diff --git a/cli/.gitignore b/cli/.gitignore index d0b1f2c514d16..409ee189ef2da 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -1,2 +1 @@ npm/ -gen/ \ No newline at end of file diff --git a/cli/gen/core/ApiError.ts b/cli/gen/core/ApiError.ts new file mode 100644 index 0000000000000..81aa78a668c0e --- /dev/null +++ b/cli/gen/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; +import type { ApiResult } from './ApiResult.ts'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/cli/gen/core/ApiRequestOptions.ts b/cli/gen/core/ApiRequestOptions.ts new file mode 100644 index 0000000000000..939a0aa4c8b25 --- /dev/null +++ b/cli/gen/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/cli/gen/core/ApiResult.ts b/cli/gen/core/ApiResult.ts new file mode 100644 index 0000000000000..4c58e391382b1 --- /dev/null +++ b/cli/gen/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/cli/gen/core/CancelablePromise.ts b/cli/gen/core/CancelablePromise.ts new file mode 100644 index 0000000000000..ccc082e8f2a32 --- /dev/null +++ b/cli/gen/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/cli/gen/core/OpenAPI.ts b/cli/gen/core/OpenAPI.ts new file mode 100644 index 0000000000000..88e02785eea55 --- /dev/null +++ b/cli/gen/core/OpenAPI.ts @@ -0,0 +1,63 @@ +const getEnv = (key: string) => { + return Deno.env.get(key) +}; + +const baseUrl = getEnv("BASE_INTERNAL_URL") ?? getEnv("BASE_URL") ?? "http://localhost:8000"; +const baseUrlApi = (baseUrl ?? '') + "/api"; + +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: baseUrlApi, + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: getEnv("WM_TOKEN"), + USERNAME: undefined, + VERSION: '1.398.1', + WITH_CREDENTIALS: true, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/cli/gen/core/request.ts b/cli/gen/core/request.ts new file mode 100644 index 0000000000000..ed11eb44822eb --- /dev/null +++ b/cli/gen/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError.ts'; +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; +import type { ApiResult } from './ApiResult.ts'; +import { CancelablePromise } from './CancelablePromise.ts'; +import type { OnCancel } from './CancelablePromise.ts'; +import type { OpenAPIConfig } from './OpenAPI.ts'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/cli/gen/index.ts b/cli/gen/index.ts new file mode 100644 index 0000000000000..77b08aeebb3e7 --- /dev/null +++ b/cli/gen/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError.ts'; +export { CancelablePromise, CancelError } from './core/CancelablePromise.ts'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI.ts'; +export * from './services.gen.ts'; +export * from './types.gen.ts'; \ No newline at end of file diff --git a/cli/gen/services.gen.ts b/cli/gen/services.gen.ts new file mode 100644 index 0000000000000..9894d6de36c55 --- /dev/null +++ b/cli/gen/services.gen.ts @@ -0,0 +1,6616 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise.ts'; +import { OpenAPI } from './core/OpenAPI.ts'; +import { request as __request } from './core/request.ts'; +import type { BackendVersionResponse, BackendUptodateResponse, GetLicenseIdResponse, GetOpenApiYamlResponse, GetAuditLogData, GetAuditLogResponse, ListAuditLogsData, ListAuditLogsResponse, LoginData, LoginResponse, LogoutResponse, GetUserData, GetUserResponse, UpdateUserData, UpdateUserResponse, IsOwnerOfPathData, IsOwnerOfPathResponse, SetPasswordData, SetPasswordResponse, CreateUserGloballyData, CreateUserGloballyResponse, GlobalUserUpdateData, GlobalUserUpdateResponse, GlobalUsernameInfoData, GlobalUsernameInfoResponse, GlobalUserRenameData, GlobalUserRenameResponse, GlobalUserDeleteData, GlobalUserDeleteResponse, GlobalUsersOverwriteData, GlobalUsersOverwriteResponse, GlobalUsersExportResponse, DeleteUserData, DeleteUserResponse, ListWorkspacesResponse, IsDomainAllowedResponse, ListUserWorkspacesResponse, ListWorkspacesAsSuperAdminData, ListWorkspacesAsSuperAdminResponse, CreateWorkspaceData, CreateWorkspaceResponse, ExistsWorkspaceData, ExistsWorkspaceResponse, ExistsUsernameData, ExistsUsernameResponse, GetGlobalData, GetGlobalResponse, SetGlobalData, SetGlobalResponse, GetLocalResponse, TestSmtpData, TestSmtpResponse, TestCriticalChannelsData, TestCriticalChannelsResponse, TestLicenseKeyData, TestLicenseKeyResponse, TestObjectStorageConfigData, TestObjectStorageConfigResponse, SendStatsResponse, GetLatestKeyRenewalAttemptResponse, RenewLicenseKeyData, RenewLicenseKeyResponse, CreateCustomerPortalSessionData, CreateCustomerPortalSessionResponse, TestMetadataData, TestMetadataResponse, ListGlobalSettingsResponse, GetCurrentEmailResponse, RefreshUserTokenResponse, GetTutorialProgressResponse, UpdateTutorialProgressData, UpdateTutorialProgressResponse, LeaveInstanceResponse, GetUsageResponse, GetRunnableResponse, GlobalWhoamiResponse, ListWorkspaceInvitesResponse, WhoamiData, WhoamiResponse, AcceptInviteData, AcceptInviteResponse, DeclineInviteData, DeclineInviteResponse, InviteUserData, InviteUserResponse, AddUserData, AddUserResponse, DeleteInviteData, DeleteInviteResponse, ArchiveWorkspaceData, ArchiveWorkspaceResponse, UnarchiveWorkspaceData, UnarchiveWorkspaceResponse, DeleteWorkspaceData, DeleteWorkspaceResponse, LeaveWorkspaceData, LeaveWorkspaceResponse, GetWorkspaceNameData, GetWorkspaceNameResponse, ChangeWorkspaceNameData, ChangeWorkspaceNameResponse, ChangeWorkspaceIdData, ChangeWorkspaceIdResponse, WhoisData, WhoisResponse, ExistsEmailData, ExistsEmailResponse, ListUsersAsSuperAdminData, ListUsersAsSuperAdminResponse, ListPendingInvitesData, ListPendingInvitesResponse, GetSettingsData, GetSettingsResponse, GetDeployToData, GetDeployToResponse, GetIsPremiumData, GetIsPremiumResponse, GetPremiumInfoData, GetPremiumInfoResponse, SetAutomaticBillingData, SetAutomaticBillingResponse, EditSlackCommandData, EditSlackCommandResponse, RunSlackMessageTestJobData, RunSlackMessageTestJobResponse, EditDeployToData, EditDeployToResponse, EditAutoInviteData, EditAutoInviteResponse, EditWebhookData, EditWebhookResponse, EditCopilotConfigData, EditCopilotConfigResponse, GetCopilotInfoData, GetCopilotInfoResponse, EditErrorHandlerData, EditErrorHandlerResponse, EditLargeFileStorageConfigData, EditLargeFileStorageConfigResponse, EditWorkspaceGitSyncConfigData, EditWorkspaceGitSyncConfigResponse, EditWorkspaceDeployUiSettingsData, EditWorkspaceDeployUiSettingsResponse, EditWorkspaceDefaultAppData, EditWorkspaceDefaultAppResponse, EditDefaultScriptsData, EditDefaultScriptsResponse, GetDefaultScriptsData, GetDefaultScriptsResponse, SetEnvironmentVariableData, SetEnvironmentVariableResponse, GetWorkspaceEncryptionKeyData, GetWorkspaceEncryptionKeyResponse, SetWorkspaceEncryptionKeyData, SetWorkspaceEncryptionKeyResponse, GetWorkspaceDefaultAppData, GetWorkspaceDefaultAppResponse, GetLargeFileStorageConfigData, GetLargeFileStorageConfigResponse, GetWorkspaceUsageData, GetWorkspaceUsageResponse, ListUsersData, ListUsersResponse, ListUsersUsageData, ListUsersUsageResponse, ListUsernamesData, ListUsernamesResponse, UsernameToEmailData, UsernameToEmailResponse, CreateTokenData, CreateTokenResponse, CreateTokenImpersonateData, CreateTokenImpersonateResponse, DeleteTokenData, DeleteTokenResponse, ListTokensData, ListTokensResponse, GetOidcTokenData, GetOidcTokenResponse, CreateVariableData, CreateVariableResponse, EncryptValueData, EncryptValueResponse, DeleteVariableData, DeleteVariableResponse, UpdateVariableData, UpdateVariableResponse, GetVariableData, GetVariableResponse, GetVariableValueData, GetVariableValueResponse, ExistsVariableData, ExistsVariableResponse, ListVariableData, ListVariableResponse, ListContextualVariablesData, ListContextualVariablesResponse, LoginWithOauthData, LoginWithOauthResponse, ConnectSlackCallbackData, ConnectSlackCallbackResponse, ConnectSlackCallbackInstanceData, ConnectSlackCallbackInstanceResponse, ConnectCallbackData, ConnectCallbackResponse, CreateAccountData, CreateAccountResponse, RefreshTokenData, RefreshTokenResponse, DisconnectAccountData, DisconnectAccountResponse, DisconnectSlackData, DisconnectSlackResponse, ListOauthLoginsResponse, ListOauthConnectsResponse, GetOauthConnectData, GetOauthConnectResponse, CreateResourceData, CreateResourceResponse, DeleteResourceData, DeleteResourceResponse, UpdateResourceData, UpdateResourceResponse, UpdateResourceValueData, UpdateResourceValueResponse, GetResourceData, GetResourceResponse, GetResourceValueInterpolatedData, GetResourceValueInterpolatedResponse, GetResourceValueData, GetResourceValueResponse, ExistsResourceData, ExistsResourceResponse, ListResourceData, ListResourceResponse, ListSearchResourceData, ListSearchResourceResponse, ListResourceNamesData, ListResourceNamesResponse, CreateResourceTypeData, CreateResourceTypeResponse, FileResourceTypeToFileExtMapData, FileResourceTypeToFileExtMapResponse, DeleteResourceTypeData, DeleteResourceTypeResponse, UpdateResourceTypeData, UpdateResourceTypeResponse, GetResourceTypeData, GetResourceTypeResponse, ExistsResourceTypeData, ExistsResourceTypeResponse, ListResourceTypeData, ListResourceTypeResponse, ListResourceTypeNamesData, ListResourceTypeNamesResponse, QueryResourceTypesData, QueryResourceTypesResponse, ListHubIntegrationsData, ListHubIntegrationsResponse, ListHubFlowsResponse, GetHubFlowByIdData, GetHubFlowByIdResponse, ListHubAppsResponse, GetHubAppByIdData, GetHubAppByIdResponse, GetHubScriptContentByPathData, GetHubScriptContentByPathResponse, GetHubScriptByPathData, GetHubScriptByPathResponse, GetTopHubScriptsData, GetTopHubScriptsResponse, QueryHubScriptsData, QueryHubScriptsResponse, ListSearchScriptData, ListSearchScriptResponse, ListScriptsData, ListScriptsResponse, ListScriptPathsData, ListScriptPathsResponse, CreateDraftData, CreateDraftResponse, DeleteDraftData, DeleteDraftResponse, CreateScriptData, CreateScriptResponse, ToggleWorkspaceErrorHandlerForScriptData, ToggleWorkspaceErrorHandlerForScriptResponse, GetCustomTagsResponse, GeDefaultTagsResponse, IsDefaultTagsPerWorkspaceResponse, ArchiveScriptByPathData, ArchiveScriptByPathResponse, ArchiveScriptByHashData, ArchiveScriptByHashResponse, DeleteScriptByHashData, DeleteScriptByHashResponse, DeleteScriptByPathData, DeleteScriptByPathResponse, GetScriptByPathData, GetScriptByPathResponse, GetScriptByPathWithDraftData, GetScriptByPathWithDraftResponse, GetScriptHistoryByPathData, GetScriptHistoryByPathResponse, UpdateScriptHistoryData, UpdateScriptHistoryResponse, RawScriptByPathData, RawScriptByPathResponse, RawScriptByPathTokenedData, RawScriptByPathTokenedResponse, ExistsScriptByPathData, ExistsScriptByPathResponse, GetScriptByHashData, GetScriptByHashResponse, RawScriptByHashData, RawScriptByHashResponse, GetScriptDeploymentStatusData, GetScriptDeploymentStatusResponse, RunScriptByPathData, RunScriptByPathResponse, OpenaiSyncScriptByPathData, OpenaiSyncScriptByPathResponse, RunWaitResultScriptByPathData, RunWaitResultScriptByPathResponse, RunWaitResultScriptByPathGetData, RunWaitResultScriptByPathGetResponse, OpenaiSyncFlowByPathData, OpenaiSyncFlowByPathResponse, RunWaitResultFlowByPathData, RunWaitResultFlowByPathResponse, ResultByIdData, ResultByIdResponse, ListFlowPathsData, ListFlowPathsResponse, ListSearchFlowData, ListSearchFlowResponse, ListFlowsData, ListFlowsResponse, GetFlowHistoryData, GetFlowHistoryResponse, GetFlowVersionData, GetFlowVersionResponse, UpdateFlowHistoryData, UpdateFlowHistoryResponse, GetFlowByPathData, GetFlowByPathResponse, ToggleWorkspaceErrorHandlerForFlowData, ToggleWorkspaceErrorHandlerForFlowResponse, GetFlowByPathWithDraftData, GetFlowByPathWithDraftResponse, ExistsFlowByPathData, ExistsFlowByPathResponse, CreateFlowData, CreateFlowResponse, UpdateFlowData, UpdateFlowResponse, ArchiveFlowByPathData, ArchiveFlowByPathResponse, DeleteFlowByPathData, DeleteFlowByPathResponse, ListRawAppsData, ListRawAppsResponse, ExistsRawAppData, ExistsRawAppResponse, GetRawAppDataData, GetRawAppDataResponse, ListSearchAppData, ListSearchAppResponse, ListAppsData, ListAppsResponse, CreateAppData, CreateAppResponse, ExistsAppData, ExistsAppResponse, GetAppByPathData, GetAppByPathResponse, GetAppByPathWithDraftData, GetAppByPathWithDraftResponse, GetAppHistoryByPathData, GetAppHistoryByPathResponse, UpdateAppHistoryData, UpdateAppHistoryResponse, GetPublicAppBySecretData, GetPublicAppBySecretResponse, GetPublicResourceData, GetPublicResourceResponse, GetPublicSecretOfAppData, GetPublicSecretOfAppResponse, GetAppByVersionData, GetAppByVersionResponse, CreateRawAppData, CreateRawAppResponse, UpdateRawAppData, UpdateRawAppResponse, DeleteRawAppData, DeleteRawAppResponse, DeleteAppData, DeleteAppResponse, UpdateAppData, UpdateAppResponse, ExecuteComponentData, ExecuteComponentResponse, RunFlowByPathData, RunFlowByPathResponse, RestartFlowAtStepData, RestartFlowAtStepResponse, RunScriptByHashData, RunScriptByHashResponse, RunScriptPreviewData, RunScriptPreviewResponse, RunCodeWorkflowTaskData, RunCodeWorkflowTaskResponse, RunRawScriptDependenciesData, RunRawScriptDependenciesResponse, RunFlowPreviewData, RunFlowPreviewResponse, ListQueueData, ListQueueResponse, GetQueueCountData, GetQueueCountResponse, GetCompletedCountData, GetCompletedCountResponse, ListFilteredUuidsData, ListFilteredUuidsResponse, CancelSelectionData, CancelSelectionResponse, ListCompletedJobsData, ListCompletedJobsResponse, ListJobsData, ListJobsResponse, GetDbClockResponse, GetJobData, GetJobResponse, GetRootJobIdData, GetRootJobIdResponse, GetJobLogsData, GetJobLogsResponse, GetJobArgsData, GetJobArgsResponse, GetJobUpdatesData, GetJobUpdatesResponse, GetLogFileFromStoreData, GetLogFileFromStoreResponse, GetFlowDebugInfoData, GetFlowDebugInfoResponse, GetCompletedJobData, GetCompletedJobResponse, GetCompletedJobResultData, GetCompletedJobResultResponse, GetCompletedJobResultMaybeData, GetCompletedJobResultMaybeResponse, DeleteCompletedJobData, DeleteCompletedJobResponse, CancelQueuedJobData, CancelQueuedJobResponse, CancelPersistentQueuedJobsData, CancelPersistentQueuedJobsResponse, ForceCancelQueuedJobData, ForceCancelQueuedJobResponse, CreateJobSignatureData, CreateJobSignatureResponse, GetResumeUrlsData, GetResumeUrlsResponse, ResumeSuspendedJobGetData, ResumeSuspendedJobGetResponse, ResumeSuspendedJobPostData, ResumeSuspendedJobPostResponse, SetFlowUserStateData, SetFlowUserStateResponse, GetFlowUserStateData, GetFlowUserStateResponse, ResumeSuspendedFlowAsOwnerData, ResumeSuspendedFlowAsOwnerResponse, CancelSuspendedJobGetData, CancelSuspendedJobGetResponse, CancelSuspendedJobPostData, CancelSuspendedJobPostResponse, GetSuspendedJobFlowData, GetSuspendedJobFlowResponse, PreviewScheduleData, PreviewScheduleResponse, CreateScheduleData, CreateScheduleResponse, UpdateScheduleData, UpdateScheduleResponse, SetScheduleEnabledData, SetScheduleEnabledResponse, DeleteScheduleData, DeleteScheduleResponse, GetScheduleData, GetScheduleResponse, ExistsScheduleData, ExistsScheduleResponse, ListSchedulesData, ListSchedulesResponse, ListSchedulesWithJobsData, ListSchedulesWithJobsResponse, SetDefaultErrorOrRecoveryHandlerData, SetDefaultErrorOrRecoveryHandlerResponse, CreateHttpTriggerData, CreateHttpTriggerResponse, UpdateHttpTriggerData, UpdateHttpTriggerResponse, DeleteHttpTriggerData, DeleteHttpTriggerResponse, GetHttpTriggerData, GetHttpTriggerResponse, ListHttpTriggersData, ListHttpTriggersResponse, ExistsHttpTriggerData, ExistsHttpTriggerResponse, ExistsRouteData, ExistsRouteResponse, UsedData, UsedResponse, ListInstanceGroupsResponse, GetInstanceGroupData, GetInstanceGroupResponse, CreateInstanceGroupData, CreateInstanceGroupResponse, UpdateInstanceGroupData, UpdateInstanceGroupResponse, DeleteInstanceGroupData, DeleteInstanceGroupResponse, AddUserToInstanceGroupData, AddUserToInstanceGroupResponse, RemoveUserFromInstanceGroupData, RemoveUserFromInstanceGroupResponse, ExportInstanceGroupsResponse, OverwriteInstanceGroupsData, OverwriteInstanceGroupsResponse, ListGroupsData, ListGroupsResponse, ListGroupNamesData, ListGroupNamesResponse, CreateGroupData, CreateGroupResponse, UpdateGroupData, UpdateGroupResponse, DeleteGroupData, DeleteGroupResponse, GetGroupData, GetGroupResponse, AddUserToGroupData, AddUserToGroupResponse, RemoveUserToGroupData, RemoveUserToGroupResponse, ListFoldersData, ListFoldersResponse, ListFolderNamesData, ListFolderNamesResponse, CreateFolderData, CreateFolderResponse, UpdateFolderData, UpdateFolderResponse, DeleteFolderData, DeleteFolderResponse, GetFolderData, GetFolderResponse, GetFolderUsageData, GetFolderUsageResponse, AddOwnerToFolderData, AddOwnerToFolderResponse, RemoveOwnerToFolderData, RemoveOwnerToFolderResponse, ListWorkersData, ListWorkersResponse, ExistsWorkerWithTagData, ExistsWorkerWithTagResponse, GetQueueMetricsResponse, ListWorkerGroupsResponse, GetConfigData, GetConfigResponse, UpdateConfigData, UpdateConfigResponse, DeleteConfigData, DeleteConfigResponse, ListConfigsResponse, GetGranularAclsData, GetGranularAclsResponse, AddGranularAclsData, AddGranularAclsResponse, RemoveGranularAclsData, RemoveGranularAclsResponse, UpdateCaptureData, UpdateCaptureResponse, CreateCaptureData, CreateCaptureResponse, GetCaptureData, GetCaptureResponse, StarData, StarResponse, UnstarData, UnstarResponse, GetInputHistoryData, GetInputHistoryResponse, GetArgsFromHistoryOrSavedInputData, GetArgsFromHistoryOrSavedInputResponse, ListInputsData, ListInputsResponse, CreateInputData, CreateInputResponse, UpdateInputData, UpdateInputResponse, DeleteInputData, DeleteInputResponse, DuckdbConnectionSettingsData, DuckdbConnectionSettingsResponse, DuckdbConnectionSettingsV2Data, DuckdbConnectionSettingsV2Response, PolarsConnectionSettingsData, PolarsConnectionSettingsResponse, PolarsConnectionSettingsV2Data, PolarsConnectionSettingsV2Response, S3ResourceInfoData, S3ResourceInfoResponse, DatasetStorageTestConnectionData, DatasetStorageTestConnectionResponse, ListStoredFilesData, ListStoredFilesResponse, LoadFileMetadataData, LoadFileMetadataResponse, LoadFilePreviewData, LoadFilePreviewResponse, LoadParquetPreviewData, LoadParquetPreviewResponse, LoadTableRowCountData, LoadTableRowCountResponse, LoadCsvPreviewData, LoadCsvPreviewResponse, DeleteS3FileData, DeleteS3FileResponse, MoveS3FileData, MoveS3FileResponse, FileUploadData, FileUploadResponse, FileDownloadData, FileDownloadResponse, FileDownloadParquetAsCsvData, FileDownloadParquetAsCsvResponse, GetJobMetricsData, GetJobMetricsResponse, SetJobProgressData, SetJobProgressResponse, GetJobProgressData, GetJobProgressResponse, ListLogFilesData, ListLogFilesResponse, GetLogFileData, GetLogFileResponse, ListConcurrencyGroupsResponse, DeleteConcurrencyGroupData, DeleteConcurrencyGroupResponse, GetConcurrencyKeyData, GetConcurrencyKeyResponse, ListExtendedJobsData, ListExtendedJobsResponse, SearchJobsIndexData, SearchJobsIndexResponse } from './types.gen.ts'; + +/** + * get backend version + * @returns string git version of backend + * @throws ApiError + */ +export const backendVersion = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/version' +}); }; + +/** + * is backend up to date + * @returns string is backend up to date + * @throws ApiError + */ +export const backendUptodate = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/uptodate' +}); }; + +/** + * get license id + * @returns string get license id (empty if not ee) + * @throws ApiError + */ +export const getLicenseId = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/ee_license' +}); }; + +/** + * get openapi yaml spec + * @returns string openapi yaml file content + * @throws ApiError + */ +export const getOpenApiYaml = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/openapi.yaml' +}); }; + +/** + * get audit log (requires admin privilege) + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns AuditLog an audit log + * @throws ApiError + */ +export const getAuditLog = (data: GetAuditLogData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/audit/get/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * list audit logs (requires admin privilege) + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.before filter on started before (inclusive) timestamp + * @param data.after filter on created after (exclusive) timestamp + * @param data.username filter on exact username of user + * @param data.operation filter on exact or prefix name of operation + * @param data.operations comma separated list of exact operations to include + * @param data.excludeOperations comma separated list of operations to exclude + * @param data.resource filter on exact or prefix name of resource + * @param data.actionKind filter on type of operation + * @returns AuditLog a list of audit logs + * @throws ApiError + */ +export const listAuditLogs = (data: ListAuditLogsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/audit/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + before: data.before, + after: data.after, + username: data.username, + operation: data.operation, + operations: data.operations, + exclude_operations: data.excludeOperations, + resource: data.resource, + action_kind: data.actionKind + } +}); }; + +/** + * login with password + * @param data The data for the request. + * @param data.requestBody credentials + * @returns string Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience. + * + * @throws ApiError + */ +export const login = (data: LoginData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/auth/login', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * logout + * @returns string clear cookies and clear token (if applicable) + * @throws ApiError + */ +export const logout = (): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/auth/logout' +}); }; + +/** + * get user (require admin privilege) + * @param data The data for the request. + * @param data.workspace + * @param data.username + * @returns User user created + * @throws ApiError + */ +export const getUser = (data: GetUserData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/{username}', + path: { + workspace: data.workspace, + username: data.username + } +}); }; + +/** + * update user (require admin privilege) + * @param data The data for the request. + * @param data.workspace + * @param data.username + * @param data.requestBody new user + * @returns string edited user + * @throws ApiError + */ +export const updateUser = (data: UpdateUserData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/users/update/{username}', + path: { + workspace: data.workspace, + username: data.username + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * is owner of path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean is owner + * @throws ApiError + */ +export const isOwnerOfPath = (data: IsOwnerOfPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/is_owner/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * set password + * @param data The data for the request. + * @param data.requestBody set password + * @returns string password set + * @throws ApiError + */ +export const setPassword = (data: SetPasswordData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/setpassword', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create user + * @param data The data for the request. + * @param data.requestBody user info + * @returns string user created + * @throws ApiError + */ +export const createUserGlobally = (data: CreateUserGloballyData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/create', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * global update user (require super admin) + * @param data The data for the request. + * @param data.email + * @param data.requestBody new user info + * @returns string user updated + * @throws ApiError + */ +export const globalUserUpdate = (data: GlobalUserUpdateData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/update/{email}', + path: { + email: data.email + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * global username info (require super admin) + * @param data The data for the request. + * @param data.email + * @returns unknown user renamed + * @throws ApiError + */ +export const globalUsernameInfo = (data: GlobalUsernameInfoData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/username_info/{email}', + path: { + email: data.email + } +}); }; + +/** + * global rename user (require super admin) + * @param data The data for the request. + * @param data.email + * @param data.requestBody new username + * @returns string user renamed + * @throws ApiError + */ +export const globalUserRename = (data: GlobalUserRenameData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/rename/{email}', + path: { + email: data.email + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * global delete user (require super admin) + * @param data The data for the request. + * @param data.email + * @returns string user deleted + * @throws ApiError + */ +export const globalUserDelete = (data: GlobalUserDeleteData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/users/delete/{email}', + path: { + email: data.email + } +}); }; + +/** + * global overwrite users (require super admin and EE) + * @param data The data for the request. + * @param data.requestBody List of users + * @returns string Success message + * @throws ApiError + */ +export const globalUsersOverwrite = (data: GlobalUsersOverwriteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/overwrite', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * global export users (require super admin and EE) + * @returns ExportedUser exported users + * @throws ApiError + */ +export const globalUsersExport = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/export' +}); }; + +/** + * delete user (require admin privilege) + * @param data The data for the request. + * @param data.workspace + * @param data.username + * @returns string delete user + * @throws ApiError + */ +export const deleteUser = (data: DeleteUserData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/users/delete/{username}', + path: { + workspace: data.workspace, + username: data.username + } +}); }; + +/** + * list all workspaces visible to me + * @returns Workspace all workspaces + * @throws ApiError + */ +export const listWorkspaces = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workspaces/list' +}); }; + +/** + * is domain allowed for auto invi + * @returns boolean domain allowed or not + * @throws ApiError + */ +export const isDomainAllowed = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workspaces/allowed_domain_auto_invite' +}); }; + +/** + * list all workspaces visible to me with user info + * @returns UserWorkspaceList workspace with associated username + * @throws ApiError + */ +export const listUserWorkspaces = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workspaces/users' +}); }; + +/** + * list all workspaces as super admin (require to be super admin) + * @param data The data for the request. + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns Workspace workspaces + * @throws ApiError + */ +export const listWorkspacesAsSuperAdmin = (data: ListWorkspacesAsSuperAdminData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workspaces/list_as_superadmin', + query: { + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * create workspace + * @param data The data for the request. + * @param data.requestBody new token + * @returns string token created + * @throws ApiError + */ +export const createWorkspace = (data: CreateWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/workspaces/create', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * exists workspace + * @param data The data for the request. + * @param data.requestBody id of workspace + * @returns boolean status + * @throws ApiError + */ +export const existsWorkspace = (data: ExistsWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/workspaces/exists', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * exists username + * @param data The data for the request. + * @param data.requestBody + * @returns boolean status + * @throws ApiError + */ +export const existsUsername = (data: ExistsUsernameData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/workspaces/exists_username', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get global settings + * @param data The data for the request. + * @param data.key + * @returns unknown status + * @throws ApiError + */ +export const getGlobal = (data: GetGlobalData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/settings/global/{key}', + path: { + key: data.key + } +}); }; + +/** + * post global settings + * @param data The data for the request. + * @param data.key + * @param data.requestBody value set + * @returns string status + * @throws ApiError + */ +export const setGlobal = (data: SetGlobalData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/global/{key}', + path: { + key: data.key + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get local settings + * @returns unknown status + * @throws ApiError + */ +export const getLocal = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/settings/local' +}); }; + +/** + * test smtp + * @param data The data for the request. + * @param data.requestBody test smtp payload + * @returns string status + * @throws ApiError + */ +export const testSmtp = (data: TestSmtpData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/test_smtp', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * test critical channels + * @param data The data for the request. + * @param data.requestBody test critical channel payload + * @returns string status + * @throws ApiError + */ +export const testCriticalChannels = (data: TestCriticalChannelsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/test_critical_channels', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * test license key + * @param data The data for the request. + * @param data.requestBody test license key + * @returns string status + * @throws ApiError + */ +export const testLicenseKey = (data: TestLicenseKeyData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/test_license_key', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * test object storage config + * @param data The data for the request. + * @param data.requestBody test object storage config + * @returns string status + * @throws ApiError + */ +export const testObjectStorageConfig = (data: TestObjectStorageConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/test_object_storage_config', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * send stats + * @returns string status + * @throws ApiError + */ +export const sendStats = (): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/send_stats' +}); }; + +/** + * get latest key renewal attempt + * @returns unknown status + * @throws ApiError + */ +export const getLatestKeyRenewalAttempt = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/settings/latest_key_renewal_attempt' +}); }; + +/** + * renew license key + * @param data The data for the request. + * @param data.licenseKey + * @returns string status + * @throws ApiError + */ +export const renewLicenseKey = (data: RenewLicenseKeyData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/renew_license_key', + query: { + license_key: data.licenseKey + } +}); }; + +/** + * create customer portal session + * @param data The data for the request. + * @param data.licenseKey + * @returns string url to portal + * @throws ApiError + */ +export const createCustomerPortalSession = (data: CreateCustomerPortalSessionData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/settings/customer_portal', + query: { + license_key: data.licenseKey + } +}); }; + +/** + * test metadata + * @param data The data for the request. + * @param data.requestBody test metadata + * @returns string status + * @throws ApiError + */ +export const testMetadata = (data: TestMetadataData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/saml/test_metadata', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list global settings + * @returns GlobalSetting list of settings + * @throws ApiError + */ +export const listGlobalSettings = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/settings/list_global' +}); }; + +/** + * get current user email (if logged in) + * @returns string user email + * @throws ApiError + */ +export const getCurrentEmail = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/email' +}); }; + +/** + * refresh the current token + * @returns string free usage + * @throws ApiError + */ +export const refreshUserToken = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/refresh_token' +}); }; + +/** + * get tutorial progress + * @returns unknown tutorial progress + * @throws ApiError + */ +export const getTutorialProgress = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/tutorial_progress' +}); }; + +/** + * update tutorial progress + * @param data The data for the request. + * @param data.requestBody progress update + * @returns string tutorial progress + * @throws ApiError + */ +export const updateTutorialProgress = (data: UpdateTutorialProgressData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/tutorial_progress', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * leave instance + * @returns string status + * @throws ApiError + */ +export const leaveInstance = (): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/leave_instance' +}); }; + +/** + * get current usage outside of premium workspaces + * @returns number free usage + * @throws ApiError + */ +export const getUsage = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/usage' +}); }; + +/** + * get all runnables in every workspace + * @returns unknown free all runnables + * @throws ApiError + */ +export const getRunnable = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/all_runnables' +}); }; + +/** + * get current global whoami (if logged in) + * @returns GlobalUserInfo user email + * @throws ApiError + */ +export const globalWhoami = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/whoami' +}); }; + +/** + * list all workspace invites + * @returns WorkspaceInvite list all workspace invites + * @throws ApiError + */ +export const listWorkspaceInvites = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/list_invites' +}); }; + +/** + * whoami + * @param data The data for the request. + * @param data.workspace + * @returns User user + * @throws ApiError + */ +export const whoami = (data: WhoamiData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/whoami', + path: { + workspace: data.workspace + } +}); }; + +/** + * accept invite to workspace + * @param data The data for the request. + * @param data.requestBody accept invite + * @returns string status + * @throws ApiError + */ +export const acceptInvite = (data: AcceptInviteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/accept_invite', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * decline invite to workspace + * @param data The data for the request. + * @param data.requestBody decline invite + * @returns string status + * @throws ApiError + */ +export const declineInvite = (data: DeclineInviteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/decline_invite', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * invite user to workspace + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceInvite + * @returns string status + * @throws ApiError + */ +export const inviteUser = (data: InviteUserData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/invite_user', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * add user to workspace + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceInvite + * @returns string status + * @throws ApiError + */ +export const addUser = (data: AddUserData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/add_user', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete user invite + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceInvite + * @returns string status + * @throws ApiError + */ +export const deleteInvite = (data: DeleteInviteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/delete_invite', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * archive workspace + * @param data The data for the request. + * @param data.workspace + * @returns string status + * @throws ApiError + */ +export const archiveWorkspace = (data: ArchiveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/archive', + path: { + workspace: data.workspace + } +}); }; + +/** + * unarchive workspace + * @param data The data for the request. + * @param data.workspace + * @returns string status + * @throws ApiError + */ +export const unarchiveWorkspace = (data: UnarchiveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/workspaces/unarchive/{workspace}', + path: { + workspace: data.workspace + } +}); }; + +/** + * delete workspace (require super admin) + * @param data The data for the request. + * @param data.workspace + * @returns string status + * @throws ApiError + */ +export const deleteWorkspace = (data: DeleteWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/workspaces/delete/{workspace}', + path: { + workspace: data.workspace + } +}); }; + +/** + * leave workspace + * @param data The data for the request. + * @param data.workspace + * @returns string status + * @throws ApiError + */ +export const leaveWorkspace = (data: LeaveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/leave', + path: { + workspace: data.workspace + } +}); }; + +/** + * get workspace name + * @param data The data for the request. + * @param data.workspace + * @returns string status + * @throws ApiError + */ +export const getWorkspaceName = (data: GetWorkspaceNameData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/get_workspace_name', + path: { + workspace: data.workspace + } +}); }; + +/** + * change workspace name + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns string status + * @throws ApiError + */ +export const changeWorkspaceName = (data: ChangeWorkspaceNameData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/change_workspace_name', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * change workspace id + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns string status + * @throws ApiError + */ +export const changeWorkspaceId = (data: ChangeWorkspaceIdData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/change_workspace_id', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * whois + * @param data The data for the request. + * @param data.workspace + * @param data.username + * @returns User user + * @throws ApiError + */ +export const whois = (data: WhoisData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/whois/{username}', + path: { + workspace: data.workspace, + username: data.username + } +}); }; + +/** + * exists email + * @param data The data for the request. + * @param data.email + * @returns boolean user + * @throws ApiError + */ +export const existsEmail = (data: ExistsEmailData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/exists/{email}', + path: { + email: data.email + } +}); }; + +/** + * list all users as super admin (require to be super amdin) + * @param data The data for the request. + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns GlobalUserInfo user + * @throws ApiError + */ +export const listUsersAsSuperAdmin = (data: ListUsersAsSuperAdminData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/list_as_super_admin', + query: { + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * list pending invites for a workspace + * @param data The data for the request. + * @param data.workspace + * @returns WorkspaceInvite user + * @throws ApiError + */ +export const listPendingInvites = (data: ListPendingInvitesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/list_pending_invites', + path: { + workspace: data.workspace + } +}); }; + +/** + * get settings + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getSettings = (data: GetSettingsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/get_settings', + path: { + workspace: data.workspace + } +}); }; + +/** + * get deploy to + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getDeployTo = (data: GetDeployToData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/get_deploy_to', + path: { + workspace: data.workspace + } +}); }; + +/** + * get if workspace is premium + * @param data The data for the request. + * @param data.workspace + * @returns boolean status + * @throws ApiError + */ +export const getIsPremium = (data: GetIsPremiumData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/is_premium', + path: { + workspace: data.workspace + } +}); }; + +/** + * get premium info + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getPremiumInfo = (data: GetPremiumInfoData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/premium_info', + path: { + workspace: data.workspace + } +}); }; + +/** + * set automatic billing + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody automatic billing + * @returns string status + * @throws ApiError + */ +export const setAutomaticBilling = (data: SetAutomaticBillingData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/set_automatic_billing', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit slack command + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceInvite + * @returns string status + * @throws ApiError + */ +export const editSlackCommand = (data: EditSlackCommandData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_slack_command', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run a job that sends a message to Slack + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody path to hub script to run and its corresponding args + * @returns unknown status + * @throws ApiError + */ +export const runSlackMessageTestJob = (data: RunSlackMessageTestJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/run_slack_message_test_job', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit deploy to + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns string status + * @throws ApiError + */ +export const editDeployTo = (data: EditDeployToData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_deploy_to', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit auto invite + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceInvite + * @returns string status + * @throws ApiError + */ +export const editAutoInvite = (data: EditAutoInviteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_auto_invite', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit webhook + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceWebhook + * @returns string status + * @throws ApiError + */ +export const editWebhook = (data: EditWebhookData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_webhook', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit copilot config + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceCopilotConfig + * @returns string status + * @throws ApiError + */ +export const editCopilotConfig = (data: EditCopilotConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_copilot_config', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get copilot info + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getCopilotInfo = (data: GetCopilotInfoData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/get_copilot_info', + path: { + workspace: data.workspace + } +}); }; + +/** + * edit error handler + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody WorkspaceErrorHandler + * @returns string status + * @throws ApiError + */ +export const editErrorHandler = (data: EditErrorHandlerData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_error_handler', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit large file storage settings + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody LargeFileStorage info + * @returns unknown status + * @throws ApiError + */ +export const editLargeFileStorageConfig = (data: EditLargeFileStorageConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_large_file_storage_config', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit workspace git sync settings + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Workspace Git sync settings + * @returns unknown status + * @throws ApiError + */ +export const editWorkspaceGitSyncConfig = (data: EditWorkspaceGitSyncConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_git_sync_config', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit workspace deploy ui settings + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Workspace deploy UI settings + * @returns unknown status + * @throws ApiError + */ +export const editWorkspaceDeployUiSettings = (data: EditWorkspaceDeployUiSettingsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_deploy_ui_config', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit default app for workspace + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Workspace default app + * @returns string status + * @throws ApiError + */ +export const editWorkspaceDefaultApp = (data: EditWorkspaceDefaultAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/edit_default_app', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * edit default scripts for workspace + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Workspace default app + * @returns string status + * @throws ApiError + */ +export const editDefaultScripts = (data: EditDefaultScriptsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/default_scripts', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get default scripts for workspace + * @param data The data for the request. + * @param data.workspace + * @returns WorkspaceDefaultScripts status + * @throws ApiError + */ +export const getDefaultScripts = (data: GetDefaultScriptsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/default_scripts', + path: { + workspace: data.workspace + } +}); }; + +/** + * set environment variable + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Workspace default app + * @returns string status + * @throws ApiError + */ +export const setEnvironmentVariable = (data: SetEnvironmentVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/set_environment_variable', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * retrieves the encryption key for this workspace + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getWorkspaceEncryptionKey = (data: GetWorkspaceEncryptionKeyData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/encryption_key', + path: { + workspace: data.workspace + } +}); }; + +/** + * update the encryption key for this workspace + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody New encryption key + * @returns string status + * @throws ApiError + */ +export const setWorkspaceEncryptionKey = (data: SetWorkspaceEncryptionKeyData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/workspaces/encryption_key', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get default app for workspace + * @param data The data for the request. + * @param data.workspace + * @returns unknown status + * @throws ApiError + */ +export const getWorkspaceDefaultApp = (data: GetWorkspaceDefaultAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/default_app', + path: { + workspace: data.workspace + } +}); }; + +/** + * get large file storage config + * @param data The data for the request. + * @param data.workspace + * @returns LargeFileStorage status + * @throws ApiError + */ +export const getLargeFileStorageConfig = (data: GetLargeFileStorageConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/get_large_file_storage_config', + path: { + workspace: data.workspace + } +}); }; + +/** + * get usage + * @param data The data for the request. + * @param data.workspace + * @returns number usage + * @throws ApiError + */ +export const getWorkspaceUsage = (data: GetWorkspaceUsageData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/workspaces/usage', + path: { + workspace: data.workspace + } +}); }; + +/** + * list users + * @param data The data for the request. + * @param data.workspace + * @returns User user + * @throws ApiError + */ +export const listUsers = (data: ListUsersData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/list', + path: { + workspace: data.workspace + } +}); }; + +/** + * list users usage + * @param data The data for the request. + * @param data.workspace + * @returns UserUsage user + * @throws ApiError + */ +export const listUsersUsage = (data: ListUsersUsageData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/list_usage', + path: { + workspace: data.workspace + } +}); }; + +/** + * list usernames + * @param data The data for the request. + * @param data.workspace + * @returns string user + * @throws ApiError + */ +export const listUsernames = (data: ListUsernamesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/list_usernames', + path: { + workspace: data.workspace + } +}); }; + +/** + * get email from username + * @param data The data for the request. + * @param data.workspace + * @param data.username + * @returns string email + * @throws ApiError + */ +export const usernameToEmail = (data: UsernameToEmailData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/users/username_to_email/{username}', + path: { + workspace: data.workspace, + username: data.username + } +}); }; + +/** + * create token + * @param data The data for the request. + * @param data.requestBody new token + * @returns string token created + * @throws ApiError + */ +export const createToken = (data: CreateTokenData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/tokens/create', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create token to impersonate a user (require superadmin) + * @param data The data for the request. + * @param data.requestBody new token + * @returns string token created + * @throws ApiError + */ +export const createTokenImpersonate = (data: CreateTokenImpersonateData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/users/tokens/impersonate', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete token + * @param data The data for the request. + * @param data.tokenPrefix + * @returns string delete token + * @throws ApiError + */ +export const deleteToken = (data: DeleteTokenData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/users/tokens/delete/{token_prefix}', + path: { + token_prefix: data.tokenPrefix + } +}); }; + +/** + * list token + * @param data The data for the request. + * @param data.excludeEphemeral + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns TruncatedToken truncated token + * @throws ApiError + */ +export const listTokens = (data: ListTokensData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/users/tokens/list', + query: { + exclude_ephemeral: data.excludeEphemeral, + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * get OIDC token (ee only) + * @param data The data for the request. + * @param data.workspace + * @param data.audience + * @returns string new oidc token + * @throws ApiError + */ +export const getOidcToken = (data: GetOidcTokenData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oidc/token/{audience}', + path: { + workspace: data.workspace, + audience: data.audience + } +}); }; + +/** + * create variable + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new variable + * @param data.alreadyEncrypted + * @returns string variable created + * @throws ApiError + */ +export const createVariable = (data: CreateVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/variables/create', + path: { + workspace: data.workspace + }, + query: { + already_encrypted: data.alreadyEncrypted + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * encrypt value + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new variable + * @returns string encrypted value + * @throws ApiError + */ +export const encryptValue = (data: EncryptValueData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/variables/encrypt', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete variable + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string variable deleted + * @throws ApiError + */ +export const deleteVariable = (data: DeleteVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/variables/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update variable + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated variable + * @param data.alreadyEncrypted + * @returns string variable updated + * @throws ApiError + */ +export const updateVariable = (data: UpdateVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/variables/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + already_encrypted: data.alreadyEncrypted + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get variable + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.decryptSecret ask to decrypt secret if this variable is secret + * (if not secret no effect, default: true) + * + * @param data.includeEncrypted ask to include the encrypted value if secret and decrypt secret is not true (default: false) + * + * @returns ListableVariable variable + * @throws ApiError + */ +export const getVariable = (data: GetVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/variables/get/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + decrypt_secret: data.decryptSecret, + include_encrypted: data.includeEncrypted + } +}); }; + +/** + * get variable value + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string variable + * @throws ApiError + */ +export const getVariableValue = (data: GetVariableValueData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/variables/get_value/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * does variable exists at path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean variable + * @throws ApiError + */ +export const existsVariable = (data: ExistsVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/variables/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list variables + * @param data The data for the request. + * @param data.workspace + * @param data.pathStart + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns ListableVariable variable list + * @throws ApiError + */ +export const listVariable = (data: ListVariableData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/variables/list', + path: { + workspace: data.workspace + }, + query: { + path_start: data.pathStart, + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * list contextual variables + * @param data The data for the request. + * @param data.workspace + * @returns ContextualVariable contextual variable list + * @throws ApiError + */ +export const listContextualVariables = (data: ListContextualVariablesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/variables/list_contextual', + path: { + workspace: data.workspace + } +}); }; + +/** + * login with oauth authorization flow + * @param data The data for the request. + * @param data.clientName + * @param data.requestBody Partially filled script + * @returns string Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience. + * + * @throws ApiError + */ +export const loginWithOauth = (data: LoginWithOauthData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/oauth/login_callback/{client_name}', + path: { + client_name: data.clientName + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * connect slack callback + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody code endpoint + * @returns string slack token + * @throws ApiError + */ +export const connectSlackCallback = (data: ConnectSlackCallbackData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oauth/connect_slack_callback', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * connect slack callback instance + * @param data The data for the request. + * @param data.requestBody code endpoint + * @returns string success message + * @throws ApiError + */ +export const connectSlackCallbackInstance = (data: ConnectSlackCallbackInstanceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/oauth/connect_slack_callback', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * connect callback + * @param data The data for the request. + * @param data.clientName + * @param data.requestBody code endpoint + * @returns TokenResponse oauth token + * @throws ApiError + */ +export const connectCallback = (data: ConnectCallbackData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/oauth/connect_callback/{client_name}', + path: { + client_name: data.clientName + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create OAuth account + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody code endpoint + * @returns string account set + * @throws ApiError + */ +export const createAccount = (data: CreateAccountData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oauth/create_account', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * refresh token + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody variable path + * @returns string token refreshed + * @throws ApiError + */ +export const refreshToken = (data: RefreshTokenData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oauth/refresh_token/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * disconnect account + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns string disconnected client + * @throws ApiError + */ +export const disconnectAccount = (data: DisconnectAccountData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oauth/disconnect/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * disconnect slack + * @param data The data for the request. + * @param data.workspace + * @returns string disconnected slack + * @throws ApiError + */ +export const disconnectSlack = (data: DisconnectSlackData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/oauth/disconnect_slack', + path: { + workspace: data.workspace + } +}); }; + +/** + * list oauth logins + * @returns unknown list of oauth and saml login clients + * @throws ApiError + */ +export const listOauthLogins = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/oauth/list_logins' +}); }; + +/** + * list oauth connects + * @returns string list of oauth connects clients + * @throws ApiError + */ +export const listOauthConnects = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/oauth/list_connects' +}); }; + +/** + * get oauth connect + * @param data The data for the request. + * @param data.client client name + * @returns unknown get + * @throws ApiError + */ +export const getOauthConnect = (data: GetOauthConnectData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/oauth/get_connect/{client}', + path: { + client: data.client + } +}); }; + +/** + * create resource + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new resource + * @param data.updateIfExists + * @returns string resource created + * @throws ApiError + */ +export const createResource = (data: CreateResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/resources/create', + path: { + workspace: data.workspace + }, + query: { + update_if_exists: data.updateIfExists + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete resource + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string resource deleted + * @throws ApiError + */ +export const deleteResource = (data: DeleteResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/resources/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update resource + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated resource + * @returns string resource updated + * @throws ApiError + */ +export const updateResource = (data: UpdateResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/resources/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update resource value + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated resource + * @returns string resource value updated + * @throws ApiError + */ +export const updateResourceValue = (data: UpdateResourceValueData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/resources/update_value/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get resource + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns Resource resource + * @throws ApiError + */ +export const getResource = (data: GetResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/get/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get resource interpolated (variables and resources are fully unrolled) + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.jobId job id + * @returns unknown resource value + * @throws ApiError + */ +export const getResourceValueInterpolated = (data: GetResourceValueInterpolatedData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/get_value_interpolated/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + job_id: data.jobId + } +}); }; + +/** + * get resource value + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown resource value + * @throws ApiError + */ +export const getResourceValue = (data: GetResourceValueData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/get_value/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * does resource exists + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean does resource exists + * @throws ApiError + */ +export const existsResource = (data: ExistsResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list resources + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.resourceType resource_types to list from, separated by ',', + * @param data.resourceTypeExclude resource_types to not list from, separated by ',', + * @param data.pathStart + * @returns ListableResource resource list + * @throws ApiError + */ +export const listResource = (data: ListResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + resource_type: data.resourceType, + resource_type_exclude: data.resourceTypeExclude, + path_start: data.pathStart + } +}); }; + +/** + * list resources for search + * @param data The data for the request. + * @param data.workspace + * @returns unknown resource list + * @throws ApiError + */ +export const listSearchResource = (data: ListSearchResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/list_search', + path: { + workspace: data.workspace + } +}); }; + +/** + * list resource names + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns unknown resource list names + * @throws ApiError + */ +export const listResourceNames = (data: ListResourceNamesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/list_names/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * create resource_type + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new resource_type + * @returns string resource_type created + * @throws ApiError + */ +export const createResourceType = (data: CreateResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/resources/type/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get map from resource type to format extension + * @param data The data for the request. + * @param data.workspace + * @returns unknown map from resource type to file ext + * @throws ApiError + */ +export const fileResourceTypeToFileExtMap = (data: FileResourceTypeToFileExtMapData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/file_resource_type_to_file_ext_map', + path: { + workspace: data.workspace + } +}); }; + +/** + * delete resource_type + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string resource_type deleted + * @throws ApiError + */ +export const deleteResourceType = (data: DeleteResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/resources/type/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update resource_type + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated resource_type + * @returns string resource_type updated + * @throws ApiError + */ +export const updateResourceType = (data: UpdateResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/resources/type/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get resource_type + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns ResourceType resource_type deleted + * @throws ApiError + */ +export const getResourceType = (data: GetResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/type/get/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * does resource_type exists + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean does resource_type exist + * @throws ApiError + */ +export const existsResourceType = (data: ExistsResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/type/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list resource_types + * @param data The data for the request. + * @param data.workspace + * @returns ResourceType resource_type list + * @throws ApiError + */ +export const listResourceType = (data: ListResourceTypeData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/type/list', + path: { + workspace: data.workspace + } +}); }; + +/** + * list resource_types names + * @param data The data for the request. + * @param data.workspace + * @returns string resource_type list + * @throws ApiError + */ +export const listResourceTypeNames = (data: ListResourceTypeNamesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/resources/type/listnames', + path: { + workspace: data.workspace + } +}); }; + +/** + * query resource types by similarity + * @param data The data for the request. + * @param data.workspace + * @param data.text query text + * @param data.limit query limit + * @returns unknown resource type details + * @throws ApiError + */ +export const queryResourceTypes = (data: QueryResourceTypesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/embeddings/query_resource_types', + path: { + workspace: data.workspace + }, + query: { + text: data.text, + limit: data.limit + } +}); }; + +/** + * list hub integrations + * @param data The data for the request. + * @param data.kind query integrations kind + * @returns unknown integrations details + * @throws ApiError + */ +export const listHubIntegrations = (data: ListHubIntegrationsData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/integrations/hub/list', + query: { + kind: data.kind + } +}); }; + +/** + * list all hub flows + * @returns unknown hub flows list + * @throws ApiError + */ +export const listHubFlows = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/flows/hub/list' +}); }; + +/** + * get hub flow by id + * @param data The data for the request. + * @param data.id + * @returns unknown flow + * @throws ApiError + */ +export const getHubFlowById = (data: GetHubFlowByIdData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/flows/hub/get/{id}', + path: { + id: data.id + } +}); }; + +/** + * list all hub apps + * @returns unknown hub apps list + * @throws ApiError + */ +export const listHubApps = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/apps/hub/list' +}); }; + +/** + * get hub app by id + * @param data The data for the request. + * @param data.id + * @returns unknown app + * @throws ApiError + */ +export const getHubAppById = (data: GetHubAppByIdData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/apps/hub/get/{id}', + path: { + id: data.id + } +}); }; + +/** + * get hub script content by path + * @param data The data for the request. + * @param data.path + * @returns string script details + * @throws ApiError + */ +export const getHubScriptContentByPath = (data: GetHubScriptContentByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/scripts/hub/get/{path}', + path: { + path: data.path + } +}); }; + +/** + * get full hub script by path + * @param data The data for the request. + * @param data.path + * @returns unknown script details + * @throws ApiError + */ +export const getHubScriptByPath = (data: GetHubScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/scripts/hub/get_full/{path}', + path: { + path: data.path + } +}); }; + +/** + * get top hub scripts + * @param data The data for the request. + * @param data.limit query limit + * @param data.app query scripts app + * @param data.kind query scripts kind + * @returns unknown hub scripts list + * @throws ApiError + */ +export const getTopHubScripts = (data: GetTopHubScriptsData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/scripts/hub/top', + query: { + limit: data.limit, + app: data.app, + kind: data.kind + } +}); }; + +/** + * query hub scripts by similarity + * @param data The data for the request. + * @param data.text query text + * @param data.kind query scripts kind + * @param data.limit query limit + * @param data.app query scripts app + * @returns unknown script details + * @throws ApiError + */ +export const queryHubScripts = (data: QueryHubScriptsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/embeddings/query_hub_scripts', + query: { + text: data.text, + kind: data.kind, + limit: data.limit, + app: data.app + } +}); }; + +/** + * list scripts for search + * @param data The data for the request. + * @param data.workspace + * @returns unknown script list + * @throws ApiError + */ +export const listSearchScript = (data: ListSearchScriptData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/list_search', + path: { + workspace: data.workspace + } +}); }; + +/** + * list all scripts + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.pathStart mask to filter matching starting path + * @param data.pathExact mask to filter exact matching path + * @param data.firstParentHash mask to filter scripts whom first direct parent has exact hash + * @param data.lastParentHash mask to filter scripts whom last parent in the chain has exact hash. + * Beware that each script stores only a limited number of parents. Hence + * the last parent hash for a script is not necessarily its top-most parent. + * To find the top-most parent you will have to jump from last to last hash + * until finding the parent + * + * @param data.parentHash is the hash present in the array of stored parent hashes for this script. + * The same warning applies than for last_parent_hash. A script only store a + * limited number of direct parent + * + * @param data.showArchived (default false) + * show only the archived files. + * when multiple archived hash share the same path, only the ones with the latest create_at + * are + * ed. + * + * @param data.includeWithoutMain (default false) + * include scripts without an exported main function + * + * @param data.includeDraftOnly (default false) + * include scripts that have no deployed version + * + * @param data.isTemplate (default regardless) + * if true show only the templates + * if false show only the non templates + * if not defined, show all regardless of if the script is a template + * + * @param data.kinds (default regardless) + * script kinds to filter, split by comma + * + * @param data.starredOnly (default false) + * show only the starred items + * + * @param data.withDeploymentMsg (default false) + * include deployment message + * + * @returns Script All scripts + * @throws ApiError + */ +export const listScripts = (data: ListScriptsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + order_desc: data.orderDesc, + created_by: data.createdBy, + path_start: data.pathStart, + path_exact: data.pathExact, + first_parent_hash: data.firstParentHash, + last_parent_hash: data.lastParentHash, + parent_hash: data.parentHash, + show_archived: data.showArchived, + include_without_main: data.includeWithoutMain, + include_draft_only: data.includeDraftOnly, + is_template: data.isTemplate, + kinds: data.kinds, + starred_only: data.starredOnly, + with_deployment_msg: data.withDeploymentMsg + } +}); }; + +/** + * list all scripts paths + * @param data The data for the request. + * @param data.workspace + * @returns string list of script paths + * @throws ApiError + */ +export const listScriptPaths = (data: ListScriptPathsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/list_paths', + path: { + workspace: data.workspace + } +}); }; + +/** + * create draft + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns string draft created + * @throws ApiError + */ +export const createDraft = (data: CreateDraftData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/drafts/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete draft + * @param data The data for the request. + * @param data.workspace + * @param data.kind + * @param data.path + * @returns string draft deleted + * @throws ApiError + */ +export const deleteDraft = (data: DeleteDraftData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/drafts/delete/{kind}/{path}', + path: { + workspace: data.workspace, + kind: data.kind, + path: data.path + } +}); }; + +/** + * create script + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Partially filled script + * @returns string script created + * @throws ApiError + */ +export const createScript = (data: CreateScriptData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Toggle ON and OFF the workspace error handler for a given script + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody Workspace error handler enabled + * @returns string error handler toggled + * @throws ApiError + */ +export const toggleWorkspaceErrorHandlerForScript = (data: ToggleWorkspaceErrorHandlerForScriptData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/toggle_workspace_error_handler/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get all instance custom tags (tags are used to dispatch jobs to different worker groups) + * @returns string list of custom tags + * @throws ApiError + */ +export const getCustomTags = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/custom_tags' +}); }; + +/** + * get all instance default tags + * @returns string list of default tags + * @throws ApiError + */ +export const geDefaultTags = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/get_default_tags' +}); }; + +/** + * is default tags per workspace + * @returns boolean is the default tags per workspace + * @throws ApiError + */ +export const isDefaultTagsPerWorkspace = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/is_default_tags_per_workspace' +}); }; + +/** + * archive script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string script archived + * @throws ApiError + */ +export const archiveScriptByPath = (data: ArchiveScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/archive/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * archive script by hash + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @returns Script script details + * @throws ApiError + */ +export const archiveScriptByHash = (data: ArchiveScriptByHashData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/archive/h/{hash}', + path: { + workspace: data.workspace, + hash: data.hash + } +}); }; + +/** + * delete script by hash (erase content but keep hash, require admin) + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @returns Script script details + * @throws ApiError + */ +export const deleteScriptByHash = (data: DeleteScriptByHashData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/delete/h/{hash}', + path: { + workspace: data.workspace, + hash: data.hash + } +}); }; + +/** + * delete all scripts at a given path (require admin) + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string script path + * @throws ApiError + */ +export const deleteScriptByPath = (data: DeleteScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/delete/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.withStarredInfo + * @returns Script script details + * @throws ApiError + */ +export const getScriptByPath = (data: GetScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/get/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + with_starred_info: data.withStarredInfo + } +}); }; + +/** + * get script by path with draft + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns NewScriptWithDraft script details + * @throws ApiError + */ +export const getScriptByPathWithDraft = (data: GetScriptByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/get/draft/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get history of a script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns ScriptHistory script history + * @throws ApiError + */ +export const getScriptHistoryByPath = (data: GetScriptHistoryByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/history/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update history of a script + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @param data.path + * @param data.requestBody Script deployment message + * @returns string success + * @throws ApiError + */ +export const updateScriptHistory = (data: UpdateScriptHistoryData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/scripts/history_update/h/{hash}/p/{path}', + path: { + workspace: data.workspace, + hash: data.hash, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * raw script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string script content + * @throws ApiError + */ +export const rawScriptByPath = (data: RawScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/raw/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts) + * @param data The data for the request. + * @param data.workspace + * @param data.token + * @param data.path + * @returns string script content + * @throws ApiError + */ +export const rawScriptByPathTokened = (data: RawScriptByPathTokenedData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/scripts_u/tokened_raw/{workspace}/{token}/{path}', + path: { + workspace: data.workspace, + token: data.token, + path: data.path + } +}); }; + +/** + * exists script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean does it exists + * @throws ApiError + */ +export const existsScriptByPath = (data: ExistsScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/exists/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get script by hash + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @param data.withStarredInfo + * @returns Script script details + * @throws ApiError + */ +export const getScriptByHash = (data: GetScriptByHashData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/get/h/{hash}', + path: { + workspace: data.workspace, + hash: data.hash + }, + query: { + with_starred_info: data.withStarredInfo + } +}); }; + +/** + * raw script by hash + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string script content + * @throws ApiError + */ +export const rawScriptByHash = (data: RawScriptByHashData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/raw/h/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get script deployment status + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @returns unknown script details + * @throws ApiError + */ +export const getScriptDeploymentStatus = (data: GetScriptDeploymentStatusData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/scripts/deployment_status/h/{hash}', + path: { + workspace: data.workspace, + hash: data.hash + } +}); }; + +/** + * run script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody script args + * @param data.scheduledFor when to schedule this job (leave empty for immediate run) + * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now + * @param data.skipPreprocessor skip the preprocessor + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.invisibleToOwner make the run invisible to the the script owner (default false) + * @returns string job created + * @throws ApiError + */ +export const runScriptByPath = (data: RunScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + scheduled_for: data.scheduledFor, + scheduled_in_secs: data.scheduledInSecs, + skip_preprocessor: data.skipPreprocessor, + parent_job: data.parentJob, + tag: data.tag, + cache_ttl: data.cacheTtl, + job_id: data.jobId, + invisible_to_owner: data.invisibleToOwner + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run script by path in openai format + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody script args + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + * @returns unknown job result + * @throws ApiError + */ +export const openaiSyncScriptByPath = (data: OpenaiSyncScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/openai_sync/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + parent_job: data.parentJob, + job_id: data.jobId, + include_header: data.includeHeader, + queue_limit: data.queueLimit + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run script by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody script args + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + * @returns unknown job result + * @throws ApiError + */ +export const runWaitResultScriptByPath = (data: RunWaitResultScriptByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run_wait_result/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + parent_job: data.parentJob, + tag: data.tag, + cache_ttl: data.cacheTtl, + job_id: data.jobId, + include_header: data.includeHeader, + queue_limit: data.queueLimit + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run script by path with get + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent + * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` + * + * @returns unknown job result + * @throws ApiError + */ +export const runWaitResultScriptByPathGet = (data: RunWaitResultScriptByPathGetData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/run_wait_result/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + parent_job: data.parentJob, + tag: data.tag, + cache_ttl: data.cacheTtl, + job_id: data.jobId, + include_header: data.includeHeader, + queue_limit: data.queueLimit, + payload: data.payload + } +}); }; + +/** + * run flow by path and wait until completion in openai format + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody script args + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @returns unknown job result + * @throws ApiError + */ +export const openaiSyncFlowByPath = (data: OpenaiSyncFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/openai_sync/f/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + include_header: data.includeHeader, + queue_limit: data.queueLimit, + job_id: data.jobId + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run flow by path and wait until completion + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody script args + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @returns unknown job result + * @throws ApiError + */ +export const runWaitResultFlowByPath = (data: RunWaitResultFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run_wait_result/f/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + include_header: data.includeHeader, + queue_limit: data.queueLimit, + job_id: data.jobId + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get job result by id + * @param data The data for the request. + * @param data.workspace + * @param data.flowJobId + * @param data.nodeId + * @returns unknown job result + * @throws ApiError + */ +export const resultById = (data: ResultByIdData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}', + path: { + workspace: data.workspace, + flow_job_id: data.flowJobId, + node_id: data.nodeId + } +}); }; + +/** + * list all flow paths + * @param data The data for the request. + * @param data.workspace + * @returns string list of flow paths + * @throws ApiError + */ +export const listFlowPaths = (data: ListFlowPathsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/list_paths', + path: { + workspace: data.workspace + } +}); }; + +/** + * list flows for search + * @param data The data for the request. + * @param data.workspace + * @returns unknown flow list + * @throws ApiError + */ +export const listSearchFlow = (data: ListSearchFlowData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/list_search', + path: { + workspace: data.workspace + } +}); }; + +/** + * list all flows + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.pathStart mask to filter matching starting path + * @param data.pathExact mask to filter exact matching path + * @param data.showArchived (default false) + * show only the archived files. + * when multiple archived hash share the same path, only the ones with the latest create_at + * are displayed. + * + * @param data.starredOnly (default false) + * show only the starred items + * + * @param data.includeDraftOnly (default false) + * include items that have no deployed version + * + * @param data.withDeploymentMsg (default false) + * include deployment message + * + * @returns unknown All flow + * @throws ApiError + */ +export const listFlows = (data: ListFlowsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + order_desc: data.orderDesc, + created_by: data.createdBy, + path_start: data.pathStart, + path_exact: data.pathExact, + show_archived: data.showArchived, + starred_only: data.starredOnly, + include_draft_only: data.includeDraftOnly, + with_deployment_msg: data.withDeploymentMsg + } +}); }; + +/** + * get flow history by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns FlowVersion Flow history + * @throws ApiError + */ +export const getFlowHistory = (data: GetFlowHistoryData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/history/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get flow version + * @param data The data for the request. + * @param data.workspace + * @param data.version + * @param data.path + * @returns Flow flow details + * @throws ApiError + */ +export const getFlowVersion = (data: GetFlowVersionData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/get/v/{version}/p/{path}', + path: { + workspace: data.workspace, + version: data.version, + path: data.path + } +}); }; + +/** + * update flow history + * @param data The data for the request. + * @param data.workspace + * @param data.version + * @param data.path + * @param data.requestBody Flow deployment message + * @returns string success + * @throws ApiError + */ +export const updateFlowHistory = (data: UpdateFlowHistoryData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/flows/history_update/v/{version}/p/{path}', + path: { + workspace: data.workspace, + version: data.version, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get flow by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.withStarredInfo + * @returns Flow flow details + * @throws ApiError + */ +export const getFlowByPath = (data: GetFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/get/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + with_starred_info: data.withStarredInfo + } +}); }; + +/** + * Toggle ON and OFF the workspace error handler for a given flow + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody Workspace error handler enabled + * @returns string error handler toggled + * @throws ApiError + */ +export const toggleWorkspaceErrorHandlerForFlow = (data: ToggleWorkspaceErrorHandlerForFlowData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/flows/toggle_workspace_error_handler/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get flow by path with draft + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown flow details with draft + * @throws ApiError + */ +export const getFlowByPathWithDraft = (data: GetFlowByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/get/draft/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * exists flow by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean flow details + * @throws ApiError + */ +export const existsFlowByPath = (data: ExistsFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/flows/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * create flow + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Partially filled flow + * @returns string flow created + * @throws ApiError + */ +export const createFlow = (data: CreateFlowData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/flows/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update flow + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody Partially filled flow + * @returns string flow updated + * @throws ApiError + */ +export const updateFlow = (data: UpdateFlowData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/flows/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * archive flow by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody archiveFlow + * @returns string flow archived + * @throws ApiError + */ +export const archiveFlowByPath = (data: ArchiveFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/flows/archive/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete flow by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string flow delete + * @throws ApiError + */ +export const deleteFlowByPath = (data: DeleteFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/flows/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list all raw apps + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.pathStart mask to filter matching starting path + * @param data.pathExact mask to filter exact matching path + * @param data.starredOnly (default false) + * show only the starred items + * + * @returns ListableRawApp All raw apps + * @throws ApiError + */ +export const listRawApps = (data: ListRawAppsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/raw_apps/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + order_desc: data.orderDesc, + created_by: data.createdBy, + path_start: data.pathStart, + path_exact: data.pathExact, + starred_only: data.starredOnly + } +}); }; + +/** + * does an app exisst at path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean app exists + * @throws ApiError + */ +export const existsRawApp = (data: ExistsRawAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/raw_apps/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get app by path + * @param data The data for the request. + * @param data.workspace + * @param data.version + * @param data.path + * @returns string app details + * @throws ApiError + */ +export const getRawAppData = (data: GetRawAppDataData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/get_data/{version}/{path}', + path: { + workspace: data.workspace, + version: data.version, + path: data.path + } +}); }; + +/** + * list apps for search + * @param data The data for the request. + * @param data.workspace + * @returns unknown app list + * @throws ApiError + */ +export const listSearchApp = (data: ListSearchAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/list_search', + path: { + workspace: data.workspace + } +}); }; + +/** + * list all apps + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.pathStart mask to filter matching starting path + * @param data.pathExact mask to filter exact matching path + * @param data.starredOnly (default false) + * show only the starred items + * + * @param data.includeDraftOnly (default false) + * include items that have no deployed version + * + * @param data.withDeploymentMsg (default false) + * include deployment message + * + * @returns ListableApp All apps + * @throws ApiError + */ +export const listApps = (data: ListAppsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + order_desc: data.orderDesc, + created_by: data.createdBy, + path_start: data.pathStart, + path_exact: data.pathExact, + starred_only: data.starredOnly, + include_draft_only: data.includeDraftOnly, + with_deployment_msg: data.withDeploymentMsg + } +}); }; + +/** + * create app + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new app + * @returns string app created + * @throws ApiError + */ +export const createApp = (data: CreateAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/apps/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * does an app exisst at path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean app exists + * @throws ApiError + */ +export const existsApp = (data: ExistsAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get app by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.withStarredInfo + * @returns AppWithLastVersion app details + * @throws ApiError + */ +export const getAppByPath = (data: GetAppByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/get/p/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + with_starred_info: data.withStarredInfo + } +}); }; + +/** + * get app by path with draft + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns AppWithLastVersionWDraft app details with draft + * @throws ApiError + */ +export const getAppByPathWithDraft = (data: GetAppByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/get/draft/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get app history by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns AppHistory app history + * @throws ApiError + */ +export const getAppHistoryByPath = (data: GetAppHistoryByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/history/p/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update app history + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.version + * @param data.requestBody App deployment message + * @returns string success + * @throws ApiError + */ +export const updateAppHistory = (data: UpdateAppHistoryData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/apps/history_update/a/{id}/v/{version}', + path: { + workspace: data.workspace, + id: data.id, + version: data.version + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get public app by secret + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns AppWithLastVersion app details + * @throws ApiError + */ +export const getPublicAppBySecret = (data: GetPublicAppBySecretData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps_u/public_app/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get public resource + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown resource value + * @throws ApiError + */ +export const getPublicResource = (data: GetPublicResourceData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps_u/public_resource/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get public secret of app + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string app secret + * @throws ApiError + */ +export const getPublicSecretOfApp = (data: GetPublicSecretOfAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/secret_of/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get app by version + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns AppWithLastVersion app details + * @throws ApiError + */ +export const getAppByVersion = (data: GetAppByVersionData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/apps/get/v/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * create raw app + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new raw app + * @returns string raw app created + * @throws ApiError + */ +export const createRawApp = (data: CreateRawAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/raw_apps/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update app + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updateraw app + * @returns string app updated + * @throws ApiError + */ +export const updateRawApp = (data: UpdateRawAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/raw_apps/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete raw app + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string app deleted + * @throws ApiError + */ +export const deleteRawApp = (data: DeleteRawAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/raw_apps/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * delete app + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string app deleted + * @throws ApiError + */ +export const deleteApp = (data: DeleteAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/apps/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * update app + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody update app + * @returns string app updated + * @throws ApiError + */ +export const updateApp = (data: UpdateAppData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/apps/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * executeComponent + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody update app + * @returns string job uuid + * @throws ApiError + */ +export const executeComponent = (data: ExecuteComponentData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/apps_u/execute_component/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run flow by path + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody flow args + * @param data.scheduledFor when to schedule this job (leave empty for immediate run) + * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now + * @param data.skipPreprocessor skip the preprocessor + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.invisibleToOwner make the run invisible to the the flow owner (default false) + * @returns string job created + * @throws ApiError + */ +export const runFlowByPath = (data: RunFlowByPathData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/f/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + scheduled_for: data.scheduledFor, + scheduled_in_secs: data.scheduledInSecs, + skip_preprocessor: data.skipPreprocessor, + parent_job: data.parentJob, + tag: data.tag, + job_id: data.jobId, + include_header: data.includeHeader, + invisible_to_owner: data.invisibleToOwner + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * restart a completed flow at a given step + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.stepId step id to restart the flow from + * @param data.branchOrIterationN for branchall or loop, the iteration at which the flow should restart + * @param data.requestBody flow args + * @param data.scheduledFor when to schedule this job (leave empty for immediate run) + * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.invisibleToOwner make the run invisible to the the flow owner (default false) + * @returns string job created + * @throws ApiError + */ +export const restartFlowAtStep = (data: RestartFlowAtStepData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}', + path: { + workspace: data.workspace, + id: data.id, + step_id: data.stepId, + branch_or_iteration_n: data.branchOrIterationN + }, + query: { + scheduled_for: data.scheduledFor, + scheduled_in_secs: data.scheduledInSecs, + parent_job: data.parentJob, + tag: data.tag, + job_id: data.jobId, + include_header: data.includeHeader, + invisible_to_owner: data.invisibleToOwner + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run script by hash + * @param data The data for the request. + * @param data.workspace + * @param data.hash + * @param data.requestBody Partially filled args + * @param data.scheduledFor when to schedule this job (leave empty for immediate run) + * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now + * @param data.skipPreprocessor skip the preprocessor + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.tag Override the tag to use + * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.invisibleToOwner make the run invisible to the the script owner (default false) + * @returns string job created + * @throws ApiError + */ +export const runScriptByHash = (data: RunScriptByHashData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/h/{hash}', + path: { + workspace: data.workspace, + hash: data.hash + }, + query: { + scheduled_for: data.scheduledFor, + scheduled_in_secs: data.scheduledInSecs, + skip_preprocessor: data.skipPreprocessor, + parent_job: data.parentJob, + tag: data.tag, + cache_ttl: data.cacheTtl, + job_id: data.jobId, + include_header: data.includeHeader, + invisible_to_owner: data.invisibleToOwner + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run script preview + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody preview + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.invisibleToOwner make the run invisible to the the script owner (default false) + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @returns string job created + * @throws ApiError + */ +export const runScriptPreview = (data: RunScriptPreviewData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/preview', + path: { + workspace: data.workspace + }, + query: { + include_header: data.includeHeader, + invisible_to_owner: data.invisibleToOwner, + job_id: data.jobId + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run code-workflow task + * @param data The data for the request. + * @param data.workspace + * @param data.jobId + * @param data.entrypoint + * @param data.requestBody preview + * @returns string job created + * @throws ApiError + */ +export const runCodeWorkflowTask = (data: RunCodeWorkflowTaskData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/workflow_as_code/{job_id}/{entrypoint}', + path: { + workspace: data.workspace, + job_id: data.jobId, + entrypoint: data.entrypoint + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run a one-off dependencies job + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody raw script content + * @returns unknown dependency job result + * @throws ApiError + */ +export const runRawScriptDependencies = (data: RunRawScriptDependenciesData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/dependencies', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * run flow preview + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody preview + * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + * @param data.invisibleToOwner make the run invisible to the the script owner (default false) + * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + * @returns string job created + * @throws ApiError + */ +export const runFlowPreview = (data: RunFlowPreviewData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/run/preview_flow', + path: { + workspace: data.workspace + }, + query: { + include_header: data.includeHeader, + invisible_to_owner: data.invisibleToOwner, + job_id: data.jobId + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list all queued jobs + * @param data The data for the request. + * @param data.workspace + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.scriptPathExact mask to filter exact matching path + * @param data.scriptPathStart mask to filter matching starting path + * @param data.schedulePath mask to filter by schedule path + * @param data.scriptHash mask to filter exact matching path + * @param data.startedBefore filter on started before (inclusive) timestamp + * @param data.startedAfter filter on started after (exclusive) timestamp + * @param data.success filter on successful jobs + * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) + * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + * @param data.suspended filter on suspended jobs + * @param data.running filter on running jobs + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.result filter on jobs containing those result as a json subset (@> in postgres) + * @param data.tag filter on jobs with a given tag/worker group + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) + * @param data.isNotSchedule is not a scheduled job + * @returns QueuedJob All queued jobs + * @throws ApiError + */ +export const listQueue = (data: ListQueueData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/queue/list', + path: { + workspace: data.workspace + }, + query: { + order_desc: data.orderDesc, + created_by: data.createdBy, + parent_job: data.parentJob, + script_path_exact: data.scriptPathExact, + script_path_start: data.scriptPathStart, + schedule_path: data.schedulePath, + script_hash: data.scriptHash, + started_before: data.startedBefore, + started_after: data.startedAfter, + success: data.success, + scheduled_for_before_now: data.scheduledForBeforeNow, + job_kinds: data.jobKinds, + suspended: data.suspended, + running: data.running, + args: data.args, + result: data.result, + tag: data.tag, + page: data.page, + per_page: data.perPage, + all_workspaces: data.allWorkspaces, + is_not_schedule: data.isNotSchedule + } +}); }; + +/** + * get queue count + * @param data The data for the request. + * @param data.workspace + * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) + * @returns unknown queue count + * @throws ApiError + */ +export const getQueueCount = (data: GetQueueCountData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/queue/count', + path: { + workspace: data.workspace + }, + query: { + all_workspaces: data.allWorkspaces + } +}); }; + +/** + * get completed count + * @param data The data for the request. + * @param data.workspace + * @returns unknown completed count + * @throws ApiError + */ +export const getCompletedCount = (data: GetCompletedCountData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/completed/count', + path: { + workspace: data.workspace + } +}); }; + +/** + * get the ids of all jobs matching the given filters + * @param data The data for the request. + * @param data.workspace + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.scriptPathExact mask to filter exact matching path + * @param data.scriptPathStart mask to filter matching starting path + * @param data.schedulePath mask to filter by schedule path + * @param data.scriptHash mask to filter exact matching path + * @param data.startedBefore filter on started before (inclusive) timestamp + * @param data.startedAfter filter on started after (exclusive) timestamp + * @param data.success filter on successful jobs + * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) + * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + * @param data.suspended filter on suspended jobs + * @param data.running filter on running jobs + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.result filter on jobs containing those result as a json subset (@> in postgres) + * @param data.tag filter on jobs with a given tag/worker group + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.concurrencyKey + * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) + * @param data.isNotSchedule is not a scheduled job + * @returns string uuids of jobs + * @throws ApiError + */ +export const listFilteredUuids = (data: ListFilteredUuidsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/queue/list_filtered_uuids', + path: { + workspace: data.workspace + }, + query: { + order_desc: data.orderDesc, + created_by: data.createdBy, + parent_job: data.parentJob, + script_path_exact: data.scriptPathExact, + script_path_start: data.scriptPathStart, + schedule_path: data.schedulePath, + script_hash: data.scriptHash, + started_before: data.startedBefore, + started_after: data.startedAfter, + success: data.success, + scheduled_for_before_now: data.scheduledForBeforeNow, + job_kinds: data.jobKinds, + suspended: data.suspended, + running: data.running, + args: data.args, + result: data.result, + tag: data.tag, + page: data.page, + per_page: data.perPage, + concurrency_key: data.concurrencyKey, + all_workspaces: data.allWorkspaces, + is_not_schedule: data.isNotSchedule + } +}); }; + +/** + * cancel jobs based on the given uuids + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody uuids of the jobs to cancel + * @returns string uuids of canceled jobs + * @throws ApiError + */ +export const cancelSelection = (data: CancelSelectionData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/queue/cancel_selection', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list all completed jobs + * @param data The data for the request. + * @param data.workspace + * @param data.orderDesc order by desc order (default true) + * @param data.createdBy mask to filter exact matching user creator + * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.scriptPathExact mask to filter exact matching path + * @param data.scriptPathStart mask to filter matching starting path + * @param data.schedulePath mask to filter by schedule path + * @param data.scriptHash mask to filter exact matching path + * @param data.startedBefore filter on started before (inclusive) timestamp + * @param data.startedAfter filter on started after (exclusive) timestamp + * @param data.success filter on successful jobs + * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.result filter on jobs containing those result as a json subset (@> in postgres) + * @param data.tag filter on jobs with a given tag/worker group + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.isSkipped is the job skipped + * @param data.isFlowStep is the job a flow step + * @param data.hasNullParent has null parent + * @param data.isNotSchedule is not a scheduled job + * @returns CompletedJob All completed jobs + * @throws ApiError + */ +export const listCompletedJobs = (data: ListCompletedJobsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/completed/list', + path: { + workspace: data.workspace + }, + query: { + order_desc: data.orderDesc, + created_by: data.createdBy, + label: data.label, + parent_job: data.parentJob, + script_path_exact: data.scriptPathExact, + script_path_start: data.scriptPathStart, + schedule_path: data.schedulePath, + script_hash: data.scriptHash, + started_before: data.startedBefore, + started_after: data.startedAfter, + success: data.success, + job_kinds: data.jobKinds, + args: data.args, + result: data.result, + tag: data.tag, + page: data.page, + per_page: data.perPage, + is_skipped: data.isSkipped, + is_flow_step: data.isFlowStep, + has_null_parent: data.hasNullParent, + is_not_schedule: data.isNotSchedule + } +}); }; + +/** + * list all jobs + * @param data The data for the request. + * @param data.workspace + * @param data.createdBy mask to filter exact matching user creator + * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.scriptPathExact mask to filter exact matching path + * @param data.scriptPathStart mask to filter matching starting path + * @param data.schedulePath mask to filter by schedule path + * @param data.scriptHash mask to filter exact matching path + * @param data.startedBefore filter on started before (inclusive) timestamp + * @param data.startedAfter filter on started after (exclusive) timestamp + * @param data.createdBefore filter on created before (inclusive) timestamp + * @param data.createdAfter filter on created after (exclusive) timestamp + * @param data.createdOrStartedBefore filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp + * @param data.running filter on running jobs + * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) + * @param data.createdOrStartedAfter filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp + * @param data.createdOrStartedAfterCompletedJobs filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs + * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + * @param data.suspended filter on suspended jobs + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.tag filter on jobs with a given tag/worker group + * @param data.result filter on jobs containing those result as a json subset (@> in postgres) + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.isSkipped is the job skipped + * @param data.isFlowStep is the job a flow step + * @param data.hasNullParent has null parent + * @param data.success filter on successful jobs + * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) + * @param data.isNotSchedule is not a scheduled job + * @returns Job All jobs + * @throws ApiError + */ +export const listJobs = (data: ListJobsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/list', + path: { + workspace: data.workspace + }, + query: { + created_by: data.createdBy, + label: data.label, + parent_job: data.parentJob, + script_path_exact: data.scriptPathExact, + script_path_start: data.scriptPathStart, + schedule_path: data.schedulePath, + script_hash: data.scriptHash, + started_before: data.startedBefore, + started_after: data.startedAfter, + created_before: data.createdBefore, + created_after: data.createdAfter, + created_or_started_before: data.createdOrStartedBefore, + running: data.running, + scheduled_for_before_now: data.scheduledForBeforeNow, + created_or_started_after: data.createdOrStartedAfter, + created_or_started_after_completed_jobs: data.createdOrStartedAfterCompletedJobs, + job_kinds: data.jobKinds, + suspended: data.suspended, + args: data.args, + tag: data.tag, + result: data.result, + page: data.page, + per_page: data.perPage, + is_skipped: data.isSkipped, + is_flow_step: data.isFlowStep, + has_null_parent: data.hasNullParent, + success: data.success, + all_workspaces: data.allWorkspaces, + is_not_schedule: data.isNotSchedule + } +}); }; + +/** + * get db clock + * @returns number the timestamp of the db that can be used to compute the drift + * @throws ApiError + */ +export const getDbClock = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/jobs/db_clock' +}); }; + +/** + * get job + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.noLogs + * @returns Job job details + * @throws ApiError + */ +export const getJob = (data: GetJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + query: { + no_logs: data.noLogs + } +}); }; + +/** + * get root job id + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns string get root job id + * @throws ApiError + */ +export const getRootJobId = (data: GetRootJobIdData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_root_job_id/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * get job logs + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns string job details + * @throws ApiError + */ +export const getJobLogs = (data: GetJobLogsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_logs/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * get job args + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns unknown job args + * @throws ApiError + */ +export const getJobArgs = (data: GetJobArgsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_args/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * get job updates + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.running + * @param data.logOffset + * @param data.getProgress + * @returns unknown job details + * @throws ApiError + */ +export const getJobUpdates = (data: GetJobUpdatesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/getupdate/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + query: { + running: data.running, + log_offset: data.logOffset, + get_progress: data.getProgress + } +}); }; + +/** + * get log file from object store + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown job log + * @throws ApiError + */ +export const getLogFileFromStore = (data: GetLogFileFromStoreData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_log_file/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get flow debug info + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns unknown flow debug info details + * @throws ApiError + */ +export const getFlowDebugInfo = (data: GetFlowDebugInfoData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_flow_debug_info/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * get completed job + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns CompletedJob job details + * @throws ApiError + */ +export const getCompletedJob = (data: GetCompletedJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/completed/get/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * get completed job result + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.suspendedJob + * @param data.resumeId + * @param data.secret + * @param data.approver + * @returns unknown result + * @throws ApiError + */ +export const getCompletedJobResult = (data: GetCompletedJobResultData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/completed/get_result/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + query: { + suspended_job: data.suspendedJob, + resume_id: data.resumeId, + secret: data.secret, + approver: data.approver + } +}); }; + +/** + * get completed job result if job is completed + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.getStarted + * @returns unknown result + * @throws ApiError + */ +export const getCompletedJobResultMaybe = (data: GetCompletedJobResultMaybeData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/completed/get_result_maybe/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + query: { + get_started: data.getStarted + } +}); }; + +/** + * delete completed job (erase content but keep run id) + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns CompletedJob job details + * @throws ApiError + */ +export const deleteCompletedJob = (data: DeleteCompletedJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/completed/delete/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * cancel queued or running job + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody reason + * @returns string job canceled + * @throws ApiError + */ +export const cancelQueuedJob = (data: CancelQueuedJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs_u/queue/cancel/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * cancel all queued jobs for persistent script + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody reason + * @returns string persistent job scaled down to zero + * @throws ApiError + */ +export const cancelPersistentQueuedJobs = (data: CancelPersistentQueuedJobsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs_u/queue/cancel_persistent/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * force cancel queued job + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody reason + * @returns string job canceled + * @throws ApiError + */ +export const forceCancelQueuedJob = (data: ForceCancelQueuedJobData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs_u/queue/force_cancel/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create an HMac signature given a job id and a resume id + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.approver + * @returns string job signature + * @throws ApiError + */ +export const createJobSignature = (data: CreateJobSignatureData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/job_signature/{id}/{resume_id}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId + }, + query: { + approver: data.approver + } +}); }; + +/** + * get resume urls given a job_id, resume_id and a nonce to resume a flow + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.approver + * @returns unknown url endpoints + * @throws ApiError + */ +export const getResumeUrls = (data: GetResumeUrlsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/resume_urls/{id}/{resume_id}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId + }, + query: { + approver: data.approver + } +}); }; + +/** + * resume a job for a suspended flow + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.signature + * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent + * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` + * + * @param data.approver + * @returns string job resumed + * @throws ApiError + */ +export const resumeSuspendedJobGet = (data: ResumeSuspendedJobGetData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId, + signature: data.signature + }, + query: { + payload: data.payload, + approver: data.approver + } +}); }; + +/** + * resume a job for a suspended flow + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.signature + * @param data.requestBody + * @param data.approver + * @returns string job resumed + * @throws ApiError + */ +export const resumeSuspendedJobPost = (data: ResumeSuspendedJobPostData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId, + signature: data.signature + }, + query: { + approver: data.approver + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * set flow user state at a given key + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.key + * @param data.requestBody new value + * @returns string flow user state updated + * @throws ApiError + */ +export const setFlowUserState = (data: SetFlowUserStateData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/flow/user_states/{id}/{key}', + path: { + workspace: data.workspace, + id: data.id, + key: data.key + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get flow user state at a given key + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.key + * @returns unknown flow user state updated + * @throws ApiError + */ +export const getFlowUserState = (data: GetFlowUserStateData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs/flow/user_states/{id}/{key}', + path: { + workspace: data.workspace, + id: data.id, + key: data.key + } +}); }; + +/** + * resume a job for a suspended flow as an owner + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody + * @returns string job resumed + * @throws ApiError + */ +export const resumeSuspendedFlowAsOwner = (data: ResumeSuspendedFlowAsOwnerData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs/flow/resume/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * cancel a job for a suspended flow + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.signature + * @param data.approver + * @returns string job canceled + * @throws ApiError + */ +export const cancelSuspendedJobGet = (data: CancelSuspendedJobGetData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId, + signature: data.signature + }, + query: { + approver: data.approver + } +}); }; + +/** + * cancel a job for a suspended flow + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.signature + * @param data.requestBody + * @param data.approver + * @returns string job canceled + * @throws ApiError + */ +export const cancelSuspendedJobPost = (data: CancelSuspendedJobPostData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId, + signature: data.signature + }, + query: { + approver: data.approver + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get parent flow job of suspended job + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.resumeId + * @param data.signature + * @param data.approver + * @returns unknown parent flow details + * @throws ApiError + */ +export const getSuspendedJobFlow = (data: GetSuspendedJobFlowData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}', + path: { + workspace: data.workspace, + id: data.id, + resume_id: data.resumeId, + signature: data.signature + }, + query: { + approver: data.approver + } +}); }; + +/** + * preview schedule + * @param data The data for the request. + * @param data.requestBody schedule + * @returns string List of 5 estimated upcoming execution events (in UTC) + * @throws ApiError + */ +export const previewSchedule = (data: PreviewScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/schedules/preview', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create schedule + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new schedule + * @returns string schedule created + * @throws ApiError + */ +export const createSchedule = (data: CreateScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/schedules/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update schedule + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated schedule + * @returns string schedule updated + * @throws ApiError + */ +export const updateSchedule = (data: UpdateScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/schedules/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * set enabled schedule + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated schedule enable + * @returns string schedule enabled set + * @throws ApiError + */ +export const setScheduleEnabled = (data: SetScheduleEnabledData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/schedules/setenabled/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete schedule + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string schedule deleted + * @throws ApiError + */ +export const deleteSchedule = (data: DeleteScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/schedules/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get schedule + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns Schedule schedule deleted + * @throws ApiError + */ +export const getSchedule = (data: GetScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/schedules/get/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * does schedule exists + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean schedule exists + * @throws ApiError + */ +export const existsSchedule = (data: ExistsScheduleData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/schedules/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list schedules + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.path filter by path + * @param data.isFlow + * @param data.pathStart + * @returns Schedule schedule list + * @throws ApiError + */ +export const listSchedules = (data: ListSchedulesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/schedules/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + args: data.args, + path: data.path, + is_flow: data.isFlow, + path_start: data.pathStart + } +}); }; + +/** + * list schedules with last 20 jobs + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns ScheduleWJobs schedule list + * @throws ApiError + */ +export const listSchedulesWithJobs = (data: ListSchedulesWithJobsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/schedules/list_with_jobs', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * Set default error or recoevery handler + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Handler description + * @returns unknown default error handler set + * @throws ApiError + */ +export const setDefaultErrorOrRecoveryHandler = (data: SetDefaultErrorOrRecoveryHandlerData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/schedules/setdefaulthandler', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * create http trigger + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody new http trigger + * @returns string http trigger created + * @throws ApiError + */ +export const createHttpTrigger = (data: CreateHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/http_triggers/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update http trigger + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.requestBody updated trigger + * @returns string http trigger updated + * @throws ApiError + */ +export const updateHttpTrigger = (data: UpdateHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/http_triggers/update/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete http trigger + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns string http trigger deleted + * @throws ApiError + */ +export const deleteHttpTrigger = (data: DeleteHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/http_triggers/delete/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get http trigger + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns HttpTrigger http trigger deleted + * @throws ApiError + */ +export const getHttpTrigger = (data: GetHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/http_triggers/get/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * list http triggers + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.path filter by path + * @param data.isFlow + * @param data.pathStart + * @returns HttpTrigger http trigger list + * @throws ApiError + */ +export const listHttpTriggers = (data: ListHttpTriggersData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/http_triggers/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage, + path: data.path, + is_flow: data.isFlow, + path_start: data.pathStart + } +}); }; + +/** + * does http trigger exists + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns boolean http trigger exists + * @throws ApiError + */ +export const existsHttpTrigger = (data: ExistsHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/http_triggers/exists/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * does route exists + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody route exists request + * @returns boolean route exists + * @throws ApiError + */ +export const existsRoute = (data: ExistsRouteData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/http_triggers/route_exists', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * whether http triggers are used + * @param data The data for the request. + * @param data.workspace + * @returns boolean whether http triggers are used + * @throws ApiError + */ +export const used = (data: UsedData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/http_triggers/used', + path: { + workspace: data.workspace + } +}); }; + +/** + * list instance groups + * @returns InstanceGroup instance group list + * @throws ApiError + */ +export const listInstanceGroups = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/groups/list' +}); }; + +/** + * get instance group + * @param data The data for the request. + * @param data.name + * @returns InstanceGroup instance group + * @throws ApiError + */ +export const getInstanceGroup = (data: GetInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/groups/get/{name}', + path: { + name: data.name + } +}); }; + +/** + * create instance group + * @param data The data for the request. + * @param data.requestBody create instance group + * @returns string instance group created + * @throws ApiError + */ +export const createInstanceGroup = (data: CreateInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/groups/create', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update instance group + * @param data The data for the request. + * @param data.name + * @param data.requestBody update instance group + * @returns string instance group updated + * @throws ApiError + */ +export const updateInstanceGroup = (data: UpdateInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/groups/update/{name}', + path: { + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete instance group + * @param data The data for the request. + * @param data.name + * @returns string instance group deleted + * @throws ApiError + */ +export const deleteInstanceGroup = (data: DeleteInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/groups/delete/{name}', + path: { + name: data.name + } +}); }; + +/** + * add user to instance group + * @param data The data for the request. + * @param data.name + * @param data.requestBody user to add to instance group + * @returns string user added to instance group + * @throws ApiError + */ +export const addUserToInstanceGroup = (data: AddUserToInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/groups/adduser/{name}', + path: { + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * remove user from instance group + * @param data The data for the request. + * @param data.name + * @param data.requestBody user to remove from instance group + * @returns string user removed from instance group + * @throws ApiError + */ +export const removeUserFromInstanceGroup = (data: RemoveUserFromInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/groups/removeuser/{name}', + path: { + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * export instance groups + * @returns ExportedInstanceGroup exported instance groups + * @throws ApiError + */ +export const exportInstanceGroups = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/groups/export' +}); }; + +/** + * overwrite instance groups + * @param data The data for the request. + * @param data.requestBody overwrite instance groups + * @returns string success message + * @throws ApiError + */ +export const overwriteInstanceGroups = (data: OverwriteInstanceGroupsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/groups/overwrite', + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list groups + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns Group group list + * @throws ApiError + */ +export const listGroups = (data: ListGroupsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/groups/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * list group names + * @param data The data for the request. + * @param data.workspace + * @param data.onlyMemberOf only list the groups the user is member of (default false) + * @returns string group list + * @throws ApiError + */ +export const listGroupNames = (data: ListGroupNamesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/groups/listnames', + path: { + workspace: data.workspace + }, + query: { + only_member_of: data.onlyMemberOf + } +}); }; + +/** + * create group + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody create group + * @returns string group created + * @throws ApiError + */ +export const createGroup = (data: CreateGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/groups/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update group + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody updated group + * @returns string group updated + * @throws ApiError + */ +export const updateGroup = (data: UpdateGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/groups/update/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete group + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns string group deleted + * @throws ApiError + */ +export const deleteGroup = (data: DeleteGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/groups/delete/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * get group + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns Group group + * @throws ApiError + */ +export const getGroup = (data: GetGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/groups/get/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * add user to group + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody added user to group + * @returns string user added to group + * @throws ApiError + */ +export const addUserToGroup = (data: AddUserToGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/groups/adduser/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * remove user to group + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody added user to group + * @returns string user removed from group + * @throws ApiError + */ +export const removeUserToGroup = (data: RemoveUserToGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/groups/removeuser/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list folders + * @param data The data for the request. + * @param data.workspace + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns Folder folder list + * @throws ApiError + */ +export const listFolders = (data: ListFoldersData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/folders/list', + path: { + workspace: data.workspace + }, + query: { + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * list folder names + * @param data The data for the request. + * @param data.workspace + * @param data.onlyMemberOf only list the folders the user is member of (default false) + * @returns string folder list + * @throws ApiError + */ +export const listFolderNames = (data: ListFolderNamesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/folders/listnames', + path: { + workspace: data.workspace + }, + query: { + only_member_of: data.onlyMemberOf + } +}); }; + +/** + * create folder + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody create folder + * @returns string folder created + * @throws ApiError + */ +export const createFolder = (data: CreateFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/folders/create', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update folder + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody update folder + * @returns string folder updated + * @throws ApiError + */ +export const updateFolder = (data: UpdateFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/folders/update/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * delete folder + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns string folder deleted + * @throws ApiError + */ +export const deleteFolder = (data: DeleteFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/folders/delete/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * get folder + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns Folder folder + * @throws ApiError + */ +export const getFolder = (data: GetFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/folders/get/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * get folder usage + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @returns unknown folder + * @throws ApiError + */ +export const getFolderUsage = (data: GetFolderUsageData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/folders/getusage/{name}', + path: { + workspace: data.workspace, + name: data.name + } +}); }; + +/** + * add owner to folder + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody owner user to folder + * @returns string owner added to folder + * @throws ApiError + */ +export const addOwnerToFolder = (data: AddOwnerToFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/folders/addowner/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * remove owner to folder + * @param data The data for the request. + * @param data.workspace + * @param data.name + * @param data.requestBody added owner to folder + * @returns string owner removed from folder + * @throws ApiError + */ +export const removeOwnerToFolder = (data: RemoveOwnerToFolderData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/folders/removeowner/{name}', + path: { + workspace: data.workspace, + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * list workers + * @param data The data for the request. + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.pingSince number of seconds the worker must have had a last ping more recent of (default to 300) + * @returns WorkerPing a list of workers + * @throws ApiError + */ +export const listWorkers = (data: ListWorkersData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/list', + query: { + page: data.page, + per_page: data.perPage, + ping_since: data.pingSince + } +}); }; + +/** + * exists worker with tag + * @param data The data for the request. + * @param data.tag + * @returns boolean whether a worker with the tag exists + * @throws ApiError + */ +export const existsWorkerWithTag = (data: ExistsWorkerWithTagData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/exists_worker_with_tag', + query: { + tag: data.tag + } +}); }; + +/** + * get queue metrics + * @returns unknown metrics + * @throws ApiError + */ +export const getQueueMetrics = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/workers/queue_metrics' +}); }; + +/** + * list worker groups + * @returns unknown a list of worker group configs + * @throws ApiError + */ +export const listWorkerGroups = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/configs/list_worker_groups' +}); }; + +/** + * get config + * @param data The data for the request. + * @param data.name + * @returns unknown a config + * @throws ApiError + */ +export const getConfig = (data: GetConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/configs/get/{name}', + path: { + name: data.name + } +}); }; + +/** + * Update config + * @param data The data for the request. + * @param data.name + * @param data.requestBody worker group + * @returns string Update a worker group + * @throws ApiError + */ +export const updateConfig = (data: UpdateConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/configs/update/{name}', + path: { + name: data.name + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Delete Config + * @param data The data for the request. + * @param data.name + * @returns string Delete config + * @throws ApiError + */ +export const deleteConfig = (data: DeleteConfigData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/configs/update/{name}', + path: { + name: data.name + } +}); }; + +/** + * list configs + * @returns Config list of configs + * @throws ApiError + */ +export const listConfigs = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/configs/list' +}); }; + +/** + * get granular acls + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.kind + * @returns boolean acls + * @throws ApiError + */ +export const getGranularAcls = (data: GetGranularAclsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/acls/get/{kind}/{path}', + path: { + workspace: data.workspace, + path: data.path, + kind: data.kind + } +}); }; + +/** + * add granular acls + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.kind + * @param data.requestBody acl to add + * @returns string granular acl added + * @throws ApiError + */ +export const addGranularAcls = (data: AddGranularAclsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/acls/add/{kind}/{path}', + path: { + workspace: data.workspace, + path: data.path, + kind: data.kind + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * remove granular acls + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.kind + * @param data.requestBody acl to add + * @returns string granular acl removed + * @throws ApiError + */ +export const removeGranularAcls = (data: RemoveGranularAclsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/acls/remove/{kind}/{path}', + path: { + workspace: data.workspace, + path: data.path, + kind: data.kind + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * update flow preview capture + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns void flow preview captured + * @throws ApiError + */ +export const updateCapture = (data: UpdateCaptureData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/capture_u/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * create flow preview capture + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown flow preview capture created + * @throws ApiError + */ +export const createCapture = (data: CreateCaptureData): CancelablePromise => { return __request(OpenAPI, { + method: 'PUT', + url: '/w/{workspace}/capture/{path}', + path: { + workspace: data.workspace, + path: data.path + } +}); }; + +/** + * get flow preview capture + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @returns unknown captured flow preview + * @throws ApiError + */ +export const getCapture = (data: GetCaptureData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/capture/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + errors: { + 404: 'capture does not exist for this flow' + } +}); }; + +/** + * star item + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns unknown star item + * @throws ApiError + */ +export const star = (data: StarData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/favorites/star', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * unstar item + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody + * @returns unknown unstar item + * @throws ApiError + */ +export const unstar = (data: UnstarData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/favorites/unstar', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * List Inputs used in previously completed jobs + * @param data The data for the request. + * @param data.workspace + * @param data.runnableId + * @param data.runnableType + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns Input Input history for completed jobs + * @throws ApiError + */ +export const getInputHistory = (data: GetInputHistoryData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/inputs/history', + path: { + workspace: data.workspace + }, + query: { + runnable_id: data.runnableId, + runnable_type: data.runnableType, + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * Get args from history or saved input + * @param data The data for the request. + * @param data.workspace + * @param data.jobOrInputId + * @param data.input + * @param data.allowLarge + * @returns unknown args + * @throws ApiError + */ +export const getArgsFromHistoryOrSavedInput = (data: GetArgsFromHistoryOrSavedInputData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/inputs/{jobOrInputId}/args', + path: { + workspace: data.workspace, + jobOrInputId: data.jobOrInputId + }, + query: { + input: data.input, + allow_large: data.allowLarge + } +}); }; + +/** + * List saved Inputs for a Runnable + * @param data The data for the request. + * @param data.workspace + * @param data.runnableId + * @param data.runnableType + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @returns Input Saved Inputs for a Runnable + * @throws ApiError + */ +export const listInputs = (data: ListInputsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/inputs/list', + path: { + workspace: data.workspace + }, + query: { + runnable_id: data.runnableId, + runnable_type: data.runnableType, + page: data.page, + per_page: data.perPage + } +}); }; + +/** + * Create an Input for future use in a script or flow + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody Input + * @param data.runnableId + * @param data.runnableType + * @returns string Input created + * @throws ApiError + */ +export const createInput = (data: CreateInputData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/inputs/create', + path: { + workspace: data.workspace + }, + query: { + runnable_id: data.runnableId, + runnable_type: data.runnableType + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Update an Input + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody UpdateInput + * @returns string Input updated + * @throws ApiError + */ +export const updateInput = (data: UpdateInputData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/inputs/update', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Delete a Saved Input + * @param data The data for the request. + * @param data.workspace + * @param data.input + * @returns string Input deleted + * @throws ApiError + */ +export const deleteInput = (data: DeleteInputData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/inputs/delete/{input}', + path: { + workspace: data.workspace, + input: data.input + } +}); }; + +/** + * Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody S3 resource to connect to + * @returns unknown Connection settings + * @throws ApiError + */ +export const duckdbConnectionSettings = (data: DuckdbConnectionSettingsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/duckdb_connection_settings', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used + * @returns unknown Connection settings + * @throws ApiError + */ +export const duckdbConnectionSettingsV2 = (data: DuckdbConnectionSettingsV2Data): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/v2/duckdb_connection_settings', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody S3 resource to connect to + * @returns unknown Connection settings + * @throws ApiError + */ +export const polarsConnectionSettings = (data: PolarsConnectionSettingsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/polars_connection_settings', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used + * @returns unknown Connection settings + * @throws ApiError + */ +export const polarsConnectionSettingsV2 = (data: PolarsConnectionSettingsV2Data): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/v2/polars_connection_settings', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Returns the s3 resource associated to the provided path, or the workspace default S3 resource + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody S3 resource path to use. If empty, the S3 resource defined in the workspace settings will be used + * @returns S3Resource Connection settings + * @throws ApiError + */ +export const s3ResourceInfo = (data: S3ResourceInfoData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/v2/s3_resource_info', + path: { + workspace: data.workspace + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * Test connection to the workspace object storage + * @param data The data for the request. + * @param data.workspace + * @param data.storage + * @returns unknown Connection settings + * @throws ApiError + */ +export const datasetStorageTestConnection = (data: DatasetStorageTestConnectionData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/test_connection', + path: { + workspace: data.workspace + }, + query: { + storage: data.storage + } +}); }; + +/** + * List the file keys available in a workspace object storage + * @param data The data for the request. + * @param data.workspace + * @param data.maxKeys + * @param data.marker + * @param data.prefix + * @param data.storage + * @returns unknown List of file keys + * @throws ApiError + */ +export const listStoredFiles = (data: ListStoredFilesData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/list_stored_files', + path: { + workspace: data.workspace + }, + query: { + max_keys: data.maxKeys, + marker: data.marker, + prefix: data.prefix, + storage: data.storage + } +}); }; + +/** + * Load metadata of the file + * @param data The data for the request. + * @param data.workspace + * @param data.fileKey + * @param data.storage + * @returns WindmillFileMetadata FileMetadata + * @throws ApiError + */ +export const loadFileMetadata = (data: LoadFileMetadataData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/load_file_metadata', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + storage: data.storage + } +}); }; + +/** + * Load a preview of the file + * @param data The data for the request. + * @param data.workspace + * @param data.fileKey + * @param data.fileSizeInBytes + * @param data.fileMimeType + * @param data.csvSeparator + * @param data.csvHasHeader + * @param data.readBytesFrom + * @param data.readBytesLength + * @param data.storage + * @returns WindmillFilePreview FilePreview + * @throws ApiError + */ +export const loadFilePreview = (data: LoadFilePreviewData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/load_file_preview', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + file_size_in_bytes: data.fileSizeInBytes, + file_mime_type: data.fileMimeType, + csv_separator: data.csvSeparator, + csv_has_header: data.csvHasHeader, + read_bytes_from: data.readBytesFrom, + read_bytes_length: data.readBytesLength, + storage: data.storage + } +}); }; + +/** + * Load a preview of a parquet file + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.offset + * @param data.limit + * @param data.sortCol + * @param data.sortDesc + * @param data.searchCol + * @param data.searchTerm + * @param data.storage + * @returns unknown Parquet Preview + * @throws ApiError + */ +export const loadParquetPreview = (data: LoadParquetPreviewData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/load_parquet_preview/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + offset: data.offset, + limit: data.limit, + sort_col: data.sortCol, + sort_desc: data.sortDesc, + search_col: data.searchCol, + search_term: data.searchTerm, + storage: data.storage + } +}); }; + +/** + * Load the table row count + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.searchCol + * @param data.searchTerm + * @param data.storage + * @returns unknown Table count + * @throws ApiError + */ +export const loadTableRowCount = (data: LoadTableRowCountData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/load_table_count/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + search_col: data.searchCol, + search_term: data.searchTerm, + storage: data.storage + } +}); }; + +/** + * Load a preview of a csv file + * @param data The data for the request. + * @param data.workspace + * @param data.path + * @param data.offset + * @param data.limit + * @param data.sortCol + * @param data.sortDesc + * @param data.searchCol + * @param data.searchTerm + * @param data.storage + * @param data.csvSeparator + * @returns unknown Csv Preview + * @throws ApiError + */ +export const loadCsvPreview = (data: LoadCsvPreviewData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/load_csv_preview/{path}', + path: { + workspace: data.workspace, + path: data.path + }, + query: { + offset: data.offset, + limit: data.limit, + sort_col: data.sortCol, + sort_desc: data.sortDesc, + search_col: data.searchCol, + search_term: data.searchTerm, + storage: data.storage, + csv_separator: data.csvSeparator + } +}); }; + +/** + * Permanently delete file from S3 + * @param data The data for the request. + * @param data.workspace + * @param data.fileKey + * @param data.storage + * @returns unknown Confirmation + * @throws ApiError + */ +export const deleteS3File = (data: DeleteS3FileData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/w/{workspace}/job_helpers/delete_s3_file', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + storage: data.storage + } +}); }; + +/** + * Move a S3 file from one path to the other within the same bucket + * @param data The data for the request. + * @param data.workspace + * @param data.srcFileKey + * @param data.destFileKey + * @param data.storage + * @returns unknown Confirmation + * @throws ApiError + */ +export const moveS3File = (data: MoveS3FileData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/move_s3_file', + path: { + workspace: data.workspace + }, + query: { + src_file_key: data.srcFileKey, + dest_file_key: data.destFileKey, + storage: data.storage + } +}); }; + +/** + * Upload file to S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.requestBody File content + * @param data.fileKey + * @param data.fileExtension + * @param data.s3ResourcePath + * @param data.resourceType + * @param data.storage + * @returns unknown File upload status + * @throws ApiError + */ +export const fileUpload = (data: FileUploadData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_helpers/upload_s3_file', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + file_extension: data.fileExtension, + s3_resource_path: data.s3ResourcePath, + resource_type: data.resourceType, + storage: data.storage + }, + body: data.requestBody, + mediaType: 'application/octet-stream' +}); }; + +/** + * Download file to S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.fileKey + * @param data.s3ResourcePath + * @param data.resourceType + * @param data.storage + * @returns binary Chunk of the downloaded file + * @throws ApiError + */ +export const fileDownload = (data: FileDownloadData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/download_s3_file', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + s3_resource_path: data.s3ResourcePath, + resource_type: data.resourceType, + storage: data.storage + } +}); }; + +/** + * Download file to S3 bucket + * @param data The data for the request. + * @param data.workspace + * @param data.fileKey + * @param data.s3ResourcePath + * @param data.resourceType + * @returns string The downloaded file + * @throws ApiError + */ +export const fileDownloadParquetAsCsv = (data: FileDownloadParquetAsCsvData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_helpers/download_s3_parquet_file_as_csv', + path: { + workspace: data.workspace + }, + query: { + file_key: data.fileKey, + s3_resource_path: data.s3ResourcePath, + resource_type: data.resourceType + } +}); }; + +/** + * get job metrics + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody parameters for statistics retrieval + * @returns unknown job details + * @throws ApiError + */ +export const getJobMetrics = (data: GetJobMetricsData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_metrics/get/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * set job metrics + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @param data.requestBody parameters for statistics retrieval + * @returns unknown Job progress updated + * @throws ApiError + */ +export const setJobProgress = (data: SetJobProgressData): CancelablePromise => { return __request(OpenAPI, { + method: 'POST', + url: '/w/{workspace}/job_metrics/set_progress/{id}', + path: { + workspace: data.workspace, + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json' +}); }; + +/** + * get job progress + * @param data The data for the request. + * @param data.workspace + * @param data.id + * @returns number job progress between 0 and 99 + * @throws ApiError + */ +export const getJobProgress = (data: GetJobProgressData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/job_metrics/get_progress/{id}', + path: { + workspace: data.workspace, + id: data.id + } +}); }; + +/** + * list log files ordered by timestamp + * @param data The data for the request. + * @param data.before filter on started before (inclusive) timestamp + * @param data.after filter on created after (exclusive) timestamp + * @param data.withError + * @returns unknown time + * @throws ApiError + */ +export const listLogFiles = (data: ListLogFilesData = {}): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/service_logs/list_files', + query: { + before: data.before, + after: data.after, + with_error: data.withError + } +}); }; + +/** + * get log file by path + * @param data The data for the request. + * @param data.path + * @returns string log stream + * @throws ApiError + */ +export const getLogFile = (data: GetLogFileData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/service_logs/get_log_file/{path}', + path: { + path: data.path + } +}); }; + +/** + * List all concurrency groups + * @returns ConcurrencyGroup all concurrency groups + * @throws ApiError + */ +export const listConcurrencyGroups = (): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/concurrency_groups/list' +}); }; + +/** + * Delete concurrency group + * @param data The data for the request. + * @param data.concurrencyId + * @returns unknown concurrency group removed + * @throws ApiError + */ +export const deleteConcurrencyGroup = (data: DeleteConcurrencyGroupData): CancelablePromise => { return __request(OpenAPI, { + method: 'DELETE', + url: '/concurrency_groups/prune/{concurrency_id}', + path: { + concurrency_id: data.concurrencyId + } +}); }; + +/** + * Get the concurrency key for a job that has concurrency limits enabled + * @param data The data for the request. + * @param data.id + * @returns string concurrency key for given job + * @throws ApiError + */ +export const getConcurrencyKey = (data: GetConcurrencyKeyData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/concurrency_groups/{id}/key', + path: { + id: data.id + } +}); }; + +/** + * Get intervals of job runtime concurrency + * @param data The data for the request. + * @param data.workspace + * @param data.concurrencyKey + * @param data.rowLimit + * @param data.createdBy mask to filter exact matching user creator + * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') + * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any + * @param data.scriptPathExact mask to filter exact matching path + * @param data.scriptPathStart mask to filter matching starting path + * @param data.schedulePath mask to filter by schedule path + * @param data.scriptHash mask to filter exact matching path + * @param data.startedBefore filter on started before (inclusive) timestamp + * @param data.startedAfter filter on started after (exclusive) timestamp + * @param data.createdOrStartedBefore filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp + * @param data.running filter on running jobs + * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) + * @param data.createdOrStartedAfter filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp + * @param data.createdOrStartedAfterCompletedJobs filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs + * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + * @param data.args filter on jobs containing those args as a json subset (@> in postgres) + * @param data.tag filter on jobs with a given tag/worker group + * @param data.result filter on jobs containing those result as a json subset (@> in postgres) + * @param data.page which page to return (start at 1, default 1) + * @param data.perPage number of items to return for a given page (default 30, max 100) + * @param data.isSkipped is the job skipped + * @param data.isFlowStep is the job a flow step + * @param data.hasNullParent has null parent + * @param data.success filter on successful jobs + * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) + * @param data.isNotSchedule is not a scheduled job + * @returns ExtendedJobs time + * @throws ApiError + */ +export const listExtendedJobs = (data: ListExtendedJobsData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/w/{workspace}/concurrency_groups/list_jobs', + path: { + workspace: data.workspace + }, + query: { + concurrency_key: data.concurrencyKey, + row_limit: data.rowLimit, + created_by: data.createdBy, + label: data.label, + parent_job: data.parentJob, + script_path_exact: data.scriptPathExact, + script_path_start: data.scriptPathStart, + schedule_path: data.schedulePath, + script_hash: data.scriptHash, + started_before: data.startedBefore, + started_after: data.startedAfter, + created_or_started_before: data.createdOrStartedBefore, + running: data.running, + scheduled_for_before_now: data.scheduledForBeforeNow, + created_or_started_after: data.createdOrStartedAfter, + created_or_started_after_completed_jobs: data.createdOrStartedAfterCompletedJobs, + job_kinds: data.jobKinds, + args: data.args, + tag: data.tag, + result: data.result, + page: data.page, + per_page: data.perPage, + is_skipped: data.isSkipped, + is_flow_step: data.isFlowStep, + has_null_parent: data.hasNullParent, + success: data.success, + all_workspaces: data.allWorkspaces, + is_not_schedule: data.isNotSchedule + } +}); }; + +/** + * Search through jobs with a string query + * @param data The data for the request. + * @param data.workspace + * @param data.searchQuery + * @returns unknown search results + * @throws ApiError + */ +export const searchJobsIndex = (data: SearchJobsIndexData): CancelablePromise => { return __request(OpenAPI, { + method: 'GET', + url: '/srch/w/{workspace}/index/search/job', + path: { + workspace: data.workspace + }, + query: { + search_query: data.searchQuery + } +}); }; \ No newline at end of file diff --git a/cli/gen/types.gen.ts b/cli/gen/types.gen.ts new file mode 100644 index 0000000000000..e066cf1436093 --- /dev/null +++ b/cli/gen/types.gen.ts @@ -0,0 +1,5796 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Script = { + workspace_id?: string; + hash: string; + path: string; + /** + * The first element is the direct parent of the script, the second is the parent of the first, etc + * + */ + parent_hashes?: Array<(string)>; + summary: string; + description: string; + content: string; + created_by: string; + created_at: string; + archived: boolean; + schema?: { + [key: string]: unknown; + }; + deleted: boolean; + is_template: boolean; + extra_perms: { + [key: string]: (boolean); + }; + lock?: string; + lock_error_logs?: string; + language: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + kind: 'script' | 'failure' | 'trigger' | 'command' | 'approval'; + starred: boolean; + tag?: string; + has_draft?: boolean; + draft_only?: boolean; + envs?: Array<(string)>; + concurrent_limit?: number; + concurrency_time_window_s?: number; + concurrency_key?: string; + cache_ttl?: number; + dedicated_worker?: boolean; + ws_error_handler_muted?: boolean; + priority?: number; + restart_unless_cancelled?: boolean; + timeout?: number; + delete_after_use?: boolean; + visible_to_runner_only?: boolean; + no_main_func: boolean; + codebase?: string; + has_preprocessor: boolean; +}; + +export type language = 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + +export type kind = 'script' | 'failure' | 'trigger' | 'command' | 'approval'; + +export type NewScript = { + path: string; + parent_hash?: string; + summary: string; + description: string; + content: string; + schema?: { + [key: string]: unknown; + }; + is_template?: boolean; + lock?: string; + language: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + kind?: 'script' | 'failure' | 'trigger' | 'command' | 'approval'; + tag?: string; + draft_only?: boolean; + envs?: Array<(string)>; + concurrent_limit?: number; + concurrency_time_window_s?: number; + cache_ttl?: number; + dedicated_worker?: boolean; + ws_error_handler_muted?: boolean; + priority?: number; + restart_unless_cancelled?: boolean; + timeout?: number; + delete_after_use?: boolean; + deployment_message?: string; + concurrency_key?: string; + visible_to_runner_only?: boolean; + no_main_func?: boolean; + codebase?: string; + has_preprocessor?: boolean; +}; + +export type NewScriptWithDraft = NewScript & { + draft?: NewScript; + hash: string; +}; + +export type ScriptHistory = { + script_hash: string; + deployment_msg?: string; +}; + +export type ScriptArgs = { + [key: string]: unknown; +}; + +export type Input = { + id: string; + name: string; + created_by: string; + created_at: string; + is_public: boolean; + success?: boolean; +}; + +export type CreateInput = { + name: string; + args: { + [key: string]: unknown; + }; +}; + +export type UpdateInput = { + id: string; + name: string; + is_public: boolean; +}; + +export type RunnableType = 'ScriptHash' | 'ScriptPath' | 'FlowPath'; + +export type QueuedJob = { + workspace_id?: string; + id: string; + parent_job?: string; + created_by?: string; + created_at?: string; + started_at?: string; + scheduled_for?: string; + running: boolean; + script_path?: string; + script_hash?: string; + args?: ScriptArgs; + logs?: string; + raw_code?: string; + canceled: boolean; + canceled_by?: string; + canceled_reason?: string; + last_ping?: string; + job_kind: 'script' | 'preview' | 'dependencies' | 'flowdependencies' | 'appdependencies' | 'flow' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow'; + schedule_path?: string; + /** + * The user (u/userfoo) or group (g/groupfoo) whom + * the execution of this script will be permissioned_as and by extension its DT_TOKEN. + * + */ + permissioned_as: string; + flow_status?: FlowStatus; + raw_flow?: FlowValue; + is_flow_step: boolean; + language?: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + email: string; + visible_to_owner: boolean; + mem_peak?: number; + tag: string; + priority?: number; + self_wait_time_ms?: number; + aggregate_wait_time_ms?: number; +}; + +export type job_kind = 'script' | 'preview' | 'dependencies' | 'flowdependencies' | 'appdependencies' | 'flow' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow'; + +export type CompletedJob = { + workspace_id?: string; + id: string; + parent_job?: string; + created_by: string; + created_at: string; + started_at: string; + duration_ms: number; + success: boolean; + script_path?: string; + script_hash?: string; + args?: ScriptArgs; + result?: unknown; + logs?: string; + deleted?: boolean; + raw_code?: string; + canceled: boolean; + canceled_by?: string; + canceled_reason?: string; + job_kind: 'script' | 'preview' | 'dependencies' | 'flow' | 'flowdependencies' | 'appdependencies' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow'; + schedule_path?: string; + /** + * The user (u/userfoo) or group (g/groupfoo) whom + * the execution of this script will be permissioned_as and by extension its DT_TOKEN. + * + */ + permissioned_as: string; + flow_status?: FlowStatus; + raw_flow?: FlowValue; + is_flow_step: boolean; + language?: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + is_skipped: boolean; + email: string; + visible_to_owner: boolean; + mem_peak?: number; + tag: string; + priority?: number; + labels?: Array<(string)>; + self_wait_time_ms?: number; + aggregate_wait_time_ms?: number; +}; + +export type ObscuredJob = { + typ?: string; + started_at?: string; + duration_ms?: number; +}; + +export type Job = (CompletedJob & { + type?: 'CompletedJob'; +}) | (QueuedJob & { + type?: 'QueuedJob'; +}); + +export type type = 'CompletedJob'; + +export type User = { + email: string; + username: string; + is_admin: boolean; + is_super_admin: boolean; + created_at: string; + operator: boolean; + disabled: boolean; + groups?: Array<(string)>; + folders: Array<(string)>; + folders_owners: Array<(string)>; +}; + +export type UserUsage = { + email?: string; + executions?: number; +}; + +export type Login = { + email: string; + password: string; +}; + +export type EditWorkspaceUser = { + is_admin?: boolean; + operator?: boolean; + disabled?: boolean; +}; + +export type TruncatedToken = { + label?: string; + expiration?: string; + token_prefix: string; + created_at: string; + last_used_at: string; + scopes?: Array<(string)>; +}; + +export type NewToken = { + label?: string; + expiration?: string; + scopes?: Array<(string)>; +}; + +export type NewTokenImpersonate = { + label?: string; + expiration?: string; + impersonate_email: string; +}; + +export type ListableVariable = { + workspace_id: string; + path: string; + value?: string; + is_secret: boolean; + description?: string; + account?: number; + is_oauth?: boolean; + extra_perms: { + [key: string]: (boolean); + }; + is_expired?: boolean; + refresh_error?: string; + is_linked?: boolean; + is_refreshed?: boolean; + expires_at?: string; +}; + +export type ContextualVariable = { + name: string; + value: string; + description: string; + is_custom: boolean; +}; + +export type CreateVariable = { + path: string; + value: string; + is_secret: boolean; + description: string; + account?: number; + is_oauth?: boolean; + expires_at?: string; +}; + +export type EditVariable = { + path?: string; + value?: string; + is_secret?: boolean; + description?: string; +}; + +export type AuditLog = { + id: number; + timestamp: string; + username: string; + operation: 'jobs.run' | 'jobs.run.script' | 'jobs.run.preview' | 'jobs.run.flow' | 'jobs.run.flow_preview' | 'jobs.run.script_hub' | 'jobs.run.dependencies' | 'jobs.run.identity' | 'jobs.run.noop' | 'jobs.flow_dependencies' | 'jobs' | 'jobs.cancel' | 'jobs.force_cancel' | 'jobs.disapproval' | 'jobs.delete' | 'account.delete' | 'openai.request' | 'resources.create' | 'resources.update' | 'resources.delete' | 'resource_types.create' | 'resource_types.update' | 'resource_types.delete' | 'schedule.create' | 'schedule.setenabled' | 'schedule.edit' | 'schedule.delete' | 'scripts.create' | 'scripts.update' | 'scripts.archive' | 'scripts.delete' | 'users.create' | 'users.delete' | 'users.update' | 'users.login' | 'users.logout' | 'users.accept_invite' | 'users.decline_invite' | 'users.token.create' | 'users.token.delete' | 'users.add_to_workspace' | 'users.add_global' | 'users.setpassword' | 'users.impersonate' | 'users.leave_workspace' | 'oauth.login' | 'oauth.signup' | 'variables.create' | 'variables.delete' | 'variables.update' | 'flows.create' | 'flows.update' | 'flows.delete' | 'flows.archive' | 'apps.create' | 'apps.update' | 'apps.delete' | 'folder.create' | 'folder.update' | 'folder.delete' | 'folder.add_owner' | 'folder.remove_owner' | 'group.create' | 'group.delete' | 'group.edit' | 'group.adduser' | 'group.removeuser' | 'igroup.create' | 'igroup.delete' | 'igroup.adduser' | 'igroup.removeuser' | 'variables.decrypt_secret' | 'workspaces.edit_command_script' | 'workspaces.edit_deploy_to' | 'workspaces.edit_auto_invite_domain' | 'workspaces.edit_webhook' | 'workspaces.edit_copilot_config' | 'workspaces.edit_error_handler' | 'workspaces.create' | 'workspaces.update' | 'workspaces.archive' | 'workspaces.unarchive' | 'workspaces.delete'; + action_kind: 'Created' | 'Updated' | 'Delete' | 'Execute'; + resource?: string; + parameters?: { + [key: string]: unknown; + }; +}; + +export type operation = 'jobs.run' | 'jobs.run.script' | 'jobs.run.preview' | 'jobs.run.flow' | 'jobs.run.flow_preview' | 'jobs.run.script_hub' | 'jobs.run.dependencies' | 'jobs.run.identity' | 'jobs.run.noop' | 'jobs.flow_dependencies' | 'jobs' | 'jobs.cancel' | 'jobs.force_cancel' | 'jobs.disapproval' | 'jobs.delete' | 'account.delete' | 'openai.request' | 'resources.create' | 'resources.update' | 'resources.delete' | 'resource_types.create' | 'resource_types.update' | 'resource_types.delete' | 'schedule.create' | 'schedule.setenabled' | 'schedule.edit' | 'schedule.delete' | 'scripts.create' | 'scripts.update' | 'scripts.archive' | 'scripts.delete' | 'users.create' | 'users.delete' | 'users.update' | 'users.login' | 'users.logout' | 'users.accept_invite' | 'users.decline_invite' | 'users.token.create' | 'users.token.delete' | 'users.add_to_workspace' | 'users.add_global' | 'users.setpassword' | 'users.impersonate' | 'users.leave_workspace' | 'oauth.login' | 'oauth.signup' | 'variables.create' | 'variables.delete' | 'variables.update' | 'flows.create' | 'flows.update' | 'flows.delete' | 'flows.archive' | 'apps.create' | 'apps.update' | 'apps.delete' | 'folder.create' | 'folder.update' | 'folder.delete' | 'folder.add_owner' | 'folder.remove_owner' | 'group.create' | 'group.delete' | 'group.edit' | 'group.adduser' | 'group.removeuser' | 'igroup.create' | 'igroup.delete' | 'igroup.adduser' | 'igroup.removeuser' | 'variables.decrypt_secret' | 'workspaces.edit_command_script' | 'workspaces.edit_deploy_to' | 'workspaces.edit_auto_invite_domain' | 'workspaces.edit_webhook' | 'workspaces.edit_copilot_config' | 'workspaces.edit_error_handler' | 'workspaces.create' | 'workspaces.update' | 'workspaces.archive' | 'workspaces.unarchive' | 'workspaces.delete'; + +export type action_kind = 'Created' | 'Updated' | 'Delete' | 'Execute'; + +export type MainArgSignature = { + type: 'Valid' | 'Invalid'; + error: string; + star_args: boolean; + star_kwargs?: boolean; + args: Array<{ + name: string; + typ: ('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { + resource: (string) | null; +} | { + str: Array<(string)> | null; +} | { + object: Array<{ + key: string; + typ: ('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { + str: unknown; +}); + }>; +} | { + list: (('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { + str: unknown; +}) | null); +}); + has_default?: boolean; + default?: unknown; + }>; + no_main_func: (boolean) | null; + has_preprocessor: (boolean) | null; +}; + +export type type2 = 'Valid' | 'Invalid'; + +export type Preview = { + content?: string; + path?: string; + args: ScriptArgs; + language?: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; + tag?: string; + kind?: 'code' | 'identity' | 'http'; + dedicated_worker?: boolean; + lock?: string; +}; + +export type kind2 = 'code' | 'identity' | 'http'; + +export type WorkflowTask = { + args: ScriptArgs; +}; + +export type WorkflowStatusRecord = { + [key: string]: WorkflowStatus; +}; + +export type WorkflowStatus = { + scheduled_for?: string; + started_at?: string; + duration_ms?: number; + name?: string; +}; + +export type CreateResource = { + path: string; + value: unknown; + description?: string; + resource_type: string; +}; + +export type EditResource = { + path?: string; + description?: string; + value?: unknown; +}; + +export type Resource = { + workspace_id?: string; + path: string; + description?: string; + resource_type: string; + value?: unknown; + is_oauth: boolean; + extra_perms?: { + [key: string]: (boolean); + }; + created_by?: string; + edited_at?: string; +}; + +export type ListableResource = { + workspace_id?: string; + path: string; + description?: string; + resource_type: string; + value?: unknown; + is_oauth: boolean; + extra_perms?: { + [key: string]: (boolean); + }; + is_expired?: boolean; + refresh_error?: string; + is_linked: boolean; + is_refreshed: boolean; + account?: number; + created_by?: string; + edited_at?: string; +}; + +export type ResourceType = { + workspace_id?: string; + name: string; + schema?: unknown; + description?: string; + created_by?: string; + edited_at?: string; + format_extension?: string; +}; + +export type EditResourceType = { + schema?: unknown; + description?: string; +}; + +export type Schedule = { + path: string; + edited_by: string; + edited_at: string; + schedule: string; + timezone: string; + enabled: boolean; + script_path: string; + is_flow: boolean; + args?: ScriptArgs; + extra_perms: { + [key: string]: (boolean); + }; + email: string; + error?: string; + on_failure?: string; + on_failure_times?: number; + on_failure_exact?: boolean; + on_failure_extra_args?: ScriptArgs; + on_recovery?: string; + on_recovery_times?: number; + on_recovery_extra_args?: ScriptArgs; + on_success?: string; + on_success_extra_args?: ScriptArgs; + ws_error_handler_muted?: boolean; + retry?: Retry; + summary?: string; + no_flow_overlap?: boolean; + tag?: string; + paused_until?: string; +}; + +export type ScheduleWJobs = Schedule & { + jobs?: Array<{ + id: string; + success: boolean; + duration_ms: number; + }>; +}; + +export type NewSchedule = { + path: string; + schedule: string; + timezone: string; + script_path: string; + is_flow: boolean; + args: ScriptArgs; + enabled?: boolean; + on_failure?: string; + on_failure_times?: number; + on_failure_exact?: boolean; + on_failure_extra_args?: ScriptArgs; + on_recovery?: string; + on_recovery_times?: number; + on_recovery_extra_args?: ScriptArgs; + on_success?: string; + on_success_extra_args?: ScriptArgs; + ws_error_handler_muted?: boolean; + retry?: Retry; + no_flow_overlap?: boolean; + summary?: string; + tag?: string; + paused_until?: string; +}; + +export type EditSchedule = { + schedule: string; + timezone: string; + args: ScriptArgs; + on_failure?: string; + on_failure_times?: number; + on_failure_exact?: boolean; + on_failure_extra_args?: ScriptArgs; + on_recovery?: string; + on_recovery_times?: number; + on_recovery_extra_args?: ScriptArgs; + on_success?: string; + on_success_extra_args?: ScriptArgs; + ws_error_handler_muted?: boolean; + retry?: Retry; + no_flow_overlap?: boolean; + summary?: string; + tag?: string; + paused_until?: string; +}; + +export type HttpTrigger = { + path: string; + edited_by: string; + edited_at: string; + script_path: string; + route_path: string; + is_flow: boolean; + extra_perms: { + [key: string]: (boolean); + }; + email: string; + workspace_id: string; + http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; + is_async: boolean; + requires_auth: boolean; +}; + +export type http_method = 'get' | 'post' | 'put' | 'delete' | 'patch'; + +export type NewHttpTrigger = { + path: string; + script_path: string; + route_path: string; + is_flow: boolean; + http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; + is_async: boolean; + requires_auth: boolean; +}; + +export type EditHttpTrigger = { + path: string; + script_path: string; + route_path?: string; + is_flow: boolean; + http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; + is_async: boolean; + requires_auth: boolean; +}; + +export type Group = { + name: string; + summary?: string; + members?: Array<(string)>; + extra_perms?: { + [key: string]: (boolean); + }; +}; + +export type InstanceGroup = { + name: string; + summary?: string; + emails?: Array<(string)>; +}; + +export type Folder = { + name: string; + owners: Array<(string)>; + extra_perms: { + [key: string]: (boolean); + }; + summary?: string; + created_by?: string; + edited_at?: string; +}; + +export type WorkerPing = { + worker: string; + worker_instance: string; + last_ping?: number; + started_at: string; + ip: string; + jobs_executed: number; + custom_tags?: Array<(string)>; + worker_group: string; + wm_version: string; + last_job_id?: string; + last_job_workspace_id?: string; + occupancy_rate?: number; + memory?: number; + vcpus?: number; + memory_usage?: number; + wm_memory_usage?: number; +}; + +export type UserWorkspaceList = { + email: string; + workspaces: Array<{ + id: string; + name: string; + username: string; + }>; +}; + +export type CreateWorkspace = { + id: string; + name: string; + username?: string; +}; + +export type Workspace = { + id: string; + name: string; + owner: string; + domain?: string; +}; + +export type WorkspaceInvite = { + workspace_id: string; + email: string; + is_admin: boolean; + operator: boolean; +}; + +export type GlobalUserInfo = { + email: string; + login_type: 'password' | 'github'; + super_admin: boolean; + verified: boolean; + name?: string; + company?: string; + username?: string; +}; + +export type login_type = 'password' | 'github'; + +export type Flow = OpenFlow & FlowMetadata; + +export type ExtraPerms = { + [key: string]: (boolean); +}; + +export type FlowMetadata = { + workspace_id?: string; + path: string; + edited_by: string; + edited_at: string; + archived: boolean; + extra_perms: ExtraPerms; + starred?: boolean; + draft_only?: boolean; + tag?: string; + ws_error_handler_muted?: boolean; + priority?: number; + dedicated_worker?: boolean; + timeout?: number; + visible_to_runner_only?: boolean; +}; + +export type OpenFlowWPath = OpenFlow & { + path: string; + tag?: string; + ws_error_handler_muted?: boolean; + priority?: number; + dedicated_worker?: boolean; + timeout?: number; + visible_to_runner_only?: boolean; +}; + +export type FlowPreview = { + value: FlowValue; + path?: string; + args: ScriptArgs; + tag?: string; + restarted_from?: RestartedFrom; +}; + +export type RestartedFrom = { + flow_job_id?: string; + step_id?: string; + branch_or_iteration_n?: number; +}; + +export type Policy = { + triggerables?: { + [key: string]: { + [key: string]: unknown; + }; + }; + triggerables_v2?: { + [key: string]: { + [key: string]: unknown; + }; + }; + execution_mode?: 'viewer' | 'publisher' | 'anonymous'; + on_behalf_of?: string; + on_behalf_of_email?: string; +}; + +export type execution_mode = 'viewer' | 'publisher' | 'anonymous'; + +export type ListableApp = { + id: number; + workspace_id: string; + path: string; + summary: string; + version: number; + extra_perms: { + [key: string]: (boolean); + }; + starred?: boolean; + edited_at: string; + execution_mode: 'viewer' | 'publisher' | 'anonymous'; +}; + +export type ListableRawApp = { + workspace_id: string; + path: string; + summary: string; + extra_perms: { + [key: string]: (boolean); + }; + starred?: boolean; + version: number; + edited_at: string; +}; + +export type AppWithLastVersion = { + id: number; + workspace_id: string; + path: string; + summary: string; + versions: Array<(number)>; + created_by: string; + created_at: string; + value: { + [key: string]: unknown; + }; + policy: Policy; + execution_mode: 'viewer' | 'publisher' | 'anonymous'; + extra_perms: { + [key: string]: (boolean); + }; +}; + +export type AppWithLastVersionWDraft = AppWithLastVersion & { + draft_only?: boolean; + draft?: unknown; +}; + +export type AppHistory = { + version: number; + deployment_msg?: string; +}; + +export type FlowVersion = { + id: number; + created_at: string; + deployment_msg?: string; +}; + +export type SlackToken = { + access_token: string; + team_id: string; + team_name: string; + bot: { + bot_access_token?: string; + }; +}; + +export type TokenResponse = { + access_token: string; + expires_in?: number; + refresh_token?: string; + scope?: Array<(string)>; +}; + +export type HubScriptKind = unknown; + +export type PolarsClientKwargs = { + region_name: string; +}; + +export type LargeFileStorage = { + type?: 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; + s3_resource_path?: string; + azure_blob_resource_path?: string; + public_resource?: boolean; + secondary_storage?: { + [key: string]: { + type?: 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; + s3_resource_path?: string; + azure_blob_resource_path?: string; + public_resource?: boolean; + }; + }; +}; + +export type type3 = 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; + +export type WindmillLargeFile = { + s3: string; +}; + +export type WindmillFileMetadata = { + mime_type?: string; + size_in_bytes?: number; + last_modified?: string; + expires?: string; + version_id?: string; +}; + +export type WindmillFilePreview = { + msg?: string; + content?: string; + content_type: 'RawText' | 'Csv' | 'Parquet' | 'Unknown'; +}; + +export type content_type = 'RawText' | 'Csv' | 'Parquet' | 'Unknown'; + +export type S3Resource = { + bucket: string; + region: string; + endPoint: string; + useSSL: boolean; + accessKey?: string; + secretKey?: string; + pathStyle: boolean; +}; + +export type WorkspaceGitSyncSettings = { + include_path?: Array<(string)>; + include_type?: Array<('script' | 'flow' | 'app' | 'folder' | 'resource' | 'variable' | 'secret' | 'resourcetype' | 'schedule' | 'user' | 'group')>; + repositories?: Array; +}; + +export type WorkspaceDeployUISettings = { + include_path?: Array<(string)>; + include_type?: Array<('script' | 'flow' | 'app' | 'resource' | 'variable' | 'secret')>; +}; + +export type WorkspaceDefaultScripts = { + order?: Array<(string)>; + hidden?: Array<(string)>; + default_script_content?: { + [key: string]: (string); + }; +}; + +export type GitRepositorySettings = { + script_path: string; + git_repo_resource_path: string; + use_individual_branch?: boolean; + group_by_folder?: boolean; + exclude_types_override?: Array<('script' | 'flow' | 'app' | 'folder' | 'resource' | 'variable' | 'secret' | 'resourcetype' | 'schedule' | 'user' | 'group')>; +}; + +export type UploadFilePart = { + part_number: number; + tag: string; +}; + +export type MetricMetadata = { + id: string; + name?: string; +}; + +export type ScalarMetric = { + metric_id?: string; + value: number; +}; + +export type TimeseriesMetric = { + metric_id?: string; + values: Array; +}; + +export type MetricDataPoint = { + timestamp: string; + value: number; +}; + +export type RawScriptForDependencies = { + raw_code: string; + path: string; + language: 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible'; +}; + +export type ConcurrencyGroup = { + concurrency_key: string; + total_running: number; +}; + +export type ExtendedJobs = { + jobs: Array; + obscured_jobs: Array; + /** + * Obscured jobs omitted for security because of too specific filtering + */ + omitted_obscured_jobs?: boolean; +}; + +export type ExportedUser = { + email: string; + password_hash?: string; + super_admin: boolean; + verified: boolean; + name?: string; + company?: string; + first_time_user: boolean; + username?: string; +}; + +export type GlobalSetting = { + name: string; + value: { + [key: string]: unknown; + }; +}; + +export type Config = { + name: string; + config?: { + [key: string]: unknown; + }; +}; + +export type ExportedInstanceGroup = { + name: string; + summary?: string; + emails?: Array<(string)>; + id?: string; + scim_display_name?: string; + external_id?: string; +}; + +export type JobSearchHit = { + dancer?: string; +}; + +export type OpenFlow = { + summary: string; + description?: string; + value: FlowValue; + schema?: { + [key: string]: unknown; + }; +}; + +export type FlowValue = { + modules: Array; + failure_module?: FlowModule; + preprocessor_module?: FlowModule; + same_worker?: boolean; + concurrent_limit?: number; + concurrency_key?: string; + concurrency_time_window_s?: number; + skip_expr?: string; + cache_ttl?: number; + priority?: number; + early_return?: string; +}; + +export type Retry = { + constant?: { + attempts?: number; + seconds?: number; + }; + exponential?: { + attempts?: number; + multiplier?: number; + seconds?: number; + random_factor?: number; + }; +}; + +export type FlowModule = { + id: string; + value: FlowModuleValue; + stop_after_if?: { + skip_if_stopped?: boolean; + expr: string; + }; + stop_after_all_iters_if?: { + skip_if_stopped?: boolean; + expr: string; + }; + sleep?: InputTransform; + cache_ttl?: number; + timeout?: number; + delete_after_use?: boolean; + summary?: string; + mock?: { + enabled?: boolean; + return_value?: unknown; + }; + suspend?: { + required_events?: number; + timeout?: number; + resume_form?: { + schema?: { + [key: string]: unknown; + }; + }; + user_auth_required?: boolean; + user_groups_required?: InputTransform; + self_approval_disabled?: boolean; + hide_cancel?: boolean; + continue_on_disapprove_timeout?: boolean; + }; + priority?: number; + continue_on_error?: boolean; + retry?: Retry; +}; + +export type InputTransform = StaticTransform | JavascriptTransform; + +export type StaticTransform = { + value?: unknown; + type: 'static'; +}; + +export type JavascriptTransform = { + expr: string; + type: 'javascript'; +}; + +export type FlowModuleValue = RawScript | PathScript | PathFlow | ForloopFlow | WhileloopFlow | BranchOne | BranchAll | Identity; + +export type RawScript = { + input_transforms: { + [key: string]: InputTransform; + }; + content: string; + language: 'deno' | 'bun' | 'python3' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'php'; + path?: string; + lock?: string; + type: 'rawscript'; + tag?: string; + concurrent_limit?: number; + concurrency_time_window_s?: number; + custom_concurrency_key?: string; +}; + +export type language2 = 'deno' | 'bun' | 'python3' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'graphql' | 'nativets' | 'php'; + +export type PathScript = { + input_transforms: { + [key: string]: InputTransform; + }; + path: string; + hash?: string; + type: 'script'; + tag_override?: string; +}; + +export type PathFlow = { + input_transforms: { + [key: string]: InputTransform; + }; + path: string; + type: 'flow'; +}; + +export type ForloopFlow = { + modules: Array; + iterator: InputTransform; + skip_failures: boolean; + type: 'forloopflow'; + parallel?: boolean; + parallelism?: number; +}; + +export type WhileloopFlow = { + modules: Array; + skip_failures: boolean; + type: 'whileloopflow'; + parallel?: boolean; + parallelism?: number; +}; + +export type BranchOne = { + branches: Array<{ + summary?: string; + expr: string; + modules: Array; + }>; + default: Array; + type: 'branchone'; +}; + +export type BranchAll = { + branches: Array<{ + summary?: string; + skip_failure?: boolean; + modules: Array; + }>; + type: 'branchall'; + parallel?: boolean; +}; + +export type Identity = { + type: 'identity'; + flow?: boolean; +}; + +export type FlowStatus = { + step: number; + modules: Array; + user_states?: { + [key: string]: unknown; + }; + preprocessor_module?: (FlowStatusModule); + failure_module: (FlowStatusModule & { + parent_module?: string; +}); + retry?: { + fail_count?: number; + failed_jobs?: Array<(string)>; + }; +}; + +export type FlowStatusModule = { + type: 'WaitingForPriorSteps' | 'WaitingForEvents' | 'WaitingForExecutor' | 'InProgress' | 'Success' | 'Failure'; + id?: string; + job?: string; + count?: number; + progress?: number; + iterator?: { + index?: number; + itered?: Array; + args?: unknown; + }; + flow_jobs?: Array<(string)>; + flow_jobs_success?: Array<(boolean)>; + branch_chosen?: { + type: 'branch' | 'default'; + branch?: number; + }; + branchall?: { + branch: number; + len: number; + }; + approvers?: Array<{ + resume_id: number; + approver: string; + }>; + failed_retries?: Array<(string)>; +}; + +export type type4 = 'WaitingForPriorSteps' | 'WaitingForEvents' | 'WaitingForExecutor' | 'InProgress' | 'Success' | 'Failure'; + +export type ParameterKey = string; + +export type ParameterWorkspaceId = string; + +export type ParameterVersionId = number; + +export type ParameterToken = string; + +export type ParameterAccountId = number; + +export type ParameterClientName = string; + +export type ParameterScriptPath = string; + +export type ParameterScriptHash = string; + +export type ParameterJobId = string; + +export type ParameterPath = string; + +export type ParameterPathId = number; + +export type ParameterPathVersion = number; + +export type ParameterName = string; + +/** + * which page to return (start at 1, default 1) + */ +export type ParameterPage = number; + +/** + * number of items to return for a given page (default 30, max 100) + */ +export type ParameterPerPage = number; + +/** + * order by desc order (default true) + */ +export type ParameterOrderDesc = boolean; + +/** + * mask to filter exact matching user creator + */ +export type ParameterCreatedBy = string; + +/** + * mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') + */ +export type ParameterLabel = string; + +/** + * The parent job that is at the origin and responsible for the execution of this script if any + */ +export type ParameterParentJob = string; + +/** + * Override the tag to use + */ +export type ParameterWorkerTag = string; + +/** + * Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl + */ +export type ParameterCacheTtl = string; + +/** + * The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) + */ +export type ParameterNewJobId = string; + +/** + * List of headers's keys (separated with ',') whove value are added to the args + * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key + * + */ +export type ParameterIncludeHeader = string; + +/** + * The maximum size of the queue for which the request would get rejected if that job would push it above that limit + * + */ +export type ParameterQueueLimit = string; + +/** + * The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent + * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` + * + */ +export type ParameterPayload = string; + +/** + * mask to filter matching starting path + */ +export type ParameterScriptStartPath = string; + +/** + * mask to filter by schedule path + */ +export type ParameterSchedulePath = string; + +/** + * mask to filter exact matching path + */ +export type ParameterScriptExactPath = string; + +/** + * mask to filter exact matching path + */ +export type ParameterScriptExactHash = string; + +/** + * filter on created before (inclusive) timestamp + */ +export type ParameterCreatedBefore = string; + +/** + * filter on created after (exclusive) timestamp + */ +export type ParameterCreatedAfter = string; + +/** + * filter on started before (inclusive) timestamp + */ +export type ParameterStartedBefore = string; + +/** + * filter on started after (exclusive) timestamp + */ +export type ParameterStartedAfter = string; + +/** + * filter on started before (inclusive) timestamp + */ +export type ParameterBefore = string; + +/** + * filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp + */ +export type ParameterCreatedOrStartedAfter = string; + +/** + * filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs + */ +export type ParameterCreatedOrStartedAfterCompletedJob = string; + +/** + * filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp + */ +export type ParameterCreatedOrStartedBefore = string; + +/** + * filter on successful jobs + */ +export type ParameterSuccess = boolean; + +/** + * filter on jobs scheduled_for before now (hence waitinf for a worker) + */ +export type ParameterScheduledForBeforeNow = boolean; + +/** + * filter on suspended jobs + */ +export type ParameterSuspended = boolean; + +/** + * filter on running jobs + */ +export type ParameterRunning = boolean; + +/** + * filter on jobs containing those args as a json subset (@> in postgres) + */ +export type ParameterArgsFilter = string; + +/** + * filter on jobs with a given tag/worker group + */ +export type ParameterTag = string; + +/** + * filter on jobs containing those result as a json subset (@> in postgres) + */ +export type ParameterResultFilter = string; + +/** + * filter on created after (exclusive) timestamp + */ +export type ParameterAfter = string; + +/** + * filter on exact username of user + */ +export type ParameterUsername = string; + +/** + * filter on exact or prefix name of operation + */ +export type ParameterOperation = string; + +/** + * filter on exact or prefix name of resource + */ +export type ParameterResourceName = string; + +/** + * filter on type of operation + */ +export type ParameterActionKind = 'Create' | 'Update' | 'Delete' | 'Execute'; + +/** + * filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, + */ +export type ParameterJobKinds = string; + +export type ParameterRunnableId = string; + +export type ParameterRunnableTypeQuery = RunnableType; + +export type ParameterInputId = string; + +export type ParameterGetStarted = boolean; + +export type ParameterConcurrencyId = string; + +export type BackendVersionResponse = (string); + +export type BackendUptodateResponse = (string); + +export type GetLicenseIdResponse = (string); + +export type GetOpenApiYamlResponse = (string); + +export type GetAuditLogData = { + id: number; + workspace: string; +}; + +export type GetAuditLogResponse = (AuditLog); + +export type ListAuditLogsData = { + /** + * filter on type of operation + */ + actionKind?: 'Create' | 'Update' | 'Delete' | 'Execute'; + /** + * filter on created after (exclusive) timestamp + */ + after?: string; + /** + * filter on started before (inclusive) timestamp + */ + before?: string; + /** + * comma separated list of operations to exclude + */ + excludeOperations?: string; + /** + * filter on exact or prefix name of operation + */ + operation?: string; + /** + * comma separated list of exact operations to include + */ + operations?: string; + /** + * which page to return (start at 1, default 1) + */ + page?: number; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; + /** + * filter on exact or prefix name of resource + */ + resource?: string; + /** + * filter on exact username of user + */ + username?: string; + workspace: string; +}; + +export type ListAuditLogsResponse = (Array); + +export type LoginData = { + /** + * credentials + */ + requestBody: Login; +}; + +export type LoginResponse = (string); + +export type LogoutResponse = (string); + +export type GetUserData = { + username: string; + workspace: string; +}; + +export type GetUserResponse = (User); + +export type UpdateUserData = { + /** + * new user + */ + requestBody: EditWorkspaceUser; + username: string; + workspace: string; +}; + +export type UpdateUserResponse = (string); + +export type IsOwnerOfPathData = { + path: string; + workspace: string; +}; + +export type IsOwnerOfPathResponse = (boolean); + +export type SetPasswordData = { + /** + * set password + */ + requestBody: { + password: string; + }; +}; + +export type SetPasswordResponse = (string); + +export type CreateUserGloballyData = { + /** + * user info + */ + requestBody: { + email: string; + password: string; + super_admin: boolean; + name?: string; + company?: string; + }; +}; + +export type CreateUserGloballyResponse = (string); + +export type GlobalUserUpdateData = { + email: string; + /** + * new user info + */ + requestBody: { + is_super_admin?: boolean; + name?: string; + }; +}; + +export type GlobalUserUpdateResponse = (string); + +export type GlobalUsernameInfoData = { + email: string; +}; + +export type GlobalUsernameInfoResponse = ({ + username: string; + workspace_usernames: Array<{ + workspace_id: string; + username: string; + }>; +}); + +export type GlobalUserRenameData = { + email: string; + /** + * new username + */ + requestBody: { + new_username: string; + }; +}; + +export type GlobalUserRenameResponse = (string); + +export type GlobalUserDeleteData = { + email: string; +}; + +export type GlobalUserDeleteResponse = (string); + +export type GlobalUsersOverwriteData = { + /** + * List of users + */ + requestBody: Array; +}; + +export type GlobalUsersOverwriteResponse = (string); + +export type GlobalUsersExportResponse = (Array); + +export type DeleteUserData = { + username: string; + workspace: string; +}; + +export type DeleteUserResponse = (string); + +export type ListWorkspacesResponse = (Array); + +export type IsDomainAllowedResponse = (boolean); + +export type ListUserWorkspacesResponse = (UserWorkspaceList); + +export type ListWorkspacesAsSuperAdminData = { + /** + * which page to return (start at 1, default 1) + */ + page?: number; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; +}; + +export type ListWorkspacesAsSuperAdminResponse = (Array); + +export type CreateWorkspaceData = { + /** + * new token + */ + requestBody: CreateWorkspace; +}; + +export type CreateWorkspaceResponse = (string); + +export type ExistsWorkspaceData = { + /** + * id of workspace + */ + requestBody: { + id: string; + }; +}; + +export type ExistsWorkspaceResponse = (boolean); + +export type ExistsUsernameData = { + requestBody: { + id: string; + username: string; + }; +}; + +export type ExistsUsernameResponse = (boolean); + +export type GetGlobalData = { + key: string; +}; + +export type GetGlobalResponse = (unknown); + +export type SetGlobalData = { + key: string; + /** + * value set + */ + requestBody: { + value?: unknown; + }; +}; + +export type SetGlobalResponse = (string); + +export type GetLocalResponse = (unknown); + +export type TestSmtpData = { + /** + * test smtp payload + */ + requestBody: { + to: string; + smtp: { + host: string; + username: string; + password: string; + port: number; + from: string; + tls_implicit: boolean; + }; + }; +}; + +export type TestSmtpResponse = (string); + +export type TestCriticalChannelsData = { + /** + * test critical channel payload + */ + requestBody: Array<{ + email?: string; + slack_channel?: string; + }>; +}; + +export type TestCriticalChannelsResponse = (string); + +export type TestLicenseKeyData = { + /** + * test license key + */ + requestBody: { + license_key: string; + }; +}; + +export type TestLicenseKeyResponse = (string); + +export type TestObjectStorageConfigData = { + /** + * test object storage config + */ + requestBody: { + [key: string]: unknown; + }; +}; + +export type TestObjectStorageConfigResponse = (string); + +export type SendStatsResponse = (string); + +export type GetLatestKeyRenewalAttemptResponse = ({ + result: string; + attempted_at: string; +} | null); + +export type RenewLicenseKeyData = { + licenseKey?: string; +}; + +export type RenewLicenseKeyResponse = (string); + +export type CreateCustomerPortalSessionData = { + licenseKey?: string; +}; + +export type CreateCustomerPortalSessionResponse = (string); + +export type TestMetadataData = { + /** + * test metadata + */ + requestBody: string; +}; + +export type TestMetadataResponse = (string); + +export type ListGlobalSettingsResponse = (Array); + +export type GetCurrentEmailResponse = (string); + +export type RefreshUserTokenResponse = (string); + +export type GetTutorialProgressResponse = ({ + progress?: number; +}); + +export type UpdateTutorialProgressData = { + /** + * progress update + */ + requestBody: { + progress?: number; + }; +}; + +export type UpdateTutorialProgressResponse = (string); + +export type LeaveInstanceResponse = (string); + +export type GetUsageResponse = (number); + +export type GetRunnableResponse = ({ + workspace: string; + endpoint_async: string; + endpoint_sync: string; + endpoint_openai_sync: string; + summary: string; + description?: string; + kind: string; +}); + +export type GlobalWhoamiResponse = (GlobalUserInfo); + +export type ListWorkspaceInvitesResponse = (Array); + +export type WhoamiData = { + workspace: string; +}; + +export type WhoamiResponse = (User); + +export type AcceptInviteData = { + /** + * accept invite + */ + requestBody: { + workspace_id: string; + username?: string; + }; +}; + +export type AcceptInviteResponse = (string); + +export type DeclineInviteData = { + /** + * decline invite + */ + requestBody: { + workspace_id: string; + }; +}; + +export type DeclineInviteResponse = (string); + +export type InviteUserData = { + /** + * WorkspaceInvite + */ + requestBody: { + email: string; + is_admin: boolean; + operator: boolean; + }; + workspace: string; +}; + +export type InviteUserResponse = (string); + +export type AddUserData = { + /** + * WorkspaceInvite + */ + requestBody: { + email: string; + is_admin: boolean; + username?: string; + operator: boolean; + }; + workspace: string; +}; + +export type AddUserResponse = (string); + +export type DeleteInviteData = { + /** + * WorkspaceInvite + */ + requestBody: { + email: string; + is_admin: boolean; + operator: boolean; + }; + workspace: string; +}; + +export type DeleteInviteResponse = (string); + +export type ArchiveWorkspaceData = { + workspace: string; +}; + +export type ArchiveWorkspaceResponse = (string); + +export type UnarchiveWorkspaceData = { + workspace: string; +}; + +export type UnarchiveWorkspaceResponse = (string); + +export type DeleteWorkspaceData = { + workspace: string; +}; + +export type DeleteWorkspaceResponse = (string); + +export type LeaveWorkspaceData = { + workspace: string; +}; + +export type LeaveWorkspaceResponse = (string); + +export type GetWorkspaceNameData = { + workspace: string; +}; + +export type GetWorkspaceNameResponse = (string); + +export type ChangeWorkspaceNameData = { + requestBody?: { + new_name?: string; + }; + workspace: string; +}; + +export type ChangeWorkspaceNameResponse = (string); + +export type ChangeWorkspaceIdData = { + requestBody?: { + new_id?: string; + new_name?: string; + }; + workspace: string; +}; + +export type ChangeWorkspaceIdResponse = (string); + +export type WhoisData = { + username: string; + workspace: string; +}; + +export type WhoisResponse = (User); + +export type ExistsEmailData = { + email: string; +}; + +export type ExistsEmailResponse = (boolean); + +export type ListUsersAsSuperAdminData = { + /** + * which page to return (start at 1, default 1) + */ + page?: number; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; +}; + +export type ListUsersAsSuperAdminResponse = (Array); + +export type ListPendingInvitesData = { + workspace: string; +}; + +export type ListPendingInvitesResponse = (Array); + +export type GetSettingsData = { + workspace: string; +}; + +export type GetSettingsResponse = ({ + workspace_id?: string; + slack_name?: string; + slack_team_id?: string; + slack_command_script?: string; + auto_invite_domain?: string; + auto_invite_operator?: boolean; + auto_add?: boolean; + plan?: string; + automatic_billing: boolean; + customer_id?: string; + webhook?: string; + deploy_to?: string; + openai_resource_path?: string; + code_completion_enabled: boolean; + error_handler?: string; + error_handler_extra_args?: ScriptArgs; + error_handler_muted_on_cancel: boolean; + large_file_storage?: LargeFileStorage; + git_sync?: WorkspaceGitSyncSettings; + deploy_ui?: WorkspaceDeployUISettings; + default_app?: string; + default_scripts?: WorkspaceDefaultScripts; +}); + +export type GetDeployToData = { + workspace: string; +}; + +export type GetDeployToResponse = ({ + deploy_to?: string; +}); + +export type GetIsPremiumData = { + workspace: string; +}; + +export type GetIsPremiumResponse = (boolean); + +export type GetPremiumInfoData = { + workspace: string; +}; + +export type GetPremiumInfoResponse = ({ + premium: boolean; + usage?: number; + seats?: number; + automatic_billing: boolean; +}); + +export type SetAutomaticBillingData = { + /** + * automatic billing + */ + requestBody: { + automatic_billing: boolean; + seats?: number; + }; + workspace: string; +}; + +export type SetAutomaticBillingResponse = (string); + +export type EditSlackCommandData = { + /** + * WorkspaceInvite + */ + requestBody: { + slack_command_script?: string; + }; + workspace: string; +}; + +export type EditSlackCommandResponse = (string); + +export type RunSlackMessageTestJobData = { + /** + * path to hub script to run and its corresponding args + */ + requestBody: { + hub_script_path?: string; + channel?: string; + test_msg?: string; + }; + workspace: string; +}; + +export type RunSlackMessageTestJobResponse = ({ + job_uuid?: string; +}); + +export type EditDeployToData = { + requestBody: { + deploy_to?: string; + }; + workspace: string; +}; + +export type EditDeployToResponse = (string); + +export type EditAutoInviteData = { + /** + * WorkspaceInvite + */ + requestBody: { + operator?: boolean; + invite_all?: boolean; + auto_add?: boolean; + }; + workspace: string; +}; + +export type EditAutoInviteResponse = (string); + +export type EditWebhookData = { + /** + * WorkspaceWebhook + */ + requestBody: { + webhook?: string; + }; + workspace: string; +}; + +export type EditWebhookResponse = (string); + +export type EditCopilotConfigData = { + /** + * WorkspaceCopilotConfig + */ + requestBody: { + openai_resource_path?: string; + code_completion_enabled: boolean; + }; + workspace: string; +}; + +export type EditCopilotConfigResponse = (string); + +export type GetCopilotInfoData = { + workspace: string; +}; + +export type GetCopilotInfoResponse = ({ + exists_openai_resource_path: boolean; + code_completion_enabled: boolean; +}); + +export type EditErrorHandlerData = { + /** + * WorkspaceErrorHandler + */ + requestBody: { + error_handler?: string; + error_handler_extra_args?: ScriptArgs; + error_handler_muted_on_cancel?: boolean; + }; + workspace: string; +}; + +export type EditErrorHandlerResponse = (string); + +export type EditLargeFileStorageConfigData = { + /** + * LargeFileStorage info + */ + requestBody: { + large_file_storage?: LargeFileStorage; + }; + workspace: string; +}; + +export type EditLargeFileStorageConfigResponse = (unknown); + +export type EditWorkspaceGitSyncConfigData = { + /** + * Workspace Git sync settings + */ + requestBody: { + git_sync_settings?: WorkspaceGitSyncSettings; + }; + workspace: string; +}; + +export type EditWorkspaceGitSyncConfigResponse = (unknown); + +export type EditWorkspaceDeployUiSettingsData = { + /** + * Workspace deploy UI settings + */ + requestBody: { + deploy_ui_settings?: WorkspaceDeployUISettings; + }; + workspace: string; +}; + +export type EditWorkspaceDeployUiSettingsResponse = (unknown); + +export type EditWorkspaceDefaultAppData = { + /** + * Workspace default app + */ + requestBody: { + default_app_path?: string; + }; + workspace: string; +}; + +export type EditWorkspaceDefaultAppResponse = (string); + +export type EditDefaultScriptsData = { + /** + * Workspace default app + */ + requestBody?: WorkspaceDefaultScripts; + workspace: string; +}; + +export type EditDefaultScriptsResponse = (string); + +export type GetDefaultScriptsData = { + workspace: string; +}; + +export type GetDefaultScriptsResponse = (WorkspaceDefaultScripts); + +export type SetEnvironmentVariableData = { + /** + * Workspace default app + */ + requestBody: { + name: string; + value?: string; + }; + workspace: string; +}; + +export type SetEnvironmentVariableResponse = (string); + +export type GetWorkspaceEncryptionKeyData = { + workspace: string; +}; + +export type GetWorkspaceEncryptionKeyResponse = ({ + key: string; +}); + +export type SetWorkspaceEncryptionKeyData = { + /** + * New encryption key + */ + requestBody: { + new_key: string; + skip_reencrypt?: boolean; + }; + workspace: string; +}; + +export type SetWorkspaceEncryptionKeyResponse = (string); + +export type GetWorkspaceDefaultAppData = { + workspace: string; +}; + +export type GetWorkspaceDefaultAppResponse = ({ + default_app_path?: string; +}); + +export type GetLargeFileStorageConfigData = { + workspace: string; +}; + +export type GetLargeFileStorageConfigResponse = (LargeFileStorage); + +export type GetWorkspaceUsageData = { + workspace: string; +}; + +export type GetWorkspaceUsageResponse = (number); + +export type ListUsersData = { + workspace: string; +}; + +export type ListUsersResponse = (Array); + +export type ListUsersUsageData = { + workspace: string; +}; + +export type ListUsersUsageResponse = (Array); + +export type ListUsernamesData = { + workspace: string; +}; + +export type ListUsernamesResponse = (Array<(string)>); + +export type UsernameToEmailData = { + username: string; + workspace: string; +}; + +export type UsernameToEmailResponse = (string); + +export type CreateTokenData = { + /** + * new token + */ + requestBody: NewToken; +}; + +export type CreateTokenResponse = (string); + +export type CreateTokenImpersonateData = { + /** + * new token + */ + requestBody: NewTokenImpersonate; +}; + +export type CreateTokenImpersonateResponse = (string); + +export type DeleteTokenData = { + tokenPrefix: string; +}; + +export type DeleteTokenResponse = (string); + +export type ListTokensData = { + excludeEphemeral?: boolean; + /** + * which page to return (start at 1, default 1) + */ + page?: number; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; +}; + +export type ListTokensResponse = (Array); + +export type GetOidcTokenData = { + audience: string; + workspace: string; +}; + +export type GetOidcTokenResponse = (string); + +export type CreateVariableData = { + alreadyEncrypted?: boolean; + /** + * new variable + */ + requestBody: CreateVariable; + workspace: string; +}; + +export type CreateVariableResponse = (string); + +export type EncryptValueData = { + /** + * new variable + */ + requestBody: string; + workspace: string; +}; + +export type EncryptValueResponse = (string); + +export type DeleteVariableData = { + path: string; + workspace: string; +}; + +export type DeleteVariableResponse = (string); + +export type UpdateVariableData = { + alreadyEncrypted?: boolean; + path: string; + /** + * updated variable + */ + requestBody: EditVariable; + workspace: string; +}; + +export type UpdateVariableResponse = (string); + +export type GetVariableData = { + /** + * ask to decrypt secret if this variable is secret + * (if not secret no effect, default: true) + * + */ + decryptSecret?: boolean; + /** + * ask to include the encrypted value if secret and decrypt secret is not true (default: false) + * + */ + includeEncrypted?: boolean; + path: string; + workspace: string; +}; + +export type GetVariableResponse = (ListableVariable); + +export type GetVariableValueData = { + path: string; + workspace: string; +}; + +export type GetVariableValueResponse = (string); + +export type ExistsVariableData = { + path: string; + workspace: string; +}; + +export type ExistsVariableResponse = (boolean); + +export type ListVariableData = { + /** + * which page to return (start at 1, default 1) + */ + page?: number; + pathStart?: string; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; + workspace: string; +}; + +export type ListVariableResponse = (Array); + +export type ListContextualVariablesData = { + workspace: string; +}; + +export type ListContextualVariablesResponse = (Array); + +export type LoginWithOauthData = { + clientName: string; + /** + * Partially filled script + */ + requestBody: { + code?: string; + state?: string; + }; +}; + +export type LoginWithOauthResponse = (string); + +export type ConnectSlackCallbackData = { + /** + * code endpoint + */ + requestBody: { + code: string; + state: string; + }; + workspace: string; +}; + +export type ConnectSlackCallbackResponse = (string); + +export type ConnectSlackCallbackInstanceData = { + /** + * code endpoint + */ + requestBody: { + code: string; + state: string; + }; +}; + +export type ConnectSlackCallbackInstanceResponse = (string); + +export type ConnectCallbackData = { + clientName: string; + /** + * code endpoint + */ + requestBody: { + code: string; + state: string; + }; +}; + +export type ConnectCallbackResponse = (TokenResponse); + +export type CreateAccountData = { + /** + * code endpoint + */ + requestBody: { + refresh_token?: string; + expires_in: number; + client: string; + }; + workspace: string; +}; + +export type CreateAccountResponse = (string); + +export type RefreshTokenData = { + id: number; + /** + * variable path + */ + requestBody: { + path: string; + }; + workspace: string; +}; + +export type RefreshTokenResponse = (string); + +export type DisconnectAccountData = { + id: number; + workspace: string; +}; + +export type DisconnectAccountResponse = (string); + +export type DisconnectSlackData = { + workspace: string; +}; + +export type DisconnectSlackResponse = (string); + +export type ListOauthLoginsResponse = ({ + oauth: Array<(string)>; + saml?: string; +}); + +export type ListOauthConnectsResponse = (Array<(string)>); + +export type GetOauthConnectData = { + /** + * client name + */ + client: string; +}; + +export type GetOauthConnectResponse = ({ + extra_params?: { + [key: string]: unknown; + }; + scopes?: Array<(string)>; +}); + +export type CreateResourceData = { + /** + * new resource + */ + requestBody: CreateResource; + updateIfExists?: boolean; + workspace: string; +}; + +export type CreateResourceResponse = (string); + +export type DeleteResourceData = { + path: string; + workspace: string; +}; + +export type DeleteResourceResponse = (string); + +export type UpdateResourceData = { + path: string; + /** + * updated resource + */ + requestBody: EditResource; + workspace: string; +}; + +export type UpdateResourceResponse = (string); + +export type UpdateResourceValueData = { + path: string; + /** + * updated resource + */ + requestBody: { + value?: unknown; + }; + workspace: string; +}; + +export type UpdateResourceValueResponse = (string); + +export type GetResourceData = { + path: string; + workspace: string; +}; + +export type GetResourceResponse = (Resource); + +export type GetResourceValueInterpolatedData = { + /** + * job id + */ + jobId?: string; + path: string; + workspace: string; +}; + +export type GetResourceValueInterpolatedResponse = (unknown); + +export type GetResourceValueData = { + path: string; + workspace: string; +}; + +export type GetResourceValueResponse = (unknown); + +export type ExistsResourceData = { + path: string; + workspace: string; +}; + +export type ExistsResourceResponse = (boolean); + +export type ListResourceData = { + /** + * which page to return (start at 1, default 1) + */ + page?: number; + pathStart?: string; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; + /** + * resource_types to list from, separated by ',', + */ + resourceType?: string; + /** + * resource_types to not list from, separated by ',', + */ + resourceTypeExclude?: string; + workspace: string; +}; + +export type ListResourceResponse = (Array); + +export type ListSearchResourceData = { + workspace: string; +}; + +export type ListSearchResourceResponse = (Array<{ + path: string; + value: unknown; +}>); + +export type ListResourceNamesData = { + name: string; + workspace: string; +}; + +export type ListResourceNamesResponse = (Array<{ + name: string; + path: string; +}>); + +export type CreateResourceTypeData = { + /** + * new resource_type + */ + requestBody: ResourceType; + workspace: string; +}; + +export type CreateResourceTypeResponse = (string); + +export type FileResourceTypeToFileExtMapData = { + workspace: string; +}; + +export type FileResourceTypeToFileExtMapResponse = (unknown); + +export type DeleteResourceTypeData = { + path: string; + workspace: string; +}; + +export type DeleteResourceTypeResponse = (string); + +export type UpdateResourceTypeData = { + path: string; + /** + * updated resource_type + */ + requestBody: EditResourceType; + workspace: string; +}; + +export type UpdateResourceTypeResponse = (string); + +export type GetResourceTypeData = { + path: string; + workspace: string; +}; + +export type GetResourceTypeResponse = (ResourceType); + +export type ExistsResourceTypeData = { + path: string; + workspace: string; +}; + +export type ExistsResourceTypeResponse = (boolean); + +export type ListResourceTypeData = { + workspace: string; +}; + +export type ListResourceTypeResponse = (Array); + +export type ListResourceTypeNamesData = { + workspace: string; +}; + +export type ListResourceTypeNamesResponse = (Array<(string)>); + +export type QueryResourceTypesData = { + /** + * query limit + */ + limit?: number; + /** + * query text + */ + text: string; + workspace: string; +}; + +export type QueryResourceTypesResponse = (Array<{ + name: string; + score: number; + schema?: unknown; +}>); + +export type ListHubIntegrationsData = { + /** + * query integrations kind + */ + kind?: string; +}; + +export type ListHubIntegrationsResponse = (Array<{ + name: string; +}>); + +export type ListHubFlowsResponse = ({ + flows?: Array<{ + id: number; + flow_id: number; + summary: string; + apps: Array<(string)>; + approved: boolean; + votes: number; + }>; +}); + +export type GetHubFlowByIdData = { + id: number; +}; + +export type GetHubFlowByIdResponse = ({ + flow?: OpenFlow; +}); + +export type ListHubAppsResponse = ({ + apps?: Array<{ + id: number; + app_id: number; + summary: string; + apps: Array<(string)>; + approved: boolean; + votes: number; + }>; +}); + +export type GetHubAppByIdData = { + id: number; +}; + +export type GetHubAppByIdResponse = ({ + app: { + summary: string; + value: unknown; + }; +}); + +export type GetHubScriptContentByPathData = { + path: string; +}; + +export type GetHubScriptContentByPathResponse = (string); + +export type GetHubScriptByPathData = { + path: string; +}; + +export type GetHubScriptByPathResponse = ({ + content: string; + lockfile?: string; + schema?: unknown; + language: string; + summary?: string; +}); + +export type GetTopHubScriptsData = { + /** + * query scripts app + */ + app?: string; + /** + * query scripts kind + */ + kind?: string; + /** + * query limit + */ + limit?: number; +}; + +export type GetTopHubScriptsResponse = ({ + asks?: Array<{ + id: number; + ask_id: number; + summary: string; + app: string; + version_id: number; + kind: HubScriptKind; + votes: number; + views: number; + }>; +}); + +export type QueryHubScriptsData = { + /** + * query scripts app + */ + app?: string; + /** + * query scripts kind + */ + kind?: string; + /** + * query limit + */ + limit?: number; + /** + * query text + */ + text: string; +}; + +export type QueryHubScriptsResponse = (Array<{ + ask_id: number; + id: number; + version_id: number; + summary: string; + app: string; + kind: HubScriptKind; + score: number; +}>); + +export type ListSearchScriptData = { + workspace: string; +}; + +export type ListSearchScriptResponse = (Array<{ + path: string; + content: string; +}>); + +export type ListScriptsData = { + /** + * mask to filter exact matching user creator + */ + createdBy?: string; + /** + * mask to filter scripts whom first direct parent has exact hash + */ + firstParentHash?: string; + /** + * (default false) + * include scripts that have no deployed version + * + */ + includeDraftOnly?: boolean; + /** + * (default false) + * include scripts without an exported main function + * + */ + includeWithoutMain?: boolean; + /** + * (default regardless) + * if true show only the templates + * if false show only the non templates + * if not defined, show all regardless of if the script is a template + * + */ + isTemplate?: boolean; + /** + * (default regardless) + * script kinds to filter, split by comma + * + */ + kinds?: string; + /** + * mask to filter scripts whom last parent in the chain has exact hash. + * Beware that each script stores only a limited number of parents. Hence + * the last parent hash for a script is not necessarily its top-most parent. + * To find the top-most parent you will have to jump from last to last hash + * until finding the parent + * + */ + lastParentHash?: string; + /** + * order by desc order (default true) + */ + orderDesc?: boolean; + /** + * which page to return (start at 1, default 1) + */ + page?: number; + /** + * is the hash present in the array of stored parent hashes for this script. + * The same warning applies than for last_parent_hash. A script only store a + * limited number of direct parent + * + */ + parentHash?: string; + /** + * mask to filter exact matching path + */ + pathExact?: string; + /** + * mask to filter matching starting path + */ + pathStart?: string; + /** + * number of items to return for a given page (default 30, max 100) + */ + perPage?: number; + /** + * (default false) + * show only the archived files. + * when multiple archived hash share the same path, only the ones with the latest create_at + * are + * ed. + * + */ + showArchived?: boolean; + /** + * (default false) + * show only the starred items + * + */ + starredOnly?: boolean; + /** + * (default false) + * include deployment message + * + */ + withDeploymentMsg?: boolean; + workspace: string; +}; + +export type ListScriptsResponse = (Array