export type GetApiRocketreachProfileCompanyLookupArgs = {name?: string | undefined, current_employer?: string | undefined, linkedin_url?: string | undefined, email?: string | undefined}; export type GetApiRocketreachProfileCompanyLookupOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Look up a person and their associated company data in a single request. * * GET /rocketreach/profile-company/lookup */ export const getApiRocketreachProfileCompanyLookup = async (args: GetApiRocketreachProfileCompanyLookupArgs, options?: GetApiRocketreachProfileCompanyLookupOptions) => { 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.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/profile-company/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 };