export type GetApiJoinmassiveBrowserBatchesArgs = {id: string}; export type GetApiJoinmassiveBrowserBatchesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve status of batch browsing requests. * * GET /joinmassive/browser/batches */ export const getApiJoinmassiveBrowserBatches = async (args: GetApiJoinmassiveBrowserBatchesArgs, options?: GetApiJoinmassiveBrowserBatchesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) const url = `${baseUrl.replace(/\/+$/, '')}/joinmassive/browser/batches${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 };