@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.
Files changed (178) hide show
  1. package/README.md +19 -2
  2. package/lib/anydocs/deleteAnyDocumentTag.js +14 -0
  3. package/lib/anydocs/getAnyDocument.js +3 -3
  4. package/lib/anydocs/getAnyDocumentTags.js +15 -0
  5. package/lib/anydocs/getAnyDocuments.js +3 -3
  6. package/lib/anydocs/getBlueprints.js +17 -0
  7. package/lib/anydocs/processAnyDocumentAsync.js +31 -0
  8. package/lib/anydocs/processAnyDocumentAsyncBase64.js +30 -0
  9. package/lib/anydocs/processAnyDocumentAsyncStream.js +30 -0
  10. package/lib/anydocs/processAnyDocumentAsyncUrl.js +30 -0
  11. package/lib/anydocs/tags/addAnyDocumentTag.js +15 -0
  12. package/lib/anydocs/tags/addAnyDocumentTags.js +15 -0
  13. package/lib/anydocs/tags/deleteAnyDocumentTags.js +12 -0
  14. package/lib/anydocs/updateAnyDocument.js +14 -0
  15. package/lib/bankstatements/getBankStatement.js +3 -3
  16. package/lib/bankstatements/getBankStatementSet.js +14 -0
  17. package/lib/bankstatements/getBankStatementSets.js +23 -0
  18. package/lib/bankstatements/getBankStatements.js +3 -3
  19. package/lib/bankstatements/processBankStatementAsync.js +31 -0
  20. package/lib/bankstatements/processBankStatementAsyncBase64.js +30 -0
  21. package/lib/bankstatements/processBankStatementAsyncStream.js +30 -0
  22. package/lib/bankstatements/processBankStatementAsyncUrl.js +30 -0
  23. package/lib/bankstatements/splitBankStatements.js +25 -0
  24. package/lib/bankstatements/splitBankStatementsBase64.js +24 -0
  25. package/lib/bankstatements/splitBankStatementsStream.js +24 -0
  26. package/lib/bankstatements/splitBankStatementsUrl.js +24 -0
  27. package/lib/bankstatements/tags/addBankStatementTag.js +15 -0
  28. package/lib/bankstatements/tags/addBankStatementTags.js +15 -0
  29. package/lib/bankstatements/tags/deleteBankStatementTag.js +13 -0
  30. package/lib/bankstatements/tags/deleteBankStatementTags.js +12 -0
  31. package/lib/bankstatements/tags/getBankStatementTags.js +14 -0
  32. package/lib/bankstatements/updateBankStatement.js +14 -0
  33. package/lib/businesscards/getBusinessCard.js +3 -3
  34. package/lib/businesscards/getBusinessCards.js +3 -3
  35. package/lib/businesscards/tags/addBusinessCardTag.js +15 -0
  36. package/lib/businesscards/tags/addBusinessCardTags.js +15 -0
  37. package/lib/businesscards/tags/deleteBusinessCardTag.js +13 -0
  38. package/lib/businesscards/tags/deleteBusinessCardTags.js +12 -0
  39. package/lib/businesscards/tags/getBusinessCardTags.js +14 -0
  40. package/lib/businesscards/updateBusinessCard.js +14 -0
  41. package/lib/checks/getCheck.js +3 -3
  42. package/lib/checks/getChecks.js +3 -3
  43. package/lib/checks/processCheckAsync.js +31 -0
  44. package/lib/checks/processCheckAsyncBase64.js +30 -0
  45. package/lib/checks/processCheckAsyncStream.js +30 -0
  46. package/lib/checks/processCheckAsyncUrl.js +30 -0
  47. package/lib/checks/processCheckWithRemittance.js +31 -0
  48. package/lib/checks/processCheckWithRemittanceBase64.js +30 -0
  49. package/lib/checks/processCheckWithRemittanceStream.js +30 -0
  50. package/lib/checks/processCheckWithRemittanceUrl.js +30 -0
  51. package/lib/checks/tags/addCheckTag.js +15 -0
  52. package/lib/checks/tags/addCheckTags.js +15 -0
  53. package/lib/checks/tags/deleteCheckTag.js +13 -0
  54. package/lib/checks/tags/deleteCheckTags.js +12 -0
  55. package/lib/checks/tags/getCheckTags.js +14 -0
  56. package/lib/checks/updateCheck.js +14 -0
  57. package/lib/classify/classifyDocument.js +25 -0
  58. package/lib/classify/classifyDocumentBase64.js +3 -3
  59. package/lib/classify/classifyDocumentStream.js +24 -0
  60. package/lib/classify/classifyDocumentUrl.js +4 -4
  61. package/lib/classify/extractDocument.js +28 -0
  62. package/lib/classify/extractDocumentBase64.js +27 -0
  63. package/lib/classify/extractDocumentStream.js +27 -0
  64. package/lib/classify/extractDocumentUrl.js +27 -0
  65. package/lib/client/client.js +152 -4
  66. package/lib/client/getHeaders.js +1 -1
  67. package/lib/client/request.js +7 -2
  68. package/lib/contracts/deleteContract.js +12 -0
  69. package/lib/contracts/getContract.js +18 -0
  70. package/lib/contracts/getContracts.js +23 -0
  71. package/lib/contracts/processContract.js +25 -0
  72. package/lib/contracts/processContractBase64.js +24 -0
  73. package/lib/contracts/processContractStream.js +24 -0
  74. package/lib/contracts/processContractUrl.js +24 -0
  75. package/lib/contracts/tags/addContractTag.js +15 -0
  76. package/lib/contracts/tags/addContractTags.js +15 -0
  77. package/lib/contracts/tags/deleteContractTag.js +13 -0
  78. package/lib/contracts/tags/deleteContractTags.js +12 -0
  79. package/lib/contracts/tags/getContractTags.js +14 -0
  80. package/lib/contracts/updateContract.js +14 -0
  81. package/lib/documents/getDocument.js +1 -2
  82. package/lib/documents/getDocuments.js +5 -5
  83. package/lib/documents/lineitems/createLineItem.js +14 -0
  84. package/lib/documents/lineitems/deleteDocumentLineItems.js +12 -0
  85. package/lib/documents/lineitems/deleteLineItem.js +13 -0
  86. package/lib/documents/lineitems/getDocumentLineItems.js +14 -0
  87. package/lib/documents/lineitems/getLineItem.js +15 -0
  88. package/lib/documents/lineitems/updateLineItem.js +15 -0
  89. package/lib/documents/processDocument.js +3 -0
  90. package/lib/documents/processDocumentStream.js +1 -1
  91. package/lib/documents/processDocumentUrl.js +1 -1
  92. package/lib/documents/processDocumentsBulk.js +15 -0
  93. package/lib/documents/tags/deleteTag.js +13 -0
  94. package/lib/documents/tags/getDocumentTags.js +14 -0
  95. package/lib/documents/taxlines/createTaxLine.js +14 -0
  96. package/lib/documents/taxlines/deleteTaxLine.js +13 -0
  97. package/lib/documents/taxlines/getTaxLine.js +15 -0
  98. package/lib/documents/taxlines/getTaxLines.js +14 -0
  99. package/lib/documents/taxlines/updateTaxLine.js +15 -0
  100. package/lib/fraud/addDevicesToBlocklist.js +20 -0
  101. package/lib/fraud/getFraudBlocklist.js +17 -0
  102. package/lib/fraud/removeDeviceFromBlocklist.js +12 -0
  103. package/lib/parse/deleteMarkdownDocument.js +12 -0
  104. package/lib/parse/getMarkdownDocument.js +14 -0
  105. package/lib/parse/getMarkdownDocumentSet.js +14 -0
  106. package/lib/parse/getMarkdownDocumentSets.js +23 -0
  107. package/lib/parse/getMarkdownDocuments.js +23 -0
  108. package/lib/parse/processMarkdownDocument.js +25 -0
  109. package/lib/parse/processMarkdownDocumentAsync.js +25 -0
  110. package/lib/parse/processMarkdownDocumentAsyncBase64.js +24 -0
  111. package/lib/parse/processMarkdownDocumentAsyncStream.js +24 -0
  112. package/lib/parse/processMarkdownDocumentAsyncUrl.js +24 -0
  113. package/lib/parse/processMarkdownDocumentBase64.js +24 -0
  114. package/lib/parse/processMarkdownDocumentSet.js +25 -0
  115. package/lib/parse/processMarkdownDocumentSetBase64.js +24 -0
  116. package/lib/parse/processMarkdownDocumentSetStream.js +24 -0
  117. package/lib/parse/processMarkdownDocumentSetUrl.js +24 -0
  118. package/lib/parse/processMarkdownDocumentStream.js +24 -0
  119. package/lib/parse/processMarkdownDocumentUrl.js +24 -0
  120. package/lib/parse/updateMarkdownDocument.js +14 -0
  121. package/lib/platform/getOcrCounts.js +20 -0
  122. package/lib/platform/getOpenApiSchema.js +17 -0
  123. package/lib/platform/getReleaseNotifications.js +13 -0
  124. package/lib/settings/addWebhook.js +20 -0
  125. package/lib/settings/confirmWebhook.js +23 -0
  126. package/lib/settings/createApiKey.js +20 -0
  127. package/lib/settings/createClientKeys.js +17 -0
  128. package/lib/settings/deleteClientKey.js +12 -0
  129. package/lib/settings/deleteTlsCertificate.js +12 -0
  130. package/lib/settings/getApiKey.js +17 -0
  131. package/lib/settings/getApiKeyPermissions.js +15 -0
  132. package/lib/settings/getApiKeys.js +15 -0
  133. package/lib/settings/getClientKeys.js +15 -0
  134. package/lib/settings/getTlsCertificates.js +15 -0
  135. package/lib/settings/getWebhooks.js +15 -0
  136. package/lib/settings/processTlsCertificate.js +17 -0
  137. package/lib/settings/resetClientKeys.js +17 -0
  138. package/lib/settings/revokeApiKey.js +12 -0
  139. package/lib/settings/rotateApiKey.js +14 -0
  140. package/lib/settings/updateApiKey.js +19 -0
  141. package/lib/settings/verifyApiKey.js +15 -0
  142. package/lib/split/getSplitDocument.js +2 -3
  143. package/lib/split/getSplitDocuments.js +3 -3
  144. package/lib/split/splitDocument.js +16 -0
  145. package/lib/split/splitDocumentStream.js +19 -0
  146. package/lib/split/splitDocumentUrl.js +1 -1
  147. package/lib/types/Client.ts +547 -1
  148. package/lib/types/VeryfiExtraArgs.ts +4 -5
  149. package/lib/w2s/getW2.js +1 -2
  150. package/lib/w2s/getW2Set.js +14 -0
  151. package/lib/w2s/getW2Sets.js +23 -0
  152. package/lib/w2s/splitW2s.js +25 -0
  153. package/lib/w2s/splitW2sBase64.js +24 -0
  154. package/lib/w2s/splitW2sStream.js +24 -0
  155. package/lib/w2s/splitW2sUrl.js +24 -0
  156. package/lib/w2s/tags/addW2Tag.js +15 -0
  157. package/lib/w2s/tags/addW2Tags.js +15 -0
  158. package/lib/w2s/tags/deleteW2Tag.js +13 -0
  159. package/lib/w2s/tags/deleteW2Tags.js +12 -0
  160. package/lib/w2s/tags/getW2Tags.js +14 -0
  161. package/lib/w2s/updateW2.js +14 -0
  162. package/lib/w8bene/getW8BENE.js +3 -3
  163. package/lib/w8bene/getW8BENEs.js +3 -3
  164. package/lib/w8bene/tags/addW8beneTag.js +15 -0
  165. package/lib/w8bene/tags/addW8beneTags.js +15 -0
  166. package/lib/w8bene/tags/deleteW8beneTag.js +13 -0
  167. package/lib/w8bene/tags/deleteW8beneTags.js +12 -0
  168. package/lib/w8bene/tags/getW8beneTags.js +14 -0
  169. package/lib/w8bene/updateW8BENE.js +14 -0
  170. package/lib/w9s/getW9.js +3 -3
  171. package/lib/w9s/getW9s.js +3 -3
  172. package/lib/w9s/tags/addW9Tag.js +15 -0
  173. package/lib/w9s/tags/addW9Tags.js +15 -0
  174. package/lib/w9s/tags/deleteW9Tag.js +13 -0
  175. package/lib/w9s/tags/deleteW9Tags.js +12 -0
  176. package/lib/w9s/tags/getW9Tags.js +14 -0
  177. package/lib/w9s/updateW9.js +14 -0
  178. package/package.json +14 -11
@@ -0,0 +1,13 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink a tag from a bank statement. https://docs.veryfi.com/api/bank-statements/unlink-a-tag-from-a-bank-statement/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string} tag_id ID of the tag to unlink
8
+ * @returns {JSON} Delete response
9
+ */
10
+ Client.prototype.delete_bank_statement_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/bank-statements/${document_id}/tags/${tag_id}/`;
12
+ return this._request("DELETE", endpoint_name, {});
13
+ }
@@ -0,0 +1,12 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink all tags from a bank statement. https://docs.veryfi.com/api/bank-statements/unlink-all-tags-from-a-bank-statement/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_bank_statement_tags = async function (document_id) {
10
+ let endpoint_name = `/bank-statements/${document_id}/tags/`;
11
+ return this._request("DELETE", endpoint_name, {});
12
+ }
@@ -0,0 +1,14 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Get tags assigned to a bank statement. https://docs.veryfi.com/api/bank-statements/get-bank-statement-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_bank_statement_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/bank-statements/${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
+ * Update a bank statement. https://docs.veryfi.com/api/bank-statements/update-a-bank-statement/
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_bank_statement = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/bank-statements/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
@@ -15,10 +15,10 @@ Client.prototype.get_business_card = async function (
15
15
  {...kwargs} = {}
16
16
  ) {
17
17
  let endpoint_name = `/business-cards/${document_id}/`;
18
- let request_arguments = {
18
+ let query = Object.assign({
19
19
  "bounding_boxes": bounding_boxes,
20
20
  "confidence_details": confidence_details
21
- };
22
- let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
21
+ }, kwargs);
22
+ let document = await this._request("GET", endpoint_name, {}, query, false);
23
23
  return document['data'];
24
24
  }
@@ -17,12 +17,12 @@ Client.prototype.get_business_cards = async function (
17
17
  {...kwargs} = {}
18
18
  ) {
19
19
  let endpoint_name = `/business-cards/`;
20
- let request_arguments = {
20
+ let query = Object.assign({
21
21
  "page": page,
22
22
  "page_size": page_size,
23
23
  "bounding_boxes": bounding_boxes,
24
24
  "confidence_details": confidence_details
25
- };
26
- let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
25
+ }, kwargs);
26
+ let document = await this._request("GET", endpoint_name, {}, query, false);
27
27
  return document['data'];
28
28
  }
@@ -0,0 +1,15 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Add a tag to a business card. https://docs.veryfi.com/api/add-a-tag-to-a-business-card/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string} tag Tag name to add
8
+ * @returns {JSON} Tag response
9
+ */
10
+ Client.prototype.add_business_card_tag = async function (document_id, tag) {
11
+ let endpoint_name = `/business-cards/${document_id}/tags/`;
12
+ let request_arguments = {"name": tag};
13
+ let response = await this._request("PUT", endpoint_name, request_arguments);
14
+ return response['data'];
15
+ }
@@ -0,0 +1,15 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Add tags to a business card. https://docs.veryfi.com/api/add-tags-to-a-business-card/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string[]} tags Tag names to add
8
+ * @returns {JSON} Tags response
9
+ */
10
+ Client.prototype.add_business_card_tags = async function (document_id, tags) {
11
+ let endpoint_name = `/business-cards/${document_id}/tags/`;
12
+ let request_arguments = {"tags": tags};
13
+ let response = await this._request("POST", endpoint_name, request_arguments);
14
+ return response['data'];
15
+ }
@@ -0,0 +1,13 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink a tag from a business card. https://docs.veryfi.com/api/unlink-a-tag-from-a-business-card/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string} tag_id ID of the tag to unlink
8
+ * @returns {JSON} Delete response
9
+ */
10
+ Client.prototype.delete_business_card_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/business-cards/${document_id}/tags/${tag_id}/`;
12
+ return this._request("DELETE", endpoint_name, {});
13
+ }
@@ -0,0 +1,12 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink all tags from a business card. https://docs.veryfi.com/api/unlink-all-tags-from-a-business-card/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_business_card_tags = async function (document_id) {
10
+ let endpoint_name = `/business-cards/${document_id}/tags/`;
11
+ return this._request("DELETE", endpoint_name, {});
12
+ }
@@ -0,0 +1,14 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Get tags assigned to a business card. https://docs.veryfi.com/api/get-business-card-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_business_card_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/business-cards/${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
+ * Update a business card. https://docs.veryfi.com/api/business-cards/update-a-business-card/
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_business_card = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/business-cards/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
@@ -15,10 +15,10 @@ Client.prototype.get_check = async function (
15
15
  {...kwargs} = {}
16
16
  ) {
17
17
  let endpoint_name = `/checks/${document_id}/`;
18
- let request_arguments = {
18
+ let query = Object.assign({
19
19
  "bounding_boxes": bounding_boxes,
20
20
  "confidence_details": confidence_details
21
- };
22
- let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
21
+ }, kwargs);
22
+ let document = await this._request("GET", endpoint_name, {}, query, false);
23
23
  return document['data'];
24
24
  }
@@ -17,12 +17,12 @@ Client.prototype.get_checks = async function (
17
17
  {...kwargs} = {}
18
18
  ) {
19
19
  let endpoint_name = `/checks/`;
20
- let request_arguments = {
20
+ let query = Object.assign({
21
21
  "page": page,
22
22
  "page_size": page_size,
23
23
  "bounding_boxes": bounding_boxes,
24
24
  "confidence_details": confidence_details
25
- };
26
- let document = await this._request("GET", endpoint_name, request_arguments, kwargs, false);
25
+ }, kwargs);
26
+ let document = await this._request("GET", endpoint_name, {}, query, false);
27
27
  return document['data'];
28
28
  }
@@ -0,0 +1,31 @@
1
+ const Client = require('../client/constructor');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ /**
5
+ * Process a check asynchronously. https://docs.veryfi.com/api/checks/process-a-check-asynchronously/
6
+ * @example
7
+ * veryfi_client.process_check_async('file/path')
8
+ *
9
+ * @memberof Client
10
+ * @param {String} file_path Path on disk to a file to submit
11
+ * @param {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
12
+ * @param {boolean} confidence_details Return score and ocr_score fields.
13
+ * @param {Object} kwargs Additional request parameters
14
+ * @returns {JSON} API response data
15
+ */
16
+ Client.prototype.process_check_async = async function (
17
+ file_path,
18
+ bounding_boxes = false,
19
+ confidence_details = false,
20
+ {...kwargs} = {}
21
+ ) {
22
+ let file = fs.createReadStream(file_path);
23
+ let file_name = path.basename(file_path);
24
+ return this.process_check_async_from_stream(
25
+ file,
26
+ file_name,
27
+ bounding_boxes,
28
+ confidence_details,
29
+ kwargs
30
+ );
31
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check asynchronously from a base64 string. https://docs.veryfi.com/api/checks/process-a-check-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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_async_from_base64 = async function (
14
+ file_name,
15
+ file_base64_string,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/checks/async/";
21
+ let request_arguments = {
22
+ "file_name": file_name,
23
+ "file_data": file_base64_string,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, false);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check asynchronously from a file stream. https://docs.veryfi.com/api/checks/process-a-check-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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_async_from_stream = async function (
14
+ file,
15
+ file_name,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/checks/async/";
21
+ let request_arguments = {
22
+ "file": file,
23
+ "file_name": file_name,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, true);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check asynchronously from a URL. https://docs.veryfi.com/api/checks/process-a-check-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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_async_from_url = async function (
14
+ file_url = null,
15
+ file_urls = null,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/checks/async/";
21
+ let request_arguments = {
22
+ "file_url": file_url,
23
+ "file_urls": file_urls,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, false);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,31 @@
1
+ const Client = require('../client/constructor');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ /**
5
+ * Process a check with remittance. https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
6
+ * @example
7
+ * veryfi_client.process_check_with_remittance('file/path')
8
+ *
9
+ * @memberof Client
10
+ * @param {String} file_path Path on disk to a file to submit
11
+ * @param {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
12
+ * @param {boolean} confidence_details Return score and ocr_score fields.
13
+ * @param {Object} kwargs Additional request parameters
14
+ * @returns {JSON} API response data
15
+ */
16
+ Client.prototype.process_check_with_remittance = async function (
17
+ file_path,
18
+ bounding_boxes = false,
19
+ confidence_details = false,
20
+ {...kwargs} = {}
21
+ ) {
22
+ let file = fs.createReadStream(file_path);
23
+ let file_name = path.basename(file_path);
24
+ return this.process_check_with_remittance_from_stream(
25
+ file,
26
+ file_name,
27
+ bounding_boxes,
28
+ confidence_details,
29
+ kwargs
30
+ );
31
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check with remittance from a base64 string. https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_with_remittance_from_base64 = async function (
14
+ file_name,
15
+ file_base64_string,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/check-with-document/";
21
+ let request_arguments = {
22
+ "file_name": file_name,
23
+ "file_data": file_base64_string,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, false);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check with remittance from a file stream. https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_with_remittance_from_stream = async function (
14
+ file,
15
+ file_name,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/check-with-document/";
21
+ let request_arguments = {
22
+ "file": file,
23
+ "file_name": file_name,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, true);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,30 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Process a check with remittance from a URL. https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
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 {boolean} bounding_boxes Return bounding_box and bounding_region for extracted fields.
9
+ * @param {boolean} confidence_details Return score and ocr_score fields.
10
+ * @param {Object} kwargs Additional request parameters
11
+ * @returns {JSON} API response data
12
+ */
13
+ Client.prototype.process_check_with_remittance_from_url = async function (
14
+ file_url = null,
15
+ file_urls = null,
16
+ bounding_boxes = false,
17
+ confidence_details = false,
18
+ {...kwargs} = {}
19
+ ) {
20
+ let endpoint_name = "/check-with-document/";
21
+ let request_arguments = {
22
+ "file_url": file_url,
23
+ "file_urls": file_urls,
24
+ "bounding_boxes": bounding_boxes,
25
+ "confidence_details": confidence_details,
26
+ };
27
+ request_arguments = Object.assign(request_arguments, kwargs);
28
+ let response = await this._request("POST", endpoint_name, request_arguments, null, false);
29
+ return response['data'];
30
+ }
@@ -0,0 +1,15 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Add a tag to a check. https://docs.veryfi.com/api/checks/add-a-tag-to-a-check/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string} tag Tag name to add
8
+ * @returns {JSON} Tag response
9
+ */
10
+ Client.prototype.add_check_tag = async function (document_id, tag) {
11
+ let endpoint_name = `/checks/${document_id}/tags/`;
12
+ let request_arguments = {"name": tag};
13
+ let response = await this._request("PUT", endpoint_name, request_arguments);
14
+ return response['data'];
15
+ }
@@ -0,0 +1,15 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Add tags to a check. https://docs.veryfi.com/api/checks/add-tags-to-a-check/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string[]} tags Tag names to add
8
+ * @returns {JSON} Tags response
9
+ */
10
+ Client.prototype.add_check_tags = async function (document_id, tags) {
11
+ let endpoint_name = `/checks/${document_id}/tags/`;
12
+ let request_arguments = {"tags": tags};
13
+ let response = await this._request("POST", endpoint_name, request_arguments);
14
+ return response['data'];
15
+ }
@@ -0,0 +1,13 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink a tag from a check. https://docs.veryfi.com/api/checks/unlink-a-tag-from-a-check/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @param {string} tag_id ID of the tag to unlink
8
+ * @returns {JSON} Delete response
9
+ */
10
+ Client.prototype.delete_check_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/checks/${document_id}/tags/${tag_id}/`;
12
+ return this._request("DELETE", endpoint_name, {});
13
+ }
@@ -0,0 +1,12 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Unlink all tags from a check. https://docs.veryfi.com/api/checks/unlink-all-tags-from-a-check/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_check_tags = async function (document_id) {
10
+ let endpoint_name = `/checks/${document_id}/tags/`;
11
+ return this._request("DELETE", endpoint_name, {});
12
+ }
@@ -0,0 +1,14 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Get tags assigned to a check. https://docs.veryfi.com/api/checks/get-check-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_check_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/checks/${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
+ * Update a check. https://docs.veryfi.com/api/checks/update-a-check/
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_check = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/checks/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
@@ -0,0 +1,25 @@
1
+ const Client = require('../client/constructor');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ /**
5
+ * Classify a document. https://docs.veryfi.com/api/classify/classify-a-document/
6
+ * @example
7
+ * veryfi_client.classify_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.classify_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.classify_document_from_stream(
21
+ file,
22
+ file_name,
23
+ kwargs
24
+ );
25
+ }
@@ -1,6 +1,6 @@
1
1
  const Client = require('../client/constructor');
2
2
  /**
3
- * Classify a document and extract all the fields from it. https://docs.veryfi.com/api/classify/classify-a-document/
3
+ * Classify a document. https://docs.veryfi.com/api/classify/classify-a-document/
4
4
  * @example
5
5
  * veryfi_client.classify_document_from_base64('base64_encoded_string',
6
6
  * 'receipt.png',
@@ -9,8 +9,8 @@ const Client = require('../client/constructor');
9
9
  * @memberof Client
10
10
  * @param {String} base64_encoded_string Buffer string of a file to submit for classify extraction
11
11
  * @param {String} file_name The file name including the extension
12
- * @param {Object} kwargs Additional request parameters
13
- * @returns {JSON} Data extracted from the document
12
+ * @param {Object} kwargs Additional request parameters (document_types, external_id, package_path, bucket)
13
+ * @returns {JSON} Document classification
14
14
  */
15
15
  Client.prototype.classify_document_from_base64 = async function (
16
16
  base64_encoded_string,
@@ -0,0 +1,24 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Classify a document from a file stream. https://docs.veryfi.com/api/classify/classify-a-document/
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.classify_document_from_stream = async function (
12
+ file,
13
+ file_name,
14
+ {...kwargs} = {}
15
+ ) {
16
+ let endpoint_name = "/classify/";
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
+ }