Skip to content

Commit

Permalink
Add matched to Person/Company Response (#214)
Browse files Browse the repository at this point in the history
* Bump eslint-plugin-unused-imports from 3.1.0 to 3.2.0

Bumps [eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports) from 3.1.0 to 3.2.0.
- [Commits](https://github.com/sweepline/eslint-plugin-unused-imports/commits)

---
updated-dependencies:
- dependency-name: eslint-plugin-unused-imports
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* other dependencies

* add matched to person/company responses

* update version

* reset yarn locks

* reset yarn lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: vvillait88 <vvillait88@yahoo.com>
  • Loading branch information
dependabot[bot] and vvillait88 authored May 10, 2024
1 parent 258c560 commit ffecff2
Show file tree
Hide file tree
Showing 6 changed files with 827 additions and 856 deletions.
52 changes: 46 additions & 6 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ const PDLJSClient = new PDLJS({ apiKey: process.env.PDL_API_KEY });
// Person APIs

PDLJSClient.person.enrichment({ phone: '4155688415' }).then((data) => {
console.log('Person Enrichment API');
console.log(data);
}).catch((error) => {
console.log('Person Enrichment API');
console.log(error);
});

PDLJSClient.person.enrichmentPreview({ phone: '4155688415' }).then((data) => {
console.log('Person Preview Enrichment API');
console.log(data);
}).catch((error) => {
console.log('Person Preview Enrichment API');
console.log(error);
});

PDLJSClient.person.identify({ phone: '4155688415' }).then((data) => {
console.log('Person Identify API');
console.log(data);
}).catch((error) => {
console.log('Person Identify API');
console.log(error);
});

Expand All @@ -35,17 +41,21 @@ const bulkEnrichmentRecords = {
};

PDLJSClient.person.bulk.enrichment(bulkEnrichmentRecords).then((data) => {
console.log(data.items);
console.log('Person Bulk Enrichment API');
console.log(data);
}).catch((error) => {
console.log('Person Bulk Enrichment API');
console.log(error);
});

PDLJSClient.person.search.sql({
searchQuery: "SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health'AND phone_numbers IS NOT NULL;",
size: 10,
}).then((data) => {
console.log('Person Search API - SQL');
console.log(data);
}).catch((error) => {
console.log('Person Search API - SQL');
console.log(error);
});

Expand All @@ -59,16 +69,20 @@ PDLJSClient.person.search.elastic({
},
size: 10,
}).then((data) => {
console.log('Person Search API - Elastic');
console.log(data);
}).catch((error) => {
console.log('Person Search API - Elastic');
console.log(error);
});

// Company APIs

PDLJSClient.company.enrichment({ website: 'peopledatalabs.com' }).then((data) => {
console.log('Company Enrichment API');
console.log(data);
}).catch((error) => {
console.log('Company Enrichment API');
console.log(error);
});

Expand All @@ -80,17 +94,21 @@ const bulkCompanyEnrichmentRecords = {
};

PDLJSClient.company.bulk.enrichment(bulkCompanyEnrichmentRecords).then((data) => {
console.log(data.items);
console.log('Company Bulk Enrichment API');
console.log(data);
}).catch((error) => {
console.log('Company Bulk Enrichment API');
console.log(error);
});

PDLJSClient.company.search.sql({
searchQuery: "SELECT * FROM company WHERE website = 'peopledatalabs.com';",
size: 10,
}).then((data) => {
console.log('Company Search API - SQL');
console.log(data);
}).catch((error) => {
console.log('Company Search API - SQL');
console.log(error);
});

Expand All @@ -104,16 +122,20 @@ PDLJSClient.company.search.elastic({
},
size: 10,
}).then((data) => {
console.log('Company Search API - Elastic');
console.log(data);
}).catch((error) => {
console.log('Company Search API - Elastic');
console.log(error);
});

// IP APIs

PDLJSClient.ip({ ip: '72.212.42.169' }).then((data) => {
console.log('IP Enrichment API');
console.log(data);
}).catch((error) => {
console.log('IP Enrichment API');
console.log(error);
});

Expand All @@ -124,61 +146,79 @@ PDLJSClient.autocomplete({
text: 'c++',
size: 10,
}).then((data) => {
console.log('Autocomplete API');
console.log(data);
}).catch((error) => {
console.log('Autocomplete API');
console.log(error);
});

PDLJSClient.company.cleaner({ name: 'peopledatalabs' }).then((data) => {
console.log('Company Cleaner API');
console.log(data);
}).catch((error) => {
console.log('Company Cleaner API');
console.log(error);
});

PDLJSClient.location.cleaner({ location: '455 Market Street, San Francisco, California 94105, US' }).then((data) => {
console.log('Location Cleaner API');
console.log(data);
}).catch((error) => {
console.log('Location Cleaner API');
console.log(error);
});

