-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package Updates, Add Support for Bulk Company Enrichment, Add Size to…
… Company Enrichment and Update Types (#164) * Bump axios from 1.6.2 to 1.6.5 Bumps [axios](https://github.com/axios/axios) from 1.6.2 to 1.6.5. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.6.2...v1.6.5) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * packages * update package version * fix tests and upgrade chai * add new features and tests * update readme --------- 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
1 parent
68f28b8
commit a44b113
Showing
10 changed files
with
277 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import axios from 'axios'; | ||
|
||
import { check, errorHandler } from '../../errors.js'; | ||
import { BulkCompanyEnrichmentParams, BulkCompanyEnrichmentResponse } from '../../types/bulk-types.js'; | ||
import { parseRateLimitingResponse } from '../../utils/api-utils.js'; | ||
|
||
export default (basePath: string, apiKey: string, records: BulkCompanyEnrichmentParams) => { | ||
const headers = { | ||
'Content-Type': 'application/json', | ||
'Accept-Encoding': 'gzip', | ||
'X-Api-Key': apiKey, | ||
'User-Agent': 'PDL-JS-SDK', | ||
}; | ||
|
||
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)); | ||
}); | ||
}).catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.