export type GetApiEmailReputationV1Args = {email: string}; export type GetApiEmailReputationV1Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get detailed reputation data for an email address including deliverability, quality score, and risk indicators. * * GET /email-reputation/v1 */ export const getApiEmailReputationV1 = async (args: GetApiEmailReputationV1Args, options?: GetApiEmailReputationV1Options) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.email != null) query.append("email", String(args.email)) const url = `${baseUrl.replace(/\/+$/, '')}/email-reputation/v1${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 };