mindee 4.0.1 → 4.1.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 (171) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +4 -3
  3. package/src/cli.js +36 -66
  4. package/src/client.d.ts +76 -32
  5. package/src/client.js +108 -21
  6. package/src/http/endpoint.d.ts +36 -0
  7. package/src/http/endpoint.js +54 -16
  8. package/src/http/error.d.ts +66 -1
  9. package/src/http/error.js +196 -4
  10. package/src/http/index.d.ts +1 -1
  11. package/src/http/index.js +10 -1
  12. package/src/index.d.ts +2 -1
  13. package/src/index.js +2 -1
  14. package/src/input/base.d.ts +1 -0
  15. package/src/input/base.js +3 -0
  16. package/src/input/pageOptions.d.ts +4 -0
  17. package/src/input/pageOptions.js +3 -0
  18. package/src/input/sources.d.ts +2 -3
  19. package/src/input/sources.js +2 -1
  20. package/src/internal.d.ts +5 -0
  21. package/src/internal.js +31 -0
  22. package/src/parsing/common/apiRequest.d.ts +9 -0
  23. package/src/parsing/common/apiRequest.js +5 -0
  24. package/src/parsing/common/apiResponse.d.ts +15 -0
  25. package/src/parsing/common/apiResponse.js +15 -0
  26. package/src/parsing/common/asyncPredictResponse.d.ts +24 -3
  27. package/src/parsing/common/asyncPredictResponse.js +15 -0
  28. package/src/parsing/common/document.d.ts +17 -0
  29. package/src/parsing/common/document.js +16 -4
  30. package/src/parsing/common/extras/cropperExtra.d.ts +3 -0
  31. package/src/parsing/common/extras/cropperExtra.js +3 -0
  32. package/src/parsing/common/extras/extras.d.ts +3 -0
  33. package/src/parsing/common/extras/extras.js +3 -0
  34. package/src/parsing/common/inference.d.ts +26 -0
  35. package/src/parsing/common/inference.js +23 -2
  36. package/src/parsing/common/mvisionV1.d.ts +3 -0
  37. package/src/parsing/common/mvisionV1.js +3 -0
  38. package/src/parsing/common/ocr.d.ts +3 -0
  39. package/src/parsing/common/ocr.js +3 -0
  40. package/src/parsing/common/ocrPage.d.ts +3 -0
  41. package/src/parsing/common/ocrPage.js +3 -0
  42. package/src/parsing/common/orientation.d.ts +3 -0
  43. package/src/parsing/common/orientation.js +3 -0
  44. package/src/parsing/common/page.d.ts +19 -0
  45. package/src/parsing/common/page.js +15 -0
  46. package/src/parsing/common/predictResponse.d.ts +11 -0
  47. package/src/parsing/common/predictResponse.js +10 -0
  48. package/src/parsing/custom/classificationField.d.ts +3 -0
  49. package/src/parsing/custom/classificationField.js +3 -0
  50. package/src/parsing/custom/listField.d.ts +6 -0
  51. package/src/parsing/custom/listField.js +6 -0
  52. package/src/parsing/standard/amount.d.ts +3 -0
  53. package/src/parsing/standard/amount.js +3 -0
  54. package/src/parsing/standard/base.d.ts +3 -0
  55. package/src/parsing/standard/base.js +3 -0
  56. package/src/parsing/standard/locale.d.ts +3 -0
  57. package/src/parsing/standard/locale.js +3 -0
  58. package/src/parsing/standard/paymentDetails.d.ts +3 -0
  59. package/src/parsing/standard/paymentDetails.js +3 -0
  60. package/src/parsing/standard/position.d.ts +3 -0
  61. package/src/parsing/standard/position.js +3 -0
  62. package/src/parsing/standard/tax.d.ts +3 -0
  63. package/src/parsing/standard/tax.js +3 -0
  64. package/src/product/cropper/cropperV1.d.ts +7 -0
  65. package/src/product/cropper/cropperV1.js +6 -0
  66. package/src/product/cropper/cropperV1Document.d.ts +6 -0
  67. package/src/product/cropper/cropperV1Document.js +6 -0
  68. package/src/product/cropper/internal.d.ts +2 -0
  69. package/src/product/cropper/internal.js +7 -0
  70. package/src/product/custom/customV1.d.ts +7 -0
  71. package/src/product/custom/customV1.js +6 -0
  72. package/src/product/custom/customV1Document.d.ts +16 -0
  73. package/src/product/custom/customV1Document.js +16 -2
  74. package/src/product/custom/customV1Page.d.ts +7 -0
  75. package/src/product/custom/customV1Page.js +7 -0
  76. package/src/product/custom/internal.d.ts +3 -0
  77. package/src/product/custom/internal.js +9 -0
  78. package/src/product/eu/internal.d.ts +1 -0
  79. package/src/product/eu/internal.js +27 -0
  80. package/src/product/eu/licensePlate/internal.d.ts +2 -0
  81. package/src/product/eu/licensePlate/internal.js +7 -0
  82. package/src/product/eu/licensePlate/licensePlateV1.d.ts +7 -0
  83. package/src/product/eu/licensePlate/licensePlateV1.js +6 -0
  84. package/src/product/eu/licensePlate/licensePlateV1Document.d.ts +3 -0
  85. package/src/product/eu/licensePlate/licensePlateV1Document.js +3 -0
  86. package/src/product/financialDocument/financialDocumentV1.d.ts +7 -0
  87. package/src/product/financialDocument/financialDocumentV1.js +6 -0
  88. package/src/product/financialDocument/financialDocumentV1Document.d.ts +3 -0
  89. package/src/product/financialDocument/financialDocumentV1Document.js +3 -0
  90. package/src/product/financialDocument/internal.d.ts +3 -0
  91. package/src/product/financialDocument/internal.js +9 -0
  92. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +7 -0
  93. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +6 -0
  94. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +3 -0
  95. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +3 -0
  96. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +7 -0
  97. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +6 -0
  98. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +3 -0
  99. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +3 -0
  100. package/src/product/fr/bankAccountDetails/internal.d.ts +5 -0
  101. package/src/product/fr/bankAccountDetails/internal.js +13 -0
  102. package/src/product/fr/carteVitale/carteVitaleV1.d.ts +7 -0
  103. package/src/product/fr/carteVitale/carteVitaleV1.js +6 -0
  104. package/src/product/fr/carteVitale/carteVitaleV1Document.d.ts +3 -0
  105. package/src/product/fr/carteVitale/carteVitaleV1Document.js +3 -0
  106. package/src/product/fr/carteVitale/internal.d.ts +2 -0
  107. package/src/product/fr/carteVitale/internal.js +7 -0
  108. package/src/product/fr/idCard/idCardV1.d.ts +7 -0
  109. package/src/product/fr/idCard/idCardV1.js +6 -0
  110. package/src/product/fr/idCard/idCardV1Document.d.ts +3 -0
  111. package/src/product/fr/idCard/idCardV1Document.js +3 -0
  112. package/src/product/fr/idCard/internal.d.ts +3 -0
  113. package/src/product/fr/idCard/internal.js +9 -0
  114. package/src/product/fr/internal.d.ts +3 -0
  115. package/src/product/fr/internal.js +29 -0
  116. package/src/product/index.d.ts +0 -1
  117. package/src/product/index.js +1 -3
  118. package/src/product/internal.d.ts +11 -0
  119. package/src/product/internal.js +37 -0
  120. package/src/product/invoice/internal.d.ts +3 -0
  121. package/src/product/invoice/internal.js +9 -0
  122. package/src/product/invoice/invoiceV4.d.ts +7 -0
  123. package/src/product/invoice/invoiceV4.js +6 -0
  124. package/src/product/invoice/invoiceV4Document.d.ts +3 -1
  125. package/src/product/invoice/invoiceV4Document.js +3 -1
  126. package/src/product/invoice/invoiceV4LineItem.d.ts +9 -0
  127. package/src/product/invoice/invoiceV4LineItem.js +9 -0
  128. package/src/product/invoiceSplitter/internal.d.ts +3 -0
  129. package/src/product/invoiceSplitter/internal.js +9 -0
  130. package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +7 -0
  131. package/src/product/invoiceSplitter/invoiceSplitterV1.js +6 -0
  132. package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +8 -2
  133. package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +7 -1
  134. package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +9 -1
  135. package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.js +10 -3
  136. package/src/product/passport/internal.d.ts +2 -0
  137. package/src/product/passport/internal.js +7 -0
  138. package/src/product/passport/passportV1.d.ts +7 -0
  139. package/src/product/passport/passportV1.js +6 -0
  140. package/src/product/passport/passportV1Document.d.ts +3 -0
  141. package/src/product/passport/passportV1Document.js +3 -0
  142. package/src/product/proofOfAddress/internal.d.ts +2 -0
  143. package/src/product/proofOfAddress/internal.js +7 -0
  144. package/src/product/proofOfAddress/proofOfAddressV1.d.ts +7 -0
  145. package/src/product/proofOfAddress/proofOfAddressV1.js +6 -0
  146. package/src/product/proofOfAddress/proofOfAddressV1Document.d.ts +3 -0
  147. package/src/product/proofOfAddress/proofOfAddressV1Document.js +3 -0
  148. package/src/product/receipt/internal.d.ts +5 -0
  149. package/src/product/receipt/internal.js +13 -0
  150. package/src/product/receipt/receiptV4.d.ts +7 -0
  151. package/src/product/receipt/receiptV4.js +5 -0
  152. package/src/product/receipt/receiptV4Document.d.ts +6 -0
  153. package/src/product/receipt/receiptV4Document.js +6 -0
  154. package/src/product/receipt/receiptV5.d.ts +7 -0
  155. package/src/product/receipt/receiptV5.js +6 -0
  156. package/src/product/receipt/receiptV5Document.d.ts +3 -0
  157. package/src/product/receipt/receiptV5Document.js +3 -0
  158. package/src/product/us/bankCheck/bankCheckV1.d.ts +7 -0
  159. package/src/product/us/bankCheck/bankCheckV1.js +6 -0
  160. package/src/product/us/bankCheck/bankCheckV1Document.d.ts +3 -0
  161. package/src/product/us/bankCheck/bankCheckV1Document.js +3 -0
  162. package/src/product/us/bankCheck/internal.d.ts +3 -0
  163. package/src/product/us/bankCheck/internal.js +9 -0
  164. package/src/product/us/driverLicense/driverLicenseV1.d.ts +7 -0
  165. package/src/product/us/driverLicense/driverLicenseV1.js +6 -0
  166. package/src/product/us/driverLicense/driverLicenseV1Document.d.ts +3 -0
  167. package/src/product/us/driverLicense/driverLicenseV1Document.js +3 -0
  168. package/src/product/us/driverLicense/internal.d.ts +3 -0
  169. package/src/product/us/driverLicense/internal.js +9 -0
  170. package/src/product/us/internal.d.ts +2 -0
  171. package/src/product/us/internal.js +28 -0
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CarteVitaleV1 = void 0;
4
4
  const common_1 = require("../../../parsing/common");
