export type GetApiApiQualityReviewArgs = {task_id?: number | undefined}; export type GetApiApiQualityReviewOptions = {baseUrl: string, sessionCookie?: string | undefined, fetch?: typeof fetch | undefined}; /** * List quality reviews * * GET /api/quality-review * * Also accepts auth: apiKey */ export const getApiApiQualityReview = async (args: GetApiApiQualityReviewArgs, options: GetApiApiQualityReviewOptions) => { const {baseUrl, fetch: fetchFn = fetch, sessionCookie} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.task_id != null) query.append("task_id", String(args.task_id)) if (sessionCookie !== undefined) cookies.push("__Host-mc-session=" + encodeURIComponent(sessionCookie)) const url = `${baseUrl.replace(/\/+$/, '')}/api/quality-review${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 };