export type CreateApiApiWorkflowBulkRestartArgs = {useLatestDefinitions?: boolean | undefined, body: Array}; export type CreateApiApiWorkflowBulkRestartOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restart the list of completed workflow * * POST /api/workflow/bulk/restart */ export const createApiApiWorkflowBulkRestart = async (args: CreateApiApiWorkflowBulkRestartArgs, options?: CreateApiApiWorkflowBulkRestartOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args.useLatestDefinitions != null) query.append("useLatestDefinitions", String(args.useLatestDefinitions)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/bulk/restart${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };