export type HumanTaskUser = {user?: string | undefined, userType?: ('EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP') | undefined}; export type HumanTaskAssignment = {assignee?: HumanTaskUser | undefined, slaMinutes?: number | undefined}; export type CreateApiApiHumanTasksTaskIdReassignArgs = {taskId: string, body: Array}; export type CreateApiApiHumanTasksTaskIdReassignOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reassign a task without completing it * * POST /api/human/tasks/{taskId}/reassign */ export const createApiApiHumanTasksTaskIdReassign = async (args: CreateApiApiHumanTasksTaskIdReassignArgs, options?: CreateApiApiHumanTasksTaskIdReassignOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/human/tasks/${encodeURIComponent(String(args.taskId))}/reassign${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 };