mindee 4.13.1 → 4.14.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +9 -9
  3. package/package.json +2 -2
  4. package/src/cli.js +108 -48
  5. package/src/parsing/standard/companyRegistration.d.ts +3 -0
  6. package/src/parsing/standard/companyRegistration.js +15 -0
  7. package/src/product/barcodeReader/index.d.ts +1 -0
  8. package/src/product/barcodeReader/index.js +5 -0
  9. package/src/product/cropper/index.d.ts +1 -0
  10. package/src/product/cropper/index.js +5 -0
  11. package/src/product/eu/driverLicense/index.d.ts +1 -0
  12. package/src/product/eu/driverLicense/index.js +5 -0
  13. package/src/product/eu/driverLicense/internal.d.ts +1 -0
  14. package/src/product/eu/driverLicense/internal.js +3 -1
  15. package/src/product/eu/index.d.ts +1 -1
  16. package/src/product/eu/index.js +3 -3
  17. package/src/product/eu/internal.d.ts +1 -1
  18. package/src/product/eu/internal.js +2 -2
  19. package/src/product/eu/licensePlate/index.d.ts +1 -0
  20. package/src/product/eu/licensePlate/index.js +5 -0
  21. package/src/product/financialDocument/financialDocumentV1Document.d.ts +1 -1
  22. package/src/product/financialDocument/financialDocumentV1Document.js +3 -2
  23. package/src/product/financialDocument/financialDocumentV1LineItem.d.ts +2 -0
  24. package/src/product/financialDocument/financialDocumentV1LineItem.js +10 -0
  25. package/src/product/financialDocument/index.d.ts +1 -0
  26. package/src/product/financialDocument/index.js +5 -0
  27. package/src/product/fr/bankAccountDetails/index.d.ts +2 -0
  28. package/src/product/fr/bankAccountDetails/index.js +7 -0
  29. package/src/product/fr/bankAccountDetails/internal.d.ts +1 -1
  30. package/src/product/fr/bankAccountDetails/internal.js +3 -3
  31. package/src/product/fr/carteGrise/index.d.ts +1 -0
  32. package/src/product/fr/carteGrise/index.js +5 -0
  33. package/src/product/fr/carteVitale/index.d.ts +1 -0
  34. package/src/product/fr/carteVitale/index.js +5 -0
  35. package/src/product/fr/idCard/index.d.ts +2 -0
  36. package/src/product/fr/idCard/index.js +7 -0
  37. package/src/product/fr/idCard/internal.d.ts +3 -1
  38. package/src/product/fr/idCard/internal.js +7 -3
  39. package/src/product/fr/index.d.ts +3 -3
  40. package/src/product/fr/index.js +7 -7
  41. package/src/product/fr/internal.d.ts +1 -1
  42. package/src/product/fr/internal.js +2 -2
  43. package/src/product/index.d.ts +2 -2
  44. package/src/product/index.js +5 -5
  45. package/src/product/internal.d.ts +1 -1
  46. package/src/product/internal.js +2 -2
  47. package/src/product/internationalId/index.d.ts +1 -0
  48. package/src/product/internationalId/index.js +5 -0
  49. package/src/product/internationalId/internationalIdV2Document.d.ts +1 -1
  50. package/src/product/internationalId/internationalIdV2Document.js +1 -1
  51. package/src/product/invoice/index.d.ts +1 -0
  52. package/src/product/invoice/index.js +5 -0
  53. package/src/product/invoice/invoiceV4Document.d.ts +1 -1
  54. package/src/product/invoice/invoiceV4Document.js +3 -2
  55. package/src/product/invoice/invoiceV4LineItem.d.ts +2 -0
  56. package/src/product/invoice/invoiceV4LineItem.js +10 -0
  57. package/src/product/multiReceiptsDetector/index.d.ts +1 -0
  58. package/src/product/multiReceiptsDetector/index.js +5 -0
  59. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +1 -1
  60. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +1 -1
  61. package/src/product/passport/index.d.ts +1 -0
  62. package/src/product/passport/index.js +5 -0
  63. package/src/product/proofOfAddress/index.d.ts +1 -0
  64. package/src/product/proofOfAddress/index.js +5 -0
  65. package/src/product/receipt/index.d.ts +1 -0
  66. package/src/product/receipt/index.js +5 -0
  67. package/src/product/receipt/receiptV5Document.d.ts +1 -1
  68. package/src/product/receipt/receiptV5Document.js +1 -1
  69. package/src/product/resume/index.d.ts +1 -0
  70. package/src/product/resume/index.js +5 -0
  71. package/src/product/resume/internal.d.ts +1 -1
  72. package/src/product/resume/internal.js +3 -3
  73. package/src/product/us/bankCheck/index.d.ts +1 -0
  74. package/src/product/us/bankCheck/index.js +5 -0
  75. package/src/product/us/driverLicense/index.d.ts +1 -0
  76. package/src/product/us/driverLicense/index.js +5 -0
  77. package/src/product/us/healthcareCard/healthcareCardV1.d.ts +16 -0
  78. package/src/product/us/healthcareCard/healthcareCardV1.js +27 -0
  79. package/src/product/us/healthcareCard/healthcareCardV1Copay.d.ts +30 -0
  80. package/src/product/us/healthcareCard/healthcareCardV1Copay.js +66 -0
  81. package/src/product/us/healthcareCard/healthcareCardV1Document.d.ts +37 -0
  82. package/src/product/us/healthcareCard/healthcareCardV1Document.js +96 -0
  83. package/src/product/us/healthcareCard/index.d.ts +3 -0
  84. package/src/product/us/healthcareCard/index.js +9 -0
  85. package/src/product/us/healthcareCard/internal.d.ts +3 -0
  86. package/src/product/us/healthcareCard/internal.js +9 -0
  87. package/src/product/us/index.d.ts +2 -1
  88. package/src/product/us/index.js +5 -3
  89. package/src/product/us/internal.d.ts +1 -0
  90. package/src/product/us/internal.js +2 -1
  91. package/src/product/us/w9/index.d.ts +1 -0
  92. package/src/product/us/w9/index.js +5 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v4.14.1 - 2024-09-03
