@veryfi/veryfi-sdk 1.4.0 → 1.4.2

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.
@@ -5,7 +5,7 @@ const Client = require('../client/constructor');
5
5
  * veryfi_client.process_any_document('file/path','blue_print')
6
6
  *
7
7
  * @memberof Client
8
- * @param {ReadStream} file ReadStream of a file to submit for data extraction
8
+ * @param {stream.Readable} file ReadStream of a file to submit for data extraction
9
9
  * @param {String} file_name The file name including the extension
10
10
  * @param {String} blueprint_name The name of the extraction blueprints to use.
11
11
  * @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
@@ -3,7 +3,7 @@ const Client = require('../client/constructor');
3
3
  * Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
4
4
  *
5
5
  * @memberof Client
6
- * @param {fs.ReadStream} file file to submit for data extraction
6
+ * @param {stream.Readable} file file to submit for data extraction
7
7
  * @param {String} file_name The file name including the extension
8
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
9
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -3,7 +3,7 @@ const Client = require('../client/constructor');
3
3
  * Process Business card and extract all the fields from it. https://docs.veryfi.com/api/business-cards/process-a-business-card/
4
4
  *
5
5
  * @memberof Client
6
- * @param {fs.ReadStream} file file to submit for data extraction
6
+ * @param {stream.Readable} file file to submit for data extraction
7
7
  * @param {String} file_name The file name including the extension
8
8
  * @param {Object} kwargs Additional request parameters
9
9
  * @returns {JSON} Data extracted from the document
@@ -3,7 +3,7 @@ const Client = require('../client/constructor');
3
3
  * Process Check and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
4
4
  *
5
5
  * @memberof Client
6
- * @param {fs.ReadStream} file file to submit for data extraction
6
+ * @param {stream.Readable} file file to submit for data extraction
7
7
  * @param {String} file_name The file name including the extension
8
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
9
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -8,7 +8,7 @@ const Client = require('../client/constructor');
8
8
  */
