Skip to content

Commit

Permalink
Remove updated_title_roles (#291)
Browse files Browse the repository at this point in the history
* remove updated_title_roles

* dependencies

* add canonical values

* lint

* updates

* formatting

* update types

* cleanup

* dependencies

* dependencies

* update boolean types

* dependencies

* dependencies

* dependencies

* dependencies

* updates
  • Loading branch information
vvillait88 authored Feb 20, 2025
1 parent 7757823 commit 10296c4
Show file tree
Hide file tree
Showing 31 changed files with 1,028 additions and 475 deletions.
34 changes: 17 additions & 17 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
'simple-import-sort',
'sort-destructure-keys',
'typescript-sort-keys',
'import-newlines',
],
rules: {
'max-len': 'off',
Expand All @@ -34,26 +35,25 @@ module.exports = {
caseSensitive: false,
natural: true,
}],
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
'import-newlines/enforce': ['error', {
items: 5000,
multiline: false,
}],
'@stylistic/member-delimiter-style': ['error', {
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
],
}],
'@stylistic/type-annotation-spacing': 'error',
'@stylistic/type-generic-spacing': ['error'],
'@stylistic/type-named-tuple-spacing': ['error'],
'sort-destructure-keys/sort-destructure-keys': [
2, {
caseSensitive: false,
},
],
'sort-destructure-keys/sort-destructure-keys': [2, {
caseSensitive: false,
}],
},
};
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ updates:
labels:
- "dependencies"
ignore:
- dependency-name: "@stylistic/eslint-plugin"
- dependency-name: "@typescript-eslint/eslint-plugin"
- dependency-name: "@typescript-eslint/parser"
- dependency-name: "copy-anything"
Expand Down
1 change: 1 addition & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"interactive": true,
"packageManager": "yarn",
"reject": [
"@stylistic/eslint-plugin",
"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
"copy-anything",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ try {
```js
// Enrich an IP Address
try {
const response = await PDLJSClient.ip({ ip: '72.212.42.169' });
const response = await PDLJSClient.ip({ ip: '72.212.42.228' });

console.log(response);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ PDLJSClient.company.search.elastic({

// IP APIs

PDLJSClient.ip({ ip: '72.212.42.169' }).then((data) => {
PDLJSClient.ip({ ip: '72.212.42.228' }).then((data) => {
console.log('IP Enrichment API');
console.log(data);
}).catch((error) => {
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peopledatalabs",
"version": "9.5.0",
"version": "10.0.0",
"description": "JavaScript client with TypeScript support for the People Data Labs API",
"type": "module",
"main": "dist/index.cjs",
Expand Down Expand Up @@ -43,18 +43,19 @@
},
"homepage": "https://docs.peopledatalabs.com/docs/javascript-sdk",
"devDependencies": {
"@stylistic/eslint-plugin": "^2.12.1",
"@stylistic/eslint-plugin": "^3.1.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"chai": "^5.1.2",
"chai": "^5.2.0",
"dotenv": "^16.4.7",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-newlines": "^1.4.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
Expand All @@ -63,8 +64,8 @@
"eslint-plugin-unused-imports": "^3.2.0",
"esm": "^3.2.25",
"microbundle": "^0.15.1",
"mocha": "^11.0.1",
"typescript": "^5.7.2"
"mocha": "^11.1.0",
"typescript": "^5.7.3"
},
"dependencies": {
"axios": "^1.7.9",
Expand Down
27 changes: 8 additions & 19 deletions src/endpoints/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ export default (
params: AutoCompleteParams,
) => new Promise<AutoCompleteResponse>((resolve, reject) => {
check(params, basePath, apiKey, null, 'autocomplete').then(() => {
const {
field,
pretty,
size,
text,
titlecase,
// eslint-disable-next-line @typescript-eslint/naming-convention
updated_title_roles,
} = params;
const { field, pretty, size, text, titlecase } = params;

const autocompleteParams = {
field,
text: text || '',
size: size || 10,
pretty: pretty || false,
titlecase: titlecase || false,
updated_title_roles: updated_title_roles || false,
};

const headers = {
Expand All @@ -40,15 +31,13 @@ export default (
...autocompleteParams,
},
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
14 changes: 7 additions & 7 deletions src/endpoints/bulkCompanyEnrichment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export default (basePath: string, apiKey: string, records: BulkCompanyEnrichment

return new Promise<BulkCompanyEnrichmentResponse>((resolve, reject) => {
check(records, basePath, apiKey, 'Records', 'bulk').then(() => {
axios.post<BulkCompanyEnrichmentResponse>(`${basePath}/company/enrich/bulk`, records, { headers })
.then((response) => {
resolve(parseRateLimitingResponse(response));
})
.catch((error) => {
reject(errorHandler(error));
});
axios.post<BulkCompanyEnrichmentResponse>(`${basePath}/company/enrich/bulk`, records, {
headers,
}).then((response) => {
resolve(parseRateLimitingResponse(response));
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
14 changes: 7 additions & 7 deletions src/endpoints/bulkEnrichment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export default (basePath: string, apiKey: string, records: BulkPersonEnrichmentP

return new Promise<BulkPersonEnrichmentResponse>((resolve, reject) => {
check(records, basePath, apiKey, 'Records', 'bulk').then(() => {
axios.post<BulkPersonEnrichmentResponse>(`${basePath}/person/bulk`, records, { headers })
.then((response) => {
resolve(parseRateLimitingResponse(response));
})
.catch((error) => {
reject(errorHandler(error));
});
axios.post<BulkPersonEnrichmentResponse>(`${basePath}/person/bulk`, records, {
headers,
}).then((response) => {
resolve(parseRateLimitingResponse(response));
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
20 changes: 8 additions & 12 deletions src/endpoints/bulkRetrieve/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import axios from 'axios';

import { check, errorHandler } from '../../errors.js';
import {
ApiBulkPersonRetrieveParams,
BulkPersonRetrieveParams,
BulkPersonRetrieveResponse,
} from '../../types/bulk-retrieve-types.js';
import { ApiBulkPersonRetrieveParams, BulkPersonRetrieveParams, BulkPersonRetrieveResponse } from '../../types/bulk-retrieve-types.js';
import { parseRateLimitingResponse } from '../../utils/api-utils.js';

const transformBulkRetrieveParams = (params: BulkPersonRetrieveParams): ApiBulkPersonRetrieveParams => {
Expand Down Expand Up @@ -35,13 +31,13 @@ export default (basePath: string, apiKey: string, records: BulkPersonRetrievePar
return new Promise<BulkPersonRetrieveResponse>((resolve, reject) => {
check(records, basePath, apiKey, 'Records', 'bulk').then(() => {
const apiParams = transformBulkRetrieveParams(records);
axios.post<BulkPersonRetrieveResponse>(`${basePath}/person/retrieve/bulk`, apiParams, { headers })
.then((response) => {
resolve(parseRateLimitingResponse(response));
})
.catch((error) => {
reject(errorHandler(error));
});
axios.post<BulkPersonRetrieveResponse>(`${basePath}/person/retrieve/bulk`, apiParams, {
headers,
}).then((response) => {
resolve(parseRateLimitingResponse(response));
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/cleaner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ export default <T, K extends BaseResponse> (
...params,
},
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/enrichment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ export default <T extends PersonEnrichmentParams | CompanyEnrichmentParams, K ex
axios.get<K>(url, {
params: p,
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/enrichmentPreview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ export default (
axios.get<PersonEnrichmentPreviewResponse>(url, {
params: p,
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/identify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ export default (
axios.get<IdentifyResponse>(url, {
params: p,
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/ip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ export default (
...params,
},
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/jobTitle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ export default (
...jobTitleParams,
},
headers,
})
.then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
})
.catch((error) => {
reject(errorHandler(error));
});
}).then((response) => {
if (response?.data?.status === 200) {
resolve(parseRateLimitingResponse(response));
}
}).catch((error) => {
reject(errorHandler(error));
});
}).catch((error) => {
reject(error);
});
Expand Down
Loading

0 comments on commit 10296c4

Please sign in to comment.