mindee 3.4.0 → 3.5.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 (74) hide show
  1. package/CHANGELOG.md +17 -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/cli.js +19 -11
  7. package/src/client.d.ts +3 -3
  8. package/src/client.js +4 -1
  9. package/src/documents/{custom.d.ts → custom/customV1.d.ts} +4 -4
  10. package/src/documents/{custom.js → custom/customV1.js} +2 -2
  11. package/src/{fields/apiBuilder.d.ts → documents/custom/fields.d.ts} +8 -6
  12. package/src/{fields/apiBuilder.js → documents/custom/fields.js} +1 -1
  13. package/src/documents/document.d.ts +4 -4
  14. package/src/documents/eu/licensePlate/licensePlateV1.d.ts +3 -3
  15. package/src/documents/eu/licensePlate/licensePlateV1.js +2 -2
  16. package/src/documents/financialDocument/financialDocumentV1.d.ts +9 -9
  17. package/src/documents/financialDocument/financialDocumentV1.js +5 -5
  18. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +8 -7
  19. package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.js +4 -3
  20. package/src/documents/fr/carteVitale/carteVitaleV1.d.ts +6 -6
  21. package/src/documents/fr/carteVitale/carteVitaleV1.js +5 -5
  22. package/src/documents/fr/idCard/idCardV1.d.ts +10 -10
  23. package/src/documents/fr/idCard/idCardV1.js +8 -8
  24. package/src/documents/index.d.ts +2 -1
  25. package/src/documents/index.js +6 -3
  26. package/src/documents/invoice/invoiceLineItem.d.ts +2 -2
  27. package/src/documents/invoice/invoiceV3.d.ts +7 -7
  28. package/src/documents/invoice/invoiceV3.js +5 -5
  29. package/src/documents/invoice/invoiceV4.d.ts +7 -9
  30. package/src/documents/invoice/invoiceV4.js +6 -6
  31. package/src/documents/invoice/reconstruction.js +5 -4
  32. package/src/documents/invoiceSplitter/invoiceSplitterV1.d.ts +14 -0
  33. package/src/documents/invoiceSplitter/invoiceSplitterV1.js +46 -0
  34. package/src/documents/passport/passportV1.d.ts +16 -16
  35. package/src/documents/passport/passportV1.js +15 -13
  36. package/src/documents/receipt/receiptV3.d.ts +4 -4
  37. package/src/documents/receipt/receiptV3.js +6 -7
  38. package/src/documents/receipt/receiptV4.d.ts +10 -10
  39. package/src/documents/receipt/receiptV4.js +6 -8
  40. package/src/documents/shipping_container/shippingContainerV1.d.ts +4 -4
  41. package/src/documents/shipping_container/shippingContainerV1.js +3 -3
  42. package/src/documents/us/bankCheck/bankCheckV1.d.ts +8 -8
  43. package/src/documents/us/bankCheck/bankCheckV1.js +4 -4
  44. package/src/fields/amount.d.ts +1 -1
  45. package/src/fields/amount.js +2 -0
  46. package/src/fields/base.d.ts +27 -0
  47. package/src/fields/base.js +53 -0
  48. package/src/fields/companyRegistration.d.ts +3 -1
  49. package/src/fields/date.d.ts +4 -1
  50. package/src/fields/date.js +16 -8
  51. package/src/fields/field.d.ts +8 -38
  52. package/src/fields/field.js +6 -53
  53. package/src/fields/fullText.d.ts +1 -1
  54. package/src/fields/fullText.js +4 -4
  55. package/src/fields/index.d.ts +3 -3
  56. package/src/fields/index.js +5 -8
  57. package/src/fields/locale.d.ts +13 -9
  58. package/src/fields/locale.js +4 -3
  59. package/src/fields/orientation.d.ts +3 -1
  60. package/src/fields/orientation.js +2 -2
  61. package/src/fields/paymentDetails.d.ts +4 -1
  62. package/src/fields/paymentDetails.js +26 -23
  63. package/src/fields/position.d.ts +2 -2
  64. package/src/fields/tax.d.ts +7 -2
  65. package/src/fields/tax.js +10 -1
  66. package/src/fields/text.d.ts +13 -0
  67. package/src/fields/text.js +10 -0
  68. package/src/geometry.d.ts +1 -2
  69. package/src/index.d.ts +4 -3
  70. package/src/index.js +5 -1
  71. package/src/inputs/sources.d.ts +4 -4
  72. package/src/inputs/sources.js +9 -9
  73. package/src/documents/receipt/tax.d.ts +0 -25
  74. package/src/documents/receipt/tax.js +0 -40
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v3.5.0 - 2023-01-17
4
+ ### Changes
5
+ * :memo: updates to class documentation
6
+ * :sparkles: Add invoice splitter support (beta)
7
+
8
+ ### Fixes
9
+ * :bug: fix for CLI command option description
10
+
11
+ ## v3.4.1 - 2023-01-05
12
+ ### Changes
13
+ * :label: Added typing information, get rid of `any` type in various places
14
+ * :recycle: Use a specific `TextField` class for fields we know are textual
15
+ * :arrow_up: update dependencies
16
+
17
+ ### Fixes
18
+ * :bug: Expose various class and type definitions to improve developer experience
19
+
3
20
  ## v3.4.0 - 2023-01-04
4
21
  ### Changes
5
22
  * :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.5.0",
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/cli.js CHANGED
@@ -22,15 +22,23 @@ const CLI_COMMAND_CONFIG = new Map([
22
22
  [
23
23
  "invoice",
24
24
  {
25
- description: "Invoice V4",
25
+ description: "Invoice",
26
26
  docClass: documents_1.InvoiceV4,
27
27
  fullText: true,
28
28
  },
29
29
  ],
30
+ [
31
+ "invoice-splitter",
32
+ {
33
+ description: "Invoice Splitter",
34
+ docClass: documents_1.InvoiceSplitterV1,
35
+ fullText: false,
36
+ },
37
+ ],
30
38
  [
31
39
  "receipt",
32
40
  {
33
- description: "Expense Receipt V4",
41
+ description: "Expense Receipt",
34
42
  docClass: documents_1.ReceiptV4,
35
43
  fullText: true,
36
44
  },
@@ -38,7 +46,7 @@ const CLI_COMMAND_CONFIG = new Map([
38
46
  [
39
47
  "passport",
40
48
  {
41
- description: "Passport V1",
49
+ description: "Passport",
42
50
  docClass: documents_1.PassportV1,
43
51
  fullText: false,
44
52
  },
@@ -46,7 +54,7 @@ const CLI_COMMAND_CONFIG = new Map([
46
54
  [
47
55
  "financial",
48
56
  {
49
- description: "Financial Document V1 (receipt or invoice)",
57
+ description: "Financial Document (receipt or invoice)",
50
58
  docClass: documents_1.FinancialDocumentV1,
51
59
  fullText: true,
52
60
  },
@@ -54,7 +62,7 @@ const CLI_COMMAND_CONFIG = new Map([
54
62
  [
55
63
  "fr-id-card",
56
64
  {
57
- description: "FR ID Card V1",
65
+ description: "FR ID Card",
58
66
  docClass: documents_1.fr.IdCardV1,
59
67
  fullText: false,
60
68
  },
@@ -62,7 +70,7 @@ const CLI_COMMAND_CONFIG = new Map([
62
70
  [
63
71
  "fr-bank-account-details",
64
72
  {
65
- description: "FR Bank Account Details V1",
73
+ description: "FR Bank Account Details",
66
74
  docClass: documents_1.fr.BankAccountDetailsV1,
67
75
  fullText: false,
68
76
  },
@@ -70,7 +78,7 @@ const CLI_COMMAND_CONFIG = new Map([
70
78
  [
71
79
  "fr-carte-vitale",
72
80
  {
73
- description: "FR Carte Vitale V1",
81
+ description: "FR Carte Vitale",
74
82
  docClass: documents_1.fr.CarteVitaleV1,
75
83
  fullText: false,
76
84
  },
@@ -78,7 +86,7 @@ const CLI_COMMAND_CONFIG = new Map([
78
86
  [
79
87
  "eu-license-plate",
80
88
  {
81
- description: "EU License Plate V1",
89
+ description: "EU License Plate",
82
90
  docClass: documents_1.eu.LicensePlateV1,
83
91
  fullText: false,
84
92
  },
@@ -86,7 +94,7 @@ const CLI_COMMAND_CONFIG = new Map([
86
94
  [
87
95
  "us-bank-check",
88
96
  {
89
- description: "US Bank Check V1",
97
+ description: "US Bank Check",
90
98
  docClass: documents_1.us.BankCheckV1,
91
99
  fullText: false,
92
100
  },
@@ -94,7 +102,7 @@ const CLI_COMMAND_CONFIG = new Map([
94
102
  [
95
103
  "shipping-container",
96
104
  {
97
- description: "Shipping container V1",
105
+ description: "Shipping Container",
98
106
  docClass: documents_1.ShippingContainerV1,
99
107
  fullText: false,
100
108
  },
@@ -159,7 +167,7 @@ function cli() {
159
167
  }
160
168
  if (name === COMMAND_CUSTOM) {
161
169
  prog.requiredOption("-u, --user <username>", "API account name for the endpoint");
162
- prog.option("-v, --version <version>", "API account name for the endpoint");
170
+ prog.option("-v, --version <version>", "Version for the endpoint, use the latest version if not specified.");
163
171
  prog.argument("<endpoint_name>", "API endpoint name");
164
172
  }
165
173
  prog.argument("<input_path>", "Full path to the file");
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
@@ -86,6 +86,9 @@ class Client {
86
86
  this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.InvoiceV4.name], new documentConfig_1.DocumentConfig(documents_1.InvoiceV4, [
87
87
  new api_1.StandardEndpoint("invoices", "4", this.apiKey),
88
88
  ]));
89
+ this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.InvoiceSplitterV1.name], new documentConfig_1.DocumentConfig(documents_1.InvoiceSplitterV1, [
90
+ new api_1.StandardEndpoint("invoice_splitter_beta", "1", this.apiKey),
91
+ ]));
89
92
  this.docConfigs.set([api_1.STANDARD_API_OWNER, documents_1.ReceiptV3.name], new documentConfig_1.DocumentConfig(documents_1.ReceiptV3, [
90
93
  new api_1.StandardEndpoint("expense_receipts", "3", this.apiKey),
91
94
  ]));
@@ -155,7 +158,7 @@ class Client {
155
158
  return new DocumentClient(doc, this.docConfigs);
156
159
  }
157
160
  /**
158
- * Load an input document from a `ReadStream`.
161
+ * Load an input document from a `stream.Readable` object.
159
162
  * @param inputStream
160
163
  * @param filename
161
164
  */
@@ -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
- /** A list of license plates values. */
5
- licensePlates: Field[];
4
+ /** A list of license plates. */
5
+ licensePlates: TextField[];
6
6
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
7
7
  toString(): string;
8
8
  }
@@ -11,9 +11,9 @@ class LicensePlateV1 extends document_1.Document {
11
11
  orientation: orientation,
12
12
  extras: extras,
13
13
  });
14
- /** A list of license plates values. */
14
+ /** A list of license plates. */
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,13 @@
1
1
  import { Document, DocumentConstructorProps } from "../../document";
2
- import { Field } from "../../../fields";
2
+ import { TextField } from "../../../fields";
3
+ /** French bank account information (RIB) */
3
4
  export declare class BankAccountDetailsV1 extends Document {
4
- /** The IBAN number. */
5
- iban: Field;
6
- /** The account holder name. */
7
- accountHolderName: Field;
8
- /** The SWIFT value. */
9
- swift: Field;
5
+ /** The account's IBAN. */
6
+ iban: TextField;
7
+ /** The account holder's name. */
8
+ accountHolderName: TextField;
9
+ /** The bank's SWIFT code. */
10
+ swift: TextField;
10
11
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
11
12
  toString(): string;
12
13
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BankAccountDetailsV1 = void 0;
4
4
  const document_1 = require("../../document");
5
5
  const fields_1 = require("../../../fields");
6
+ /** French bank account information (RIB) */
6
7
  class BankAccountDetailsV1 extends document_1.Document {
7
8
  constructor({ prediction, orientation = undefined, extras = undefined, inputSource = undefined, pageId = undefined, }) {
8
9
  super({
@@ -11,15 +12,15 @@ class BankAccountDetailsV1 extends document_1.Document {
11
12
  orientation: orientation,
12
13
  extras: extras,
13
14
  });
14
- this.iban = new fields_1.Field({
15
+ this.iban = new fields_1.TextField({
15
16
  prediction: prediction.iban,
16
17
  pageId: pageId,
17
18
  });
18
- this.accountHolderName = new fields_1.Field({
19
+ this.accountHolderName = new fields_1.TextField({
19
20
  prediction: prediction.account_holder_name,
20
21
  pageId: pageId,
21
22
  });
22
- this.swift = new fields_1.Field({
23
+ this.swift = new fields_1.TextField({
23
24
  prediction: prediction.swift,
24
25
  pageId: pageId,
25
26
  });
@@ -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
- /** The list of the names of the person. */
5
- givenNames: Field[];
4
+ /** List of given (first) names of the cardholder. */
5
+ givenNames: TextField[];
6
6
  /** The surname of the person. */
7
- surname: Field;
8
- /** The ID number of the card. */
9
- idNumber: Field;
7
+ surname: TextField;
8
+ /** The social security number of the cardholder. */
9
+ socialSecurity: TextField;
10
10
  /** The issuance date of the card. */
11
11
  issuanceDate: DateField;
12
12
  constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
@@ -11,9 +11,9 @@ class CarteVitaleV1 extends document_1.Document {
11
11
  orientation: orientation,
12
12
  extras: extras,
13
13
  });
14
- /** The list of the names of the person. */
14
+ /** List of given (first) names of the cardholder. */
15
15
  this.givenNames = [];
16
- this.idNumber = new fields_1.Field({
16
+ this.socialSecurity = 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
  })));
@@ -35,7 +35,7 @@ class CarteVitaleV1 extends document_1.Document {
35
35
  Filename: ${this.filename}
36
36
  Given names: ${this.givenNames.map((name) => name.value).join(" ")}
37
37
  Surname: ${this.surname}
38
- ID Number: ${this.idNumber}
38
+ Social Security Number: ${this.socialSecurity}
39
39
  Issuance date: ${this.issuanceDate}
40
40
  ----------------------
41
41
  `;
@@ -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;
6
- /** Indicates if it is the recto, the verso or the both of it. */
5
+ authority: TextField;
6
+ /** Indicates if it is the recto side, the verso side or both. */
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
  })));