export type GetApiOlostepV1ScrapesScrapeIdArgs = {scrape_id: string}; export type GetApiOlostepV1ScrapesScrapeIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Can be used to retrieve response for a scrape. * * GET /olostep/v1/scrapes/{scrape_id} */ export const getApiOlostepV1ScrapesScrapeId = async (args: GetApiOlostepV1ScrapesScrapeIdArgs, options?: GetApiOlostepV1ScrapesScrapeIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/olostep/v1/scrapes/${encodeURIComponent(String(args.scrape_id))}${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 };