export type GetApiEmailtrustscoreArgs = {lookup: string, language?: string | undefined}; export type GetApiEmailtrustscoreOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Email validation and trust score: scores an email address from 0 to 99 with AI-generated reasoning, flagging disposable and temporary addresses, suspicious patterns, and deliverability risk. For signup fraud prevention, lead quality scoring, list cleaning, and trial abuse detection. * * GET /emailtrustscore */ export const getApiEmailtrustscore = async (args: GetApiEmailtrustscoreArgs, options?: GetApiEmailtrustscoreOptions) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.lookup != null) query.append("lookup", String(args.lookup)) if (args.language != null) query.append("language", String(args.language)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/emailtrustscore${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 (await res.json()) as unknown };