@veryfi/veryfi-sdk 1.4.8 → 1.5.1
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 +151 -4
- 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/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 +537 -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 +5 -5
|
@@ -6,7 +6,7 @@ const Client = require('../client/constructor');
|
|
|
6
6
|
* @param {number} page_size The number of Documents per page.
|
|
7
7
|
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
8
8
|
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
9
|
-
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @param {Object} kwargs Additional request parameters (q, order_by, external_id, device_id, device_user_uuid, status, tag, owner, created__/updated__/date__ gt/lt/gte/lte, track_total_results, detailed)
|
|
10
10
|
* @returns {JSON} JSON object of previously processed documents
|
|
11
11
|
*/
|
|
12
12
|
Client.prototype.get_documents = async function (
|
|
@@ -17,13 +17,13 @@ Client.prototype.get_documents = async function (
|
|
|
17
17
|
{...kwargs} = {}
|
|
18
18
|
) {
|
|
19
19
|
let endpoint_name = "/documents/";
|
|
20
|
-
let
|
|
20
|
+
let query = Object.assign({
|
|
21
21
|
"page": page,
|
|
22
22
|
"page_size": page_size,
|
|
23
23
|
"bounding_boxes": bounding_boxes,
|
|
24
|
-
"confidence_details": confidence_details
|
|
25
|
-
};
|
|
26
|
-
let documents = await this._request("GET", endpoint_name,
|
|
24
|
+
"confidence_details": confidence_details
|
|
25
|
+
}, kwargs);
|
|
26
|
+
let documents = await this._request("GET", endpoint_name, {}, query, false);
|
|
27
27
|
if ("data" in documents) {
|
|
28
28
|
documents = documents["data"];
|
|
29
29
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Create a line item. https://docs.veryfi.com/api/receipts-invoices/create-a-line-item/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {Object} kwargs Line item fields (description, total, sku, quantity, etc.)
|
|
8
|
+
* @returns {JSON} Created line item
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.create_line_item = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/line-items/`;
|
|
12
|
+
let response = await this._request("POST", endpoint_name, kwargs);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete all document line items. https://docs.veryfi.com/api/receipts-invoices/delete-all-document-line-items/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.delete_document_line_items = async function (document_id) {
|
|
10
|
+
let endpoint_name = `/documents/${document_id}/line-items/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {});
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a line item. https://docs.veryfi.com/api/receipts-invoices/delete-a-line-item/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} line_item_id ID of the line item
|
|
8
|
+
* @returns {JSON} Delete response
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.delete_line_item = async function (document_id, line_item_id) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/line-items/${line_item_id}/`;
|
|
12
|
+
return this._request("DELETE", endpoint_name, {});
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get document line items. https://docs.veryfi.com/api/receipts-invoices/get-document-line-items/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} Line items
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_document_line_items = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/line-items/`;
|
|
12
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a line item. https://docs.veryfi.com/api/receipts-invoices/get-a-line-item/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} line_item_id ID of the line item
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Line item
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_line_item = async function (document_id, line_item_id, {...kwargs} = {}) {
|
|
12
|
+
let endpoint_name = `/documents/${document_id}/line-items/${line_item_id}/`;
|
|
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
|
+
* Update a line item. https://docs.veryfi.com/api/receipts-invoices/update-a-line-item/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} line_item_id ID of the line item
|
|
8
|
+
* @param {Object} kwargs Fields to update
|
|
9
|
+
* @returns {JSON} Updated line item
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.update_line_item = async function (document_id, line_item_id, {...kwargs} = {}) {
|
|
12
|
+
let endpoint_name = `/documents/${document_id}/line-items/${line_item_id}/`;
|
|
13
|
+
let response = await this._request("PUT", endpoint_name, kwargs);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -26,6 +26,9 @@ Client.prototype.process_document = async function (
|
|
|
26
26
|
let file = fs.createReadStream(file_path);
|
|
27
27
|
let file_name = path.basename(file_path);
|
|
28
28
|
|
|
29
|
+
if (categories != null) {
|
|
30
|
+
kwargs = Object.assign({categories: categories}, kwargs);
|
|
31
|
+
}
|
|
29
32
|
return this.process_document_from_stream(
|
|
30
33
|
file,
|
|
31
34
|
file_name,
|
|
@@ -12,7 +12,7 @@ const Client = require('../client/constructor');
|
|
|
12
12
|
* @param {stream.Readable} file ReadStream of a file to submit for data extraction
|
|
13
13
|
* @param {String} file_name The file name including the extension
|
|
14
14
|
* @param {Boolean} auto_delete Delete this document from Veryfi after data has been extracted
|
|
15
|
-
* @param {Object} kwargs Additional request parameters
|
|
15
|
+
* @param {Object} kwargs Additional request parameters (categories, tags, async, parse_address, crop_document, compute, country, document_type, device_data, package_path, bucket, bounding_boxes, confidence_details)
|
|
16
16
|
* @returns {JSON} Data extracted from the document
|
|
17
17
|
*/
|
|
18
18
|
Client.prototype.process_document_from_stream = async function (
|
|
@@ -12,7 +12,7 @@ const Client = require('../client/constructor');
|
|
|
12
12
|
* @param {boolean} boost_mode Flag that tells Veryfi whether boost mode should be enabled. When set to 1, Veryfi will skip data enrichment steps, but will process the document faster. Default value for this flag is 0
|
|
13
13
|
* @param {string|null} external_id Optional custom document identifier. Use this if you would like to assign your own ID to documents
|
|
14
14
|
* @param {int} max_pages_to_process When sending a long document to Veryfi for processing, this parameter controls how many pages of the document will be read and processed, starting from page 1.
|
|
15
|
-
* @param {Object} kwargs Additional request parameters
|
|
15
|
+
* @param {Object} kwargs Additional request parameters (async, tags, parse_address, crop_document, compute, country, document_type, device_data, package_path, bucket, bounding_boxes, confidence_details, thinking, thinking_llm_version, allowed_async_enrichments, emailed_receipt_id, receipt_id)
|
|
16
16
|
* @return {JSON} Data extracted from the document.
|
|
17
17
|
*/
|
|
18
18
|
Client.prototype.process_document_from_url = async function (
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Bulk process multiple documents. https://docs.veryfi.com/api/receipts-invoices/bulk-process-multiple-documents/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string[]} file_urls Required. Array of publicly accessible document URLs (1-100).
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} List of document ids being processed
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.process_documents_bulk = async function (file_urls, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = "/documents/bulk/";
|
|
12
|
+
let request_arguments = Object.assign({ "file_urls": file_urls }, kwargs);
|
|
13
|
+
let response = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get document tags. https://docs.veryfi.com/api/receipts-invoices/get-document-tags/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} List of tags
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_document_tags = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/tags/`;
|
|
12
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Create a tax line. https://docs.veryfi.com/api/create-a-tax-line/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {Object} kwargs Tax line fields
|
|
8
|
+
* @returns {JSON} Created tax line
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.create_tax_line = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/tax-lines/`;
|
|
12
|
+
let response = await this._request("POST", endpoint_name, kwargs);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a tax line. https://docs.veryfi.com/api/delete-a-tax-line/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} tax_line_id ID of the tax line
|
|
8
|
+
* @returns {JSON} Delete response
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.delete_tax_line = async function (document_id, tax_line_id) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/tax-lines/${tax_line_id}/`;
|
|
12
|
+
return this._request("DELETE", endpoint_name, {});
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a document tax line. https://docs.veryfi.com/api/returns-document-tax-line/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} tax_line_id ID of the tax line
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Tax line
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_tax_line = async function (document_id, tax_line_id, {...kwargs} = {}) {
|
|
12
|
+
let endpoint_name = `/documents/${document_id}/tax-lines/${tax_line_id}/`;
|
|
13
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get document tax lines. https://docs.veryfi.com/api/returns-a-list-of-document-tax-lines/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} Tax lines
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_tax_lines = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/documents/${document_id}/tax-lines/`;
|
|
12
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Client = require('../../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Update a tax line. https://docs.veryfi.com/api/update-a-tax-line/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document
|
|
7
|
+
* @param {string} tax_line_id ID of the tax line
|
|
8
|
+
* @param {Object} kwargs Fields to update
|
|
9
|
+
* @returns {JSON} Updated tax line
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.update_tax_line = async function (document_id, tax_line_id, {...kwargs} = {}) {
|
|
12
|
+
let endpoint_name = `/documents/${document_id}/tax-lines/${tax_line_id}/`;
|
|
13
|
+
let response = await this._request("PUT", endpoint_name, kwargs);
|
|
14
|
+
return response['data'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Add devices to blocklist. https://docs.veryfi.com/api/add-devices-to-blocklist/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string[]} device_ids Device IDs to block
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.add_devices_to_blocklist = async function (
|
|
11
|
+
device_ids,
|
|
12
|
+
{...kwargs} = {}
|
|
13
|
+
) {
|
|
14
|
+
let endpoint_name = "/fraud/blocklist/";
|
|
15
|
+
let request_arguments = Object.assign({
|
|
16
|
+
"device_ids": device_ids,
|
|
17
|
+
}, kwargs);
|
|
18
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
19
|
+
return response['data'];
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get devices from blocklist. https://docs.veryfi.com/api/get-devices-from-blocklist/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {Object} kwargs Additional request parameters
|
|
7
|
+
* @returns {JSON} API response data
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.get_fraud_blocklist = async function (
|
|
10
|
+
{...kwargs} = {}
|
|
11
|
+
) {
|
|
12
|
+
let endpoint_name = "/fraud/blocklist/";
|
|
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,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Remove a device from blocklist. https://docs.veryfi.com/api/remove-a-device-from-blocklist/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} device_id ID of the resource
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.remove_device_from_blocklist = async function (device_id) {
|
|
10
|
+
let endpoint_name = `/fraud/blocklist/${device_id}/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {});
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a Markdown Document. https://docs.veryfi.com/api/parse/delete-a-markdown-document/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the resource
|
|
7
|
+
* @returns {JSON} Delete response
|
|
8
|
+
*/
|
|
9
|
+
Client.prototype.delete_markdown_document = async function (document_id) {
|
|
10
|
+
let endpoint_name = `/parse/${document_id}/`;
|
|
11
|
+
return this._request("DELETE", endpoint_name, {});
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a Markdown Document. https://docs.veryfi.com/api/parse/get-a-markdown-document/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the resource
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_markdown_document = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/parse/${document_id}/`;
|
|
12
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a Markdown Document Set. https://docs.veryfi.com/api/parse/get-a-markdown-document-set/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the resource
|
|
7
|
+
* @param {Object} kwargs Additional request parameters
|
|
8
|
+
* @returns {JSON} API response data
|
|
9
|
+
*/
|
|
10
|
+
Client.prototype.get_markdown_document_set = async function (document_id, {...kwargs} = {}) {
|
|
11
|
+
let endpoint_name = `/parse-set/${document_id}/`;
|
|
12
|
+
let response = await this._request("GET", endpoint_name, {}, kwargs, false);
|
|
13
|
+
return response['data'];
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get Markdown Document Sets. https://docs.veryfi.com/api/parse/get-markdown-document-sets/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {number} page Page number
|
|
7
|
+
* @param {number} page_size Results per page
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_markdown_document_sets = async function (
|
|
12
|
+
page = 1,
|
|
13
|
+
page_size = 50,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse-set/";
|
|
17
|
+
let query = Object.assign({
|
|
18
|
+
"page": page,
|
|
19
|
+
"page_size": page_size,
|
|
20
|
+
}, kwargs);
|
|
21
|
+
let response = await this._request("GET", endpoint_name, {}, query, false);
|
|
22
|
+
return response['data'];
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get Markdown Documents. https://docs.veryfi.com/api/parse/get-markdown-documents/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {number} page Page number
|
|
7
|
+
* @param {number} page_size Results per page
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_markdown_documents = async function (
|
|
12
|
+
page = 1,
|
|
13
|
+
page_size = 50,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/";
|
|
17
|
+
let query = Object.assign({
|
|
18
|
+
"page": page,
|
|
19
|
+
"page_size": page_size,
|
|
20
|
+
}, kwargs);
|
|
21
|
+
let response = await this._request("GET", endpoint_name, {}, query, false);
|
|
22
|
+
return response['data'];
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Convert a document to markdown. https://docs.veryfi.com/api/parse/convert-a-document-to-markdown/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_markdown_document('file/path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} API response data
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_markdown_document = async function (
|
|
15
|
+
file_path,
|
|
16
|
+
{...kwargs} = {}
|
|
17
|
+
) {
|
|
18
|
+
let file = fs.createReadStream(file_path);
|
|
19
|
+
let file_name = path.basename(file_path);
|
|
20
|
+
return this.process_markdown_document_from_stream(
|
|
21
|
+
file,
|
|
22
|
+
file_name,
|
|
23
|
+
kwargs
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process a markdown document asynchronously. https://docs.veryfi.com/api/parse/process-a-markdown-document-asynchronously/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_markdown_document_async('file/path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} API response data
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_markdown_document_async = async function (
|
|
15
|
+
file_path,
|
|
16
|
+
{...kwargs} = {}
|
|
17
|
+
) {
|
|
18
|
+
let file = fs.createReadStream(file_path);
|
|
19
|
+
let file_name = path.basename(file_path);
|
|
20
|
+
return this.process_markdown_document_async_from_stream(
|
|
21
|
+
file,
|
|
22
|
+
file_name,
|
|
23
|
+
kwargs
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process a markdown document asynchronously from a base64 string. https://docs.veryfi.com/api/parse/process-a-markdown-document-asynchronously/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string Base64-encoded file contents (raw or data URI)
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_async_from_base64 = async function (
|
|
12
|
+
file_name,
|
|
13
|
+
file_base64_string,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/async/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file_name": file_name,
|
|
19
|
+
"file_data": file_base64_string,
|
|
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
|
+
* Process a markdown document asynchronously from a file stream. https://docs.veryfi.com/api/parse/process-a-markdown-document-asynchronously/
|
|
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_async_from_stream = async function (
|
|
12
|
+
file,
|
|
13
|
+
file_name,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/async/";
|
|
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 asynchronously from a URL. https://docs.veryfi.com/api/parse/process-a-markdown-document-asynchronously/
|
|
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_async_from_url = async function (
|
|
12
|
+
file_url = null,
|
|
13
|
+
file_urls = null,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/async/";
|
|
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 base64 string. https://docs.veryfi.com/api/parse/convert-a-document-to-markdown/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string Base64-encoded file contents (raw or data URI)
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_from_base64 = async function (
|
|
12
|
+
file_name,
|
|
13
|
+
file_base64_string,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file_name": file_name,
|
|
19
|
+
"file_data": file_base64_string,
|
|
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,25 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process a markdown document set. https://docs.veryfi.com/api/parse/process-a-markdown-document-set/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_markdown_document_set('file/path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} API response data
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_markdown_document_set = async function (
|
|
15
|
+
file_path,
|
|
16
|
+
{...kwargs} = {}
|
|
17
|
+
) {
|
|
18
|
+
let file = fs.createReadStream(file_path);
|
|
19
|
+
let file_name = path.basename(file_path);
|
|
20
|
+
return this.process_markdown_document_set_from_stream(
|
|
21
|
+
file,
|
|
22
|
+
file_name,
|
|
23
|
+
kwargs
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process a markdown document set from a base64 string. https://docs.veryfi.com/api/parse/process-a-markdown-document-set/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string Base64-encoded file contents (raw or data URI)
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} API response data
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_markdown_document_set_from_base64 = async function (
|
|
12
|
+
file_name,
|
|
13
|
+
file_base64_string,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
let endpoint_name = "/parse-set/";
|
|
17
|
+
let request_arguments = {
|
|
18
|
+
"file_name": file_name,
|
|
19
|
+
"file_data": file_base64_string,
|
|
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
|
+
* 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
|
+
}
|