mindee 4.15.0 → 4.17.0

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 (146) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +1 -1
  3. package/src/parsing/common/index.d.ts +1 -0
  4. package/src/parsing/common/index.js +4 -1
  5. package/src/parsing/common/summaryHelper.d.ts +10 -0
  6. package/src/parsing/common/summaryHelper.js +27 -1
  7. package/src/parsing/standard/amount.d.ts +0 -1
  8. package/src/parsing/standard/amount.js +4 -11
  9. package/src/parsing/standard/date.d.ts +2 -0
  10. package/src/parsing/standard/date.js +4 -2
  11. package/src/parsing/standard/index.d.ts +1 -1
  12. package/src/parsing/standard/index.js +1 -2
  13. package/src/parsing/standard/tax.js +4 -4
  14. package/src/product/billOfLading/billOfLadingV1.d.ts +16 -0
  15. package/src/product/billOfLading/billOfLadingV1.js +27 -0
  16. package/src/product/billOfLading/billOfLadingV1Carrier.d.ts +32 -0
  17. package/src/product/billOfLading/billOfLadingV1Carrier.js +62 -0
  18. package/src/product/billOfLading/billOfLadingV1CarrierItem.d.ts +38 -0
  19. package/src/product/billOfLading/billOfLadingV1CarrierItem.js +117 -0
  20. package/src/product/billOfLading/billOfLadingV1Consignee.d.ts +34 -0
  21. package/src/product/billOfLading/billOfLadingV1Consignee.js +67 -0
  22. package/src/product/billOfLading/billOfLadingV1Document.d.ts +39 -0
  23. package/src/product/billOfLading/billOfLadingV1Document.js +95 -0
  24. package/src/product/billOfLading/billOfLadingV1NotifyParty.d.ts +34 -0
  25. package/src/product/billOfLading/billOfLadingV1NotifyParty.js +67 -0
  26. package/src/product/billOfLading/billOfLadingV1Shipper.d.ts +34 -0
  27. package/src/product/billOfLading/billOfLadingV1Shipper.js +67 -0
  28. package/src/product/billOfLading/index.d.ts +1 -0
  29. package/src/product/billOfLading/index.js +5 -0
  30. package/src/product/billOfLading/internal.d.ts +7 -0
  31. package/src/product/billOfLading/internal.js +17 -0
  32. package/src/product/financialDocument/financialDocumentV1Document.d.ts +5 -1
  33. package/src/product/financialDocument/financialDocumentV1Document.js +11 -1
  34. package/src/product/financialDocument/financialDocumentV1LineItem.d.ts +8 -8
  35. package/src/product/financialDocument/financialDocumentV1LineItem.js +47 -22
  36. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +4 -4
  37. package/src/product/fr/energyBill/energyBillV1.d.ts +16 -0
  38. package/src/product/fr/energyBill/energyBillV1.js +27 -0
  39. package/src/product/fr/energyBill/energyBillV1Document.d.ts +49 -0
  40. package/src/product/fr/energyBill/energyBillV1Document.js +143 -0
  41. package/src/product/fr/energyBill/energyBillV1EnergyConsumer.d.ts +30 -0
  42. package/src/product/fr/energyBill/energyBillV1EnergyConsumer.js +57 -0
  43. package/src/product/fr/energyBill/energyBillV1EnergySupplier.d.ts +30 -0
  44. package/src/product/fr/energyBill/energyBillV1EnergySupplier.js +57 -0
  45. package/src/product/fr/energyBill/energyBillV1EnergyUsage.d.ts +38 -0
  46. package/src/product/fr/energyBill/energyBillV1EnergyUsage.js +117 -0
  47. package/src/product/fr/energyBill/energyBillV1MeterDetail.d.ts +32 -0
  48. package/src/product/fr/energyBill/energyBillV1MeterDetail.js +62 -0
  49. package/src/product/fr/energyBill/energyBillV1Subscription.d.ts +38 -0
  50. package/src/product/fr/energyBill/energyBillV1Subscription.js +117 -0
  51. package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.d.ts +38 -0
  52. package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.js +117 -0
  53. package/src/product/fr/energyBill/index.d.ts +1 -0
  54. package/src/product/fr/energyBill/index.js +5 -0
  55. package/src/product/fr/energyBill/internal.d.ts +8 -0
  56. package/src/product/fr/energyBill/internal.js +19 -0
  57. package/src/product/fr/index.d.ts +2 -0
  58. package/src/product/fr/index.js +5 -1
  59. package/src/product/fr/internal.d.ts +2 -0
  60. package/src/product/fr/internal.js +3 -1
  61. package/src/product/fr/payslip/index.d.ts +1 -0
  62. package/src/product/fr/payslip/index.js +5 -0
  63. package/src/product/fr/payslip/internal.d.ts +10 -0
  64. package/src/product/fr/payslip/internal.js +23 -0
  65. package/src/product/fr/payslip/payslipV2.d.ts +16 -0
  66. package/src/product/fr/payslip/payslipV2.js +27 -0
  67. package/src/product/fr/payslip/payslipV2BankAccountDetail.d.ts +32 -0
  68. package/src/product/fr/payslip/payslipV2BankAccountDetail.js +62 -0
  69. package/src/product/fr/payslip/payslipV2Document.d.ts +35 -0
  70. package/src/product/fr/payslip/payslipV2Document.js +80 -0
  71. package/src/product/fr/payslip/payslipV2Employee.d.ts +40 -0
  72. package/src/product/fr/payslip/payslipV2Employee.js +82 -0
  73. package/src/product/fr/payslip/payslipV2Employer.d.ts +40 -0
  74. package/src/product/fr/payslip/payslipV2Employer.js +82 -0
  75. package/src/product/fr/payslip/payslipV2Employment.d.ts +38 -0
  76. package/src/product/fr/payslip/payslipV2Employment.js +85 -0
  77. package/src/product/fr/payslip/payslipV2PayDetail.d.ts +46 -0
  78. package/src/product/fr/payslip/payslipV2PayDetail.js +168 -0
  79. package/src/product/fr/payslip/payslipV2PayPeriod.d.ts +36 -0
  80. package/src/product/fr/payslip/payslipV2PayPeriod.js +72 -0
  81. package/src/product/fr/payslip/payslipV2Pto.d.ts +32 -0
  82. package/src/product/fr/payslip/payslipV2Pto.js +84 -0
  83. package/src/product/fr/payslip/payslipV2SalaryDetail.d.ts +34 -0
  84. package/src/product/fr/payslip/payslipV2SalaryDetail.js +97 -0
  85. package/src/product/index.d.ts +2 -0
  86. package/src/product/index.js +5 -1
  87. package/src/product/internal.d.ts +2 -0
  88. package/src/product/internal.js +3 -1
  89. package/src/product/invoice/invoiceV4Document.d.ts +5 -1
  90. package/src/product/invoice/invoiceV4Document.js +11 -1
  91. package/src/product/invoice/invoiceV4LineItem.d.ts +8 -8
  92. package/src/product/invoice/invoiceV4LineItem.js +47 -22
  93. package/src/product/nutritionFactsLabel/index.d.ts +1 -0
  94. package/src/product/nutritionFactsLabel/index.js +5 -0
  95. package/src/product/nutritionFactsLabel/internal.d.ts +15 -0
  96. package/src/product/nutritionFactsLabel/internal.js +33 -0
  97. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.d.ts +16 -0
  98. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.js +27 -0
  99. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.d.ts +32 -0
  100. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.js +84 -0
  101. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.d.ts +32 -0
  102. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.js +84 -0
  103. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.d.ts +32 -0
  104. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.js +84 -0
  105. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.d.ts +32 -0
  106. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.js +84 -0
  107. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.d.ts +53 -0
  108. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.js +117 -0
  109. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.d.ts +36 -0
  110. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.js +107 -0
  111. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.d.ts +32 -0
  112. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.js +84 -0
  113. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.d.ts +32 -0
  114. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.js +84 -0
  115. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.d.ts +30 -0
  116. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.js +65 -0
  117. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.d.ts +34 -0
  118. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.js +89 -0
  119. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.d.ts +32 -0
  120. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.js +84 -0
  121. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.d.ts +32 -0
  122. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.js +84 -0
  123. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.d.ts +32 -0
  124. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.js +84 -0
  125. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.d.ts +32 -0
  126. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.js +84 -0
  127. package/src/product/receipt/receiptV5LineItem.d.ts +4 -4
  128. package/src/product/receipt/receiptV5LineItem.js +27 -12
  129. package/src/product/resume/resumeV1Certificate.d.ts +4 -4
  130. package/src/product/resume/resumeV1Certificate.js +9 -8
  131. package/src/product/resume/resumeV1Education.d.ts +7 -7
  132. package/src/product/resume/resumeV1Education.js +15 -14
  133. package/src/product/resume/resumeV1Language.d.ts +2 -2
  134. package/src/product/resume/resumeV1Language.js +5 -4
  135. package/src/product/resume/resumeV1ProfessionalExperience.d.ts +8 -8
  136. package/src/product/resume/resumeV1ProfessionalExperience.js +17 -16
  137. package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +2 -2
  138. package/src/product/resume/resumeV1SocialNetworksUrl.js +5 -4
  139. package/src/product/us/healthcareCard/healthcareCardV1Copay.d.ts +2 -2
  140. package/src/product/us/healthcareCard/healthcareCardV1Copay.js +11 -6
  141. package/src/product/us/usMail/index.d.ts +1 -0
  142. package/src/product/us/usMail/index.js +5 -0
  143. package/src/product/us/usMail/usMailV2RecipientAddress.d.ts +7 -7
  144. package/src/product/us/usMail/usMailV2RecipientAddress.js +17 -15
  145. package/src/product/us/usMail/usMailV2SenderAddress.d.ts +5 -5
  146. package/src/product/us/usMail/usMailV2SenderAddress.js +5 -25
