Skip to main content
Module

x/windmill/windmill-api/apis/FlowApi.ts

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
File
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
// TODO: better import syntax?import {BaseAPIRequestFactory, RequiredError} from './baseapi.ts';import {Configuration} from '../configuration.ts';import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts';import {ObjectSerializer} from '../models/ObjectSerializer.ts';import {ApiException} from './exception.ts';import {canConsumeForm, isCodeInRange} from '../util.ts';import {SecurityAuthentication} from '../auth/auth.ts';

import { Flow } from '../models/Flow.ts';import { InlineResponse2003 } from '../models/InlineResponse2003.ts';import { InlineResponse2004 } from '../models/InlineResponse2004.ts';import { OpenFlowWPath } from '../models/OpenFlowWPath.ts';
/** * no description */export class FlowApiRequestFactory extends BaseAPIRequestFactory {
/** * archive flow by path * @param workspace * @param path */ public async archiveFlowByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "archiveFlowByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("FlowApi", "archiveFlowByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/flows/archive/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * create flow * @param workspace * @param openFlowWPath Partially filled flow */ public async createFlow(workspace: string, openFlowWPath: OpenFlowWPath, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "createFlow", "workspace"); }

// verify required parameter 'openFlowWPath' is not null or undefined if (openFlowWPath === null || openFlowWPath === undefined) { throw new RequiredError("FlowApi", "createFlow", "openFlowWPath"); }

// Path Params const localVarPath = '/w/{workspace}/flows/create' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(openFlowWPath, "OpenFlowWPath", ""), contentType ); requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * exists flow by path * @param workspace * @param path */ public async existsFlowByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "existsFlowByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("FlowApi", "existsFlowByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/flows/exists/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get flow by path * @param workspace * @param path */ public async getFlowByPath(workspace: string, path: string, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "getFlowByPath", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("FlowApi", "getFlowByPath", "path"); }

// Path Params const localVarPath = '/w/{workspace}/flows/get/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * get hub flow by id * @param id */ public async getHubFlowById(id: number, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError("FlowApi", "getHubFlowById", "id"); }

// Path Params const localVarPath = '/flows/hub/get/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * list all available flows * @param workspace * @param page which page to return (start at 1, default 1) * @param perPage number of items to return for a given page (default 30, max 100) * @param orderDesc order by desc order (default true) * @param createdBy mask to filter exact matching user creator * @param pathStart mask to filter matching starting path * @param pathExact mask to filter exact matching path * @param showArchived (default false) show also the archived files. when multiple archived hash share the same path, only the ones with the latest create_at are displayed. */ public async listFlows(workspace: string, page?: number, perPage?: number, orderDesc?: boolean, createdBy?: string, pathStart?: string, pathExact?: string, showArchived?: boolean, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "listFlows", "workspace"); }








// Path Params const localVarPath = '/w/{workspace}/flows/list' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
// Query Params if (page !== undefined) { requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "int32")); }
// Query Params if (perPage !== undefined) { requestContext.setQueryParam("per_page", ObjectSerializer.serialize(perPage, "number", "int32")); }
// Query Params if (orderDesc !== undefined) { requestContext.setQueryParam("order_desc", ObjectSerializer.serialize(orderDesc, "boolean", "")); }
// Query Params if (createdBy !== undefined) { requestContext.setQueryParam("created_by", ObjectSerializer.serialize(createdBy, "string", "")); }
// Query Params if (pathStart !== undefined) { requestContext.setQueryParam("path_start", ObjectSerializer.serialize(pathStart, "string", "")); }
// Query Params if (pathExact !== undefined) { requestContext.setQueryParam("path_exact", ObjectSerializer.serialize(pathExact, "string", "")); }
// Query Params if (showArchived !== undefined) { requestContext.setQueryParam("show_archived", ObjectSerializer.serialize(showArchived, "boolean", "")); }

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * list all available hub flows */ public async listHubFlows(_options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// Path Params const localVarPath = '/flows/hub/list';
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
/** * update flow * @param workspace * @param path * @param openFlowWPath Partially filled flow */ public async updateFlow(workspace: string, path: string, openFlowWPath: OpenFlowWPath, _options?: Configuration): Promise<RequestContext> { let _config = _options || this.configuration;
// verify required parameter 'workspace' is not null or undefined if (workspace === null || workspace === undefined) { throw new RequiredError("FlowApi", "updateFlow", "workspace"); }

// verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new RequiredError("FlowApi", "updateFlow", "path"); }

// verify required parameter 'openFlowWPath' is not null or undefined if (openFlowWPath === null || openFlowWPath === undefined) { throw new RequiredError("FlowApi", "updateFlow", "openFlowWPath"); }

// Path Params const localVarPath = '/w/{workspace}/flows/update/{path}' .replace('{' + 'workspace' + '}', encodeURIComponent(String(workspace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path)));
// Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(openFlowWPath, "OpenFlowWPath", ""), contentType ); requestContext.setBody(serializedBody);
let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["bearerAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } // Apply auth methods authMethod = _config.authMethods["cookieAuth"] if (authMethod?.applySecurityAuthentication) { await authMethod?.applySecurityAuthentication(requestContext); } const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); }
return requestContext; }
}
export class FlowApiResponseProcessor {
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to archiveFlowByPath * @throws ApiException if the response code was not in [200, 299] */ public async archiveFlowByPath(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createFlow * @throws ApiException if the response code was not in [200, 299] */ public async createFlow(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to existsFlowByPath * @throws ApiException if the response code was not in [200, 299] */ public async existsFlowByPath(response: ResponseContext): Promise<boolean > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: boolean = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "boolean", "" ) as boolean; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: boolean = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "boolean", "" ) as boolean; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getFlowByPath * @throws ApiException if the response code was not in [200, 299] */ public async getFlowByPath(response: ResponseContext): Promise<Flow > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Flow = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Flow", "" ) as Flow; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Flow = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Flow", "" ) as Flow; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getHubFlowById * @throws ApiException if the response code was not in [200, 299] */ public async getHubFlowById(response: ResponseContext): Promise<InlineResponse2004 > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: InlineResponse2004 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2004", "" ) as InlineResponse2004; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: InlineResponse2004 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2004", "" ) as InlineResponse2004; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listFlows * @throws ApiException if the response code was not in [200, 299] */ public async listFlows(response: ResponseContext): Promise<Array<Flow> > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Array<Flow> = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Array<Flow>", "" ) as Array<Flow>; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: Array<Flow> = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Array<Flow>", "" ) as Array<Flow>; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listHubFlows * @throws ApiException if the response code was not in [200, 299] */ public async listHubFlows(response: ResponseContext): Promise<InlineResponse2003 > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: InlineResponse2003 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2003", "" ) as InlineResponse2003; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: InlineResponse2003 = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "InlineResponse2003", "" ) as InlineResponse2003; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
/** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to updateFlow * @throws ApiException if the response code was not in [200, 299] */ public async updateFlow(response: ResponseContext): Promise<string > { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
// Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: string = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "string", "" ) as string; return body; }
throw new ApiException<string | Blob | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); }
}