4
+ ### Changes
5
+ * :memo: add classification detail to guide documentation
6
+ ### Fixes
7
+ * :arrow_up: update dependencies
8
+ * :memo: fix broken documentation URLs
9
+ * :recycle: generate missing accessors for products
10
+ * :recycle: add missing async code samples
11
+
12
+
13
+ ## v4.14.0 - 2024-07-24
14
+ ### Changes
15
+ * :sparkles: add support for Healthcare Card V1
16
+ * :sparkles: add support for Invoice V4.7
17
+ * :sparkles: add support for Financial Document V1.9
18
+ * :recycle: update display for registration field
19
+
20
+
3
21
  ## v4.13.1 - 2024-06-10
4
22
  ### Fixes
5
23
  * :recycle: refactored image extraction module to allow for more generic manipulations
package/README.md CHANGED
@@ -144,8 +144,8 @@ const apiResponse = mindeeClient.parse(
144
144
  Complete details on the working of the library are available in the following guides:
145
145
 
146
146
  * [Node.js Getting Started](https://developers.mindee.com/docs/nodejs-getting-started)
147
- * [Node.js Generated API](https://developers.mindee.com/docs/nodejs-generated-api)
148
- * [Node.js Custom OCR](https://developers.mindee.com/docs/nodejs-api-builder)
147
+ * [Node.js Generated API](https://developers.mindee.com/docs/nodejs-generated-ocr)
148
+ * [Node.js Custom OCR (Deprecated)](https://developers.mindee.com/docs/nodejs-api-builder)
149
149
  * [Node.js Invoice OCR](https://developers.mindee.com/docs/nodejs-invoice-ocr)
150
150
  * [Node.js International Id OCR](https://developers.mindee.com/docs/nodejs-international-id-ocr)
151
151
  * [Node.js Receipt OCR](https://developers.mindee.com/docs/nodejs-receipt-ocr)
@@ -153,18 +153,18 @@ Complete details on the working of the library are available in the following gu
153
153
  * [Node.js Financial Document OCR](https://developers.mindee.com/docs/nodejs-financial-document-ocr)
154
154
  * [Node.js Passport OCR](https://developers.mindee.com/docs/nodejs-passport-ocr)
155
155
  * [Node.js Proof of Address OCR](https://developers.mindee.com/docs/nodejs-proof-of-address-ocr)
156
- * [Node.js EU License Plate OCR](https://developers.mindee.com/docs/nodejs-eu-license-plates-ocr)
156
+ * [Node.js EU License Plate OCR](https://developers.mindee.com/docs/nodejs-eu-license-plate-ocr)
157
157
  * [Node.js EU Driver License OCR](https://developers.mindee.com/docs/nodejs-eu-driver-license-ocr)
158
158
  * [Node.js FR Bank Account Detail OCR](https://developers.mindee.com/docs/nodejs-fr-bank-account-details-ocr)
159
159
  * [Node.js FR Carte Vitale OCR](https://developers.mindee.com/docs/nodejs-fr-carte-vitale-ocr)
160
- * [Node.js FR ID Card OCR](https://developers.mindee.com/docs/nodejs-fr-id-card-ocr)
161
- * [Node.js US Bank Check OCR](https://developers.mindee.com/docs/nodejs-us-bank-checks-ocr)
160
+ * [Node.js FR ID Card OCR](https://developers.mindee.com/docs/nodejs-fr-carte-nationale-didentite-ocr)
161
+ * [Node.js US Bank Check OCR](https://developers.mindee.com/docs/nodejs-us-bank-check-ocr)
162
162
  * [Node.js US W9 OCR](https://developers.mindee.com/docs/nodejs-us-w9-ocr)
163
163
  * [Node.js US Driver License OCR](https://developers.mindee.com/docs/nodejs-us-driver-license-ocr)
164
- * [Node.js Barcode Reader API](https://developers.mindee.com/docs/nodejs-barcode-reader-api)
165
- * [Node.js Cropper API](https://developers.mindee.com/docs/nodejs-cropper-api)
166
- * [Node.js Invoice Splitter API](https://developers.mindee.com/docs/nodejs-invoice-splitter-api)
167
- * [Node.js Multi Receipts Detector API](https://developers.mindee.com/docs/nodejs-multi-receipts-detector-api)
164
+ * [Node.js Barcode Reader API](https://developers.mindee.com/docs/nodejs-barcode-reader-ocr)
165
+ * [Node.js Cropper API](https://developers.mindee.com/docs/nodejs-cropper-ocr)
166
+ * [Node.js Invoice Splitter API](https://developers.mindee.com/docs/nodejs-invoice-splitter-ocr)
167
+ * [Node.js Multi Receipts Detector API](https://developers.mindee.com/docs/nodejs-multi-receipts-detector-ocr)
168
168
 
169
169
  You can also take a look at the **[Reference Documentation](https://mindee.github.io/mindee-api-nodejs/)**.
170
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindee",
3
- "version": "4.13.1",
3
+ "version": "4.14.1",
4
4
  "description": "Mindee Client Library for Node.js",
5
5
  "main": "src/index.js",
6
6
  "bin": "bin/mindee.js",
@@ -48,7 +48,7 @@
48
48
  "chai": "^4.3.10",
49
49
  "eslint": "^8.49.0",
50
50
  "eslint-plugin-jsdoc": "^46.8.2",
51
- "lint-staged": "^13.3.0",
51
+ "lint-staged": "^15.2.10",
52
52
  "mocha": "^10.1.0",
53
53
  "nock": "^13.3.3",
54
54
  "ts-node": "^10.9.1",
package/src/cli.js CHANGED
@@ -58,6 +58,16 @@ const CLI_COMMAND_CONFIG = new Map([
58
58
  sync: true,
59
59
  },
60
60
  ],
61
+ [
62
+ "barcode-reader",
63
+ {
64
+ displayName: "Barcode Reader",
65
+ docClass: product.BarcodeReaderV1,
66
+ allWords: true,
67
+ async: false,
68
+ sync: true,
69
+ },
70
+ ],
61
71
  [
62
72
  "cropper",
63
73
  {
@@ -69,125 +79,145 @@ const CLI_COMMAND_CONFIG = new Map([
69
79
  },
70
80
  ],
71
81
  [
72
- "international-id",
82
+ "financial",
73
83
  {
74
- displayName: "International Id",
75
- docClass: product.InternationalIdV2,
76
- allWords: false,
84
+ displayName: "Financial Document",
85
+ docClass: product.FinancialDocumentV1,
86
+ allWords: true,
77
87
  async: true,
78
- sync: false,
88
+ sync: true,
79
89
  },
80
90
  ],
81
91
  [
82
- "invoice",
92
+ "fr-bank-account-details",
83
93
  {
84
- displayName: "Invoice",
85
- docClass: product.InvoiceV4,
86
- allWords: true,
94
+ displayName: "FR Bank Account Details",
95
+ docClass: product.fr.BankAccountDetailsV2,
96
+ allWords: false,
87
97
  async: false,
88
98
  sync: true,
89
99
  },
90
100
  ],
91
101
  [
92
- "invoice-splitter",
102
+ "fr-id-card",
93
103
  {
94
- displayName: "Invoice Splitter",
95
- docClass: product.InvoiceSplitterV1,
104
+ displayName: "FR ID Card",
105
+ docClass: product.fr.IdCardV1,
96
106
  allWords: false,
97
- async: true,
98
- sync: false,
107
+ async: false,
108
+ sync: true,
99
109
  },
100
110
  ],
101
111
  [
102
- "receipt",
112
+ "fr-carte-vitale",
103
113
  {
104
- displayName: "Expense Receipt",
105
- docClass: product.ReceiptV5,
106
- allWords: true,
114
+ displayName: "FR Carte Vitale",
115
+ docClass: product.fr.CarteVitaleV1,
116
+ allWords: false,
107
117
  async: false,
108
118
  sync: true,
109
119
  },
110
120
  ],
111
121
  [
112
- "resume",
122
+ "fr-carte-grise",
113
123
  {
114
- displayName: "Resume",
115
- docClass: product.ResumeV1,
124
+ displayName: "FR Carte Grise",
125
+ docClass: product.fr.CarteGriseV1,
116
126
  allWords: false,
117
- async: true,
118
- sync: false,
127
+ async: false,
128
+ sync: true,
119
129
  },
120
130
  ],
121
131
  [
122
- "passport",
132
+ "eu-license-plate",
123
133
  {
124
- displayName: "Passport",
125
- docClass: product.PassportV1,
134
+ displayName: "EU License Plate",
135
+ docClass: product.eu.LicensePlateV1,
126
136
  allWords: false,
127
137
  async: false,
128
138
  sync: true,
129
139
  },
130
140
  ],
131
141
  [
132
- "financial",
142
+ "eu-driver-license",
133
143
  {
134
- displayName: "Financial Document",
135
- docClass: product.FinancialDocumentV1,
136
- allWords: true,
144
+ displayName: "EU Driver License",
145
+ docClass: product.eu.DriverLicenseV1,
146
+ allWords: false,
137
147
  async: false,
138
148
  sync: true,
139
149
  },
140
150
  ],
141
151
  [
142
- "fr-id-card",
152
+ "international-id",
143
153
  {
144
- displayName: "FR ID Card",
145
- docClass: product.fr.IdCardV1,
154
+ displayName: "International Id",
155
+ docClass: product.InternationalIdV2,
146
156
  allWords: false,
157
+ async: true,
158
+ sync: false,
159
+ },
160
+ ],
161
+ [
162
+ "invoice",
163
+ {
164
+ displayName: "Invoice",
165
+ docClass: product.InvoiceV4,
166
+ allWords: true,
147
167
  async: false,
148
168
  sync: true,
149
169
  },
150
170
  ],
151
171
  [
152
- "fr-bank-account-details",
172
+ "invoice-splitter",
153
173
  {
154
- displayName: "FR Bank Account Details",
155
- docClass: product.fr.BankAccountDetailsV2,
174
+ displayName: "Invoice Splitter",
175
+ docClass: product.InvoiceSplitterV1,
156
176
  allWords: false,
157
- async: false,
158
- sync: true,
177
+ async: true,
178
+ sync: false,
159
179
  },
160
180
  ],
161
181
  [
162
- "fr-carte-vitale",
182
+ "multi-receipts-detector",
163
183
  {
164
- displayName: "FR Carte Vitale",
165
- docClass: product.fr.CarteVitaleV1,
184
+ displayName: "Multi Receipts Detector",
185
+ docClass: product.MultiReceiptsDetectorV1,
166
186
  allWords: false,
167
187
  async: false,
168
188
  sync: true,
169
189
  },
170
190
  ],
171
191
  [
172
- "eu-license-plate",
192
+ "passport",
173
193
  {
174
- displayName: "EU License Plate",
175
- docClass: product.eu.LicensePlateV1,
194
+ displayName: "Passport",
195
+ docClass: product.PassportV1,
176
196
  allWords: false,
177
197
  async: false,
178
198
  sync: true,
179
199
  },
180
200
  ],
181
201
  [
182
- "eu-driver-license",
202
+ "receipt",
183
203
  {
184
- displayName: "EU Driver License",
185
- docClass: product.eu.DriverLicenseV1,
186
- allWords: false,
204
+ displayName: "Expense Receipt",
205
+ docClass: product.ReceiptV5,
206
+ allWords: true,
187
207
  async: false,
188
208
  sync: true,
189
209
  },
190
210
  ],
211
+ [
212
+ "resume",
213
+ {
214
+ displayName: "Resume",
215
+ docClass: product.ResumeV1,
216
+ allWords: false,
217
+ async: true,
218
+ sync: false,
219
+ },
220
+ ],
191
221
  [
192
222
  "us-bank-check",
193
223
  {
@@ -208,6 +238,36 @@ const CLI_COMMAND_CONFIG = new Map([
208
238
  sync: true,
209
239
  },
210
240
  ],
241
+ [
242
+ "us-healthcare-card",
243
+ {
244
+ displayName: "US Healthcare Card",
245
+ docClass: product.us.HealthcareCardV1,
246
+ allWords: false,
247
+ async: true,
248
+ sync: false,
249
+ },
250
+ ],
251
+ [
252
+ "us-mail",
253
+ {
254
+ displayName: "US Mail",
255
+ docClass: product.us.UsMailV2,
256
+ allWords: false,
257
+ async: true,
258
+ sync: false,
259
+ },
260
+ ],
261
+ [
262
+ "us-w9",
263
+ {
264
+ displayName: "US W9",
265
+ docClass: product.us.W9V1,
266
+ allWords: false,
267
+ async: true,
268
+ sync: false,
269
+ },
270
+ ],
211
271
  ]);
212
272
  //
213
273
  // EXECUTE THE COMMANDS
@@ -9,4 +9,7 @@ export declare class CompanyRegistrationField extends Field {
9
9
  /** Type of company registration. */
10
10
  type: string;
11
11
  constructor({ prediction, valueKey, reconstructed, pageId, }: BaseFieldConstructor);
12
+ toTableLine(): string;
13
+ toString(): string;
14
+ private printableValues;
12
15
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompanyRegistrationField = void 0;
4
4
  const field_1 = require("./field");
5
+ const common_1 = require("../common");
5
6
  /**
6
7
  * A company registration item.
7
8
  */
@@ -10,5 +11,19 @@ class CompanyRegistrationField extends field_1.Field {
10
11
  super({ prediction, valueKey, reconstructed, pageId });
11
12
  this.type = prediction["type"];
12
13
  }
14
+ toTableLine() {
15
+ const printable = this.printableValues();
16
+ return `| ${printable["type"].padEnd(15)} | ${printable["value"].padEnd(20)} `;
17
+ }
18
+ toString() {
19
+ const printable = this.printableValues();
20
+ return `Type: ${printable["type"]}, Value: ${printable["value"]}`;
21
+ }
22
+ printableValues() {
23
+ const printable = {};
24
+ printable["type"] = (0, common_1.cleanOutString)(this.type);
25
+ printable["value"] = (0, common_1.cleanOutString)((this.value ?? "").toString());
26
+ return printable;
27
+ }
13
28
  }
14
29
  exports.CompanyRegistrationField = CompanyRegistrationField;
@@ -0,0 +1 @@
1
+ export { BarcodeReaderV1 } from "./barcodeReaderV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BarcodeReaderV1 = void 0;
4
+ var barcodeReaderV1_1 = require("./barcodeReaderV1");
5
+ Object.defineProperty(exports, "BarcodeReaderV1", { enumerable: true, get: function () { return barcodeReaderV1_1.BarcodeReaderV1; } });
@@ -0,0 +1 @@
1
+ export { CropperV1 } from "./cropperV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CropperV1 = void 0;
4
+ var cropperV1_1 = require("./cropperV1");
5
+ Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
@@ -0,0 +1 @@
1
+ export { DriverLicenseV1 } from "./driverLicenseV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverLicenseV1 = void 0;
4
+ var driverLicenseV1_1 = require("./driverLicenseV1");
5
+ Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
@@ -1,2 +1,3 @@
1
1
  export { DriverLicenseV1 } from "./driverLicenseV1";
2
2
  export { DriverLicenseV1Document } from "./driverLicenseV1Document";
3
+ export { DriverLicenseV1Page } from "./driverLicenseV1Page";
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DriverLicenseV1Document = exports.DriverLicenseV1 = void 0;
3
+ exports.DriverLicenseV1Page = exports.DriverLicenseV1Document = exports.DriverLicenseV1 = void 0;
4
4
  var driverLicenseV1_1 = require("./driverLicenseV1");
5
5
  Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
6
6
  var driverLicenseV1Document_1 = require("./driverLicenseV1Document");
7
7
  Object.defineProperty(exports, "DriverLicenseV1Document", { enumerable: true, get: function () { return driverLicenseV1Document_1.DriverLicenseV1Document; } });
8
+ var driverLicenseV1Page_1 = require("./driverLicenseV1Page");
9
+ Object.defineProperty(exports, "DriverLicenseV1Page", { enumerable: true, get: function () { return driverLicenseV1Page_1.DriverLicenseV1Page; } });
@@ -1,2 +1,2 @@
1
- export { LicensePlateV1 } from "./licensePlate/licensePlateV1";
2
1
  export { DriverLicenseV1 } from "./driverLicense/driverLicenseV1";
2
+ export { LicensePlateV1 } from "./licensePlate/licensePlateV1";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DriverLicenseV1 = exports.LicensePlateV1 = void 0;
4
- var licensePlateV1_1 = require("./licensePlate/licensePlateV1");
5
- Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
3
+ exports.LicensePlateV1 = exports.DriverLicenseV1 = void 0;
6
4
  var driverLicenseV1_1 = require("./driverLicense/driverLicenseV1");
7
5
  Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
6
+ var licensePlateV1_1 = require("./licensePlate/licensePlateV1");
7
+ Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
@@ -1,2 +1,2 @@
1
- export * as licensePlate from "./licensePlate/internal";
2
1
  export * as driverLicense from "./driverLicense/internal";
2
+ export * as licensePlate from "./licensePlate/internal";
@@ -23,6 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.driverLicense = exports.licensePlate = void 0;
27
- exports.licensePlate = __importStar(require("./licensePlate/internal"));
26
+ exports.licensePlate = exports.driverLicense = void 0;
28
27
  exports.driverLicense = __importStar(require("./driverLicense/internal"));
28
+ exports.licensePlate = __importStar(require("./licensePlate/internal"));
@@ -0,0 +1 @@
1
+ export { LicensePlateV1 } from "./licensePlateV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LicensePlateV1 = void 0;
4
+ var licensePlateV1_1 = require("./licensePlateV1");
5
+ Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
2
2
  import { FinancialDocumentV1LineItem } from "./financialDocumentV1LineItem";
3
3
  import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
4
4
  /**
5
- * Financial Document API version 1.7 document data.
5
+ * Financial Document API version 1.9 document data.
6
6
  */
7
7
  export declare class FinancialDocumentV1Document implements Prediction {
8
8
  /** The customer's address used for billing. */
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
5
5
  const financialDocumentV1LineItem_1 = require("./financialDocumentV1LineItem");
6
6
  const standard_1 = require("../../parsing/standard");
7
7
  /**
8
- * Financial Document API version 1.7 document data.
8
+ * Financial Document API version 1.9 document data.
9
9
  */
10
10
  class FinancialDocumentV1Document {
11
11
  constructor(rawPrediction, pageId) {
@@ -148,7 +148,7 @@ class FinancialDocumentV1Document {
148
148
  const customerCompanyRegistrations = this.customerCompanyRegistrations.join("\n ");
149
149
  let lineItemsSummary = "";
150
150
  if (this.lineItems && this.lineItems.length > 0) {
151
- const lineItemsColSizes = [38, 14, 10, 12, 14, 14, 12];
151
+ const lineItemsColSizes = [38, 14, 10, 12, 14, 14, 17, 12];
152
152
  lineItemsSummary += "\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "-") + "\n ";
153
153
  lineItemsSummary += "| Description ";
154
154
  lineItemsSummary += "| Product code ";
@@ -156,6 +156,7 @@ class FinancialDocumentV1Document {
156
156
  lineItemsSummary += "| Tax Amount ";
157
157
  lineItemsSummary += "| Tax Rate (%) ";
158
158
  lineItemsSummary += "| Total Amount ";
159
+ lineItemsSummary += "| Unit of measure ";
159
160
  lineItemsSummary += "| Unit Price ";
160
161
  lineItemsSummary += "|\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "=");
161
162
  lineItemsSummary += this.lineItems.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "-")).join("");
@@ -17,6 +17,8 @@ export declare class FinancialDocumentV1LineItem {
17
17
  taxRate: number | undefined;
18
18
  /** The item total amount. */
19
19
  totalAmount: number | undefined;
20
+ /** The item unit of measure. */
21
+ unitMeasure: string | undefined;
20
22
  /** The item unit price. */
21
23
  unitPrice: number | undefined;
22
24
  /** Confidence score */
@@ -35,6 +35,7 @@ class FinancialDocumentV1LineItem {
35
35
  if (prediction["total_amount"] && !isNaN(prediction["total_amount"])) {
36
36
  this.totalAmount = +parseFloat(prediction["total_amount"]).toFixed(3);
37
37
  }
38
+ this.unitMeasure = prediction["unit_measure"];
38
39
  if (prediction["unit_price"] && !isNaN(prediction["unit_price"])) {
39
40
  this.unitPrice = +parseFloat(prediction["unit_price"]).toFixed(3);
40
41
  }
@@ -61,6 +62,8 @@ class FinancialDocumentV1LineItem {
61
62
  printable.taxRate +
62
63
  ", Total Amount: " +
63
64
  printable.totalAmount +
65
+ ", Unit of measure: " +
66
+ printable.unitMeasure +
64
67
  ", Unit Price: " +
65
68
  printable.unitPrice);
66
69
  }
@@ -82,6 +85,8 @@ class FinancialDocumentV1LineItem {
82
85
  " | " +
83
86
  printable.totalAmount.padEnd(12) +
84
87
  " | " +
88
+ printable.unitMeasure.padEnd(15) +
89
+ " | " +
85
90
  printable.unitPrice.padEnd(10) +
86
91
  " |");
87
92
  }
@@ -103,6 +108,11 @@ _FinancialDocumentV1LineItem_instances = new WeakSet(), _FinancialDocumentV1Line
103
108
  taxAmount: this.taxAmount !== undefined ? (0, standard_1.floatToString)(this.taxAmount) : "",
104
109
  taxRate: this.taxRate !== undefined ? (0, standard_1.floatToString)(this.taxRate) : "",
105
110
  totalAmount: this.totalAmount !== undefined ? (0, standard_1.floatToString)(this.totalAmount) : "",
111
+ unitMeasure: this.unitMeasure ?
112
+ this.unitMeasure.length <= 15 ?
113
+ this.unitMeasure :
114
+ this.unitMeasure.slice(0, 12) + "..." :
115
+ "",
106
116
  unitPrice: this.unitPrice !== undefined ? (0, standard_1.floatToString)(this.unitPrice) : "",
107
117
  };
108
118
  };
@@ -0,0 +1 @@
1
+ export { FinancialDocumentV1 } from "./financialDocumentV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialDocumentV1 = void 0;
4
+ var financialDocumentV1_1 = require("./financialDocumentV1");
5
+ Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
@@ -0,0 +1,2 @@
1
+ export { BankAccountDetailsV1 } from "./bankAccountDetailsV1";
2
+ export { BankAccountDetailsV2 } from "./bankAccountDetailsV2";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1 = void 0;
4
+ var bankAccountDetailsV1_1 = require("./bankAccountDetailsV1");
5
+ Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
6
+ var bankAccountDetailsV2_1 = require("./bankAccountDetailsV2");
7
+ Object.defineProperty(exports, "BankAccountDetailsV2", { enumerable: true, get: function () { return bankAccountDetailsV2_1.BankAccountDetailsV2; } });
@@ -1,5 +1,5 @@
1
1
  export { BankAccountDetailsV1 } from "./bankAccountDetailsV1";
2
2
  export { BankAccountDetailsV1Document } from "./bankAccountDetailsV1Document";
3
3
  export { BankAccountDetailsV2 } from "./bankAccountDetailsV2";
4
- export { BankAccountDetailsV2Document } from "./bankAccountDetailsV2Document";
5
4
  export { BankAccountDetailsV2Bban } from "./bankAccountDetailsV2Bban";
5
+ export { BankAccountDetailsV2Document } from "./bankAccountDetailsV2Document";
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BankAccountDetailsV2Bban = exports.BankAccountDetailsV2Document = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1Document = exports.BankAccountDetailsV1 = void 0;
3
+ exports.BankAccountDetailsV2Document = exports.BankAccountDetailsV2Bban = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1Document = exports.BankAccountDetailsV1 = void 0;
4
4
  var bankAccountDetailsV1_1 = require("./bankAccountDetailsV1");
5
5
  Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
6
6
  var bankAccountDetailsV1Document_1 = require("./bankAccountDetailsV1Document");
7
7
  Object.defineProperty(exports, "BankAccountDetailsV1Document", { enumerable: true, get: function () { return bankAccountDetailsV1Document_1.BankAccountDetailsV1Document; } });
8
8
  var bankAccountDetailsV2_1 = require("./bankAccountDetailsV2");
9
9
  Object.defineProperty(exports, "BankAccountDetailsV2", { enumerable: true, get: function () { return bankAccountDetailsV2_1.BankAccountDetailsV2; } });
10
- var bankAccountDetailsV2Document_1 = require("./bankAccountDetailsV2Document");
11
- Object.defineProperty(exports, "BankAccountDetailsV2Document", { enumerable: true, get: function () { return bankAccountDetailsV2Document_1.BankAccountDetailsV2Document; } });
12
10
  var bankAccountDetailsV2Bban_1 = require("./bankAccountDetailsV2Bban");
13
11
  Object.defineProperty(exports, "BankAccountDetailsV2Bban", { enumerable: true, get: function () { return bankAccountDetailsV2Bban_1.BankAccountDetailsV2Bban; } });
12
+ var bankAccountDetailsV2Document_1 = require("./bankAccountDetailsV2Document");
13
+ Object.defineProperty(exports, "BankAccountDetailsV2Document", { enumerable: true, get: function () { return bankAccountDetailsV2Document_1.BankAccountDetailsV2Document; } });
@@ -0,0 +1 @@
1
+ export { CarteGriseV1 } from "./carteGriseV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteGriseV1 = void 0;
4
+ var carteGriseV1_1 = require("./carteGriseV1");
5
+ Object.defineProperty(exports, "CarteGriseV1", { enumerable: true, get: function () { return carteGriseV1_1.CarteGriseV1; } });
@@ -0,0 +1 @@
1
+ export { CarteVitaleV1 } from "./carteVitaleV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteVitaleV1 = void 0;
4
+ var carteVitaleV1_1 = require("./carteVitaleV1");
5
+ Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
@@ -0,0 +1,2 @@
1
+ export { IdCardV1 } from "./idCardV1";
2
+ export { IdCardV2 } from "./idCardV2";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdCardV2 = exports.IdCardV1 = void 0;
4
+ var idCardV1_1 = require("./idCardV1");
5
+ Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
6
+ var idCardV2_1 = require("./idCardV2");
7
+ Object.defineProperty(exports, "IdCardV2", { enumerable: true, get: function () { return idCardV2_1.IdCardV2; } });
@@ -1,4 +1,6 @@
1
1
  export { IdCardV1 } from "./idCardV1";
2
- export { IdCardV2 } from "./idCardV2";
3
2
  export { IdCardV1Document } from "./idCardV1Document";
4
3
  export { IdCardV1Page } from "./idCardV1Page";
4
+ export { IdCardV2 } from "./idCardV2";
5
+ export { IdCardV2Document } from "./idCardV2Document";
6
+ export { IdCardV2Page } from "./idCardV2Page";