mindee 3.10.2 → 4.0.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 (265) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +103 -41
  3. package/package.json +4 -5
  4. package/src/cli.js +96 -70
  5. package/src/client.d.ts +34 -65
  6. package/src/client.js +108 -172
  7. package/src/geometry/boundingBox.d.ts +5 -0
  8. package/src/geometry/boundingBox.js +2 -0
  9. package/src/geometry/boundingBoxUtils.d.ts +22 -0
  10. package/src/geometry/boundingBoxUtils.js +66 -0
  11. package/src/geometry/index.d.ts +6 -0
  12. package/src/geometry/index.js +21 -0
  13. package/src/geometry/minMax.d.ts +4 -0
  14. package/src/geometry/minMax.js +2 -0
  15. package/src/geometry/point.d.ts +2 -0
  16. package/src/geometry/point.js +2 -0
  17. package/src/geometry/polygon.d.ts +4 -0
  18. package/src/geometry/polygon.js +7 -0
  19. package/src/{geometry.d.ts → geometry/polygonUtils.d.ts} +7 -32
  20. package/src/{geometry.js → geometry/polygonUtils.js} +41 -64
  21. package/src/http/endpoint.d.ts +44 -0
  22. package/src/http/endpoint.js +188 -0
  23. package/src/http/error.d.ts +2 -0
  24. package/src/http/error.js +9 -0
  25. package/src/http/index.d.ts +3 -0
  26. package/src/http/index.js +11 -0
  27. package/src/http/mindeeApi.d.ts +20 -0
  28. package/src/http/mindeeApi.js +73 -0
  29. package/src/index.d.ts +4 -4
  30. package/src/index.js +33 -26
  31. package/src/{inputs → input}/base.d.ts +4 -3
  32. package/src/{inputs → input}/base.js +9 -7
  33. package/src/{inputs → input}/index.d.ts +1 -1
  34. package/src/{inputs → input}/index.js +1 -2
  35. package/src/{inputs → input}/sources.d.ts +10 -11
  36. package/src/{inputs → input}/sources.js +9 -9
  37. package/src/parsing/common/apiRequest.d.ts +10 -0
  38. package/src/parsing/common/apiRequest.js +13 -0
  39. package/src/parsing/common/apiResponse.d.ts +6 -0
  40. package/src/parsing/common/apiResponse.js +10 -0
  41. package/src/parsing/common/asyncPredictResponse.d.ts +21 -0
  42. package/src/parsing/common/asyncPredictResponse.js +39 -0
  43. package/src/parsing/common/document.d.ts +13 -0
  44. package/src/parsing/common/document.js +34 -0
  45. package/src/parsing/common/extras/cropperExtra.d.ts +8 -0
  46. package/src/parsing/common/extras/cropperExtra.js +26 -0
  47. package/src/parsing/common/extras/extras.d.ts +11 -0
  48. package/src/parsing/common/extras/extras.js +18 -0
  49. package/src/parsing/common/index.d.ts +9 -0
  50. package/src/parsing/common/index.js +20 -0
  51. package/src/parsing/common/inference.d.ts +26 -0
  52. package/src/parsing/common/inference.js +56 -0
  53. package/src/parsing/common/mvisionV1.d.ts +8 -0
  54. package/src/parsing/common/mvisionV1.js +17 -0
  55. package/src/parsing/common/ocr.d.ts +8 -0
  56. package/src/parsing/common/ocr.js +13 -0
  57. package/src/parsing/common/ocrPage.d.ts +16 -0
  58. package/src/parsing/common/ocrPage.js +66 -0
  59. package/src/{fields → parsing/common}/orientation.d.ts +2 -2
  60. package/src/{fields → parsing/common}/orientation.js +4 -4
  61. package/src/parsing/common/page.d.ts +12 -0
  62. package/src/parsing/common/page.js +40 -0
  63. package/src/parsing/common/predictResponse.d.ts +6 -0
  64. package/src/parsing/common/predictResponse.js +12 -0
  65. package/src/parsing/common/prediction.d.ts +2 -0
  66. package/src/parsing/common/prediction.js +6 -0
  67. package/src/parsing/common/product.d.ts +4 -0
  68. package/src/parsing/common/product.js +2 -0
  69. package/src/parsing/common/stringDict.d.ts +3 -0
  70. package/src/parsing/common/stringDict.js +2 -0
  71. package/src/parsing/common/summaryHelper.d.ts +8 -0
  72. package/src/parsing/common/summaryHelper.js +22 -0
  73. package/src/parsing/custom/classificationField.d.ts +16 -0
  74. package/src/parsing/custom/classificationField.js +14 -0
  75. package/src/parsing/custom/index.d.ts +3 -0
  76. package/src/parsing/custom/index.js +12 -0
  77. package/src/{documents/custom/lineitems.d.ts → parsing/custom/lineItems.d.ts} +4 -4
  78. package/src/{documents/custom/lineitems.js → parsing/custom/lineItems.js} +11 -9
  79. package/src/{documents/custom/fields.d.ts → parsing/custom/listField.d.ts} +3 -16
  80. package/src/{documents/custom/fields.js → parsing/custom/listField.js} +4 -14
  81. package/src/parsing/index.d.ts +3 -0
  82. package/src/parsing/index.js +29 -0
  83. package/src/{fields → parsing/standard}/amount.d.ts +2 -2
  84. package/src/{fields → parsing/standard}/amount.js +5 -5
  85. package/src/{fields → parsing/standard}/base.d.ts +5 -5
  86. package/src/{fields → parsing/standard}/base.js +3 -2
  87. package/src/{fields → parsing/standard}/classification.d.ts +1 -1
  88. package/src/{fields → parsing/standard}/classification.js +3 -3
  89. package/src/{fields → parsing/standard}/companyRegistration.d.ts +1 -1
  90. package/src/parsing/standard/companyRegistration.js +14 -0
  91. package/src/{fields → parsing/standard}/date.d.ts +1 -1
  92. package/src/{fields → parsing/standard}/date.js +2 -2
  93. package/src/{fields → parsing/standard}/field.d.ts +3 -4
  94. package/src/{fields → parsing/standard}/field.js +6 -7
  95. package/src/parsing/standard/index.d.ts +12 -0
  96. package/src/parsing/standard/index.js +27 -0
  97. package/src/{fields → parsing/standard}/locale.d.ts +4 -4
  98. package/src/parsing/standard/locale.js +42 -0
  99. package/src/{fields → parsing/standard}/paymentDetails.d.ts +3 -3
  100. package/src/{fields → parsing/standard}/paymentDetails.js +11 -11
  101. package/src/{fields → parsing/standard}/position.d.ts +2 -2
  102. package/src/{fields → parsing/standard}/position.js +5 -5
  103. package/src/{fields → parsing/standard}/tax.d.ts +3 -3
  104. package/src/{fields → parsing/standard}/tax.js +3 -3
  105. package/src/{fields → parsing/standard}/text.d.ts +2 -2
  106. package/src/{fields → parsing/standard}/text.js +4 -4
  107. package/src/parsing/standard/word.d.ts +10 -0
  108. package/src/parsing/standard/word.js +2 -0
  109. package/src/pdf/pdfOperation.d.ts +1 -1
  110. package/src/pdf/pdfOperation.js +3 -3
  111. package/src/product/cropper/cropperV1.d.ts +9 -0
  112. package/src/product/cropper/cropperV1.js +16 -0
  113. package/src/product/cropper/cropperV1Document.d.ts +8 -0
  114. package/src/product/cropper/cropperV1Document.js +26 -0
  115. package/src/product/custom/customV1.d.ts +10 -0
  116. package/src/product/custom/customV1.js +17 -0
  117. package/src/product/custom/customV1Document.d.ts +9 -0
  118. package/src/product/custom/customV1Document.js +43 -0
  119. package/src/product/custom/customV1Page.d.ts +7 -0
  120. package/src/product/custom/customV1Page.js +24 -0
  121. package/src/product/eu/licensePlate/licensePlateV1.d.ts +9 -0
  122. package/src/product/eu/licensePlate/licensePlateV1.js +16 -0
  123. package/src/product/eu/licensePlate/licensePlateV1Document.d.ts +11 -0
  124. package/src/product/eu/licensePlate/licensePlateV1Document.js +25 -0
  125. package/src/product/financialDocument/financialDocumentV1.d.ts +9 -0
  126. package/src/product/financialDocument/financialDocumentV1.js +16 -0
  127. package/src/{documents/financialDocument/financialDocumentV1.d.ts → product/financialDocument/financialDocumentV1Document.d.ts} +43 -44
  128. package/src/product/financialDocument/financialDocumentV1Document.js +158 -0
  129. package/src/{documents → product}/financialDocument/financialDocumentV1LineItem.d.ts +8 -8
  130. package/src/{documents → product}/financialDocument/financialDocumentV1LineItem.js +35 -34
  131. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +9 -0
  132. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +16 -0
  133. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +15 -0
  134. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +31 -0
  135. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +9 -0
  136. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +16 -0
  137. package/src/{documents → product}/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +5 -5
  138. package/src/{documents → product}/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +1 -1
  139. package/src/{documents/fr/bankAccountDetails/bankAccountDetailsV2.d.ts → product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts} +7 -7
  140. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +37 -0
  141. package/src/product/fr/carteVitale/carteVitaleV1.d.ts +9 -0
  142. package/src/product/fr/carteVitale/carteVitaleV1.js +16 -0
  143. package/src/product/fr/carteVitale/carteVitaleV1Document.d.ts +17 -0
  144. package/src/product/fr/carteVitale/carteVitaleV1Document.js +40 -0
  145. package/src/product/fr/idCard/idCardV1.d.ts +10 -0
  146. package/src/product/fr/idCard/idCardV1.js +17 -0
  147. package/src/product/fr/idCard/idCardV1Document.d.ts +29 -0
  148. package/src/product/fr/idCard/idCardV1Document.js +70 -0
  149. package/src/product/fr/idCard/idCardV1Page.d.ts +12 -0
  150. package/src/product/fr/idCard/idCardV1Page.js +23 -0
  151. package/src/{documents → product}/index.d.ts +2 -7
  152. package/src/{documents → product}/index.js +3 -14
  153. package/src/product/invoice/invoiceV4.d.ts +9 -0
  154. package/src/product/invoice/invoiceV4.js +16 -0
  155. package/src/product/invoice/invoiceV4Document.d.ts +44 -0
  156. package/src/product/invoice/invoiceV4Document.js +146 -0
  157. package/src/{documents/invoice/invoiceLineItem.d.ts → product/invoice/invoiceV4LineItem.d.ts} +10 -8
  158. package/src/product/invoice/invoiceV4LineItem.js +101 -0
  159. package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +9 -0
  160. package/src/product/invoiceSplitter/invoiceSplitterV1.js +16 -0
  161. package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +8 -0
  162. package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +23 -0
  163. package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +7 -0
  164. package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.js +14 -0
  165. package/src/product/passport/passportV1.d.ts +9 -0
  166. package/src/product/passport/passportV1.js +16 -0
  167. package/src/product/passport/passportV1Document.d.ts +31 -0
  168. package/src/product/passport/passportV1Document.js +75 -0
  169. package/src/product/proofOfAddress/proofOfAddressV1.d.ts +9 -0
  170. package/src/product/proofOfAddress/proofOfAddressV1.js +16 -0
  171. package/src/product/proofOfAddress/proofOfAddressV1Document.d.ts +27 -0
  172. package/src/product/proofOfAddress/proofOfAddressV1Document.js +72 -0
  173. package/src/product/receipt/receiptV4.d.ts +9 -0
  174. package/src/product/receipt/receiptV4.js +15 -0
  175. package/src/{documents/receipt/receiptV4.d.ts → product/receipt/receiptV4Document.d.ts} +12 -12
  176. package/src/product/receipt/receiptV4Document.js +67 -0
  177. package/src/product/receipt/receiptV5.d.ts +9 -0
  178. package/src/product/receipt/receiptV5.js +16 -0
  179. package/src/{documents/receipt/receiptV5.d.ts → product/receipt/receiptV5Document.d.ts} +16 -17
  180. package/src/product/receipt/receiptV5Document.js +108 -0
  181. package/src/{documents → product}/receipt/receiptV5LineItem.d.ts +5 -5
  182. package/src/{documents → product}/receipt/receiptV5LineItem.js +20 -19
  183. package/src/product/us/bankCheck/bankCheckV1.d.ts +10 -0
  184. package/src/product/us/bankCheck/bankCheckV1.js +17 -0
  185. package/src/product/us/bankCheck/bankCheckV1Document.d.ts +21 -0
  186. package/src/product/us/bankCheck/bankCheckV1Document.js +50 -0
  187. package/src/product/us/bankCheck/bankCheckV1Page.d.ts +14 -0
  188. package/src/product/us/bankCheck/bankCheckV1Page.js +32 -0
  189. package/src/product/us/driverLicense/driverLicenseV1.d.ts +10 -0
  190. package/src/product/us/driverLicense/driverLicenseV1.js +17 -0
  191. package/src/product/us/driverLicense/driverLicenseV1Document.d.ts +43 -0
  192. package/src/product/us/driverLicense/driverLicenseV1Document.js +101 -0
  193. package/src/product/us/driverLicense/driverLicenseV1Page.d.ts +14 -0
  194. package/src/product/us/driverLicense/driverLicenseV1Page.js +29 -0
  195. package/src/product/us/index.d.ts +2 -0
  196. package/src/product/us/index.js +7 -0
  197. package/src/api/documentResponse.d.ts +0 -25
  198. package/src/api/documentResponse.js +0 -50
  199. package/src/api/endpoint.d.ts +0 -63
  200. package/src/api/endpoint.js +0 -216
  201. package/src/api/index.d.ts +0 -3
  202. package/src/api/index.js +0 -13
  203. package/src/api/predictResponse.d.ts +0 -33
  204. package/src/api/predictResponse.js +0 -52
  205. package/src/documents/cropper/cropperV1.d.ts +0 -7
  206. package/src/documents/cropper/cropperV1.js +0 -35
  207. package/src/documents/custom/customV1.d.ts +0 -10
  208. package/src/documents/custom/customV1.js +0 -53
  209. package/src/documents/document.d.ts +0 -47
  210. package/src/documents/document.js +0 -76
  211. package/src/documents/documentConfig.d.ts +0 -42
  212. package/src/documents/documentConfig.js +0 -118
  213. package/src/documents/eu/licensePlate/licensePlateV1.d.ts +0 -8
  214. package/src/documents/eu/licensePlate/licensePlateV1.js +0 -32
  215. package/src/documents/financialDocument/financialDocumentV0.d.ts +0 -28
  216. package/src/documents/financialDocument/financialDocumentV0.js +0 -140
  217. package/src/documents/financialDocument/financialDocumentV1.js +0 -197
  218. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +0 -13
  219. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.js +0 -39
  220. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2.js +0 -48
  221. package/src/documents/fr/carteVitale/carteVitaleV1.d.ts +0 -14
  222. package/src/documents/fr/carteVitale/carteVitaleV1.js +0 -45
  223. package/src/documents/fr/idCard/idCardV1.d.ts +0 -28
  224. package/src/documents/fr/idCard/idCardV1.js +0 -79
  225. package/src/documents/invoice/checks.d.ts +0 -5
  226. package/src/documents/invoice/checks.js +0 -87
  227. package/src/documents/invoice/invoiceLineItem.js +0 -66
  228. package/src/documents/invoice/invoiceV3.d.ts +0 -49
  229. package/src/documents/invoice/invoiceV3.js +0 -156
  230. package/src/documents/invoice/invoiceV4.d.ts +0 -45
  231. package/src/documents/invoice/invoiceV4.js +0 -166
  232. package/src/documents/invoice/reconstruction.d.ts +0 -6
  233. package/src/documents/invoice/reconstruction.js +0 -78
  234. package/src/documents/invoiceSplitter/invoiceSplitterV1.d.ts +0 -14
  235. package/src/documents/invoiceSplitter/invoiceSplitterV1.js +0 -47
  236. package/src/documents/mindeeVision/mindeeVisionV1.d.ts +0 -8
  237. package/src/documents/mindeeVision/mindeeVisionV1.js +0 -29
  238. package/src/documents/passport/passportV1.d.ts +0 -43
  239. package/src/documents/passport/passportV1.js +0 -220
  240. package/src/documents/proofOfAddress/proofOfAddressV1.d.ts +0 -24
  241. package/src/documents/proofOfAddress/proofOfAddressV1.js +0 -77
  242. package/src/documents/receipt/receiptV3.d.ts +0 -25
  243. package/src/documents/receipt/receiptV3.js +0 -136
  244. package/src/documents/receipt/receiptV4.js +0 -78
  245. package/src/documents/receipt/receiptV5.js +0 -137
  246. package/src/documents/us/bankCheck/bankCheckV1.d.ts +0 -22
  247. package/src/documents/us/bankCheck/bankCheckV1.js +0 -63
  248. package/src/documents/us/index.d.ts +0 -1
  249. package/src/documents/us/index.js +0 -5
  250. package/src/fields/companyRegistration.js +0 -14
  251. package/src/fields/fullText.d.ts +0 -27
  252. package/src/fields/fullText.js +0 -92
  253. package/src/fields/index.d.ts +0 -12
  254. package/src/fields/index.js +0 -28
  255. package/src/fields/locale.js +0 -45
  256. package/src/math/index.d.ts +0 -1
  257. package/src/math/index.js +0 -5
  258. package/src/math/precision.d.ts +0 -1
  259. package/src/math/precision.js +0 -13
  260. /package/src/{inputs → input}/pageOptions.d.ts +0 -0
  261. /package/src/{inputs → input}/pageOptions.js +0 -0
  262. /package/src/{documents → product}/eu/index.d.ts +0 -0
  263. /package/src/{documents → product}/eu/index.js +0 -0
  264. /package/src/{documents → product}/fr/index.d.ts +0 -0
  265. /package/src/{documents → product}/fr/index.js +0 -0
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../../parsing/common";
2
+ import { LicensePlateV1Document } from "./licensePlateV1Document";
3
+ export declare class LicensePlateV1 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: LicensePlateV1Document;
7
+ pages: Page<LicensePlateV1Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LicensePlateV1 = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const licensePlateV1Document_1 = require("./licensePlateV1Document");
6
+ class LicensePlateV1 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "license_plates";
10
+ this.endpointVersion = "1";
11
+ this.pages = [];
12
+ this.prediction = new licensePlateV1Document_1.LicensePlateV1Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(licensePlateV1Document_1.LicensePlateV1Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.LicensePlateV1 = LicensePlateV1;
@@ -0,0 +1,11 @@
1
+ import { Prediction, StringDict } from "../../../parsing/common";
2
+ import { StringField } from "../../../parsing/standard";
3
+ /**
4
+ * Document data for License Plate, API version 1.
5
+ */
6
+ export declare class LicensePlateV1Document implements Prediction {
7
+ /** List of all license plates found in the image. */
8
+ licensePlates: StringField[];
9
+ constructor(rawPrediction: StringDict, pageId?: number);
10
+ toString(): string;
11
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LicensePlateV1Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ /**
7
+ * Document data for License Plate, API version 1.
8
+ */
9
+ class LicensePlateV1Document {
10
+ constructor(rawPrediction, pageId) {
11
+ /** List of all license plates found in the image. */
12
+ this.licensePlates = [];
13
+ rawPrediction["license_plates"] &&
14
+ rawPrediction["license_plates"].map((itemPrediction) => this.licensePlates.push(new standard_1.StringField({
15
+ prediction: itemPrediction,
16
+ pageId: pageId,
17
+ })));
18
+ }
19
+ toString() {
20
+ const licensePlates = this.licensePlates.join("\n ");
21
+ const outStr = `:License Plates: ${licensePlates}`.trimEnd();
22
+ return (0, common_1.cleanOutString)(outStr);
23
+ }
24
+ }
25
+ exports.LicensePlateV1Document = LicensePlateV1Document;
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../parsing/common";
2
+ import { FinancialDocumentV1Document } from "./financialDocumentV1Document";
3
+ export declare class FinancialDocumentV1 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: FinancialDocumentV1Document;
7
+ pages: Page<FinancialDocumentV1Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialDocumentV1 = void 0;
4
+ const common_1 = require("../../parsing/common");
5
+ const financialDocumentV1Document_1 = require("./financialDocumentV1Document");
6
+ class FinancialDocumentV1 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "financial_document";
10
+ this.endpointVersion = "1";
11
+ this.pages = [];
12
+ this.prediction = new financialDocumentV1Document_1.FinancialDocumentV1Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(financialDocumentV1Document_1.FinancialDocumentV1Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.FinancialDocumentV1 = FinancialDocumentV1;
@@ -1,57 +1,56 @@
1
- import { Document, DocumentConstructorProps } from "../document";
2
- import { Amount, ClassificationField, CompanyRegistration, DateField, Locale, PaymentDetails, TaxField, TextField } from "../../fields";
1
+ import { Prediction, StringDict } from "../../parsing/common";
3
2
  import { FinancialDocumentV1LineItem } from "./financialDocumentV1LineItem";
3
+ import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
4
4
  /**
5
5
  * Document data for Financial Document, API version 1.
6
6
  */
7
- export declare class FinancialDocumentV1 extends Document {
8
- #private;
9
- /** The locale detected on the document. */
10
- locale: Locale;
11
- /** The invoice number or identifier. */
12
- invoiceNumber: TextField;
13
- /** List of Reference numbers, including PO number. */
14
- referenceNumbers: TextField[];
7
+ export declare class FinancialDocumentV1Document implements Prediction {
8
+ /** The purchase category among predefined classes. */
9
+ category: ClassificationField;
10
+ /** The address of the customer. */
11
+ customerAddress: StringField;
12
+ /** List of company registrations associated to the customer. */
13
+ customerCompanyRegistrations: CompanyRegistrationField[];
14
+ /** The name of the customer. */
15
+ customerName: StringField;
15
16
  /** The date the purchase was made. */
16
17
  date: DateField;
17
- /** The date on which the payment is due. */
18
- dueDate: DateField;
19
- /** The net amount paid: does not include taxes, fees, and discounts. */
20
- totalNet: Amount;
21
- /** The total amount paid: includes taxes, tips, fees, and other charges. */
22
- totalAmount: Amount;
23
- /** List of tax lines information. */
24
- taxes: TaxField[];
25
- /** List of payment details associated to the supplier. */
26
- supplierPaymentDetails: PaymentDetails[];
27
- /** The name of the supplier or merchant. */
28
- supplierName: TextField;
29
- /** List of company registrations associated to the supplier. */
30
- supplierCompanyRegistrations: CompanyRegistration[];
31
- /** The address of the supplier or merchant. */
32
- supplierAddress: TextField;
33
- /** The phone number of the supplier or merchant. */
34
- supplierPhoneNumber: TextField;
35
- /** The name of the customer. */
36
- customerName: TextField;
37
- /** List of company registrations associated to the customer. */
38
- customerCompanyRegistrations: CompanyRegistration[];
39
- /** The address of the customer. */
40
- customerAddress: TextField;
41
18
  /** One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'. */
42
19
  documentType: ClassificationField;
20
+ /** The date on which the payment is due. */
21
+ dueDate: DateField;
22
+ /** The invoice number or identifier. */
23
+ invoiceNumber: StringField;
24
+ /** List of line item details. */
25
+ lineItems: FinancialDocumentV1LineItem[];
26
+ /** The locale detected on the document. */
27
+ locale: LocaleField;
28
+ /** List of Reference numbers, including PO number. */
29
+ referenceNumbers: StringField[];
43
30
  /** The purchase subcategory among predefined classes for transport and food. */
44
31
  subcategory: ClassificationField;
45
- /** The purchase category among predefined classes. */
46
- category: ClassificationField;
47
- /** The total amount of taxes. */
48
- totalTax: Amount;
49
- /** The total amount of tip and gratuity */
50
- tip: Amount;
32
+ /** The address of the supplier or merchant. */
33
+ supplierAddress: StringField;
34
+ /** List of company registrations associated to the supplier. */
35
+ supplierCompanyRegistrations: CompanyRegistrationField[];
36
+ /** The name of the supplier or merchant. */
37
+ supplierName: StringField;
38
+ /** List of payment details associated to the supplier. */
39
+ supplierPaymentDetails: PaymentDetailsField[];
40
+ /** The phone number of the supplier or merchant. */
41
+ supplierPhoneNumber: StringField;
42
+ /** List of tax lines information. */
43
+ taxes: Taxes;
51
44
  /** The time the purchase was made. */
52
- time: TextField;
53
- /** List of line item details. */
54
- lineItems: FinancialDocumentV1LineItem[];
55
- constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
45
+ time: StringField;
46
+ /** The total amount of tip and gratuity */
47
+ tip: AmountField;
48
+ /** The total amount paid: includes taxes, tips, fees, and other charges. */
49
+ totalAmount: AmountField;
50
+ /** The net amount paid: does not include taxes, fees, and discounts. */
51
+ totalNet: AmountField;
52
+ /** The total amount of taxes. */
53
+ totalTax: AmountField;
54
+ constructor(rawPrediction: StringDict, pageId?: number);
56
55
  toString(): string;
57
56
  }
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialDocumentV1Document = void 0;
4
+ const common_1 = require("../../parsing/common");
5
+ const financialDocumentV1LineItem_1 = require("./financialDocumentV1LineItem");
6
+ const standard_1 = require("../../parsing/standard");
7
+ /**
8
+ * Document data for Financial Document, API version 1.
9
+ */
10
+ class FinancialDocumentV1Document {
11
+ constructor(rawPrediction, pageId) {
12
+ /** List of company registrations associated to the customer. */
13
+ this.customerCompanyRegistrations = [];
14
+ /** List of line item details. */
15
+ this.lineItems = [];
16
+ /** List of Reference numbers, including PO number. */
17
+ this.referenceNumbers = [];
18
+ /** List of company registrations associated to the supplier. */
19
+ this.supplierCompanyRegistrations = [];
20
+ /** List of payment details associated to the supplier. */
21
+ this.supplierPaymentDetails = [];
22
+ this.category = new standard_1.ClassificationField({
23
+ prediction: rawPrediction["category"],
24
+ });
25
+ this.customerAddress = new standard_1.StringField({
26
+ prediction: rawPrediction["customer_address"],
27
+ pageId: pageId,
28
+ });
29
+ rawPrediction["customer_company_registrations"] &&
30
+ rawPrediction["customer_company_registrations"].map((itemPrediction) => this.customerCompanyRegistrations.push(new standard_1.CompanyRegistrationField({
31
+ prediction: itemPrediction,
32
+ pageId: pageId,
33
+ })));
34
+ this.customerName = new standard_1.StringField({
35
+ prediction: rawPrediction["customer_name"],
36
+ pageId: pageId,
37
+ });
38
+ this.date = new standard_1.DateField({
39
+ prediction: rawPrediction["date"],
40
+ pageId: pageId,
41
+ });
42
+ this.documentType = new standard_1.ClassificationField({
43
+ prediction: rawPrediction["document_type"],
44
+ });
45
+ this.dueDate = new standard_1.DateField({
46
+ prediction: rawPrediction["due_date"],
47
+ pageId: pageId,
48
+ });
49
+ this.invoiceNumber = new standard_1.StringField({
50
+ prediction: rawPrediction["invoice_number"],
51
+ pageId: pageId,
52
+ });
53
+ rawPrediction["line_items"] &&
54
+ rawPrediction["line_items"].map((itemPrediction) => this.lineItems.push(new financialDocumentV1LineItem_1.FinancialDocumentV1LineItem({
55
+ prediction: itemPrediction,
56
+ pageId: pageId,
57
+ })));
58
+ this.locale = new standard_1.LocaleField({
59
+ prediction: rawPrediction["locale"],
60
+ });
61
+ rawPrediction["reference_numbers"] &&
62
+ rawPrediction["reference_numbers"].map((itemPrediction) => this.referenceNumbers.push(new standard_1.StringField({
63
+ prediction: itemPrediction,
64
+ pageId: pageId,
65
+ })));
66
+ this.subcategory = new standard_1.ClassificationField({
67
+ prediction: rawPrediction["subcategory"],
68
+ });
69
+ this.supplierAddress = new standard_1.StringField({
70
+ prediction: rawPrediction["supplier_address"],
71
+ pageId: pageId,
72
+ });
73
+ rawPrediction["supplier_company_registrations"] &&
74
+ rawPrediction["supplier_company_registrations"].map((itemPrediction) => this.supplierCompanyRegistrations.push(new standard_1.CompanyRegistrationField({
75
+ prediction: itemPrediction,
76
+ pageId: pageId,
77
+ })));
78
+ this.supplierName = new standard_1.StringField({
79
+ prediction: rawPrediction["supplier_name"],
80
+ pageId: pageId,
81
+ });
82
+ rawPrediction["supplier_payment_details"] &&
83
+ rawPrediction["supplier_payment_details"].map((itemPrediction) => this.supplierPaymentDetails.push(new standard_1.PaymentDetailsField({
84
+ prediction: itemPrediction,
85
+ pageId: pageId,
86
+ })));
87
+ this.supplierPhoneNumber = new standard_1.StringField({
88
+ prediction: rawPrediction["supplier_phone_number"],
89
+ pageId: pageId,
90
+ });
91
+ this.taxes = new standard_1.Taxes().init(rawPrediction["taxes"], pageId);
92
+ this.time = new standard_1.StringField({
93
+ prediction: rawPrediction["time"],
94
+ pageId: pageId,
95
+ });
96
+ this.tip = new standard_1.AmountField({
97
+ prediction: rawPrediction["tip"],
98
+ pageId: pageId,
99
+ });
100
+ this.totalAmount = new standard_1.AmountField({
101
+ prediction: rawPrediction["total_amount"],
102
+ pageId: pageId,
103
+ });
104
+ this.totalNet = new standard_1.AmountField({
105
+ prediction: rawPrediction["total_net"],
106
+ pageId: pageId,
107
+ });
108
+ this.totalTax = new standard_1.AmountField({
109
+ prediction: rawPrediction["total_tax"],
110
+ pageId: pageId,
111
+ });
112
+ }
113
+ toString() {
114
+ const referenceNumbers = this.referenceNumbers.join("\n ");
115
+ const supplierPaymentDetails = this.supplierPaymentDetails.join("\n ");
116
+ const supplierCompanyRegistrations = this.supplierCompanyRegistrations.join("\n ");
117
+ const customerCompanyRegistrations = this.customerCompanyRegistrations.join("\n ");
118
+ let lineItemsSummary = "";
119
+ if (this.lineItems && this.lineItems.length > 0) {
120
+ const lineItemsColSizes = [38, 14, 10, 12, 14, 14, 12];
121
+ lineItemsSummary += "\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "-") + "\n ";
122
+ lineItemsSummary += "| Description ";
123
+ lineItemsSummary += "| Product code ";
124
+ lineItemsSummary += "| Quantity ";
125
+ lineItemsSummary += "| Tax Amount ";
126
+ lineItemsSummary += "| Tax Rate (%) ";
127
+ lineItemsSummary += "| Total Amount ";
128
+ lineItemsSummary += "| Unit Price ";
129
+ lineItemsSummary += "|\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "=");
130
+ lineItemsSummary += this.lineItems.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(lineItemsColSizes, "-")).join("");
131
+ }
132
+ const outStr = `:Locale: ${this.locale}
133
+ :Invoice Number: ${this.invoiceNumber}
134
+ :Reference Numbers: ${referenceNumbers}
135
+ :Purchase Date: ${this.date}
136
+ :Due Date: ${this.dueDate}
137
+ :Total Net: ${this.totalNet}
138
+ :Total Amount: ${this.totalAmount}
139
+ :Taxes: ${this.taxes}
140
+ :Supplier Payment Details: ${supplierPaymentDetails}
141
+ :Supplier name: ${this.supplierName}
142
+ :Supplier Company Registrations: ${supplierCompanyRegistrations}
143
+ :Supplier Address: ${this.supplierAddress}
144
+ :Supplier Phone Number: ${this.supplierPhoneNumber}
145
+ :Customer name: ${this.customerName}
146
+ :Customer Company Registrations: ${customerCompanyRegistrations}
147
+ :Customer Address: ${this.customerAddress}
148
+ :Document Type: ${this.documentType}
149
+ :Purchase Subcategory: ${this.subcategory}
150
+ :Purchase Category: ${this.category}
151
+ :Total Tax: ${this.totalTax}
152
+ :Tip and Gratuity: ${this.tip}
153
+ :Purchase Time: ${this.time}
154
+ :Line Items: ${lineItemsSummary}`.trimEnd();
155
+ return (0, common_1.cleanOutString)(outStr);
156
+ }
157
+ }
158
+ exports.FinancialDocumentV1Document = FinancialDocumentV1Document;
@@ -1,4 +1,4 @@
1
- import { StringDict } from "../../fields";
1
+ import { StringDict } from "../../parsing/common";
2
2
  import { Polygon } from "../../geometry";
3
3
  /**
4
4
  * List of line item details.
@@ -6,19 +6,19 @@ import { Polygon } from "../../geometry";
6
6
  export declare class FinancialDocumentV1LineItem {
7
7
  #private;
8
8
  /** The item description. */
9
- description: string | null;
9
+ description: string | undefined;
10
10
  /** The product code referring to the item. */
11
- productCode: string | null;
11
+ productCode: string | undefined;
12
12
  /** The item quantity */
13
- quantity: number | null;
13
+ quantity: number | undefined;
14
14
  /** The item tax amount. */
15
- taxAmount: number | null;
15
+ taxAmount: number | undefined;
16
16
  /** The item tax rate in percentage. */
17
- taxRate: number | null;
17
+ taxRate: number | undefined;
18
18
  /** The item total amount. */
19
- totalAmount: number | null;
19
+ totalAmount: number | undefined;
20
20
  /** The item unit price. */
21
- unitPrice: number | null;
21
+ unitPrice: number | undefined;
22
22
  /** Confidence score */
23
23
  confidence: number;
24
24
  /** The document page on which the information was found. */
@@ -7,12 +7,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
7
7
  var _FinancialDocumentV1LineItem_instances, _FinancialDocumentV1LineItem_printableValues;
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.FinancialDocumentV1LineItem = void 0;
10
- const amount_1 = require("../../fields/amount");
10
+ const standard_1 = require("../../parsing/standard");
11
11
  /**
12
12
  * List of line item details.
13
13
  */
14
14
  class FinancialDocumentV1LineItem {
15
- constructor({ prediction }) {
15
+ constructor({ prediction = {} }) {
16
16
  _FinancialDocumentV1LineItem_instances.add(this);
17
17
  /** Confidence score */
18
18
  this.confidence = 0.0;
@@ -23,25 +23,20 @@ class FinancialDocumentV1LineItem {
23
23
  this.polygon = [];
24
24
  this.description = prediction["description"];
25
25
  this.productCode = prediction["product_code"];
26
- this.quantity = +parseFloat(prediction["quantity"]).toFixed(3);
27
- if (isNaN(this.quantity)) {
28
- this.quantity = null;
26
+ if (prediction["quantity"] && !isNaN(prediction["quantity"])) {
27
+ this.quantity = +parseFloat(prediction["quantity"]).toFixed(3);
29
28
  }
30
- this.taxAmount = +parseFloat(prediction["tax_amount"]).toFixed(3);
31
- if (isNaN(this.taxAmount)) {
32
- this.taxAmount = null;
29
+ if (prediction["tax_amount"] && !isNaN(prediction["tax_amount"])) {
30
+ this.taxAmount = +parseFloat(prediction["tax_amount"]).toFixed(3);
33
31
  }
34
- this.taxRate = +parseFloat(prediction["tax_rate"]).toFixed(3);
35
- if (isNaN(this.taxRate)) {
36
- this.taxRate = null;
32
+ if (prediction["tax_rate"] && !isNaN(prediction["tax_rate"])) {
33
+ this.taxRate = +parseFloat(prediction["tax_rate"]).toFixed(3);
37
34
  }
38
- this.totalAmount = +parseFloat(prediction["total_amount"]).toFixed(3);
39
- if (isNaN(this.totalAmount)) {
40
- this.totalAmount = null;
35
+ if (prediction["total_amount"] && !isNaN(prediction["total_amount"])) {
36
+ this.totalAmount = +parseFloat(prediction["total_amount"]).toFixed(3);
41
37
  }
42
- this.unitPrice = +parseFloat(prediction["unit_price"]).toFixed(3);
43
- if (isNaN(this.unitPrice)) {
44
- this.unitPrice = null;
38
+ if (prediction["unit_price"] && !isNaN(prediction["unit_price"])) {
39
+ this.unitPrice = +parseFloat(prediction["unit_price"]).toFixed(3);
45
40
  }
46
41
  this.pageId = prediction["page_id"];
47
42
  this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
@@ -56,18 +51,18 @@ class FinancialDocumentV1LineItem {
56
51
  const printable = __classPrivateFieldGet(this, _FinancialDocumentV1LineItem_instances, "m", _FinancialDocumentV1LineItem_printableValues).call(this);
57
52
  return ("Description: " +
58
53
  printable.description +
59
- "Product code: " +
54
+ ", Product code: " +
60
55
  printable.productCode +
61
- "Quantity: " +
56
+ ", Quantity: " +
62
57
  printable.quantity +
63
- "Tax Amount: " +
58
+ ", Tax Amount: " +
64
59
  printable.taxAmount +
65
- "Tax Rate (%): " +
60
+ ", Tax Rate (%): " +
66
61
  printable.taxRate +
67
- "Total Amount: " +
62
+ ", Total Amount: " +
68
63
  printable.totalAmount +
69
- "Unit Price: " +
70
- printable.unitPrice).trim();
64
+ ", Unit Price: " +
65
+ printable.unitPrice);
71
66
  }
72
67
  /**
73
68
  * Output in a format suitable for inclusion in an rST table.
@@ -75,9 +70,7 @@ class FinancialDocumentV1LineItem {
75
70
  toTableLine() {
76
71
  const printable = __classPrivateFieldGet(this, _FinancialDocumentV1LineItem_instances, "m", _FinancialDocumentV1LineItem_printableValues).call(this);
77
72
  return ("| " +
78
- (printable.description.length > 33
79
- ? printable.description.substring(0, 33) + "..."
80
- : printable.description).padEnd(36) +
73
+ printable.description.padEnd(36) +
81
74
  " | " +
82
75
  printable.productCode.padEnd(12) +
83
76
  " | " +
@@ -96,12 +89,20 @@ class FinancialDocumentV1LineItem {
96
89
  exports.FinancialDocumentV1LineItem = FinancialDocumentV1LineItem;
97
90
  _FinancialDocumentV1LineItem_instances = new WeakSet(), _FinancialDocumentV1LineItem_printableValues = function _FinancialDocumentV1LineItem_printableValues() {
98
91
  return {
99
- description: this.description ?? "",
100
- productCode: this.productCode ?? "",
101
- quantity: this.quantity !== null ? (0, amount_1.floatToString)(this.quantity) : "",
102
- taxAmount: this.taxAmount !== null ? (0, amount_1.floatToString)(this.taxAmount) : "",
103
- taxRate: this.taxRate !== null ? (0, amount_1.floatToString)(this.taxRate) : "",
104
- totalAmount: this.totalAmount !== null ? (0, amount_1.floatToString)(this.totalAmount) : "",
105
- unitPrice: this.unitPrice !== null ? (0, amount_1.floatToString)(this.unitPrice) : "",
92
+ description: this.description ?
93
+ this.description.length <= 36 ?
94
+ this.description :
95
+ this.description.slice(0, 33) + "..." :
96
+ "",
97
+ productCode: this.productCode ?
98
+ this.productCode.length <= 12 ?
99
+ this.productCode :
100
+ this.productCode.slice(0, 9) + "..." :
101
+ "",
102
+ quantity: this.quantity !== undefined ? (0, standard_1.floatToString)(this.quantity) : "",
103
+ taxAmount: this.taxAmount !== undefined ? (0, standard_1.floatToString)(this.taxAmount) : "",
104
+ taxRate: this.taxRate !== undefined ? (0, standard_1.floatToString)(this.taxRate) : "",
105
+ totalAmount: this.totalAmount !== undefined ? (0, standard_1.floatToString)(this.totalAmount) : "",
106
+ unitPrice: this.unitPrice !== undefined ? (0, standard_1.floatToString)(this.unitPrice) : "",
106
107
  };
107
108
  };
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../../parsing/common";
2
+ import { BankAccountDetailsV1Document } from "./bankAccountDetailsV1Document";
3
+ export declare class BankAccountDetailsV1 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: BankAccountDetailsV1Document;
7
+ pages: Page<BankAccountDetailsV1Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountDetailsV1 = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const bankAccountDetailsV1Document_1 = require("./bankAccountDetailsV1Document");
6
+ class BankAccountDetailsV1 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "bank_account_details";
10
+ this.endpointVersion = "1";
11
+ this.pages = [];
12
+ this.prediction = new bankAccountDetailsV1Document_1.BankAccountDetailsV1Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV1Document_1.BankAccountDetailsV1Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.BankAccountDetailsV1 = BankAccountDetailsV1;
@@ -0,0 +1,15 @@
1
+ import { Prediction, StringDict } from "../../../parsing/common";
2
+ import { StringField } from "../../../parsing/standard";
3
+ /**
4
+ * Document data for Bank Account Details, API version 1.
5
+ */
6
+ export declare class BankAccountDetailsV1Document implements Prediction {
7
+ /** The name of the account holder as seen on the document. */
8
+ accountHolderName: StringField;
9
+ /** The International Bank Account Number (IBAN). */
10
+ iban: StringField;
11
+ /** The bank's SWIFT Business Identifier Code (BIC). */
12
+ swift: StringField;
13
+ constructor(rawPrediction: StringDict, pageId?: number);
14
+ toString(): string;
15
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountDetailsV1Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ /**
7
+ * Document data for Bank Account Details, API version 1.
8
+ */
9
+ class BankAccountDetailsV1Document {
10
+ constructor(rawPrediction, pageId) {
11
+ this.accountHolderName = new standard_1.StringField({
12
+ prediction: rawPrediction["account_holder_name"],
13
+ pageId: pageId,
14
+ });
15
+ this.iban = new standard_1.StringField({
16
+ prediction: rawPrediction["iban"],
17
+ pageId: pageId,
18
+ });
19
+ this.swift = new standard_1.StringField({
20
+ prediction: rawPrediction["swift"],
21
+ pageId: pageId,
22
+ });
23
+ }
24
+ toString() {
25
+ const outStr = `:IBAN: ${this.iban}
26
+ :Account Holder's Name: ${this.accountHolderName}
27
+ :SWIFT Code: ${this.swift}`.trimEnd();
28
+ return (0, common_1.cleanOutString)(outStr);
29
+ }
30
+ }
31
+ exports.BankAccountDetailsV1Document = BankAccountDetailsV1Document;
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../../parsing/common";
2
+ import { BankAccountDetailsV2Document } from "./bankAccountDetailsV2Document";
3
+ export declare class BankAccountDetailsV2 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: BankAccountDetailsV2Document;
7
+ pages: Page<BankAccountDetailsV2Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountDetailsV2 = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const bankAccountDetailsV2Document_1 = require("./bankAccountDetailsV2Document");
6
+ class BankAccountDetailsV2 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "bank_account_details";
10
+ this.endpointVersion = "2";
11
+ this.pages = [];
12
+ this.prediction = new bankAccountDetailsV2Document_1.BankAccountDetailsV2Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV2Document_1.BankAccountDetailsV2Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.BankAccountDetailsV2 = BankAccountDetailsV2;
@@ -1,4 +1,4 @@
1
- import { StringDict } from "../../../fields";
1
+ import { StringDict } from "../../../parsing/common";
2
2
  import { Polygon } from "../../../geometry";
3
3
  /**
4
4
  * Full extraction of BBAN, including: branch code, bank code, account and key.
@@ -6,13 +6,13 @@ import { Polygon } from "../../../geometry";
6
6
  export declare class BankAccountDetailsV2Bban {
7
7
  #private;
8
8
  /** The BBAN bank code outputted as a string. */
9
- bbanBankCode: string | null;
9
+ bbanBankCode: string | undefined;
10
10
  /** The BBAN branch code outputted as a string. */
11
- bbanBranchCode: string | null;
11
+ bbanBranchCode: string | undefined;
12
12
  /** The BBAN key outputted as a string. */
13
- bbanKey: string | null;
13
+ bbanKey: string | undefined;
14
14
  /** The BBAN Account number outputted as a string. */
15
- bbanNumber: string | null;
15
+ bbanNumber: string | undefined;
16
16
  /** Confidence score */
17
17
  confidence: number;
18
18
  /** The document page on which the information was found. */
@@ -11,7 +11,7 @@ exports.BankAccountDetailsV2Bban = void 0;
11
11
  * Full extraction of BBAN, including: branch code, bank code, account and key.
12
12
  */
13
13
  class BankAccountDetailsV2Bban {
14
- constructor({ prediction }) {
14
+ constructor({ prediction = {} }) {
15
15
  _BankAccountDetailsV2Bban_instances.add(this);
16
16
  /** Confidence score */
17
17
  this.confidence = 0.0;