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,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverLicenseV1Document = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ /**
7
+ * Document data for Driver License, API version 1.
8
+ */
9
+ class DriverLicenseV1Document {
10
+ constructor(rawPrediction, pageId) {
11
+ this.address = new standard_1.StringField({
12
+ prediction: rawPrediction["address"],
13
+ pageId: pageId,
14
+ });
15
+ this.category = new standard_1.StringField({
16
+ prediction: rawPrediction["category"],
17
+ pageId: pageId,
18
+ });
19
+ this.countryCode = new standard_1.StringField({
20
+ prediction: rawPrediction["country_code"],
21
+ pageId: pageId,
22
+ });
23
+ this.dateOfBirth = new standard_1.DateField({
24
+ prediction: rawPrediction["date_of_birth"],
25
+ pageId: pageId,
26
+ });
27
+ this.documentId = new standard_1.StringField({
28
+ prediction: rawPrediction["document_id"],
29
+ pageId: pageId,
30
+ });
31
+ this.expiryDate = new standard_1.DateField({
32
+ prediction: rawPrediction["expiry_date"],
33
+ pageId: pageId,
34
+ });
35
+ this.firstName = new standard_1.StringField({
36
+ prediction: rawPrediction["first_name"],
37
+ pageId: pageId,
38
+ });
39
+ this.issueAuthority = new standard_1.StringField({
40
+ prediction: rawPrediction["issue_authority"],
41
+ pageId: pageId,
42
+ });
43
+ this.issueDate = new standard_1.DateField({
44
+ prediction: rawPrediction["issue_date"],
45
+ pageId: pageId,
46
+ });
47
+ this.lastName = new standard_1.StringField({
48
+ prediction: rawPrediction["last_name"],
49
+ pageId: pageId,
50
+ });
51
+ this.mrz = new standard_1.StringField({
52
+ prediction: rawPrediction["mrz"],
53
+ pageId: pageId,
54
+ });
55
+ this.placeOfBirth = new standard_1.StringField({
56
+ prediction: rawPrediction["place_of_birth"],
57
+ pageId: pageId,
58
+ });
59
+ }
60
+ /**
61
+ * Default string representation.
62
+ */
63
+ toString() {
64
+ const outStr = `:Country Code: ${this.countryCode}
65
+ :Document ID: ${this.documentId}
66
+ :Driver License Category: ${this.category}
67
+ :Last Name: ${this.lastName}
68
+ :First Name: ${this.firstName}
69
+ :Date Of Birth: ${this.dateOfBirth}
70
+ :Place Of Birth: ${this.placeOfBirth}
71
+ :Expiry Date: ${this.expiryDate}
72
+ :Issue Date: ${this.issueDate}
73
+ :Issue Authority: ${this.issueAuthority}
74
+ :MRZ: ${this.mrz}
75
+ :Address: ${this.address}`.trimEnd();
76
+ return (0, common_1.cleanOutString)(outStr);
77
+ }
78
+ }
79
+ exports.DriverLicenseV1Document = DriverLicenseV1Document;
@@ -0,0 +1,14 @@
1
+ import { StringDict } from "../../../parsing/common";
2
+ import { PositionField } from "../../../parsing/standard";
3
+ import { DriverLicenseV1Document } from "./driverLicenseV1Document";
4
+ /**
5
+ * Page data for Driver License, API version 1.
6
+ */
7
+ export declare class DriverLicenseV1Page extends DriverLicenseV1Document {
8
+ /** Has a photo of the EU driver license holder */
9
+ photo: PositionField;
10
+ /** Has a signature of the EU driver license holder */
11
+ signature: PositionField;
12
+ constructor(rawPrediction: StringDict, pageId?: number);
13
+ toString(): string;
14
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverLicenseV1Page = void 0;
4
+ const common_1 = require("../../../parsing/common");
5
+ const standard_1 = require("../../../parsing/standard");
6
+ const driverLicenseV1Document_1 = require("./driverLicenseV1Document");
7
+ /**
8
+ * Page data for Driver License, API version 1.
9
+ */
10
+ class DriverLicenseV1Page extends driverLicenseV1Document_1.DriverLicenseV1Document {
11
+ constructor(rawPrediction, pageId) {
12
+ super(rawPrediction, pageId);
13
+ this.photo = new standard_1.PositionField({
14
+ prediction: rawPrediction["photo"],
15
+ pageId: pageId,
16
+ });
17
+ this.signature = new standard_1.PositionField({
18
+ prediction: rawPrediction["signature"],
19
+ pageId: pageId,
20
+ });
21
+ }
22
+ toString() {
23
+ let outStr = `:Photo: ${this.photo}
24
+ :Signature: ${this.signature}`.trimEnd();
25
+ outStr += "\n" + super.toString();
26
+ return (0, common_1.cleanOutString)(outStr);
27
+ }
28
+ }
29
+ exports.DriverLicenseV1Page = DriverLicenseV1Page;
@@ -0,0 +1,2 @@
1
+ export { DriverLicenseV1 } from "./driverLicenseV1";
2
+ export { DriverLicenseV1Document } from "./driverLicenseV1Document";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverLicenseV1Document = exports.DriverLicenseV1 = void 0;
4
+ var driverLicenseV1_1 = require("./driverLicenseV1");
5
+ Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
6
+ var driverLicenseV1Document_1 = require("./driverLicenseV1Document");
7
+ Object.defineProperty(exports, "DriverLicenseV1Document", { enumerable: true, get: function () { return driverLicenseV1Document_1.DriverLicenseV1Document; } });
@@ -1 +1,2 @@
1
1
  export { LicensePlateV1 } from "./licensePlate/licensePlateV1";
2
+ export { DriverLicenseV1 } from "./driverLicense/driverLicenseV1";
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LicensePlateV1 = void 0;
3
+ exports.DriverLicenseV1 = exports.LicensePlateV1 = void 0;
4
4
  var licensePlateV1_1 = require("./licensePlate/licensePlateV1");
5
5
  Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
6
+ var driverLicenseV1_1 = require("./driverLicense/driverLicenseV1");
7
+ Object.defineProperty(exports, "DriverLicenseV1", { enumerable: true, get: function () { return driverLicenseV1_1.DriverLicenseV1; } });
@@ -1 +1,2 @@
1
1
  export * as licensePlate from "./licensePlate/internal";
2
+ export * as driverLicense from "./driverLicense/internal";
@@ -23,5 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.licensePlate = void 0;
26
+ exports.driverLicense = exports.licensePlate = void 0;
27
27
  exports.licensePlate = __importStar(require("./licensePlate/internal"));
28
+ exports.driverLicense = __importStar(require("./driverLicense/internal"));
@@ -16,7 +16,12 @@ class LicensePlateV1 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new licensePlateV1Document_1.LicensePlateV1Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(licensePlateV1Document_1.LicensePlateV1Document, page, page["id"], page["orientation"]));
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(licensePlateV1Document_1.LicensePlateV1Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.LicensePlateV1 = LicensePlateV1;
@@ -16,7 +16,12 @@ class FinancialDocumentV1 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new financialDocumentV1Document_1.FinancialDocumentV1Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(financialDocumentV1Document_1.FinancialDocumentV1Document, page, page["id"], page["orientation"]));
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(financialDocumentV1Document_1.FinancialDocumentV1Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.FinancialDocumentV1 = FinancialDocumentV1;
@@ -16,7 +16,12 @@ class BankAccountDetailsV1 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new bankAccountDetailsV1Document_1.BankAccountDetailsV1Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV1Document_1.BankAccountDetailsV1Document, page, page["id"], page["orientation"]));
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(bankAccountDetailsV1Document_1.BankAccountDetailsV1Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.BankAccountDetailsV1 = BankAccountDetailsV1;
@@ -16,7 +16,12 @@ class BankAccountDetailsV2 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new bankAccountDetailsV2Document_1.BankAccountDetailsV2Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV2Document_1.BankAccountDetailsV2Document, page, page["id"], page["orientation"]));
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(bankAccountDetailsV2Document_1.BankAccountDetailsV2Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.BankAccountDetailsV2 = BankAccountDetailsV2;
@@ -16,7 +16,12 @@ class CarteGriseV1 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new carteGriseV1Document_1.CarteGriseV1Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(carteGriseV1Document_1.CarteGriseV1Document, page, page["id"], page["orientation"]));
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(carteGriseV1Document_1.CarteGriseV1Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.CarteGriseV1 = CarteGriseV1;
@@ -16,7 +16,12 @@ class CarteVitaleV1 extends common_1.Inference {
16
16
  /** The document's pages. */
17
17
  this.pages = [];
18
18
  this.prediction = new carteVitaleV1Document_1.CarteVitaleV1Document(rawPrediction["prediction"]);
19
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(carteVitaleV1Document_1.CarteVitaleV1Document, page, page["id"], page["orientation"]));
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(carteVitaleV1Document_1.CarteVitaleV1Document, page, page["id"], page["orientation"]));
23
+ }
24
+ });
20
25
  }
21
26
  }
22
27
  exports.CarteVitaleV1 = CarteVitaleV1;
@@ -17,7 +17,12 @@ class IdCardV1 extends common_1.Inference {
17
17
  /** The document's pages. */
18
18
  this.pages = [];
19
19
  this.prediction = new idCardV1Document_1.IdCardV1Document(rawPrediction["prediction"]);
20
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(idCardV1Page_1.IdCardV1Page, 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(idCardV1Page_1.IdCardV1Page, page, page["id"], page["orientation"]));
24
+ }
25
+ });
21
26
  }
22
27
  }
23
28
  exports.IdCardV1 = IdCardV1;
@@ -17,7 +17,12 @@ class IdCardV2 extends common_1.Inference {
17
17
  /** The document's pages. */
18
18
  this.pages = [];
19
19
  this.prediction = new idCardV2Document_1.IdCardV2Document(rawPrediction["prediction"]);
20
- this.pages = rawPrediction["pages"].map((page) => new common_1.Page(idCardV2Page_1.IdCardV2Page, 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(idCardV2Page_1.IdCardV2Page, page, page["id"], page["orientation"]));
24
+ }
25
+ });
21
26
  }
22
27
  }
23
28
  exports.IdCardV2 = IdCardV2;
@@ -3,6 +3,8 @@ export { CropperV1 } from "./cropper/cropperV1";
3
3
  export { CustomV1 } from "./custom/customV1";
4
4
  export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
5
5
  export { InvoiceV4 } from "./invoice/invoiceV4";
6
+ export { InternationalIdV1 } from "./internationalId/internationalIdV1";
7
+ export { InternationalIdV2 } from "./internationalId/internationalIdV2";
6
8
  export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
7
9
  export { GeneratedV1 } from "./generated/generatedV1";
8
10
  export { MultiReceiptsDetectorV1 } from "./multiReceiptsDetector/multiReceiptsDetectorV1";
@@ -10,6 +12,7 @@ export { PassportV1 } from "./passport/passportV1";
10
12
  export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
11
13
  export { ReceiptV4 } from "./receipt/receiptV4";
12
14
  export { ReceiptV5 } from "./receipt/receiptV5";
15
+ export { ResumeV1 } from "./resume/resumeV1";
13
16
  export * as eu from "./eu";
14
17
  export * as fr from "./fr";
15
18
  export * as us from "./us";
@@ -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.fr = exports.eu = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.MultiReceiptsDetectorV1 = exports.GeneratedV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = exports.BarcodeReaderV1 = void 0;
26
+ exports.us = exports.fr = exports.eu = exports.ResumeV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ProofOfAddressV1 = exports.PassportV1 = exports.MultiReceiptsDetectorV1 = exports.GeneratedV1 = exports.InvoiceSplitterV1 = exports.InternationalIdV2 = exports.InternationalIdV1 = exports.InvoiceV4 = exports.FinancialDocumentV1 = exports.CustomV1 = exports.CropperV1 = 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 cropperV1_1 = require("./cropper/cropperV1");
@@ -34,6 +34,10 @@ var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
34
34
  Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
35
35
  var invoiceV4_1 = require("./invoice/invoiceV4");
36
36
  Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
37
+ var internationalIdV1_1 = require("./internationalId/internationalIdV1");
38
+ Object.defineProperty(exports, "InternationalIdV1", { enumerable: true, get: function () { return internationalIdV1_1.InternationalIdV1; } });
39
+ var internationalIdV2_1 = require("./internationalId/internationalIdV2");
40
+ Object.defineProperty(exports, "InternationalIdV2", { enumerable: true, get: function () { return internationalIdV2_1.InternationalIdV2; } });
37
41
  var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
38
42
  Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
39
43
  var generatedV1_1 = require("./generated/generatedV1");
@@ -48,6 +52,8 @@ var receiptV4_1 = require("./receipt/receiptV4");
48
52
  Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
49
53
  var receiptV5_1 = require("./receipt/receiptV5");
50
54
  Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return receiptV5_1.ReceiptV5; } });
55
+ var resumeV1_1 = require("./resume/resumeV1");
56
+ Object.defineProperty(exports, "ResumeV1", { enumerable: true, get: function () { return resumeV1_1.ResumeV1; } });
51
57
  exports.eu = __importStar(require("./eu"));
52
58
  exports.fr = __importStar(require("./fr"));
53
59
  exports.us = __importStar(require("./us"));
@@ -5,10 +5,12 @@ export * as generated from "./generated/internal";
5
5
  export * as eu from "./eu/internal";
6
6
  export * as financialDocument from "./financialDocument/internal";
7
7
  export * as fr from "./fr/internal";
8
+ export * as internationalId from "./internationalId/internal";
8
9
  export * as invoice from "./invoice/internal";
9
10
  export * as invoiceSplitter from "./invoiceSplitter/internal";
10
11
  export * as multiReceiptsDetector from "./multiReceiptsDetector/internal";
11
12
  export * as passport from "./passport/internal";
12
13
  export * as proofOfAddress from "./proofOfAddress/internal";
13
14
  export * as receipt from "./receipt/internal";
15
+ export * as resume from "./resume/internal";
14
16
  export * as us from "./us/internal";
@@ -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.receipt = exports.proofOfAddress = exports.passport = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.fr = exports.financialDocument = exports.eu = exports.generated = exports.custom = exports.cropper = exports.barcodeReader = void 0;
26
+ exports.us = exports.resume = exports.receipt = exports.proofOfAddress = exports.passport = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.fr = exports.financialDocument = exports.eu = exports.generated = exports.custom = exports.cropper = exports.barcodeReader = void 0;
27
27
  exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
28
28
  exports.cropper = __importStar(require("./cropper/internal"));
29
29
  exports.custom = __importStar(require("./custom/internal"));
@@ -31,10 +31,12 @@ exports.generated = __importStar(require("./generated/internal"));
31
31
  exports.eu = __importStar(require("./eu/internal"));
32
32
  exports.financialDocument = __importStar(require("./financialDocument/internal"));
33
33
  exports.fr = __importStar(require("./fr/internal"));
34
+ exports.internationalId = __importStar(require("./internationalId/internal"));
34
35
  exports.invoice = __importStar(require("./invoice/internal"));
35
36
  exports.invoiceSplitter = __importStar(require("./invoiceSplitter/internal"));
36
37
  exports.multiReceiptsDetector = __importStar(require("./multiReceiptsDetector/internal"));
37
38
  exports.passport = __importStar(require("./passport/internal"));
38
39
  exports.proofOfAddress = __importStar(require("./proofOfAddress/internal"));
39
40
  exports.receipt = __importStar(require("./receipt/internal"));
41
+ exports.resume = __importStar(require("./resume/internal"));
40
42
  exports.us = __importStar(require("./us/internal"));
@@ -0,0 +1,4 @@
1
+ export { InternationalIdV1 } from "./internationalIdV1";
2
+ export { InternationalIdV1Document } from "./internationalIdV1Document";
3
+ export { InternationalIdV2 } from "./internationalIdV2";
4
+ export { InternationalIdV2Document } from "./internationalIdV2Document";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InternationalIdV2Document = exports.InternationalIdV2 = exports.InternationalIdV1Document = exports.InternationalIdV1 = void 0;
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; } });
8
+ var internationalIdV2_1 = require("./internationalIdV2");
9
+ Object.defineProperty(exports, "InternationalIdV2", { enumerable: true, get: function () { return internationalIdV2_1.InternationalIdV2; } });
10
+ var internationalIdV2Document_1 = require("./internationalIdV2Document");
11
+ Object.defineProperty(exports, "InternationalIdV2Document", { enumerable: true, get: function () { return internationalIdV2Document_1.InternationalIdV2Document; } });
@@ -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;