@veryfi/veryfi-sdk 1.2.4 → 1.2.5
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 +4 -1
- package/lib/main.js +29 -1
- package/lib/types/main.d.ts +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ You may need to run the above command with `sudo`.
|
|
|
38
38
|
|
|
39
39
|
### Obtaining Client ID and user keys
|
|
40
40
|
|
|
41
|
-
If you don't have an account with Veryfi, please go ahead and register here: [https://
|
|
41
|
+
If you don't have an account with Veryfi, please go ahead and register here: [https://app.veryfi.com/signup/api/](https://app.veryfi.com/signup/api/)
|
|
42
42
|
|
|
43
43
|
### Node.js API Client Library
|
|
44
44
|
|
|
@@ -248,11 +248,14 @@ veryfi_client.update_document(id=12345,
|
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
## Need help?
|
|
251
|
+
Visit https://docs.veryfi.com/ to access integration guides and usage notes in the Veryfi API Documentation Portal
|
|
251
252
|
|
|
252
253
|
If you run into any issue or need help installing or using the library, please contact support@veryfi.com.
|
|
253
254
|
|
|
254
255
|
If you found a bug in this library or would like new features added, then open an issue or pull requests against this repo!
|
|
255
256
|
|
|
257
|
+
### [API Docs](https://docs.veryfi.com/)
|
|
258
|
+
|
|
256
259
|
### [Learn more at our blog](https://www.veryfi.com/nodejs/)
|
|
257
260
|
|
|
258
261
|
## Tutorial Video
|
package/lib/main.js
CHANGED
|
@@ -67,7 +67,7 @@ Client.prototype._check_w2_version = function () {
|
|
|
67
67
|
*/
|
|
68
68
|
Client.prototype._get_headers = function (has_files = false) {
|
|
69
69
|
let final_headers = {
|
|
70
|
-
"User-Agent": "Node.js Veryfi-Nodejs/1.2.
|
|
70
|
+
"User-Agent": "Node.js Veryfi-Nodejs/1.2.5",
|
|
71
71
|
"Accept": "application/json",
|
|
72
72
|
"Content-Type": "application/json",
|
|
73
73
|
"Client-Id": this.client_id,
|
|
@@ -535,6 +535,34 @@ Client.prototype.delete_tags = async function (document_id) {
|
|
|
535
535
|
return this._request("DELETE", endpoint_name, request_arguments);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
/**
|
|
539
|
+
* Replace multiple tags on an existing document
|
|
540
|
+
*
|
|
541
|
+
* @param {number} document_id ID of the document you'd like to add a Tag
|
|
542
|
+
* @param {string[]} tags array of tags to be added
|
|
543
|
+
* @return {JSON} response about tag added.
|
|
544
|
+
*/
|
|
545
|
+
Client.prototype.replace_tags = async function (document_id, tags) {
|
|
546
|
+
let endpoint_name = `/documents/${document_id}/`;
|
|
547
|
+
let request_arguments = {"tags": tags};
|
|
548
|
+
let response = await this._request("PUT", endpoint_name, request_arguments);
|
|
549
|
+
return response['data'];
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Add multiple tags on an existing document
|
|
554
|
+
*
|
|
555
|
+
* @param {number} document_id ID of the document you'd like to add a Tag
|
|
556
|
+
* @param {string[]} tags array of tags to be added
|
|
557
|
+
* @return {JSON} response about tag added.
|
|
558
|
+
*/
|
|
559
|
+
Client.prototype.add_tags = async function (document_id, tags) {
|
|
560
|
+
let endpoint_name = `/documents/${document_id}/tags/`;
|
|
561
|
+
let request_arguments = {"tags": tags};
|
|
562
|
+
let response = await this._request("POST", endpoint_name, request_arguments);
|
|
563
|
+
return response['data'];
|
|
564
|
+
}
|
|
565
|
+
|
|
538
566
|
|
|
539
567
|
// Exports
|
|
540
568
|
|
package/lib/types/main.d.ts
CHANGED
|
@@ -328,6 +328,24 @@ export declare class Client {
|
|
|
328
328
|
*/
|
|
329
329
|
public delete_tags(document_id: string): Promise<any>;
|
|
330
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Add multiple tags on an existing document
|
|
333
|
+
*
|
|
334
|
+
* @param {number} document_id ID of the document you'd like to add a Tag
|
|
335
|
+
* @param {string[]} tags name to add
|
|
336
|
+
* @return {Promise<Tag>} response about tags added.
|
|
337
|
+
*/
|
|
338
|
+
public add_tags(document_id: string, tags: string[]): Promise<Tag>;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Replace multiple tags on an existing document
|
|
342
|
+
*
|
|
343
|
+
* @param {number} document_id ID of the document you'd like to add a Tag
|
|
344
|
+
* @param {string[]} tags names to be added
|
|
345
|
+
* @return {Promise<Tag>} response about tags added.
|
|
346
|
+
*/
|
|
347
|
+
public replace_tags(document_id: string, tags: string[]): Promise<Tag>;
|
|
348
|
+
|
|
331
349
|
}
|
|
332
350
|
|
|
333
351
|
/**
|