export type CreateApiApiWorkflowWorkflowIdResetcallbacksArgs = {workflowId: string}; export type CreateApiApiWorkflowWorkflowIdResetcallbacksOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resets callback times of all non-terminal SIMPLE tasks to 0 * * POST /api/workflow/{workflowId}/resetcallbacks */ export const createApiApiWorkflowWorkflowIdResetcallbacks = async (args: CreateApiApiWorkflowWorkflowIdResetcallbacksArgs, options?: CreateApiApiWorkflowWorkflowIdResetcallbacksOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/resetcallbacks${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 };