export type GetApiIntelligenceDomainHealthSummaryArgs = {teamId: string}; export type GetApiIntelligenceDomainHealthSummaryOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Domain Health Summary * * GET /intelligence/domain-health-summary */ export const getApiIntelligenceDomainHealthSummary = async (args: GetApiIntelligenceDomainHealthSummaryArgs, options?: GetApiIntelligenceDomainHealthSummaryOptions) => { const {baseUrl = "https://api.supersend.io/v2", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.teamId != null) query.append("teamId", String(args.teamId)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/intelligence/domain-health-summary${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 };