mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-08 03:10:26 +00:00
`bun run generate` (openapi-generator typescript-axios) emits trailing spaces and extra blank lines, so every regeneration produced a noisy whitespace diff that masked real spec/client drift. Add a normalize-generated.ts post-generation pass that strips trailing whitespace and ends each file with exactly one newline, and chain it into the `generate` script. Establishes the normalized baseline across the generated client; running `generate` twice now yields no diff. No content changes — the entire diff is whitespace. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
338 lines
23 KiB
TypeScript
Generated
338 lines
23 KiB
TypeScript
Generated
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* Fabro Run API
|
|
* HTTP API for managing Fabro workflow run executions.
|
|
*
|
|
* The version of the OpenAPI document: 0.1.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import type { Configuration } from '../configuration';
|
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
import globalAxios from 'axios';
|
|
// Some imports not used depending on template conditions
|
|
// @ts-ignore
|
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
|
// @ts-ignore
|
|
import type { ErrorResponse } from '../models';
|
|
// @ts-ignore
|
|
import type { PaginatedRunCommitList } from '../models';
|
|
// @ts-ignore
|
|
import type { PaginatedRunFileList } from '../models';
|
|
// @ts-ignore
|
|
import type { RunBilling } from '../models';
|
|
/**
|
|
* RunOutputsApi - axios parameter creator
|
|
*/
|
|
export const RunOutputsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
* Returns commits on the run branch since the run\'s base SHA, sourced directly from sandbox Git. The list uses first-parent chronological history and is capped by `limit` (default and maximum: 100). Commit data is Git-authoritative; Fabro-generated commit messages are not required for correctness.
|
|
* @summary List Run Commits
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [limit] Maximum number of commits to return. Defaults to 100 and is capped at 100.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listRunCommits: async (id: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'id' is not null or undefined
|
|
assertParamExists('listRunCommits', 'id', id)
|
|
const localVarPath = `/api/v1/runs/{id}/commits`
|
|
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
// authentication SessionCookie required
|
|
|
|
// authentication BearerAuth required
|
|
// http bearer authentication required
|
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameter['limit'] = limit;
|
|
}
|
|
|
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
/**
|
|
* Returns the set of file changes produced by a run as a list of before/after diffs. While the run\'s sandbox is reachable, diffs are resolved live against the sandbox working tree at the current HEAD. Degraded responses keep the same `data: FileDiff[]` shape. File contents are null on every entry; non-sensitive non-flagged entries include `unified_patch`, while sensitive / binary / symlink / submodule / truncated entries render through the same placeholder flags used by the live path. Responses are bounded by per-file (256 KiB / 20k lines), per-run aggregate (5 MiB), and per-request (200 files) caps. Files exceeding a cap are returned with `truncated: true` and empty `contents`. Sensitive paths (credentials, keys) are elided with `sensitive: true` and empty `contents`.
|
|
* @summary List Run Files Changed
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [pageLimit] Maximum number of items to return per page.
|
|
* @param {number} [pageOffset] Number of items to skip before returning results.
|
|
* @param {ListRunFilesScopeEnum} [scope] Diff scope to return. Defaults to committed changes only. Sandbox-backed responses honor all scopes for tracked files; untracked files are excluded. Final-patch fallback responses always represent the stored committed/final diff.
|
|
* @param {string} [fromSha] Explicit start SHA for a commit-range diff. Must be supplied together with `to_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {string} [toSha] Explicit end SHA for a commit-range diff. Must be supplied together with `from_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listRunFiles: async (id: string, pageLimit?: number, pageOffset?: number, scope?: ListRunFilesScopeEnum, fromSha?: string, toSha?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'id' is not null or undefined
|
|
assertParamExists('listRunFiles', 'id', id)
|
|
const localVarPath = `/api/v1/runs/{id}/files`
|
|
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
// authentication SessionCookie required
|
|
|
|
// authentication BearerAuth required
|
|
// http bearer authentication required
|
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
|
|
if (pageLimit !== undefined) {
|
|
localVarQueryParameter['page[limit]'] = pageLimit;
|
|
}
|
|
|
|
if (pageOffset !== undefined) {
|
|
localVarQueryParameter['page[offset]'] = pageOffset;
|
|
}
|
|
|
|
if (scope !== undefined) {
|
|
localVarQueryParameter['scope'] = scope;
|
|
}
|
|
|
|
if (fromSha !== undefined) {
|
|
localVarQueryParameter['from_sha'] = fromSha;
|
|
}
|
|
|
|
if (toSha !== undefined) {
|
|
localVarQueryParameter['to_sha'] = toSha;
|
|
}
|
|
|
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
/**
|
|
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
|
* @summary Retrieve Run Billing
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
retrieveRunBilling: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'id' is not null or undefined
|
|
assertParamExists('retrieveRunBilling', 'id', id)
|
|
const localVarPath = `/api/v1/runs/{id}/billing`
|
|
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
// authentication SessionCookie required
|
|
|
|
// authentication BearerAuth required
|
|
// http bearer authentication required
|
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
|
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* RunOutputsApi - functional programming interface
|
|
*/
|
|
export const RunOutputsApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = RunOutputsApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
* Returns commits on the run branch since the run\'s base SHA, sourced directly from sandbox Git. The list uses first-parent chronological history and is capped by `limit` (default and maximum: 100). Commit data is Git-authoritative; Fabro-generated commit messages are not required for correctness.
|
|
* @summary List Run Commits
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [limit] Maximum number of commits to return. Defaults to 100 and is capped at 100.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async listRunCommits(id: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedRunCommitList>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listRunCommits(id, limit, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['RunOutputsApi.listRunCommits']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
* Returns the set of file changes produced by a run as a list of before/after diffs. While the run\'s sandbox is reachable, diffs are resolved live against the sandbox working tree at the current HEAD. Degraded responses keep the same `data: FileDiff[]` shape. File contents are null on every entry; non-sensitive non-flagged entries include `unified_patch`, while sensitive / binary / symlink / submodule / truncated entries render through the same placeholder flags used by the live path. Responses are bounded by per-file (256 KiB / 20k lines), per-run aggregate (5 MiB), and per-request (200 files) caps. Files exceeding a cap are returned with `truncated: true` and empty `contents`. Sensitive paths (credentials, keys) are elided with `sensitive: true` and empty `contents`.
|
|
* @summary List Run Files Changed
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [pageLimit] Maximum number of items to return per page.
|
|
* @param {number} [pageOffset] Number of items to skip before returning results.
|
|
* @param {ListRunFilesScopeEnum} [scope] Diff scope to return. Defaults to committed changes only. Sandbox-backed responses honor all scopes for tracked files; untracked files are excluded. Final-patch fallback responses always represent the stored committed/final diff.
|
|
* @param {string} [fromSha] Explicit start SHA for a commit-range diff. Must be supplied together with `to_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {string} [toSha] Explicit end SHA for a commit-range diff. Must be supplied together with `from_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async listRunFiles(id: string, pageLimit?: number, pageOffset?: number, scope?: ListRunFilesScopeEnum, fromSha?: string, toSha?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedRunFileList>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listRunFiles(id, pageLimit, pageOffset, scope, fromSha, toSha, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['RunOutputsApi.listRunFiles']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
|
* @summary Retrieve Run Billing
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async retrieveRunBilling(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RunBilling>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunBilling(id, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['RunOutputsApi.retrieveRunBilling']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* RunOutputsApi - factory interface
|
|
*/
|
|
export const RunOutputsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = RunOutputsApiFp(configuration)
|
|
return {
|
|
/**
|
|
* Returns commits on the run branch since the run\'s base SHA, sourced directly from sandbox Git. The list uses first-parent chronological history and is capped by `limit` (default and maximum: 100). Commit data is Git-authoritative; Fabro-generated commit messages are not required for correctness.
|
|
* @summary List Run Commits
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [limit] Maximum number of commits to return. Defaults to 100 and is capped at 100.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listRunCommits(id: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<PaginatedRunCommitList> {
|
|
return localVarFp.listRunCommits(id, limit, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
* Returns the set of file changes produced by a run as a list of before/after diffs. While the run\'s sandbox is reachable, diffs are resolved live against the sandbox working tree at the current HEAD. Degraded responses keep the same `data: FileDiff[]` shape. File contents are null on every entry; non-sensitive non-flagged entries include `unified_patch`, while sensitive / binary / symlink / submodule / truncated entries render through the same placeholder flags used by the live path. Responses are bounded by per-file (256 KiB / 20k lines), per-run aggregate (5 MiB), and per-request (200 files) caps. Files exceeding a cap are returned with `truncated: true` and empty `contents`. Sensitive paths (credentials, keys) are elided with `sensitive: true` and empty `contents`.
|
|
* @summary List Run Files Changed
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [pageLimit] Maximum number of items to return per page.
|
|
* @param {number} [pageOffset] Number of items to skip before returning results.
|
|
* @param {ListRunFilesScopeEnum} [scope] Diff scope to return. Defaults to committed changes only. Sandbox-backed responses honor all scopes for tracked files; untracked files are excluded. Final-patch fallback responses always represent the stored committed/final diff.
|
|
* @param {string} [fromSha] Explicit start SHA for a commit-range diff. Must be supplied together with `to_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {string} [toSha] Explicit end SHA for a commit-range diff. Must be supplied together with `from_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listRunFiles(id: string, pageLimit?: number, pageOffset?: number, scope?: ListRunFilesScopeEnum, fromSha?: string, toSha?: string, options?: RawAxiosRequestConfig): AxiosPromise<PaginatedRunFileList> {
|
|
return localVarFp.listRunFiles(id, pageLimit, pageOffset, scope, fromSha, toSha, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
|
* @summary Retrieve Run Billing
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
retrieveRunBilling(id: string, options?: RawAxiosRequestConfig): AxiosPromise<RunBilling> {
|
|
return localVarFp.retrieveRunBilling(id, options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* RunOutputsApi - object-oriented interface
|
|
*/
|
|
export class RunOutputsApi extends BaseAPI {
|
|
/**
|
|
* Returns commits on the run branch since the run\'s base SHA, sourced directly from sandbox Git. The list uses first-parent chronological history and is capped by `limit` (default and maximum: 100). Commit data is Git-authoritative; Fabro-generated commit messages are not required for correctness.
|
|
* @summary List Run Commits
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [limit] Maximum number of commits to return. Defaults to 100 and is capped at 100.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public listRunCommits(id: string, limit?: number, options?: RawAxiosRequestConfig) {
|
|
return RunOutputsApiFp(this.configuration).listRunCommits(id, limit, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
* Returns the set of file changes produced by a run as a list of before/after diffs. While the run\'s sandbox is reachable, diffs are resolved live against the sandbox working tree at the current HEAD. Degraded responses keep the same `data: FileDiff[]` shape. File contents are null on every entry; non-sensitive non-flagged entries include `unified_patch`, while sensitive / binary / symlink / submodule / truncated entries render through the same placeholder flags used by the live path. Responses are bounded by per-file (256 KiB / 20k lines), per-run aggregate (5 MiB), and per-request (200 files) caps. Files exceeding a cap are returned with `truncated: true` and empty `contents`. Sensitive paths (credentials, keys) are elided with `sensitive: true` and empty `contents`.
|
|
* @summary List Run Files Changed
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {number} [pageLimit] Maximum number of items to return per page.
|
|
* @param {number} [pageOffset] Number of items to skip before returning results.
|
|
* @param {ListRunFilesScopeEnum} [scope] Diff scope to return. Defaults to committed changes only. Sandbox-backed responses honor all scopes for tracked files; untracked files are excluded. Final-patch fallback responses always represent the stored committed/final diff.
|
|
* @param {string} [fromSha] Explicit start SHA for a commit-range diff. Must be supplied together with `to_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {string} [toSha] Explicit end SHA for a commit-range diff. Must be supplied together with `from_sha`; when present, `scope` must be omitted and the response scope is `range`.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public listRunFiles(id: string, pageLimit?: number, pageOffset?: number, scope?: ListRunFilesScopeEnum, fromSha?: string, toSha?: string, options?: RawAxiosRequestConfig) {
|
|
return RunOutputsApiFp(this.configuration).listRunFiles(id, pageLimit, pageOffset, scope, fromSha, toSha, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
|
* @summary Retrieve Run Billing
|
|
* @param {string} id Unique run identifier (ULID).
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public retrieveRunBilling(id: string, options?: RawAxiosRequestConfig) {
|
|
return RunOutputsApiFp(this.configuration).retrieveRunBilling(id, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|
|
export const ListRunFilesScopeEnum = {
|
|
COMMITTED: 'committed',
|
|
UNCOMMITTED: 'uncommitted',
|
|
ALL: 'all'
|
|
} as const;
|
|
export type ListRunFilesScopeEnum = typeof ListRunFilesScopeEnum[keyof typeof ListRunFilesScopeEnum];
|