export type GetApiTombaV1EmailVerifierArgs = {email: string}; export type GetApiTombaV1EmailVerifierOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verify the deliverability of an email address. * * GET /tomba/v1/email-verifier */ export const getApiTombaV1EmailVerifier = async (args: GetApiTombaV1EmailVerifierArgs, options?: GetApiTombaV1EmailVerifierOptions) => { 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(/\/+$/, '')}/tomba/v1/email-verifier${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 };