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
|
@@ -0,0 +1,110 @@
|
|
|
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 _PayslipV3SalaryDetail_instances, _PayslipV3SalaryDetail_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PayslipV3SalaryDetail = void 0;
|
|
10
|
+
const common_1 = require("../../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* Detailed information about the earnings.
|
|
13
|
+
*/
|
|
14
|
+
class PayslipV3SalaryDetail {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_PayslipV3SalaryDetail_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["number"] !== undefined &&
|
|
42
|
+
prediction["number"] !== null &&
|
|
43
|
+
!isNaN(prediction["number"])) {
|
|
44
|
+
this.number = +parseFloat(prediction["number"]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.number = null;
|
|
48
|
+
}
|
|
49
|
+
if (prediction["rate"] !== undefined &&
|
|
50
|
+
prediction["rate"] !== null &&
|
|
51
|
+
!isNaN(prediction["rate"])) {
|
|
52
|
+
this.rate = +parseFloat(prediction["rate"]);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.rate = null;
|
|
56
|
+
}
|
|
57
|
+
this.pageId = prediction["page_id"];
|
|
58
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
59
|
+
if (prediction["polygon"]) {
|
|
60
|
+
this.polygon = prediction.polygon;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Default string representation.
|
|
65
|
+
*/
|
|
66
|
+
toString() {
|
|
67
|
+
const printable = __classPrivateFieldGet(this, _PayslipV3SalaryDetail_instances, "m", _PayslipV3SalaryDetail_printableValues).call(this);
|
|
68
|
+
return ("Amount: " +
|
|
69
|
+
printable.amount +
|
|
70
|
+
", Base: " +
|
|
71
|
+
printable.base +
|
|
72
|
+
", Description: " +
|
|
73
|
+
printable.description +
|
|
74
|
+
", Number: " +
|
|
75
|
+
printable.number +
|
|
76
|
+
", Rate: " +
|
|
77
|
+
printable.rate);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
81
|
+
*/
|
|
82
|
+
toTableLine() {
|
|
83
|
+
const printable = __classPrivateFieldGet(this, _PayslipV3SalaryDetail_instances, "m", _PayslipV3SalaryDetail_printableValues).call(this);
|
|
84
|
+
return ("| " +
|
|
85
|
+
printable.amount.padEnd(12) +
|
|
86
|
+
" | " +
|
|
87
|
+
printable.base.padEnd(9) +
|
|
88
|
+
" | " +
|
|
89
|
+
printable.description.padEnd(36) +
|
|
90
|
+
" | " +
|
|
91
|
+
printable.number.padEnd(6) +
|
|
92
|
+
" | " +
|
|
93
|
+
printable.rate.padEnd(9) +
|
|
94
|
+
" |");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.PayslipV3SalaryDetail = PayslipV3SalaryDetail;
|
|
98
|
+
_PayslipV3SalaryDetail_instances = new WeakSet(), _PayslipV3SalaryDetail_printableValues = function _PayslipV3SalaryDetail_printableValues() {
|
|
99
|
+
return {
|
|
100
|
+
amount: this.amount !== undefined ? (0, common_1.floatToString)(this.amount) : "",
|
|
101
|
+
base: this.base !== undefined ? (0, common_1.floatToString)(this.base) : "",
|
|
102
|
+
description: this.description ?
|
|
103
|
+
this.description.length <= 36 ?
|
|
104
|
+
(0, common_1.cleanSpecialChars)(this.description) :
|
|
105
|
+
(0, common_1.cleanSpecialChars)(this.description).slice(0, 33) + "..." :
|
|
106
|
+
"",
|
|
107
|
+
number: this.number !== undefined ? (0, common_1.floatToString)(this.number) : "",
|
|
108
|
+
rate: this.rate !== undefined ? (0, common_1.floatToString)(this.rate) : "",
|
|
109
|
+
};
|
|
110
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
2
|
import { ClassificationField, DateField, StringField } from "../../../parsing/standard";
|
|
3
3
|
/**
|
|
4
|
-
* Passport - India API version 1.
|
|
4
|
+
* Passport - India API version 1.1 document data.
|
|
5
5
|
*/
|
|
6
6
|
export declare class IndianPassportV1Document implements Prediction {
|
|
7
7
|
/** The first line of the address of the passport holder. */
|
|
@@ -4,7 +4,7 @@ exports.IndianPassportV1Document = void 0;
|
|
|
4
4
|
const common_1 = require("../../../parsing/common");
|
|
5
5
|
const standard_1 = require("../../../parsing/standard");
|
|
6
6
|
/**
|
|
7
|
-
* Passport - India API version 1.
|
|
7
|
+
* Passport - India API version 1.1 document data.
|
|
8
8
|
*/
|
|
9
9
|
class IndianPassportV1Document {
|
|
10
10
|
constructor(rawPrediction, pageId) {
|
package/src/product/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export { BusinessCardV1 } from "./businessCard/businessCardV1";
|
|
|
4
4
|
export { CropperV1 } from "./cropper/cropperV1";
|
|
5
5
|
export { CustomV1 } from "./custom/customV1";
|
|
6
6
|
export { DeliveryNoteV1 } from "./deliveryNote/deliveryNoteV1";
|
|
7
|
+
export { DriverLicenseV1 } from "./driverLicense/driverLicenseV1";
|
|
7
8
|
export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
|
|
8
9
|
export { GeneratedV1 } from "./generated/generatedV1";
|
|
9
|
-
export { InternationalIdV1 } from "./internationalId/internationalIdV1";
|
|
10
10
|
export { InternationalIdV2 } from "./internationalId/internationalIdV2";
|
|
11
11
|
export { InvoiceV4 } from "./invoice/invoiceV4";
|
|
12
12
|
export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
|
package/src/product/index.js
CHANGED
|
@@ -23,7 +23,7 @@ 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.ind = 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.
|
|
26
|
+
exports.us = exports.ind = 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.GeneratedV1 = exports.FinancialDocumentV1 = exports.DriverLicenseV1 = exports.DeliveryNoteV1 = exports.CustomV1 = exports.CropperV1 = exports.BusinessCardV1 = 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
29
|
var billOfLadingV1_1 = require("./billOfLading/billOfLadingV1");
|
|
@@ -36,12 +36,12 @@ var customV1_1 = require("./custom/customV1");
|
|
|
36
36
|
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
|
|
37
37
|
var deliveryNoteV1_1 = require("./deliveryNote/deliveryNoteV1");
|
|
38
38
|
Object.defineProperty(exports, "DeliveryNoteV1", { enumerable: true, get: function () { return deliveryNoteV1_1.DeliveryNoteV1; } });
|
|
39
|
+
var driverLicenseV1_1 = require("./driverLicense/driverLicenseV1");
|
|
40
|
+
Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
|
|
39
41
|
var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
|
|
40
42
|
Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
|
|
41
43
|
var generatedV1_1 = require("./generated/generatedV1");
|
|
42
44
|
Object.defineProperty(exports, "GeneratedV1", { enumerable: true, get: function () { return generatedV1_1.GeneratedV1; } });
|
|
43
|
-
var internationalIdV1_1 = require("./internationalId/internationalIdV1");
|
|
44
|
-
Object.defineProperty(exports, "InternationalIdV1", { enumerable: true, get: function () { return internationalIdV1_1.InternationalIdV1; } });
|
|
45
45
|
var internationalIdV2_1 = require("./internationalId/internationalIdV2");
|
|
46
46
|
Object.defineProperty(exports, "InternationalIdV2", { enumerable: true, get: function () { return internationalIdV2_1.InternationalIdV2; } });
|
|
47
47
|
var invoiceV4_1 = require("./invoice/invoiceV4");
|
|
@@ -4,6 +4,7 @@ export * as businessCard from "./businessCard/internal";
|
|
|
4
4
|
export * as cropper from "./cropper/internal";
|
|
5
5
|
export * as custom from "./custom/internal";
|
|
6
6
|
export * as deliveryNote from "./deliveryNote/internal";
|
|
7
|
+
export * as driverLicense from "./driverLicense/internal";
|
|
7
8
|
export * as eu from "./eu/internal";
|
|
8
9
|
export * as financialDocument from "./financialDocument/internal";
|
|
9
10
|
export * as fr from "./fr/internal";
|
package/src/product/internal.js
CHANGED
|
@@ -23,13 +23,14 @@ 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.nutritionFactsLabel = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.generated = exports.fr = exports.financialDocument = exports.eu = exports.deliveryNote = exports.custom = exports.cropper = exports.businessCard = exports.billOfLading = 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.driverLicense = exports.deliveryNote = exports.custom = exports.cropper = exports.businessCard = exports.billOfLading = exports.barcodeReader = void 0;
|
|
27
27
|
exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
|
|
28
28
|
exports.billOfLading = __importStar(require("./billOfLading/internal"));
|
|
29
29
|
exports.businessCard = __importStar(require("./businessCard/internal"));
|
|
30
30
|
exports.cropper = __importStar(require("./cropper/internal"));
|
|
31
31
|
exports.custom = __importStar(require("./custom/internal"));
|
|
32
32
|
exports.deliveryNote = __importStar(require("./deliveryNote/internal"));
|
|
33
|
+
exports.driverLicense = __importStar(require("./driverLicense/internal"));
|
|
33
34
|
exports.eu = __importStar(require("./eu/internal"));
|
|
34
35
|
exports.financialDocument = __importStar(require("./financialDocument/internal"));
|
|
35
36
|
exports.fr = __importStar(require("./fr/internal"));
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InternationalIdV2Document = exports.InternationalIdV2 =
|
|
4
|
-
var internationalIdV1_1 = require("./internationalIdV1");
|
|
5
|
-
Object.defineProperty(exports, "InternationalIdV1", { enumerable: true, get: function () { return internationalIdV1_1.InternationalIdV1; } });
|
|
6
|
-
var internationalIdV1Document_1 = require("./internationalIdV1Document");
|
|
7
|
-
Object.defineProperty(exports, "InternationalIdV1Document", { enumerable: true, get: function () { return internationalIdV1Document_1.InternationalIdV1Document; } });
|
|
3
|
+
exports.InternationalIdV2Document = exports.InternationalIdV2 = void 0;
|
|
8
4
|
var internationalIdV2_1 = require("./internationalIdV2");
|
|
9
5
|
Object.defineProperty(exports, "InternationalIdV2", { enumerable: true, get: function () { return internationalIdV2_1.InternationalIdV2; } });
|
|
10
6
|
var internationalIdV2Document_1 = require("./internationalIdV2Document");
|
|
@@ -6,7 +6,7 @@ import { ResumeV1ProfessionalExperience } from "./resumeV1ProfessionalExperience
|
|
|
6
6
|
import { ResumeV1Certificate } from "./resumeV1Certificate";
|
|
7
7
|
import { ClassificationField, StringField } from "../../parsing/standard";
|
|
8
8
|
/**
|
|
9
|
-
* Resume API version 1.
|
|
9
|
+
* Resume API version 1.2 document data.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ResumeV1Document implements Prediction {
|
|
12
12
|
/** The location information of the candidate, including city, state, and country. */
|
|
@@ -9,7 +9,7 @@ const resumeV1ProfessionalExperience_1 = require("./resumeV1ProfessionalExperien
|
|
|
9
9
|
const resumeV1Certificate_1 = require("./resumeV1Certificate");
|
|
10
10
|
const standard_1 = require("../../parsing/standard");
|
|
11
11
|
/**
|
|
12
|
-
* Resume API version 1.
|
|
12
|
+
* Resume API version 1.2 document data.
|
|
13
13
|
*/
|
|
14
14
|
class ResumeV1Document {
|
|
15
15
|
constructor(rawPrediction, pageId) {
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
-
import { ClassificationField, DateField, StringField } from "../../parsing/standard";
|
|
3
|
-
/**
|
|
4
|
-
* Document data for International ID, API version 1.
|
|
5
|
-
*/
|
|
6
|
-
export declare class InternationalIdV1Document implements Prediction {
|
|
7
|
-
/** The physical location of the document holder's residence. */
|
|
8
|
-
address: StringField;
|
|
9
|
-
/** The date of birth of the document holder. */
|
|
10
|
-
birthDate: DateField;
|
|
11
|
-
/** The location where the document holder was born. */
|
|
12
|
-
birthPlace: StringField;
|
|
13
|
-
/** The country that issued the identification document. */
|
|
14
|
-
countryOfIssue: StringField;
|
|
15
|
-
/** The unique identifier assigned to the identification document. */
|
|
16
|
-
documentNumber: StringField;
|
|
17
|
-
/** The type of identification document being used. */
|
|
18
|
-
documentType: ClassificationField;
|
|
19
|
-
/** The date when the document will no longer be valid for use. */
|
|
20
|
-
expiryDate: DateField;
|
|
21
|
-
/** The first names or given names of the document holder. */
|
|
22
|
-
givenNames: StringField[];
|
|
23
|
-
/** The date when the document was issued. */
|
|
24
|
-
issueDate: DateField;
|
|
25
|
-
/** First line of information in a standardized format for easy machine reading and processing. */
|
|
26
|
-
mrz1: StringField;
|
|
27
|
-
/** Second line of information in a standardized format for easy machine reading and processing. */
|
|
28
|
-
mrz2: StringField;
|
|
29
|
-
/** Third line of information in a standardized format for easy machine reading and processing. */
|
|
30
|
-
mrz3: StringField;
|
|
31
|
-
/** Indicates the country of citizenship or nationality of the document holder. */
|
|
32
|
-
nationality: StringField;
|
|
33
|
-
/** The document holder's biological sex, such as male or female. */
|
|
34
|
-
sex: StringField;
|
|
35
|
-
/** The surnames of the document holder. */
|
|
36
|
-
surnames: StringField[];
|
|
37
|
-
constructor(rawPrediction: StringDict, pageId?: number);
|
|
38
|
-
/**
|
|
39
|
-
* Default string representation.
|
|
40
|
-
*/
|
|
41
|
-
toString(): string;
|
|
42
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InternationalIdV1Document = void 0;
|
|
4
|
-
const common_1 = require("../../parsing/common");
|
|
5
|
-
const standard_1 = require("../../parsing/standard");
|
|
6
|
-
/**
|
|
7
|
-
* Document data for International ID, API version 1.
|
|
8
|
-
*/
|
|
9
|
-
class InternationalIdV1Document {
|
|
10
|
-
constructor(rawPrediction, pageId) {
|
|
11
|
-
/** The first names or given names of the document holder. */
|
|
12
|
-
this.givenNames = [];
|
|
13
|
-
/** The surnames of the document holder. */
|
|
14
|
-
this.surnames = [];
|
|
15
|
-
this.address = new standard_1.StringField({
|
|
16
|
-
prediction: rawPrediction["address"],
|
|
17
|
-
pageId: pageId,
|
|
18
|
-
});
|
|
19
|
-
this.birthDate = new standard_1.DateField({
|
|
20
|
-
prediction: rawPrediction["birth_date"],
|
|
21
|
-
pageId: pageId,
|
|
22
|
-
});
|
|
23
|
-
this.birthPlace = new standard_1.StringField({
|
|
24
|
-
prediction: rawPrediction["birth_place"],
|
|
25
|
-
pageId: pageId,
|
|
26
|
-
});
|
|
27
|
-
this.countryOfIssue = new standard_1.StringField({
|
|
28
|
-
prediction: rawPrediction["country_of_issue"],
|
|
29
|
-
pageId: pageId,
|
|
30
|
-
});
|
|
31
|
-
this.documentNumber = new standard_1.StringField({
|
|
32
|
-
prediction: rawPrediction["document_number"],
|
|
33
|
-
pageId: pageId,
|
|
34
|
-
});
|
|
35
|
-
this.documentType = new standard_1.ClassificationField({
|
|
36
|
-
prediction: rawPrediction["document_type"],
|
|
37
|
-
});
|
|
38
|
-
this.expiryDate = new standard_1.DateField({
|
|
39
|
-
prediction: rawPrediction["expiry_date"],
|
|
40
|
-
pageId: pageId,
|
|
41
|
-
});
|
|
42
|
-
rawPrediction["given_names"] &&
|
|
43
|
-
rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
|
|
44
|
-
prediction: itemPrediction,
|
|
45
|
-
pageId: pageId,
|
|
46
|
-
})));
|
|
47
|
-
this.issueDate = new standard_1.DateField({
|
|
48
|
-
prediction: rawPrediction["issue_date"],
|
|
49
|
-
pageId: pageId,
|
|
50
|
-
});
|
|
51
|
-
this.mrz1 = new standard_1.StringField({
|
|
52
|
-
prediction: rawPrediction["mrz1"],
|
|
53
|
-
pageId: pageId,
|
|
54
|
-
});
|
|
55
|
-
this.mrz2 = new standard_1.StringField({
|
|
56
|
-
prediction: rawPrediction["mrz2"],
|
|
57
|
-
pageId: pageId,
|
|
58
|
-
});
|
|
59
|
-
this.mrz3 = new standard_1.StringField({
|
|
60
|
-
prediction: rawPrediction["mrz3"],
|
|
61
|
-
pageId: pageId,
|
|
62
|
-
});
|
|
63
|
-
this.nationality = new standard_1.StringField({
|
|
64
|
-
prediction: rawPrediction["nationality"],
|
|
65
|
-
pageId: pageId,
|
|
66
|
-
});
|
|
67
|
-
this.sex = new standard_1.StringField({
|
|
68
|
-
prediction: rawPrediction["sex"],
|
|
69
|
-
pageId: pageId,
|
|
70
|
-
});
|
|
71
|
-
rawPrediction["surnames"] &&
|
|
72
|
-
rawPrediction["surnames"].map((itemPrediction) => this.surnames.push(new standard_1.StringField({
|
|
73
|
-
prediction: itemPrediction,
|
|
74
|
-
pageId: pageId,
|
|
75
|
-
})));
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Default string representation.
|
|
79
|
-
*/
|
|
80
|
-
toString() {
|
|
81
|
-
const surnames = this.surnames.join("\n ");
|
|
82
|
-
const givenNames = this.givenNames.join("\n ");
|
|
83
|
-
const outStr = `:Document Type: ${this.documentType}
|
|
84
|
-
:Document Number: ${this.documentNumber}
|
|
85
|
-
:Country of Issue: ${this.countryOfIssue}
|
|
86
|
-
:Surnames: ${surnames}
|
|
87
|
-
:Given Names: ${givenNames}
|
|
88
|
-
:Gender: ${this.sex}
|
|
89
|
-
:Birth date: ${this.birthDate}
|
|
90
|
-
:Birth Place: ${this.birthPlace}
|
|
91
|
-
:Nationality: ${this.nationality}
|
|
92
|
-
:Issue Date: ${this.issueDate}
|
|
93
|
-
:Expiry Date: ${this.expiryDate}
|
|
94
|
-
:Address: ${this.address}
|
|
95
|
-
:Machine Readable Zone Line 1: ${this.mrz1}
|
|
96
|
-
:Machine Readable Zone Line 2: ${this.mrz2}
|
|
97
|
-
:Machine Readable Zone Line 3: ${this.mrz3}`.trimEnd();
|
|
98
|
-
return (0, common_1.cleanOutString)(outStr);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.InternationalIdV1Document = InternationalIdV1Document;
|