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
@@ -1,18 +1,18 @@
1
- import { Document, DocumentConstructorProps } from "../../document";
2
- import { TextField } from "../../../fields";
1
+ import { Prediction, StringDict } from "../../../parsing/common";
3
2
  import { BankAccountDetailsV2Bban } from "./bankAccountDetailsV2Bban";
3
+ import { StringField } from "../../../parsing/standard";
4
4
  /**
5
5
  * Document data for Bank Account Details, API version 2.
6
6
  */
7
- export declare class BankAccountDetailsV2 extends Document {
7
+ export declare class BankAccountDetailsV2Document implements Prediction {
8
8
  /** Full extraction of the account holders names. */
9
- accountHoldersNames: TextField;
9
+ accountHoldersNames: StringField;
10
10
  /** Full extraction of BBAN, including: branch code, bank code, account and key. */
11
11
  bban: BankAccountDetailsV2Bban;
12
12
  /** Full extraction of the IBAN number. */
13
- iban: TextField;
13
+ iban: StringField;
14
14
  /** Full extraction of the SWIFT code. */
15
- swiftCode: TextField;
16
- constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
15
+ swiftCode: StringField;
16
+ constructor(rawPrediction: StringDict, pageId?: number);
17
17
  toString(): string;
18
18
  }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountDetailsV2Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const bankAccountDetailsV2Bban_1 = require("./bankAccountDetailsV2Bban");
6
+ const standard_1 = require("../../../parsing/standard");
7
+ /**
8
+ * Document data for Bank Account Details, API version 2.
9
+ */
10
+ class BankAccountDetailsV2Document {
11
+ constructor(rawPrediction, pageId) {
12
+ this.accountHoldersNames = new standard_1.StringField({
13
+ prediction: rawPrediction["account_holders_names"],
14
+ pageId: pageId,
15
+ });
16
+ this.bban = new bankAccountDetailsV2Bban_1.BankAccountDetailsV2Bban({
17
+ prediction: rawPrediction["bban"],
18
+ pageId: pageId,
19
+ });
20
+ this.iban = new standard_1.StringField({
21
+ prediction: rawPrediction["iban"],
22
+ pageId: pageId,
23
+ });
24
+ this.swiftCode = new standard_1.StringField({
25
+ prediction: rawPrediction["swift_code"],
26
+ pageId: pageId,
27
+ });
28
+ }
29
+ toString() {
30
+ const outStr = `:Account Holder's Names: ${this.accountHoldersNames}
31
+ :Basic Bank Account Number: ${this.bban.toFieldList()}
32
+ :IBAN: ${this.iban}
33
+ :SWIFT Code: ${this.swiftCode}`.trimEnd();
34
+ return (0, common_1.cleanOutString)(outStr);
35
+ }
36
+ }
37
+ exports.BankAccountDetailsV2Document = BankAccountDetailsV2Document;
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../../parsing/common";
2
+ import { CarteVitaleV1Document } from "./carteVitaleV1Document";
3
+ export declare class CarteVitaleV1 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: CarteVitaleV1Document;
7
+ pages: Page<CarteVitaleV1Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteVitaleV1 = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const carteVitaleV1Document_1 = require("./carteVitaleV1Document");
6
+ class CarteVitaleV1 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "carte_vitale";
10
+ this.endpointVersion = "1";
11
+ this.pages = [];
12
+ this.prediction = new carteVitaleV1Document_1.CarteVitaleV1Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(carteVitaleV1Document_1.CarteVitaleV1Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.CarteVitaleV1 = CarteVitaleV1;
@@ -0,0 +1,17 @@
1
+ import { Prediction, StringDict } from "../../../parsing/common";
2
+ import { DateField, StringField } from "../../../parsing/standard";
3
+ /**
4
+ * Document data for Carte Vitale, API version 1.
5
+ */
6
+ export declare class CarteVitaleV1Document implements Prediction {
7
+ /** The given name(s) of the card holder. */
8
+ givenNames: StringField[];
9
+ /** The date the card was issued. */
10
+ issuanceDate: DateField;
11
+ /** The Social Security Number (Numéro de Sécurité Sociale) of the card holder */
12
+ socialSecurity: StringField;
13
+ /** The surname of the card holder. */
14
+ surname: StringField;
15
+ constructor(rawPrediction: StringDict, pageId?: number);
16
+ toString(): string;
17
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteVitaleV1Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ /**
7
+ * Document data for Carte Vitale, API version 1.
8
+ */
9
+ class CarteVitaleV1Document {
10
+ constructor(rawPrediction, pageId) {
11
+ /** The given name(s) of the card holder. */
12
+ this.givenNames = [];
13
+ rawPrediction["given_names"] &&
14
+ rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
15
+ prediction: itemPrediction,
16
+ pageId: pageId,
17
+ })));
18
+ this.issuanceDate = new standard_1.DateField({
19
+ prediction: rawPrediction["issuance_date"],
20
+ pageId: pageId,
21
+ });
22
+ this.socialSecurity = new standard_1.StringField({
23
+ prediction: rawPrediction["social_security"],
24
+ pageId: pageId,
25
+ });
26
+ this.surname = new standard_1.StringField({
27
+ prediction: rawPrediction["surname"],
28
+ pageId: pageId,
29
+ });
30
+ }
31
+ toString() {
32
+ const givenNames = this.givenNames.join("\n ");
33
+ const outStr = `:Given Name(s): ${givenNames}
34
+ :Surname: ${this.surname}
35
+ :Social Security Number: ${this.socialSecurity}
36
+ :Issuance Date: ${this.issuanceDate}`.trimEnd();
37
+ return (0, common_1.cleanOutString)(outStr);
38
+ }
39
+ }
40
+ exports.CarteVitaleV1Document = CarteVitaleV1Document;
@@ -0,0 +1,10 @@
1
+ import { Inference, StringDict, Page } from "../../../parsing/common";
2
+ import { IdCardV1Document } from "./idCardV1Document";
3
+ import { IdCardV1Page } from "./idCardV1Page";
4
+ export declare class IdCardV1 extends Inference {
5
+ endpointName: string;
6
+ endpointVersion: string;
7
+ prediction: IdCardV1Document;
8
+ pages: Page<IdCardV1Page>[];
9
+ constructor(rawPrediction: StringDict);
10
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdCardV1 = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const idCardV1Document_1 = require("./idCardV1Document");
6
+ const idCardV1Page_1 = require("./idCardV1Page");
7
+ class IdCardV1 extends common_1.Inference {
8
+ constructor(rawPrediction) {
9
+ super(rawPrediction);
10
+ this.endpointName = "idcard_fr";
11
+ this.endpointVersion = "1";
12
+ this.pages = [];
13
+ this.prediction = new idCardV1Document_1.IdCardV1Document(rawPrediction["prediction"]);
14
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(idCardV1Page_1.IdCardV1Page, page, page["id"], page["orientation"]));
15
+ }
16
+ }
17
+ exports.IdCardV1 = IdCardV1;
@@ -0,0 +1,29 @@
1
+ import { Prediction, StringDict } from "../../../parsing/common";
2
+ import { DateField, StringField } from "../../../parsing/standard";
3
+ /**
4
+ * Document data for Carte Nationale d'Identité, API version 1.
5
+ */
6
+ export declare class IdCardV1Document implements Prediction {
7
+ /** The name of the issuing authority. */
8
+ authority: StringField;
9
+ /** The date of birth of the card holder. */
10
+ birthDate: DateField;
11
+ /** The place of birth of the card holder. */
12
+ birthPlace: StringField;
13
+ /** The expiry date of the identification card. */
14
+ expiryDate: DateField;
15
+ /** The gender of the card holder. */
16
+ gender: StringField;
17
+ /** The given name(s) of the card holder. */
18
+ givenNames: StringField[];
19
+ /** The identification card number. */
20
+ idNumber: StringField;
21
+ /** Machine Readable Zone, first line */
22
+ mrz1: StringField;
23
+ /** Machine Readable Zone, second line */
24
+ mrz2: StringField;
25
+ /** The surname of the card holder. */
26
+ surname: StringField;
27
+ constructor(rawPrediction: StringDict, pageId?: number);
28
+ toString(): string;
29
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdCardV1Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ /**
7
+ * Document data for Carte Nationale d'Identité, API version 1.
8
+ */
9
+ class IdCardV1Document {
10
+ constructor(rawPrediction, pageId) {
11
+ /** The given name(s) of the card holder. */
12
+ this.givenNames = [];
13
+ this.authority = new standard_1.StringField({
14
+ prediction: rawPrediction["authority"],
15
+ pageId: pageId,
16
+ });
17
+ this.birthDate = new standard_1.DateField({
18
+ prediction: rawPrediction["birth_date"],
19
+ pageId: pageId,
20
+ });
21
+ this.birthPlace = new standard_1.StringField({
22
+ prediction: rawPrediction["birth_place"],
23
+ pageId: pageId,
24
+ });
25
+ this.expiryDate = new standard_1.DateField({
26
+ prediction: rawPrediction["expiry_date"],
27
+ pageId: pageId,
28
+ });
29
+ this.gender = new standard_1.StringField({
30
+ prediction: rawPrediction["gender"],
31
+ pageId: pageId,
32
+ });
33
+ rawPrediction["given_names"] &&
34
+ rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
35
+ prediction: itemPrediction,
36
+ pageId: pageId,
37
+ })));
38
+ this.idNumber = new standard_1.StringField({
39
+ prediction: rawPrediction["id_number"],
40
+ pageId: pageId,
41
+ });
42
+ this.mrz1 = new standard_1.StringField({
43
+ prediction: rawPrediction["mrz1"],
44
+ pageId: pageId,
45
+ });
46
+ this.mrz2 = new standard_1.StringField({
47
+ prediction: rawPrediction["mrz2"],
48
+ pageId: pageId,
49
+ });
50
+ this.surname = new standard_1.StringField({
51
+ prediction: rawPrediction["surname"],
52
+ pageId: pageId,
53
+ });
54
+ }
55
+ toString() {
56
+ const givenNames = this.givenNames.join("\n ");
57
+ const outStr = `:Identity Number: ${this.idNumber}
58
+ :Given Name(s): ${givenNames}
59
+ :Surname: ${this.surname}
60
+ :Date of Birth: ${this.birthDate}
61
+ :Place of Birth: ${this.birthPlace}
62
+ :Expiry Date: ${this.expiryDate}
63
+ :Issuing Authority: ${this.authority}
64
+ :Gender: ${this.gender}
65
+ :MRZ Line 1: ${this.mrz1}
66
+ :MRZ Line 2: ${this.mrz2}`.trimEnd();
67
+ return (0, common_1.cleanOutString)(outStr);
68
+ }
69
+ }
70
+ exports.IdCardV1Document = IdCardV1Document;
@@ -0,0 +1,12 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { ClassificationField } from "../../../parsing/standard";
3
+ import { IdCardV1Document } from "./idCardV1Document";
4
+ /**
5
+ * Page data for Carte Nationale d'Identité, API version 1.
6
+ */
7
+ export declare class IdCardV1Page extends IdCardV1Document {
8
+ /** The side of the document which is visible. */
9
+ documentSide: ClassificationField;
10
+ constructor(rawPrediction: StringDict, pageId?: number);
11
+ toString(): string;
12
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdCardV1Page = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ const idCardV1Document_1 = require("./idCardV1Document");
7
+ /**
8
+ * Page data for Carte Nationale d'Identité, API version 1.
9
+ */
10
+ class IdCardV1Page extends idCardV1Document_1.IdCardV1Document {
11
+ constructor(rawPrediction, pageId) {
12
+ super(rawPrediction, pageId);
13
+ this.documentSide = new standard_1.ClassificationField({
14
+ prediction: rawPrediction["document_side"],
15
+ });
16
+ }
17
+ toString() {
18
+ let outStr = `:Document Side: ${this.documentSide}`.trimEnd();
19
+ outStr += "\n" + super.toString();
20
+ return (0, common_1.cleanOutString)(outStr);
21
+ }
22
+ }
23
+ exports.IdCardV1Page = IdCardV1Page;
@@ -1,18 +1,13 @@
1
- export { InvoiceV3 } from "./invoice/invoiceV3";
2
1
  export { InvoiceV4 } from "./invoice/invoiceV4";
3
- export { InvoiceSplitterV1, PageGroup, } from "./invoiceSplitter/invoiceSplitterV1";
4
- export { ReceiptV3 } from "./receipt/receiptV3";
2
+ export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
3
+ export { PageGroup } from "./invoiceSplitter/invoiceSplitterV1PageGroup";
5
4
  export { ReceiptV4 } from "./receipt/receiptV4";
6
5
  export { ReceiptV5 } from "./receipt/receiptV5";
7
6
  export { PassportV1 } from "./passport/passportV1";
8
- export { FinancialDocumentV0 } from "./financialDocument/financialDocumentV0";
9
7
  export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
10
8
  export { CustomV1 } from "./custom/customV1";
11
- export { getLineItems } from "./custom/lineitems";
12
9
  export { CropperV1 } from "./cropper/cropperV1";
13
- export { MindeeVisionV1 } from "./mindeeVision/mindeeVisionV1";
14
10
  export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
15
- export { Document, DocumentConstructorProps, DocumentSig } from "./document";
16
11
  export * as fr from "./fr";
17
12
  export * as us from "./us";
18
13
  export * as eu from "./eu";
@@ -23,38 +23,27 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.eu = exports.us = exports.fr = exports.Document = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.CropperV1 = exports.getLineItems = exports.CustomV1 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PageGroup = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = void 0;
27
- var invoiceV3_1 = require("./invoice/invoiceV3");
28
- Object.defineProperty(exports, "InvoiceV3", { enumerable: true, get: function () { return invoiceV3_1.InvoiceV3; } });
26
+ exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.CropperV1 = exports.CustomV1 = exports.FinancialDocumentV1 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.PageGroup = exports.InvoiceSplitterV1 = exports.InvoiceV4 = void 0;
29
27
  var invoiceV4_1 = require("./invoice/invoiceV4");
30
28
  Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
31
29
  var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
32
30
  Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
33
- Object.defineProperty(exports, "PageGroup", { enumerable: true, get: function () { return invoiceSplitterV1_1.PageGroup; } });
34
- var receiptV3_1 = require("./receipt/receiptV3");
35
- Object.defineProperty(exports, "ReceiptV3", { enumerable: true, get: function () { return receiptV3_1.ReceiptV3; } });
31
+ var invoiceSplitterV1PageGroup_1 = require("./invoiceSplitter/invoiceSplitterV1PageGroup");
32
+ Object.defineProperty(exports, "PageGroup", { enumerable: true, get: function () { return invoiceSplitterV1PageGroup_1.PageGroup; } });
36
33
  var receiptV4_1 = require("./receipt/receiptV4");
37
34
  Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
38
35
  var receiptV5_1 = require("./receipt/receiptV5");
39
36
  Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return receiptV5_1.ReceiptV5; } });
