export type CreateApiOlostepV1MapsArgs = {body: {url: string, search_query?: string | undefined, top_n?: number | undefined, include_subdomain?: boolean | undefined, include_urls?: Array | undefined, exclude_urls?: Array | undefined, cursor?: string | undefined}}; export type CreateApiOlostepV1MapsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * This endpoint allows users to get all the urls on a certain website. It can take up to 120 seconds for complex websites. For large websites, results are paginated using cursor-based pagination * * POST /olostep/v1/maps */ export const createApiOlostepV1Maps = async (args: CreateApiOlostepV1MapsArgs, options?: CreateApiOlostepV1MapsOptions) => { 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/maps${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 };