5
5
  const carteVitaleV1Document_1 = require("./carteVitaleV1Document");
6
+ /**
7
+ * Inference prediction for Carte Vitale, API version 1.
8
+ */
6
9
  class CarteVitaleV1 extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
12
+ /** The endpoint's name. */
9
13
  this.endpointName = "carte_vitale";
14
+ /** The endpoint's version. */
10
15
  this.endpointVersion = "1";
16
+ /** The document's pages. */
11
17
  this.pages = [];
12
18
  this.prediction = new carteVitaleV1Document_1.CarteVitaleV1Document(rawPrediction["prediction"]);
13
19
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(carteVitaleV1Document_1.CarteVitaleV1Document, page, page["id"], page["orientation"]));
@@ -13,5 +13,8 @@ export declare class CarteVitaleV1Document implements Prediction {
13
13
  /** The surname of the card holder. */
14
14
  surname: StringField;
15
15
  constructor(rawPrediction: StringDict, pageId?: number);
16
+ /**
17
+ * Default string representation.
18
+ */
16
19
  toString(): string;
17
20
  }
@@ -28,6 +28,9 @@ class CarteVitaleV1Document {
28
28
  pageId: pageId,
29
29
  });
30
30
  }
31
+ /**
32
+ * Default string representation.
33
+ */
31
34
  toString() {
32
35
  const givenNames = this.givenNames.join("\n ");
33
36
  const outStr = `:Given Name(s): ${givenNames}
@@ -0,0 +1,2 @@
1
+ export { CarteVitaleV1 } from "./carteVitaleV1";
2
+ export { CarteVitaleV1Document } from "./carteVitaleV1Document";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarteVitaleV1Document = exports.CarteVitaleV1 = void 0;
4
+ var carteVitaleV1_1 = require("./carteVitaleV1");
5
+ Object.defineProperty(exports, "CarteVitaleV1", { enumerable: true, get: function () { return carteVitaleV1_1.CarteVitaleV1; } });
6
+ var carteVitaleV1Document_1 = require("./carteVitaleV1Document");
7
+ Object.defineProperty(exports, "CarteVitaleV1Document", { enumerable: true, get: function () { return carteVitaleV1Document_1.CarteVitaleV1Document; } });
@@ -1,10 +1,17 @@
1
1
  import { Inference, StringDict, Page } from "../../../parsing/common";
2
2
  import { IdCardV1Document } from "./idCardV1Document";
3
3
  import { IdCardV1Page } from "./idCardV1Page";
4
+ /**
5
+ * Inference prediction for Carte Nationale d'Identité, API version 1.
6
+ */
4
7
  export declare class IdCardV1 extends Inference {
8
+ /** The endpoint's name. */
5
9
  endpointName: string;
10
+ /** The endpoint's version. */
6
11
  endpointVersion: string;
12
+ /** The document-level prediction. */
7
13
  prediction: IdCardV1Document;
14
+ /** The document's pages. */
8
15
  pages: Page<IdCardV1Page>[];
9
16
  constructor(rawPrediction: StringDict);
10
17
  }
@@ -4,11 +4,17 @@ exports.IdCardV1 = void 0;
4
4
  const common_1 = require("../../../parsing/common");
5
5
  const idCardV1Document_1 = require("./idCardV1Document");
6
6
  const idCardV1Page_1 = require("./idCardV1Page");
7
+ /**
8
+ * Inference prediction for Carte Nationale d'Identité, API version 1.
9
+ */
7
10
  class IdCardV1 extends common_1.Inference {
8
11
  constructor(rawPrediction) {
9
12
  super(rawPrediction);
13
+ /** The endpoint's name. */
10
14
  this.endpointName = "idcard_fr";
15
+ /** The endpoint's version. */
11
16
  this.endpointVersion = "1";
17
+ /** The document's pages. */
12
18
  this.pages = [];
13
19
  this.prediction = new idCardV1Document_1.IdCardV1Document(rawPrediction["prediction"]);
14
20
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(idCardV1Page_1.IdCardV1Page, page, page["id"], page["orientation"]));
@@ -25,5 +25,8 @@ export declare class IdCardV1Document implements Prediction {
25
25
  /** The surname of the card holder. */
26
26
  surname: StringField;
27
27
  constructor(rawPrediction: StringDict, pageId?: number);
28
+ /**
29
+ * Default string representation.
30
+ */
28
31
  toString(): string;
29
32
  }
@@ -52,6 +52,9 @@ class IdCardV1Document {
52
52
  pageId: pageId,
53
53
  });
54
54
  }
55
+ /**
56
+ * Default string representation.
57
+ */
55
58
  toString() {
56
59
  const givenNames = this.givenNames.join("\n ");
57
60
  const outStr = `:Identity Number: ${this.idNumber}
@@ -0,0 +1,3 @@
1
+ export { IdCardV1 } from "./idCardV1";
2
+ export { IdCardV1Document } from "./idCardV1Document";
3
+ export { IdCardV1Page } from "./idCardV1Page";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdCardV1Page = exports.IdCardV1Document = exports.IdCardV1 = void 0;
4
+ var idCardV1_1 = require("./idCardV1");
5
+ Object.defineProperty(exports, "IdCardV1", { enumerable: true, get: function () { return idCardV1_1.IdCardV1; } });
6
+ var idCardV1Document_1 = require("./idCardV1Document");
7
+ Object.defineProperty(exports, "IdCardV1Document", { enumerable: true, get: function () { return idCardV1Document_1.IdCardV1Document; } });
8
+ var idCardV1Page_1 = require("./idCardV1Page");
9
+ Object.defineProperty(exports, "IdCardV1Page", { enumerable: true, get: function () { return idCardV1Page_1.IdCardV1Page; } });
@@ -0,0 +1,3 @@
1
+ export * as bankAccountDetails from "./bankAccountDetails/internal";
2
+ export * as carteVitale from "./carteVitale/internal";
3
+ export * as idCard from "./idCard/internal";
@@ -0,0 +1,29 @@
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.idCard = exports.carteVitale = exports.bankAccountDetails = void 0;
27
+ exports.bankAccountDetails = __importStar(require("./bankAccountDetails/internal"));
28
+ exports.carteVitale = __importStar(require("./carteVitale/internal"));
29
+ exports.idCard = __importStar(require("./idCard/internal"));
@@ -1,6 +1,5 @@
1
1
  export { InvoiceV4 } from "./invoice/invoiceV4";
2
2
  export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
3
- export { PageGroup } from "./invoiceSplitter/invoiceSplitterV1PageGroup";
4
3
  export { ReceiptV4 } from "./receipt/receiptV4";
5
4
  export { ReceiptV5 } from "./receipt/receiptV5";
6
5
  export { PassportV1 } from "./passport/passportV1";
@@ -23,13 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.CropperV1 = exports.CustomV1 = exports.FinancialDocumentV1 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.PageGroup = exports.InvoiceSplitterV1 = exports.InvoiceV4 = void 0;
26
+ exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.CropperV1 = exports.CustomV1 = exports.FinancialDocumentV1 = exports.PassportV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = void 0;
27
27
  var invoiceV4_1 = require("./invoice/invoiceV4");
28
28
  Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
29
29
  var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
30
30
  Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
31
- var invoiceSplitterV1PageGroup_1 = require("./invoiceSplitter/invoiceSplitterV1PageGroup");
32
- Object.defineProperty(exports, "PageGroup", { enumerable: true, get: function () { return invoiceSplitterV1PageGroup_1.PageGroup; } });
33
31
  var receiptV4_1 = require("./receipt/receiptV4");
34
32
  Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
35
33
  var receiptV5_1 = require("./receipt/receiptV5");
@@ -0,0 +1,11 @@
1
+ export * as cropper from "./cropper/internal";
2
+ export * as custom from "./custom/internal";
3
+ export * as eu from "./eu/internal";
4
+ export * as financialDocument from "./financialDocument/internal";
5
+ export * as fr from "./fr/internal";
6
+ export * as invoice from "./invoice/internal";
7
+ export * as invoiceSplitter from "./invoiceSplitter/internal";
8
+ export * as passport from "./passport/internal";
9
+ export * as proofOfAddress from "./proofOfAddress/internal";
10
+ export * as receipt from "./receipt/internal";
11
+ export * as us from "./us/internal";
@@ -0,0 +1,37 @@
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.us = exports.receipt = exports.proofOfAddress = exports.passport = exports.invoiceSplitter = exports.invoice = exports.fr = exports.financialDocument = exports.eu = exports.custom = exports.cropper = void 0;
27
+ exports.cropper = __importStar(require("./cropper/internal"));
28
+ exports.custom = __importStar(require("./custom/internal"));
29
+ exports.eu = __importStar(require("./eu/internal"));
30
+ exports.financialDocument = __importStar(require("./financialDocument/internal"));
31
+ exports.fr = __importStar(require("./fr/internal"));
32
+ exports.invoice = __importStar(require("./invoice/internal"));
33
+ exports.invoiceSplitter = __importStar(require("./invoiceSplitter/internal"));
34
+ exports.passport = __importStar(require("./passport/internal"));
35
+ exports.proofOfAddress = __importStar(require("./proofOfAddress/internal"));
36
+ exports.receipt = __importStar(require("./receipt/internal"));
37
+ exports.us = __importStar(require("./us/internal"));
@@ -0,0 +1,3 @@
1
+ export { InvoiceV4 } from "./invoiceV4";
2
+ export { InvoiceV4Document } from "./invoiceV4Document";
3
+ export { InvoiceV4LineItem } from "./invoiceV4LineItem";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceV4LineItem = exports.InvoiceV4Document = exports.InvoiceV4 = void 0;
4
+ var invoiceV4_1 = require("./invoiceV4");
5
+ Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
6
+ var invoiceV4Document_1 = require("./invoiceV4Document");
7
+ Object.defineProperty(exports, "InvoiceV4Document", { enumerable: true, get: function () { return invoiceV4Document_1.InvoiceV4Document; } });
8
+ var invoiceV4LineItem_1 = require("./invoiceV4LineItem");
9
+ Object.defineProperty(exports, "InvoiceV4LineItem", { enumerable: true, get: function () { return invoiceV4LineItem_1.InvoiceV4LineItem; } });
@@ -1,9 +1,16 @@
1
1
  import { Inference, StringDict, Page } from "../../parsing/common";
2
2
  import { InvoiceV4Document } from "./invoiceV4Document";
3
+ /**
4
+ * Inference prediction for Invoice, API version 4.
5
+ */
3
6
  export declare class InvoiceV4 extends Inference {
7
+ /** The endpoint's name. */
4
8
  endpointName: string;
9
+ /** The endpoint's version. */
5
10
  endpointVersion: string;
11
+ /** The document-level prediction. */
6
12
  prediction: InvoiceV4Document;
13
+ /** The document's pages. */
7
14
  pages: Page<InvoiceV4Document>[];
8
15
  constructor(rawPrediction: StringDict);
9
16
  }
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceV4 = void 0;
4
4
  const common_1 = require("../../parsing/common");
5
5
  const invoiceV4Document_1 = require("./invoiceV4Document");
6
+ /**
7
+ * Inference prediction for Invoice, API version 4.
8
+ */
6
9
  class InvoiceV4 extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
12
+ /** The endpoint's name. */
9
13
  this.endpointName = "invoices";
14
+ /** The endpoint's version. */
10
15
  this.endpointVersion = "4";
16
+ /** The document's pages. */
11
17
  this.pages = [];
12
18
  this.prediction = new invoiceV4Document_1.InvoiceV4Document(rawPrediction["prediction"]);
13
19
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(invoiceV4Document_1.InvoiceV4Document, page, page["id"], page["orientation"]));
@@ -1,7 +1,9 @@
1
1
  import { Prediction, StringDict } from "../../parsing/common";
