mindee 4.8.1 → 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.
Files changed (67) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +6 -3
  3. package/package.json +1 -1
  4. package/src/cli.js +42 -2
  5. package/src/client.d.ts +14 -1
  6. package/src/client.js +16 -14
  7. package/src/parsing/generated/generatedList.js +1 -4
  8. package/src/product/barcodeReader/barcodeReaderV1.js +6 -1
  9. package/src/product/cropper/cropperV1.js +6 -1
  10. package/src/product/eu/driverLicense/driverLicenseV1.d.ts +17 -0
  11. package/src/product/eu/driverLicense/driverLicenseV1.js +28 -0
  12. package/src/product/eu/driverLicense/driverLicenseV1Document.d.ts +36 -0
  13. package/src/product/eu/driverLicense/driverLicenseV1Document.js +79 -0
  14. package/src/product/eu/driverLicense/driverLicenseV1Page.d.ts +14 -0
  15. package/src/product/eu/driverLicense/driverLicenseV1Page.js +29 -0
  16. package/src/product/eu/driverLicense/internal.d.ts +2 -0
  17. package/src/product/eu/driverLicense/internal.js +7 -0
  18. package/src/product/eu/index.d.ts +1 -0
  19. package/src/product/eu/index.js +3 -1
  20. package/src/product/eu/internal.d.ts +1 -0
  21. package/src/product/eu/internal.js +2 -1
  22. package/src/product/eu/licensePlate/licensePlateV1.js +6 -1
  23. package/src/product/financialDocument/financialDocumentV1.js +6 -1
  24. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +6 -1
  25. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +6 -1
  26. package/src/product/fr/carteGrise/carteGriseV1.js +6 -1
  27. package/src/product/fr/carteVitale/carteVitaleV1.js +6 -1
  28. package/src/product/fr/idCard/idCardV1.js +6 -1
  29. package/src/product/fr/idCard/idCardV2.js +6 -1
  30. package/src/product/index.d.ts +3 -0
  31. package/src/product/index.js +7 -1
  32. package/src/product/internal.d.ts +2 -0
  33. package/src/product/internal.js +3 -1
  34. package/src/product/internationalId/internal.d.ts +4 -0
  35. package/src/product/internationalId/internal.js +11 -0
  36. package/src/product/internationalId/internationalIdV1.d.ts +16 -0
  37. package/src/product/internationalId/internationalIdV1.js +27 -0
  38. package/src/product/internationalId/internationalIdV1Document.d.ts +42 -0
  39. package/src/product/internationalId/internationalIdV1Document.js +101 -0
  40. package/src/product/internationalId/internationalIdV2.d.ts +16 -0
  41. package/src/product/internationalId/internationalIdV2.js +27 -0
  42. package/src/product/internationalId/internationalIdV2Document.d.ts +46 -0
  43. package/src/product/internationalId/internationalIdV2Document.js +111 -0
  44. package/src/product/invoice/invoiceV4.js +6 -1
  45. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +6 -1
  46. package/src/product/passport/passportV1.js +6 -1
  47. package/src/product/proofOfAddress/proofOfAddressV1.js +6 -1
  48. package/src/product/receipt/receiptV5.js +6 -1
  49. package/src/product/resume/internal.d.ts +7 -0
  50. package/src/product/resume/internal.js +17 -0
  51. package/src/product/resume/resumeV1.d.ts +16 -0
  52. package/src/product/resume/resumeV1.js +27 -0
  53. package/src/product/resume/resumeV1Certificate.d.ts +34 -0
  54. package/src/product/resume/resumeV1Certificate.js +87 -0
  55. package/src/product/resume/resumeV1Document.d.ts +51 -0
  56. package/src/product/resume/resumeV1Document.js +197 -0
  57. package/src/product/resume/resumeV1Education.d.ts +40 -0
  58. package/src/product/resume/resumeV1Education.js +117 -0
  59. package/src/product/resume/resumeV1Language.d.ts +30 -0
  60. package/src/product/resume/resumeV1Language.js +67 -0
  61. package/src/product/resume/resumeV1ProfessionalExperience.d.ts +42 -0
  62. package/src/product/resume/resumeV1ProfessionalExperience.js +127 -0
  63. package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +30 -0
  64. package/src/product/resume/resumeV1SocialNetworksUrl.js +67 -0
  65. package/src/product/us/bankCheck/bankCheckV1.js +6 -1
  66. package/src/product/us/driverLicense/driverLicenseV1.js +6 -1
  67. package/src/product/us/w9/w9V1.js +6 -1
