export type UpdateApiV1InternalApprovalRankerScoresArgs = {body: {model: string, predecessorModel?: (string | null) | undefined, run: string, image: string, scoredAt: string, scores: Array<{scanId: string, measurementStageRunId?: (string | null) | undefined, box: {lengthCm: number, widthCm: number, heightCm: number}, fusionId?: (string | null) | undefined, p: number, rawScore: number, predecessorP?: (number | null) | undefined}>}}; export type UpdateApiV1InternalApprovalRankerScoresOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/internal/approval-ranker/scores */ export const updateApiV1InternalApprovalRankerScores = async (args: UpdateApiV1InternalApprovalRankerScoresArgs, options: UpdateApiV1InternalApprovalRankerScoresOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/internal/approval-ranker/scores${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 };