export type GetApiTombaV1LinkedinArgs = {url: string, enrich_mobile?: string | undefined}; export type GetApiTombaV1LinkedinOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find the email address from a LinkedIn profile URL. * * GET /tomba/v1/linkedin */ export const getApiTombaV1Linkedin = async (args: GetApiTombaV1LinkedinArgs, options?: GetApiTombaV1LinkedinOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.url != null) query.append("url", String(args.url)) if (args.enrich_mobile != null) query.append("enrich_mobile", String(args.enrich_mobile)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/linkedin${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 };