export type GetApiPeopledatalabsV5PersonIdentifyArgs = {name?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, email?: string | undefined, phone?: string | undefined, lid?: string | undefined, profile?: string | undefined, company?: string | undefined, location?: string | undefined, pretty?: boolean | undefined}; export type GetApiPeopledatalabsV5PersonIdentifyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Broad person lookup returning up to 20 candidate matches with confidence scores. Useful when you have partial info and want multiple possible matches. * * GET /peopledatalabs/v5/person/identify */ export const getApiPeopledatalabsV5PersonIdentify = async (args: GetApiPeopledatalabsV5PersonIdentifyArgs, options?: GetApiPeopledatalabsV5PersonIdentifyOptions) => { 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.first_name != null) query.append("first_name", String(args.first_name)) if (args.last_name != null) query.append("last_name", String(args.last_name)) if (args.email != null) query.append("email", String(args.email)) if (args.phone != null) query.append("phone", String(args.phone)) if (args.lid != null) query.append("lid", String(args.lid)) if (args.profile != null) query.append("profile", String(args.profile)) if (args.company != null) query.append("company", String(args.company)) if (args.location != null) query.append("location", String(args.location)) if (args.pretty != null) query.append("pretty", String(args.pretty)) const url = `${baseUrl.replace(/\/+$/, '')}/peopledatalabs/v5/person/identify${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 };