import * as p_throttle from 'p-throttle'; import { KyInstance } from 'ky'; /** * TODO: I'm holding off on converting this client to an `AIFunctionsProvider` * because it seems to be significantly more expensive than other data sources, * and I'm not sure if it's worth the cost. */ declare namespace peopledatalabs { const BASE_URL = "https://api.peopledatalabs.com/v5/"; const throttle10PerMin: (function_: F) => p_throttle.ThrottledFunction; const throttle100PerMin: (function_: F) => p_throttle.ThrottledFunction; const JobTitleLevels: string[]; const JobTitleRoles: string[]; interface CompanyLookupOptions { pdl_id?: string; name?: string; profile?: string; ticker?: string; website?: string; location?: string[]; locality?: string; region?: string; country?: string; street_address?: string; postal_code?: string; data_include?: string; pretty?: boolean; } interface Naics { naics_code: string; sector: string; sub_sector: string; industry_group: string; naics_industry: string | null; national_industry: string | null; } interface Sic { sic_code: string; major_group: string; industry_group: string; industry_sector: string | null; } interface Location { name: string; locality: string; region: string; metro: string; country: string; continent: string; street_address: string; address_line_2: string | null; postal_code: string; geo: string; } interface EmployeeCountByCountry { [country: string]: number; } interface CompanyLookupResponse { status: number; name: string; display_name: string; size: string; employee_count: number; id: string; founded: number; industry: string; naics: Naics[]; sic: Sic[]; location: Location; linkedin_id: string; linkedin_url: string; facebook_url: string; twitter_url: string; profiles: string[]; website: string; ticker: string; gics_sector: string | null; mic_exchange: string | null; type: string; summary: string; tags: string[]; headline: string; alternative_names: string[]; alternative_domains: string[]; affiliated_profiles: string[]; employee_count_by_country: EmployeeCountByCountry; likelihood: number; } interface CompanySearchOptions { limit?: number; query: { website?: string; tags?: string; industry?: string; 'location.country'?: string; 'location.metro'?: string; summary?: string; size?: string[]; affiliated_profiles?: string; }; } type CompanySearchOptionsQueryKeys = keyof CompanySearchOptions['query']; interface CompanySearchResponse { status: number; data: { name: string; display_name: string; size: string; employee_count: number; id: string; founded: number; industry: string; naics: Naics[]; sic: Sic[]; location: Location; linkedin_id: string; linkedin_url: string; facebook_url: string; twitter_url: string; profiles: string[]; website: string; ticker: string; gics_sector: string | null; mic_exchange: string | null; type: string; summary: string; tags: string[]; headline: string; alternative_names: string[]; alternative_domains: string[]; affiliated_profiles: string[]; employee_count_by_country: EmployeeCountByCountry; }[]; scroll_token: string; total: number; } interface PersonSearchOptions { limit?: number; query: { first_name?: string; full_name?: string; last_name?: string; job_company_website?: string; job_title_role?: string; /** * The docs says this property should be an array of strings. * But when sending the array a 404 error is returned. * See: https://docs.peopledatalabs.com/docs/fields#job_title_levels */ job_title_levels?: string; job_company_name?: string; job_company_location_country?: string; }; } type PersonSearchOptionsQueryKeys = keyof PersonSearchOptions['query']; interface SearchPersonApiResponse { id: string; full_name: string; first_name: string; middle_initial: null | string; middle_name: null | string; last_initial: string; last_name: string; gender: string; birth_year: null | number; birth_date: null | string; linkedin_url: string; linkedin_username: string; linkedin_id: string; facebook_url: null | string; facebook_username: null | string; facebook_id: null | string; twitter_url: string; twitter_username: string; github_url: null | string; github_username: null | string; work_email: string; personal_emails: string[]; recommended_personal_email: null | string; mobile_phone: null | string; industry: null | string; job_title: string; job_title_role: null | string; job_title_sub_role: null | string; job_title_levels: string[]; job_onet_code: string; job_onet_major_group: string; job_onet_minor_group: string; job_onet_broad_occupation: string; job_onet_specific_occupation: string; job_onet_specific_occupation_detail: string; job_company_id: string; job_company_name: string; job_company_website: string; job_company_size: string; job_company_founded: number; job_company_industry: string; job_company_linkedin_url: string; job_company_linkedin_id: string; job_company_facebook_url: string; job_company_twitter_url: string; job_company_type: string; job_company_ticker: null | string; job_company_location_name: string; job_company_location_locality: string; job_company_location_metro: string; job_company_location_region: string; job_company_location_geo: string; job_company_location_street_address: string; job_company_location_address_line_2: string; job_company_location_postal_code: string; job_company_location_country: string; job_company_location_continent: string; job_last_updated: string; job_start_date: string; job_summary: null | string; location_name: null | string; location_locality: null | string; location_metro: null | string; location_region: null | string; location_country: null | string; location_continent: null | string; location_street_address: null | string; location_address_line_2: null | string; location_postal_code: null | string; location_geo: null | string; location_last_updated: null | string; linkedin_connections: number; facebook_friends: null | string; inferred_salary: string; inferred_years_experience: number; summary: null | string; phone_numbers: string[]; phones: string[]; emails: Email[]; interests: string[]; skills: string[]; location_names: string[]; regions: string[]; countries: string[]; street_addresses: string[]; experience: Experience[]; education: Education[]; profiles: Profile[]; name_aliases: string[]; possible_emails: PossibleEmail[]; possible_profiles: PossibleProfile[]; possible_phones: PossiblePhone[]; possible_street_addresses: string[]; possible_location_names: string[]; possible_birth_dates: string[]; job_history: JobHistory[]; certifications: string[]; languages: string[]; first_seen: string; num_sources: number; num_records: number; version_status: VersionStatus; } interface Email { address: string; type: null | string; first_seen: string; last_seen: string; num_sources: number; } interface Experience { company: Company; start_date: null | string; end_date: null | string; title: Title; location_names: string[]; is_primary: boolean; summary: null | string; num_sources: number; first_seen: string; last_seen: string; } interface Company { name: string; size: string; id: string; founded: number; industry: string; location: Location; linkedin_url: string; linkedin_id: string; facebook_url: null | string; twitter_url: string; website: string; ticker: null | string; type: string; raw: string[]; fuzzy_match: boolean; } interface Title { name: string; raw: string[]; role: null | string; sub_role: null | string; levels: string[]; } interface Education { school: School; degrees: string[]; start_date: string; end_date: string; majors: string[]; minors: string[]; gpa: null | string; raw: string[]; summary: null | string; } interface School { name: string; type: string; id: string; location: Location; linkedin_url: string; facebook_url: string; twitter_url: string; linkedin_id: string; website: string; domain: string; raw: string[]; } interface Profile { network: string; id: null | string; url: string; username: string; num_sources: number; first_seen: string; last_seen: string; } interface PossibleEmail { address: string; type: null | string; first_seen: string; last_seen: string; num_sources: number; } interface PossibleProfile { network: string; id: null | string; url: string; username: null | string; num_sources: number; first_seen: string; last_seen: string; } interface PossiblePhone { number: string; first_seen: string; last_seen: string; num_sources: number; } interface VersionStatus { status: string; contains: string[]; previous_version: string; current_version: string; } interface JobHistory { company_id: string; company_name: string; title: string; first_seen: string; last_seen: string; num_sources: number; } } /** * People & Company Data * * @see https://www.peopledatalabs.com */ declare class PeopleDataLabsClient { protected readonly ky: KyInstance; protected readonly apiKey: string; protected readonly apiBaseUrl: string; constructor({ apiKey, apiBaseUrl, timeoutMs, throttle, ky }?: { apiKey?: string; apiBaseUrl?: string; timeoutMs?: number; throttle?: boolean; ky?: KyInstance; }); companyLookup(options: peopledatalabs.CompanySearchOptions): Promise; companyProfile(options: peopledatalabs.CompanyLookupOptions): Promise; personSearch(options: peopledatalabs.PersonSearchOptions): Promise; } export { PeopleDataLabsClient, peopledatalabs };