export type GetApiOlostepV1CrawlsCrawlIdArgs = {crawl_id: string}; export type GetApiOlostepV1CrawlsCrawlIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fetches information about a specific crawl. * * GET /olostep/v1/crawls/{crawl_id} */ export const getApiOlostepV1CrawlsCrawlId = async (args: GetApiOlostepV1CrawlsCrawlIdArgs, options?: GetApiOlostepV1CrawlsCrawlIdOptions) => { 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/crawls/${encodeURIComponent(String(args.crawl_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 };