@veryfi/veryfi-sdk 1.4.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -2
- package/lib/anydocs/deleteAnyDocumentTag.js +14 -0
- package/lib/anydocs/getAnyDocument.js +3 -3
- package/lib/anydocs/getAnyDocumentTags.js +15 -0
- package/lib/anydocs/getAnyDocuments.js +3 -3
- package/lib/anydocs/getBlueprints.js +17 -0
- package/lib/anydocs/processAnyDocumentAsync.js +31 -0
- package/lib/anydocs/processAnyDocumentAsyncBase64.js +30 -0
- package/lib/anydocs/processAnyDocumentAsyncStream.js +30 -0
- package/lib/anydocs/processAnyDocumentAsyncUrl.js +30 -0
- package/lib/anydocs/tags/addAnyDocumentTag.js +15 -0
- package/lib/anydocs/tags/addAnyDocumentTags.js +15 -0
- package/lib/anydocs/tags/deleteAnyDocumentTags.js +12 -0
- package/lib/anydocs/updateAnyDocument.js +14 -0
- package/lib/bankstatements/getBankStatement.js +3 -3
- package/lib/bankstatements/getBankStatementSet.js +14 -0
- package/lib/bankstatements/getBankStatementSets.js +23 -0
- package/lib/bankstatements/getBankStatements.js +3 -3
- package/lib/bankstatements/processBankStatementAsync.js +31 -0
- package/lib/bankstatements/processBankStatementAsyncBase64.js +30 -0
- package/lib/bankstatements/processBankStatementAsyncStream.js +30 -0
- package/lib/bankstatements/processBankStatementAsyncUrl.js +30 -0
- package/lib/bankstatements/splitBankStatements.js +25 -0
- package/lib/bankstatements/splitBankStatementsBase64.js +24 -0
- package/lib/bankstatements/splitBankStatementsStream.js +24 -0
- package/lib/bankstatements/splitBankStatementsUrl.js +24 -0
- package/lib/bankstatements/tags/addBankStatementTag.js +15 -0
- package/lib/bankstatements/tags/addBankStatementTags.js +15 -0
- package/lib/bankstatements/tags/deleteBankStatementTag.js +13 -0
- package/lib/bankstatements/tags/deleteBankStatementTags.js +12 -0
- package/lib/bankstatements/tags/getBankStatementTags.js +14 -0
- package/lib/bankstatements/updateBankStatement.js +14 -0
- package/lib/businesscards/getBusinessCard.js +3 -3
- package/lib/businesscards/getBusinessCards.js +3 -3
- package/lib/businesscards/tags/addBusinessCardTag.js +15 -0
- package/lib/businesscards/tags/addBusinessCardTags.js +15 -0
- package/lib/businesscards/tags/deleteBusinessCardTag.js +13 -0
- package/lib/businesscards/tags/deleteBusinessCardTags.js +12 -0
- package/lib/businesscards/tags/getBusinessCardTags.js +14 -0
- package/lib/businesscards/updateBusinessCard.js +14 -0
- package/lib/checks/getCheck.js +3 -3
- package/lib/checks/getChecks.js +3 -3
- package/lib/checks/processCheckAsync.js +31 -0
- package/lib/checks/processCheckAsyncBase64.js +30 -0
- package/lib/checks/processCheckAsyncStream.js +30 -0
- package/lib/checks/processCheckAsyncUrl.js +30 -0
- package/lib/checks/processCheckWithRemittance.js +31 -0
- package/lib/checks/processCheckWithRemittanceBase64.js +30 -0
- package/lib/checks/processCheckWithRemittanceStream.js +30 -0
- package/lib/checks/processCheckWithRemittanceUrl.js +30 -0
- package/lib/checks/tags/addCheckTag.js +15 -0
- package/lib/checks/tags/addCheckTags.js +15 -0
- package/lib/checks/tags/deleteCheckTag.js +13 -0
- package/lib/checks/tags/deleteCheckTags.js +12 -0
- package/lib/checks/tags/getCheckTags.js +14 -0
- package/lib/checks/updateCheck.js +14 -0
- package/lib/classify/classifyDocument.js +25 -0
- package/lib/classify/classifyDocumentBase64.js +3 -3
- package/lib/classify/classifyDocumentStream.js +24 -0
- package/lib/classify/classifyDocumentUrl.js +4 -4
- package/lib/classify/extractDocument.js +28 -0
- package/lib/classify/extractDocumentBase64.js +27 -0
- package/lib/classify/extractDocumentStream.js +27 -0
- package/lib/classify/extractDocumentUrl.js +27 -0
- package/lib/client/client.js +152 -4
- package/lib/client/getHeaders.js +1 -1
- package/lib/client/request.js +7 -2
- package/lib/contracts/deleteContract.js +12 -0
- package/lib/contracts/getContract.js +18 -0
- package/lib/contracts/getContracts.js +23 -0
- package/lib/contracts/processContract.js +25 -0
- package/lib/contracts/processContractBase64.js +24 -0
- package/lib/contracts/processContractStream.js +24 -0
- package/lib/contracts/processContractUrl.js +24 -0
- package/lib/contracts/tags/addContractTag.js +15 -0
- package/lib/contracts/tags/addContractTags.js +15 -0
- package/lib/contracts/tags/deleteContractTag.js +13 -0
- package/lib/contracts/tags/deleteContractTags.js +12 -0
- package/lib/contracts/tags/getContractTags.js +14 -0
- package/lib/contracts/updateContract.js +14 -0
- package/lib/documents/getDocument.js +1 -2
- package/lib/documents/getDocuments.js +5 -5
- package/lib/documents/lineitems/createLineItem.js +14 -0
- package/lib/documents/lineitems/deleteDocumentLineItems.js +12 -0
- package/lib/documents/lineitems/deleteLineItem.js +13 -0
- package/lib/documents/lineitems/getDocumentLineItems.js +14 -0
- package/lib/documents/lineitems/getLineItem.js +15 -0
- package/lib/documents/lineitems/updateLineItem.js +15 -0
- package/lib/documents/processDocument.js +3 -0
- package/lib/documents/processDocumentStream.js +1 -1
- package/lib/documents/processDocumentUrl.js +1 -1
- package/lib/documents/processDocumentsBulk.js +15 -0
- package/lib/documents/tags/deleteTag.js +13 -0
- package/lib/documents/tags/getDocumentTags.js +14 -0
- package/lib/documents/taxlines/createTaxLine.js +14 -0
- package/lib/documents/taxlines/deleteTaxLine.js +13 -0
- package/lib/documents/taxlines/getTaxLine.js +15 -0
- package/lib/documents/taxlines/getTaxLines.js +14 -0
- package/lib/documents/taxlines/updateTaxLine.js +15 -0
- package/lib/fraud/addDevicesToBlocklist.js +20 -0
- package/lib/fraud/getFraudBlocklist.js +17 -0
- package/lib/fraud/removeDeviceFromBlocklist.js +12 -0
- package/lib/parse/deleteMarkdownDocument.js +12 -0
- package/lib/parse/getMarkdownDocument.js +14 -0
- package/lib/parse/getMarkdownDocumentSet.js +14 -0
- package/lib/parse/getMarkdownDocumentSets.js +23 -0
- package/lib/parse/getMarkdownDocuments.js +23 -0
- package/lib/parse/processMarkdownDocument.js +25 -0
- package/lib/parse/processMarkdownDocumentAsync.js +25 -0
- package/lib/parse/processMarkdownDocumentAsyncBase64.js +24 -0
- package/lib/parse/processMarkdownDocumentAsyncStream.js +24 -0
- package/lib/parse/processMarkdownDocumentAsyncUrl.js +24 -0
- package/lib/parse/processMarkdownDocumentBase64.js +24 -0
- package/lib/parse/processMarkdownDocumentSet.js +25 -0
- package/lib/parse/processMarkdownDocumentSetBase64.js +24 -0
- package/lib/parse/processMarkdownDocumentSetStream.js +24 -0
- package/lib/parse/processMarkdownDocumentSetUrl.js +24 -0
- package/lib/parse/processMarkdownDocumentStream.js +24 -0
- package/lib/parse/processMarkdownDocumentUrl.js +24 -0
- package/lib/parse/updateMarkdownDocument.js +14 -0
- package/lib/platform/getOcrCounts.js +20 -0
- package/lib/platform/getOpenApiSchema.js +17 -0
- package/lib/platform/getReleaseNotifications.js +13 -0
- package/lib/settings/addWebhook.js +20 -0
- package/lib/settings/confirmWebhook.js +23 -0
- package/lib/settings/createApiKey.js +20 -0
- package/lib/settings/createClientKeys.js +17 -0
- package/lib/settings/deleteClientKey.js +12 -0
- package/lib/settings/deleteTlsCertificate.js +12 -0
- package/lib/settings/getApiKey.js +17 -0
- package/lib/settings/getApiKeyPermissions.js +15 -0
- package/lib/settings/getApiKeys.js +15 -0
- package/lib/settings/getClientKeys.js +15 -0
- package/lib/settings/getTlsCertificates.js +15 -0
- package/lib/settings/getWebhooks.js +15 -0
- package/lib/settings/processTlsCertificate.js +17 -0
- package/lib/settings/resetClientKeys.js +17 -0
- package/lib/settings/revokeApiKey.js +12 -0
- package/lib/settings/rotateApiKey.js +14 -0
- package/lib/settings/updateApiKey.js +19 -0
- package/lib/settings/verifyApiKey.js +15 -0
- package/lib/split/getSplitDocument.js +2 -3
- package/lib/split/getSplitDocuments.js +3 -3
- package/lib/split/splitDocument.js +16 -0
- package/lib/split/splitDocumentStream.js +19 -0
- package/lib/split/splitDocumentUrl.js +1 -1
- package/lib/types/Client.ts +547 -1
- package/lib/types/VeryfiExtraArgs.ts +4 -5
- package/lib/w2s/getW2.js +1 -2
- package/lib/w2s/getW2Set.js +14 -0
- package/lib/w2s/getW2Sets.js +23 -0
- package/lib/w2s/splitW2s.js +25 -0
- package/lib/w2s/splitW2sBase64.js +24 -0
- package/lib/w2s/splitW2sStream.js +24 -0
- package/lib/w2s/splitW2sUrl.js +24 -0
- package/lib/w2s/tags/addW2Tag.js +15 -0
- package/lib/w2s/tags/addW2Tags.js +15 -0
- package/lib/w2s/tags/deleteW2Tag.js +13 -0
- package/lib/w2s/tags/deleteW2Tags.js +12 -0
- package/lib/w2s/tags/getW2Tags.js +14 -0
- package/lib/w2s/updateW2.js +14 -0
- package/lib/w8bene/getW8BENE.js +3 -3
- package/lib/w8bene/getW8BENEs.js +3 -3
- package/lib/w8bene/tags/addW8beneTag.js +15 -0
- package/lib/w8bene/tags/addW8beneTags.js +15 -0
- package/lib/w8bene/tags/deleteW8beneTag.js +13 -0
- package/lib/w8bene/tags/deleteW8beneTags.js +12 -0
- package/lib/w8bene/tags/getW8beneTags.js +14 -0
- package/lib/w8bene/updateW8BENE.js +14 -0
- package/lib/w9s/getW9.js +3 -3
- package/lib/w9s/getW9s.js +3 -3
- package/lib/w9s/tags/addW9Tag.js +15 -0
- package/lib/w9s/tags/addW9Tags.js +15 -0
- package/lib/w9s/tags/deleteW9Tag.js +13 -0
- package/lib/w9s/tags/deleteW9Tags.js +12 -0
- package/lib/w9s/tags/getW9Tags.js +14 -0
- package/lib/w9s/updateW9.js +14 -0
- package/package.json +14 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process a markdown document set from a file stream. https://docs.veryfi.com/api/parse/process-a-markdown-document-set/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {stream.Readable} file ReadStream of a file to submit
|
|
7
|
+
* @param {String} file_name The file name including the extension
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_set_from_stream = async function (
|
|
12
|
+
file,
|
|
13
|
+
file_name,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse-set/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file": file,
|
|
19
|
+
"file_name": file_name,
|
|
20
|
+
};
|
|
21
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
22
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
23
|
+
return response['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process a markdown document set from a URL. https://docs.veryfi.com/api/parse/process-a-markdown-document-set/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string|null} file_url Required if file_urls isn't specified. Publicly accessible URL to a file.
|
|
7
|
+
* @param {string[]} file_urls Required if file_url isn't specified. List of publicly accessible URLs.
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_set_from_url = async function (
|
|
12
|
+
file_url = null,
|
|
13
|
+
file_urls = null,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse-set/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file_url": file_url,
|
|
19
|
+
"file_urls": file_urls,
|
|
20
|
+
};
|
|
21
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
22
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
23
|
+
return response['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Convert a document to markdown from a file stream. https://docs.veryfi.com/api/parse/convert-a-document-to-markdown/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {stream.Readable} file ReadStream of a file to submit
|
|
7
|
+
* @param {String} file_name The file name including the extension
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_from_stream = async function (
|
|
12
|
+
file,
|
|
13
|
+
file_name,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file": file,
|
|
19
|
+
"file_name": file_name,
|
|
20
|
+
};
|
|
21
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
22
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
23
|
+
return response['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Convert a document to markdown from a URL. https://docs.veryfi.com/api/parse/convert-a-document-to-markdown/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string|null} file_url Required if file_urls isn't specified. Publicly accessible URL to a file.
|
|
7
|
+
* @param {string[]} file_urls Required if file_url isn't specified. List of publicly accessible URLs.
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_from_url = async function (
|
|
12
|
+
file_url = null,
|
|
13
|
+
file_urls = null,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file_url": file_url,
|
|
19
|
+
"file_urls": file_urls,
|
|
20
|
+
};
|
|
21
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
22
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
23
|
+
return response['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Update a Markdown Document. https://docs.veryfi.com/api/parse/update-a-markdown-document/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the resource
|
|
7
|
+
* @param {Object} kwargs Fields to update
|
|
8
|
+
* @returns {JSON} Updated resource
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.update_markdown_document = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/parse/${document_id}/`;
|
|
12
|
+
let response = await this._request("PUT", endpoint_name, kwargs);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get ocr-counts. https://docs.veryfi.com/api/get-ocr-counts/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} ocr_type OCR type (pepsico_codes or pepsico_caps)
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_ocr_counts = async function (
|
|
11
|
+
ocr_type = null,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = "/ocr-counts/";
|
|
15
|
+
let query = Object.assign({
|
|
16
|
+
"ocr_type": ocr_type,
|
|
17
|
+
}, kwargs);
|
|
18
|
+
let response = await this._request("GET", endpoint_name, {}, query, false);
|
|
19
|
+
return response['data'];
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get OpenAPI schema. https://docs.veryfi.com/api/get-open-api-schema/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_open_api_schema = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/documents/schema/";
|
|
13
|
+
let query = Object.assign({
|
|
14
|
+
}, kwargs);
|
|
15
|
+
let response = await this._request("GET", endpoint_name, {}, query, false);
|
|
16
|
+
return response['data'];
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get release notifications. https://docs.veryfi.com/api/get-release-notifications/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} Release notifications
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_release_notifications = async function ({...kwargs} = {}) {
|
|
10
|
+
let endpoint_name = "/release-notifications/";
|
|
11
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false, { api_version: "v1", skip_partner: true });
|
|
12
|
+
return response['data'];
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Add a webhook. https://docs.veryfi.com/api/settings/add-a-webhook/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {*} url Request field
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.add_webhook = async function (
|
|
11
|
+
url,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = "/settings/webhooks/";
|
|
15
|
+
let request_arguments = Object.assign({
|
|
16
|
+
"url": url,
|
|
17
|
+
}, kwargs);
|
|
18
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
19
|
+
return response['data'];
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Confirm a webhook. https://docs.veryfi.com/api/settings/confirm-a-webhook/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {*} url Request field
|
|
7
|
+
* @param {*} secret Request field
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.confirm_webhook = async function (
|
|
12
|
+
url,
|
|
13
|
+
secret,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/settings/webhooks/confirm/";
|
|
17
|
+
let request_arguments = Object.assign({
|
|
18
|
+
"url": url,
|
|
19
|
+
"secret": secret,
|
|
20
|
+
}, kwargs);
|
|
21
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
22
|
+
return response['data'];
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Create api-key. https://docs.veryfi.com/api/settings/create-api-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {*} name Request field
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.create_api_key = async function (
|
|
11
|
+
name,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = "/settings/api-keys/";
|
|
15
|
+
let request_arguments = Object.assign({
|
|
16
|
+
"name": name,
|
|
17
|
+
}, kwargs);
|
|
18
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, false, { api_version: "v1" });
|
|
19
|
+
return response['data'];
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Create client-keys. https://docs.veryfi.com/api/settings/create-client-keys/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.create_client_keys = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/client-keys/";
|
|
13
|
+
let request_arguments = Object.assign({
|
|
14
|
+
}, kwargs);
|
|
15
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
16
|
+
return response['data'];
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Remove a client-key. https://docs.veryfi.com/api/settings/remove-a-client-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} id Resource id
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.delete_client_key = async function (id) {
|
|
10
|
+
let endpoint_name = `/client-keys/${id}/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {});
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a Tls Certificate. https://docs.veryfi.com/api/delete-a-tls-certificate/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} certificate_id Resource id
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.delete_tls_certificate = async function (certificate_id) {
|
|
10
|
+
let endpoint_name = `/settings/tls-certificate/${certificate_id}/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {});
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve api-key. https://docs.veryfi.com/api/settings/retrieve-api-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} id Resource id
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_api_key = async function (
|
|
11
|
+
id,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = `/settings/api-keys/${id}/`;
|
|
15
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false, { api_version: "v1" });
|
|
16
|
+
return response['data'];
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Available permissions. https://docs.veryfi.com/api/settings/available-permissions/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_api_key_permissions = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/api-keys/available-permissions/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false, { api_version: "v1" });
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve api-keys list. https://docs.veryfi.com/api/settings/retrieve-api-keys-list/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_api_keys = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/api-keys/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false, { api_version: "v1" });
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve client-keys list. https://docs.veryfi.com/api/settings/retrieve-client-keys-list/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_client_keys = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/client-keys/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get Tls Certificates. https://docs.veryfi.com/api/get-tls-certificates/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_tls_certificates = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/tls-certificate/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get webhooks. https://docs.veryfi.com/api/settings/get-webhooks/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_webhooks = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/webhooks/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process a Tls Certificate. https://docs.veryfi.com/api/process-a-tls-certificate/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.process_tls_certificate = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/tls-certificate/";
|
|
13
|
+
let request_arguments = Object.assign({
|
|
14
|
+
}, kwargs);
|
|
15
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
16
|
+
return response['data'];
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Reset client-keys. https://docs.veryfi.com/api/settings/reset-client-keys/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.reset_client_keys = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/client-keys/reset/";
|
|
13
|
+
let request_arguments = Object.assign({
|
|
14
|
+
}, kwargs);
|
|
15
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
16
|
+
return response['data'];
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Revoke api-key. https://docs.veryfi.com/api/settings/revoke-api-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} id Resource id
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.revoke_api_key = async function (id) {
|
|
10
|
+
let endpoint_name = `/settings/api-keys/${id}/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {}, {}, false, { api_version: "v1" });
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Rotate api-key. https://docs.veryfi.com/api/settings/rotate-api-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} id API key id
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} Rotated API key
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.rotate_api_key = async function (id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/settings/api-keys/${id}/rotate/`;
|
|
12
|
+
let response = await this._request("POST", endpoint_name, kwargs, null, false, { api_version: "v1" });
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Update api-key. https://docs.veryfi.com/api/settings/update-api-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} id Resource id
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.update_api_key = async function (
|
|
11
|
+
id,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = `/settings/api-keys/${id}/`;
|
|
15
|
+
let request_arguments = Object.assign({
|
|
16
|
+
}, kwargs);
|
|
17
|
+
let response = await this._request("PUT", endpoint_name, request_arguments, null, false, { api_version: "v1" });
|
|
18
|
+
return response['data'];
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Verify the calling key. https://docs.veryfi.com/api/settings/verify-the-calling-key/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.verify_api_key = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/settings/api-keys/verify/";
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false, { api_version: "v1" });
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -7,8 +7,7 @@ const Client = require('../client/constructor');
|
|
|
7
7
|
* @returns {JSON} Data extracted from the Document
|
|
8
8
|
*/
|
|
9
9
|
Client.prototype.get_split_document = async function (document_id, {...kwargs} = {}) {
|
|
10
|
-
let endpoint_name = `/documents-set
|
|
11
|
-
let
|
|
12
|
-
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
10
|
+
let endpoint_name = `/documents-set/${document_id}/`;
|
|
11
|
+
let document = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
12
|
return document['data'];
|
|
14
13
|
}
|
|
@@ -13,11 +13,11 @@ Client.prototype.get_split_documents = async function (
|
|
|
13
13
|
{...kwargs} = {}
|
|
14
14
|
) {
|
|
15
15
|
let endpoint_name = "/documents-set/";
|
|
16
|
-
let
|
|
16
|
+
let query = Object.assign({
|
|
17
17
|
"page": page,
|
|
18
18
|
"page_size": page_size
|
|
19
|
-
};
|
|
20
|
-
let documents = await this._request("GET", endpoint_name,
|
|
19
|
+
}, kwargs);
|
|
20
|
+
let documents = await this._request("GET", endpoint_name, {}, query, false);
|
|
21
21
|
if ("data" in documents) {
|
|
22
22
|
documents = documents["data"];
|
|
23
23
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Split and process a PDF. https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
|
|
6
|
+
*
|
|
7
|
+
* @memberof Client
|
|
8
|
+
* @param {String} file_path Path on disk to a PDF or zip to split
|
|
9
|
+
* @param {Object} kwargs Additional request parameters (categories, tags, max_pages_to_process, external_id, package_path, bucket)
|
|
10
|
+
* @returns {JSON} Split set response
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.split_document = async function (file_path, {...kwargs} = {}) {
|
|
13
|
+
let file = fs.createReadStream(file_path);
|
|
14
|
+
let file_name = path.basename(file_path);
|
|
15
|
+
return this.split_document_from_stream(file, file_name, kwargs);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Split and process a PDF from a file stream. https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {stream.Readable} file ReadStream of a PDF or zip to split
|
|
7
|
+
* @param {String} file_name The file name including the extension
|
|
8
|
+
* @param {Object} kwargs Additional request parameters (categories, tags, max_pages_to_process, external_id, package_path, bucket)
|
|
9
|
+
* @returns {JSON} Split set response
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.split_document_from_stream = async function (file, file_name, {...kwargs} = {}) {
|
|
12
|
+
let endpoint_name = "/documents-set/";
|
|
13
|
+
let request_arguments = Object.assign({
|
|
14
|
+
"file": file,
|
|
15
|
+
"file_name": file_name
|
|
16
|
+
}, kwargs);
|
|
17
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
18
|
+
return response['data'];
|
|
19
|
+
}
|
|
@@ -7,7 +7,7 @@ const Client = require('../client/constructor');
|
|
|
7
7
|
* @memberof Client
|
|
8
8
|
* @param {string|null} file_url Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
|
|
9
9
|
* @param {Array} file_urls Required if file_url isn't specified. List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]
|
|
10
|
-
* @param {Object} kwargs Additional request parameters
|
|
10
|
+
* @param {Object} kwargs Additional request parameters (categories, tags, max_pages_to_process, external_id, package_path, bucket)
|
|
11
11
|
* @return {JSON} Data extracted from the document.
|
|
12
12
|
*/
|
|
13
13
|
Client.prototype.split_document_from_url = async function (
|