export type GetApiRocketreachPersonLookupArgs = {name?: string | undefined, current_employer?: string | undefined, current_title?: string | undefined, linkedin_url?: string | undefined, email?: string | undefined}; export type GetApiRocketreachPersonLookupOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Look up a person by name, email, LinkedIn URL, or other identifiers. Returns professional profile and contact information. Consumes 1 export credit. * * GET /rocketreach/person/lookup */ export const getApiRocketreachPersonLookup = async (args: GetApiRocketreachPersonLookupArgs, options?: GetApiRocketreachPersonLookupOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.name != null) query.append("name", String(args.name)) if (args.current_employer != null) query.append("current_employer", String(args.current_employer)) if (args.current_title != null) query.append("current_title", String(args.current_title)) if (args.linkedin_url != null) query.append("linkedin_url", String(args.linkedin_url)) if (args.email != null) query.append("email", String(args.email)) const url = `${baseUrl.replace(/\/+$/, '')}/rocketreach/person/lookup${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 };