PDLJSClient.school.cleaner({ name: 'university of oregon' }).then((data) => {
console.log('School Cleaner API');
console.log(data);
}).catch((error) => {
console.log('School Cleaner API');
console.log(error);
});

PDLJSClient.jobTitle({ jobTitle: 'software engineer' }).then((data) => {
console.log('Job Title API');
console.log(data);
}).catch((error) => {
console.log('Job Title API');
console.log(error);
});

PDLJSClient.skill({ skill: 'c++' }).then((data) => {
console.log('Skill API');
console.log(data);
}).catch((error) => {
console.log('Skill API');
console.log(error);
});

// Sandbox APIs

PDLJSClient.person.enrichment({ email: 'irussell@example.org', sandbox: true }).then((data) => {
PDLJSClient.person.enrichment({ email: 'chad_taylor@carroll-inc.com', sandbox: true }).then((data) => {
console.log('Person Enrichment Sandbox API');
console.log(data);
}).catch((error) => {
console.log('Person Enrichment Sandbox API');
console.log(error);
});

PDLJSClient.person.search.sql({
searchQuery: "SELECT * FROM person WHERE location_country='mexico';",
searchQuery: "SELECT * FROM person WHERE location_country='united states';",
size: 10,
sandbox: true,
}).then((data) => {
console.log(data);
console.log('Person Search Sandbox API - SQL');
console.log(data.rateLimit);
}).catch((error) => {
console.log('Person Search Sandbox API - SQL');
console.log(error);
});

PDLJSClient.person.identify({ company: 'walmart', sandbox: true }).then((data) => {
PDLJSClient.person.identify({ company: 'carroll inc', sandbox: true }).then((data) => {
console.log('Person Identify Sandbox API');
console.log(data);
}).catch((error) => {
console.log('Person Identify Sandbox API');
console.log(error);
});
10 changes: 5 additions & 5 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==

axios@^1.6.7:
axios@^1.6.8:
version "1.6.8"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66"
integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==
Expand Down Expand Up @@ -72,11 +72,11 @@ mime-types@^2.1.12:
mime-db "1.52.0"

peopledatalabs@*:
version "7.0.6"
resolved "https://registry.yarnpkg.com/peopledatalabs/-/peopledatalabs-7.0.6.tgz#cac173f64d75c60b86b94677949e31c28020f1d3"
integrity sha512-1g/J7jvn7B2VrxEMuL2rCr5VJLukz/EwTKtae5dOKFI+mzxys+ETGmxKdpEib62mSbCM60o8UZQTH0dUXP11Kw==
version "8.0.1"
resolved "https://registry.yarnpkg.com/peopledatalabs/-/peopledatalabs-8.0.1.tgz#7ba41c298596eb0b5cf0a861e87709cb72babd5d"
integrity sha512-/NZ8AU1qHnevxwut/fKTZQgdFBA74f39X5Pg0ljaTN5KEG9BK7TkCbo1or82RY0XVI0JTuyjljrvJfgVe83JCA==
dependencies:
axios "^1.6.7"
axios "^1.6.8"
copy-anything "^3.0.5"

proxy-from-env@^1.1.0:
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peopledatalabs",
"version": "8.0.1",
"version": "8.1.0",
"description": "JavaScript client with TypeScript support for the People Data Labs API",
"type": "module",
"main": "dist/index.cjs",
Expand Down Expand Up @@ -43,9 +43,9 @@
},
"homepage": "https://docs.peopledatalabs.com/docs/javascript-sdk",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"chai": "^5.1.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"chai": "^5.1.1",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
Expand All @@ -54,13 +54,13 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-unused-imports": "^3.2.0",
"esm": "^3.2.25",
"microbundle": "^0.15.1",
"mocha": "^10.4.0",
"typescript": "^5.4.4"
"typescript": "^5.4.5"
},
"dependencies": {
"axios": "^1.6.8",
Expand Down
1 change: 1 addition & 0 deletions src/types/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export interface CompanyResponse {
alternative_domains?: Array<string>,
affiliated_profiles?: Array<string>,
likelihood?: number,
matched?: Array<string>,
average_employee_tenure?: number,
average_tenure_by_level?: {
cxo?: number,
Expand Down
6 changes: 4 additions & 2 deletions src/types/enrichment-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export type PersonEnrichmentParams = EnrichmentAdditionalParams & Partial<{

export interface PersonEnrichmentResponse extends BaseResponse {
likelihood: number,
data: PersonResponse
data: PersonResponse,
matched?: Array<string>
}

export type PersonEnrichmentPreviewParams = PersonEnrichmentParams;
Expand All @@ -58,7 +59,8 @@ export interface PersonPreviewResponse extends PersonPreviewResponseType {}

export interface PersonEnrichmentPreviewResponse extends BaseResponse {
likelihood: number,
data: PersonPreviewResponse
data: PersonPreviewResponse,
matched?: Array<string>
}

/* ---------------------------------------------------------- */
Expand Down
Loading

0 comments on commit ffecff2

Please sign in to comment.