export type ResetInvocationBody = {event_id: number, reason?: (string | null) | undefined, exclude_signals?: boolean | undefined, exclude_updates?: boolean | undefined}; export type CreateApiV1WorkflowsExecutionsExecutionIdResetArgs = {execution_id: string, body: ResetInvocationBody}; export type CreateApiV1WorkflowsExecutionsExecutionIdResetOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset Workflow * * POST /v1/workflows/executions/{execution_id}/reset */ export const createApiV1WorkflowsExecutionsExecutionIdReset = async (args: CreateApiV1WorkflowsExecutionsExecutionIdResetArgs, options?: CreateApiV1WorkflowsExecutionsExecutionIdResetOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workflows/executions/${encodeURIComponent(String(args.execution_id))}/reset${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 undefined };