export type GetApiOlostepV1RetrieveArgs = {body: {retrieve_id: string, formats?: Array | undefined}}; export type GetApiOlostepV1RetrieveOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve page content of processed batches and crawls urls. * * GET /olostep/v1/retrieve */ export const getApiOlostepV1Retrieve = async (args: GetApiOlostepV1RetrieveArgs, options?: GetApiOlostepV1RetrieveOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/olostep/v1/retrieve${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", 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 };