2
2
  import { ClassificationField, Taxes, PaymentDetailsField, LocaleField, AmountField, StringField, DateField, CompanyRegistrationField } from "../../parsing/standard";
3
3
  import { InvoiceV4LineItem } from "./invoiceV4LineItem";
4
- /** Invoice V4 */
4
+ /**
5
+ * Document data for Invoice, API version 4.
6
+ */
5
7
  export declare class InvoiceV4Document implements Prediction {
6
8
  /** LocaleField information. */
7
9
  locale: LocaleField;
@@ -4,7 +4,9 @@ exports.InvoiceV4Document = void 0;
4
4
  const summaryHelper_1 = require("../../parsing/common/summaryHelper");
5
5
  const standard_1 = require("../../parsing/standard");
6
6
  const invoiceV4LineItem_1 = require("./invoiceV4LineItem");
7
- /** Invoice V4 */
7
+ /**
8
+ * Document data for Invoice, API version 4.
9
+ */
8
10
  class InvoiceV4Document {
9
11
  constructor(rawPrediction, pageId) {
10
12
  /** List of Reference numbers including PO number. */
@@ -1,5 +1,8 @@
1
1
  import { Polygon } from "../../geometry";
2
2
  import { StringDict } from "../../parsing/common";
3
+ /**
4
+ * List of line item details.
5
+ */
3
6
  export declare class InvoiceV4LineItem {
4
7
  #private;
5
8
  /** The product code referring to the item. */
@@ -26,6 +29,12 @@ export declare class InvoiceV4LineItem {
26
29
  */
27
30
  polygon: Polygon;
28
31
  constructor(rawPrediction: StringDict);
32
+ /**
33
+ * Output in a format suitable for inclusion in an rST table.
34
+ */
29
35
  toTableLine(): string;
36
+ /**
37
+ * Default string representation.
38
+ */
30
39
  toString(): string;
31
40
  }
@@ -8,6 +8,9 @@ var _InvoiceV4LineItem_instances, _InvoiceV4LineItem_printableValues;
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.InvoiceV4LineItem = void 0;
10
10
  const standard_1 = require("../../parsing/standard");
11
+ /**
12
+ * List of line item details.
13
+ */
11
14
  class InvoiceV4LineItem {
12
15
  constructor(rawPrediction) {
13
16
  _InvoiceV4LineItem_instances.add(this);
@@ -51,6 +54,9 @@ class InvoiceV4LineItem {
51
54
  this.polygon = rawPrediction["polygon"];
52
55
  }
53
56
  }
57
+ /**
58
+ * Output in a format suitable for inclusion in an rST table.
59
+ */
54
60
  toTableLine() {
55
61
  const printable = __classPrivateFieldGet(this, _InvoiceV4LineItem_instances, "m", _InvoiceV4LineItem_printableValues).call(this);
56
62
  return ("| " +
@@ -67,6 +73,9 @@ class InvoiceV4LineItem {
67
73
  printable.description.padEnd(36) +
68
74
  " |");
69
75
  }
76
+ /**
77
+ * Default string representation.
78
+ */
70
79
  toString() {
71
80
  const printable = __classPrivateFieldGet(this, _InvoiceV4LineItem_instances, "m", _InvoiceV4LineItem_printableValues).call(this);
72
81
  return ("Code: " +
@@ -0,0 +1,3 @@
1
+ export { InvoiceSplitterV1 } from "./invoiceSplitterV1";
2
+ export { InvoiceSplitterV1Document } from "./invoiceSplitterV1Document";
3
+ export { InvoiceSplitterV1PageGroup } from "./invoiceSplitterV1PageGroup";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceSplitterV1PageGroup = exports.InvoiceSplitterV1Document = exports.InvoiceSplitterV1 = void 0;
4
+ var invoiceSplitterV1_1 = require("./invoiceSplitterV1");
5
+ Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
6
+ var invoiceSplitterV1Document_1 = require("./invoiceSplitterV1Document");
7
+ Object.defineProperty(exports, "InvoiceSplitterV1Document", { enumerable: true, get: function () { return invoiceSplitterV1Document_1.InvoiceSplitterV1Document; } });
8
+ var invoiceSplitterV1PageGroup_1 = require("./invoiceSplitterV1PageGroup");
9
+ Object.defineProperty(exports, "InvoiceSplitterV1PageGroup", { enumerable: true, get: function () { return invoiceSplitterV1PageGroup_1.InvoiceSplitterV1PageGroup; } });
@@ -1,9 +1,16 @@
1
1
  import { Inference, StringDict, Page } from "../../parsing/common";
2
2
  import { InvoiceSplitterV1Document } from "./invoiceSplitterV1Document";
3
+ /**
4
+ * Inference prediction for Invoice Splitter, API version 1.
5
+ */
3
6
  export declare class InvoiceSplitterV1 extends Inference {
7
+ /** The endpoint's name. */
4
8
  endpointName: string;
9
+ /** The endpoint's version. */
5
10
  endpointVersion: string;
11
+ /** The document-level prediction. */
6
12
  prediction: InvoiceSplitterV1Document;
13
+ /** The document's pages. */
7
14
  pages: Page<InvoiceSplitterV1Document>[];
8
15
  constructor(rawPrediction: StringDict);
9
16
  }
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceSplitterV1 = void 0;
4
4
  const common_1 = require("../../parsing/common");
5
5
  const invoiceSplitterV1Document_1 = require("./invoiceSplitterV1Document");
6
+ /**
7
+ * Inference prediction for Invoice Splitter, API version 1.
8
+ */
6
9
  class InvoiceSplitterV1 extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
12
+ /** The endpoint's name. */
9
13
  this.endpointName = "invoice_splitter";
14
+ /** The endpoint's version. */
10
15
  this.endpointVersion = "1";
16
+ /** The document's pages. */
11
17
  this.pages = [];
12
18
  this.prediction = new invoiceSplitterV1Document_1.InvoiceSplitterV1Document(rawPrediction["prediction"]);
13
19
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(invoiceSplitterV1Document_1.InvoiceSplitterV1Document, page, page["id"], page["orientation"]));
@@ -1,8 +1,14 @@
1
1
  import { Inference, StringDict } from "../../parsing/common";
2
- import { PageGroup } from "./invoiceSplitterV1PageGroup";
2
+ import { InvoiceSplitterV1PageGroup } from "./invoiceSplitterV1PageGroup";
3
+ /**
4
+ * Document data for Invoice Splitter, API version 1.
5
+ */
3
6
  export declare class InvoiceSplitterV1Document extends Inference {
4
7
  /** List of page indexes that belong to the same invoice in the PDF. */
5
- invoicePageGroups: PageGroup[];
8
+ invoicePageGroups: InvoiceSplitterV1PageGroup[];
6
9
  constructor(rawPrediction: StringDict);
10
+ /**
11
+ * Default string representation.
12
+ */
7
13
  toString(): string;
8
14
  }
@@ -3,14 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceSplitterV1Document = void 0;
4
4
  const common_1 = require("../../parsing/common");
5
5
  const invoiceSplitterV1PageGroup_1 = require("./invoiceSplitterV1PageGroup");
6
+ /**
7
+ * Document data for Invoice Splitter, API version 1.
8
+ */
6
9
  class InvoiceSplitterV1Document extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
9
12
  /** List of page indexes that belong to the same invoice in the PDF. */
10
13
  this.invoicePageGroups = [];
11
14
  rawPrediction["invoice_page_groups"] &&
12
- rawPrediction["invoice_page_groups"].forEach((prediction) => this.invoicePageGroups.push(new invoiceSplitterV1PageGroup_1.PageGroup(prediction)));
15
+ rawPrediction["invoice_page_groups"].forEach((prediction) => this.invoicePageGroups.push(new invoiceSplitterV1PageGroup_1.InvoiceSplitterV1PageGroup(prediction)));
13
16
  }
17
+ /**
18
+ * Default string representation.
19
+ */
14
20
  toString() {
15
21
  const invoicePageGroups = this.invoicePageGroups
16
22
  .map((item) => "\n " + item.toString())
@@ -1,7 +1,15 @@
1
1
  import { StringDict } from "../../parsing/common";
2
- export declare class PageGroup {
2
+ /**
3
+ * Pages indexes in a group.
4
+ */
5
+ export declare class InvoiceSplitterV1PageGroup {
6
+ /** List of page indexes. */
3
7
  pageIndexes: number[];
8
+ /** Confidence score. */
4
9
  confidence: number;
5
10
  constructor(prediction: StringDict);
11
+ /**
12
+ * Default string representation.
13
+ */
6
14
  toString(): string;
7
15
  }
@@ -1,14 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageGroup = void 0;
4
- class PageGroup {
3
+ exports.InvoiceSplitterV1PageGroup = void 0;
4
+ /**
5
+ * Pages indexes in a group.
6
+ */
7
+ class InvoiceSplitterV1PageGroup {
5
8
  constructor(prediction) {
9
+ /** List of page indexes. */
6
10
  this.pageIndexes = [];
7
11
  this.pageIndexes = prediction.page_indexes;
8
12
  this.confidence = prediction["confidence"];
9
13
  }
14
+ /**
15
+ * Default string representation.
16
+ */
10
17
  toString() {
11
18
  return `:Page indexes: ${this.pageIndexes.join(", ")}`;
12
19
  }
13
20
  }
14
- exports.PageGroup = PageGroup;
21
+ exports.InvoiceSplitterV1PageGroup = InvoiceSplitterV1PageGroup;
@@ -0,0 +1,2 @@
1
+ export { PassportV1 } from "./passportV1";
2
+ export { PassportV1Document } from "./passportV1Document";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PassportV1Document = exports.PassportV1 = void 0;
4
+ var passportV1_1 = require("./passportV1");
5
+ Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
6
+ var passportV1Document_1 = require("./passportV1Document");
7
+ Object.defineProperty(exports, "PassportV1Document", { enumerable: true, get: function () { return passportV1Document_1.PassportV1Document; } });
@@ -1,9 +1,16 @@
1
1
  import { Inference, StringDict, Page } from "../../parsing/common";
2
2
  import { PassportV1Document } from "./passportV1Document";
3
+ /**
4
+ * Inference prediction for Passport, API version 1.
5
+ */
3
6
  export declare class PassportV1 extends Inference {
7
+ /** The endpoint's name. */
4
8
  endpointName: string;
9
+ /** The endpoint's version. */
5
10
  endpointVersion: string;
11
+ /** The document-level prediction. */
6
12
  prediction: PassportV1Document;
13
+ /** The document's pages. */
7
14
  pages: Page<PassportV1Document>[];
8
15
  constructor(rawPrediction: StringDict);
9
16
  }
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PassportV1 = void 0;
4
4
  const common_1 = require("../../parsing/common");
5
5
  const passportV1Document_1 = require("./passportV1Document");
6
+ /**
7
+ * Inference prediction for Passport, API version 1.
8
+ */
6
9
  class PassportV1 extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
12
+ /** The endpoint's name. */
9
13
  this.endpointName = "passport";
14
+ /** The endpoint's version. */
10
15
  this.endpointVersion = "1";
16
+ /** The document's pages. */
11
17
  this.pages = [];
12
18
  this.prediction = new passportV1Document_1.PassportV1Document(rawPrediction["prediction"]);
13
19
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(passportV1Document_1.PassportV1Document, page, page["id"], page["orientation"]));
@@ -27,5 +27,8 @@ export declare class PassportV1Document implements Prediction {
27
27
  /** The surname of the passport holder. */
28
28
  surname: StringField;
29
29
  constructor(rawPrediction: StringDict, pageId?: number);
30
+ /**
31
+ * Default string representation.
32
+ */
30
33
  toString(): string;
31
34
  }
@@ -56,6 +56,9 @@ class PassportV1Document {
56
56
  pageId: pageId,
57
57
  });
58
58
  }
59
+ /**
60
+ * Default string representation.
61
+ */
59
62
  toString() {
60
63
  const givenNames = this.givenNames.join("\n ");
61
64
  const outStr = `:Country Code: ${this.country}
@@ -0,0 +1,2 @@
1
+ export { ProofOfAddressV1 } from "./proofOfAddressV1";
2
+ export { ProofOfAddressV1Document } from "./proofOfAddressV1Document";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProofOfAddressV1Document = exports.ProofOfAddressV1 = void 0;
4
+ var proofOfAddressV1_1 = require("./proofOfAddressV1");
5
+ Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
6
+ var proofOfAddressV1Document_1 = require("./proofOfAddressV1Document");
7
+ Object.defineProperty(exports, "ProofOfAddressV1Document", { enumerable: true, get: function () { return proofOfAddressV1Document_1.ProofOfAddressV1Document; } });
@@ -1,9 +1,16 @@
1
1
  import { Inference, StringDict, Page } from "../../parsing/common";
2
2
  import { ProofOfAddressV1Document } from "./proofOfAddressV1Document";
3
+ /**
4
+ * Inference prediction for Proof of Address, API version 1.
5
+ */
3
6
  export declare class ProofOfAddressV1 extends Inference {
7
+ /** The endpoint's name. */
4
8
  endpointName: string;
9
+ /** The endpoint's version. */
5
10
  endpointVersion: string;
11
+ /** The document-level prediction. */
6
12
  prediction: ProofOfAddressV1Document;
13
+ /** The document's pages. */
7
14
  pages: Page<ProofOfAddressV1Document>[];
8
15
  constructor(rawPrediction: StringDict);
9
16
  }
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProofOfAddressV1 = void 0;
4
4
  const common_1 = require("../../parsing/common");
5
5
  const proofOfAddressV1Document_1 = require("./proofOfAddressV1Document");
6
+ /**
7
+ * Inference prediction for Proof of Address, API version 1.
8
+ */
6
9
  class ProofOfAddressV1 extends common_1.Inference {
7
10
  constructor(rawPrediction) {
8
11
  super(rawPrediction);
12
+ /** The endpoint's name. */
9
13
  this.endpointName = "proof_of_address";
14
+ /** The endpoint's version. */
10
15
  this.endpointVersion = "1";
16
+ /** The document's pages. */
11
17
  this.pages = [];
12
18
  this.prediction = new proofOfAddressV1Document_1.ProofOfAddressV1Document(rawPrediction["prediction"]);
13
19
  this.pages = rawPrediction["pages"].map((page) => new common_1.Page(proofOfAddressV1Document_1.ProofOfAddressV1Document, page, page["id"], page["orientation"]));