@veryfi/veryfi-sdk 1.4.8 → 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 (176) 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 +151 -4
  66. package/lib/client/request.js +7 -2
  67. package/lib/contracts/deleteContract.js +12 -0
  68. package/lib/contracts/getContract.js +18 -0
  69. package/lib/contracts/getContracts.js +23 -0
  70. package/lib/contracts/processContract.js +25 -0
  71. package/lib/contracts/processContractBase64.js +24 -0
  72. package/lib/contracts/processContractStream.js +24 -0
  73. package/lib/contracts/processContractUrl.js +24 -0
  74. package/lib/contracts/tags/addContractTag.js +15 -0
  75. package/lib/contracts/tags/addContractTags.js +15 -0
  76. package/lib/contracts/tags/deleteContractTag.js +13 -0
  77. package/lib/contracts/tags/deleteContractTags.js +12 -0
  78. package/lib/contracts/tags/getContractTags.js +14 -0
  79. package/lib/contracts/updateContract.js +14 -0
  80. package/lib/documents/getDocument.js +1 -2
  81. package/lib/documents/getDocuments.js +5 -5
  82. package/lib/documents/lineitems/createLineItem.js +14 -0
  83. package/lib/documents/lineitems/deleteDocumentLineItems.js +12 -0
  84. package/lib/documents/lineitems/deleteLineItem.js +13 -0
  85. package/lib/documents/lineitems/getDocumentLineItems.js +14 -0
  86. package/lib/documents/lineitems/getLineItem.js +15 -0
  87. package/lib/documents/lineitems/updateLineItem.js +15 -0
  88. package/lib/documents/processDocument.js +3 -0
  89. package/lib/documents/processDocumentStream.js +1 -1
  90. package/lib/documents/processDocumentUrl.js +1 -1
  91. package/lib/documents/processDocumentsBulk.js +15 -0
  92. package/lib/documents/tags/getDocumentTags.js +14 -0
  93. package/lib/documents/taxlines/createTaxLine.js +14 -0
  94. package/lib/documents/taxlines/deleteTaxLine.js +13 -0
  95. package/lib/documents/taxlines/getTaxLine.js +15 -0
  96. package/lib/documents/taxlines/getTaxLines.js +14 -0
  97. package/lib/documents/taxlines/updateTaxLine.js +15 -0
  98. package/lib/fraud/addDevicesToBlocklist.js +20 -0
  99. package/lib/fraud/getFraudBlocklist.js +17 -0
  100. package/lib/fraud/removeDeviceFromBlocklist.js +12 -0
  101. package/lib/parse/deleteMarkdownDocument.js +12 -0
  102. package/lib/parse/getMarkdownDocument.js +14 -0
  103. package/lib/parse/getMarkdownDocumentSet.js +14 -0
  104. package/lib/parse/getMarkdownDocumentSets.js +23 -0
  105. package/lib/parse/getMarkdownDocuments.js +23 -0
  106. package/lib/parse/processMarkdownDocument.js +25 -0
  107. package/lib/parse/processMarkdownDocumentAsync.js +25 -0
  108. package/lib/parse/processMarkdownDocumentAsyncBase64.js +24 -0
  109. package/lib/parse/processMarkdownDocumentAsyncStream.js +24 -0
  110. package/lib/parse/processMarkdownDocumentAsyncUrl.js +24 -0
  111. package/lib/parse/processMarkdownDocumentBase64.js +24 -0
  112. package/lib/parse/processMarkdownDocumentSet.js +25 -0
  113. package/lib/parse/processMarkdownDocumentSetBase64.js +24 -0
  114. package/lib/parse/processMarkdownDocumentSetStream.js +24 -0
  115. package/lib/parse/processMarkdownDocumentSetUrl.js +24 -0
  116. package/lib/parse/processMarkdownDocumentStream.js +24 -0
  117. package/lib/parse/processMarkdownDocumentUrl.js +24 -0
  118. package/lib/parse/updateMarkdownDocument.js +14 -0
  119. package/lib/platform/getOcrCounts.js +20 -0
  120. package/lib/platform/getOpenApiSchema.js +17 -0
  121. package/lib/platform/getReleaseNotifications.js +13 -0
  122. package/lib/settings/addWebhook.js +20 -0
  123. package/lib/settings/confirmWebhook.js +23 -0
  124. package/lib/settings/createApiKey.js +20 -0
  125. package/lib/settings/createClientKeys.js +17 -0
  126. package/lib/settings/deleteClientKey.js +12 -0
  127. package/lib/settings/deleteTlsCertificate.js +12 -0
  128. package/lib/settings/getApiKey.js +17 -0
  129. package/lib/settings/getApiKeyPermissions.js +15 -0
  130. package/lib/settings/getApiKeys.js +15 -0
  131. package/lib/settings/getClientKeys.js +15 -0
  132. package/lib/settings/getTlsCertificates.js +15 -0
  133. package/lib/settings/getWebhooks.js +15 -0
  134. package/lib/settings/processTlsCertificate.js +17 -0
  135. package/lib/settings/resetClientKeys.js +17 -0
  136. package/lib/settings/revokeApiKey.js +12 -0
  137. package/lib/settings/rotateApiKey.js +14 -0
  138. package/lib/settings/updateApiKey.js +19 -0
  139. package/lib/settings/verifyApiKey.js +15 -0
  140. package/lib/split/getSplitDocument.js +2 -3
  141. package/lib/split/getSplitDocuments.js +3 -3
  142. package/lib/split/splitDocument.js +16 -0
  143. package/lib/split/splitDocumentStream.js +19 -0
  144. package/lib/split/splitDocumentUrl.js +1 -1
  145. package/lib/types/Client.ts +537 -1
  146. package/lib/types/VeryfiExtraArgs.ts +4 -5
  147. package/lib/w2s/getW2.js +1 -2
  148. package/lib/w2s/getW2Set.js +14 -0
  149. package/lib/w2s/getW2Sets.js +23 -0
  150. package/lib/w2s/splitW2s.js +25 -0
  151. package/lib/w2s/splitW2sBase64.js +24 -0
  152. package/lib/w2s/splitW2sStream.js +24 -0
  153. package/lib/w2s/splitW2sUrl.js +24 -0
  154. package/lib/w2s/tags/addW2Tag.js +15 -0
  155. package/lib/w2s/tags/addW2Tags.js +15 -0
  156. package/lib/w2s/tags/deleteW2Tag.js +13 -0
  157. package/lib/w2s/tags/deleteW2Tags.js +12 -0
  158. package/lib/w2s/tags/getW2Tags.js +14 -0
  159. package/lib/w2s/updateW2.js +14 -0
  160. package/lib/w8bene/getW8BENE.js +3 -3
  161. package/lib/w8bene/getW8BENEs.js +3 -3
  162. package/lib/w8bene/tags/addW8beneTag.js +15 -0
  163. package/lib/w8bene/tags/addW8beneTags.js +15 -0
  164. package/lib/w8bene/tags/deleteW8beneTag.js +13 -0
  165. package/lib/w8bene/tags/deleteW8beneTags.js +12 -0
  166. package/lib/w8bene/tags/getW8beneTags.js +14 -0
  167. package/lib/w8bene/updateW8BENE.js +14 -0
  168. package/lib/w9s/getW9.js +3 -3
  169. package/lib/w9s/getW9s.js +3 -3
  170. package/lib/w9s/tags/addW9Tag.js +15 -0
  171. package/lib/w9s/tags/addW9Tags.js +15 -0
  172. package/lib/w9s/tags/deleteW9Tag.js +13 -0
  173. package/lib/w9s/tags/deleteW9Tags.js +12 -0
  174. package/lib/w9s/tags/getW9Tags.js +14 -0
  175. package/lib/w9s/updateW9.js +14 -0
  176. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Split and process a PDF with multiple W-2s from a base64 string. https://docs.veryfi.com/api/split-and-process-a-pdf-with-multiple-w-2-s/
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.split_w2s_from_base64 = async function (
12
+ file_name,
13
+ file_base64_string,
14
+ {...kwargs} = {}
15
+ ) {
16
+ let endpoint_name = "/w2s-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
+ * Split and process a PDF with multiple W-2s from a file stream. https://docs.veryfi.com/api/split-and-process-a-pdf-with-multiple-w-2-s/
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.split_w2s_from_stream = async function (
12
+ file,
13
+ file_name,
14
+ {...kwargs} = {}
15
+ ) {
16
+ let endpoint_name = "/w2s-set/";
17
+ let request_arguments = {
18
+ "file": file,
19
+ "file_name": file_name,
20
+ };
21
+ request_arguments = Object.assign(request_arguments, kwargs);
22
+ let response = await this._request("POST", endpoint_name, request_arguments, null, true);
23
+ return response['data'];
24
+ }
@@ -0,0 +1,24 @@
1
+ const Client = require('../client/constructor');
2
+ /**
3
+ * Split and process a PDF with multiple W-2s from a URL. https://docs.veryfi.com/api/split-and-process-a-pdf-with-multiple-w-2-s/
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.split_w2s_from_url = async function (
12
+ file_url = null,
13
+ file_urls = null,
14
+ {...kwargs} = {}
15
+ ) {
16
+ let endpoint_name = "/w2s-set/";
17
+ let request_arguments = {
18
+ "file_url": file_url,
19
+ "file_urls": file_urls,
20
+ };
21
+ request_arguments = Object.assign(request_arguments, kwargs);
22
+ let response = await this._request("POST", endpoint_name, request_arguments, null, false);
23
+ return response['data'];
24
+ }
@@ -0,0 +1,15 @@
1
+ const Client = require('../../client/constructor');
2
+ /**
3
+ * Add a tag to a W-2. https://docs.veryfi.com/api/add-a-tag-to-a-w-2/
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_w2_tag = async function (document_id, tag) {
11
+ let endpoint_name = `/w2s/${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 W-2. https://docs.veryfi.com/api/add-tags-to-a-w-2/
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_w2_tags = async function (document_id, tags) {
11
+ let endpoint_name = `/w2s/${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 W-2. https://docs.veryfi.com/api/unlink-a-tag-from-a-w-2/
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_w2_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/w2s/${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 W-2. https://docs.veryfi.com/api/unlink-all-tags-from-a-w-2/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_w2_tags = async function (document_id) {
10
+ let endpoint_name = `/w2s/${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 W-2. https://docs.veryfi.com/api/get-w-2-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_w2_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w2s/${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 W-2. https://docs.veryfi.com/api/w2s/update-a-w-2/
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_w2 = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w2s/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
@@ -15,10 +15,10 @@ Client.prototype.get_w8bene = async function (
15
15
  {...kwargs} = {}
16
16
  ) {
17
17
  let endpoint_name = `/w-8ben-e/${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_w8benes = async function (
17
17
  {...kwargs} = {}
18
18
  ) {
19
19
  let endpoint_name = `/w-8ben-e/`;
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 W-8BEN-E. https://docs.veryfi.com/api/add-a-tag-to-a-w-8-ben-e/
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_w8bene_tag = async function (document_id, tag) {
11
+ let endpoint_name = `/w-8ben-e/${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 W-8BEN-E. https://docs.veryfi.com/api/add-tags-to-a-w-8-ben-e/
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_w8bene_tags = async function (document_id, tags) {
11
+ let endpoint_name = `/w-8ben-e/${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 W-8BEN-E. https://docs.veryfi.com/api/unlink-a-tag-from-a-w-8-ben-e/
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_w8bene_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/w-8ben-e/${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 W-8BEN-E. https://docs.veryfi.com/api/unlink-all-tags-from-a-w-8-ben-e/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_w8bene_tags = async function (document_id) {
10
+ let endpoint_name = `/w-8ben-e/${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 W-8BEN-E. https://docs.veryfi.com/api/get-w-8-ben-e-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_w8bene_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w-8ben-e/${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 W-8BEN-E. https://docs.veryfi.com/api/w-8ben-e/update-a-w-8-ben-e/
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_w8bene = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w-8ben-e/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
package/lib/w9s/getW9.js CHANGED
@@ -15,10 +15,10 @@ Client.prototype.get_w9 = async function (
15
15
  {...kwargs} = {}
16
16
  ) {
17
17
  let endpoint_name = `/w9s/${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
  }
package/lib/w9s/getW9s.js CHANGED
@@ -17,12 +17,12 @@ Client.prototype.get_w9s = async function (
17
17
  {...kwargs} = {}
18
18
  ) {
19
19
  let endpoint_name = `/w9s/`;
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 W-9. https://docs.veryfi.com/api/add-a-tag-to-a-w-9/
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_w9_tag = async function (document_id, tag) {
11
+ let endpoint_name = `/w9s/${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 W-9. https://docs.veryfi.com/api/add-tags-to-a-w-9/
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_w9_tags = async function (document_id, tags) {
11
+ let endpoint_name = `/w9s/${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 W-9. https://docs.veryfi.com/api/unlink-a-tag-from-a-w-9/
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_w9_tag = async function (document_id, tag_id) {
11
+ let endpoint_name = `/w9s/${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 W-9. https://docs.veryfi.com/api/unlink-all-tags-from-a-w-9/
4
+ *
5
+ * @memberof Client
6
+ * @param {string} document_id ID of the document
7
+ * @returns {JSON} Delete response
8
+ */
9
+ Client.prototype.delete_w9_tags = async function (document_id) {
10
+ let endpoint_name = `/w9s/${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 W-9. https://docs.veryfi.com/api/get-w-9-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_w9_tags = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w9s/${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 W-9. https://docs.veryfi.com/api/w9s/update-a-w-9/
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_w9 = async function (document_id, {...kwargs} = {}) {
11
+ let endpoint_name = `/w9s/${document_id}/`;
12
+ let response = await this._request("PUT", endpoint_name, kwargs);
13
+ return response['data'];
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfi/veryfi-sdk",
3
- "version": "1.4.8",
3
+ "version": "1.5.0",
4
4
  "description": "Node.js module for communicating with the Veryfi OCR API",
5
5
  "main": "lib/client/client.js",
6
6
  "typings": "lib/types/Client.ts",