export type PatchApiEnsembleEmNameWorkflowsWfNameAbortOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark the given workflow to be aborted * * PATCH /ensemble/{em-name}/workflows/{wf-name}/abort */ export const patchApiEnsembleEmNameWorkflowsWfNameAbort = async (options?: PatchApiEnsembleEmNameWorkflowsWfNameAbortOptions) => { const {baseUrl = "http://localhost:5000/api/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/ensemble/${encodeURIComponent(String(args['em-name']))}/workflows/${encodeURIComponent(String(args['wf-name']))}/abort${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };