@veryfi/veryfi-sdk 1.3.2 → 1.4.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 +443 -145
- package/lib/anydocs/deleteAnyDocument.js +12 -0
- package/lib/anydocs/getAnyDocument.js +22 -0
- package/lib/anydocs/getAnyDocuments.js +30 -0
- package/lib/anydocs/processAnyDocument.js +33 -0
- package/lib/anydocs/processAnyDocumentBase64.js +31 -0
- package/lib/anydocs/processAnyDocumentStream.js +33 -0
- package/lib/anydocs/processAnyDocumentUrl.js +30 -0
- package/lib/bankstatements/deleteBankStatement.js +12 -0
- package/lib/bankstatements/getBankStatement.js +24 -0
- package/lib/bankstatements/getBankStatements.js +28 -0
- package/lib/bankstatements/processBankStatement.js +33 -0
- package/lib/bankstatements/processBankStatementBase64.js +31 -0
- package/lib/bankstatements/processBankStatementStream.js +31 -0
- package/lib/bankstatements/processBankStatementUrl.js +30 -0
- package/lib/businesscards/deleteBusinessCard.js +12 -0
- package/lib/businesscards/getBusinessCard.js +24 -0
- package/lib/businesscards/getBusinessCards.js +28 -0
- package/lib/businesscards/processBusinessCard.js +27 -0
- package/lib/businesscards/processBusinessCardBase64.js +25 -0
- package/lib/businesscards/processBusinessCardStream.js +25 -0
- package/lib/businesscards/processBusinessCardUrl.js +24 -0
- package/lib/checks/deleteCheck.js +12 -0
- package/lib/checks/getCheck.js +24 -0
- package/lib/checks/getChecks.js +28 -0
- package/lib/checks/processCheck.js +33 -0
- package/lib/checks/processCheckBase64.js +31 -0
- package/lib/checks/processCheckStream.js +31 -0
- package/lib/checks/processCheckUrl.js +30 -0
- package/lib/client/client.js +63 -0
- package/lib/client/constructor.js +27 -0
- package/lib/client/function.js +6 -0
- package/lib/client/generateSignature.js +26 -0
- package/lib/client/getHeaders.js +21 -0
- package/lib/client/getUrl.js +9 -0
- package/lib/client/request.js +58 -0
- package/lib/documents/deleteDocument.js +12 -0
- package/lib/documents/getDocument.js +14 -0
- package/lib/documents/getDocuments.js +31 -0
- package/lib/documents/processDocument.js +37 -0
- package/lib/documents/processDocumentBase64.js +37 -0
- package/lib/documents/processDocumentStream.js +33 -0
- package/lib/documents/processDocumentUrl.js +41 -0
- package/lib/documents/tags/addTag.js +14 -0
- package/lib/documents/tags/addTags.js +14 -0
- package/lib/documents/tags/deleteTags.js +12 -0
- package/lib/documents/tags/replaceTags.js +14 -0
- package/lib/documents/updateDocument.js +17 -0
- package/lib/types/BillTo.ts +11 -0
- package/lib/types/BoundingElement.ts +6 -0
- package/lib/types/Client.ts +1058 -0
- package/lib/types/LineItem.ts +39 -0
- package/lib/types/Payment.ts +8 -0
- package/lib/types/ShipTo.ts +7 -0
- package/lib/types/Tag.ts +4 -0
- package/lib/types/TaxLine.ts +9 -0
- package/lib/types/Vendor.ts +35 -0
- package/lib/types/VeryfiDocument.ts +151 -0
- package/lib/types/VeryfiExtraArgs.ts +9 -0
- package/lib/w2s/deleteW2.js +12 -0
- package/lib/w2s/getW2.js +17 -0
- package/lib/w2s/getW2s.js +13 -0
- package/lib/w2s/processW2.js +28 -0
- package/lib/w2s/processW2Base64.js +30 -0
- package/lib/w2s/processW2Stream.js +30 -0
- package/lib/w2s/processW2Url.js +32 -0
- package/lib/w8bene/deleteW8BENE.js +12 -0
- package/lib/w8bene/getW8BENE.js +24 -0
- package/lib/w8bene/getW8BENEs.js +28 -0
- package/lib/w8bene/processW8BENE.js +33 -0
- package/lib/w8bene/processW8BENEBase64.js +31 -0
- package/lib/w8bene/processW8BENEStream.js +31 -0
- package/lib/w8bene/processW8BENEUrl.js +30 -0
- package/lib/w9s/deleteW9.js +12 -0
- package/lib/w9s/getW9.js +24 -0
- package/lib/w9s/getW9s.js +28 -0
- package/lib/w9s/processW9.js +30 -0
- package/lib/w9s/processW9Base64.js +31 -0
- package/lib/w9s/processW9Stream.js +31 -0
- package/lib/w9s/processW9Url.js +27 -0
- package/package.json +4 -4
- package/lib/main.js +0 -783
- package/lib/types/main.d.ts +0 -541
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get all any documents. https://docs.veryfi.com/api/anydocs/get-%E2%88%80-docs/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} page The page number. The response is capped to maximum of 50 results per page.
|
|
6
|
+
* @param {number} page_size The number of Documents per page.
|
|
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
|
+
* @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
|
|
10
|
+
* @returns {JSON} Object of previously processed any documents
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.get_any_documents = async function (
|
|
13
|
+
page = 1,
|
|
14
|
+
page_size = 50,
|
|
15
|
+
bounding_boxes = false,
|
|
16
|
+
confidence_details = false,
|
|
17
|
+
{...kwargs} = {}) {
|
|
18
|
+
let endpoint_name = "/any-documents/";
|
|
19
|
+
let request_arguments = {
|
|
20
|
+
"page": page,
|
|
21
|
+
"page_size": page_size,
|
|
22
|
+
"bounding_boxes": bounding_boxes,
|
|
23
|
+
"confidence_details": confidence_details
|
|
24
|
+
};
|
|
25
|
+
let documents = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
26
|
+
if ("data" in documents) {
|
|
27
|
+
documents = documents["data"];
|
|
28
|
+
}
|
|
29
|
+
return documents;
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process any document and extract all the fields from it. https://docs.veryfi.com/api/anydocs/process-%E2%88%80-doc/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_any_document('file/path','blue_print')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit for data extraction
|
|
11
|
+
* @param {String} blueprint_name The name of the extraction blueprints to use.
|
|
12
|
+
* @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
|
|
13
|
+
* @param {Object} kwargs Additional request parameters
|
|
14
|
+
* @returns {JSON} Data extracted from the document
|
|
15
|
+
*/
|
|
16
|
+
Client.prototype.process_any_document = async function (
|
|
17
|
+
file_path,
|
|
18
|
+
blueprint_name,
|
|
19
|
+
max_pages_to_process = 20,
|
|
20
|
+
{...kwargs} = {}
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
let file = fs.createReadStream(file_path);
|
|
24
|
+
let file_name = path.basename(file_path);
|
|
25
|
+
|
|
26
|
+
return this.process_any_document_from_stream(
|
|
27
|
+
file,
|
|
28
|
+
file_name,
|
|
29
|
+
blueprint_name,
|
|
30
|
+
max_pages_to_process,
|
|
31
|
+
kwargs
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process any document and extract all the fields from it. https://docs.veryfi.com/api/anydocs/process-%E2%88%80-doc/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string To submit a file for data extraction, encode the file in Base64 format and ensure it includes the MIME type. The Base64 string should follow this structure: data:${mimeType};base64,${base64String}
|
|
8
|
+
* @param {String} blueprint_name The name of the extraction blueprints to use.
|
|
9
|
+
* @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
|
|
10
|
+
* @param {Object} kwargs Additional request parameters
|
|
11
|
+
* @returns {JSON} Data extracted from the document
|
|
12
|
+
*/
|
|
13
|
+
Client.prototype.process_any_document_from_base64 = async function (
|
|
14
|
+
file_name,
|
|
15
|
+
file_base64_string,
|
|
16
|
+
blueprint_name,
|
|
17
|
+
max_pages_to_process = 20,
|
|
18
|
+
{...kwargs} = {}
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
let endpoint_name = "/any-documents/";
|
|
22
|
+
let request_arguments = {
|
|
23
|
+
"file_name": file_name,
|
|
24
|
+
"file_data": file_base64_string,
|
|
25
|
+
"blueprint_name": blueprint_name,
|
|
26
|
+
"max_pages_to_process": max_pages_to_process,
|
|
27
|
+
};
|
|
28
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
29
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
30
|
+
return document['data'];
|
|
31
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process any document and extract all the fields from it. https://docs.veryfi.com/api/anydocs/process-%E2%88%80-doc/
|
|
4
|
+
* @example
|
|
5
|
+
* veryfi_client.process_any_document('file/path','blue_print')
|
|
6
|
+
*
|
|
7
|
+
* @memberof Client
|
|
8
|
+
* @param {ReadStream} file ReadStream of a file to submit for data extraction
|
|
9
|
+
* @param {String} file_name The file name including the extension
|
|
10
|
+
* @param {String} blueprint_name The name of the extraction blueprints to use.
|
|
11
|
+
* @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
|
|
12
|
+
* @param {Object} kwargs Additional request parameters
|
|
13
|
+
* @returns {JSON} Data extracted from the document
|
|
14
|
+
*/
|
|
15
|
+
Client.prototype.process_any_document_from_stream = async function (
|
|
16
|
+
file,
|
|
17
|
+
file_name,
|
|
18
|
+
blueprint_name,
|
|
19
|
+
max_pages_to_process = 20,
|
|
20
|
+
{...kwargs} = {}
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
let endpoint_name = "/any-documents/";
|
|
24
|
+
let request_arguments = {
|
|
25
|
+
"file_name": file_name,
|
|
26
|
+
"file": file,
|
|
27
|
+
"blueprint_name": blueprint_name,
|
|
28
|
+
"max_pages_to_process": max_pages_to_process,
|
|
29
|
+
};
|
|
30
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
31
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
32
|
+
return document['data'];
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process any document and extract all the fields from it. https://docs.veryfi.com/api/anydocs/process-%E2%88%80-doc/
|
|
4
|
+
* @example
|
|
5
|
+
* veryfi_client.process_any_document_from_url('file_url','blue_print')
|
|
6
|
+
*
|
|
7
|
+
* @memberof Client
|
|
8
|
+
* @param {String} file_url url file to submit for data extraction
|
|
9
|
+
* @param {String} blueprint_name The name of the extraction blueprints to use.
|
|
10
|
+
* @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} Data extracted from the document
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_any_document_from_url = async function (
|
|
15
|
+
file_url,
|
|
16
|
+
blueprint_name,
|
|
17
|
+
max_pages_to_process = 20,
|
|
18
|
+
{...kwargs} = {}
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
let endpoint_name = "/any-documents/";
|
|
22
|
+
let request_arguments = {
|
|
23
|
+
"file_url": file_url,
|
|
24
|
+
"blueprint_name": blueprint_name,
|
|
25
|
+
"max_pages_to_process": max_pages_to_process,
|
|
26
|
+
};
|
|
27
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
28
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
29
|
+
return document['data'];
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a Bank Statement from Veryfi. https://docs.veryfi.com/api/bank-statements/delete-a-bank-statement/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document you'd like to delete
|
|
7
|
+
*/
|
|
8
|
+
Client.prototype.delete_bank_statement = async function (document_id) {
|
|
9
|
+
let endpoint_name = `/bank-statements/${document_id}/`;
|
|
10
|
+
let request_arguments = {"id": document_id};
|
|
11
|
+
return this._request("DELETE", endpoint_name, request_arguments);
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a specific bank statement. https://docs.veryfi.com/api/bank-statements/get-a-bank-statement/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} document_id The unique identifier of the document.
|
|
6
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
7
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Object of a previously processed blueprinted document.
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_bank_statement = async function (
|
|
12
|
+
document_id,
|
|
13
|
+
bounding_boxes = false,
|
|
14
|
+
confidence_details = false,
|
|
15
|
+
{...kwargs} = {}
|
|
16
|
+
) {
|
|
17
|
+
let endpoint_name = `/bank-statements/${document_id}/`;
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"bounding_boxes": bounding_boxes,
|
|
20
|
+
"confidence_details": confidence_details
|
|
21
|
+
};
|
|
22
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
23
|
+
return document['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get all bank statements. https://docs.veryfi.com/api/bank-statements/get-bank-statements/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} page The page number. The response is capped to maximum of 50 results per page.
|
|
6
|
+
* @param {number} page_size The number of Documents per page.
|
|
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
|
+
* @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
|
|
10
|
+
* @returns {JSON} Object of previously processed any documents
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.get_bank_statements = async function (
|
|
13
|
+
page = 1,
|
|
14
|
+
page_size = 50,
|
|
15
|
+
bounding_boxes = false,
|
|
16
|
+
confidence_details = false,
|
|
17
|
+
{...kwargs} = {}
|
|
18
|
+
) {
|
|
19
|
+
let endpoint_name = `/bank-statements/`;
|
|
20
|
+
let request_arguments = {
|
|
21
|
+
"page": page,
|
|
22
|
+
"page_size": page_size,
|
|
23
|
+
"bounding_boxes": bounding_boxes,
|
|
24
|
+
"confidence_details": confidence_details
|
|
25
|
+
};
|
|
26
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
27
|
+
return document['data'];
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_bank_statement('file_path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit for data extraction
|
|
11
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
12
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
13
|
+
* @param {Object} kwargs Additional request parameters
|
|
14
|
+
* @returns {JSON} Data extracted from the document
|
|
15
|
+
*/
|
|
16
|
+
Client.prototype.process_bank_statement = async function (
|
|
17
|
+
file_path,
|
|
18
|
+
bounding_boxes = false,
|
|
19
|
+
confidence_details = false,
|
|
20
|
+
{...kwargs} = {}
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
let file = fs.createReadStream(file_path);
|
|
24
|
+
let file_name = path.basename(file_path);
|
|
25
|
+
|
|
26
|
+
return this.process_bank_statement_from_stream(
|
|
27
|
+
file,
|
|
28
|
+
file_name,
|
|
29
|
+
bounding_boxes,
|
|
30
|
+
confidence_details,
|
|
31
|
+
kwargs
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string To submit a file for data extraction, encode the file in Base64 format and ensure it includes the MIME type. The Base64 string should follow this structure: data:${mimeType};base64,${base64String}
|
|
8
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
9
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
10
|
+
* @param {Object} kwargs Additional request parameters
|
|
11
|
+
* @returns {JSON} Data extracted from the document
|
|
12
|
+
*/
|
|
13
|
+
Client.prototype.process_bank_statement_from_base64 = async function (
|
|
14
|
+
file_name,
|
|
15
|
+
file_base64_string,
|
|
16
|
+
bounding_boxes = false,
|
|
17
|
+
confidence_details = false,
|
|
18
|
+
{...kwargs} = {}
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
let endpoint_name = "/bank-statements/";
|
|
22
|
+
let request_arguments = {
|
|
23
|
+
"file_name": file_name,
|
|
24
|
+
"file_data": file_base64_string,
|
|
25
|
+
"bounding_boxes": bounding_boxes,
|
|
26
|
+
"confidence_details": confidence_details,
|
|
27
|
+
};
|
|
28
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
29
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
30
|
+
return document['data'];
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {fs.ReadStream} file file to submit for data extraction
|
|
7
|
+
* @param {String} file_name The file name including the extension
|
|
8
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
9
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
10
|
+
* @param {Object} kwargs Additional request parameters
|
|
11
|
+
* @returns {JSON} Data extracted from the document
|
|
12
|
+
*/
|
|
13
|
+
Client.prototype.process_bank_statement_from_stream = async function (
|
|
14
|
+
file,
|
|
15
|
+
file_name,
|
|
16
|
+
bounding_boxes = false,
|
|
17
|
+
confidence_details = false,
|
|
18
|
+
{...kwargs} = {}
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
let endpoint_name = "/bank-statements/";
|
|
22
|
+
let request_arguments = {
|
|
23
|
+
"file": file,
|
|
24
|
+
"file_name": file_name,
|
|
25
|
+
"bounding_boxes": bounding_boxes,
|
|
26
|
+
"confidence_details": confidence_details,
|
|
27
|
+
};
|
|
28
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
29
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
30
|
+
return document['data'];
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
|
|
4
|
+
* @example
|
|
5
|
+
* veryfi_client.process_bank_statement_from_url('file_url')
|
|
6
|
+
*
|
|
7
|
+
* @memberof Client
|
|
8
|
+
* @param {String} file_url url file to submit for data extraction
|
|
9
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
10
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} Data extracted from the document
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_bank_statement_from_url = async function (
|
|
15
|
+
file_url,
|
|
16
|
+
bounding_boxes = false,
|
|
17
|
+
confidence_details = false,
|
|
18
|
+
{...kwargs} = {}
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
let endpoint_name = "/bank-statements/";
|
|
22
|
+
let request_arguments = {
|
|
23
|
+
"file_url": file_url,
|
|
24
|
+
"bounding_boxes": bounding_boxes,
|
|
25
|
+
"confidence_details": confidence_details,
|
|
26
|
+
};
|
|
27
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
28
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
29
|
+
return document['data'];
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a Business Card from Veryfi. https://docs.veryfi.com/api/business-cards/delete-a-business-card/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document you'd like to delete
|
|
7
|
+
*/
|
|
8
|
+
Client.prototype.delete_business_card = async function (document_id) {
|
|
9
|
+
let endpoint_name = `/business-cards/${document_id}/`;
|
|
10
|
+
let request_arguments = {"id": document_id};
|
|
11
|
+
return this._request("DELETE", endpoint_name, request_arguments);
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a specific Business card. https://docs.veryfi.com/api/business-cards/get-a-business-card/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} document_id The unique identifier of the document.
|
|
6
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
7
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Object of a previously processed blueprinted document.
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_business_card = async function (
|
|
12
|
+
document_id,
|
|
13
|
+
bounding_boxes = false,
|
|
14
|
+
confidence_details = false,
|
|
15
|
+
{...kwargs} = {}
|
|
16
|
+
) {
|
|
17
|
+
let endpoint_name = `/business-cards/${document_id}/`;
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"bounding_boxes": bounding_boxes,
|
|
20
|
+
"confidence_details": confidence_details
|
|
21
|
+
};
|
|
22
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
23
|
+
return document['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get all Business cards. https://docs.veryfi.com/api/business-cards/get-business-cards/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} page The page number. The response is capped to maximum of 50 results per page.
|
|
6
|
+
* @param {number} page_size The number of Documents per page.
|
|
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
|
+
* @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
|
|
10
|
+
* @returns {JSON} Object of previously processed any documents
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.get_business_cards = async function (
|
|
13
|
+
page = 1,
|
|
14
|
+
page_size = 50,
|
|
15
|
+
bounding_boxes = false,
|
|
16
|
+
confidence_details = false,
|
|
17
|
+
{...kwargs} = {}
|
|
18
|
+
) {
|
|
19
|
+
let endpoint_name = `/business-cards/`;
|
|
20
|
+
let request_arguments = {
|
|
21
|
+
"page": page,
|
|
22
|
+
"page_size": page_size,
|
|
23
|
+
"bounding_boxes": bounding_boxes,
|
|
24
|
+
"confidence_details": confidence_details
|
|
25
|
+
};
|
|
26
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
27
|
+
return document['data'];
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process Business card and extract all the fields from it. https://docs.veryfi.com/api/business-cards/process-a-business-card/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_business_card('file_path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit for data extraction
|
|
11
|
+
* @param {Object} kwargs Additional request parameters
|
|
12
|
+
* @returns {JSON} Data extracted from the document
|
|
13
|
+
*/
|
|
14
|
+
Client.prototype.process_business_card = async function (
|
|
15
|
+
file_path,
|
|
16
|
+
{...kwargs} = {}
|
|
17
|
+
) {
|
|
18
|
+
|
|
19
|
+
let file = fs.createReadStream(file_path);
|
|
20
|
+
let file_name = path.basename(file_path);
|
|
21
|
+
|
|
22
|
+
return this.process_business_card_from_stream(
|
|
23
|
+
file,
|
|
24
|
+
file_name,
|
|
25
|
+
kwargs
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process Business card and extract all the fields from it. https://docs.veryfi.com/api/business-cards/process-a-business-card/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {String} file_name The file name including the extension
|
|
7
|
+
* @param {String} file_base64_string To submit a file for data extraction, encode the file in Base64 format and ensure it includes the MIME type. The Base64 string should follow this structure: data:${mimeType};base64,${base64String}
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Data extracted from the document
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_business_card_from_base64 = async function (
|
|
12
|
+
file_name,
|
|
13
|
+
file_base64_string,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
|
|
17
|
+
let endpoint_name = "/business-cards/";
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"file_name": file_name,
|
|
20
|
+
"file_data": file_base64_string,
|
|
21
|
+
};
|
|
22
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
23
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
24
|
+
return document['data'];
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process Business card and extract all the fields from it. https://docs.veryfi.com/api/business-cards/process-a-business-card/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {fs.ReadStream} file file to submit for data extraction
|
|
7
|
+
* @param {String} file_name The file name including the extension
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Data extracted from the document
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.process_business_card_from_stream = async function (
|
|
12
|
+
file,
|
|
13
|
+
file_name,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
|
|
17
|
+
let endpoint_name = "/business-cards/";
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"file": file,
|
|
20
|
+
"file_name": file_name,
|
|
21
|
+
};
|
|
22
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
23
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, true);
|
|
24
|
+
return document['data'];
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Process Check and extract all the fields from it. https://docs.veryfi.com/api/checks/process-a-check/
|
|
4
|
+
* @example
|
|
5
|
+
* veryfi_client.process_business_card_from_url('file_url')
|
|
6
|
+
*
|
|
7
|
+
* @memberof Client
|
|
8
|
+
* @param {String} file_url url file to submit for data extraction
|
|
9
|
+
* @param {Object} kwargs Additional request parameters
|
|
10
|
+
* @returns {JSON} Data extracted from the document
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.process_business_card_from_url = async function (
|
|
13
|
+
file_url,
|
|
14
|
+
{...kwargs} = {}
|
|
15
|
+
) {
|
|
16
|
+
|
|
17
|
+
let endpoint_name = "/business-cards/";
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"file_url": file_url,
|
|
20
|
+
};
|
|
21
|
+
request_arguments = Object.assign(request_arguments, kwargs);
|
|
22
|
+
let document = await this._request("POST", endpoint_name, request_arguments, null, false);
|
|
23
|
+
return document['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Delete a Check from Veryfi. https://docs.veryfi.com/api/checks/delete-a-check/
|
|
4
|
+
*
|
|
5
|
+
* @memberof Client
|
|
6
|
+
* @param {string} document_id ID of the document you'd like to delete
|
|
7
|
+
*/
|
|
8
|
+
Client.prototype.delete_check = async function (document_id) {
|
|
9
|
+
let endpoint_name = `/checks/${document_id}/`;
|
|
10
|
+
let request_arguments = {"id": document_id};
|
|
11
|
+
return this._request("DELETE", endpoint_name, request_arguments);
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get a specific check. https://docs.veryfi.com/api/checks/get-a-check/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} document_id The unique identifier of the document.
|
|
6
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
7
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
8
|
+
* @param {Object} kwargs Additional request parameters
|
|
9
|
+
* @returns {JSON} Object of a previously processed blueprinted document.
|
|
10
|
+
*/
|
|
11
|
+
Client.prototype.get_check = async function (
|
|
12
|
+
document_id,
|
|
13
|
+
bounding_boxes = false,
|
|
14
|
+
confidence_details = false,
|
|
15
|
+
{...kwargs} = {}
|
|
16
|
+
) {
|
|
17
|
+
let endpoint_name = `/checks/${document_id}/`;
|
|
18
|
+
let request_arguments = {
|
|
19
|
+
"bounding_boxes": bounding_boxes,
|
|
20
|
+
"confidence_details": confidence_details
|
|
21
|
+
};
|
|
22
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
23
|
+
return document['data'];
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
/**
|
|
3
|
+
* Get all checks. https://docs.veryfi.com/api/checks/get-checks/
|
|
4
|
+
* @memberof Client
|
|
5
|
+
* @param {number} page The page number. The response is capped to maximum of 50 results per page.
|
|
6
|
+
* @param {number} page_size The number of Documents per page.
|
|
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
|
+
* @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
|
|
10
|
+
* @returns {JSON} Object of previously processed any documents
|
|
11
|
+
*/
|
|
12
|
+
Client.prototype.get_checks = async function (
|
|
13
|
+
page = 1,
|
|
14
|
+
page_size = 50,
|
|
15
|
+
bounding_boxes = false,
|
|
16
|
+
confidence_details = false,
|
|
17
|
+
{...kwargs} = {}
|
|
18
|
+
) {
|
|
19
|
+
let endpoint_name = `/checks/`;
|
|
20
|
+
let request_arguments = {
|
|
21
|
+
"page": page,
|
|
22
|
+
"page_size": page_size,
|
|
23
|
+
"bounding_boxes": bounding_boxes,
|
|
24
|
+
"confidence_details": confidence_details
|
|
25
|
+
};
|
|
26
|
+
let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
|
|
27
|
+
return document['data'];
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const Client = require('../client/constructor');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
/**
|
|
5
|
+
* Process Check and extract all the fields from it.https://docs.veryfi.com/api/checks/process-a-check/
|
|
6
|
+
* @example
|
|
7
|
+
* veryfi_client.process_check('file_path')
|
|
8
|
+
*
|
|
9
|
+
* @memberof Client
|
|
10
|
+
* @param {String} file_path Path on disk to a file to submit for data extraction
|
|
11
|
+
* @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
|
|
12
|
+
* @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
|
|
13
|
+
* @param {Object} kwargs Additional request parameters
|
|
14
|
+
* @returns {JSON} Data extracted from the document
|
|
15
|
+
*/
|
|
16
|
+
Client.prototype.process_check = async function (
|
|
17
|
+
file_path,
|
|
18
|
+
bounding_boxes = false,
|
|
19
|
+
confidence_details = false,
|
|
20
|
+
{...kwargs} = {}
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
let file = fs.createReadStream(file_path);
|
|
24
|
+
let file_name = path.basename(file_path);
|
|
25
|
+
|
|
26
|
+
return this.process_check_from_stream(
|
|
27
|
+
file,
|
|
28
|
+
file_name,
|
|
29
|
+
bounding_boxes,
|
|
30
|
+
confidence_details,
|
|
31
|
+
kwargs
|
|
32
|
+
);
|
|
33
|
+
}
|