mindee 3.1.0 → 3.2.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 (49) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +29 -23
  3. package/package.json +1 -1
  4. package/src/cli.js +69 -51
  5. package/src/client.d.ts +41 -5
  6. package/src/client.js +18 -5
  7. package/src/documents/cropper/cropperV1.d.ts +2 -2
  8. package/src/documents/cropper/cropperV1.js +1 -1
  9. package/src/documents/document.d.ts +2 -2
  10. package/src/documents/document.js +1 -1
  11. package/src/documents/eu/index.d.ts +1 -0
  12. package/src/documents/eu/index.js +5 -0
  13. package/src/documents/eu/licensePlate/licensePlateV1.d.ts +8 -0
  14. package/src/documents/eu/licensePlate/licensePlateV1.js +29 -0
  15. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +12 -0
  16. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.js +37 -0
  17. package/src/documents/fr/carteVitale/carteVitaleV1.d.ts +14 -0
  18. package/src/documents/fr/carteVitale/carteVitaleV1.js +44 -0
  19. package/src/documents/fr/idCard/idCardV1.d.ts +11 -0
  20. package/src/documents/fr/idCard/idCardV1.js +1 -0
  21. package/src/documents/fr/index.d.ts +3 -0
  22. package/src/documents/fr/index.js +9 -0
  23. package/src/documents/index.d.ts +11 -17
  24. package/src/documents/index.js +36 -18
  25. package/src/documents/invoice/invoiceV3.d.ts +17 -0
  26. package/src/documents/invoice/invoiceV3.js +4 -0
  27. package/src/documents/passport/passportV1.d.ts +13 -0
  28. package/src/documents/passport/passportV1.js +1 -0
  29. package/src/documents/receipt/receiptV3.d.ts +9 -1
  30. package/src/documents/receipt/receiptV3.js +1 -0
  31. package/src/documents/shipping_container/shippingContainerV1.d.ts +12 -0
  32. package/src/documents/shipping_container/shippingContainerV1.js +37 -0
  33. package/src/documents/us/bankCheck/bankCheckV1.d.ts +20 -1
  34. package/src/documents/us/bankCheck/bankCheckV1.js +57 -0
  35. package/src/documents/us/index.d.ts +1 -0
  36. package/src/documents/us/index.js +5 -0
  37. package/src/fields/amount.d.ts +1 -0
  38. package/src/fields/apiBuilder.d.ts +1 -0
  39. package/src/fields/companyRegistration.d.ts +1 -1
  40. package/src/fields/field.d.ts +1 -0
  41. package/src/fields/field.js +1 -0
  42. package/src/fields/index.d.ts +1 -1
  43. package/src/fields/index.js +3 -3
  44. package/src/fields/locale.d.ts +3 -0
  45. package/src/fields/paymentDetails.d.ts +4 -0
  46. package/src/fields/{cropper.d.ts → position.d.ts} +8 -3
  47. package/src/fields/{cropper.js → position.js} +4 -6
  48. package/src/index.d.ts +1 -1
  49. package/src/index.js +5 -2
@@ -0,0 +1,3 @@
1
+ export { IdCardV1 } from "./idCard/idCardV1";
2
+ export { BankAccountDetailsV1 } from "./bankAccountDetails/bankAccountDetailsV1";
3
+ export { CarteVitaleV1 } from "./carteVitale/carteVitaleV1";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteVitaleV1 = exports.BankAccountDetailsV1 = exports.IdCardV1 = void 0;
4
+ var idCardV1_1 = require("./idCard/idCardV1");
5
+ Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
6
+ var bankAccountDetailsV1_1 = require("./bankAccountDetails/bankAccountDetailsV1");
7
+ Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
8
+ var carteVitaleV1_1 = require("./carteVitale/carteVitaleV1");
9
+ Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
@@ -1,18 +1,12 @@
1
- import { InvoiceV3 } from "./invoice/invoiceV3";
2
- import { ReceiptV3 } from "./receipt/receiptV3";
3
- import { ReceiptV4 } from "./receipt/receiptV4";
4
- import { PassportV1 } from "./passport/passportV1";
5
- import { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
6
- import { CustomV1 } from "./custom";
7
- import { CropperV1 } from "./cropper/cropperV1";
8
- import { IdCardV1 } from "./fr/idCard/idCardV1";
1
+ export { InvoiceV3 } from "./invoice/invoiceV3";
2
+ export { ReceiptV3 } from "./receipt/receiptV3";
3
+ export { ReceiptV4 } from "./receipt/receiptV4";
4
+ export { PassportV1 } from "./passport/passportV1";
5
+ export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
6
+ export { CustomV1 } from "./custom";
7
+ export { CropperV1 } from "./cropper/cropperV1";
8
+ export { ShippingContainerV1 } from "./shipping_container/shippingContainerV1";
9
9
  export { Document, DocumentConstructorProps, DocumentSig } from "./document";
10
- export { ReceiptV3, ReceiptV4, InvoiceV3, FinancialDocumentV1, PassportV1, CustomV1, CropperV1, IdCardV1, };
11
- export declare const DOC_TYPE_CUSTOM: string;
12
- export declare const DOC_TYPE_INVOICE_V3: string;
13
- export declare const DOC_TYPE_RECEIPT_V3: string;
14
- export declare const DOC_TYPE_RECEIPT_V4: string;
15
- export declare const DOC_TYPE_PASSPORT_V1: string;
16
- export declare const DOC_TYPE_FINANCIAL_V1: string;
17
- export declare const DOC_TYPE_CROPPER_V1: string;
18
- export declare const DOC_TYPE_IDCARD_V1: string;
10
+ export * as fr from "./fr";
11
+ export * as us from "./us";
12
+ export * as eu from "./eu";
@@ -1,29 +1,47 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DOC_TYPE_IDCARD_V1 = exports.DOC_TYPE_CROPPER_V1 = exports.DOC_TYPE_FINANCIAL_V1 = exports.DOC_TYPE_PASSPORT_V1 = exports.DOC_TYPE_RECEIPT_V4 = exports.DOC_TYPE_RECEIPT_V3 = exports.DOC_TYPE_INVOICE_V3 = exports.DOC_TYPE_CUSTOM = exports.IdCardV1 = exports.CropperV1 = exports.CustomV1 = exports.PassportV1 = exports.FinancialDocumentV1 = exports.InvoiceV3 = exports.ReceiptV4 = exports.ReceiptV3 = exports.Document = void 0;
4
- const invoiceV3_1 = require("./invoice/invoiceV3");
26
+ exports.eu = exports.us = exports.fr = exports.Document = exports.ShippingContainerV1 = exports.CropperV1 = exports.CustomV1 = exports.FinancialDocumentV1 = exports.PassportV1 = exports.ReceiptV4 = exports.ReceiptV3 = exports.InvoiceV3 = void 0;
27
+ var invoiceV3_1 = require("./invoice/invoiceV3");
5
28
  Object.defineProperty(exports, "InvoiceV3", { enumerable: true, get: function () { return invoiceV3_1.InvoiceV3; } });
6
- const receiptV3_1 = require("./receipt/receiptV3");
29
+ var receiptV3_1 = require("./receipt/receiptV3");
7
30
  Object.defineProperty(exports, "ReceiptV3", { enumerable: true, get: function () { return receiptV3_1.ReceiptV3; } });
8
- const receiptV4_1 = require("./receipt/receiptV4");
31
+ var receiptV4_1 = require("./receipt/receiptV4");
9
32
  Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
10
- const passportV1_1 = require("./passport/passportV1");
33
+ var passportV1_1 = require("./passport/passportV1");
11
34
  Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
12
- const financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
35
+ var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
13
36
  Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
14
- const custom_1 = require("./custom");
37
+ var custom_1 = require("./custom");
15
38
  Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return custom_1.CustomV1; } });
16
- const cropperV1_1 = require("./cropper/cropperV1");
39
+ var cropperV1_1 = require("./cropper/cropperV1");
17
40
  Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
18
- const idCardV1_1 = require("./fr/idCard/idCardV1");
19
- Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
41
+ var shippingContainerV1_1 = require("./shipping_container/shippingContainerV1");
42
+ Object.defineProperty(exports, "ShippingContainerV1", { enumerable: true, get: function () { return shippingContainerV1_1.ShippingContainerV1; } });
20
43
  var document_1 = require("./document");
21
44
  Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });
22
- exports.DOC_TYPE_CUSTOM = custom_1.CustomV1.name;
23
- exports.DOC_TYPE_INVOICE_V3 = invoiceV3_1.InvoiceV3.name;
24
- exports.DOC_TYPE_RECEIPT_V3 = receiptV3_1.ReceiptV3.name;
25
- exports.DOC_TYPE_RECEIPT_V4 = receiptV4_1.ReceiptV4.name;
26
- exports.DOC_TYPE_PASSPORT_V1 = passportV1_1.PassportV1.name;
27
- exports.DOC_TYPE_FINANCIAL_V1 = financialDocumentV1_1.FinancialDocumentV1.name;
28
- exports.DOC_TYPE_CROPPER_V1 = cropperV1_1.CropperV1.name;
29
- exports.DOC_TYPE_IDCARD_V1 = idCardV1_1.IdCardV1.name;
45
+ exports.fr = __importStar(require("./fr"));
46
+ exports.us = __importStar(require("./us"));
47
+ exports.eu = __importStar(require("./eu"));
@@ -2,22 +2,39 @@ import { Document, DocumentConstructorProps } from "../document";
2
2
  import { BaseField, TaxField, PaymentDetails, Locale, Amount, Field, DateField, CompanyRegistration } from "../../fields";
3
3
  export declare class InvoiceV3 extends Document {
4
4
  #private;
5
+ /** Total amount with the tax amount of the purchase. */
5
6
  locale: Locale;
7
+ /** The nature of the invoice. */
6
8
  documentType: BaseField;
9
+ /** The total amount with tax included. */
7
10
  totalIncl: Amount;
11
+ /** The creation date of the invoice. */
8
12
  date: DateField;
13
+ /** The due date of the invoice. */
9
14
  dueDate: DateField;
15
+ /** The created time of the invoice */
10
16
  time: Field;
17
+ /** The total tax. */
11
18
  totalTax: Amount;
19
+ /** The total amount without the tax value. */
12
20
  totalExcl: Amount;
21
+ /** The supplier name. */
13
22
  supplier: Field;
23
+ /** The supplier address. */
14
24
  supplierAddress: Field;
25
+ /** The invoice number. */
15
26
  invoiceNumber: Field;
27
+ /** The company regitration information. */
16
28
  companyRegistration: CompanyRegistration[];
29
+ /** The name of the customer. */
17
30
  customerName: Field;
31
+ /** The address of the customer. */
18
32
  customerAddress: Field;
33
+ /** The list of the taxes. */
19
34
  taxes: TaxField[];
35
+ /** The payment information. */
20
36
  paymentDetails: PaymentDetails[];
37
+ /** The company registration information for the customer. */
21
38
  customerCompanyRegistration: CompanyRegistration[];
22
39
  constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
23
40
  toString(): string;
@@ -19,9 +19,13 @@ class InvoiceV3 extends document_1.Document {
19
19
  extras: extras,
20
20
  });
21
21
  _InvoiceV3_instances.add(this);
22
+ /** The company regitration information. */
22
23
  this.companyRegistration = [];
24
+ /** The list of the taxes. */
23
25
  this.taxes = [];
26
+ /** The payment information. */
24
27
  this.paymentDetails = [];
28
+ /** The company registration information for the customer. */
25
29
  this.customerCompanyRegistration = [];
26
30
  __classPrivateFieldGet(this, _InvoiceV3_instances, "m", _InvoiceV3_initFromApiPrediction).call(this, prediction, pageId);
27
31
  __classPrivateFieldGet(this, _InvoiceV3_instances, "m", _InvoiceV3_checklist).call(this);
@@ -2,18 +2,31 @@ import { Document, DocumentConstructorProps } from "../document";
2
2
  import { Field, DateField } from "../../fields";