@@ -0,0 +1,36 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Information about the pay period.
5
+ */
6
+ export declare class PayslipV2PayPeriod {
7
+ #private;
8
+ /** The end date of the pay period. */
9
+ endDate: string | null;
10
+ /** The month of the pay period. */
11
+ month: string | null;
12
+ /** The date of payment for the pay period. */
13
+ paymentDate: string | null;
14
+ /** The start date of the pay period. */
15
+ startDate: string | null;
16
+ /** The year of the pay period. */
17
+ year: string | null;
18
+ /** Confidence score */
19
+ confidence: number;
20
+ /** The document page on which the information was found. */
21
+ pageId: number;
22
+ /**
23
+ * Contains the relative vertices coordinates (points) of a polygon containing
24
+ * the field in the document.
25
+ */
26
+ polygon: Polygon;
27
+ constructor({ prediction }: StringDict);
28
+ /**
29
+ * Default string representation.
30
+ */
31
+ toString(): string;
32
+ /**
33
+ * Output in a format suitable for inclusion in a field list.
34
+ */
35
+ toFieldList(): string;
36
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _PayslipV2PayPeriod_instances, _PayslipV2PayPeriod_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2PayPeriod = void 0;
10
+ /**
11
+ * Information about the pay period.
12
+ */
13
+ class PayslipV2PayPeriod {
14
+ constructor({ prediction = {} }) {
15
+ _PayslipV2PayPeriod_instances.add(this);
16
+ /** Confidence score */
17
+ this.confidence = 0.0;
18
+ /**
19
+ * Contains the relative vertices coordinates (points) of a polygon containing
20
+ * the field in the document.
21
+ */
22
+ this.polygon = [];
23
+ this.endDate = prediction["end_date"];
24
+ this.month = prediction["month"];
25
+ this.paymentDate = prediction["payment_date"];
26
+ this.startDate = prediction["start_date"];
27
+ this.year = prediction["year"];
28
+ this.pageId = prediction["page_id"];
29
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
30
+ if (prediction["polygon"]) {
31
+ this.polygon = prediction.polygon;
32
+ }
33
+ }
34
+ /**
35
+ * Default string representation.
36
+ */
37
+ toString() {
38
+ const printable = __classPrivateFieldGet(this, _PayslipV2PayPeriod_instances, "m", _PayslipV2PayPeriod_printableValues).call(this);
39
+ return ("End Date: " +
40
+ printable.endDate +
41
+ ", Month: " +
42
+ printable.month +
43
+ ", Payment Date: " +
44
+ printable.paymentDate +
45
+ ", Start Date: " +
46
+ printable.startDate +
47
+ ", Year: " +
48
+ printable.year);
49
+ }
50
+ /**
51
+ * Output in a format suitable for inclusion in a field list.
52
+ */
53
+ toFieldList() {
54
+ const printable = __classPrivateFieldGet(this, _PayslipV2PayPeriod_instances, "m", _PayslipV2PayPeriod_printableValues).call(this);
55
+ return `
56
+ :End Date: ${printable.endDate}
57
+ :Month: ${printable.month}
58
+ :Payment Date: ${printable.paymentDate}
59
+ :Start Date: ${printable.startDate}
60
+ :Year: ${printable.year}`.trimEnd();
61
+ }
62
+ }
63
+ exports.PayslipV2PayPeriod = PayslipV2PayPeriod;
64
+ _PayslipV2PayPeriod_instances = new WeakSet(), _PayslipV2PayPeriod_printableValues = function _PayslipV2PayPeriod_printableValues() {
65
+ return {
66
+ endDate: this.endDate ?? "",
67
+ month: this.month ?? "",
68
+ paymentDate: this.paymentDate ?? "",
69
+ startDate: this.startDate ?? "",
70
+ year: this.year ?? "",
71
+ };
72
+ };
@@ -0,0 +1,32 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Information about paid time off.
5
+ */
6
+ export declare class PayslipV2Pto {
7
+ #private;
8
+ /** The amount of paid time off accrued in this period. */
9
+ accruedThisPeriod: number | null;
10
+ /** The balance of paid time off at the end of the period. */
11
+ balanceEndOfPeriod: number | null;
12
+ /** The amount of paid time off used in this period. */
13
+ usedThisPeriod: number | null;
14
+ /** Confidence score */
15
+ confidence: number;
16
+ /** The document page on which the information was found. */
17
+ pageId: number;
18
+ /**
19
+ * Contains the relative vertices coordinates (points) of a polygon containing
20
+ * the field in the document.
21
+ */
22
+ polygon: Polygon;
23
+ constructor({ prediction }: StringDict);
24
+ /**
25
+ * Default string representation.
26
+ */
27
+ toString(): string;
28
+ /**
29
+ * Output in a format suitable for inclusion in a field list.
30
+ */
31
+ toFieldList(): string;
32
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _PayslipV2Pto_instances, _PayslipV2Pto_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2Pto = void 0;
10
+ const common_1 = require("../../../parsing/common");
11
+ /**
12
+ * Information about paid time off.
13
+ */
14
+ class PayslipV2Pto {
15
+ constructor({ prediction = {} }) {
16
+ _PayslipV2Pto_instances.add(this);
17
+ /** Confidence score */
18
+ this.confidence = 0.0;
19
+ /**
20
+ * Contains the relative vertices coordinates (points) of a polygon containing
21
+ * the field in the document.
22
+ */
23
+ this.polygon = [];
24
+ if (prediction["accrued_this_period"] !== undefined &&
25
+ prediction["accrued_this_period"] !== null &&
26
+ !isNaN(prediction["accrued_this_period"])) {
27
+ this.accruedThisPeriod = +parseFloat(prediction["accrued_this_period"]);
28
+ }
29
+ else {
30
+ this.accruedThisPeriod = null;
31
+ }
32
+ if (prediction["balance_end_of_period"] !== undefined &&
33
+ prediction["balance_end_of_period"] !== null &&
34
+ !isNaN(prediction["balance_end_of_period"])) {
35
+ this.balanceEndOfPeriod = +parseFloat(prediction["balance_end_of_period"]);
36
+ }
37
+ else {
38
+ this.balanceEndOfPeriod = null;
39
+ }
40
+ if (prediction["used_this_period"] !== undefined &&
41
+ prediction["used_this_period"] !== null &&
42
+ !isNaN(prediction["used_this_period"])) {
43
+ this.usedThisPeriod = +parseFloat(prediction["used_this_period"]);
44
+ }
45
+ else {
46
+ this.usedThisPeriod = null;
47
+ }
48
+ this.pageId = prediction["page_id"];
49
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
50
+ if (prediction["polygon"]) {
51
+ this.polygon = prediction.polygon;
52
+ }
53
+ }
54
+ /**
55
+ * Default string representation.
56
+ */
57
+ toString() {
58
+ const printable = __classPrivateFieldGet(this, _PayslipV2Pto_instances, "m", _PayslipV2Pto_printableValues).call(this);
59
+ return ("Accrued This Period: " +
60
+ printable.accruedThisPeriod +
61
+ ", Balance End of Period: " +
62
+ printable.balanceEndOfPeriod +
63
+ ", Used This Period: " +
64
+ printable.usedThisPeriod);
65
+ }
66
+ /**
67
+ * Output in a format suitable for inclusion in a field list.
68
+ */
69
+ toFieldList() {
70
+ const printable = __classPrivateFieldGet(this, _PayslipV2Pto_instances, "m", _PayslipV2Pto_printableValues).call(this);
71
+ return `
72
+ :Accrued This Period: ${printable.accruedThisPeriod}
73
+ :Balance End of Period: ${printable.balanceEndOfPeriod}
74
+ :Used This Period: ${printable.usedThisPeriod}`.trimEnd();
75
+ }
76
+ }
77
+ exports.PayslipV2Pto = PayslipV2Pto;
78
+ _PayslipV2Pto_instances = new WeakSet(), _PayslipV2Pto_printableValues = function _PayslipV2Pto_printableValues() {
79
+ return {
80
+ accruedThisPeriod: this.accruedThisPeriod !== undefined ? (0, common_1.floatToString)(this.accruedThisPeriod) : "",
81
+ balanceEndOfPeriod: this.balanceEndOfPeriod !== undefined ? (0, common_1.floatToString)(this.balanceEndOfPeriod) : "",
82
+ usedThisPeriod: this.usedThisPeriod !== undefined ? (0, common_1.floatToString)(this.usedThisPeriod) : "",
83
+ };
84
+ };
@@ -0,0 +1,34 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Detailed information about the earnings.
5
+ */
6
+ export declare class PayslipV2SalaryDetail {
7
+ #private;
8
+ /** The amount of the earnings. */
9
+ amount: number | null;
10
+ /** The base value of the earnings. */
11
+ base: number | null;
12
+ /** The description of the earnings. */
13
+ description: string | null;
14
+ /** The rate of the earnings. */
15
+ rate: number | null;
16
+ /** Confidence score */
17
+ confidence: number;
18
+ /** The document page on which the information was found. */
19
+ pageId: number;
20
+ /**
21
+ * Contains the relative vertices coordinates (points) of a polygon containing
22
+ * the field in the document.
23
+ */
24
+ polygon: Polygon;
25
+ constructor({ prediction }: StringDict);
26
+ /**
27
+ * Default string representation.
28
+ */
29
+ toString(): string;
30
+ /**
31
+ * Output in a format suitable for inclusion in an rST table.
32
+ */
33
+ toTableLine(): string;
34
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _PayslipV2SalaryDetail_instances, _PayslipV2SalaryDetail_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2SalaryDetail = void 0;
10
+ const common_1 = require("../../../parsing/common");
11
+ /**
12
+ * Detailed information about the earnings.
13
+ */
14
+ class PayslipV2SalaryDetail {
15
+ constructor({ prediction = {} }) {
16
+ _PayslipV2SalaryDetail_instances.add(this);
17
+ /** Confidence score */
18
+ this.confidence = 0.0;
19
+ /**
20
+ * Contains the relative vertices coordinates (points) of a polygon containing
21
+ * the field in the document.
22
+ */
23
+ this.polygon = [];
24
+ if (prediction["amount"] !== undefined &&
25
+ prediction["amount"] !== null &&
26
+ !isNaN(prediction["amount"])) {
27
+ this.amount = +parseFloat(prediction["amount"]);
28
+ }
29
+ else {
30
+ this.amount = null;
31
+ }
32
+ if (prediction["base"] !== undefined &&
33
+ prediction["base"] !== null &&
34
+ !isNaN(prediction["base"])) {
35
+ this.base = +parseFloat(prediction["base"]);
36
+ }
37
+ else {
38
+ this.base = null;
39
+ }
40
+ this.description = prediction["description"];
41
+ if (prediction["rate"] !== undefined &&
42
+ prediction["rate"] !== null &&
43
+ !isNaN(prediction["rate"])) {
44
+ this.rate = +parseFloat(prediction["rate"]);
45
+ }
46
+ else {
47
+ this.rate = null;
48
+ }
49
+ this.pageId = prediction["page_id"];
50
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
51
+ if (prediction["polygon"]) {
52
+ this.polygon = prediction.polygon;
53
+ }
54
+ }
55
+ /**
56
+ * Default string representation.
57
+ */
58
+ toString() {
59
+ const printable = __classPrivateFieldGet(this, _PayslipV2SalaryDetail_instances, "m", _PayslipV2SalaryDetail_printableValues).call(this);
60
+ return ("Amount: " +
61
+ printable.amount +
62
+ ", Base: " +
63
+ printable.base +
64
+ ", Description: " +
65
+ printable.description +
66
+ ", Rate: " +
67
+ printable.rate);
68
+ }
69
+ /**
70
+ * Output in a format suitable for inclusion in an rST table.
71
+ */
72
+ toTableLine() {
73
+ const printable = __classPrivateFieldGet(this, _PayslipV2SalaryDetail_instances, "m", _PayslipV2SalaryDetail_printableValues).call(this);
74
+ return ("| " +
75
+ printable.amount.padEnd(12) +
76
+ " | " +
77
+ printable.base.padEnd(9) +
78
+ " | " +
79
+ printable.description.padEnd(36) +
80
+ " | " +
81
+ printable.rate.padEnd(9) +
82
+ " |");
83
+ }
84
+ }
85
+ exports.PayslipV2SalaryDetail = PayslipV2SalaryDetail;
86
+ _PayslipV2SalaryDetail_instances = new WeakSet(), _PayslipV2SalaryDetail_printableValues = function _PayslipV2SalaryDetail_printableValues() {
87
+ return {
88
+ amount: this.amount !== undefined ? (0, common_1.floatToString)(this.amount) : "",
89
+ base: this.base !== undefined ? (0, common_1.floatToString)(this.base) : "",
90
+ description: this.description ?
91
+ this.description.length <= 36 ?
92
+ (0, common_1.cleanSpecialChars)(this.description) :
93
+ (0, common_1.cleanSpecialChars)(this.description).slice(0, 33) + "..." :
94
+ "",
95
+ rate: this.rate !== undefined ? (0, common_1.floatToString)(this.rate) : "",
96
+ };
97
+ };
@@ -1,4 +1,5 @@
1
1
  export { BarcodeReaderV1 } from "./barcodeReader/barcodeReaderV1";
2
+ export { BillOfLadingV1 } from "./billOfLading/billOfLadingV1";
2
3
  export { CropperV1 } from "./cropper/cropperV1";
3
4
  export { CustomV1 } from "./custom/customV1";
4
5
  export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
@@ -8,6 +9,7 @@ export { InternationalIdV2 } from "./internationalId/internationalIdV2";
8
9
  export { InvoiceV4 } from "./invoice/invoiceV4";
9
10
  export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
10
11
  export { MultiReceiptsDetectorV1 } from "./multiReceiptsDetector/multiReceiptsDetectorV1";
12
+ export { NutritionFactsLabelV1 } from "./nutritionFactsLabel/nutritionFactsLabelV1";
11
13
  export { PassportV1 } from "./passport/passportV1";
12
14
  export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
13
15
  export { ReceiptV4 } from "./receipt/receiptV4";
@@ -23,9 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.us = exports.fr = exports.eu = exports.ResumeV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InternationalIdV2 = exports.InternationalIdV1 = exports.GeneratedV1 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = exports.BarcodeReaderV1 = void 0;
26
+ exports.us = exports.fr = exports.eu = exports.ResumeV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.NutritionFactsLabelV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InternationalIdV2 = exports.InternationalIdV1 = exports.GeneratedV1 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = exports.BillOfLadingV1 = exports.BarcodeReaderV1 = void 0;
27
27
  var barcodeReaderV1_1 = require("./barcodeReader/barcodeReaderV1");
28
28
  Object.defineProperty(exports, "BarcodeReaderV1", { enumerable: true, get: function () { return barcodeReaderV1_1.BarcodeReaderV1; } });
29
+ var billOfLadingV1_1 = require("./billOfLading/billOfLadingV1");
30
+ Object.defineProperty(exports, "BillOfLadingV1", { enumerable: true, get: function () { return billOfLadingV1_1.BillOfLadingV1; } });
29
31
  var cropperV1_1 = require("./cropper/cropperV1");
30
32
  Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
31
33
  var customV1_1 = require("./custom/customV1");
@@ -44,6 +46,8 @@ var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
44
46
  Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
45
47
  var multiReceiptsDetectorV1_1 = require("./multiReceiptsDetector/multiReceiptsDetectorV1");
46
48
  Object.defineProperty(exports, "MultiReceiptsDetectorV1", { enumerable: true, get: function () { return multiReceiptsDetectorV1_1.MultiReceiptsDetectorV1; } });
49
+ var nutritionFactsLabelV1_1 = require("./nutritionFactsLabel/nutritionFactsLabelV1");
50
+ Object.defineProperty(exports, "NutritionFactsLabelV1", { enumerable: true, get: function () { return nutritionFactsLabelV1_1.NutritionFactsLabelV1; } });
47
51
  var passportV1_1 = require("./passport/passportV1");
48
52
  Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
49
53
  var proofOfAddressV1_1 = require("./proofOfAddress/proofOfAddressV1");
@@ -1,4 +1,5 @@
1
1
  export * as barcodeReader from "./barcodeReader/internal";
2
+ export * as billOfLading from "./billOfLading/internal";
2
3
  export * as cropper from "./cropper/internal";
3
4
  export * as custom from "./custom/internal";
4
5
  export * as eu from "./eu/internal";
@@ -9,6 +10,7 @@ export * as internationalId from "./internationalId/internal";
9
10
  export * as invoice from "./invoice/internal";
10
11
  export * as invoiceSplitter from "./invoiceSplitter/internal";
11
12
  export * as multiReceiptsDetector from "./multiReceiptsDetector/internal";
13
+ export * as nutritionFactsLabel from "./nutritionFactsLabel/internal";
12
14
  export * as passport from "./passport/internal";
13
15
  export * as proofOfAddress from "./proofOfAddress/internal";
14
16
  export * as receipt from "./receipt/internal";
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.us = exports.resume = exports.receipt = exports.proofOfAddress = exports.passport = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.generated = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = exports.barcodeReader = void 0;
26
+ exports.us = exports.resume = exports.receipt = exports.proofOfAddress = exports.passport = exports.nutritionFactsLabel = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.generated = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = exports.billOfLading = exports.barcodeReader = void 0;
27
27
  exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
28
+ exports.billOfLading = __importStar(require("./billOfLading/internal"));
28
29
  exports.cropper = __importStar(require("./cropper/internal"));
29
30
  exports.custom = __importStar(require("./custom/internal"));
30
31
  exports.eu = __importStar(require("./eu/internal"));
@@ -35,6 +36,7 @@ exports.internationalId = __importStar(require("./internationalId/internal"));
35
36
  exports.invoice = __importStar(require("./invoice/internal"));
36
37
  exports.invoiceSplitter = __importStar(require("./invoiceSplitter/internal"));
37
38
  exports.multiReceiptsDetector = __importStar(require("./multiReceiptsDetector/internal"));
39
+ exports.nutritionFactsLabel = __importStar(require("./nutritionFactsLabel/internal"));
38
40
  exports.passport = __importStar(require("./passport/internal"));
39
41
  exports.proofOfAddress = __importStar(require("./proofOfAddress/internal"));
40
42
  exports.receipt = __importStar(require("./receipt/internal"));
@@ -2,7 +2,7 @@ import { Prediction, StringDict } from "../../parsing/common";
2
2
  import { InvoiceV4LineItem } from "./invoiceV4LineItem";
3
3
  import { AmountField, ClassificationField, CompanyRegistrationField, DateField, LocaleField, PaymentDetailsField, StringField, Taxes } from "../../parsing/standard";
4
4
  /**
5
- * Invoice API version 4.7 document data.
5
+ * Invoice API version 4.8 document data.
6
6
  */
7
7
  export declare class InvoiceV4Document implements Prediction {
8
8
  /** The customer's address used for billing. */
@@ -27,6 +27,10 @@ export declare class InvoiceV4Document implements Prediction {
27
27
  lineItems: InvoiceV4LineItem[];
28
28
  /** The locale detected on the document. */
29
29
  locale: LocaleField;
30
+ /** The date on which the payment is due/ was full-filled. */
31
+ paymentDate: DateField;
32
+ /** The purchase order number. */
33
+ poNumber: StringField;
30
34
  /** List of Reference numbers, including PO number. */
31
35
  referenceNumbers: StringField[];
32
36
  /** Customer's delivery address. */
@@ -5,7 +5,7 @@ const common_1 = require("../../parsing/common");
5
5
  const invoiceV4LineItem_1 = require("./invoiceV4LineItem");
6
6
  const standard_1 = require("../../parsing/standard");
7
7
  /**
8
- * Invoice API version 4.7 document data.
8
+ * Invoice API version 4.8 document data.
9
9
  */
10
10
  class InvoiceV4Document {
11
11
  constructor(rawPrediction, pageId) {
@@ -63,6 +63,14 @@ class InvoiceV4Document {
63
63
  this.locale = new standard_1.LocaleField({
64
64
  prediction: rawPrediction["locale"],
65
65
  });
66
+ this.paymentDate = new standard_1.DateField({
67
+ prediction: rawPrediction["payment_date"],
68
+ pageId: pageId,
69
+ });
70
+ this.poNumber = new standard_1.StringField({
71
+ prediction: rawPrediction["po_number"],
72
+ pageId: pageId,
73
+ });
66
74
  rawPrediction["reference_numbers"] &&
67
75
  rawPrediction["reference_numbers"].map((itemPrediction) => this.referenceNumbers.push(new standard_1.StringField({
68
76
  prediction: itemPrediction,
@@ -141,9 +149,11 @@ class InvoiceV4Document {
141
149
  }
142
150
  const outStr = `:Locale: ${this.locale}
143
151
  :Invoice Number: ${this.invoiceNumber}
152
+ :Purchase Order Number: ${this.poNumber}
144
153
  :Reference Numbers: ${referenceNumbers}
145
154
  :Purchase Date: ${this.date}
146
155
  :Due Date: ${this.dueDate}
156
+ :Payment Date: ${this.paymentDate}
147
157
  :Total Net: ${this.totalNet}
148
158
  :Total Amount: ${this.totalAmount}
149
159
  :Total Tax: ${this.totalTax}
@@ -6,21 +6,21 @@ import { Polygon } from "../../geometry";
6
6
  export declare class InvoiceV4LineItem {
7
7
  #private;
8
8
  /** The item description. */
9
- description: string | undefined;
9
+ description: string | null;
10
10
  /** The product code referring to the item. */
11
- productCode: string | undefined;
11
+ productCode: string | null;
12
12
  /** The item quantity */
13
- quantity: number | undefined;
13
+ quantity: number | null;
14
14
  /** The item tax amount. */
15
- taxAmount: number | undefined;
15
+ taxAmount: number | null;
16
16
  /** The item tax rate in percentage. */
17
- taxRate: number | undefined;
17
+ taxRate: number | null;
18
18
  /** The item total amount. */
19
- totalAmount: number | undefined;
19
+ totalAmount: number | null;
20
20
  /** The item unit of measure. */
21
- unitMeasure: string | undefined;
21
+ unitMeasure: string | null;
22
22
  /** The item unit price. */
23
- unitPrice: number | undefined;
23
+ unitPrice: number | null;
24
24
  /** Confidence score */
25
25
  confidence: number;
26
26
  /** The document page on which the information was found. */
@@ -7,7 +7,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
7
7
  var _InvoiceV4LineItem_instances, _InvoiceV4LineItem_printableValues;
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.InvoiceV4LineItem = void 0;
10
- const standard_1 = require("../../parsing/standard");
10
+ const common_1 = require("../../parsing/common");
11
11
  /**
12
12
  * List of line item details.
13
13
  */
@@ -23,21 +23,46 @@ class InvoiceV4LineItem {
23
23
  this.polygon = [];
24
24
  this.description = prediction["description"];
25
25
  this.productCode = prediction["product_code"];
26
- if (prediction["quantity"] && !isNaN(prediction["quantity"])) {
27
- this.quantity = +parseFloat(prediction["quantity"]).toFixed(3);
26
+ if (prediction["quantity"] !== undefined &&
27
+ prediction["quantity"] !== null &&
28
+ !isNaN(prediction["quantity"])) {
29
+ this.quantity = +parseFloat(prediction["quantity"]);
28
30
  }
29
- if (prediction["tax_amount"] && !isNaN(prediction["tax_amount"])) {
30
- this.taxAmount = +parseFloat(prediction["tax_amount"]).toFixed(3);
31
+ else {
32
+ this.quantity = null;
31
33
  }
32
- if (prediction["tax_rate"] && !isNaN(prediction["tax_rate"])) {
33
- this.taxRate = +parseFloat(prediction["tax_rate"]).toFixed(3);
34
+ if (prediction["tax_amount"] !== undefined &&
35
+ prediction["tax_amount"] !== null &&
36
+ !isNaN(prediction["tax_amount"])) {
37
+ this.taxAmount = +parseFloat(prediction["tax_amount"]);
34
38
  }
35
- if (prediction["total_amount"] && !isNaN(prediction["total_amount"])) {
36
- this.totalAmount = +parseFloat(prediction["total_amount"]).toFixed(3);
39
+ else {
40
+ this.taxAmount = null;
41
+ }
42
+ if (prediction["tax_rate"] !== undefined &&
43
+ prediction["tax_rate"] !== null &&
44
+ !isNaN(prediction["tax_rate"])) {
45
+ this.taxRate = +parseFloat(prediction["tax_rate"]);
46
+ }
47
+ else {
48
+ this.taxRate = null;
49
+ }
50
+ if (prediction["total_amount"] !== undefined &&
51
+ prediction["total_amount"] !== null &&
52
+ !isNaN(prediction["total_amount"])) {
53
+ this.totalAmount = +parseFloat(prediction["total_amount"]);
54
+ }
55
+ else {
56
+ this.totalAmount = null;
37
57
  }
38
58
  this.unitMeasure = prediction["unit_measure"];
39
- if (prediction["unit_price"] && !isNaN(prediction["unit_price"])) {
40
- this.unitPrice = +parseFloat(prediction["unit_price"]).toFixed(3);
59
+ if (prediction["unit_price"] !== undefined &&
60
+ prediction["unit_price"] !== null &&
61
+ !isNaN(prediction["unit_price"])) {
62
+ this.unitPrice = +parseFloat(prediction["unit_price"]);
63
+ }
64
+ else {
65
+ this.unitPrice = null;
41
66
  }
42
67
  this.pageId = prediction["page_id"];
43
68
  this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
@@ -96,23 +121,23 @@ _InvoiceV4LineItem_instances = new WeakSet(), _InvoiceV4LineItem_printableValues
96
121
  return {
97
122
  description: this.description ?
98
123
  this.description.length <= 36 ?
99
- this.description :
100
- this.description.slice(0, 33) + "..." :
124
+ (0, common_1.cleanSpecialChars)(this.description) :
125
+ (0, common_1.cleanSpecialChars)(this.description).slice(0, 33) + "..." :
101
126
  "",
102
127
  productCode: this.productCode ?
103
128
  this.productCode.length <= 12 ?
104
- this.productCode :
105
- this.productCode.slice(0, 9) + "..." :
129
+ (0, common_1.cleanSpecialChars)(this.productCode) :
130
+ (0, common_1.cleanSpecialChars)(this.productCode).slice(0, 9) + "..." :
106
131
  "",
107
- quantity: this.quantity !== undefined ? (0, standard_1.floatToString)(this.quantity) : "",
108
- taxAmount: this.taxAmount !== undefined ? (0, standard_1.floatToString)(this.taxAmount) : "",
109
- taxRate: this.taxRate !== undefined ? (0, standard_1.floatToString)(this.taxRate) : "",
110
- totalAmount: this.totalAmount !== undefined ? (0, standard_1.floatToString)(this.totalAmount) : "",
132
+ quantity: this.quantity !== undefined ? (0, common_1.floatToString)(this.quantity) : "",
133
+ taxAmount: this.taxAmount !== undefined ? (0, common_1.floatToString)(this.taxAmount) : "",
134
+ taxRate: this.taxRate !== undefined ? (0, common_1.floatToString)(this.taxRate) : "",
135
+ totalAmount: this.totalAmount !== undefined ? (0, common_1.floatToString)(this.totalAmount) : "",
111
136
  unitMeasure: this.unitMeasure ?
112
137
  this.unitMeasure.length <= 15 ?
113
- this.unitMeasure :
114
- this.unitMeasure.slice(0, 12) + "..." :
138
+ (0, common_1.cleanSpecialChars)(this.unitMeasure) :
139
+ (0, common_1.cleanSpecialChars)(this.unitMeasure).slice(0, 12) + "..." :
115
140
  "",
116
- unitPrice: this.unitPrice !== undefined ? (0, standard_1.floatToString)(this.unitPrice) : "",
141
+ unitPrice: this.unitPrice !== undefined ? (0, common_1.floatToString)(this.unitPrice) : "",
117
142
  };
118
143
  };
@@ -0,0 +1 @@
1
+ export { NutritionFactsLabelV1 } from "./nutritionFactsLabelV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NutritionFactsLabelV1 = void 0;
4
+ var nutritionFactsLabelV1_1 = require("./nutritionFactsLabelV1");
5
+ Object.defineProperty(exports, "NutritionFactsLabelV1", { enumerable: true, get: function () { return nutritionFactsLabelV1_1.NutritionFactsLabelV1; } });
@@ -0,0 +1,15 @@
1
+ export { NutritionFactsLabelV1 } from "./nutritionFactsLabelV1";
2
+ export { NutritionFactsLabelV1AddedSugar } from "./nutritionFactsLabelV1AddedSugar";
3
+ export { NutritionFactsLabelV1Calorie } from "./nutritionFactsLabelV1Calorie";
4
+ export { NutritionFactsLabelV1Cholesterol } from "./nutritionFactsLabelV1Cholesterol";
5
+ export { NutritionFactsLabelV1DietaryFiber } from "./nutritionFactsLabelV1DietaryFiber";
6
+ export { NutritionFactsLabelV1Document } from "./nutritionFactsLabelV1Document";
7
+ export { NutritionFactsLabelV1Nutrient } from "./nutritionFactsLabelV1Nutrient";
8
+ export { NutritionFactsLabelV1Protein } from "./nutritionFactsLabelV1Protein";
9
+ export { NutritionFactsLabelV1SaturatedFat } from "./nutritionFactsLabelV1SaturatedFat";
10
+ export { NutritionFactsLabelV1ServingSize } from "./nutritionFactsLabelV1ServingSize";
11
+ export { NutritionFactsLabelV1Sodium } from "./nutritionFactsLabelV1Sodium";
12
+ export { NutritionFactsLabelV1TotalCarbohydrate } from "./nutritionFactsLabelV1TotalCarbohydrate";
13
+ export { NutritionFactsLabelV1TotalFat } from "./nutritionFactsLabelV1TotalFat";
14
+ export { NutritionFactsLabelV1TotalSugar } from "./nutritionFactsLabelV1TotalSugar";
15
+ export { NutritionFactsLabelV1TransFat } from "./nutritionFactsLabelV1TransFat";