export type GetApiOcrRequestIdLayoutsArgs = {request_id: string}; export type GetApiOcrRequestIdLayoutsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get OCR layouts * * GET /ocr/{request_id}/layouts */ export const getApiOcrRequestIdLayouts = async (args: GetApiOcrRequestIdLayoutsArgs, options?: GetApiOcrRequestIdLayoutsOptions) => { const {baseUrl = "https://us.app.zuva.ai/api/v2", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/ocr/${encodeURIComponent(String(args.request_id))}/layouts${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 res.blob() };