mindee 4.8.2 → 4.9.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 +9 -0
- package/README.md +6 -3
- package/package.json +1 -1
- package/src/cli.js +40 -0
- package/src/product/barcodeReader/barcodeReaderV1.js +6 -1
- package/src/product/cropper/cropperV1.js +6 -1
- package/src/product/eu/driverLicense/driverLicenseV1.d.ts +17 -0
- package/src/product/eu/driverLicense/driverLicenseV1.js +28 -0
- package/src/product/eu/driverLicense/driverLicenseV1Document.d.ts +36 -0
- package/src/product/eu/driverLicense/driverLicenseV1Document.js +79 -0
- package/src/product/eu/driverLicense/driverLicenseV1Page.d.ts +14 -0
- package/src/product/eu/driverLicense/driverLicenseV1Page.js +29 -0
- package/src/product/eu/driverLicense/internal.d.ts +2 -0
- package/src/product/eu/driverLicense/internal.js +7 -0
- package/src/product/eu/index.d.ts +1 -0
- package/src/product/eu/index.js +3 -1
- package/src/product/eu/internal.d.ts +1 -0
- package/src/product/eu/internal.js +2 -1
- package/src/product/eu/licensePlate/licensePlateV1.js +6 -1
- package/src/product/financialDocument/financialDocumentV1.js +6 -1
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +6 -1
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +6 -1
- package/src/product/fr/carteGrise/carteGriseV1.js +6 -1
- package/src/product/fr/carteVitale/carteVitaleV1.js +6 -1
- package/src/product/fr/idCard/idCardV1.js +6 -1
- package/src/product/fr/idCard/idCardV2.js +6 -1
- package/src/product/index.d.ts +3 -0
- package/src/product/index.js +7 -1
- package/src/product/internal.d.ts +2 -0
- package/src/product/internal.js +3 -1
- package/src/product/internationalId/internal.d.ts +4 -0
- package/src/product/internationalId/internal.js +11 -0
- package/src/product/internationalId/internationalIdV1.d.ts +16 -0
- package/src/product/internationalId/internationalIdV1.js +27 -0
- package/src/product/internationalId/internationalIdV1Document.d.ts +42 -0
- package/src/product/internationalId/internationalIdV1Document.js +101 -0
- package/src/product/internationalId/internationalIdV2.d.ts +16 -0
- package/src/product/internationalId/internationalIdV2.js +27 -0
- package/src/product/internationalId/internationalIdV2Document.d.ts +46 -0
- package/src/product/internationalId/internationalIdV2Document.js +111 -0
- package/src/product/invoice/invoiceV4.js +6 -1
- package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +6 -1
- package/src/product/passport/passportV1.js +6 -1
- package/src/product/proofOfAddress/proofOfAddressV1.js +6 -1
- package/src/product/receipt/receiptV5.js +6 -1
- package/src/product/resume/internal.d.ts +7 -0
- package/src/product/resume/internal.js +17 -0
- package/src/product/resume/resumeV1.d.ts +16 -0
- package/src/product/resume/resumeV1.js +27 -0
- package/src/product/resume/resumeV1Certificate.d.ts +34 -0
- package/src/product/resume/resumeV1Certificate.js +87 -0
- package/src/product/resume/resumeV1Document.d.ts +51 -0
- package/src/product/resume/resumeV1Document.js +197 -0
- package/src/product/resume/resumeV1Education.d.ts +40 -0
- package/src/product/resume/resumeV1Education.js +117 -0
- package/src/product/resume/resumeV1Language.d.ts +30 -0
- package/src/product/resume/resumeV1Language.js +67 -0
- package/src/product/resume/resumeV1ProfessionalExperience.d.ts +42 -0
- package/src/product/resume/resumeV1ProfessionalExperience.js +127 -0
- package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +30 -0
- package/src/product/resume/resumeV1SocialNetworksUrl.js +67 -0
- package/src/product/us/bankCheck/bankCheckV1.js +6 -1
- package/src/product/us/driverLicense/driverLicenseV1.js +6 -1
- package/src/product/us/w9/w9V1.js +6 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { InternationalIdV1Document } from "./internationalIdV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for International ID, API version 1.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InternationalIdV1 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: InternationalIdV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<InternationalIdV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternationalIdV1 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const internationalIdV1Document_1 = require("./internationalIdV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for International ID, API version 1.
|
|
8
|
+
*/
|
|
9
|
+
class InternationalIdV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "international_id";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new internationalIdV1Document_1.InternationalIdV1Document(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(internationalIdV1Document_1.InternationalIdV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.InternationalIdV1 = InternationalIdV1;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { InternationalIdV2Document } from "./internationalIdV2Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for International ID, API version 2.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InternationalIdV2 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: InternationalIdV2Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<InternationalIdV2Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternationalIdV2 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const internationalIdV2Document_1 = require("./internationalIdV2Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for International ID, API version 2.
|
|
8
|
+
*/
|
|
9
|
+
class InternationalIdV2 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "international_id";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "2";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new internationalIdV2Document_1.InternationalIdV2Document(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(internationalIdV2Document_1.InternationalIdV2Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.InternationalIdV2 = InternationalIdV2;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
+
import { ClassificationField, DateField, StringField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Document data for International ID, API version 2.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InternationalIdV2Document implements Prediction {
|
|
7
|
+
/** The physical address of the document holder. */
|
|
8
|
+
address: StringField;
|
|
9
|
+
/** The date of birth of the document holder. */
|
|
10
|
+
birthDate: DateField;
|
|
11
|
+
/** The place of birth of the document holder. */
|
|
12
|
+
birthPlace: StringField;
|
|
13
|
+
/** The country where the document was issued. */
|
|
14
|
+
countryOfIssue: StringField;
|
|
15
|
+
/** The unique identifier assigned to the document. */
|
|
16
|
+
documentNumber: StringField;
|
|
17
|
+
/** The type of personal identification document. */
|
|
18
|
+
documentType: ClassificationField;
|
|
19
|
+
/** The date when the document becomes invalid. */
|
|
20
|
+
expiryDate: DateField;
|
|
21
|
+
/** The list of the document holder's given names. */
|
|
22
|
+
givenNames: StringField[];
|
|
23
|
+
/** The date when the document was issued. */
|
|
24
|
+
issueDate: DateField;
|
|
25
|
+
/** The Machine Readable Zone, first line. */
|
|
26
|
+
mrzLine1: StringField;
|
|
27
|
+
/** The Machine Readable Zone, second line. */
|
|
28
|
+
mrzLine2: StringField;
|
|
29
|
+
/** The Machine Readable Zone, third line. */
|
|
30
|
+
mrzLine3: StringField;
|
|
31
|
+
/** The country of citizenship of the document holder. */
|
|
32
|
+
nationality: StringField;
|
|
33
|
+
/** The unique identifier assigned to the document holder. */
|
|
34
|
+
personalNumber: StringField;
|
|
35
|
+
/** The biological sex of the document holder. */
|
|
36
|
+
sex: StringField;
|
|
37
|
+
/** The state or territory where the document was issued. */
|
|
38
|
+
stateOfIssue: StringField;
|
|
39
|
+
/** The list of the document holder's family names. */
|
|
40
|
+
surnames: StringField[];
|
|
41
|
+
constructor(rawPrediction: StringDict, pageId?: number);
|
|
42
|
+
/**
|
|
43
|
+
* Default string representation.
|
|
44
|
+
*/
|
|
45
|
+
toString(): string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternationalIdV2Document = 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 2.
|
|
8
|
+
*/
|
|
9
|
+
class InternationalIdV2Document {
|
|
10
|
+
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** The list of the document holder's given names. */
|
|
12
|
+
this.givenNames = [];
|
|
13
|
+
/** The list of the document holder's family names. */
|
|
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.mrzLine1 = new standard_1.StringField({
|
|
52
|
+
prediction: rawPrediction["mrz_line1"],
|
|
53
|
+
pageId: pageId,
|
|
54
|
+
});
|
|
55
|
+
this.mrzLine2 = new standard_1.StringField({
|
|
56
|
+
prediction: rawPrediction["mrz_line2"],
|
|
57
|
+
pageId: pageId,
|
|
58
|
+
});
|
|
59
|
+
this.mrzLine3 = new standard_1.StringField({
|
|
60
|
+
prediction: rawPrediction["mrz_line3"],
|
|
61
|
+
pageId: pageId,
|
|
62
|
+
});
|
|
63
|
+
this.nationality = new standard_1.StringField({
|
|
64
|
+
prediction: rawPrediction["nationality"],
|
|
65
|
+
pageId: pageId,
|
|
66
|
+
});
|
|
67
|
+
this.personalNumber = new standard_1.StringField({
|
|
68
|
+
prediction: rawPrediction["personal_number"],
|
|
69
|
+
pageId: pageId,
|
|
70
|
+
});
|
|
71
|
+
this.sex = new standard_1.StringField({
|
|
72
|
+
prediction: rawPrediction["sex"],
|
|
73
|
+
pageId: pageId,
|
|
74
|
+
});
|
|
75
|
+
this.stateOfIssue = new standard_1.StringField({
|
|
76
|
+
prediction: rawPrediction["state_of_issue"],
|
|
77
|
+
pageId: pageId,
|
|
78
|
+
});
|
|
79
|
+
rawPrediction["surnames"] &&
|
|
80
|
+
rawPrediction["surnames"].map((itemPrediction) => this.surnames.push(new standard_1.StringField({
|
|
81
|
+
prediction: itemPrediction,
|
|
82
|
+
pageId: pageId,
|
|
83
|
+
})));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Default string representation.
|
|
87
|
+
*/
|
|
88
|
+
toString() {
|
|
89
|
+
const surnames = this.surnames.join("\n ");
|
|
90
|
+
const givenNames = this.givenNames.join("\n ");
|
|
91
|
+
const outStr = `:Document Type: ${this.documentType}
|
|
92
|
+
:Document Number: ${this.documentNumber}
|
|
93
|
+
:Surnames: ${surnames}
|
|
94
|
+
:Given Names: ${givenNames}
|
|
95
|
+
:Sex: ${this.sex}
|
|
96
|
+
:Birth Date: ${this.birthDate}
|
|
97
|
+
:Birth Place: ${this.birthPlace}
|
|
98
|
+
:Nationality: ${this.nationality}
|
|
99
|
+
:Personal Number: ${this.personalNumber}
|
|
100
|
+
:Country of Issue: ${this.countryOfIssue}
|
|
101
|
+
:State of Issue: ${this.stateOfIssue}
|
|
102
|
+
:Issue Date: ${this.issueDate}
|
|
103
|
+
:Expiration Date: ${this.expiryDate}
|
|
104
|
+
:Address: ${this.address}
|
|
105
|
+
:MRZ Line 1: ${this.mrzLine1}
|
|
106
|
+
:MRZ Line 2: ${this.mrzLine2}
|
|
107
|
+
:MRZ Line 3: ${this.mrzLine3}`.trimEnd();
|
|
108
|
+
return (0, common_1.cleanOutString)(outStr);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.InternationalIdV2Document = InternationalIdV2Document;
|
|
@@ -16,7 +16,12 @@ class InvoiceV4 extends common_1.Inference {
|
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
18
|
this.prediction = new invoiceV4Document_1.InvoiceV4Document(rawPrediction["prediction"]);
|
|
19
|
-
|
|
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(invoiceV4Document_1.InvoiceV4Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
exports.InvoiceV4 = InvoiceV4;
|
|
@@ -16,7 +16,12 @@ class MultiReceiptsDetectorV1 extends common_1.Inference {
|
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
18
|
this.prediction = new multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document(rawPrediction["prediction"]);
|
|
19
|
-
|
|
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(multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
exports.MultiReceiptsDetectorV1 = MultiReceiptsDetectorV1;
|
|
@@ -16,7 +16,12 @@ class PassportV1 extends common_1.Inference {
|
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
18
|
this.prediction = new passportV1Document_1.PassportV1Document(rawPrediction["prediction"]);
|
|
19
|
-
|
|
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(passportV1Document_1.PassportV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
exports.PassportV1 = PassportV1;
|
|
@@ -16,7 +16,12 @@ class ProofOfAddressV1 extends common_1.Inference {
|
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
18
|
this.prediction = new proofOfAddressV1Document_1.ProofOfAddressV1Document(rawPrediction["prediction"]);
|
|
19
|
-
|
|
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(proofOfAddressV1Document_1.ProofOfAddressV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
exports.ProofOfAddressV1 = ProofOfAddressV1;
|
|
@@ -16,7 +16,12 @@ class ReceiptV5 extends common_1.Inference {
|
|
|
16
16
|
/** The document's pages. */
|
|
17
17
|
this.pages = [];
|
|
18
18
|
this.prediction = new receiptV5Document_1.ReceiptV5Document(rawPrediction["prediction"]);
|
|
19
|
-
|
|
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(receiptV5Document_1.ReceiptV5Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
exports.ReceiptV5 = ReceiptV5;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ResumeV1 } from "./resumeV1";
|
|
2
|
+
export { ResumeV1Document } from "./resumeV1Document";
|
|
3
|
+
export { ResumeV1Certificate } from "./resumeV1Certificate";
|
|
4
|
+
export { ResumeV1Education } from "./resumeV1Education";
|
|
5
|
+
export { ResumeV1Language } from "./resumeV1Language";
|
|
6
|
+
export { ResumeV1ProfessionalExperience } from "./resumeV1ProfessionalExperience";
|
|
7
|
+
export { ResumeV1SocialNetworksUrl } from "./resumeV1SocialNetworksUrl";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResumeV1SocialNetworksUrl = exports.ResumeV1ProfessionalExperience = exports.ResumeV1Language = exports.ResumeV1Education = exports.ResumeV1Certificate = exports.ResumeV1Document = exports.ResumeV1 = void 0;
|
|
4
|
+
var resumeV1_1 = require("./resumeV1");
|
|
5
|
+
Object.defineProperty(exports, "ResumeV1", { enumerable: true, get: function () { return resumeV1_1.ResumeV1; } });
|
|
6
|
+
var resumeV1Document_1 = require("./resumeV1Document");
|
|
7
|
+
Object.defineProperty(exports, "ResumeV1Document", { enumerable: true, get: function () { return resumeV1Document_1.ResumeV1Document; } });
|
|
8
|
+
var resumeV1Certificate_1 = require("./resumeV1Certificate");
|
|
9
|
+
Object.defineProperty(exports, "ResumeV1Certificate", { enumerable: true, get: function () { return resumeV1Certificate_1.ResumeV1Certificate; } });
|
|
10
|
+
var resumeV1Education_1 = require("./resumeV1Education");
|
|
11
|
+
Object.defineProperty(exports, "ResumeV1Education", { enumerable: true, get: function () { return resumeV1Education_1.ResumeV1Education; } });
|
|
12
|
+
var resumeV1Language_1 = require("./resumeV1Language");
|
|
13
|
+
Object.defineProperty(exports, "ResumeV1Language", { enumerable: true, get: function () { return resumeV1Language_1.ResumeV1Language; } });
|
|
14
|
+
var resumeV1ProfessionalExperience_1 = require("./resumeV1ProfessionalExperience");
|
|
15
|
+
Object.defineProperty(exports, "ResumeV1ProfessionalExperience", { enumerable: true, get: function () { return resumeV1ProfessionalExperience_1.ResumeV1ProfessionalExperience; } });
|
|
16
|
+
var resumeV1SocialNetworksUrl_1 = require("./resumeV1SocialNetworksUrl");
|
|
17
|
+
Object.defineProperty(exports, "ResumeV1SocialNetworksUrl", { enumerable: true, get: function () { return resumeV1SocialNetworksUrl_1.ResumeV1SocialNetworksUrl; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
+
import { ResumeV1Document } from "./resumeV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Resume, API version 1.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ResumeV1 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: ResumeV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
14
|
+
pages: Page<ResumeV1Document>[];
|
|
15
|
+
constructor(rawPrediction: StringDict);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResumeV1 = void 0;
|
|
4
|
+
const common_1 = require("../../parsing/common");
|
|
5
|
+
const resumeV1Document_1 = require("./resumeV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Resume, API version 1.
|
|
8
|
+
*/
|
|
9
|
+
class ResumeV1 extends common_1.Inference {
|
|
10
|
+
constructor(rawPrediction) {
|
|
11
|
+
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
13
|
+
this.endpointName = "resume";
|
|
14
|
+
/** The endpoint's version. */
|
|
15
|
+
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
17
|
+
this.pages = [];
|
|
18
|
+
this.prediction = new resumeV1Document_1.ResumeV1Document(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(resumeV1Document_1.ResumeV1Document, page, page["id"], page["orientation"]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ResumeV1 = ResumeV1;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The list of certificates obtained by the candidate.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ResumeV1Certificate {
|
|
7
|
+
#private;
|
|
8
|
+
/** The grade obtained for the certificate. */
|
|
9
|
+
grade: string | undefined;
|
|
10
|
+
/** The name of certification. */
|
|
11
|
+
name: string | undefined;
|
|
12
|
+
/** The organization or institution that issued the certificate. */
|
|
13
|
+
provider: string | undefined;
|
|
14
|
+
/** The year when a certificate was issued or received. */
|
|
15
|
+
year: string | undefined;
|
|
16
|
+
/** Confidence score */
|
|
17
|
+
confidence: number;
|
|
18
|
+
/** The document page on which the information was found. */
|
|
19
|
+
pageId: number;
|
|
20
|
+
/**
|
|
21
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
22
|
+
* the field in the document.
|
|
23
|
+
*/
|
|
24
|
+
polygon: Polygon;
|
|
25
|
+
constructor({ prediction }: StringDict);
|
|
26
|
+
/**
|
|
27
|
+
* Default string representation.
|
|
28
|
+
*/
|
|
29
|
+
toString(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
32
|
+
*/
|
|
33
|
+
toTableLine(): string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 _ResumeV1Certificate_instances, _ResumeV1Certificate_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ResumeV1Certificate = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* The list of certificates obtained by the candidate.
|
|
12
|
+
*/
|
|
13
|
+
class ResumeV1Certificate {
|
|
14
|
+
constructor({ prediction = {} }) {
|
|
15
|
+
_ResumeV1Certificate_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.grade = prediction["grade"];
|
|
24
|
+
this.name = prediction["name"];
|
|
25
|
+
this.provider = prediction["provider"];
|
|
26
|
+
this.year = prediction["year"];
|
|
27
|
+
this.pageId = prediction["page_id"];
|
|
28
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
29
|
+
if (prediction["polygon"]) {
|
|
30
|
+
this.polygon = prediction.polygon;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Default string representation.
|
|
35
|
+
*/
|
|
36
|
+
toString() {
|
|
37
|
+
const printable = __classPrivateFieldGet(this, _ResumeV1Certificate_instances, "m", _ResumeV1Certificate_printableValues).call(this);
|
|
38
|
+
return ("Grade: " +
|
|
39
|
+
printable.grade +
|
|
40
|
+
", Name: " +
|
|
41
|
+
printable.name +
|
|
42
|
+
", Provider: " +
|
|
43
|
+
printable.provider +
|
|
44
|
+
", Year: " +
|
|
45
|
+
printable.year);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
49
|
+
*/
|
|
50
|
+
toTableLine() {
|
|
51
|
+
const printable = __classPrivateFieldGet(this, _ResumeV1Certificate_instances, "m", _ResumeV1Certificate_printableValues).call(this);
|
|
52
|
+
return ("| " +
|
|
53
|
+
printable.grade.padEnd(10) +
|
|
54
|
+
" | " +
|
|
55
|
+
printable.name.padEnd(30) +
|
|
56
|
+
" | " +
|
|
57
|
+
printable.provider.padEnd(25) +
|
|
58
|
+
" | " +
|
|
59
|
+
printable.year.padEnd(4) +
|
|
60
|
+
" |");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.ResumeV1Certificate = ResumeV1Certificate;
|
|
64
|
+
_ResumeV1Certificate_instances = new WeakSet(), _ResumeV1Certificate_printableValues = function _ResumeV1Certificate_printableValues() {
|
|
65
|
+
return {
|
|
66
|
+
grade: this.grade ?
|
|
67
|
+
this.grade.length <= 10 ?
|
|
68
|
+
this.grade :
|
|
69
|
+
this.grade.slice(0, 7) + "..." :
|
|
70
|
+
"",
|
|
71
|
+
name: this.name ?
|
|
72
|
+
this.name.length <= 30 ?
|
|
73
|
+
this.name :
|
|
74
|
+
this.name.slice(0, 27) + "..." :
|
|
75
|
+
"",
|
|
76
|
+
provider: this.provider ?
|
|
77
|
+
this.provider.length <= 25 ?
|
|
78
|
+
this.provider :
|
|
79
|
+
this.provider.slice(0, 22) + "..." :
|
|
80
|
+
"",
|
|
81
|
+
year: this.year ?
|
|
82
|
+
this.year.length <= 4 ?
|
|
83
|
+
this.year :
|
|
84
|
+
this.year.slice(0, 1) + "..." :
|
|
85
|
+
"",
|
|
86
|
+
};
|
|
87
|
+
};
|