export type GetApiV1DisclaimersArgs = {ids: string}; export type GetApiV1DisclaimersOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disclaimers * * GET /v1/disclaimers * * Also accepts auth: oauth2 */ export const getApiV1Disclaimers = async (args: GetApiV1DisclaimersArgs, options?: GetApiV1DisclaimersOptions) => { const {baseUrl = "https://api.domain.com.au", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.ids != null) query.append("ids", String(args.ids)) if (apikey !== undefined) headers.set("x-api-key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/disclaimers${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 };