export type GetApiApiV1RunTestStatusHistoryArgs = {runId: number, testId: number}; export type GetApiApiV1RunTestStatusHistoryOptions = {baseUrl?: string | undefined, cookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get test status history in run * * GET /api/v1/run/test-status-history * * Also accepts auth: bearerAuth */ export const getApiApiV1RunTestStatusHistory = async (args: GetApiApiV1RunTestStatusHistoryArgs, options?: GetApiApiV1RunTestStatusHistoryOptions) => { const {baseUrl = "http://localhost:3000", fetch: fetchFn = fetch, cookieAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.runId != null) query.append("runId", String(args.runId)) if (args.testId != null) query.append("testId", String(args.testId)) if (cookieAuth !== undefined) cookies.push("user_session=" + encodeURIComponent(cookieAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/run/test-status-history${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 undefined };