export type DeleteApiV1WorkflowsRevisionsRevisionIdArgs = {revision_id: string}; export type DeleteApiV1WorkflowsRevisionsRevisionIdOptions = {baseUrl: string, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a workflow revision * * DELETE /v1/workflows/revisions/{revision_id} */ export const deleteApiV1WorkflowsRevisionsRevisionId = async (args: DeleteApiV1WorkflowsRevisionsRevisionIdArgs, options: DeleteApiV1WorkflowsRevisionsRevisionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("x-api-key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workflows/revisions/${encodeURIComponent(String(args.revision_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 };