mindee 4.18.1 → 4.20.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.
- package/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/cli.js +10 -20
- package/src/client.d.ts +44 -9
- package/src/client.js +24 -0
- package/src/http/apiSettings.d.ts +2 -0
- package/src/http/apiSettings.js +3 -1
- package/src/http/baseEndpoint.d.ts +10 -1
- package/src/http/baseEndpoint.js +13 -1
- package/src/http/endpoint.d.ts +3 -11
- package/src/http/endpoint.js +26 -22
- package/src/http/error.js +1 -1
- package/src/http/httpParams.d.ts +17 -0
- package/src/http/httpParams.js +2 -0
- package/src/http/index.d.ts +1 -0
- package/src/http/responseValidation.js +6 -0
- package/src/http/workflowEndpoint.d.ts +29 -0
- package/src/http/workflowEndpoint.js +99 -0
- package/src/parsing/common/asyncPredictResponse.d.ts +1 -1
- package/src/parsing/common/asyncPredictResponse.js +10 -9
- package/src/parsing/common/execution.d.ts +39 -0
- package/src/parsing/common/execution.js +32 -0
- package/src/parsing/common/executionFile.d.ts +12 -0
- package/src/parsing/common/executionFile.js +14 -0
- package/src/parsing/common/executionPriority.d.ts +5 -0
- package/src/parsing/common/executionPriority.js +9 -0
- package/src/parsing/common/index.d.ts +4 -1
- package/src/parsing/common/index.js +9 -3
- package/src/parsing/common/workflowResponse.d.ts +17 -0
- package/src/parsing/common/workflowResponse.js +17 -0
- package/src/product/{internationalId/internationalIdV1.d.ts → driverLicense/driverLicenseV1.d.ts} +5 -5
- package/src/product/{internationalId/internationalIdV1.js → driverLicense/driverLicenseV1.js} +8 -8
- package/src/product/driverLicense/driverLicenseV1Document.d.ts +38 -0
- package/src/product/driverLicense/driverLicenseV1Document.js +84 -0
- package/src/product/driverLicense/index.d.ts +1 -0
- package/src/product/driverLicense/index.js +5 -0
- package/src/product/driverLicense/internal.d.ts +2 -0
- package/src/product/driverLicense/internal.js +7 -0
- package/src/product/fr/healthCard/healthCardV1.d.ts +16 -0
- package/src/product/fr/healthCard/healthCardV1.js +27 -0
- package/src/product/fr/healthCard/healthCardV1Document.d.ts +20 -0
- package/src/product/fr/healthCard/healthCardV1Document.js +43 -0
- package/src/product/fr/healthCard/index.d.ts +1 -0
- package/src/product/fr/healthCard/index.js +5 -0
- package/src/product/fr/healthCard/internal.d.ts +2 -0
- package/src/product/fr/healthCard/internal.js +7 -0
- package/src/product/fr/index.d.ts +2 -0
- package/src/product/fr/index.js +5 -1
- package/src/product/fr/internal.d.ts +1 -0
- package/src/product/fr/internal.js +2 -1
- package/src/product/fr/payslip/index.d.ts +1 -0
- package/src/product/fr/payslip/index.js +3 -1
- package/src/product/fr/payslip/internal.d.ts +10 -0
- package/src/product/fr/payslip/internal.js +21 -1
- package/src/product/fr/payslip/payslipV3.d.ts +16 -0
- package/src/product/fr/payslip/payslipV3.js +27 -0
- package/src/product/fr/payslip/payslipV3BankAccountDetail.d.ts +32 -0
- package/src/product/fr/payslip/payslipV3BankAccountDetail.js +62 -0
- package/src/product/fr/payslip/payslipV3Document.d.ts +35 -0
- package/src/product/fr/payslip/payslipV3Document.js +96 -0
- package/src/product/fr/payslip/payslipV3Employee.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employee.js +82 -0
- package/src/product/fr/payslip/payslipV3Employer.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employer.js +82 -0
- package/src/product/fr/payslip/payslipV3Employment.d.ts +40 -0
- package/src/product/fr/payslip/payslipV3Employment.js +82 -0
- package/src/product/fr/payslip/payslipV3PaidTimeOff.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3PaidTimeOff.js +107 -0
- package/src/product/fr/payslip/payslipV3PayDetail.d.ts +46 -0
- package/src/product/fr/payslip/payslipV3PayDetail.js +168 -0
- package/src/product/fr/payslip/payslipV3PayPeriod.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3PayPeriod.js +72 -0
- package/src/product/fr/payslip/payslipV3SalaryDetail.d.ts +36 -0
- package/src/product/fr/payslip/payslipV3SalaryDetail.js +110 -0
- package/src/product/ind/indianPassport/indianPassportV1Document.d.ts +1 -1
- package/src/product/ind/indianPassport/indianPassportV1Document.js +1 -1
- package/src/product/index.d.ts +1 -1
- package/src/product/index.js +3 -3
- package/src/product/internal.d.ts +1 -0
- package/src/product/internal.js +2 -1
- package/src/product/internationalId/internal.d.ts +0 -2
- package/src/product/internationalId/internal.js +1 -5
- package/src/product/resume/resumeV1Document.d.ts +1 -1
- package/src/product/resume/resumeV1Document.js +1 -1
- package/src/product/internationalId/internationalIdV1Document.d.ts +0 -42
- package/src/product/internationalId/internationalIdV1Document.js +0 -101
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayslipV2 = void 0;
|
|
3
|
+
exports.PayslipV3 = exports.PayslipV2 = void 0;
|
|
4
4
|
var payslipV2_1 = require("./payslipV2");
|
|
5
5
|
Object.defineProperty(exports, "PayslipV2", { enumerable: true, get: function () { return payslipV2_1.PayslipV2; } });
|
|
6
|
+
var payslipV3_1 = require("./payslipV3");
|
|
7
|
+
Object.defineProperty(exports, "PayslipV3", { enumerable: true, get: function () { return payslipV3_1.PayslipV3; } });
|
|
@@ -8,3 +8,13 @@ export { PayslipV2PayDetail } from "./payslipV2PayDetail";
|
|
|
8
8
|
export { PayslipV2PayPeriod } from "./payslipV2PayPeriod";
|
|
9
9
|
export { PayslipV2Pto } from "./payslipV2Pto";
|
|
10
10
|
export { PayslipV2SalaryDetail } from "./payslipV2SalaryDetail";
|
|
11
|
+
export { PayslipV3 } from "./payslipV3";
|
|
12
|
+
export { PayslipV3BankAccountDetail } from "./payslipV3BankAccountDetail";
|
|
13
|
+
export { PayslipV3Document } from "./payslipV3Document";
|
|
14
|
+
export { PayslipV3Employee } from "./payslipV3Employee";
|
|
15
|
+
export { PayslipV3Employer } from "./payslipV3Employer";
|
|
16
|
+
export { PayslipV3Employment } from "./payslipV3Employment";
|
|
17
|
+
export { PayslipV3PaidTimeOff } from "./payslipV3PaidTimeOff";
|
|
18
|
+
export { PayslipV3PayDetail } from "./payslipV3PayDetail";
|
|
19
|
+
export { PayslipV3PayPeriod } from "./payslipV3PayPeriod";
|
|
20
|
+
export { PayslipV3SalaryDetail } from "./payslipV3SalaryDetail";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayslipV2SalaryDetail = exports.PayslipV2Pto = exports.PayslipV2PayPeriod = exports.PayslipV2PayDetail = exports.PayslipV2Employment = exports.PayslipV2Employer = exports.PayslipV2Employee = exports.PayslipV2Document = exports.PayslipV2BankAccountDetail = exports.PayslipV2 = void 0;
|
|
3
|
+
exports.PayslipV3SalaryDetail = exports.PayslipV3PayPeriod = exports.PayslipV3PayDetail = exports.PayslipV3PaidTimeOff = exports.PayslipV3Employment = exports.PayslipV3Employer = exports.PayslipV3Employee = exports.PayslipV3Document = exports.PayslipV3BankAccountDetail = exports.PayslipV3 = exports.PayslipV2SalaryDetail = exports.PayslipV2Pto = exports.PayslipV2PayPeriod = exports.PayslipV2PayDetail = exports.PayslipV2Employment = exports.PayslipV2Employer = exports.PayslipV2Employee = exports.PayslipV2Document = exports.PayslipV2BankAccountDetail = exports.PayslipV2 = void 0;
|
|
4
4
|
var payslipV2_1 = require("./payslipV2");
|
|
5
5
|
Object.defineProperty(exports, "PayslipV2", { enumerable: true, get: function () { return payslipV2_1.PayslipV2; } });
|
|
6
6
|
var payslipV2BankAccountDetail_1 = require("./payslipV2BankAccountDetail");
|
|
@@ -21,3 +21,23 @@ var payslipV2Pto_1 = require("./payslipV2Pto");
|
|
|
21
21
|
Object.defineProperty(exports, "PayslipV2Pto", { enumerable: true, get: function () { return payslipV2Pto_1.PayslipV2Pto; } });
|
|
22
22
|
var payslipV2SalaryDetail_1 = require("./payslipV2SalaryDetail");
|
|
23
23
|
Object.defineProperty(exports, "PayslipV2SalaryDetail", { enumerable: true, get: function () { return payslipV2SalaryDetail_1.PayslipV2SalaryDetail; } });
|
|
24
|
+
var payslipV3_1 = require("./payslipV3");
|
|
25
|
+
Object.defineProperty(exports, "PayslipV3", { enumerable: true, get: function () { return payslipV3_1.PayslipV3; } });
|
|
26
|
+
var payslipV3BankAccountDetail_1 = require("./payslipV3BankAccountDetail");
|
|
27
|
+
Object.defineProperty(exports, "PayslipV3BankAccountDetail", { enumerable: true, get: function () { return payslipV3BankAccountDetail_1.PayslipV3BankAccountDetail; } });
|
|
28
|
+
var payslipV3Document_1 = require("./payslipV3Document");
|
|
29
|
+
Object.defineProperty(exports, "PayslipV3Document", { enumerable: true, get: function () { return payslipV3Document_1.PayslipV3Document; } });
|
|
30
|
+
var payslipV3Employee_1 = require("./payslipV3Employee");
|
|
31
|
+
Object.defineProperty(exports, "PayslipV3Employee", { enumerable: true, get: function () { return payslipV3Employee_1.PayslipV3Employee; } });
|
|
32
|
+
var payslipV3Employer_1 = require("./payslipV3Employer");
|
|
33
|
+
Object.defineProperty(exports, "PayslipV3Employer", { enumerable: true, get: function () { return payslipV3Employer_1.PayslipV3Employer; } });
|
|
34
|
+
var payslipV3Employment_1 = require("./payslipV3Employment");
|
|
35
|
+
Object.defineProperty(exports, "PayslipV3Employment", { enumerable: true, get: function () { return payslipV3Employment_1.PayslipV3Employment; } });
|
|
36
|
+
var payslipV3PaidTimeOff_1 = require("./payslipV3PaidTimeOff");
|
|
37
|
+
Object.defineProperty(exports, "PayslipV3PaidTimeOff", { enumerable: true, get: function () { return payslipV3PaidTimeOff_1.PayslipV3PaidTimeOff; } });
|
|
38
|
+
var payslipV3PayDetail_1 = require("./payslipV3PayDetail");
|
|
39
|
+
Object.defineProperty(exports, "PayslipV3PayDetail", { enumerable: true, get: function () { return payslipV3PayDetail_1.PayslipV3PayDetail; } });
|
|
40
|
+
var payslipV3PayPeriod_1 = require("./payslipV3PayPeriod");
|
|
41
|
+
Object.defineProperty(exports, "PayslipV3PayPeriod", { enumerable: true, get: function () { return payslipV3PayPeriod_1.PayslipV3PayPeriod; } });
|
|
42
|
+
var payslipV3SalaryDetail_1 = require("./payslipV3SalaryDetail");
|
|
43
|
+
Object.defineProperty(exports, "PayslipV3SalaryDetail", { enumerable: true, get: function () { return payslipV3SalaryDetail_1.PayslipV3SalaryDetail; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
+
import { PayslipV3Document } from "./payslipV3Document";
|
|
3
|
+
/**
|
|
4
|
+
* Payslip API version 3 inference prediction.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PayslipV3 extends Inference {
|
|
7
|
+
/** The endpoint's name. */
|
|
8
|
+
endpointName: string;
|
|
9
|
+
/** The endpoint's version. */
|
|
10
|
+
endpointVersion: string;
|
|
11
|
+
/** The document-level prediction. */
|
|
12
|
+
prediction: PayslipV3Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<PayslipV3Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayslipV3 = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const payslipV3Document_1 = require("./payslipV3Document");
|
|
6
|
+
/**
|
|
7
|
+
* Payslip API version 3 inference prediction.
|
|
8
|
+
*/
|
|
9
|
+
class PayslipV3 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "payslip_fra";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "3";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new payslipV3Document_1.PayslipV3Document(rawPrediction["prediction"]);
|
|
19
|
+
rawPrediction["pages"].forEach((page) => {
|
|
20
|
+
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
+
Object.keys(page.prediction).length > 0) {
|
|
22
|
+
this.pages.push(new common_1.Page(payslipV3Document_1.PayslipV3Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.PayslipV3 = PayslipV3;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* Information about the employee's bank account.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PayslipV3BankAccountDetail {
|
|
7
|
+
#private;
|
|
8
|
+
/** The name of the bank. */
|
|
9
|
+
bankName: string | null;
|
|
10
|
+
/** The IBAN of the bank account. */
|
|
11
|
+
iban: string | null;
|
|
12
|
+
/** The SWIFT code of the bank. */
|
|
13
|
+
swift: string | 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,62 @@
|
|
|
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 _PayslipV3BankAccountDetail_instances, _PayslipV3BankAccountDetail_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PayslipV3BankAccountDetail = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Information about the employee's bank account.
|
|
12
|
+
*/
|
|
13
|
+
class PayslipV3BankAccountDetail {
|
|
14
|
+
constructor({ prediction = {} }) {
|
|
15
|
+
_PayslipV3BankAccountDetail_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.bankName = prediction["bank_name"];
|
|
24
|
+
this.iban = prediction["iban"];
|
|
25
|
+
this.swift = prediction["swift"];
|
|
26
|
+
this.pageId = prediction["page_id"];
|
|
27
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
28
|
+
if (prediction["polygon"]) {
|
|
29
|
+
this.polygon = prediction.polygon;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Default string representation.
|
|
34
|
+
*/
|
|
35
|
+
toString() {
|
|
36
|
+
const printable = __classPrivateFieldGet(this, _PayslipV3BankAccountDetail_instances, "m", _PayslipV3BankAccountDetail_printableValues).call(this);
|
|
37
|
+
return ("Bank Name: " +
|
|
38
|
+
printable.bankName +
|
|
39
|
+
", IBAN: " +
|
|
40
|
+
printable.iban +
|
|
41
|
+
", SWIFT: " +
|
|
42
|
+
printable.swift);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Output in a format suitable for inclusion in a field list.
|
|
46
|
+
*/
|
|
47
|
+
toFieldList() {
|
|
48
|
+
const printable = __classPrivateFieldGet(this, _PayslipV3BankAccountDetail_instances, "m", _PayslipV3BankAccountDetail_printableValues).call(this);
|
|
49
|
+
return `
|
|
50
|
+
:Bank Name: ${printable.bankName}
|
|
51
|
+
:IBAN: ${printable.iban}
|
|
52
|
+
:SWIFT: ${printable.swift}`.trimEnd();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.PayslipV3BankAccountDetail = PayslipV3BankAccountDetail;
|
|
56
|
+
_PayslipV3BankAccountDetail_instances = new WeakSet(), _PayslipV3BankAccountDetail_printableValues = function _PayslipV3BankAccountDetail_printableValues() {
|
|
57
|
+
return {
|
|
58
|
+
bankName: this.bankName ?? "",
|
|
59
|
+
iban: this.iban ?? "",
|
|
60
|
+
swift: this.swift ?? "",
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
+
import { PayslipV3PayPeriod } from "./payslipV3PayPeriod";
|
|
3
|
+
import { PayslipV3Employee } from "./payslipV3Employee";
|
|
4
|
+
import { PayslipV3Employer } from "./payslipV3Employer";
|
|
5
|
+
import { PayslipV3BankAccountDetail } from "./payslipV3BankAccountDetail";
|
|
6
|
+
import { PayslipV3Employment } from "./payslipV3Employment";
|
|
7
|
+
import { PayslipV3SalaryDetail } from "./payslipV3SalaryDetail";
|
|
8
|
+
import { PayslipV3PayDetail } from "./payslipV3PayDetail";
|
|
9
|
+
import { PayslipV3PaidTimeOff } from "./payslipV3PaidTimeOff";
|
|
10
|
+
/**
|
|
11
|
+
* Payslip API version 3.0 document data.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PayslipV3Document implements Prediction {
|
|
14
|
+
/** Information about the employee's bank account. */
|
|
15
|
+
bankAccountDetails: PayslipV3BankAccountDetail;
|
|
16
|
+
/** Information about the employee. */
|
|
17
|
+
employee: PayslipV3Employee;
|
|
18
|
+
/** Information about the employer. */
|
|
19
|
+
employer: PayslipV3Employer;
|
|
20
|
+
/** Information about the employment. */
|
|
21
|
+
employment: PayslipV3Employment;
|
|
22
|
+
/** Information about paid time off. */
|
|
23
|
+
paidTimeOff: PayslipV3PaidTimeOff[];
|
|
24
|
+
/** Detailed information about the pay. */
|
|
25
|
+
payDetail: PayslipV3PayDetail;
|
|
26
|
+
/** Information about the pay period. */
|
|
27
|
+
payPeriod: PayslipV3PayPeriod;
|
|
28
|
+
/** Detailed information about the earnings. */
|
|
29
|
+
salaryDetails: PayslipV3SalaryDetail[];
|
|
30
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
31
|
+
/**
|
|
32
|
+
* Default string representation.
|
|
33
|
+
*/
|
|
34
|
+
toString(): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayslipV3Document = void 0;
|
|
4
|
+
const common_1 = require("../../../parsing/common");
|
|
5
|
+
const payslipV3PayPeriod_1 = require("./payslipV3PayPeriod");
|
|
6
|
+
const payslipV3Employee_1 = require("./payslipV3Employee");
|
|
7
|
+
const payslipV3Employer_1 = require("./payslipV3Employer");
|
|
8
|
+
const payslipV3BankAccountDetail_1 = require("./payslipV3BankAccountDetail");
|
|
9
|
+
const payslipV3Employment_1 = require("./payslipV3Employment");
|
|
10
|
+
const payslipV3SalaryDetail_1 = require("./payslipV3SalaryDetail");
|
|
11
|
+
const payslipV3PayDetail_1 = require("./payslipV3PayDetail");
|
|
12
|
+
const payslipV3PaidTimeOff_1 = require("./payslipV3PaidTimeOff");
|
|
13
|
+
/**
|
|
14
|
+
* Payslip API version 3.0 document data.
|
|
15
|
+
*/
|
|
16
|
+
class PayslipV3Document {
|
|
17
|
+
constructor(rawPrediction, pageId) {
|
|
18
|
+
/** Information about paid time off. */
|
|
19
|
+
this.paidTimeOff = [];
|
|
20
|
+
/** Detailed information about the earnings. */
|
|
21
|
+
this.salaryDetails = [];
|
|
22
|
+
this.bankAccountDetails = new payslipV3BankAccountDetail_1.PayslipV3BankAccountDetail({
|
|
23
|
+
prediction: rawPrediction["bank_account_details"],
|
|
24
|
+
pageId: pageId,
|
|
25
|
+
});
|
|
26
|
+
this.employee = new payslipV3Employee_1.PayslipV3Employee({
|
|
27
|
+
prediction: rawPrediction["employee"],
|
|
28
|
+
pageId: pageId,
|
|
29
|
+
});
|
|
30
|
+
this.employer = new payslipV3Employer_1.PayslipV3Employer({
|
|
31
|
+
prediction: rawPrediction["employer"],
|
|
32
|
+
pageId: pageId,
|
|
33
|
+
});
|
|
34
|
+
this.employment = new payslipV3Employment_1.PayslipV3Employment({
|
|
35
|
+
prediction: rawPrediction["employment"],
|
|
36
|
+
pageId: pageId,
|
|
37
|
+
});
|
|
38
|
+
rawPrediction["paid_time_off"] &&
|
|
39
|
+
rawPrediction["paid_time_off"].map((itemPrediction) => this.paidTimeOff.push(new payslipV3PaidTimeOff_1.PayslipV3PaidTimeOff({
|
|
40
|
+
prediction: itemPrediction,
|
|
41
|
+
pageId: pageId,
|
|
42
|
+
})));
|
|
43
|
+
this.payDetail = new payslipV3PayDetail_1.PayslipV3PayDetail({
|
|
44
|
+
prediction: rawPrediction["pay_detail"],
|
|
45
|
+
pageId: pageId,
|
|
46
|
+
});
|
|
47
|
+
this.payPeriod = new payslipV3PayPeriod_1.PayslipV3PayPeriod({
|
|
48
|
+
prediction: rawPrediction["pay_period"],
|
|
49
|
+
pageId: pageId,
|
|
50
|
+
});
|
|
51
|
+
rawPrediction["salary_details"] &&
|
|
52
|
+
rawPrediction["salary_details"].map((itemPrediction) => this.salaryDetails.push(new payslipV3SalaryDetail_1.PayslipV3SalaryDetail({
|
|
53
|
+
prediction: itemPrediction,
|
|
54
|
+
pageId: pageId,
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Default string representation.
|
|
59
|
+
*/
|
|
60
|
+
toString() {
|
|
61
|
+
let salaryDetailsSummary = "";
|
|
62
|
+
if (this.salaryDetails && this.salaryDetails.length > 0) {
|
|
63
|
+
const salaryDetailsColSizes = [14, 11, 38, 8, 11];
|
|
64
|
+
salaryDetailsSummary += "\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "-") + "\n ";
|
|
65
|
+
salaryDetailsSummary += "| Amount ";
|
|
66
|
+
salaryDetailsSummary += "| Base ";
|
|
67
|
+
salaryDetailsSummary += "| Description ";
|
|
68
|
+
salaryDetailsSummary += "| Number ";
|
|
69
|
+
salaryDetailsSummary += "| Rate ";
|
|
70
|
+
salaryDetailsSummary += "|\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "=");
|
|
71
|
+
salaryDetailsSummary += this.salaryDetails.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(salaryDetailsColSizes, "-")).join("");
|
|
72
|
+
}
|
|
73
|
+
let paidTimeOffSummary = "";
|
|
74
|
+
if (this.paidTimeOff && this.paidTimeOff.length > 0) {
|
|
75
|
+
const paidTimeOffColSizes = [11, 8, 13, 11, 11];
|
|
76
|
+
paidTimeOffSummary += "\n" + (0, common_1.lineSeparator)(paidTimeOffColSizes, "-") + "\n ";
|
|
77
|
+
paidTimeOffSummary += "| Accrued ";
|
|
78
|
+
paidTimeOffSummary += "| Period ";
|
|
79
|
+
paidTimeOffSummary += "| Type ";
|
|
80
|
+
paidTimeOffSummary += "| Remaining ";
|
|
81
|
+
paidTimeOffSummary += "| Used ";
|
|
82
|
+
paidTimeOffSummary += "|\n" + (0, common_1.lineSeparator)(paidTimeOffColSizes, "=");
|
|
83
|
+
paidTimeOffSummary += this.paidTimeOff.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(paidTimeOffColSizes, "-")).join("");
|
|
84
|
+
}
|
|
85
|
+
const outStr = `:Pay Period: ${this.payPeriod.toFieldList()}
|
|
86
|
+
:Employee: ${this.employee.toFieldList()}
|
|
87
|
+
:Employer: ${this.employer.toFieldList()}
|
|
88
|
+
:Bank Account Details: ${this.bankAccountDetails.toFieldList()}
|
|
89
|
+
:Employment: ${this.employment.toFieldList()}
|
|
90
|
+
:Salary Details: ${salaryDetailsSummary}
|
|
91
|
+
:Pay Detail: ${this.payDetail.toFieldList()}
|
|
92
|
+
:Paid Time Off: ${paidTimeOffSummary}`.trimEnd();
|
|
93
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.PayslipV3Document = PayslipV3Document;
|
|
@@ -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 PayslipV3Employee {
|
|
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 _PayslipV3Employee_instances, _PayslipV3Employee_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PayslipV3Employee = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Information about the employee.
|
|
12
|
+
*/
|
|
13
|
+
class PayslipV3Employee {
|
|
14
|
+
constructor({ prediction = {} }) {
|
|
15
|
+
_PayslipV3Employee_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, _PayslipV3Employee_instances, "m", _PayslipV3Employee_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, _PayslipV3Employee_instances, "m", _PayslipV3Employee_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.PayslipV3Employee = PayslipV3Employee;
|
|
72
|
+
_PayslipV3Employee_instances = new WeakSet(), _PayslipV3Employee_printableValues = function _PayslipV3Employee_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 PayslipV3Employer {
|
|
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 _PayslipV3Employer_instances, _PayslipV3Employer_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PayslipV3Employer = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Information about the employer.
|
|
12
|
+
*/
|
|
13
|
+
class PayslipV3Employer {
|
|
14
|
+
constructor({ prediction = {} }) {
|
|
15
|
+
_PayslipV3Employer_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, _PayslipV3Employer_instances, "m", _PayslipV3Employer_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, _PayslipV3Employer_instances, "m", _PayslipV3Employer_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.PayslipV3Employer = PayslipV3Employer;
|
|
72
|
+
_PayslipV3Employer_instances = new WeakSet(), _PayslipV3Employer_printableValues = function _PayslipV3Employer_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,40 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* Information about the employment.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PayslipV3Employment {
|
|
7
|
+
#private;
|
|
8
|
+
/** The category of the employment. */
|
|
9
|
+
category: string | null;
|
|
10
|
+
/** The coefficient of the employment. */
|
|
11
|
+
coefficient: string | 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 seniority date of the employment. */
|
|
19
|
+
seniorityDate: string | null;
|
|
20
|
+
/** The start date of the employment. */
|
|
21
|
+
startDate: 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
|
+
}
|