export type GetApiApiWorkflowWorkflowIdStatusArgs = {workflowId: string, includeOutput?: boolean | undefined, includeVariables?: boolean | undefined}; export type GetApiApiWorkflowWorkflowIdStatusOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the workflow by workflow (execution) id * * GET /api/workflow/{workflowId}/status */ export const getApiApiWorkflowWorkflowIdStatus = async (args: GetApiApiWorkflowWorkflowIdStatusArgs, options?: GetApiApiWorkflowWorkflowIdStatusOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.includeOutput != null) query.append("includeOutput", String(args.includeOutput)) if (args.includeVariables != null) query.append("includeVariables", String(args.includeVariables)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/status${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() };