@@ -0,0 +1,42 @@
1
+ import { StringDict } from "../../parsing/common";
2
+ import { Polygon } from "../../geometry";
3
+ /**
4
+ * The list of the candidate's professional experiences.
5
+ */
6
+ export declare class ResumeV1ProfessionalExperience {
7
+ #private;
8
+ /** The type of contract for the professional experience. */
9
+ contractType: string | undefined;
10
+ /** The specific department or division within the company. */
11
+ department: string | undefined;
12
+ /** The name of the company or organization. */
13
+ employer: string | undefined;
14
+ /** The month when the professional experience ended. */
15
+ endMonth: string | undefined;
16
+ /** The year when the professional experience ended. */
17
+ endYear: string | undefined;
18
+ /** The position or job title held by the candidate. */
19
+ role: string | undefined;
20
+ /** The month when the professional experience began. */
21
+ startMonth: string | undefined;
22
+ /** The year when the professional experience began. */
23
+ startYear: string | undefined;
24
+ /** Confidence score */
25
+ confidence: number;
26
+ /** The document page on which the information was found. */
27
+ pageId: number;
28
+ /**
29
+ * Contains the relative vertices coordinates (points) of a polygon containing
30
+ * the field in the document.
31
+ */
32
+ polygon: Polygon;
33
+ constructor({ prediction }: StringDict);
34
+ /**
35
+ * Default string representation.
36
+ */
37
+ toString(): string;
38
+ /**
39
+ * Output in a format suitable for inclusion in an rST table.
40
+ */
41
+ toTableLine(): string;
42
+ }
@@ -0,0 +1,127 @@
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 _ResumeV1ProfessionalExperience_instances, _ResumeV1ProfessionalExperience_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ResumeV1ProfessionalExperience = void 0;
10
+ /**
11
+ * The list of the candidate's professional experiences.
12
+ */
13
+ class ResumeV1ProfessionalExperience {
14
+ constructor({ prediction = {} }) {
15
+ _ResumeV1ProfessionalExperience_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.contractType = prediction["contract_type"];
24
+ this.department = prediction["department"];
25
+ this.employer = prediction["employer"];
26
+ this.endMonth = prediction["end_month"];
27
+ this.endYear = prediction["end_year"];
28
+ this.role = prediction["role"];
29
+ this.startMonth = prediction["start_month"];
30
+ this.startYear = prediction["start_year"];
31
+ this.pageId = prediction["page_id"];
32
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
33
+ if (prediction["polygon"]) {
34
+ this.polygon = prediction.polygon;
35
+ }
36
+ }
37
+ /**
38
+ * Default string representation.
39
+ */
40
+ toString() {
41
+ const printable = __classPrivateFieldGet(this, _ResumeV1ProfessionalExperience_instances, "m", _ResumeV1ProfessionalExperience_printableValues).call(this);
42
+ return ("Contract Type: " +
43
+ printable.contractType +
44
+ ", Department: " +
45
+ printable.department +
46
+ ", Employer: " +
47
+ printable.employer +
48
+ ", End Month: " +
49
+ printable.endMonth +
50
+ ", End Year: " +
51
+ printable.endYear +
52
+ ", Role: " +
53
+ printable.role +
54
+ ", Start Month: " +
55
+ printable.startMonth +
56
+ ", Start Year: " +
57
+ printable.startYear);
58
+ }
59
+ /**
60
+ * Output in a format suitable for inclusion in an rST table.
61
+ */
62
+ toTableLine() {
63
+ const printable = __classPrivateFieldGet(this, _ResumeV1ProfessionalExperience_instances, "m", _ResumeV1ProfessionalExperience_printableValues).call(this);
64
+ return ("| " +
65
+ printable.contractType.padEnd(15) +
66
+ " | " +
67
+ printable.department.padEnd(10) +
68
+ " | " +
69
+ printable.employer.padEnd(25) +
70
+ " | " +
71
+ printable.endMonth.padEnd(9) +
72
+ " | " +
73
+ printable.endYear.padEnd(8) +
74
+ " | " +
75
+ printable.role.padEnd(20) +
76
+ " | " +
77
+ printable.startMonth.padEnd(11) +
78
+ " | " +
79
+ printable.startYear.padEnd(10) +
80
+ " |");
81
+ }
82
+ }
83
+ exports.ResumeV1ProfessionalExperience = ResumeV1ProfessionalExperience;
84
+ _ResumeV1ProfessionalExperience_instances = new WeakSet(), _ResumeV1ProfessionalExperience_printableValues = function _ResumeV1ProfessionalExperience_printableValues() {
85
+ return {
86
+ contractType: this.contractType ?
87
+ this.contractType.length <= 15 ?
88
+ this.contractType :
89
+ this.contractType.slice(0, 12) + "..." :
90
+ "",
91
+ department: this.department ?
92
+ this.department.length <= 10 ?
93
+ this.department :
94
+ this.department.slice(0, 7) + "..." :
95
+ "",
96
+ employer: this.employer ?
97
+ this.employer.length <= 25 ?
98
+ this.employer :
99
+ this.employer.slice(0, 22) + "..." :
100
+ "",
101
+ endMonth: this.endMonth ?
102
+ this.endMonth.length <= 9 ?
103
+ this.endMonth :
104
+ this.endMonth.slice(0, 6) + "..." :
105
+ "",
106
+ endYear: this.endYear ?
107
+ this.endYear.length <= 8 ?
108
+ this.endYear :
109
+ this.endYear.slice(0, 5) + "..." :
110
+ "",
111
+ role: this.role ?
112
+ this.role.length <= 20 ?
113
+ this.role :
114
+ this.role.slice(0, 17) + "..." :
115
+ "",
116
+ startMonth: this.startMonth ?
117
+ this.startMonth.length <= 11 ?
118
+ this.startMonth :
119
+ this.startMonth.slice(0, 8) + "..." :
120
+ "",
121
+ startYear: this.startYear ?
122
+ this.startYear.length <= 10 ?
123
+ this.startYear :
124
+ this.startYear.slice(0, 7) + "..." :
125
+ "",
126
+ };
127
+ };
@@ -0,0 +1,30 @@
1
+ import { StringDict } from "../../parsing/common";
2
+ import { Polygon } from "../../geometry";
3
+ /**
4
+ * The list of social network profiles of the candidate.
5
+ */
6
+ export declare class ResumeV1SocialNetworksUrl {
7
+ #private;
8
+ /** The name of the social network. */
9
+ name: string | undefined;
10
+ /** The URL of the social network. */
11
+ url: string | undefined;
12
+ /** Confidence score */
13
+ confidence: number;
14
+ /** The document page on which the information was found. */
15
+ pageId: number;
16
+ /**
17
+ * Contains the relative vertices coordinates (points) of a polygon containing
18
+ * the field in the document.
19
+ */
20
+ polygon: Polygon;
21
+ constructor({ prediction }: StringDict);
22
+ /**
23
+ * Default string representation.
24
+ */
25
+ toString(): string;
26
+ /**
27
+ * Output in a format suitable for inclusion in an rST table.
28
+ */
29
+ toTableLine(): string;
30
+ }
@@ -0,0 +1,67 @@
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 _ResumeV1SocialNetworksUrl_instances, _ResumeV1SocialNetworksUrl_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ResumeV1SocialNetworksUrl = void 0;
10
+ /**
11
+ * The list of social network profiles of the candidate.
12
+ */
13
+ class ResumeV1SocialNetworksUrl {
14
+ constructor({ prediction = {} }) {
15
+ _ResumeV1SocialNetworksUrl_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.name = prediction["name"];
24
+ this.url = prediction["url"];
25
+ this.pageId = prediction["page_id"];
26
+ this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
27
+ if (prediction["polygon"]) {
28
+ this.polygon = prediction.polygon;
29
+ }
30
+ }
31
+ /**
32
+ * Default string representation.
33
+ */
34
+ toString() {
35
+ const printable = __classPrivateFieldGet(this, _ResumeV1SocialNetworksUrl_instances, "m", _ResumeV1SocialNetworksUrl_printableValues).call(this);
36
+ return ("Name: " +
37
+ printable.name +
38
+ ", URL: " +
39
+ printable.url);
40
+ }
41
+ /**
42
+ * Output in a format suitable for inclusion in an rST table.
43
+ */
44
+ toTableLine() {
45
+ const printable = __classPrivateFieldGet(this, _ResumeV1SocialNetworksUrl_instances, "m", _ResumeV1SocialNetworksUrl_printableValues).call(this);
46
+ return ("| " +
47
+ printable.name.padEnd(20) +
48
+ " | " +
49
+ printable.url.padEnd(50) +
50
+ " |");
51
+ }
52
+ }
53
+ exports.ResumeV1SocialNetworksUrl = ResumeV1SocialNetworksUrl;
54
+ _ResumeV1SocialNetworksUrl_instances = new WeakSet(), _ResumeV1SocialNetworksUrl_printableValues = function _ResumeV1SocialNetworksUrl_printableValues() {
55
+ return {
56
+ name: this.name ?
57
+ this.name.length <= 20 ?
58
+ this.name :
59
+ this.name.slice(0, 17) + "..." :
60
+ "",
61
+ url: this.url ?
62
+ this.url.length <= 50 ?
63
+ this.url :
64
+ this.url.slice(0, 47) + "..." :
65
+ "",
66
+ };
67
+ };
@@ -17,7 +17,12 @@ class BankCheckV1 extends common_1.Inference {
17
17
  /** The document's pages. */
18
18
  this.pages = [];
19
19
  this.prediction = new bankCheckV1Document_1.BankCheckV1Document(rawPrediction["prediction"]);
20
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankCheckV1Page_1.BankCheckV1Page, page, page["id"], page["orientation"]));
20
+ rawPrediction["pages"].forEach((page) => {
21
+ if (page.prediction !== undefined && page.prediction !== null &&
22
+ Object.keys(page.prediction).length > 0) {
23
+ this.pages.push(new common_1.Page(bankCheckV1Page_1.BankCheckV1Page, page, page["id"], page["orientation"]));
24
+ }
25
+ });
21
26
  }
22
27
  }
23
28
  exports.BankCheckV1 = BankCheckV1;
@@ -17,7 +17,12 @@ class DriverLicenseV1 extends common_1.Inference {
17
17
  /** The document's pages. */
18
18
  this.pages = [];
19
19
  this.prediction = new driverLicenseV1Document_1.DriverLicenseV1Document(rawPrediction["prediction"]);
20
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(driverLicenseV1Page_1.DriverLicenseV1Page, page, page["id"], page["orientation"]));
20
+ rawPrediction["pages"].forEach((page) => {
21
+ if (page.prediction !== undefined && page.prediction !== null &&
22
+ Object.keys(page.prediction).length > 0) {
23
+ this.pages.push(new common_1.Page(driverLicenseV1Page_1.DriverLicenseV1Page, page, page["id"], page["orientation"]));
24
+ }
25
+ });
21
26
  }
22
27
  }
23
28
  exports.DriverLicenseV1 = DriverLicenseV1;
@@ -17,7 +17,12 @@ class W9V1 extends common_1.Inference {
17
17
  /** The document's pages. */
18
18
  this.pages = [];
19
19
  this.prediction = new w9V1Document_1.W9V1Document();
20
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(w9V1Page_1.W9V1Page, page, page["id"], page["orientation"]));
20
+ rawPrediction["pages"].forEach((page) => {
21
+ if (page.prediction !== undefined && page.prediction !== null &&
22
+ Object.keys(page.prediction).length > 0) {
23
+ this.pages.push(new common_1.Page(w9V1Page_1.W9V1Page, page, page["id"], page["orientation"]));
24
+ }
25
+ });
21
26
  }
22
27
  }
23
28
  exports.W9V1 = W9V1;