export type CreateApiFindymailApiSearchReverseEmailArgs = {body: {email: string, with_profile?: boolean | undefined}}; export type CreateApiFindymailApiSearchReverseEmailOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find a LinkedIn profile from an email address. 1 credit without profile data, 2 credits with profile data (with_profile=true). * * POST /findymail/api/search/reverse-email */ export const createApiFindymailApiSearchReverseEmail = async (args: CreateApiFindymailApiSearchReverseEmailArgs, options?: CreateApiFindymailApiSearchReverseEmailOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/findymail/api/search/reverse-email${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };