mindee 3.4.0 → 3.4.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 (68) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +5 -0
  3. package/package.json +19 -19
  4. package/src/api/index.d.ts +1 -1
  5. package/src/api/response.d.ts +3 -0
  6. package/src/client.d.ts +3 -3
  7. package/src/client.js +1 -1
  8. package/src/documents/{custom.d.ts → custom/customV1.d.ts} +4 -4
  9. package/src/documents/{custom.js → custom/customV1.js} +2 -2
  10. package/src/{fields/apiBuilder.d.ts → documents/custom/fields.d.ts} +8 -6
  11. package/src/{fields/apiBuilder.js → documents/custom/fields.js} +1 -1
  12. package/src/documents/document.d.ts +4 -4
  13. package/src/documents/eu/licensePlate/licensePlateV1.d.ts +2 -2
  14. package/src/documents/eu/licensePlate/licensePlateV1.js +1 -1
  15. package/src/documents/financialDocument/financialDocumentV1.d.ts +9 -9
  16. package/src/documents/financialDocument/financialDocumentV1.js +5 -5
  17. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +4 -4
  18. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.js +3 -3
  19. package/src/documents/fr/carteVitale/carteVitaleV1.d.ts +4 -4
  20. package/src/documents/fr/carteVitale/carteVitaleV1.js +3 -3
  21. package/src/documents/fr/idCard/idCardV1.d.ts +9 -9
  22. package/src/documents/fr/idCard/idCardV1.js +8 -8
  23. package/src/documents/index.d.ts +1 -1
  24. package/src/documents/index.js +2 -2
  25. package/src/documents/invoice/invoiceLineItem.d.ts +2 -2
  26. package/src/documents/invoice/invoiceV3.d.ts +7 -7
  27. package/src/documents/invoice/invoiceV3.js +5 -5
  28. package/src/documents/invoice/invoiceV4.d.ts +7 -9
  29. package/src/documents/invoice/invoiceV4.js +6 -6
  30. package/src/documents/invoice/reconstruction.js +5 -4
  31. package/src/documents/passport/passportV1.d.ts +11 -11
  32. package/src/documents/passport/passportV1.js +15 -13
  33. package/src/documents/receipt/receiptV3.d.ts +4 -4
  34. package/src/documents/receipt/receiptV3.js +6 -7
  35. package/src/documents/receipt/receiptV4.d.ts +6 -6
  36. package/src/documents/receipt/receiptV4.js +5 -6
  37. package/src/documents/shipping_container/shippingContainerV1.d.ts +4 -4
  38. package/src/documents/shipping_container/shippingContainerV1.js +3 -3
  39. package/src/documents/us/bankCheck/bankCheckV1.d.ts +5 -5
  40. package/src/documents/us/bankCheck/bankCheckV1.js +4 -4
  41. package/src/fields/amount.d.ts +1 -1
  42. package/src/fields/amount.js +2 -0
  43. package/src/fields/base.d.ts +27 -0
  44. package/src/fields/base.js +53 -0
  45. package/src/fields/companyRegistration.d.ts +3 -1
  46. package/src/fields/date.d.ts +4 -1
  47. package/src/fields/date.js +16 -8
  48. package/src/fields/field.d.ts +8 -38
  49. package/src/fields/field.js +6 -53
  50. package/src/fields/fullText.d.ts +1 -1
  51. package/src/fields/fullText.js +4 -4
  52. package/src/fields/index.d.ts +3 -3
  53. package/src/fields/index.js +5 -8
  54. package/src/fields/locale.d.ts +13 -9
  55. package/src/fields/locale.js +4 -3
  56. package/src/fields/orientation.d.ts +3 -1
  57. package/src/fields/orientation.js +2 -2
  58. package/src/fields/paymentDetails.d.ts +4 -1
  59. package/src/fields/paymentDetails.js +26 -23
  60. package/src/fields/position.d.ts +2 -2
  61. package/src/fields/tax.d.ts +2 -1
  62. package/src/fields/text.d.ts +13 -0
  63. package/src/fields/text.js +10 -0
  64. package/src/geometry.d.ts +1 -2
  65. package/src/index.d.ts +4 -3
  66. package/src/index.js +5 -1
  67. package/src/inputs/sources.d.ts +4 -4
  68. package/src/inputs/sources.js +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v3.4.1 - 2023-01-05
4
+ ### Changes
5
+ * :label: Added typing information, get rid of `any` type in various places
6
+ * :recycle: Use a specific `TextField` class for fields we know are textual
7
+ * :arrow_up: update dependencies
8
+
9
+ ### Fixes
10
+ * :bug: Expose various class and type definitions to improve developer experience
11
+
3
12
  ## v3.4.0 - 2023-01-04
4
13
  ### Changes
5
14
  * :sparkles: Support Receipt V4.1
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![License: MIT](https://img.shields.io/github/license/mindee/mindee-api-nodejs)](https://opensource.org/licenses/MIT)
2
+ [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mindee/mindee-api-nodejs/test.yml)](https://github.com/mindee/mindee-api-nodejs)
3
+ [![NPM Version](https://img.shields.io/npm/v/mindee)](https://www.npmjs.com/package/mindee)
4
+ [![Downloads](https://img.shields.io/npm/dm/mindee)](https://www.npmjs.com/package/mindee)
5
+
1
6
  # Mindee API Helper Library for Node.js
2
7
  Quickly and easily connect to Mindee's API services using Node.js.
3
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindee",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Mindee Client Library for Node.js",
5
5
  "main": "src/index.js",
6
6
  "bin": "bin/mindee.js",
@@ -38,27 +38,27 @@
38
38
  },
39
39
  "homepage": "https://mindee.com/",
40
40
  "devDependencies": {
41
- "@types/chai": "^4.3.1",
41
+ "@types/chai": "^4.3.4",
42
42
  "@types/mocha": "^9.1.1",
43
- "@types/node": "^17.0.38",
44
- "@typescript-eslint/eslint-plugin": "^5.30.0",
45
- "@typescript-eslint/parser": "^5.30.0",
46
- "chai": "^4.3.6",
47
- "eslint": "^8.18.0",
48
- "eslint-config-prettier": "^8.5.0",
49
- "eslint-plugin-prettier": "^4.1.0",
50
- "jsdoc": "^3.6.10",
51
- "mocha": "^10.0.0",
52
- "prettier": "^2.7.1",
53
- "ts-node": "^10.8.1",
54
- "typescript": "^4.7.4"
43
+ "@types/node": "^18.11.18",
44
+ "@typescript-eslint/eslint-plugin": "^5.48.0",
45
+ "@typescript-eslint/parser": "^5.48.0",
46
+ "chai": "^4.3.7",
47
+ "eslint": "^8.31.0",
48
+ "eslint-config-prettier": "^8.6.0",
49
+ "eslint-plugin-prettier": "^4.2.1",
50
+ "jsdoc": "^3.6.11",
51
+ "mocha": "^10.1.0",
52
+ "prettier": "^2.8.1",
53
+ "ts-node": "^10.9.1",
54
+ "typescript": "^4.9.4"
55
55
  },
56
56
  "dependencies": {
57
- "commander": "^9.4.0",
58
- "file-type": "^16.5.4",
59
- "form-data": "^3.0.1",
60
- "mrz": "^3.1.4",
61
- "pdf-lib": "^1.17.1"
57
+ "commander": "~9.4.1",
58
+ "file-type": "~16.5.4",
59
+ "form-data": "~3.0.1",
60
+ "mrz": "~3.2.1",
61
+ "pdf-lib": "~1.17.1"
62
62
  },
63
63
  "keywords": [
64
64
  "typescript",
@@ -1,2 +1,2 @@
1
- export { Response } from "./response";
1
+ export { Response, ResponseSig } from "./response";
2
2
  export { Endpoint, CustomEndpoint, StandardEndpoint, predictResponse, STANDARD_API_OWNER, API_KEY_ENVVAR_NAME, } from "./endpoint";
@@ -7,6 +7,9 @@ export interface ResponseProps {
7
7
  input: InputSource;
8
8
  error: boolean;
9
9
  }
10
+ export type ResponseSig<DocType extends Document> = {
11
+ new (documentClass: DocumentSig<DocType>, params: ResponseProps): Response<DocType>;
12
+ };
10
13
  /**
11
14
  * Base class for all responses.
12
15
  */
package/src/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
+ import { Readable } from "stream";
3
4
  import { InputSource, PageOptions } from "./inputs";
4
5
  import { Response } from "./api";
5
6
  import { Document, DocumentSig } from "./documents";
6
7
  import { DocumentConfig } from "./documents/documentConfig";
7
- import { ReadStream } from "fs";
8
8
  type DocConfigs = Map<string[], DocumentConfig<any>>;
9
9
  export interface PredictOptions {
10
10
  /**
@@ -100,11 +100,11 @@ export declare class Client {
100
100
  */
101
101
  docFromBase64(inputString: string, filename: string): DocumentClient;
102
102
  /**
103
- * Load an input document from a `ReadStream`.
103
+ * Load an input document from a `stream.Readable` object.
104
104
  * @param inputStream
105
105
  * @param filename
106
106
  */
107
- docFromStream(inputStream: ReadStream, filename: string): DocumentClient;
107
+ docFromStream(inputStream: Readable, filename: string): DocumentClient;
108
108
  /**
109
109
  * Load an input document from a bytes string.
110
110
  * @param inputBytes
package/src/client.js CHANGED
@@ -155,7 +155,7 @@ class Client {
155
155
  return new DocumentClient(doc, this.docConfigs);
156
156
  }
157
157
  /**
158
- * Load an input document from a `ReadStream`.
158
+ * Load an input document from a `stream.Readable` object.
159
159
  * @param inputStream
160
160
  * @param filename
161
161
  */
@@ -1,10 +1,10 @@
1
- import { Document, DocumentConstructorProps } from "./document";
2
- import { ClassificationField, ListField } from "../fields";
3
- import { stringDict } from "../fields";
1
+ import { Document, DocumentConstructorProps } from "../document";
2
+ import { ClassificationField, ListField } from "./fields";
3
+ import { StringDict } from "../../fields";
4
4
  export declare class CustomV1 extends Document {
5
5
  fields: Map<string, ListField>;
6
6
  classifications: Map<string, ClassificationField>;
7
7
  constructor({ inputSource, prediction, extras, orientation, pageId, documentType, }: DocumentConstructorProps);
8
- protected setField(fieldName: string, apiPrediction: stringDict, pageId: number | undefined): void;
8
+ protected setField(fieldName: string, apiPrediction: StringDict, pageId: number | undefined): void;
9
9
  toString(): string;
10
10
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomV1 = void 0;
4
- const document_1 = require("./document");
5
- const fields_1 = require("../fields");
4
+ const document_1 = require("../document");
5
+ const fields_1 = require("./fields");
6
6
  class CustomV1 extends document_1.Document {
7
7
  constructor({ inputSource, prediction, extras = undefined, orientation = undefined, pageId, documentType, }) {
8
8
  super({
@@ -1,5 +1,6 @@
1
- import { FieldConstructor, stringDict } from "./field";
2
- import { Polygon } from "../geometry";
1
+ import { StringDict } from "../../fields/base";
2
+ import { FieldConstructor } from "../../fields/field";
3
+ import { Polygon } from "../../geometry";
3
4
  export declare class ClassificationField {
4
5
  /** The value for the classification. */
5
6
  value: string;
@@ -9,12 +10,13 @@ export declare class ClassificationField {
9
10
  */
10
11
  confidence: number;
11
12
  constructor({ prediction }: {
12
- prediction: stringDict;
13
+ prediction: StringDict;
13
14
  });
14
15
  toString(): string;
15
16
  }
16
17
  export declare class ListFieldValue {
17
- content: any;
18
+ /** Extracted content of the prediction */
19
+ content: string | number;
18
20
  /**
19
21
  * The confidence score of the prediction.
20
22
  * Note: Score is calculated on **word selection**, not its textual content (OCR).
@@ -30,7 +32,7 @@ export declare class ListFieldValue {
30
32
  * the word in the document.
31
33
  */
32
34
  polygon: Polygon;
33
- constructor(prediction: stringDict);
35
+ constructor(prediction: StringDict);
34
36
  toString(): string;
35
37
  }
36
38
  export declare class ListField {
@@ -41,7 +43,7 @@ export declare class ListField {
41
43
  /** The document page on which the information was found. */
42
44
  pageId: number;
43
45
  constructor({ prediction, reconstructed, pageId }: FieldConstructor);
44
- contentsList(): Array<any>;
46
+ contentsList(): Array<string | number>;
45
47
  contentsString(separator?: string): string;
46
48
  toString(): string;
47
49
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListField = exports.ListFieldValue = exports.ClassificationField = void 0;
4
- const geometry_1 = require("../geometry");
4
+ const geometry_1 = require("../../geometry");
5
5
  class ClassificationField {
6
6
  constructor({ prediction }) {
7
7
  this.value = prediction["value"];
@@ -1,17 +1,17 @@
1
1
  import { InputSource } from "../inputs";
2
- import { PositionField, FullText, OrientationField, stringDict } from "../fields";
2
+ import { PositionField, FullText, OrientationField, StringDict } from "../fields";
3
3
  export type DocumentSig<DocType extends Document> = {
4
4
  new ({ prediction, orientation, extras, inputSource, pageId, fullText, documentType, }: DocumentConstructorProps): DocType;
5
5
  };
6
6
  export interface DocumentConstructorProps extends BaseDocumentConstructorProps {
7
7
  /** JSON parsed prediction from HTTP response */
8
- prediction: stringDict;
8
+ prediction: StringDict;
9
9
  }
10
10
  interface BaseDocumentConstructorProps {
11
11
  /** Orientation JSON for page-level document */
12
- orientation?: stringDict;
12
+ orientation?: StringDict;
13
13
  /** Extras JSON */
14
- extras?: stringDict;
14
+ extras?: StringDict;
15
15
  /** input file given to parse the document */
16
16
  inputSource?: InputSource;
17
17
  /** Page ID for page-level document */
@@ -1,8 +1,8 @@
1
1
  import { Document, DocumentConstructorProps } from "../../document";
2
- import { Field } from "../../../fields";
2
+ import { TextField } from "../../../fields";
3
3
  export declare class LicensePlateV1 extends Document {
4
4
  /** A list of license plates values. */
5
- licensePlates: Field[];
5
+ licensePlates: TextField[];
6
6
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
7
7
  toString(): string;
8
8
  }
@@ -13,7 +13,7 @@ class LicensePlateV1 extends document_1.Document {
13
13
  });
14
14
  /** A list of license plates values. */
15
15
  this.licensePlates = [];
16
- prediction.license_plates.map((prediction) => this.licensePlates.push(new fields_1.Field({
16
+ prediction.license_plates.map((prediction) => this.licensePlates.push(new fields_1.TextField({
17
17
  prediction: prediction,
18
18
  pageId: pageId,
19
19
  })));
@@ -1,5 +1,5 @@
1
1
  import { Document, DocumentConstructorProps } from "../document";
2
- import { TaxField, Field, Amount, Locale, DateField as Date, CompanyRegistration } from "../../fields";
2
+ import { TaxField, TextField, Amount, Locale, DateField as Date, CompanyRegistration } from "../../fields";
3
3
  export declare class FinancialDocumentV1 extends Document {
4
4
  #private;
5
5
  pageId: number | undefined;
@@ -7,18 +7,18 @@ export declare class FinancialDocumentV1 extends Document {
7
7
  totalIncl: Amount;
8
8
  date: Date;
9
9
  dueDate: Date;
10
- category: Field;
11
- time: Field;
10
+ category: TextField;
11
+ time: TextField;
12
12
  taxes: TaxField[];
13
13
  totalTax: Amount;
14
14
  totalExcl: Amount;
15
- supplier: Field;
16
- supplierAddress: Field;
17
- invoiceNumber: Field;
15
+ supplier: TextField;
16
+ supplierAddress: TextField;
17
+ invoiceNumber: TextField;
18
18
  companyRegistration: CompanyRegistration[];
19
- customerName: Field;
20
- customerAddress: Field;
21
- paymentDetails: Field[];
19
+ customerName: TextField;
20
+ customerAddress: TextField;
21
+ paymentDetails: TextField[];
22
22
  customerCompanyRegistration: CompanyRegistration[];
23
23
  constructor({ prediction, orientation, extras, inputSource, fullText, pageId, }: DocumentConstructorProps);
24
24
  toString(): string;
@@ -63,7 +63,7 @@ _FinancialDocumentV1_instances = new WeakSet(), _FinancialDocumentV1_initFromApi
63
63
  this.companyRegistration = invoice.customerCompanyRegistration;
64
64
  this.orientation = invoice.orientation;
65
65
  this.totalTax = invoice.totalTax;
66
- this.time = new fields_1.Field({
66
+ this.time = new fields_1.TextField({
67
67
  prediction: { value: undefined, confidence: 0.0 },
68
68
  });
69
69
  this.customerName = invoice.customerName;
@@ -86,18 +86,18 @@ _FinancialDocumentV1_instances = new WeakSet(), _FinancialDocumentV1_initFromApi
86
86
  this.totalIncl = receipt.totalIncl;
87
87
  this.totalExcl = receipt.totalExcl;
88
88
  this.supplier = receipt.merchantName;
89
- this.supplierAddress = new fields_1.Field({
89
+ this.supplierAddress = new fields_1.TextField({
90
90
  prediction: { value: undefined, confidence: 0.0 },
91
91
  });
92
92
  this.time = receipt.time;
93
93
  this.totalTax = receipt.totalTax;
94
- this.invoiceNumber = new fields_1.Field({
94
+ this.invoiceNumber = new fields_1.TextField({
95
95
  prediction: { value: undefined, confidence: 0.0 },
96
96
  });
97
- this.customerName = new fields_1.Field({
97
+ this.customerName = new fields_1.TextField({
98
98
  prediction: { value: undefined, confidence: 0.0 },
99
99
  });
100
- this.customerAddress = new fields_1.Field({
100
+ this.customerAddress = new fields_1.TextField({
101
101
  prediction: { value: undefined, confidence: 0.0 },
102
102
  });
103
103
  }
@@ -1,12 +1,12 @@
1
1
  import { Document, DocumentConstructorProps } from "../../document";
2
- import { Field } from "../../../fields";
2
+ import { TextField } from "../../../fields";
3
3
  export declare class BankAccountDetailsV1 extends Document {
4
4
  /** The IBAN number. */
5
- iban: Field;
5
+ iban: TextField;
6
6
  /** The account holder name. */
7
- accountHolderName: Field;
7
+ accountHolderName: TextField;
8
8
  /** The SWIFT value. */
9
- swift: Field;
9
+ swift: TextField;
10
10
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
11
11
  toString(): string;
12
12
  }
@@ -11,15 +11,15 @@ class BankAccountDetailsV1 extends document_1.Document {
11
11
  orientation: orientation,
12
12
  extras: extras,
13
13
  });
14
- this.iban = new fields_1.Field({
14
+ this.iban = new fields_1.TextField({
15
15
  prediction: prediction.iban,
16
16
  pageId: pageId,
17
17
  });
18
- this.accountHolderName = new fields_1.Field({
18
+ this.accountHolderName = new fields_1.TextField({
19
19
  prediction: prediction.account_holder_name,
20
20
  pageId: pageId,
21
21
  });
22
- this.swift = new fields_1.Field({
22
+ this.swift = new fields_1.TextField({
23
23
  prediction: prediction.swift,
24
24
  pageId: pageId,
25
25
  });
@@ -1,12 +1,12 @@
1
1
  import { Document, DocumentConstructorProps } from "../../document";
2
- import { Field, DateField } from "../../../fields";
2
+ import { TextField, DateField } from "../../../fields";
3
3
  export declare class CarteVitaleV1 extends Document {
4
4
  /** The list of the names of the person. */
5
- givenNames: Field[];
5
+ givenNames: TextField[];
6
6
  /** The surname of the person. */
7
- surname: Field;
7
+ surname: TextField;
8
8
  /** The ID number of the card. */
9
- idNumber: Field;
9
+ idNumber: TextField;
10
10
  /** The issuance date of the card. */
11
11
  issuanceDate: DateField;
12
12
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
@@ -13,7 +13,7 @@ class CarteVitaleV1 extends document_1.Document {
13
13
  });
14
14
  /** The list of the names of the person. */
15
15
  this.givenNames = [];
16
- this.idNumber = new fields_1.Field({
16
+ this.idNumber = new fields_1.TextField({
17
17
  prediction: prediction.social_security,
18
18
  pageId: pageId,
19
19
  });
@@ -21,11 +21,11 @@ class CarteVitaleV1 extends document_1.Document {
21
21
  prediction: prediction.issuance_date,
22
22
  pageId: pageId,
23
23
  });
24
- this.surname = new fields_1.Field({
24
+ this.surname = new fields_1.TextField({
25
25
  prediction: prediction.surname,
26
26
  pageId: pageId,
27
27
  });
28
- prediction.given_names.map((prediction) => this.givenNames.push(new fields_1.Field({
28
+ prediction.given_names.map((prediction) => this.givenNames.push(new fields_1.TextField({
29
29
  prediction: prediction,
30
30
  pageId: pageId,
31
31
  })));
@@ -1,28 +1,28 @@
1
1
  import { Document, DocumentConstructorProps } from "../../document";
2
- import { Field, DateField, BaseField } from "../../../fields";
2
+ import { TextField, DateField, BaseField } from "../../../fields";
3
3
  export declare class IdCardV1 extends Document {
4
4
  /** The authority which has issued the card. */
5
- authority: Field;
5
+ authority: TextField;
6
6
  /** Indicates if it is the recto, the verso or the both of it. */
7
7
  documentSide: BaseField;
8
8
  /** The id number of the card. */
9
- idNumber: Field;
9
+ idNumber: TextField;
10
10
  /** The birth date of the person. */
11
11
  birthDate: DateField;
12
12
  /** The expiry date of the card. */
13
13
  expiryDate: DateField;
14
14
  /** The birth place of the person. */
15
- birthPlace: Field;
15
+ birthPlace: TextField;
16
16
  /** The gender of the person. */
17
- gender: Field;
17
+ gender: TextField;
18
18
  /** The first mrz value. */
19
- mrz1: Field;
19
+ mrz1: TextField;
20
20
  /** The second mrz value. */
21
- mrz2: Field;
21
+ mrz2: TextField;
22
22
  /** The surname of the person. */
23
- surname: Field;
23
+ surname: TextField;
24
24
  /** The list of the names of the person. */
25
- givenNames: Field[];
25
+ givenNames: TextField[];
26
26
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
27
27
  toString(): string;
28
28
  }
@@ -13,14 +13,14 @@ class IdCardV1 extends document_1.Document {
13
13
  });
14
14
  /** The list of the names of the person. */
15
15
  this.givenNames = [];
16
- this.authority = new fields_1.Field({
16
+ this.authority = new fields_1.TextField({
17
17
  prediction: prediction.authority,
18
18
  pageId: pageId,
19
19
  });
20
20
  this.documentSide = new fields_1.BaseField({
21
21
  prediction: prediction.document_side,
22
22
  });
23
- this.idNumber = new fields_1.Field({
23
+ this.idNumber = new fields_1.TextField({
24
24
  prediction: prediction.id_number,
25
25
  pageId: pageId,
26
26
  });
@@ -32,27 +32,27 @@ class IdCardV1 extends document_1.Document {
32
32
  prediction: prediction.expiry_date,
33
33
  pageId: pageId,
34
34
  });
35
- this.birthPlace = new fields_1.Field({
35
+ this.birthPlace = new fields_1.TextField({
36
36
  prediction: prediction.birth_place,
37
37
  pageId: pageId,
38
38
  });
39
- this.gender = new fields_1.Field({
39
+ this.gender = new fields_1.TextField({
40
40
  prediction: prediction.gender,
41
41
  pageId: pageId,
42
42
  });
43
- this.surname = new fields_1.Field({
43
+ this.surname = new fields_1.TextField({
44
44
  prediction: prediction.surname,
45
45
  pageId: pageId,
46
46
  });
47
- this.mrz1 = new fields_1.Field({
47
+ this.mrz1 = new fields_1.TextField({
48
48
  prediction: prediction.mrz1,
49
49
  pageId: pageId,
50
50
  });
51
- this.mrz2 = new fields_1.Field({
51
+ this.mrz2 = new fields_1.TextField({
52
52
  prediction: prediction.mrz2,
53
53
  pageId: pageId,
54
54
  });
55
- prediction.given_names.map((prediction) => this.givenNames.push(new fields_1.Field({
55
+ prediction.given_names.map((prediction) => this.givenNames.push(new fields_1.TextField({
56
56
  prediction: prediction,
57
57
  pageId: pageId,
58
58
  })));
@@ -4,7 +4,7 @@ export { ReceiptV3 } from "./receipt/receiptV3";
4
4
  export { ReceiptV4 } from "./receipt/receiptV4";
5
5
  export { PassportV1 } from "./passport/passportV1";
6
6
  export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
7
- export { CustomV1 } from "./custom";
7
+ export { CustomV1 } from "./custom/customV1";
8
8
  export { CropperV1 } from "./cropper/cropperV1";
9
9
  export { ShippingContainerV1 } from "./shipping_container/shippingContainerV1";
10
10
  export { Document, DocumentConstructorProps, DocumentSig } from "./document";
@@ -36,8 +36,8 @@ var passportV1_1 = require("./passport/passportV1");
36
36
  Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
37
37
  var financialDocumentV1_1 = require("./financialDocument/financialDocumentV1");
38
38
  Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
39
- var custom_1 = require("./custom");
40
- Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return custom_1.CustomV1; } });
39
+ var customV1_1 = require("./custom/customV1");
40
+ Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
41
41
  var cropperV1_1 = require("./cropper/cropperV1");
42
42
  Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
43
43
  var shippingContainerV1_1 = require("./shipping_container/shippingContainerV1");
@@ -1,4 +1,4 @@
1
- import { stringDict } from "../../fields";
1
+ import { StringDict } from "../../fields";
2
2
  import { Polygon } from "../../geometry";
3
3
  export declare class InvoiceLineItem {
4
4
  /** The product code referring to the item. */
@@ -24,6 +24,6 @@ export declare class InvoiceLineItem {
24
24
  * the field in the document.
25
25
  */
26
26
  polygon: Polygon;
27
- constructor({ prediction }: stringDict);
27
+ constructor({ prediction }: StringDict);
28
28
  toString(): string;
29
29
  }
@@ -1,5 +1,5 @@
1
1
  import { Document, DocumentConstructorProps } from "../document";
2
- import { BaseField, TaxField, PaymentDetails, Locale, Amount, Field, DateField, CompanyRegistration } from "../../fields";
2
+ import { BaseField, TaxField, PaymentDetails, Locale, Amount, TextField, DateField, CompanyRegistration } from "../../fields";
3
3
  export declare class InvoiceV3 extends Document {
4
4
  #private;
5
5
  /** Total amount with the tax amount of the purchase. */
@@ -13,23 +13,23 @@ export declare class InvoiceV3 extends Document {
13
13
  /** The due date of the invoice. */
14
14
  dueDate: DateField;
15
15
  /** The created time of the invoice */
16
- time: Field;
16
+ time: TextField;
17
17
  /** The total tax. */
18
18
  totalTax: Amount;
19
19
  /** The total amount without the tax value. Same as totalExcl. */
20
20
  totalNet: Amount;
21
21
  /** The supplier name. */
22
- supplier: Field;
22
+ supplier: TextField;
23
23
  /** The supplier address. */
24
- supplierAddress: Field;
24
+ supplierAddress: TextField;
25
25
  /** The invoice number. */
26
- invoiceNumber: Field;
26
+ invoiceNumber: TextField;
27
27
  /** The company regitration information. */
28
28
  companyRegistration: CompanyRegistration[];
29
29
  /** The name of the customer. */
30
- customerName: Field;
30
+ customerName: TextField;
31
31
  /** The address of the customer. */
32
- customerAddress: Field;
32
+ customerAddress: TextField;
33
33
  /** The list of the taxes. */
34
34
  taxes: TaxField[];
35
35
  /** The payment information. */
@@ -129,23 +129,23 @@ _InvoiceV3_instances = new WeakSet(), _InvoiceV3_initFromApiPrediction = functio
129
129
  prediction: apiPrediction.due_date,
130
130
  pageId: pageId,
131
131
  });
132
- this.invoiceNumber = new fields_1.Field({
132
+ this.invoiceNumber = new fields_1.TextField({
133
133
  prediction: apiPrediction.invoice_number,
134
134
  pageId: pageId,
135
135
  });
136
- this.supplier = new fields_1.Field({
136
+ this.supplier = new fields_1.TextField({
137
137
  prediction: apiPrediction.supplier,
138
138
  pageId: pageId,
139
139
  });
140
- this.supplierAddress = new fields_1.Field({
140
+ this.supplierAddress = new fields_1.TextField({
141
141
  prediction: apiPrediction.supplier_address,
142
142
  pageId: pageId,
143
143
  });
144
- this.customerName = new fields_1.Field({
144
+ this.customerName = new fields_1.TextField({
145
145
  prediction: apiPrediction.customer,
146
146
  pageId: pageId,
147
147
  });
148
- this.customerAddress = new fields_1.Field({
148
+ this.customerAddress = new fields_1.TextField({
149
149
  prediction: apiPrediction.customer_address,
150
150
  pageId: pageId,
151
151
  });