mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-21 00:21:27 +00:00
All API errors now return a consistent JSON shape:
{"errors": [{"status": "4xx", "title": "...", "detail": "..."}]}
Introduces ApiError type with IntoResponse impl, replaces bare
StatusCode returns and ad-hoc {"error": "..."} responses in all
handlers and auth extractors. Updates OpenAPI spec and regenerates
TypeScript client.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
329 lines
14 KiB
TypeScript
329 lines
14 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* Arc Run API
|
|
* HTTP API for managing Arc 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 { RunListItem } from '../models';
|
|
// @ts-ignore
|
|
import type { StartRunResponse } from '../models';
|
|
// @ts-ignore
|
|
import type { WorkflowDetail } from '../models';
|
|
// @ts-ignore
|
|
import type { WorkflowListItem } from '../models';
|
|
/**
|
|
* WorkflowsApi - axios parameter creator
|
|
*/
|
|
export const WorkflowsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
*
|
|
* @summary List Workflow Runs
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listWorkflowRuns: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'name' is not null or undefined
|
|
assertParamExists('listWorkflowRuns', 'name', name)
|
|
const localVarPath = `/workflows/{name}/runs`
|
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
|
// 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;
|
|
|
|
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,
|
|
};
|
|
},
|
|
/**
|
|
*
|
|
* @summary List Workflows
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listWorkflows: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
const localVarPath = `/workflows`;
|
|
// 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;
|
|
|
|
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,
|
|
};
|
|
},
|
|
/**
|
|
*
|
|
* @summary Retrieve Workflow
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
retrieveWorkflow: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'name' is not null or undefined
|
|
assertParamExists('retrieveWorkflow', 'name', name)
|
|
const localVarPath = `/workflows/{name}`
|
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
|
// 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;
|
|
|
|
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,
|
|
};
|
|
},
|
|
/**
|
|
*
|
|
* @summary Start Workflow Run
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
startWorkflowRun: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'name' is not null or undefined
|
|
assertParamExists('startWorkflowRun', 'name', name)
|
|
const localVarPath = `/workflows/{name}/runs`
|
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
|
// 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: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
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,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* WorkflowsApi - functional programming interface
|
|
*/
|
|
export const WorkflowsApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = WorkflowsApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary List Workflow Runs
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async listWorkflowRuns(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<RunListItem>>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listWorkflowRuns(name, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.listWorkflowRuns']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
*
|
|
* @summary List Workflows
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async listWorkflows(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<WorkflowListItem>>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listWorkflows(options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.listWorkflows']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
*
|
|
* @summary Retrieve Workflow
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async retrieveWorkflow(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WorkflowDetail>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveWorkflow(name, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.retrieveWorkflow']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
*
|
|
* @summary Start Workflow Run
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async startWorkflowRun(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StartRunResponse>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.startWorkflowRun(name, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['WorkflowsApi.startWorkflowRun']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* WorkflowsApi - factory interface
|
|
*/
|
|
export const WorkflowsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = WorkflowsApiFp(configuration)
|
|
return {
|
|
/**
|
|
*
|
|
* @summary List Workflow Runs
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listWorkflowRuns(name: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<RunListItem>> {
|
|
return localVarFp.listWorkflowRuns(name, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
*
|
|
* @summary List Workflows
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
listWorkflows(options?: RawAxiosRequestConfig): AxiosPromise<Array<WorkflowListItem>> {
|
|
return localVarFp.listWorkflows(options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
*
|
|
* @summary Retrieve Workflow
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
retrieveWorkflow(name: string, options?: RawAxiosRequestConfig): AxiosPromise<WorkflowDetail> {
|
|
return localVarFp.retrieveWorkflow(name, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
*
|
|
* @summary Start Workflow Run
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
startWorkflowRun(name: string, options?: RawAxiosRequestConfig): AxiosPromise<StartRunResponse> {
|
|
return localVarFp.startWorkflowRun(name, options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* WorkflowsApi - object-oriented interface
|
|
*/
|
|
export class WorkflowsApi extends BaseAPI {
|
|
/**
|
|
*
|
|
* @summary List Workflow Runs
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public listWorkflowRuns(name: string, options?: RawAxiosRequestConfig) {
|
|
return WorkflowsApiFp(this.configuration).listWorkflowRuns(name, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary List Workflows
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public listWorkflows(options?: RawAxiosRequestConfig) {
|
|
return WorkflowsApiFp(this.configuration).listWorkflows(options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Retrieve Workflow
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public retrieveWorkflow(name: string, options?: RawAxiosRequestConfig) {
|
|
return WorkflowsApiFp(this.configuration).retrieveWorkflow(name, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Start Workflow Run
|
|
* @param {string} name
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
public startWorkflowRun(name: string, options?: RawAxiosRequestConfig) {
|
|
return WorkflowsApiFp(this.configuration).startWorkflowRun(name, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|