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,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PayslipV2Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const payslipV2Employee_1 = require("./payslipV2Employee");
6
+ const payslipV2Employer_1 = require("./payslipV2Employer");
7
+ const payslipV2BankAccountDetail_1 = require("./payslipV2BankAccountDetail");
8
+ const payslipV2Employment_1 = require("./payslipV2Employment");
9
+ const payslipV2SalaryDetail_1 = require("./payslipV2SalaryDetail");
10
+ const payslipV2PayDetail_1 = require("./payslipV2PayDetail");
11
+ const payslipV2Pto_1 = require("./payslipV2Pto");
12
+ const payslipV2PayPeriod_1 = require("./payslipV2PayPeriod");
13
+ /**
14
+ * Payslip API version 2.0 document data.
15
+ */
16
+ class PayslipV2Document {
17
+ constructor(rawPrediction, pageId) {
18
+ /** Detailed information about the earnings. */
19
+ this.salaryDetails = [];
20
+ this.bankAccountDetails = new payslipV2BankAccountDetail_1.PayslipV2BankAccountDetail({
21
+ prediction: rawPrediction["bank_account_details"],
22
+ pageId: pageId,
23
+ });
24
+ this.employee = new payslipV2Employee_1.PayslipV2Employee({
25
+ prediction: rawPrediction["employee"],
26
+ pageId: pageId,
27
+ });
28
+ this.employer = new payslipV2Employer_1.PayslipV2Employer({
29
+ prediction: rawPrediction["employer"],
30
+ pageId: pageId,
31
+ });
32
+ this.employment = new payslipV2Employment_1.PayslipV2Employment({
33
+ prediction: rawPrediction["employment"],
34
+ pageId: pageId,
35
+ });
36
+ this.payDetail = new payslipV2PayDetail_1.PayslipV2PayDetail({
37
+ prediction: rawPrediction["pay_detail"],
38
+ pageId: pageId,
39
+ });
40
+ this.payPeriod = new payslipV2PayPeriod_1.PayslipV2PayPeriod({
41
+ prediction: rawPrediction["pay_period"],
42
+ pageId: pageId,
43
+ });
44
+ this.pto = new payslipV2Pto_1.PayslipV2Pto({
45
+ prediction: rawPrediction["pto"],
46
+ pageId: pageId,
47
+ });
48
+ rawPrediction["salary_details"] &&
49
+ rawPrediction["salary_details"].map((itemPrediction) => this.salaryDetails.push(new payslipV2SalaryDetail_1.PayslipV2SalaryDetail({
50
+ prediction: itemPrediction,
51
+ pageId: pageId,
52
+ })));
53
+ }
54
+ /**
55
+ * Default string representation.
56
+ */
57
+ toString() {
58
+ let salaryDetailsSummary = "";
59
+ if (this.salaryDetails && this.salaryDetails.length > 0) {
60
+ const salaryDetailsColSizes = [14, 11, 38, 11];
61
+ salaryDetailsSummary += "\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "-") + "\n ";
62
+ salaryDetailsSummary += "| Amount ";
63
+ salaryDetailsSummary += "| Base ";
64
+ salaryDetailsSummary += "| Description ";
65
+ salaryDetailsSummary += "| Rate ";
66
+ salaryDetailsSummary += "|\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "=");
67
+ salaryDetailsSummary += this.salaryDetails.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "-")).join("");
68
+ }
69
+ const outStr = `:Employee: ${this.employee.toFieldList()}
70
+ :Employer: ${this.employer.toFieldList()}
71
+ :Bank Account Details: ${this.bankAccountDetails.toFieldList()}
72
+ :Employment: ${this.employment.toFieldList()}
73
+ :Salary Details: ${salaryDetailsSummary}
74
+ :Pay Detail: ${this.payDetail.toFieldList()}
75
+ :PTO: ${this.pto.toFieldList()}
76
+ :Pay Period: ${this.payPeriod.toFieldList()}`.trimEnd();
77
+ return (0, common_1.cleanOutString)(outStr);
78
+ }
79
+ }
80
+ exports.PayslipV2Document = PayslipV2Document;
@@ -0,0 +1,40 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Information about the employee.
5
+ */
6
+ export declare class PayslipV2Employee {
7
+ #private;
8
+ /** The address of the employee. */
9
+ address: string | null;
10
+ /** The date of birth of the employee. */
11
+ dateOfBirth: string | null;
12
+ /** The first name of the employee. */
13
+ firstName: string | null;
14
+ /** The last name of the employee. */
15
+ lastName: string | null;
16
+ /** The phone number of the employee. */
17
+ phoneNumber: string | null;
18
+ /** The registration number of the employee. */
19
+ registrationNumber: string | null;
20
+ /** The social security number of the employee. */
21
+ socialSecurityNumber: string | null;
22
+ /** Confidence score */
23
+ confidence: number;
24
+ /** The document page on which the information was found. */
25
+ pageId: number;
26
+ /**
27
+ * Contains the relative vertices coordinates (points) of a polygon containing
28
+ * the field in the document.
29
+ */
30
+ polygon: Polygon;
31
+ constructor({ prediction }: StringDict);
32
+ /**
33
+ * Default string representation.
34
+ */
35
+ toString(): string;
36
+ /**
37
+ * Output in a format suitable for inclusion in a field list.
38
+ */
39
+ toFieldList(): string;
40
+ }
@@ -0,0 +1,82 @@
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 _PayslipV2Employee_instances, _PayslipV2Employee_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2Employee = void 0;
10
+ /**
11
+ * Information about the employee.
12
+ */
13
+ class PayslipV2Employee {
14
+ constructor({ prediction = {} }) {
15
+ _PayslipV2Employee_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.address = prediction["address"];
24
+ this.dateOfBirth = prediction["date_of_birth"];
25
+ this.firstName = prediction["first_name"];
26
+ this.lastName = prediction["last_name"];
27
+ this.phoneNumber = prediction["phone_number"];
28
+ this.registrationNumber = prediction["registration_number"];
29
+ this.socialSecurityNumber = prediction["social_security_number"];
30
+ this.pageId = prediction["page_id"];
31
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
32
+ if (prediction["polygon"]) {
33
+ this.polygon = prediction.polygon;
34
+ }
35
+ }
36
+ /**
37
+ * Default string representation.
38
+ */
39
+ toString() {
40
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employee_instances, "m", _PayslipV2Employee_printableValues).call(this);
41
+ return ("Address: " +
42
+ printable.address +
43
+ ", Date of Birth: " +
44
+ printable.dateOfBirth +
45
+ ", First Name: " +
46
+ printable.firstName +
47
+ ", Last Name: " +
48
+ printable.lastName +
49
+ ", Phone Number: " +
50
+ printable.phoneNumber +
51
+ ", Registration Number: " +
52
+ printable.registrationNumber +
53
+ ", Social Security Number: " +
54
+ printable.socialSecurityNumber);
55
+ }
56
+ /**
57
+ * Output in a format suitable for inclusion in a field list.
58
+ */
59
+ toFieldList() {
60
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employee_instances, "m", _PayslipV2Employee_printableValues).call(this);
61
+ return `
62
+ :Address: ${printable.address}
63
+ :Date of Birth: ${printable.dateOfBirth}
64
+ :First Name: ${printable.firstName}
65
+ :Last Name: ${printable.lastName}
66
+ :Phone Number: ${printable.phoneNumber}
67
+ :Registration Number: ${printable.registrationNumber}
68
+ :Social Security Number: ${printable.socialSecurityNumber}`.trimEnd();
69
+ }
70
+ }
71
+ exports.PayslipV2Employee = PayslipV2Employee;
72
+ _PayslipV2Employee_instances = new WeakSet(), _PayslipV2Employee_printableValues = function _PayslipV2Employee_printableValues() {
73
+ return {
74
+ address: this.address ?? "",
75
+ dateOfBirth: this.dateOfBirth ?? "",
76
+ firstName: this.firstName ?? "",
77
+ lastName: this.lastName ?? "",
78
+ phoneNumber: this.phoneNumber ?? "",
79
+ registrationNumber: this.registrationNumber ?? "",
80
+ socialSecurityNumber: this.socialSecurityNumber ?? "",
81
+ };
82
+ };
@@ -0,0 +1,40 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Information about the employer.
5
+ */
6
+ export declare class PayslipV2Employer {
7
+ #private;
8
+ /** The address of the employer. */
9
+ address: string | null;
10
+ /** The company ID of the employer. */
11
+ companyId: string | null;
12
+ /** The site of the company. */
13
+ companySite: string | null;
14
+ /** The NAF code of the employer. */
15
+ nafCode: string | null;
16
+ /** The name of the employer. */
17
+ name: string | null;
18
+ /** The phone number of the employer. */
19
+ phoneNumber: string | null;
20
+ /** The URSSAF number of the employer. */
21
+ urssafNumber: string | null;
22
+ /** Confidence score */
23
+ confidence: number;
24
+ /** The document page on which the information was found. */
25
+ pageId: number;
26
+ /**
27
+ * Contains the relative vertices coordinates (points) of a polygon containing
28
+ * the field in the document.
29
+ */
30
+ polygon: Polygon;
31
+ constructor({ prediction }: StringDict);
32
+ /**
33
+ * Default string representation.
34
+ */
35
+ toString(): string;
36
+ /**
37
+ * Output in a format suitable for inclusion in a field list.
38
+ */
39
+ toFieldList(): string;
40
+ }
@@ -0,0 +1,82 @@
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 _PayslipV2Employer_instances, _PayslipV2Employer_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2Employer = void 0;
10
+ /**
11
+ * Information about the employer.
12
+ */
13
+ class PayslipV2Employer {
14
+ constructor({ prediction = {} }) {
15
+ _PayslipV2Employer_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.address = prediction["address"];
24
+ this.companyId = prediction["company_id"];
25
+ this.companySite = prediction["company_site"];
26
+ this.nafCode = prediction["naf_code"];
27
+ this.name = prediction["name"];
28
+ this.phoneNumber = prediction["phone_number"];
29
+ this.urssafNumber = prediction["urssaf_number"];
30
+ this.pageId = prediction["page_id"];
31
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
32
+ if (prediction["polygon"]) {
33
+ this.polygon = prediction.polygon;
34
+ }
35
+ }
36
+ /**
37
+ * Default string representation.
38
+ */
39
+ toString() {
40
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employer_instances, "m", _PayslipV2Employer_printableValues).call(this);
41
+ return ("Address: " +
42
+ printable.address +
43
+ ", Company ID: " +
44
+ printable.companyId +
45
+ ", Company Site: " +
46
+ printable.companySite +
47
+ ", NAF Code: " +
48
+ printable.nafCode +
49
+ ", Name: " +
50
+ printable.name +
51
+ ", Phone Number: " +
52
+ printable.phoneNumber +
53
+ ", URSSAF Number: " +
54
+ printable.urssafNumber);
55
+ }
56
+ /**
57
+ * Output in a format suitable for inclusion in a field list.
58
+ */
59
+ toFieldList() {
60
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employer_instances, "m", _PayslipV2Employer_printableValues).call(this);
61
+ return `
62
+ :Address: ${printable.address}
63
+ :Company ID: ${printable.companyId}
64
+ :Company Site: ${printable.companySite}
65
+ :NAF Code: ${printable.nafCode}
66
+ :Name: ${printable.name}
67
+ :Phone Number: ${printable.phoneNumber}
68
+ :URSSAF Number: ${printable.urssafNumber}`.trimEnd();
69
+ }
70
+ }
71
+ exports.PayslipV2Employer = PayslipV2Employer;
72
+ _PayslipV2Employer_instances = new WeakSet(), _PayslipV2Employer_printableValues = function _PayslipV2Employer_printableValues() {
73
+ return {
74
+ address: this.address ?? "",
75
+ companyId: this.companyId ?? "",
76
+ companySite: this.companySite ?? "",
77
+ nafCode: this.nafCode ?? "",
78
+ name: this.name ?? "",
79
+ phoneNumber: this.phoneNumber ?? "",
80
+ urssafNumber: this.urssafNumber ?? "",
81
+ };
82
+ };
@@ -0,0 +1,38 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Information about the employment.
5
+ */
6
+ export declare class PayslipV2Employment {
7
+ #private;
8
+ /** The category of the employment. */
9
+ category: string | null;
10
+ /** The coefficient of the employment. */
11
+ coefficient: number | null;
12
+ /** The collective agreement of the employment. */
13
+ collectiveAgreement: string | null;
14
+ /** The job title of the employee. */
15
+ jobTitle: string | null;
16
+ /** The position level of the employment. */
17
+ positionLevel: string | null;
18
+ /** The start date of the employment. */
19
+ startDate: string | null;
20
+ /** Confidence score */
21
+ confidence: number;
22
+ /** The document page on which the information was found. */
23
+ pageId: number;
24
+ /**
25
+ * Contains the relative vertices coordinates (points) of a polygon containing
26
+ * the field in the document.
27
+ */
28
+ polygon: Polygon;
29
+ constructor({ prediction }: StringDict);
30
+ /**
31
+ * Default string representation.
32
+ */
33
+ toString(): string;
34
+ /**
35
+ * Output in a format suitable for inclusion in a field list.
36
+ */
37
+ toFieldList(): string;
38
+ }
@@ -0,0 +1,85 @@
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 _PayslipV2Employment_instances, _PayslipV2Employment_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2Employment = void 0;
10
+ const common_1 = require("../../../parsing/common");
11
+ /**
12
+ * Information about the employment.
13
+ */
14
+ class PayslipV2Employment {
15
+ constructor({ prediction = {} }) {
16
+ _PayslipV2Employment_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
+ this.category = prediction["category"];
25
+ if (prediction["coefficient"] !== undefined &&
26
+ prediction["coefficient"] !== null &&
27
+ !isNaN(prediction["coefficient"])) {
28
+ this.coefficient = +parseFloat(prediction["coefficient"]);
29
+ }
30
+ else {
31
+ this.coefficient = null;
32
+ }
33
+ this.collectiveAgreement = prediction["collective_agreement"];
34
+ this.jobTitle = prediction["job_title"];
35
+ this.positionLevel = prediction["position_level"];
36
+ this.startDate = prediction["start_date"];
37
+ this.pageId = prediction["page_id"];
38
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
39
+ if (prediction["polygon"]) {
40
+ this.polygon = prediction.polygon;
41
+ }
42
+ }
43
+ /**
44
+ * Default string representation.
45
+ */
46
+ toString() {
47
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employment_instances, "m", _PayslipV2Employment_printableValues).call(this);
48
+ return ("Category: " +
49
+ printable.category +
50
+ ", Coefficient: " +
51
+ printable.coefficient +
52
+ ", Collective Agreement: " +
53
+ printable.collectiveAgreement +
54
+ ", Job Title: " +
55
+ printable.jobTitle +
56
+ ", Position Level: " +
57
+ printable.positionLevel +
58
+ ", Start Date: " +
59
+ printable.startDate);
60
+ }
61
+ /**
62
+ * Output in a format suitable for inclusion in a field list.
63
+ */
64
+ toFieldList() {
65
+ const printable = __classPrivateFieldGet(this, _PayslipV2Employment_instances, "m", _PayslipV2Employment_printableValues).call(this);
66
+ return `
67
+ :Category: ${printable.category}
68
+ :Coefficient: ${printable.coefficient}
69
+ :Collective Agreement: ${printable.collectiveAgreement}
70
+ :Job Title: ${printable.jobTitle}
71
+ :Position Level: ${printable.positionLevel}
72
+ :Start Date: ${printable.startDate}`.trimEnd();
73
+ }
74
+ }
75
+ exports.PayslipV2Employment = PayslipV2Employment;
76
+ _PayslipV2Employment_instances = new WeakSet(), _PayslipV2Employment_printableValues = function _PayslipV2Employment_printableValues() {
77
+ return {
78
+ category: this.category ?? "",
79
+ coefficient: this.coefficient !== undefined ? (0, common_1.floatToString)(this.coefficient) : "",
80
+ collectiveAgreement: this.collectiveAgreement ?? "",
81
+ jobTitle: this.jobTitle ?? "",
82
+ positionLevel: this.positionLevel ?? "",
83
+ startDate: this.startDate ?? "",
84
+ };
85
+ };
@@ -0,0 +1,46 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { Polygon } from "../../../geometry";
3
+ /**
4
+ * Detailed information about the pay.
5
+ */
6
+ export declare class PayslipV2PayDetail {
7
+ #private;
8
+ /** The gross salary of the employee. */
9
+ grossSalary: number | null;
10
+ /** The year-to-date gross salary of the employee. */
11
+ grossSalaryYtd: number | null;
12
+ /** The income tax rate of the employee. */
13
+ incomeTaxRate: number | null;
14
+ /** The income tax withheld from the employee's pay. */
15
+ incomeTaxWithheld: number | null;
16
+ /** The net paid amount of the employee. */
17
+ netPaid: number | null;
18
+ /** The net paid amount before tax of the employee. */
19
+ netPaidBeforeTax: number | null;
20
+ /** The net taxable amount of the employee. */
21
+ netTaxable: number | null;
22
+ /** The year-to-date net taxable amount of the employee. */
23
+ netTaxableYtd: number | null;
24
+ /** The total cost to the employer. */
25
+ totalCostEmployer: number | null;
26
+ /** The total taxes and deductions of the employee. */
27
+ totalTaxesAndDeductions: number | null;
28
+ /** Confidence score */
29
+ confidence: number;
30
+ /** The document page on which the information was found. */
31
+ pageId: number;
32
+ /**
33
+ * Contains the relative vertices coordinates (points) of a polygon containing
34
+ * the field in the document.
35
+ */
36
+ polygon: Polygon;
37
+ constructor({ prediction }: StringDict);
38
+ /**
39
+ * Default string representation.
40
+ */
41
+ toString(): string;
42
+ /**
43
+ * Output in a format suitable for inclusion in a field list.
44
+ */
45
+ toFieldList(): string;
46
+ }
@@ -0,0 +1,168 @@
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 _PayslipV2PayDetail_instances, _PayslipV2PayDetail_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PayslipV2PayDetail = void 0;
10
+ const common_1 = require("../../../parsing/common");
11
+ /**
12
+ * Detailed information about the pay.
13
+ */
14
+ class PayslipV2PayDetail {
15
+ constructor({ prediction = {} }) {
16
+ _PayslipV2PayDetail_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["gross_salary"] !== undefined &&
25
+ prediction["gross_salary"] !== null &&
26
+ !isNaN(prediction["gross_salary"])) {
27
+ this.grossSalary = +parseFloat(prediction["gross_salary"]);
28
+ }
29
+ else {
30
+ this.grossSalary = null;
31
+ }
32
+ if (prediction["gross_salary_ytd"] !== undefined &&
33
+ prediction["gross_salary_ytd"] !== null &&
34
+ !isNaN(prediction["gross_salary_ytd"])) {
35
+ this.grossSalaryYtd = +parseFloat(prediction["gross_salary_ytd"]);
36
+ }
37
+ else {
38
+ this.grossSalaryYtd = null;
39
+ }
40
+ if (prediction["income_tax_rate"] !== undefined &&
41
+ prediction["income_tax_rate"] !== null &&
42
+ !isNaN(prediction["income_tax_rate"])) {
43
+ this.incomeTaxRate = +parseFloat(prediction["income_tax_rate"]);
44
+ }
45
+ else {
46
+ this.incomeTaxRate = null;
47
+ }
48
+ if (prediction["income_tax_withheld"] !== undefined &&
49
+ prediction["income_tax_withheld"] !== null &&
50
+ !isNaN(prediction["income_tax_withheld"])) {
51
+ this.incomeTaxWithheld = +parseFloat(prediction["income_tax_withheld"]);
52
+ }
53
+ else {
54
+ this.incomeTaxWithheld = null;
55
+ }
56
+ if (prediction["net_paid"] !== undefined &&
57
+ prediction["net_paid"] !== null &&
58
+ !isNaN(prediction["net_paid"])) {
59
+ this.netPaid = +parseFloat(prediction["net_paid"]);
60
+ }
61
+ else {
62
+ this.netPaid = null;
63
+ }
64
+ if (prediction["net_paid_before_tax"] !== undefined &&
65
+ prediction["net_paid_before_tax"] !== null &&
66
+ !isNaN(prediction["net_paid_before_tax"])) {
67
+ this.netPaidBeforeTax = +parseFloat(prediction["net_paid_before_tax"]);
68
+ }
69
+ else {
70
+ this.netPaidBeforeTax = null;
71
+ }
72
+ if (prediction["net_taxable"] !== undefined &&
73
+ prediction["net_taxable"] !== null &&
74
+ !isNaN(prediction["net_taxable"])) {
75
+ this.netTaxable = +parseFloat(prediction["net_taxable"]);
76
+ }
77
+ else {
78
+ this.netTaxable = null;
79
+ }
80
+ if (prediction["net_taxable_ytd"] !== undefined &&
81
+ prediction["net_taxable_ytd"] !== null &&
82
+ !isNaN(prediction["net_taxable_ytd"])) {
83
+ this.netTaxableYtd = +parseFloat(prediction["net_taxable_ytd"]);
84
+ }
85
+ else {
86
+ this.netTaxableYtd = null;
87
+ }
88
+ if (prediction["total_cost_employer"] !== undefined &&
89
+ prediction["total_cost_employer"] !== null &&
90
+ !isNaN(prediction["total_cost_employer"])) {
91
+ this.totalCostEmployer = +parseFloat(prediction["total_cost_employer"]);
92
+ }
93
+ else {
94
+ this.totalCostEmployer = null;
95
+ }
96
+ if (prediction["total_taxes_and_deductions"] !== undefined &&
97
+ prediction["total_taxes_and_deductions"] !== null &&
98
+ !isNaN(prediction["total_taxes_and_deductions"])) {
99
+ this.totalTaxesAndDeductions = +parseFloat(prediction["total_taxes_and_deductions"]);
100
+ }
101
+ else {
102
+ this.totalTaxesAndDeductions = null;
103
+ }
104
+ this.pageId = prediction["page_id"];
105
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
106
+ if (prediction["polygon"]) {
107
+ this.polygon = prediction.polygon;
108
+ }
109
+ }
110
+ /**
111
+ * Default string representation.
112
+ */
113
+ toString() {
114
+ const printable = __classPrivateFieldGet(this, _PayslipV2PayDetail_instances, "m", _PayslipV2PayDetail_printableValues).call(this);
115
+ return ("Gross Salary: " +
116
+ printable.grossSalary +
117
+ ", Gross Salary YTD: " +
118
+ printable.grossSalaryYtd +
119
+ ", Income Tax Rate: " +
120
+ printable.incomeTaxRate +
121
+ ", Income Tax Withheld: " +
122
+ printable.incomeTaxWithheld +
123
+ ", Net Paid: " +
124
+ printable.netPaid +
125
+ ", Net Paid Before Tax: " +
126
+ printable.netPaidBeforeTax +
127
+ ", Net Taxable: " +
128
+ printable.netTaxable +
129
+ ", Net Taxable YTD: " +
130
+ printable.netTaxableYtd +
131
+ ", Total Cost Employer: " +
132
+ printable.totalCostEmployer +
133
+ ", Total Taxes and Deductions: " +
134
+ printable.totalTaxesAndDeductions);
135
+ }
136
+ /**
137
+ * Output in a format suitable for inclusion in a field list.
138
+ */
139
+ toFieldList() {
140
+ const printable = __classPrivateFieldGet(this, _PayslipV2PayDetail_instances, "m", _PayslipV2PayDetail_printableValues).call(this);
141
+ return `
142
+ :Gross Salary: ${printable.grossSalary}
143
+ :Gross Salary YTD: ${printable.grossSalaryYtd}
144
+ :Income Tax Rate: ${printable.incomeTaxRate}
145
+ :Income Tax Withheld: ${printable.incomeTaxWithheld}
146
+ :Net Paid: ${printable.netPaid}
147
+ :Net Paid Before Tax: ${printable.netPaidBeforeTax}
148
+ :Net Taxable: ${printable.netTaxable}
149
+ :Net Taxable YTD: ${printable.netTaxableYtd}
150
+ :Total Cost Employer: ${printable.totalCostEmployer}
151
+ :Total Taxes and Deductions: ${printable.totalTaxesAndDeductions}`.trimEnd();
152
+ }
153
+ }
154
+ exports.PayslipV2PayDetail = PayslipV2PayDetail;
155
+ _PayslipV2PayDetail_instances = new WeakSet(), _PayslipV2PayDetail_printableValues = function _PayslipV2PayDetail_printableValues() {
156
+ return {
157
+ grossSalary: this.grossSalary !== undefined ? (0, common_1.floatToString)(this.grossSalary) : "",
158
+ grossSalaryYtd: this.grossSalaryYtd !== undefined ? (0, common_1.floatToString)(this.grossSalaryYtd) : "",
159
+ incomeTaxRate: this.incomeTaxRate !== undefined ? (0, common_1.floatToString)(this.incomeTaxRate) : "",
160
+ incomeTaxWithheld: this.incomeTaxWithheld !== undefined ? (0, common_1.floatToString)(this.incomeTaxWithheld) : "",
161
+ netPaid: this.netPaid !== undefined ? (0, common_1.floatToString)(this.netPaid) : "",
162
+ netPaidBeforeTax: this.netPaidBeforeTax !== undefined ? (0, common_1.floatToString)(this.netPaidBeforeTax) : "",
163
+ netTaxable: this.netTaxable !== undefined ? (0, common_1.floatToString)(this.netTaxable) : "",
164
+ netTaxableYtd: this.netTaxableYtd !== undefined ? (0, common_1.floatToString)(this.netTaxableYtd) : "",
165
+ totalCostEmployer: this.totalCostEmployer !== undefined ? (0, common_1.floatToString)(this.totalCostEmployer) : "",
166
+ totalTaxesAndDeductions: this.totalTaxesAndDeductions !== undefined ? (0, common_1.floatToString)(this.totalTaxesAndDeductions) : "",
167
+ };
168
+ };