export type GetApiApiWorkflowWorkflowIdTasksArgs = {workflowId: string, start?: number | undefined, count?: number | undefined, status?: Array | undefined}; export type GetApiApiWorkflowWorkflowIdTasksOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the workflow tasks by workflow (execution) id * * GET /api/workflow/{workflowId}/tasks */ export const getApiApiWorkflowWorkflowIdTasks = async (args: GetApiApiWorkflowWorkflowIdTasksArgs, options?: GetApiApiWorkflowWorkflowIdTasksOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.start != null) query.append("start", String(args.start)) if (args.count != null) query.append("count", String(args.count)) for (const item of args.status ?? []) query.append("status", String(item)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/tasks${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };