export type CreateApiOlostepV1BatchesArgs = {body: {items: Array<{custom_id?: string | undefined, url?: string | undefined}>, country?: string | undefined, parser?: ({id?: string | undefined}) | undefined, links_on_page?: ({absolute_links?: boolean | undefined, include_links?: Array | undefined, exclude_links?: Array | undefined}) | undefined}}; export type CreateApiOlostepV1BatchesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Starts a new batch. You receive an `id` that you can use to track the progress of the batch as shown [here](/api-reference/batches/info). Note: Processing time is constant regardless of batch size * * POST /olostep/v1/batches */ export const createApiOlostepV1Batches = async (args: CreateApiOlostepV1BatchesArgs, options?: CreateApiOlostepV1BatchesOptions) => { 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/batches${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };