export type GetApiApiV1SeoPagesDocumentArgs = {path: string}; export type GetApiApiV1SeoPagesDocumentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v1/seo/pages/document */ export const getApiApiV1SeoPagesDocument = async (args: GetApiApiV1SeoPagesDocumentArgs, options?: GetApiApiV1SeoPagesDocumentOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.path != null) query.append("path", String(args.path)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/seo/pages/document${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 };