3
3
  export declare class PassportV1 extends Document {
4
4
  #private;
5
+ /** The country of issue. */
5
6
  country: Field;
7
+ /** The passport number. */
6
8
  idNumber: Field;
9
+ /** The date of birth of the passport holder. */
7
10
  birthDate: DateField;
11
+ /** The expiration date of the passport. */
8
12
  expiryDate: DateField;
13
+ /** The issuance date.*/
9
14
  issuanceDate: DateField;
15
+ /** The place of birth of the passport holder. */
10
16
  birthPlace: Field;
17
+ /** The sex or gender of the passport holder. */
11
18
  gender: Field;
19
+ /** The surname of the person. */
12
20
  surname: Field;
21
+ /** The value of the first mrz line. */
13
22
  mrz1: Field;
23
+ /** The value of the second mrz line. */
14
24
  mrz2: Field;
25
+ /** List of first (given) names of the passport holder. */
15
26
  givenNames: Field[];
27
+ /** The full name of the passport holder. */
16
28
  fullName: Field;
29
+ /** All the mrz values combined. */
17
30
  mrz: Field;
18
31
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
19
32
  static convertMRZDateToDatetime(dateString: string): Date;
@@ -43,6 +43,7 @@ class PassportV1 extends document_1.Document {
43
43
  extras: extras,
44
44
  });
45
45
  _PassportV1_instances.add(this);
46
+ /** List of first (given) names of the passport holder. */
46
47
  this.givenNames = [];
47
48
  this.country = new fields_1.Field({
48
49
  prediction: prediction.country,
@@ -2,15 +2,23 @@ import { Document, DocumentConstructorProps } from "../document";
2
2
  import { TaxField, Field, Amount, Locale, DateField } from "../../fields";
3
3
  export declare class ReceiptV3 extends Document {
4
4
  #private;
5
+ /** Total amount with the tax amount of the purchase. */
5
6
  locale: Locale;
7
+ /** Where the purchase was made, the language, and the currency. */
6
8
  totalIncl: Amount;
9
+ /** The purchase date. */
7
10
  date: DateField;
8
- /** Receipt category as seen on the receipt. */
11
+ /** The type of purchase. */
9
12
  category: Field;
13
+ /** Merchant's name as seen on the receipt. */
10
14
  merchantName: Field;
15
+ /** Time as seen on the receipt in HH:MM format. */
11
16
  time: Field;
17
+ /** Total tax amount of the purchase. */
12
18
  totalTax: Amount;
19
+ /** Total amount without tax of the purchase. */
13
20
  totalExcl: Amount;
21
+ /** List of different taxe. */
14
22
  taxes: TaxField[];
15
23
  constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
16
24
  toString(): string;
@@ -19,6 +19,7 @@ class ReceiptV3 extends document_1.Document {
19
19
  fullText: fullText,
20
20
  });
21
21
  _ReceiptV3_instances.add(this);
22
+ /** List of different taxe. */
22
23
  this.taxes = [];
23
24
  this.locale = new fields_1.Locale({
24
25
  prediction: prediction.locale,
@@ -0,0 +1,12 @@
1
+ import { Document, DocumentConstructorProps } from "../document";
2
+ import { Field } from "../../fields";
3
+ export declare class ShippingContainerV1 extends Document {
4
+ /** ISO 6346 code for container owner prefix + equipment identifier. */
5
+ owner: Field;
6
+ /** ISO 6346 code for container serial number (6+1 digits). */
7
+ serialNumber: Field;
8
+ /** ISO 6346 code for container length, height and type. */
9
+ sizeType: Field;
10
+ constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
11
+ toString(): string;
12
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShippingContainerV1 = void 0;
4
+ const document_1 = require("../document");
5
+ const fields_1 = require("../../fields");
6
+ class ShippingContainerV1 extends document_1.Document {
7
+ constructor({ prediction, orientation = undefined, extras = undefined, inputSource = undefined, pageId = undefined, }) {
8
+ super({
9
+ inputSource: inputSource,
10
+ pageId: pageId,
11
+ orientation: orientation,
12
+ extras: extras,
13
+ });
14
+ this.owner = new fields_1.Field({
15
+ prediction: prediction.owner,
16
+ pageId: pageId,
17
+ });
18
+ this.serialNumber = new fields_1.Field({
19
+ prediction: prediction.serial_number,
20
+ pageId: pageId,
21
+ });
22
+ this.sizeType = new fields_1.Field({
23
+ prediction: prediction.size_type,
24
+ pageId: pageId,
25
+ });
26
+ }
27
+ toString() {
28
+ const outStr = `----- Shipping Container V1 -----
29
+ Owner: ${this.owner}
30
+ Serial number: ${this.serialNumber}
31
+ Size and type: ${this.sizeType}
32
+ ----------------------
33
+ `;
34
+ return ShippingContainerV1.cleanOutString(outStr);
35
+ }
36
+ }
37
+ exports.ShippingContainerV1 = ShippingContainerV1;
@@ -1,3 +1,22 @@
1
- import { Document } from "../../document";
1
+ import { Document, DocumentConstructorProps } from "../../document";
2
+ import { Field, DateField, PositionField, Amount } from "../../../fields";
2
3
  export declare class BankCheckV1 extends Document {
4
+ /** Payer's bank account number. */
5
+ accountNumber: Field;
6
+ /** Total including taxes. */
7
+ amount: Amount;
8
+ /** Payer's bank account number. */
9
+ checkNumber: Field;
10
+ /** Check's position in the image. */
11
+ checkPosition: PositionField;
12
+ /** Date the check was issued. */
13
+ issuanceDate: DateField;
14
+ /** List of payees (full name or company name). */
15
+ payees: Field[];
16
+ /** Payer's bank account routing number. */
17
+ routingNumber: Field;
18
+ /** Signatures' positions in the image. */
19
+ signaturesPositions: PositionField;
20
+ constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
21
+ toString(): string;
3
22
  }
@@ -2,6 +2,63 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BankCheckV1 = void 0;
4
4
  const document_1 = require("../../document");
5
+ const fields_1 = require("../../../fields");
5
6
  class BankCheckV1 extends document_1.Document {
7
+ constructor({ prediction, orientation = undefined, extras = undefined, inputSource = undefined, pageId = undefined, }) {
8
+ super({
9
+ inputSource: inputSource,
10
+ pageId: pageId,
11
+ orientation: orientation,
12
+ extras: extras,
13
+ });
14
+ /** List of payees (full name or company name). */
15
+ this.payees = [];
16
+ this.accountNumber = new fields_1.Field({
17
+ prediction: prediction.account_number,
18
+ pageId: pageId,
19
+ });
20
+ this.checkNumber = new fields_1.Field({
21
+ prediction: prediction.check_number,
22
+ pageId: pageId,
23
+ });
24
+ this.amount = new fields_1.Amount({
25
+ prediction: prediction.amount,
26
+ valueKey: "value",
27
+ pageId: pageId,
28
+ });
29
+ this.checkPosition = new fields_1.PositionField({
30
+ prediction: prediction.check_position,
31
+ pageId: pageId,
32
+ });
33
+ this.issuanceDate = new fields_1.DateField({
34
+ prediction: prediction.date,
35
+ pageId: pageId,
36
+ });
37
+ prediction.payees.map((prediction) => this.payees.push(new fields_1.Field({
38
+ prediction: prediction,
39
+ pageId: pageId,
40
+ })));
41
+ this.routingNumber = new fields_1.Field({
42
+ prediction: prediction.routing_number,
43
+ pageId: pageId,
44
+ });
45
+ this.signaturesPositions = new fields_1.PositionField({
46
+ prediction: prediction.signatures_positions,
47
+ pageId: pageId,
48
+ });
49
+ }
50
+ toString() {
51
+ const outStr = `----- US Bank Check V1 -----
52
+ Filename: ${this.filename}
53
+ Routing number: ${this.routingNumber}
54
+ Account number: ${this.accountNumber}
55
+ Check number: ${this.checkNumber}
56
+ Date: ${this.issuanceDate}
57
+ Amount: ${this.amount}
58
+ Payees: ${this.payees.map((name) => name.value).join(", ")}
59
+ ----------------------
60
+ `;
61
+ return BankCheckV1.cleanOutString(outStr);
62
+ }
6
63
  }
7
64
  exports.BankCheckV1 = BankCheckV1;
@@ -0,0 +1 @@
1
+ export { BankCheckV1 } from "./bankCheck/bankCheckV1";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankCheckV1 = void 0;
4
+ var bankCheckV1_1 = require("./bankCheck/bankCheckV1");
5
+ Object.defineProperty(exports, "BankCheckV1", { enumerable: true, get: function () { return bankCheckV1_1.BankCheckV1; } });
@@ -1,6 +1,7 @@
1
1
  import { Field, FieldConstructor } from "./field";
2
2
  export declare function floatToString(value: number): string;
3
3
  export declare class Amount extends Field {
4
+ /** The value. */
4
5
  value: number | undefined;
5
6
  /**
6
7
  * @param {Object} prediction - Prediction object from HTTP response
@@ -1,6 +1,7 @@
1
1
  import { FieldConstructor, stringDict } from "./field";
2
2
  import { Polygon } from "../geometry";
3
3
  export declare class ClassificationField {
4
+ /** The value for the classification. */
4
5
  value: string;
5
6
  /**
6
7
  * The confidence score of the prediction.
@@ -1,6 +1,6 @@
1
1
  import { Field, FieldConstructor } from "./field";
2
2
  export declare class CompanyRegistration extends Field {
3
- /** Type of company registration number */
3
+ /** Type of company registration number. */
4
4
  type: string;
5
5
  constructor({ prediction, valueKey, reconstructed, pageId, }: FieldConstructor);
6
6
  }
@@ -14,6 +14,7 @@ export interface BaseFieldConstructor {
14
14
  reconstructed?: boolean;
15
15
  }
16
16
  export declare class BaseField {
17
+ /** The value. */
17
18
  value?: any;
18
19
  /**
19
20
  * True if the field was reconstructed or computed using other fields.
@@ -9,6 +9,7 @@ class BaseField {
9
9
  * @param {Boolean} reconstructed - Does the object is reconstructed (not extracted by the API)
10
10
  */
11
11
  constructor({ prediction, valueKey = "value", reconstructed = false, }) {
12
+ /** The value. */
12
13
  this.value = undefined;
13
14
  this.reconstructed = reconstructed;
14
15
  if (prediction !== undefined &&
@@ -8,4 +8,4 @@ export { BaseField, stringDict, Field } from "./field";
8
8
  export { ListField, ListFieldValue, ClassificationField } from "./apiBuilder";
9
9
  export { FullText } from "./fullText";
10
10
  export { CompanyRegistration } from "./companyRegistration";
11
- export { CropperField } from "./cropper";
11
+ export { PositionField } from "./position";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CropperField = exports.CompanyRegistration = exports.FullText = exports.ClassificationField = exports.ListFieldValue = exports.ListField = exports.Field = exports.BaseField = exports.DateField = exports.Amount = exports.Locale = exports.OrientationField = exports.PaymentDetails = exports.TaxField = void 0;
3
+ exports.PositionField = exports.CompanyRegistration = exports.FullText = exports.ClassificationField = exports.ListFieldValue = exports.ListField = exports.Field = exports.BaseField = exports.DateField = exports.Amount = exports.Locale = exports.OrientationField = exports.PaymentDetails = exports.TaxField = void 0;
4
4
  var tax_1 = require("./tax");
5
5
  Object.defineProperty(exports, "TaxField", { enumerable: true, get: function () { return tax_1.TaxField; } });
6
6
  var paymentDetails_1 = require("./paymentDetails");
@@ -24,5 +24,5 @@ var fullText_1 = require("./fullText");
24
24
  Object.defineProperty(exports, "FullText", { enumerable: true, get: function () { return fullText_1.FullText; } });
25
25
  var companyRegistration_1 = require("./companyRegistration");
26
26
  Object.defineProperty(exports, "CompanyRegistration", { enumerable: true, get: function () { return companyRegistration_1.CompanyRegistration; } });
27
- var cropper_1 = require("./cropper");
28
- Object.defineProperty(exports, "CropperField", { enumerable: true, get: function () { return cropper_1.CropperField; } });
27
+ var position_1 = require("./position");
28
+ Object.defineProperty(exports, "PositionField", { enumerable: true, get: function () { return position_1.PositionField; } });
@@ -1,7 +1,10 @@
1
1
  import { Field } from "./field";
2
2
  export declare class Locale extends Field {
3
+ /** The langage which has been detected */
3
4
  language: string | undefined;
5
+ /** The country which has been detected (ISO Alpha-2)*/
4
6
  country: string | undefined;
7
+ /** The currency which has been detected.*/
5
8
  currency: string | undefined;
6
9
  /**
7
10
  * @param {Object} prediction - Prediction object from HTTP response
@@ -11,9 +11,13 @@ interface PaymentDetailsConstructor {
11
11
  }
12
12
  export declare class PaymentDetails extends Field {
13
13
  #private;
14
+ /** The account number. */
14
15
  accountNumber: number | undefined;
16
+ /** The account IBAN. */
15
17
  iban: string | undefined;
18
+ /** The routing number. */
16
19
  routingNumber: number | undefined;
20
+ /** The SWIFT value. */
17
21
  swift: number | undefined;
18
22
  /**
19
23
  * @param {Object} prediction - Prediction object from HTTP response
@@ -1,6 +1,11 @@
1
- import { BaseField, FieldConstructor } from "./field";
1
+ import { stringDict } from "./field";
2
2
  import { Polygon } from "../geometry";
3
- export declare class CropperField extends BaseField {
3
+ export interface PositionFieldConstructor {
4
+ prediction: stringDict;
5
+ valueKey?: string;
6
+ pageId?: number | undefined;
7
+ }
8
+ export declare class PositionField {
4
9
  /** Straight rectangle. */
5
10
  boundingBox: Polygon;
6
11
  /** Free polygon with up to 30 vertices. */
@@ -11,6 +16,6 @@ export declare class CropperField extends BaseField {
11
16
  rectangle: Polygon;
12
17
  /** The document page on which the information was found. */
13
18
  pageId: number | undefined;
14
- constructor({ prediction, valueKey, pageId }: FieldConstructor);
19
+ constructor({ prediction, pageId }: PositionFieldConstructor);
15
20
  toString(): string;
16
21
  }
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CropperField = void 0;
4
- const field_1 = require("./field");
5
- class CropperField extends field_1.BaseField {
6
- constructor({ prediction, valueKey = "polygon", pageId }) {
7
- super({ prediction, valueKey });
3
+ exports.PositionField = void 0;
4
+ class PositionField {
5
+ constructor({ prediction, pageId }) {
8
6
  this.pageId = pageId;
9
7
  this.boundingBox = prediction.bounding_box;
10
8
  this.polygon = prediction.polygon;
@@ -15,4 +13,4 @@ class CropperField extends field_1.BaseField {
15
13
  return `Polygon with ${this.polygon.length} points.`;
16
14
  }
17
15
  }
18
- exports.CropperField = CropperField;
16
+ exports.PositionField = PositionField;
package/src/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { CustomV1, FinancialDocumentV1, InvoiceV3, PassportV1, ReceiptV3, ReceiptV4, CropperV1, IdCardV1, } from "./documents";
1
+ export { CustomV1, FinancialDocumentV1, InvoiceV3, PassportV1, ReceiptV3, ReceiptV4, CropperV1, ShippingContainerV1, fr, us, eu, } from "./documents";
2
2
  export { Client } from "./client";
3
3
  export { PageOptionsOperation } from "./inputs";
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageOptionsOperation = exports.Client = exports.IdCardV1 = exports.CropperV1 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PassportV1 = exports.InvoiceV3 = exports.FinancialDocumentV1 = exports.CustomV1 = void 0;
3
+ exports.PageOptionsOperation = exports.Client = exports.eu = exports.us = exports.fr = exports.ShippingContainerV1 = exports.CropperV1 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PassportV1 = exports.InvoiceV3 = exports.FinancialDocumentV1 = exports.CustomV1 = void 0;
4
4
  var documents_1 = require("./documents");
5
5
  Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return documents_1.CustomV1; } });
6
6
  Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return documents_1.FinancialDocumentV1; } });
@@ -9,7 +9,10 @@ Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function (
9
9
  Object.defineProperty(exports, "ReceiptV3", { enumerable: true, get: function () { return documents_1.ReceiptV3; } });
10
10
  Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return documents_1.ReceiptV4; } });
11
11
  Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return documents_1.CropperV1; } });
12
- Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return documents_1.IdCardV1; } });
12
+ Object.defineProperty(exports, "ShippingContainerV1", { enumerable: true, get: function () { return documents_1.ShippingContainerV1; } });
13
+ Object.defineProperty(exports, "fr", { enumerable: true, get: function () { return documents_1.fr; } });
14
+ Object.defineProperty(exports, "us", { enumerable: true, get: function () { return documents_1.us; } });
15
+ Object.defineProperty(exports, "eu", { enumerable: true, get: function () { return documents_1.eu; } });
13
16
  var client_1 = require("./client");
14
17
  Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
15
18
  var inputs_1 = require("./inputs");