40
37
  var passportV1_1 = require("./passport/passportV1");
41
38
  Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
42
- var financialDocumentV0_1 = require("./financialDocument/financialDocumentV0");
43
- Object.defineProperty(exports, "FinancialDocumentV0", { enumerable: true, get: function () { return financialDocumentV0_1.FinancialDocumentV0; } });
44
39
  var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
45
40
  Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
46
41
  var customV1_1 = require("./custom/customV1");
47
42
  Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
48
- var lineitems_1 = require("./custom/lineitems");
49
- Object.defineProperty(exports, "getLineItems", { enumerable: true, get: function () { return lineitems_1.getLineItems; } });
50
43
  var cropperV1_1 = require("./cropper/cropperV1");
51
44
  Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
52
- var mindeeVisionV1_1 = require("./mindeeVision/mindeeVisionV1");
53
- Object.defineProperty(exports, "MindeeVisionV1", { enumerable: true, get: function () { return mindeeVisionV1_1.MindeeVisionV1; } });
54
45
  var proofOfAddressV1_1 = require("./proofOfAddress/proofOfAddressV1");
55
46
  Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
56
- var document_1 = require("./document");
57
- Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });
58
47
  exports.fr = __importStar(require("./fr"));
59
48
  exports.us = __importStar(require("./us"));
60
49
  exports.eu = __importStar(require("./eu"));
@@ -0,0 +1,9 @@
1
+ import { Inference, StringDict, Page } from "../../parsing/common";
2
+ import { InvoiceV4Document } from "./invoiceV4Document";
3
+ export declare class InvoiceV4 extends Inference {
4
+ endpointName: string;
5
+ endpointVersion: string;
6
+ prediction: InvoiceV4Document;
7
+ pages: Page<InvoiceV4Document>[];
8
+ constructor(rawPrediction: StringDict);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceV4 = void 0;
4
+ const common_1 = require("../../parsing/common");
5
+ const invoiceV4Document_1 = require("./invoiceV4Document");
6
+ class InvoiceV4 extends common_1.Inference {
7
+ constructor(rawPrediction) {
8
+ super(rawPrediction);
9
+ this.endpointName = "invoices";
10
+ this.endpointVersion = "4";
11
+ this.pages = [];
12
+ this.prediction = new invoiceV4Document_1.InvoiceV4Document(rawPrediction["prediction"]);
13
+ this.pages = rawPrediction["pages"].map((page) => new common_1.Page(invoiceV4Document_1.InvoiceV4Document, page, page["id"], page["orientation"]));
14
+ }
15
+ }
16
+ exports.InvoiceV4 = InvoiceV4;
@@ -0,0 +1,44 @@
1
+ import { Prediction, StringDict } from "../../parsing/common";
2
+ import { ClassificationField, Taxes, PaymentDetailsField, LocaleField, AmountField, StringField, DateField, CompanyRegistrationField } from "../../parsing/standard";
3
+ import { InvoiceV4LineItem } from "./invoiceV4LineItem";
4
+ /** Invoice V4 */
5
+ export declare class InvoiceV4Document implements Prediction {
6
+ /** LocaleField information. */
7
+ locale: LocaleField;
8
+ /** The nature of the invoice. */
9
+ documentType: ClassificationField;
10
+ /** List of Reference numbers including PO number. */
11
+ referenceNumbers: StringField[];
12
+ /** The total amount with tax included. */
13
+ totalAmount: AmountField;
14
+ /** The creation date of the invoice. */
15
+ date: DateField;
16
+ /** The due date of the invoice. */
17
+ dueDate: DateField;
18
+ /** The total tax. */
19
+ totalTax: AmountField;
20
+ /** The total amount without the tax value. */
21
+ totalNet: AmountField;
22
+ /** The supplier name. */
23
+ supplierName: StringField;
24
+ /** The supplier address. */
25
+ supplierAddress: StringField;
26
+ /** The payment information. */
27
+ supplierPaymentDetails: PaymentDetailsField[];
28
+ /** The supplier company registration information. */
29
+ supplierCompanyRegistrations: CompanyRegistrationField[];
30
+ /** The invoice number. */
31
+ invoiceNumber: StringField;
32
+ /** The name of the customer. */
33
+ customerName: StringField;
34
+ /** The address of the customer. */
35
+ customerAddress: StringField;
36
+ /** The company registration information for the customer. */
37
+ customerCompanyRegistrations: CompanyRegistrationField[];
38
+ /** The list of the taxes. */
39
+ taxes: Taxes;
40
+ /** Line items details. */
41
+ lineItems: InvoiceV4LineItem[];
42
+ constructor(rawPrediction: StringDict, pageId?: number);
43
+ toString(): string;
44
+ }
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceV4Document = void 0;
4
+ const summaryHelper_1 = require("../../parsing/common/summaryHelper");
5
+ const standard_1 = require("../../parsing/standard");
6
+ const invoiceV4LineItem_1 = require("./invoiceV4LineItem");
7
+ /** Invoice V4 */
8
+ class InvoiceV4Document {
9
+ constructor(rawPrediction, pageId) {
10
+ /** List of Reference numbers including PO number. */
11
+ this.referenceNumbers = [];
12
+ /** The payment information. */
13
+ this.supplierPaymentDetails = [];
14
+ /** The supplier company registration information. */
15
+ this.supplierCompanyRegistrations = [];
16
+ /** The company registration information for the customer. */
17
+ this.customerCompanyRegistrations = [];
18
+ /** Line items details. */
19
+ this.lineItems = [];
20
+ this.locale = new standard_1.LocaleField({
21
+ prediction: rawPrediction["locale"],
22
+ valueKey: "language",
23
+ });
24
+ this.documentType = new standard_1.ClassificationField({
25
+ prediction: rawPrediction["document_type"],
26
+ });
27
+ this.referenceNumbers =
28
+ rawPrediction["reference_numbers"] &&
29
+ rawPrediction["reference_numbers"].map((prediction) => new standard_1.StringField({
30
+ prediction: prediction,
31
+ pageId: pageId,
32
+ }));
33
+ this.totalAmount = new standard_1.AmountField({
34
+ prediction: rawPrediction["total_amount"],
35
+ pageId: pageId,
36
+ });
37
+ this.totalTax = new standard_1.AmountField({
38
+ prediction: rawPrediction["taxes"] && rawPrediction["taxes"].length > 0
39
+ ? {
40
+ value: rawPrediction["taxes"].reduce((acc, tax) => {
41
+ return tax.value !== undefined ? acc + tax.value : acc;
42
+ }, 0),
43
+ confidence: 1,
44
+ }
45
+ : { value: undefined, confidence: 0.0 },
46
+ pageId: pageId,
47
+ });
48
+ this.totalNet = new standard_1.AmountField({
49
+ prediction: rawPrediction["total_net"],
50
+ pageId: pageId,
51
+ });
52
+ this.date = new standard_1.DateField({
53
+ prediction: rawPrediction["date"],
54
+ pageId,
55
+ });
56
+ this.taxes = new standard_1.Taxes().init(rawPrediction["taxes"], pageId);
57
+ this.supplierCompanyRegistrations =
58
+ rawPrediction["supplier_company_registrations"] &&
59
+ rawPrediction["supplier_company_registrations"].map((prediction) => new standard_1.CompanyRegistrationField({
60
+ prediction: prediction,
61
+ pageId: pageId,
62
+ }));
63
+ this.dueDate = new standard_1.DateField({
64
+ prediction: rawPrediction["due_date"],
65
+ pageId: pageId,
66
+ });
67
+ this.invoiceNumber = new standard_1.StringField({
68
+ prediction: rawPrediction["invoice_number"],
69
+ pageId: pageId,
70
+ });
71
+ this.supplierName = new standard_1.StringField({
72
+ prediction: rawPrediction["supplier_name"],
73
+ pageId: pageId,
74
+ });
75
+ this.supplierAddress = new standard_1.StringField({
76
+ prediction: rawPrediction["supplier_address"],
77
+ pageId: pageId,
78
+ });
79
+ this.customerName = new standard_1.StringField({
80
+ prediction: rawPrediction["customer_name"],
81
+ pageId: pageId,
82
+ });
83
+ this.customerAddress = new standard_1.StringField({
84
+ prediction: rawPrediction["customer_address"],
85
+ pageId: pageId,
86
+ });
87
+ rawPrediction["customer_company_registrations"] &&
88
+ rawPrediction["customer_company_registrations"].forEach((prediction) => this.customerCompanyRegistrations.push(new standard_1.CompanyRegistrationField({
89
+ prediction: prediction,
90
+ pageId: pageId,
91
+ })));
92
+ rawPrediction["supplier_payment_details"] &&
93
+ rawPrediction["supplier_payment_details"].forEach((prediction) => this.supplierPaymentDetails.push(new standard_1.PaymentDetailsField({
94
+ prediction: prediction,
95
+ pageId: pageId,
96
+ })));
97
+ rawPrediction["line_items"] &&
98
+ rawPrediction["line_items"].forEach((prediction) => this.lineItems.push(new invoiceV4LineItem_1.InvoiceV4LineItem(prediction)));
99
+ }
100
+ toString() {
101
+ const referenceNumbers = this.referenceNumbers
102
+ .map((item) => item.toString())
103
+ .join(", ");
104
+ const paymentDetails = this.supplierPaymentDetails
105
+ .map((item) => item.toString())
106
+ .join("\n ");
107
+ const customerCompanyRegistration = this.customerCompanyRegistrations
108
+ .map((item) => item.toString())
109
+ .join("; ");
110
+ const companyRegistration = this.supplierCompanyRegistrations
111
+ .map((item) => item.toString())
112
+ .join("; ");
113
+ let lineItems = "\n";
114
+ if (this.lineItems.length > 0) {
115
+ lineItems += (0, summaryHelper_1.lineSeparator)([22, 9, 9, 10, 18, 38], "-");
116
+ lineItems +=
117
+ "\n | Code | QTY | Price | Amount | Tax (Rate) | Description |\n";
118
+ lineItems += (0, summaryHelper_1.lineSeparator)([22, 9, 9, 10, 18, 38], "=") + "\n ";
119
+ lineItems += this.lineItems
120
+ .map((item) => item.toTableLine() +
121
+ "\n" +
122
+ (0, summaryHelper_1.lineSeparator)([22, 9, 9, 10, 18, 38], "-"))
123
+ .join("\n ");
124
+ }
125
+ const outStr = `:Locale: ${this.locale}
126
+ :Document type: ${this.documentType}
127
+ :Invoice number: ${this.invoiceNumber}
128
+ :Reference numbers: ${referenceNumbers}
129
+ :Invoice date: ${this.date}
130
+ :Invoice due date: ${this.dueDate}
131
+ :Supplier name: ${this.supplierName}
132
+ :Supplier address: ${this.supplierAddress}
133
+ :Supplier company registrations: ${companyRegistration}
134
+ :Supplier payment details: ${paymentDetails}
135
+ :Customer name: ${this.customerName}
136
+ :Customer address: ${this.customerAddress}
137
+ :Customer company registrations: ${customerCompanyRegistration}
138
+ :Taxes: ${this.taxes}
139
+ :Total net: ${this.totalNet}
140
+ :Total tax: ${this.totalTax}
141
+ :Total amount: ${this.totalAmount}
142
+ :Line Items: ${lineItems}`;
143
+ return (0, summaryHelper_1.cleanOutString)(outStr);
144
+ }
145
+ }
146
+ exports.InvoiceV4Document = InvoiceV4Document;
@@ -1,20 +1,21 @@
1
- import { StringDict } from "../../fields";
2
1
  import { Polygon } from "../../geometry";
3
- export declare class InvoiceLineItem {
2
+ import { StringDict } from "../../parsing/common";
3
+ export declare class InvoiceV4LineItem {
4
+ #private;
4
5
  /** The product code referring to the item. */
5
6
  productCode: string;
6
7
  /** The item description. */
7
8
  description: string;
8
9
  /** The item quantity */
9
- quantity: number | null;
10
+ quantity: number | undefined;
10
11
  /** The item unit price. */
11
- unitPrice: number | null;
12
+ unitPrice: number | undefined;
12
13
  /** The item total amount. */
13
- totalAmount: number | null;
14
+ totalAmount: number | undefined;
14
15
  /** The item tax rate in percentage. */
15
- taxRate: number | null;
16
+ taxRate: number | undefined;
16
17
  /** The item tax amount. */
17
- taxAmount: number | null;
18
+ taxAmount: number | undefined;
18
19
  /** Confidence score */
19
20
  confidence: number;
20
21
  /** The document page on which the information was found. */
@@ -24,6 +25,7 @@ export declare class InvoiceLineItem {
24
25
  * the field in the document.
25
26
  */
26
27
  polygon: Polygon;
27
- constructor({ prediction }: StringDict);
28
+ constructor(rawPrediction: StringDict);
29
+ toTableLine(): string;
28
30
  toString(): string;
29
31
  }