export type GetApiApiV1UnifiedExecutionsIdStreamArgs = {id: string, 'X-Tenant-ID': string, 'X-Org-ID': string}; export type GetApiApiV1UnifiedExecutionsIdStreamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stream execution status via SSE * * GET /api/v1/unified/executions/{id}/stream */ export const getApiApiV1UnifiedExecutionsIdStream = async (args: GetApiApiV1UnifiedExecutionsIdStreamArgs, options?: GetApiApiV1UnifiedExecutionsIdStreamOptions) => { const {baseUrl = "https://orchestrator.getaxonflow.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/event-stream") if (args['X-Tenant-ID'] != null) headers.set("X-Tenant-ID", String(args['X-Tenant-ID'])) if (args['X-Org-ID'] != null) headers.set("X-Org-ID", String(args['X-Org-ID'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/unified/executions/${encodeURIComponent(String(args.id))}/stream${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.text() };