export type UpdateApiApiV1RunEditArgs = {body: {runId: number, runName?: string | undefined, testIds?: Array | undefined}}; export type UpdateApiApiV1RunEditOptions = {baseUrl?: string | undefined, cookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a run * * PUT /api/v1/run/edit * * Also accepts auth: bearerAuth */ export const updateApiApiV1RunEdit = async (args: UpdateApiApiV1RunEditArgs, options?: UpdateApiApiV1RunEditOptions) => { 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/edit${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 };