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