9
9
  Client.prototype._get_headers = function (has_files = false) {
10
10
  let final_headers = {
11
- "User-Agent": "Node.js Veryfi-Nodejs/1.4.0",
11
+ "User-Agent": "Node.js Veryfi-Nodejs/1.4.2",
12
12
  "Accept": "application/json",
13
13
  "Content-Type": "application/json",
14
14
  "Client-Id": this.client_id,
@@ -9,7 +9,7 @@ const Client = require('../client/constructor');
9
9
  * {'extra': 'parameters'})
10
10
  *
11
11
  * @memberof Client
12
- * @param {ReadStream} file ReadStream of a file to submit for data extraction
12
+ * @param {stream.Readable} file ReadStream of a file to submit for data extraction
13
13
  * @param {String} file_name The file name including the extension
14
14
  * @param {Boolean} auto_delete Delete this document from Veryfi after data has been extracted
15
15
  * @param {Object} kwargs Additional request parameters
@@ -2,6 +2,7 @@ import fs from "fs";
2
2
  import {VeryfiDocument} from "./VeryfiDocument";
3
3
  import {JsonObject, VeryfiExtraArgs} from "./VeryfiExtraArgs";
4
4
  import {Tag} from "./Tag";
5
+ import * as stream from "node:stream";
5
6
 
6
7
  export declare class Client {
7
8
  /**
@@ -134,7 +135,7 @@ export declare class Client {
134
135
  * Process a document and extract all the fields from it. https://docs.veryfi.com/api/receipts-invoices/process-a-document/
135
136
  *
136
137
  * @memberof Client
137
- * @param {fs.ReadStream} file ReadStream of a file to submit for data extraction
138
+ * @param {stream.Readable} file ReadStream of a file to submit for data extraction
138
139
  * @param {String} file_name The file name including the extension
139
140
  * @param {Array} categories List of categories Veryfi can use to categorize the document
140
141
  * @param {Boolean} auto_delete Delete this document from Veryfi after data has been extracted
@@ -142,7 +143,7 @@ export declare class Client {
142
143
  * @returns {JSON} Data extracted from the document
143
144
  */
144
145
  public process_document_from_stream(
145
- file: fs.ReadStream,
146
+ file: stream.Readable,
146
147
  file_name: string,
147
148
  categories?: string[],
148
149
  auto_delete?: boolean,
@@ -253,7 +254,7 @@ export declare class Client {
253
254
  * Process any document and extract all the fields from it. https://docs.veryfi.com/api/anydocs/process-%E2%88%80-doc/
254
255
  *
255
256
  * @memberof Client
256
- * @param {ReadStream} file ReadStream of a file to submit for data extraction
257
+ * @param {stream.Readable} file ReadStream of a file to submit for data extraction
257
258
  * @param {String} file_name The file name including the extension
258
259
  * @param {String} blueprint_name The name of the extraction blueprints to use.
259
260
  * @param {number} max_pages_to_process The number of pages to process for the document. The limit is 50 pages per document.
@@ -261,7 +262,7 @@ export declare class Client {
261
262
  * @returns {JSON} Data extracted from the document
262
263
  */
263
264
  public process_any_document_from_stream(
264
- file: fs.ReadStream,
265
+ file: stream.Readable,
265
266
  file_name: string,
266
267
  blueprint_name?: string,
267
268
  max_pages_to_process?: number,
@@ -368,7 +369,7 @@ export declare class Client {
368
369
  * Process bank statement and extract all the fields from it. https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
369
370
  *
370
371
  * @memberof Client
371
- * @param {fs.ReadStream} file file to submit for data extraction
372
+ * @param {stream.Readable} file file to submit for data extraction
372
373
  * @param {String} file_name The file name including the extension
373
374
  * @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
374
375
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -376,7 +377,7 @@ export declare class Client {
376
377
  * @returns {JSON} Data extracted from the document
377
378
  */
378
379
  public process_bank_statement_from_stream(
379
- file: fs.ReadStream,
380
+ file: stream.Readable,
380
381
  file_name: string,
381
382
  bounding_boxes?: boolean,
382
383
  confidence_details?: boolean,
@@ -482,13 +483,13 @@ export declare class Client {
482
483
  * Process business card and extract all the fields from it. https://docs.veryfi.com/api/business-cards/process-a-business-card/
483
484
  *
484
485
  * @memberof Client
485
- * @param {fs.ReadStream} file ReadStream of a file to submit for data extraction
486
+ * @param {stream.Readable} file ReadStream of a file to submit for data extraction
486
487
  * @param {String} file_name The file name including the extension
487
488
  * @param {Object} kwargs Additional request parameters
488
489
  * @returns {JSON} Data extracted from the document
489
490
  */
490
491
  public process_business_card_from_stream(
491
- file: fs.ReadStream,
492
+ file: stream.Readable,
492
493
  file_name: string,
493
494
  {...kwargs}?: VeryfiExtraArgs
494
495
  ): Promise<JsonObject>;
@@ -606,7 +607,7 @@ export declare class Client {
606
607
  * Process check and extract all the fields from it. https://docs.veryfi.com/api/checks/process-a-check/
607
608
  *
608
609
  * @memberof Client
609
- * @param {fs.ReadStream} file file to submit for data extraction
610
+ * @param {stream.Readable} file file to submit for data extraction
610
611
  * @param {String} file_name The file name including the extension
611
612
  * @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
612
613
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -614,7 +615,7 @@ export declare class Client {
614
615
  * @returns {JSON} Data extracted from the document
615
616
  */
616
617
  public process_check_from_stream(
617
- file: fs.ReadStream,
618
+ file: stream.Readable,
618
619
  file_name: string,
619
620
  bounding_boxes?: boolean,
620
621
  confidence_details?: boolean,
@@ -703,7 +704,7 @@ export declare class Client {
703
704
  * Process w2 and extract all the fields from it. https://docs.veryfi.com/api/w2s/process-a-w-2/
704
705
  *
705
706
  * @memberof Client
706
- * @param {fs.ReadStream} file file to submit for data extraction
707
+ * @param {stream.Readable} file file to submit for data extraction
707
708
  * @param {String} file_name The file name including the extension
708
709
  * @param {boolean} auto_delete Delete this document from Veryfi after data has been extracted
709
710
  * @param {int} max_pages_to_process When sending a long document to Veryfi for processing, this parameter controls how many pages of the document will be read and processed, starting from page 1.
@@ -711,7 +712,7 @@ export declare class Client {
711
712
  * @returns {JSON} Data extracted from the document
712
713
  */
713
714
  public process_w2_from_stream(
714
- file: fs.ReadStream,
715
+ file: stream.Readable,
715
716
  file_name: string,
716
717
  auto_delete?: boolean,
717
718
  max_pages_to_process?: number,
@@ -826,7 +827,7 @@ export declare class Client {
826
827
  * Process W-8BEN-E and extract all the fields from it. https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
827
828
  *
828
829
  * @memberof Client
829
- * @param {fs.ReadStream} file file to submit for data extraction
830
+ * @param {stream.Readable} file file to submit for data extraction
830
831
  * @param {String} file_name The file name including the extension.
831
832
  * @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
832
833
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -834,7 +835,7 @@ export declare class Client {
834
835
  * @returns {JSON} Data extracted from the document
835
836
  */
836
837
  public process_w8bene_from_stream(
837
- file: fs.ReadStream,
838
+ file: stream.Readable,
838
839
  file_name: string,
839
840
  bounding_boxes?: boolean,
840
841
  confidence_details?: boolean,
@@ -943,7 +944,7 @@ export declare class Client {
943
944
  * Process w9 and extract all the fields from it. https://docs.veryfi.com/api/w9s/process-a-w-9/
944
945
  *
945
946
  * @memberof Client
946
- * @param {fs.ReadStream} file file to submit for data extraction
947
+ * @param {stream.Readable} file file to submit for data extraction
947
948
  * @param {String} file_name The file name including the extension.
948
949
  * @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
949
950
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -951,7 +952,7 @@ export declare class Client {
951
952
  * @returns {JSON} Data extracted from the document
952
953
  */
953
954
  public process_w9_from_stream(
954
- file: fs.ReadStream,
955
+ file: stream.Readable,
955
956
  file_name: string,
956
957
  bounding_boxes?: boolean,
957
958
  confidence_details?: boolean,
@@ -1,13 +1,23 @@
1
1
  import {BoundingElement} from "./BoundingElement";
2
2
 
3
-
4
3
  export declare type LineItem = {
4
+ category?: null | string | BoundingElement;
5
+ country_of_origin?: null | string | BoundingElement;
6
+ custom_fields?: Record<string, unknown>;
5
7
  date?: null | string | BoundingElement;
6
8
  description?: null | string | BoundingElement;
7
9
  discount?: null | number | BoundingElement;
10
+ discount_price?: null | number | BoundingElement;
11
+ discount_rate?: null | number | BoundingElement;
8
12
  end_date?: null | string | BoundingElement;
13
+ full_description?: null | string | BoundingElement;
14
+ gross_total?: null | number | BoundingElement;
9
15
  hsn?: null | string;
10
16
  id?: null | number;
17
+ lot?: null | string | BoundingElement;
18
+ manufacturer?: null | string | BoundingElement;
19
+ net_total?: null | number | BoundingElement;
20
+ normalized_description?: null | string | BoundingElement;
11
21
  order?: null | number;
12
22
  price?: null | number | BoundingElement;
13
23
  quantity?: null | number | BoundingElement;
@@ -15,10 +25,15 @@ export declare type LineItem = {
15
25
  section?: null | string;
16
26
  sku?: null | string | BoundingElement;
17
27
  start_date?: null | string;
18
- tags?: null | null[];
28
+ subtotal?: null | number | BoundingElement;
29
+ tags?: null | string[];
19
30
  tax?: null | number | BoundingElement;
31
+ tax_code?: null | string | BoundingElement;
20
32
  tax_rate?: null | number;
33
+ text?: null | string | BoundingElement;
21
34
  total?: null | number | BoundingElement;
22
35
  type?: null | string;
23
36
  unit_of_measure?: null | string;
37
+ upc?: null | string | BoundingElement;
38
+ weight?: null | number | BoundingElement;
24
39
  };
@@ -1,15 +1,35 @@
1
1
  import {BoundingElement} from "./BoundingElement";
2
2
 
3
3
  export declare type Vendor = {
4
+ abn_number?: null | string | BoundingElement;
5
+ account_currency?: null | string | BoundingElement;
6
+ account_number?: null | string | BoundingElement;
4
7
  address?: null | string | BoundingElement;
8
+ bank_breakdown?: Array<null | Record<string, unknown>>;
9
+ bank_name?: null | string | BoundingElement;
10
+ bank_number?: null | string | BoundingElement;
11
+ bank_swift?: null | string | BoundingElement;
12
+ biller_code?: null | string | BoundingElement;
5
13
  category?: null | string | BoundingElement;
14
+ country_code?: null | string | BoundingElement;
6
15
  email?: null | string | BoundingElement;
16
+ external_id?: null | string | BoundingElement;
17
+ external_ids?: Array<null | string>;
7
18
  fax_number?: null | string | BoundingElement;
19
+ iban?: null | string | BoundingElement;
20
+ lat?: number;
21
+ lng?: number;
22
+ logo?: null | string | BoundingElement;
23
+ logo_name?: null | string | BoundingElement;
24
+ map_url?: null | string | BoundingElement;
8
25
  name?: null | string | BoundingElement;
26
+ order_number?: null | string | BoundingElement;
27
+ parsed_address?: null | Record<string, unknown>;
9
28
  phone_number?: null | string | BoundingElement;
29
+ raw_address?: null | string | BoundingElement;
10
30
  raw_name?: null | string;
11
- vendor_logo?: null | string | BoundingElement;
12
- vendor_reg_number?: null | string | BoundingElement;
13
- vendor_type?: null | string;
31
+ reg_number?: null | string | BoundingElement;
32
+ type?: null | string | BoundingElement;
33
+ vat_number?: null | string | BoundingElement;
14
34
  web?: null | string | BoundingElement;
15
35
  };
@@ -16,7 +16,7 @@ export declare type VeryfiDocument = {
16
16
  account_number?: null | string | BoundingElement;
17
17
  accounting_entry_type?: null | string;
18
18
  balance?: null | string | BoundingElement;
19
- barcodes?: null | string[] | BoundingElement[];
19
+ barcodes?: null | Array<{ data: string; type: string }>;
20
20
  bill_to?: null | BillTo;
21
21
  card_number?: null | string | BoundingElement;
22
22
  cashback?: null | number | BoundingElement;
@@ -51,9 +51,67 @@ export declare type VeryfiDocument = {
51
51
  is_document?: null | boolean;
52
52
  is_duplicate?: null | boolean;
53
53
  is_money_in?: null | boolean | BoundingElement;
54
+ language?: null | string[];
54
55
  license_plate_number?: null | string | BoundingElement;
55
56
  line_items?: null | LineItem[];
56
57
  line_items_with_scores?: null | LineItem[];
58
+ meta?: null | {
59
+ device_id?: null | string;
60
+ device_user_uuid?: null | string;
61
+ duplicates?: Array<{
62
+ id: number;
63
+ score: number;
64
+ url: string;
65
+ }>;
66
+ fraud?: {
67
+ attribution?: null | string;
68
+ color?: string;
69
+ custom_types?: string[];
70
+ decision?: string;
71
+ images?: Array<{
72
+ is_lcd: boolean;
73
+ score: number;
74
+ }>;
75
+ pages?: Array<{
76
+ is_lcd: {
77
+ score: number;
78
+ value: boolean;
79
+ };
80
+ }>;
81
+ score?: number;
82
+ submissions?: Record<string, unknown>;
83
+ types?: string[];
84
+ version?: null | string;
85
+ };
86
+ handwritten_fields?: null | string[];
87
+ language?: null | string[];
88
+ owner?: null | string;
89
+ pages?: Array<{
90
+ height: number;
91
+ is_blurry: {
92
+ score: number;
93
+ value: boolean;
94
+ };
95
+ language: string[];
96
+ screenshot: {
97
+ score: number;
98
+ type: null | string;
99
+ };
100
+ width: number;
101
+ }>;
102
+ processed_pages?: null | number;
103
+ source?: null | string;
104
+ source_documents?: Array<{
105
+ height: number;
106
+ size_kb: number;
107
+ width: number;
108
+ }>;
109
+ total_pages?: null | number;
110
+ warnings?: Array<{
111
+ message: string;
112
+ type: string;
113
+ }>;
114
+ };
57
115
  notes?: null | string;
58
116
  ocr_text?: null | string;
59
117
  order_date?: null | string | BoundingElement;
@@ -61,6 +119,7 @@ export declare type VeryfiDocument = {
61
119
  pdf_url?: null | string;
62
120
  previous_balance?: null | number | BoundingElement;
63
121
  purchase_order_number?: null | string | BoundingElement;
122
+ reference_number?: null | string | BoundingElement;
64
123
  rounding?: null | number | BoundingElement;
65
124
  server_name?: null | string | BoundingElement;
66
125
  service_end_date?: null | string;
@@ -76,7 +135,6 @@ export declare type VeryfiDocument = {
76
135
  tax_lines?: null | TaxLine[];
77
136
  tip?: null | number | BoundingElement;
78
137
  total?: null | number | BoundingElement;
79
- total_pages?: null | number;
80
138
  total_quantity?: null | string | BoundingElement;
81
139
  total_weight?: null | string | BoundingElement;
82
140
  tracking_number?: null | string | BoundingElement;
@@ -2,7 +2,7 @@ const Client = require('../client/constructor');
2
2
  /**
3
3
  * Upload a w2 document from a buffer. https://docs.veryfi.com/api/w2s/process-a-w-2/
4
4
  * @memberOf Client
5
- * @param {fs.ReadStream} file file to submit for data extraction
5
+ * @param {stream.Readable} file file to submit for data extraction
6
6
  * @param {String} file_name The file name including the extension
7
7
  * @param {boolean} auto_delete Delete this document from Veryfi after data has been extracted
8
8
  * @param {int} max_pages_to_process When sending a long document to Veryfi for processing, this parameter controls how many pages of the document will be read and processed, starting from page 1.
@@ -3,7 +3,7 @@ const Client = require('../client/constructor');
3
3
  * Upload a W-8BEN-E document from a buffer. https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
4
4
  *
5
5
  * @memberof Client
6
- * @param {fs.ReadStream} file file to submit for data extraction
6
+ * @param {stream.Readable} file file to submit for data extraction
7
7
  * @param {String} file_name The file name including the extension
8
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
9
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
@@ -2,7 +2,7 @@ const Client = require('../client/constructor');
2
2
  /**
3
3
  * Upload a w9 document from a buffer. https://docs.veryfi.com/api/w9s/process-a-w-9/
4
4
  * @memberof Client
5
- * @param {fs.ReadStream} file file to submit for data extraction
5
+ * @param {stream.Readable} file file to submit for data extraction
6
6
  * @param {String} file_name The file name including the extension
7
7
  * @param {boolean} bounding_boxes A field used to determine whether to return bounding_box and bounding_region for extracted fields in the Document response.
8
8
  * @param {boolean} confidence_details A field used to determine whether to return the score and ocr_score fields in the Document response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfi/veryfi-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
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",