export type CreateApiApiAdminSweepRequeueWorkflowIdArgs = {workflowId: string}; export type CreateApiApiAdminSweepRequeueWorkflowIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Queue up all the running workflows for sweep * * POST /api/admin/sweep/requeue/{workflowId} */ export const createApiApiAdminSweepRequeueWorkflowId = async (args: CreateApiApiAdminSweepRequeueWorkflowIdArgs, options?: CreateApiApiAdminSweepRequeueWorkflowIdOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/sweep/requeue/${encodeURIComponent(String(args.workflowId))}${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 res.text() };