mindee 4.8.2 → 4.9.1

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 (83) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +6 -3
  3. package/package.json +1 -1
  4. package/src/cli.js +40 -0
  5. package/src/errors/handler.d.ts +4 -2
  6. package/src/errors/handler.js +5 -1
  7. package/src/errors/index.d.ts +1 -1
  8. package/src/errors/index.js +3 -3
  9. package/src/errors/{MindeeError.d.ts → mindeeError.d.ts} +6 -0
  10. package/src/errors/{MindeeError.js → mindeeError.js} +6 -0
  11. package/src/http/apiSettings.js +1 -0
  12. package/src/http/endpoint.js +11 -16
  13. package/src/http/error.d.ts +1 -1
  14. package/src/http/error.js +7 -3
  15. package/src/http/index.d.ts +1 -0
  16. package/src/http/index.js +5 -1
  17. package/src/http/responseValidation.d.ts +23 -0
  18. package/src/http/responseValidation.js +66 -0
  19. package/src/input/pageOptions.d.ts +6 -2
  20. package/src/input/pageOptions.js +3 -1
  21. package/src/internal.d.ts +5 -3
  22. package/src/internal.js +6 -4
  23. package/src/parsing/common/asyncPredictResponse.d.ts +2 -0
  24. package/src/product/barcodeReader/barcodeReaderV1.js +6 -1
  25. package/src/product/cropper/cropperV1.js +6 -1
  26. package/src/product/eu/driverLicense/driverLicenseV1.d.ts +17 -0
  27. package/src/product/eu/driverLicense/driverLicenseV1.js +28 -0
  28. package/src/product/eu/driverLicense/driverLicenseV1Document.d.ts +36 -0
  29. package/src/product/eu/driverLicense/driverLicenseV1Document.js +79 -0
  30. package/src/product/eu/driverLicense/driverLicenseV1Page.d.ts +14 -0
  31. package/src/product/eu/driverLicense/driverLicenseV1Page.js +29 -0
  32. package/src/product/eu/driverLicense/internal.d.ts +2 -0
  33. package/src/product/eu/driverLicense/internal.js +7 -0
  34. package/src/product/eu/index.d.ts +1 -0
  35. package/src/product/eu/index.js +3 -1
  36. package/src/product/eu/internal.d.ts +1 -0
  37. package/src/product/eu/internal.js +2 -1
  38. package/src/product/eu/licensePlate/licensePlateV1.js +6 -1
  39. package/src/product/financialDocument/financialDocumentV1.js +6 -1
  40. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +6 -1
  41. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +6 -1
  42. package/src/product/fr/carteGrise/carteGriseV1.js +6 -1
  43. package/src/product/fr/carteVitale/carteVitaleV1.js +6 -1
  44. package/src/product/fr/idCard/idCardV1.js +6 -1
  45. package/src/product/fr/idCard/idCardV2.js +6 -1
  46. package/src/product/index.d.ts +3 -0
  47. package/src/product/index.js +7 -1
  48. package/src/product/internal.d.ts +2 -0
  49. package/src/product/internal.js +3 -1
  50. package/src/product/internationalId/internal.d.ts +4 -0
  51. package/src/product/internationalId/internal.js +11 -0
  52. package/src/product/internationalId/internationalIdV1.d.ts +16 -0
  53. package/src/product/internationalId/internationalIdV1.js +27 -0
  54. package/src/product/internationalId/internationalIdV1Document.d.ts +42 -0
  55. package/src/product/internationalId/internationalIdV1Document.js +101 -0
  56. package/src/product/internationalId/internationalIdV2.d.ts +16 -0
  57. package/src/product/internationalId/internationalIdV2.js +27 -0
  58. package/src/product/internationalId/internationalIdV2Document.d.ts +46 -0
  59. package/src/product/internationalId/internationalIdV2Document.js +111 -0
  60. package/src/product/invoice/invoiceV4.js +6 -1
  61. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +6 -1
  62. package/src/product/passport/passportV1.js +6 -1
  63. package/src/product/proofOfAddress/proofOfAddressV1.js +6 -1
  64. package/src/product/receipt/receiptV5.js +6 -1
  65. package/src/product/resume/internal.d.ts +7 -0
  66. package/src/product/resume/internal.js +17 -0
  67. package/src/product/resume/resumeV1.d.ts +16 -0
  68. package/src/product/resume/resumeV1.js +27 -0
  69. package/src/product/resume/resumeV1Certificate.d.ts +34 -0
  70. package/src/product/resume/resumeV1Certificate.js +87 -0
  71. package/src/product/resume/resumeV1Document.d.ts +51 -0
  72. package/src/product/resume/resumeV1Document.js +197 -0
  73. package/src/product/resume/resumeV1Education.d.ts +40 -0
  74. package/src/product/resume/resumeV1Education.js +117 -0
  75. package/src/product/resume/resumeV1Language.d.ts +30 -0
  76. package/src/product/resume/resumeV1Language.js +67 -0
  77. package/src/product/resume/resumeV1ProfessionalExperience.d.ts +42 -0
  78. package/src/product/resume/resumeV1ProfessionalExperience.js +127 -0
  79. package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +30 -0
  80. package/src/product/resume/resumeV1SocialNetworksUrl.js +67 -0
  81. package/src/product/us/bankCheck/bankCheckV1.js +6 -1
  82. package/src/product/us/driverLicense/driverLicenseV1.js +6 -1
  83. package/src/product/us/w9/w9V1.js +6 -1
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResumeV1Document = void 0;
4
+ const common_1 = require("../../parsing/common");
5
+ const resumeV1SocialNetworksUrl_1 = require("./resumeV1SocialNetworksUrl");
6
+ const resumeV1Language_1 = require("./resumeV1Language");
7
+ const resumeV1Education_1 = require("./resumeV1Education");
8
+ const resumeV1ProfessionalExperience_1 = require("./resumeV1ProfessionalExperience");
9
+ const resumeV1Certificate_1 = require("./resumeV1Certificate");
10
+ const standard_1 = require("../../parsing/standard");
11
+ /**
12
+ * Document data for Resume, API version 1.
13
+ */
14
+ class ResumeV1Document {
15
+ constructor(rawPrediction, pageId) {
16
+ /** The list of certificates obtained by the candidate. */
17
+ this.certificates = [];
18
+ /** The list of the candidate's educational background. */
19
+ this.education = [];
20
+ /** The candidate's first or given names. */
21
+ this.givenNames = [];
22
+ /** The list of the candidate's technical abilities and knowledge. */
23
+ this.hardSkills = [];
24
+ /** The list of languages that the candidate is proficient in. */
25
+ this.languages = [];
26
+ /** The list of the candidate's professional experiences. */
27
+ this.professionalExperiences = [];
28
+ /** The list of social network profiles of the candidate. */
29
+ this.socialNetworksUrls = [];
30
+ /** The list of the candidate's interpersonal and communication abilities. */
31
+ this.softSkills = [];
32
+ /** The candidate's last names. */
33
+ this.surnames = [];
34
+ this.address = new standard_1.StringField({
35
+ prediction: rawPrediction["address"],
36
+ pageId: pageId,
37
+ });
38
+ rawPrediction["certificates"] &&
39
+ rawPrediction["certificates"].map((itemPrediction) => this.certificates.push(new resumeV1Certificate_1.ResumeV1Certificate({
40
+ prediction: itemPrediction,
41
+ pageId: pageId,
42
+ })));
43
+ this.documentLanguage = new standard_1.StringField({
44
+ prediction: rawPrediction["document_language"],
45
+ pageId: pageId,
46
+ });
47
+ this.documentType = new standard_1.ClassificationField({
48
+ prediction: rawPrediction["document_type"],
49
+ });
50
+ rawPrediction["education"] &&
51
+ rawPrediction["education"].map((itemPrediction) => this.education.push(new resumeV1Education_1.ResumeV1Education({
52
+ prediction: itemPrediction,
53
+ pageId: pageId,
54
+ })));
55
+ this.emailAddress = new standard_1.StringField({
56
+ prediction: rawPrediction["email_address"],
57
+ pageId: pageId,
58
+ });
59
+ rawPrediction["given_names"] &&
60
+ rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({
61
+ prediction: itemPrediction,
62
+ pageId: pageId,
63
+ })));
64
+ rawPrediction["hard_skills"] &&
65
+ rawPrediction["hard_skills"].map((itemPrediction) => this.hardSkills.push(new standard_1.StringField({
66
+ prediction: itemPrediction,
67
+ pageId: pageId,
68
+ })));
69
+ this.jobApplied = new standard_1.StringField({
70
+ prediction: rawPrediction["job_applied"],
71
+ pageId: pageId,
72
+ });
73
+ rawPrediction["languages"] &&
74
+ rawPrediction["languages"].map((itemPrediction) => this.languages.push(new resumeV1Language_1.ResumeV1Language({
75
+ prediction: itemPrediction,
76
+ pageId: pageId,
77
+ })));
78
+ this.nationality = new standard_1.StringField({
79
+ prediction: rawPrediction["nationality"],
80
+ pageId: pageId,
81
+ });
82
+ this.phoneNumber = new standard_1.StringField({
83
+ prediction: rawPrediction["phone_number"],
84
+ pageId: pageId,
85
+ });
86
+ this.profession = new standard_1.StringField({
87
+ prediction: rawPrediction["profession"],
88
+ pageId: pageId,
89
+ });
90
+ rawPrediction["professional_experiences"] &&
91
+ rawPrediction["professional_experiences"].map((itemPrediction) => this.professionalExperiences.push(new resumeV1ProfessionalExperience_1.ResumeV1ProfessionalExperience({
92
+ prediction: itemPrediction,
93
+ pageId: pageId,
94
+ })));
95
+ rawPrediction["social_networks_urls"] &&
96
+ rawPrediction["social_networks_urls"].map((itemPrediction) => this.socialNetworksUrls.push(new resumeV1SocialNetworksUrl_1.ResumeV1SocialNetworksUrl({
97
+ prediction: itemPrediction,
98
+ pageId: pageId,
99
+ })));
100
+ rawPrediction["soft_skills"] &&
101
+ rawPrediction["soft_skills"].map((itemPrediction) => this.softSkills.push(new standard_1.StringField({
102
+ prediction: itemPrediction,
103
+ pageId: pageId,
104
+ })));
105
+ rawPrediction["surnames"] &&
106
+ rawPrediction["surnames"].map((itemPrediction) => this.surnames.push(new standard_1.StringField({
107
+ prediction: itemPrediction,
108
+ pageId: pageId,
109
+ })));
110
+ }
111
+ /**
112
+ * Default string representation.
113
+ */
114
+ toString() {
115
+ const givenNames = this.givenNames.join("\n ");
116
+ const surnames = this.surnames.join("\n ");
117
+ let socialNetworksUrlsSummary = "";
118
+ if (this.socialNetworksUrls && this.socialNetworksUrls.length > 0) {
119
+ const socialNetworksUrlsColSizes = [22, 52];
120
+ socialNetworksUrlsSummary += "\n" + (0, common_1.lineSeparator)(socialNetworksUrlsColSizes, "-") + "\n ";
121
+ socialNetworksUrlsSummary += "| Name ";
122
+ socialNetworksUrlsSummary += "| URL ";
123
+ socialNetworksUrlsSummary += "|\n" + (0, common_1.lineSeparator)(socialNetworksUrlsColSizes, "=");
124
+ socialNetworksUrlsSummary += this.socialNetworksUrls.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(socialNetworksUrlsColSizes, "-")).join("");
125
+ }
126
+ let languagesSummary = "";
127
+ if (this.languages && this.languages.length > 0) {
128
+ const languagesColSizes = [10, 22];
129
+ languagesSummary += "\n" + (0, common_1.lineSeparator)(languagesColSizes, "-") + "\n ";
130
+ languagesSummary += "| Language ";
131
+ languagesSummary += "| Level ";
132
+ languagesSummary += "|\n" + (0, common_1.lineSeparator)(languagesColSizes, "=");
133
+ languagesSummary += this.languages.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(languagesColSizes, "-")).join("");
134
+ }
135
+ const hardSkills = this.hardSkills.join("\n ");
136
+ const softSkills = this.softSkills.join("\n ");
137
+ let educationSummary = "";
138
+ if (this.education && this.education.length > 0) {
139
+ const educationColSizes = [17, 27, 11, 10, 27, 13, 12];
140
+ educationSummary += "\n" + (0, common_1.lineSeparator)(educationColSizes, "-") + "\n ";
141
+ educationSummary += "| Domain ";
142
+ educationSummary += "| Degree ";
143
+ educationSummary += "| End Month ";
144
+ educationSummary += "| End Year ";
145
+ educationSummary += "| School ";
146
+ educationSummary += "| Start Month ";
147
+ educationSummary += "| Start Year ";
148
+ educationSummary += "|\n" + (0, common_1.lineSeparator)(educationColSizes, "=");
149
+ educationSummary += this.education.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(educationColSizes, "-")).join("");
150
+ }
151
+ let professionalExperiencesSummary = "";
152
+ if (this.professionalExperiences && this.professionalExperiences.length > 0) {
153
+ const professionalExperiencesColSizes = [17, 12, 27, 11, 10, 22, 13, 12];
154
+ professionalExperiencesSummary += "\n" + (0, common_1.lineSeparator)(professionalExperiencesColSizes, "-") + "\n ";
155
+ professionalExperiencesSummary += "| Contract Type ";
156
+ professionalExperiencesSummary += "| Department ";
157
+ professionalExperiencesSummary += "| Employer ";
158
+ professionalExperiencesSummary += "| End Month ";
159
+ professionalExperiencesSummary += "| End Year ";
160
+ professionalExperiencesSummary += "| Role ";
161
+ professionalExperiencesSummary += "| Start Month ";
162
+ professionalExperiencesSummary += "| Start Year ";
163
+ professionalExperiencesSummary += "|\n" + (0, common_1.lineSeparator)(professionalExperiencesColSizes, "=");
164
+ professionalExperiencesSummary += this.professionalExperiences.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(professionalExperiencesColSizes, "-")).join("");
165
+ }
166
+ let certificatesSummary = "";
167
+ if (this.certificates && this.certificates.length > 0) {
168
+ const certificatesColSizes = [12, 32, 27, 6];
169
+ certificatesSummary += "\n" + (0, common_1.lineSeparator)(certificatesColSizes, "-") + "\n ";
170
+ certificatesSummary += "| Grade ";
171
+ certificatesSummary += "| Name ";
172
+ certificatesSummary += "| Provider ";
173
+ certificatesSummary += "| Year ";
174
+ certificatesSummary += "|\n" + (0, common_1.lineSeparator)(certificatesColSizes, "=");
175
+ certificatesSummary += this.certificates.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(certificatesColSizes, "-")).join("");
176
+ }
177
+ const outStr = `:Document Language: ${this.documentLanguage}
178
+ :Document Type: ${this.documentType}
179
+ :Given Names: ${givenNames}
180
+ :Surnames: ${surnames}
181
+ :Nationality: ${this.nationality}
182
+ :Email Address: ${this.emailAddress}
183
+ :Phone Number: ${this.phoneNumber}
184
+ :Address: ${this.address}
185
+ :Social Networks: ${socialNetworksUrlsSummary}
186
+ :Profession: ${this.profession}
187
+ :Job Applied: ${this.jobApplied}
188
+ :Languages: ${languagesSummary}
189
+ :Hard Skills: ${hardSkills}
190
+ :Soft Skills: ${softSkills}
191
+ :Education: ${educationSummary}
192
+ :Professional Experiences: ${professionalExperiencesSummary}
193
+ :Certificates: ${certificatesSummary}`.trimEnd();
194
+ return (0, common_1.cleanOutString)(outStr);
195
+ }
196
+ }
197
+ exports.ResumeV1Document = ResumeV1Document;
@@ -0,0 +1,40 @@
1
+ import { StringDict } from "../../parsing/common";
2
+ import { Polygon } from "../../geometry";
3
+ /**
4
+ * The list of the candidate's educational background.
5
+ */
6
+ export declare class ResumeV1Education {
7
+ #private;
8
+ /** The area of study or specialization. */
9
+ degreeDomain: string | undefined;
10
+ /** The type of degree obtained, such as Bachelor's, Master's, or Doctorate. */
11
+ degreeType: string | undefined;
12
+ /** The month when the education program or course was completed. */
13
+ endMonth: string | undefined;
14
+ /** The year when the education program or course was completed. */
15
+ endYear: string | undefined;
16
+ /** The name of the school. */
17
+ school: string | undefined;
18
+ /** The month when the education program or course began. */
19
+ startMonth: string | undefined;
20
+ /** The year when the education program or course began. */
21
+ startYear: string | undefined;
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 an rST table.
38
+ */
39
+ toTableLine(): string;
40
+ }
@@ -0,0 +1,117 @@
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 _ResumeV1Education_instances, _ResumeV1Education_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ResumeV1Education = void 0;
10
+ /**
11
+ * The list of the candidate's educational background.
12
+ */
13
+ class ResumeV1Education {
14
+ constructor({ prediction = {} }) {
15
+ _ResumeV1Education_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.degreeDomain = prediction["degree_domain"];
24
+ this.degreeType = prediction["degree_type"];
25
+ this.endMonth = prediction["end_month"];
26
+ this.endYear = prediction["end_year"];
27
+ this.school = prediction["school"];
28
+ this.startMonth = prediction["start_month"];
29
+ this.startYear = prediction["start_year"];
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, _ResumeV1Education_instances, "m", _ResumeV1Education_printableValues).call(this);
41
+ return ("Domain: " +
42
+ printable.degreeDomain +
43
+ ", Degree: " +
44
+ printable.degreeType +
45
+ ", End Month: " +
46
+ printable.endMonth +
47
+ ", End Year: " +
48
+ printable.endYear +
49
+ ", School: " +
50
+ printable.school +
51
+ ", Start Month: " +
52
+ printable.startMonth +
53
+ ", Start Year: " +
54
+ printable.startYear);
55
+ }
56
+ /**
57
+ * Output in a format suitable for inclusion in an rST table.
58
+ */
59
+ toTableLine() {
60
+ const printable = __classPrivateFieldGet(this, _ResumeV1Education_instances, "m", _ResumeV1Education_printableValues).call(this);
61
+ return ("| " +
62
+ printable.degreeDomain.padEnd(15) +
63
+ " | " +
64
+ printable.degreeType.padEnd(25) +
65
+ " | " +
66
+ printable.endMonth.padEnd(9) +
67
+ " | " +
68
+ printable.endYear.padEnd(8) +
69
+ " | " +
70
+ printable.school.padEnd(25) +
71
+ " | " +
72
+ printable.startMonth.padEnd(11) +
73
+ " | " +
74
+ printable.startYear.padEnd(10) +
75
+ " |");
76
+ }
77
+ }
78
+ exports.ResumeV1Education = ResumeV1Education;
79
+ _ResumeV1Education_instances = new WeakSet(), _ResumeV1Education_printableValues = function _ResumeV1Education_printableValues() {
80
+ return {
81
+ degreeDomain: this.degreeDomain ?
82
+ this.degreeDomain.length <= 15 ?
83
+ this.degreeDomain :
84
+ this.degreeDomain.slice(0, 12) + "..." :
85
+ "",
86
+ degreeType: this.degreeType ?
87
+ this.degreeType.length <= 25 ?
88
+ this.degreeType :
89
+ this.degreeType.slice(0, 22) + "..." :
90
+ "",
91
+ endMonth: this.endMonth ?
92
+ this.endMonth.length <= 9 ?
93
+ this.endMonth :
94
+ this.endMonth.slice(0, 6) + "..." :
95
+ "",
96
+ endYear: this.endYear ?
97
+ this.endYear.length <= 8 ?
98
+ this.endYear :
99
+ this.endYear.slice(0, 5) + "..." :
100
+ "",
101
+ school: this.school ?
102
+ this.school.length <= 25 ?
103
+ this.school :
104
+ this.school.slice(0, 22) + "..." :
105
+ "",
106
+ startMonth: this.startMonth ?
107
+ this.startMonth.length <= 11 ?
108
+ this.startMonth :
109
+ this.startMonth.slice(0, 8) + "..." :
110
+ "",
111
+ startYear: this.startYear ?
112
+ this.startYear.length <= 10 ?
113
+ this.startYear :
114
+ this.startYear.slice(0, 7) + "..." :
115
+ "",
116
+ };
117
+ };
@@ -0,0 +1,30 @@
1
+ import { StringDict } from "../../parsing/common";
2
+ import { Polygon } from "../../geometry";
3
+ /**
4
+ * The list of languages that the candidate is proficient in.
5
+ */
6
+ export declare class ResumeV1Language {
7
+ #private;
8
+ /** The language's ISO 639 code. */
9
+ language: string | undefined;
10
+ /** The candidate's level for the language. */
11
+ level: 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 _ResumeV1Language_instances, _ResumeV1Language_printableValues;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ResumeV1Language = void 0;
10
+ /**
11
+ * The list of languages that the candidate is proficient in.
12
+ */
13
+ class ResumeV1Language {
14
+ constructor({ prediction = {} }) {
15
+ _ResumeV1Language_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.language = prediction["language"];
24
+ this.level = prediction["level"];
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, _ResumeV1Language_instances, "m", _ResumeV1Language_printableValues).call(this);
36
+ return ("Language: " +
37
+ printable.language +
38
+ ", Level: " +
39
+ printable.level);
40
+ }
41
+ /**
42
+ * Output in a format suitable for inclusion in an rST table.
43
+ */
44
+ toTableLine() {
45
+ const printable = __classPrivateFieldGet(this, _ResumeV1Language_instances, "m", _ResumeV1Language_printableValues).call(this);
46
+ return ("| " +
47
+ printable.language.padEnd(8) +
48
+ " | " +
49
+ printable.level.padEnd(20) +
50
+ " |");
51
+ }
52
+ }
53
+ exports.ResumeV1Language = ResumeV1Language;
54
+ _ResumeV1Language_instances = new WeakSet(), _ResumeV1Language_printableValues = function _ResumeV1Language_printableValues() {
55
+ return {
56
+ language: this.language ?
57
+ this.language.length <= 8 ?
58
+ this.language :
59
+ this.language.slice(0, 5) + "..." :
60
+ "",
61
+ level: this.level ?
62
+ this.level.length <= 20 ?
63
+ this.level :
64
+ this.level.slice(0, 17) + "..." :
65
+ "",
66
+ };
67
+ };
@@ -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
+ }