export type GetApiTombaV1EmailFinderArgs = {domain?: string | undefined, company?: string | undefined, full_name?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, enrich_mobile?: string | undefined}; export type GetApiTombaV1EmailFinderOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find the most likely email address from a domain name, first name, and last name. * * GET /tomba/v1/email-finder */ export const getApiTombaV1EmailFinder = async (args: GetApiTombaV1EmailFinderArgs, options?: GetApiTombaV1EmailFinderOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.domain != null) query.append("domain", String(args.domain)) if (args.company != null) query.append("company", String(args.company)) if (args.full_name != null) query.append("full_name", String(args.full_name)) if (args.first_name != null) query.append("first_name", String(args.first_name)) if (args.last_name != null) query.append("last_name", String(args.last_name)) if (args.enrich_mobile != null) query.append("enrich_mobile", String(args.enrich_mobile)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/email-finder${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 };