export type TestStatus = 'Passed' | 'Failed' | 'Blocked' | 'Untested' | 'Retest' | 'Archived' | 'Skipped' | 'InProgress'; export type UpdateApiApiV1RunUpdateTestStatusArgs = {body: {runId: number, testIdStatusArray: Array<{testId?: number | undefined, status?: TestStatus | undefined}>, comment?: (string | null) | undefined}}; export type UpdateApiApiV1RunUpdateTestStatusOptions = {baseUrl?: string | undefined, cookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update test status in run * * PUT /api/v1/run/update-test-status * * Also accepts auth: bearerAuth */ export const updateApiApiV1RunUpdateTestStatus = async (args: UpdateApiApiV1RunUpdateTestStatusArgs, options?: UpdateApiApiV1RunUpdateTestStatusOptions) => { const {baseUrl = "http://localhost:3000", fetch: fetchFn = fetch, cookieAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (cookieAuth !== undefined) cookies.push("user_session=" + encodeURIComponent(cookieAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/run/update-test-status${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };