export type GetApiOgcConformanceArgs = {f?: string | undefined}; export type GetApiOgcConformanceOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Information about stardards to which this API conforms * * GET /ogc/conformance */ export const getApiOgcConformance = async (args: GetApiOgcConformanceArgs, options: GetApiOgcConformanceOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.f != null) query.append("f", String(args.f)) const url = `${baseUrl.replace(/\/+$/, '')}/ogc/conformance${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 };