export type GetApiApiAgentExecutionsArgs = {start?: number | undefined, size?: number | undefined, sort?: string | undefined, freeText?: string | undefined, status?: string | undefined, agentName?: string | undefined, sessionId?: string | undefined, classifier?: string | undefined}; export type GetApiApiAgentExecutionsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/agent/executions */ export const getApiApiAgentExecutions = async (args: GetApiApiAgentExecutionsArgs, options?: GetApiApiAgentExecutionsOptions) => { 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.size != null) query.append("size", String(args.size)) if (args.sort != null) query.append("sort", String(args.sort)) if (args.freeText != null) query.append("freeText", String(args.freeText)) if (args.status != null) query.append("status", String(args.status)) if (args.agentName != null) query.append("agentName", String(args.agentName)) if (args.sessionId != null) query.append("sessionId", String(args.sessionId)) if (args.classifier != null) query.append("classifier", String(args.classifier)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/agent/executions${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() };