Skip to main content
Module

x/windmill/windmill-api/services/ScriptService.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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
/* istanbul ignore file *//* tslint:disable *//* eslint-disable */import type { HubScriptKind } from '../models/HubScriptKind.ts';import type { NewScript } from '../models/NewScript.ts';import type { NewScriptWithDraft } from '../models/NewScriptWithDraft.ts';import type { Script } from '../models/Script.ts';import type { ScriptHistory } from '../models/ScriptHistory.ts';
import type { CancelablePromise } from '../core/CancelablePromise.ts';import { OpenAPI } from '../core/OpenAPI.ts';import { request as __request } from '../core/request.ts';
export class ScriptService {
/** * get hub script content by path * @returns string script details * @throws ApiError */ public static getHubScriptContentByPath({ path, }: { path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'GET', url: '/scripts/hub/get/{path}', path: { 'path': path, }, }); }
/** * get full hub script by path * @returns any script details * @throws ApiError */ public static getHubScriptByPath({ path, }: { path: string, }): CancelablePromise<{ content: string; lockfile?: string; schema?: any; language: string; summary?: string; }> { return __request(OpenAPI, { method: 'GET', url: '/scripts/hub/get_full/{path}', path: { 'path': path, }, }); }
/** * get top hub scripts * @returns any hub scripts list * @throws ApiError */ public static getTopHubScripts({ limit, app, kind, }: { /** * query limit */ limit?: number, /** * query scripts app */ app?: string, /** * query scripts kind */ kind?: string, }): CancelablePromise<{ asks?: Array<{ id: number; ask_id: number; summary: string; app: string; version_id: number; kind: HubScriptKind; votes: number; views: number; }>; }> { return __request(OpenAPI, { method: 'GET', url: '/scripts/hub/top', query: { 'limit': limit, 'app': app, 'kind': kind, }, }); }
/** * query hub scripts by similarity * @returns any script details * @throws ApiError */ public static queryHubScripts({ text, kind, limit, app, }: { /** * query text */ text: string, /** * query scripts kind */ kind?: string, /** * query limit */ limit?: number, /** * query scripts app */ app?: string, }): CancelablePromise<Array<{ ask_id: number; id: number; version_id: number; summary: string; app: string; kind: HubScriptKind; score: number; }>> { return __request(OpenAPI, { method: 'GET', url: '/embeddings/query_hub_scripts', query: { 'text': text, 'kind': kind, 'limit': limit, 'app': app, }, }); }
/** * list scripts for search * @returns any script list * @throws ApiError */ public static listSearchScript({ workspace, }: { workspace: string, }): CancelablePromise<Array<{ path: string; content: string; }>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/list_search', path: { 'workspace': workspace, }, }); }
/** * list all scripts * @returns Script All scripts * @throws ApiError */ public static listScripts({ workspace, page, perPage, orderDesc, createdBy, pathStart, pathExact, firstParentHash, lastParentHash, parentHash, showArchived, isTemplate, kinds, starredOnly, }: { workspace: 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, /** * order by desc order (default true) */ orderDesc?: boolean, /** * mask to filter exact matching user creator */ createdBy?: string, /** * mask to filter matching starting path */ pathStart?: string, /** * mask to filter exact matching path */ pathExact?: string, /** * mask to filter scripts whom first direct parent has exact hash */ firstParentHash?: 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, /** * 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, /** * (default false) * show also the archived files. * when multiple archived hash share the same path, only the ones with the latest create_at * are * ed. * */ showArchived?: 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, /** * (default false) * show only the starred items * */ starredOnly?: boolean, }): CancelablePromise<Array<Script>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/list', path: { 'workspace': workspace, }, query: { 'page': page, 'per_page': perPage, 'order_desc': orderDesc, 'created_by': createdBy, 'path_start': pathStart, 'path_exact': pathExact, 'first_parent_hash': firstParentHash, 'last_parent_hash': lastParentHash, 'parent_hash': parentHash, 'show_archived': showArchived, 'is_template': isTemplate, 'kinds': kinds, 'starred_only': starredOnly, }, }); }
/** * list all scripts paths * @returns string list of script paths * @throws ApiError */ public static listScriptPaths({ workspace, }: { workspace: string, }): CancelablePromise<Array<string>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/list_paths', path: { 'workspace': workspace, }, }); }
/** * create script * @returns string script created * @throws ApiError */ public static createScript({ workspace, requestBody, }: { workspace: string, /** * Partially filled script */ requestBody: NewScript, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/create', path: { 'workspace': workspace, }, body: requestBody, mediaType: 'application/json', }); }
/** * Toggle ON and OFF the workspace error handler for a given script * @returns string error handler toggled * @throws ApiError */ public static toggleWorkspaceErrorHandlerForScript({ workspace, path, requestBody, }: { workspace: string, path: string, /** * Workspace error handler enabled */ requestBody: { muted?: boolean; }, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/toggle_workspace_error_handler/p/{path}', path: { 'workspace': workspace, 'path': path, }, body: requestBody, mediaType: 'application/json', }); }
/** * archive script by path * @returns string script archived * @throws ApiError */ public static archiveScriptByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/archive/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * archive script by hash * @returns Script script details * @throws ApiError */ public static archiveScriptByHash({ workspace, hash, }: { workspace: string, hash: string, }): CancelablePromise<Script> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/archive/h/{hash}', path: { 'workspace': workspace, 'hash': hash, }, }); }
/** * delete script by hash (erase content but keep hash, require admin) * @returns Script script details * @throws ApiError */ public static deleteScriptByHash({ workspace, hash, }: { workspace: string, hash: string, }): CancelablePromise<Script> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/delete/h/{hash}', path: { 'workspace': workspace, 'hash': hash, }, }); }
/** * delete all scripts at a given path (require admin) * @returns string script path * @throws ApiError */ public static deleteScriptByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/delete/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get script by path * @returns Script script details * @throws ApiError */ public static getScriptByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<Script> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/get/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get script by path with draft * @returns NewScriptWithDraft script details * @throws ApiError */ public static getScriptByPathWithDraft({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<NewScriptWithDraft> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/get/draft/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get history of a script by path * @returns ScriptHistory script history * @throws ApiError */ public static getScriptHistoryByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<Array<ScriptHistory>> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/history/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * update history of a script * @returns string success * @throws ApiError */ public static updateScriptHistory({ workspace, hash, path, requestBody, }: { workspace: string, hash: string, path: string, /** * Script deployment message */ requestBody: { deployment_msg?: string; }, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'POST', url: '/w/{workspace}/scripts/history_update/h/{hash}/p/{path}', path: { 'workspace': workspace, 'hash': hash, 'path': path, }, body: requestBody, mediaType: 'application/json', }); }
/** * raw script by path * @returns string script content * @throws ApiError */ public static rawScriptByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/raw/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts) * @returns string script content * @throws ApiError */ public static rawScriptByPathTokened({ workspace, token, path, }: { workspace: string, token: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'GET', url: '/scripts_u/tokened_raw/{workspace}/{token}/{path}', path: { 'workspace': workspace, 'token': token, 'path': path, }, }); }
/** * exists script by path * @returns boolean does it exists * @throws ApiError */ public static existsScriptByPath({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<boolean> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/exists/p/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get script by hash * @returns Script script details * @throws ApiError */ public static getScriptByHash({ workspace, hash, }: { workspace: string, hash: string, }): CancelablePromise<Script> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/get/h/{hash}', path: { 'workspace': workspace, 'hash': hash, }, }); }
/** * raw script by hash * @returns string script content * @throws ApiError */ public static rawScriptByHash({ workspace, path, }: { workspace: string, path: string, }): CancelablePromise<string> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/raw/h/{path}', path: { 'workspace': workspace, 'path': path, }, }); }
/** * get script deployment status * @returns any script details * @throws ApiError */ public static getScriptDeploymentStatus({ workspace, hash, }: { workspace: string, hash: string, }): CancelablePromise<{ lock?: string; lock_error_logs?: string; }> { return __request(OpenAPI, { method: 'GET', url: '/w/{workspace}/scripts/deployment_status/h/{hash}', path: { 'workspace': workspace, 'hash': hash, }, }); }
}