export type CreateApiWorkflowsEventsEventIdWorkflowWorkflowIdReflowArgs = {eventId: string, workflowId: string}; export type CreateApiWorkflowsEventsEventIdWorkflowWorkflowIdReflowOptions = {baseUrl: string, OAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reflow by event and workflow * * POST /workflows/events/{eventId}/workflow/{workflowId}/reflow * * Also accepts auth: ApiSecretKey */ export const createApiWorkflowsEventsEventIdWorkflowWorkflowIdReflow = async (args: CreateApiWorkflowsEventsEventIdWorkflowWorkflowIdReflowArgs, options: CreateApiWorkflowsEventsEventIdWorkflowWorkflowIdReflowOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth !== undefined) headers.set('authorization', `Bearer ${OAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/workflows/events/${encodeURIComponent(String(args.eventId))}/workflow/${encodeURIComponent(String(args.workflowId))}/reflow${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 };