export type DeleteApiApiV2WorkflowsWorkflowIdArgs = {workflow_id: string}; export type DeleteApiApiV2WorkflowsWorkflowIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a workflow * * DELETE /api/v2/workflows/{workflow_id} */ export const deleteApiApiV2WorkflowsWorkflowId = async (args: DeleteApiApiV2WorkflowsWorkflowIdArgs, options?: DeleteApiApiV2WorkflowsWorkflowIdOptions) => { const {baseUrl = "https://api.ai.vision.tiliter.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/workflows/${encodeURIComponent(String(args.workflow_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };