export type GetApiTombaV1PhoneFinderArgs = {email?: string | undefined, domain?: string | undefined, linkedin?: string | undefined, full?: boolean | undefined}; export type GetApiTombaV1PhoneFinderOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find phone numbers associated with an email, domain, or LinkedIn profile. * * GET /tomba/v1/phone-finder */ export const getApiTombaV1PhoneFinder = async (args: GetApiTombaV1PhoneFinderArgs, options?: GetApiTombaV1PhoneFinderOptions) => { 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)) if (args.domain != null) query.append("domain", String(args.domain)) if (args.linkedin != null) query.append("linkedin", String(args.linkedin)) if (args.full != null) query.append("full", String(args.full)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/phone-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 };