export type GetApiAviatoPersonEnrichArgs = {id?: string | undefined, linkedinID?: string | undefined, linkedinEntityId?: string | undefined, linkedinURL?: string | undefined, twitterID?: string | undefined, crunchbaseID?: string | undefined, angelListID?: string | undefined, signalNfxID?: string | undefined, polyworkID?: string | undefined, email?: string | undefined, rescrape?: boolean | undefined, maxDataAgeDays?: number | undefined, preview?: boolean | undefined, full?: boolean | undefined}; export type GetApiAviatoPersonEnrichOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get enriched details on a person. Pass any identifier. * * GET /aviato/person/enrich */ export const getApiAviatoPersonEnrich = async (args: GetApiAviatoPersonEnrichArgs, options?: GetApiAviatoPersonEnrichOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.linkedinID != null) query.append("linkedinID", String(args.linkedinID)) if (args.linkedinEntityId != null) query.append("linkedinEntityId", String(args.linkedinEntityId)) if (args.linkedinURL != null) query.append("linkedinURL", String(args.linkedinURL)) if (args.twitterID != null) query.append("twitterID", String(args.twitterID)) if (args.crunchbaseID != null) query.append("crunchbaseID", String(args.crunchbaseID)) if (args.angelListID != null) query.append("angelListID", String(args.angelListID)) if (args.signalNfxID != null) query.append("signalNfxID", String(args.signalNfxID)) if (args.polyworkID != null) query.append("polyworkID", String(args.polyworkID)) if (args.email != null) query.append("email", String(args.email)) if (args.rescrape != null) query.append("rescrape", String(args.rescrape)) if (args.maxDataAgeDays != null) query.append("maxDataAgeDays", String(args.maxDataAgeDays)) if (args.preview != null) query.append("preview", String(args.preview)) if (args.full != null) query.append("full", String(args.full)) const url = `${baseUrl.replace(/\/+$/, '')}/aviato/person/enrich${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 };