export type CreateApiApiWorkflowWorkflowIdRetryArgs = {workflowId: string, resumeSubworkflowTasks?: boolean | undefined, retryIfRetriedByParent?: boolean | undefined}; export type CreateApiApiWorkflowWorkflowIdRetryOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retries the last failed task * * POST /api/workflow/{workflowId}/retry */ export const createApiApiWorkflowWorkflowIdRetry = async (args: CreateApiApiWorkflowWorkflowIdRetryArgs, options?: CreateApiApiWorkflowWorkflowIdRetryOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.resumeSubworkflowTasks != null) query.append("resumeSubworkflowTasks", String(args.resumeSubworkflowTasks)) if (args.retryIfRetriedByParent != null) query.append("retryIfRetriedByParent", String(args.retryIfRetriedByParent)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/retry${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };