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.
- package/CHANGELOG.md +25 -0
- package/package.json +4 -3
- package/src/cli.js +36 -66
- package/src/client.d.ts +76 -32
- package/src/client.js +108 -21
- package/src/http/endpoint.d.ts +36 -0
- package/src/http/endpoint.js +54 -16
- package/src/http/error.d.ts +66 -1
- package/src/http/error.js +196 -4
- package/src/http/index.d.ts +1 -1
- package/src/http/index.js +10 -1
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/input/base.d.ts +1 -0
- package/src/input/base.js +3 -0
- package/src/input/pageOptions.d.ts +4 -0
- package/src/input/pageOptions.js +3 -0
- package/src/input/sources.d.ts +2 -3
- package/src/input/sources.js +2 -1
- package/src/internal.d.ts +5 -0
- package/src/internal.js +31 -0
- package/src/parsing/common/apiRequest.d.ts +9 -0
- package/src/parsing/common/apiRequest.js +5 -0
- package/src/parsing/common/apiResponse.d.ts +15 -0
- package/src/parsing/common/apiResponse.js +15 -0
- package/src/parsing/common/asyncPredictResponse.d.ts +24 -3
- package/src/parsing/common/asyncPredictResponse.js +15 -0
- package/src/parsing/common/document.d.ts +17 -0
- package/src/parsing/common/document.js +16 -4
- package/src/parsing/common/extras/cropperExtra.d.ts +3 -0
- package/src/parsing/common/extras/cropperExtra.js +3 -0
- package/src/parsing/common/extras/extras.d.ts +3 -0
- package/src/parsing/common/extras/extras.js +3 -0
- package/src/parsing/common/inference.d.ts +26 -0
- package/src/parsing/common/inference.js +23 -2
- package/src/parsing/common/mvisionV1.d.ts +3 -0
- package/src/parsing/common/mvisionV1.js +3 -0
- package/src/parsing/common/ocr.d.ts +3 -0
- package/src/parsing/common/ocr.js +3 -0
- package/src/parsing/common/ocrPage.d.ts +3 -0
- package/src/parsing/common/ocrPage.js +3 -0
- package/src/parsing/common/orientation.d.ts +3 -0
- package/src/parsing/common/orientation.js +3 -0
- package/src/parsing/common/page.d.ts +19 -0
- package/src/parsing/common/page.js +15 -0
- package/src/parsing/common/predictResponse.d.ts +11 -0
- package/src/parsing/common/predictResponse.js +10 -0
- package/src/parsing/custom/classificationField.d.ts +3 -0
- package/src/parsing/custom/classificationField.js +3 -0
- package/src/parsing/custom/listField.d.ts +6 -0
- package/src/parsing/custom/listField.js +6 -0
- package/src/parsing/standard/amount.d.ts +3 -0
- package/src/parsing/standard/amount.js +3 -0
- package/src/parsing/standard/base.d.ts +3 -0
- package/src/parsing/standard/base.js +3 -0
- package/src/parsing/standard/locale.d.ts +3 -0
- package/src/parsing/standard/locale.js +3 -0
- package/src/parsing/standard/paymentDetails.d.ts +3 -0
- package/src/parsing/standard/paymentDetails.js +3 -0
- package/src/parsing/standard/position.d.ts +3 -0
- package/src/parsing/standard/position.js +3 -0
- package/src/parsing/standard/tax.d.ts +3 -0
- package/src/parsing/standard/tax.js +3 -0
- package/src/product/cropper/cropperV1.d.ts +7 -0
- package/src/product/cropper/cropperV1.js +6 -0
- package/src/product/cropper/cropperV1Document.d.ts +6 -0
- package/src/product/cropper/cropperV1Document.js +6 -0
- package/src/product/cropper/internal.d.ts +2 -0
- package/src/product/cropper/internal.js +7 -0
- package/src/product/custom/customV1.d.ts +7 -0
- package/src/product/custom/customV1.js +6 -0
- package/src/product/custom/customV1Document.d.ts +16 -0
- package/src/product/custom/customV1Document.js +16 -2
- package/src/product/custom/customV1Page.d.ts +7 -0
- package/src/product/custom/customV1Page.js +7 -0
- package/src/product/custom/internal.d.ts +3 -0
- package/src/product/custom/internal.js +9 -0
- package/src/product/eu/internal.d.ts +1 -0
- package/src/product/eu/internal.js +27 -0
- package/src/product/eu/licensePlate/internal.d.ts +2 -0
- package/src/product/eu/licensePlate/internal.js +7 -0
- package/src/product/eu/licensePlate/licensePlateV1.d.ts +7 -0
- package/src/product/eu/licensePlate/licensePlateV1.js +6 -0
- package/src/product/eu/licensePlate/licensePlateV1Document.d.ts +3 -0
- package/src/product/eu/licensePlate/licensePlateV1Document.js +3 -0
- package/src/product/financialDocument/financialDocumentV1.d.ts +7 -0
- package/src/product/financialDocument/financialDocumentV1.js +6 -0
- package/src/product/financialDocument/financialDocumentV1Document.d.ts +3 -0
- package/src/product/financialDocument/financialDocumentV1Document.js +3 -0
- package/src/product/financialDocument/internal.d.ts +3 -0
- package/src/product/financialDocument/internal.js +9 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +7 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +6 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +3 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +3 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +7 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +6 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +3 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +3 -0
- package/src/product/fr/bankAccountDetails/internal.d.ts +5 -0
- package/src/product/fr/bankAccountDetails/internal.js +13 -0
- package/src/product/fr/carteVitale/carteVitaleV1.d.ts +7 -0
- package/src/product/fr/carteVitale/carteVitaleV1.js +6 -0
- package/src/product/fr/carteVitale/carteVitaleV1Document.d.ts +3 -0
- package/src/product/fr/carteVitale/carteVitaleV1Document.js +3 -0
- package/src/product/fr/carteVitale/internal.d.ts +2 -0
- package/src/product/fr/carteVitale/internal.js +7 -0
- package/src/product/fr/idCard/idCardV1.d.ts +7 -0
- package/src/product/fr/idCard/idCardV1.js +6 -0
- package/src/product/fr/idCard/idCardV1Document.d.ts +3 -0
- package/src/product/fr/idCard/idCardV1Document.js +3 -0
- package/src/product/fr/idCard/internal.d.ts +3 -0
- package/src/product/fr/idCard/internal.js +9 -0
- package/src/product/fr/internal.d.ts +3 -0
- package/src/product/fr/internal.js +29 -0
- package/src/product/index.d.ts +0 -1
- package/src/product/index.js +1 -3
- package/src/product/internal.d.ts +11 -0
- package/src/product/internal.js +37 -0
- package/src/product/invoice/internal.d.ts +3 -0
- package/src/product/invoice/internal.js +9 -0
- package/src/product/invoice/invoiceV4.d.ts +7 -0
- package/src/product/invoice/invoiceV4.js +6 -0
- package/src/product/invoice/invoiceV4Document.d.ts +3 -1
- package/src/product/invoice/invoiceV4Document.js +3 -1
- package/src/product/invoice/invoiceV4LineItem.d.ts +9 -0
- package/src/product/invoice/invoiceV4LineItem.js +9 -0
- package/src/product/invoiceSplitter/internal.d.ts +3 -0
- package/src/product/invoiceSplitter/internal.js +9 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +7 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1.js +6 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +8 -2
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +7 -1
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +9 -1
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.js +10 -3
- package/src/product/passport/internal.d.ts +2 -0
- package/src/product/passport/internal.js +7 -0
- package/src/product/passport/passportV1.d.ts +7 -0
- package/src/product/passport/passportV1.js +6 -0
- package/src/product/passport/passportV1Document.d.ts +3 -0
- package/src/product/passport/passportV1Document.js +3 -0
- package/src/product/proofOfAddress/internal.d.ts +2 -0
- package/src/product/proofOfAddress/internal.js +7 -0
- package/src/product/proofOfAddress/proofOfAddressV1.d.ts +7 -0
- package/src/product/proofOfAddress/proofOfAddressV1.js +6 -0
- package/src/product/proofOfAddress/proofOfAddressV1Document.d.ts +3 -0
- package/src/product/proofOfAddress/proofOfAddressV1Document.js +3 -0
- package/src/product/receipt/internal.d.ts +5 -0
- package/src/product/receipt/internal.js +13 -0
- package/src/product/receipt/receiptV4.d.ts +7 -0
- package/src/product/receipt/receiptV4.js +5 -0
- package/src/product/receipt/receiptV4Document.d.ts +6 -0
- package/src/product/receipt/receiptV4Document.js +6 -0
- package/src/product/receipt/receiptV5.d.ts +7 -0
- package/src/product/receipt/receiptV5.js +6 -0
- package/src/product/receipt/receiptV5Document.d.ts +3 -0
- package/src/product/receipt/receiptV5Document.js +3 -0
- package/src/product/us/bankCheck/bankCheckV1.d.ts +7 -0
- package/src/product/us/bankCheck/bankCheckV1.js +6 -0
- package/src/product/us/bankCheck/bankCheckV1Document.d.ts +3 -0
- package/src/product/us/bankCheck/bankCheckV1Document.js +3 -0
- package/src/product/us/bankCheck/internal.d.ts +3 -0
- package/src/product/us/bankCheck/internal.js +9 -0
- package/src/product/us/driverLicense/driverLicenseV1.d.ts +7 -0
- package/src/product/us/driverLicense/driverLicenseV1.js +6 -0
- package/src/product/us/driverLicense/driverLicenseV1Document.d.ts +3 -0
- package/src/product/us/driverLicense/driverLicenseV1Document.js +3 -0
- package/src/product/us/driverLicense/internal.d.ts +3 -0
- package/src/product/us/driverLicense/internal.js +9 -0
- package/src/product/us/internal.d.ts +2 -0
- package/src/product/us/internal.js +28 -0
|
@@ -20,5 +20,8 @@ export declare class PositionField {
|
|
|
20
20
|
/** The document page on which the information was found. */
|
|
21
21
|
pageId: number | undefined;
|
|
22
22
|
constructor({ prediction, pageId }: PositionFieldConstructor);
|
|
23
|
+
/**
|
|
24
|
+
* Default string representation.
|
|
25
|
+
*/
|
|
23
26
|
toString(): string;
|
|
24
27
|
}
|
|
@@ -49,6 +49,9 @@ export declare class TaxField extends Field {
|
|
|
49
49
|
export declare class Taxes extends Array<TaxField> {
|
|
50
50
|
#private;
|
|
51
51
|
init(prediction: StringDict[] | undefined, pageId: number | undefined): this;
|
|
52
|
+
/**
|
|
53
|
+
* Default string representation.
|
|
54
|
+
*/
|
|
52
55
|
toString(): string;
|
|
53
56
|
}
|
|
54
57
|
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, Page, StringDict } from "../../parsing/common";
|
|
2
2
|
import { CropperV1Document } from "./cropperV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Cropper API, version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CropperV1 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: CropperV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<CropperV1Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CropperV1 = void 0;
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const cropperV1Document_1 = require("./cropperV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Cropper API, version 1.
|
|
8
|
+
*/
|
|
6
9
|
class CropperV1 extends common_1.Inference {
|
|
7
10
|
constructor(rawPrediction) {
|
|
8
11
|
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
9
13
|
this.endpointName = "cropper";
|
|
14
|
+
/** The endpoint's version. */
|
|
10
15
|
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
11
17
|
this.pages = [];
|
|
12
18
|
this.prediction = new cropperV1Document_1.CropperV1Document(rawPrediction["prediction"]);
|
|
13
19
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(cropperV1Document_1.CropperV1Document, page, page["id"], page["orientation"]));
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
2
|
import { PositionField } from "../../parsing/standard";
|
|
3
|
+
/**
|
|
4
|
+
* Document data for Cropper API, version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CropperV1Document implements Prediction {
|
|
4
7
|
/** A list of cropped positions. */
|
|
5
8
|
cropping: PositionField[];
|
|
6
9
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
10
|
+
/**
|
|
11
|
+
* Default string representation.
|
|
12
|
+
*/
|
|
7
13
|
toString(): string;
|
|
8
14
|
}
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CropperV1Document = void 0;
|
|
4
4
|
const summaryHelper_1 = require("../../parsing/common/summaryHelper");
|
|
5
5
|
const standard_1 = require("../../parsing/standard");
|
|
6
|
+
/**
|
|
7
|
+
* Document data for Cropper API, version 1.
|
|
8
|
+
*/
|
|
6
9
|
class CropperV1Document {
|
|
7
10
|
constructor(rawPrediction, pageId) {
|
|
8
11
|
/** A list of cropped positions. */
|
|
@@ -15,6 +18,9 @@ class CropperV1Document {
|
|
|
15
18
|
}));
|
|
16
19
|
});
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Default string representation.
|
|
23
|
+
*/
|
|
18
24
|
toString() {
|
|
19
25
|
const cropping = this.cropping
|
|
20
26
|
.map((crop) => crop.toString())
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CropperV1Document = exports.CropperV1 = void 0;
|
|
4
|
+
var cropperV1_1 = require("./cropperV1");
|
|
5
|
+
Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return cropperV1_1.CropperV1; } });
|
|
6
|
+
var cropperV1Document_1 = require("./cropperV1Document");
|
|
7
|
+
Object.defineProperty(exports, "CropperV1Document", { enumerable: true, get: function () { return cropperV1Document_1.CropperV1Document; } });
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Inference, Page, StringDict } from "../../parsing/common";
|
|
2
2
|
import { CustomV1Document } from "./customV1Document";
|
|
3
3
|
import { CustomV1Page } from "./customV1Page";
|
|
4
|
+
/**
|
|
5
|
+
* Inference prediction for Custom builds.
|
|
6
|
+
*/
|
|
4
7
|
export declare class CustomV1 extends Inference {
|
|
8
|
+
/** The endpoint's name. Note: placeholder for custom APIs. */
|
|
5
9
|
endpointName: string;
|
|
10
|
+
/** The endpoint's version. Note: placeholder for custom APIs. */
|
|
6
11
|
endpointVersion: string;
|
|
12
|
+
/** The document-level prediction. */
|
|
7
13
|
prediction: CustomV1Document;
|
|
14
|
+
/** The document's pages. */
|
|
8
15
|
pages: Page<CustomV1Page>[];
|
|
9
16
|
constructor(rawPrediction: StringDict);
|
|
10
17
|
}
|
|
@@ -4,11 +4,17 @@ exports.CustomV1 = void 0;
|
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const customV1Document_1 = require("./customV1Document");
|
|
6
6
|
const customV1Page_1 = require("./customV1Page");
|
|
7
|
+
/**
|
|
8
|
+
* Inference prediction for Custom builds.
|
|
9
|
+
*/
|
|
7
10
|
class CustomV1 extends common_1.Inference {
|
|
8
11
|
constructor(rawPrediction) {
|
|
9
12
|
super(rawPrediction);
|
|
13
|
+
/** The endpoint's name. Note: placeholder for custom APIs. */
|
|
10
14
|
this.endpointName = "custom";
|
|
15
|
+
/** The endpoint's version. Note: placeholder for custom APIs. */
|
|
11
16
|
this.endpointVersion = "1";
|
|
17
|
+
/** The document's pages. */
|
|
12
18
|
this.pages = [];
|
|
13
19
|
this.prediction = new customV1Document_1.CustomV1Document(rawPrediction["prediction"]);
|
|
14
20
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(customV1Page_1.CustomV1Page, page, page["id"], page["orientation"]));
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { StringDict, Prediction } from "../../parsing/common";
|
|
2
2
|
import { ClassificationField, ListField } from "../../parsing/custom";
|
|
3
|
+
/**
|
|
4
|
+
* Document data for Custom builds.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CustomV1Document implements Prediction {
|
|
7
|
+
/** List of fields for a Custom build. */
|
|
4
8
|
fields: Map<string, ListField>;
|
|
9
|
+
/** List of classification fields for a Custom build. */
|
|
5
10
|
classifications: Map<string, ClassificationField>;
|
|
6
11
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
12
|
+
/**
|
|
13
|
+
* Sorts and sets fields between classification fields and regular fields.
|
|
14
|
+
* Note: Currently, two types of fields possible in a custom API response:
|
|
15
|
+
* fields having a list of values, and classification fields.
|
|
16
|
+
* @param fieldName name of the field.
|
|
17
|
+
* @param fieldValue value of the field.
|
|
18
|
+
* @param pageId page the field was found on.
|
|
19
|
+
*/
|
|
7
20
|
protected setField(fieldName: string, fieldValue: any, pageId?: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* Default string representation.
|
|
23
|
+
*/
|
|
8
24
|
toString(): string;
|
|
9
25
|
}
|
|
@@ -3,17 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CustomV1Document = void 0;
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const custom_1 = require("../../parsing/custom");
|
|
6
|
+
/**
|
|
7
|
+
* Document data for Custom builds.
|
|
8
|
+
*/
|
|
6
9
|
class CustomV1Document {
|
|
7
10
|
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** List of fields for a Custom build. */
|
|
8
12
|
this.fields = new Map();
|
|
13
|
+
/** List of classification fields for a Custom build. */
|
|
9
14
|
this.classifications = new Map();
|
|
10
15
|
Object.entries(rawPrediction).forEach(([fieldName, fieldValue]) => {
|
|
11
16
|
this.setField(fieldName, fieldValue, pageId);
|
|
12
17
|
});
|
|
13
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Sorts and sets fields between classification fields and regular fields.
|
|
21
|
+
* Note: Currently, two types of fields possible in a custom API response:
|
|
22
|
+
* fields having a list of values, and classification fields.
|
|
23
|
+
* @param fieldName name of the field.
|
|
24
|
+
* @param fieldValue value of the field.
|
|
25
|
+
* @param pageId page the field was found on.
|
|
26
|
+
*/
|
|
14
27
|
setField(fieldName, fieldValue, pageId) {
|
|
15
|
-
// Currently, two types of fields possible in a custom API response:
|
|
16
|
-
// fields having a list of values, and classification fields.
|
|
17
28
|
if (fieldValue && fieldValue["values"] !== undefined) {
|
|
18
29
|
// Only value lists have the 'values' attribute.
|
|
19
30
|
this.fields.set(fieldName, new custom_1.ListField({
|
|
@@ -29,6 +40,9 @@ class CustomV1Document {
|
|
|
29
40
|
throw new Error(`Unknown API field type for field ${fieldName} : ${fieldValue}`);
|
|
30
41
|
}
|
|
31
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Default string representation.
|
|
45
|
+
*/
|
|
32
46
|
toString() {
|
|
33
47
|
let outStr = "";
|
|
34
48
|
this.classifications.forEach((fieldData, name) => {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { StringDict, Prediction } from "../../parsing/common";
|
|
2
2
|
import { ListField } from "../../parsing/custom";
|
|
3
|
+
/**
|
|
4
|
+
* Page data for Custom builds.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CustomV1Page implements Prediction {
|
|
7
|
+
/** List of page-specific fields for a Custom build. Cannot include Classification fields. */
|
|
4
8
|
fields: Map<string, ListField>;
|
|
5
9
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
10
|
+
/**
|
|
11
|
+
* Default string representation.
|
|
12
|
+
*/
|
|
6
13
|
toString(): string;
|
|
7
14
|
}
|
|
@@ -3,8 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CustomV1Page = void 0;
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const custom_1 = require("../../parsing/custom");
|
|
6
|
+
/**
|
|
7
|
+
* Page data for Custom builds.
|
|
8
|
+
*/
|
|
6
9
|
class CustomV1Page {
|
|
7
10
|
constructor(rawPrediction, pageId) {
|
|
11
|
+
/** List of page-specific fields for a Custom build. Cannot include Classification fields. */
|
|
8
12
|
this.fields = new Map();
|
|
9
13
|
Object.entries(rawPrediction).forEach(([fieldName, fieldValue]) => {
|
|
10
14
|
this.fields.set(fieldName, new custom_1.ListField({
|
|
@@ -13,6 +17,9 @@ class CustomV1Page {
|
|
|
13
17
|
}));
|
|
14
18
|
});
|
|
15
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Default string representation.
|
|
22
|
+
*/
|
|
16
23
|
toString() {
|
|
17
24
|
let outStr = "";
|
|
18
25
|
this.fields.forEach((fieldData, name) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomV1Page = exports.CustomV1Document = exports.CustomV1 = void 0;
|
|
4
|
+
var customV1_1 = require("./customV1");
|
|
5
|
+
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return customV1_1.CustomV1; } });
|
|
6
|
+
var customV1Document_1 = require("./customV1Document");
|
|
7
|
+
Object.defineProperty(exports, "CustomV1Document", { enumerable: true, get: function () { return customV1Document_1.CustomV1Document; } });
|
|
8
|
+
var customV1Page_1 = require("./customV1Page");
|
|
9
|
+
Object.defineProperty(exports, "CustomV1Page", { enumerable: true, get: function () { return customV1Page_1.CustomV1Page; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as licensePlate from "./licensePlate/internal";
|
|
@@ -0,0 +1,27 @@
|
|
|
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.licensePlate = void 0;
|
|
27
|
+
exports.licensePlate = __importStar(require("./licensePlate/internal"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LicensePlateV1Document = exports.LicensePlateV1 = void 0;
|
|
4
|
+
var licensePlateV1_1 = require("./licensePlateV1");
|
|
5
|
+
Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
|
|
6
|
+
var licensePlateV1Document_1 = require("./licensePlateV1Document");
|
|
7
|
+
Object.defineProperty(exports, "LicensePlateV1Document", { enumerable: true, get: function () { return licensePlateV1Document_1.LicensePlateV1Document; } });
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
2
|
import { LicensePlateV1Document } from "./licensePlateV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for License Plate, API version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class LicensePlateV1 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: LicensePlateV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<LicensePlateV1Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LicensePlateV1 = void 0;
|
|
4
4
|
const common_1 = require("../../../parsing/common");
|
|
5
5
|
const licensePlateV1Document_1 = require("./licensePlateV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for License Plate, API version 1.
|
|
8
|
+
*/
|
|
6
9
|
class LicensePlateV1 extends common_1.Inference {
|
|
7
10
|
constructor(rawPrediction) {
|
|
8
11
|
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
9
13
|
this.endpointName = "license_plates";
|
|
14
|
+
/** The endpoint's version. */
|
|
10
15
|
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
11
17
|
this.pages = [];
|
|
12
18
|
this.prediction = new licensePlateV1Document_1.LicensePlateV1Document(rawPrediction["prediction"]);
|
|
13
19
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(licensePlateV1Document_1.LicensePlateV1Document, page, page["id"], page["orientation"]));
|
|
@@ -7,5 +7,8 @@ export declare class LicensePlateV1Document implements Prediction {
|
|
|
7
7
|
/** List of all license plates found in the image. */
|
|
8
8
|
licensePlates: StringField[];
|
|
9
9
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
10
|
+
/**
|
|
11
|
+
* Default string representation.
|
|
12
|
+
*/
|
|
10
13
|
toString(): string;
|
|
11
14
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
2
|
import { FinancialDocumentV1Document } from "./financialDocumentV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Financial Document, API version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class FinancialDocumentV1 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: FinancialDocumentV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<FinancialDocumentV1Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FinancialDocumentV1 = void 0;
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const financialDocumentV1Document_1 = require("./financialDocumentV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Financial Document, API version 1.
|
|
8
|
+
*/
|
|
6
9
|
class FinancialDocumentV1 extends common_1.Inference {
|
|
7
10
|
constructor(rawPrediction) {
|
|
8
11
|
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
9
13
|
this.endpointName = "financial_document";
|
|
14
|
+
/** The endpoint's version. */
|
|
10
15
|
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
11
17
|
this.pages = [];
|
|
12
18
|
this.prediction = new financialDocumentV1Document_1.FinancialDocumentV1Document(rawPrediction["prediction"]);
|
|
13
19
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(financialDocumentV1Document_1.FinancialDocumentV1Document, page, page["id"], page["orientation"]));
|
|
@@ -52,5 +52,8 @@ export declare class FinancialDocumentV1Document implements Prediction {
|
|
|
52
52
|
/** The total amount of taxes. */
|
|
53
53
|
totalTax: AmountField;
|
|
54
54
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
55
|
+
/**
|
|
56
|
+
* Default string representation.
|
|
57
|
+
*/
|
|
55
58
|
toString(): string;
|
|
56
59
|
}
|
|
@@ -110,6 +110,9 @@ class FinancialDocumentV1Document {
|
|
|
110
110
|
pageId: pageId,
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Default string representation.
|
|
115
|
+
*/
|
|
113
116
|
toString() {
|
|
114
117
|
const referenceNumbers = this.referenceNumbers.join("\n ");
|
|
115
118
|
const supplierPaymentDetails = this.supplierPaymentDetails.join("\n ");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialDocumentV1LineItem = exports.FinancialDocumentV1Document = exports.FinancialDocumentV1 = void 0;
|
|
4
|
+
var financialDocumentV1_1 = require("./financialDocumentV1");
|
|
5
|
+
Object.defineProperty(exports, "FinancialDocumentV1", { enumerable: true, get: function () { return financialDocumentV1_1.FinancialDocumentV1; } });
|
|
6
|
+
var financialDocumentV1Document_1 = require("./financialDocumentV1Document");
|
|
7
|
+
Object.defineProperty(exports, "FinancialDocumentV1Document", { enumerable: true, get: function () { return financialDocumentV1Document_1.FinancialDocumentV1Document; } });
|
|
8
|
+
var financialDocumentV1LineItem_1 = require("./financialDocumentV1LineItem");
|
|
9
|
+
Object.defineProperty(exports, "FinancialDocumentV1LineItem", { enumerable: true, get: function () { return financialDocumentV1LineItem_1.FinancialDocumentV1LineItem; } });
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
2
|
import { BankAccountDetailsV1Document } from "./bankAccountDetailsV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Bank Account Details, API version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class BankAccountDetailsV1 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: BankAccountDetailsV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<BankAccountDetailsV1Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BankAccountDetailsV1 = void 0;
|
|
4
4
|
const common_1 = require("../../../parsing/common");
|
|
5
5
|
const bankAccountDetailsV1Document_1 = require("./bankAccountDetailsV1Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Bank Account Details, API version 1.
|
|
8
|
+
*/
|
|
6
9
|
class BankAccountDetailsV1 extends common_1.Inference {
|
|
7
10
|
constructor(rawPrediction) {
|
|
8
11
|
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
9
13
|
this.endpointName = "bank_account_details";
|
|
14
|
+
/** The endpoint's version. */
|
|
10
15
|
this.endpointVersion = "1";
|
|
16
|
+
/** The document's pages. */
|
|
11
17
|
this.pages = [];
|
|
12
18
|
this.prediction = new bankAccountDetailsV1Document_1.BankAccountDetailsV1Document(rawPrediction["prediction"]);
|
|
13
19
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV1Document_1.BankAccountDetailsV1Document, page, page["id"], page["orientation"]));
|
|
@@ -11,5 +11,8 @@ export declare class BankAccountDetailsV1Document implements Prediction {
|
|
|
11
11
|
/** The bank's SWIFT Business Identifier Code (BIC). */
|
|
12
12
|
swift: StringField;
|
|
13
13
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
14
|
+
/**
|
|
15
|
+
* Default string representation.
|
|
16
|
+
*/
|
|
14
17
|
toString(): string;
|
|
15
18
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
2
|
import { BankAccountDetailsV2Document } from "./bankAccountDetailsV2Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Bank Account Details, API version 2.
|
|
5
|
+
*/
|
|
3
6
|
export declare class BankAccountDetailsV2 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: BankAccountDetailsV2Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<BankAccountDetailsV2Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BankAccountDetailsV2 = void 0;
|
|
4
4
|
const common_1 = require("../../../parsing/common");
|
|
5
5
|
const bankAccountDetailsV2Document_1 = require("./bankAccountDetailsV2Document");
|
|
6
|
+
/**
|
|
7
|
+
* Inference prediction for Bank Account Details, API version 2.
|
|
8
|
+
*/
|
|
6
9
|
class BankAccountDetailsV2 extends common_1.Inference {
|
|
7
10
|
constructor(rawPrediction) {
|
|
8
11
|
super(rawPrediction);
|
|
12
|
+
/** The endpoint's name. */
|
|
9
13
|
this.endpointName = "bank_account_details";
|
|
14
|
+
/** The endpoint's version. */
|
|
10
15
|
this.endpointVersion = "2";
|
|
16
|
+
/** The document's pages. */
|
|
11
17
|
this.pages = [];
|
|
12
18
|
this.prediction = new bankAccountDetailsV2Document_1.BankAccountDetailsV2Document(rawPrediction["prediction"]);
|
|
13
19
|
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(bankAccountDetailsV2Document_1.BankAccountDetailsV2Document, page, page["id"], page["orientation"]));
|
|
@@ -14,5 +14,8 @@ export declare class BankAccountDetailsV2Document implements Prediction {
|
|
|
14
14
|
/** Full extraction of the SWIFT code. */
|
|
15
15
|
swiftCode: StringField;
|
|
16
16
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
17
|
+
/**
|
|
18
|
+
* Default string representation.
|
|
19
|
+
*/
|
|
17
20
|
toString(): string;
|
|
18
21
|
}
|
|
@@ -26,6 +26,9 @@ class BankAccountDetailsV2Document {
|
|
|
26
26
|
pageId: pageId,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Default string representation.
|
|
31
|
+
*/
|
|
29
32
|
toString() {
|
|
30
33
|
const outStr = `:Account Holder's Names: ${this.accountHoldersNames}
|
|
31
34
|
:Basic Bank Account Number: ${this.bban.toFieldList()}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BankAccountDetailsV1 } from "./bankAccountDetailsV1";
|
|
2
|
+
export { BankAccountDetailsV1Document } from "./bankAccountDetailsV1Document";
|
|
3
|
+
export { BankAccountDetailsV2 } from "./bankAccountDetailsV2";
|
|
4
|
+
export { BankAccountDetailsV2Document } from "./bankAccountDetailsV2Document";
|
|
5
|
+
export { BankAccountDetailsV2Bban } from "./bankAccountDetailsV2Bban";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BankAccountDetailsV2Bban = exports.BankAccountDetailsV2Document = exports.BankAccountDetailsV2 = exports.BankAccountDetailsV1Document = exports.BankAccountDetailsV1 = void 0;
|
|
4
|
+
var bankAccountDetailsV1_1 = require("./bankAccountDetailsV1");
|
|
5
|
+
Object.defineProperty(exports, "BankAccountDetailsV1", { enumerable: true, get: function () { return bankAccountDetailsV1_1.BankAccountDetailsV1; } });
|
|
6
|
+
var bankAccountDetailsV1Document_1 = require("./bankAccountDetailsV1Document");
|
|
7
|
+
Object.defineProperty(exports, "BankAccountDetailsV1Document", { enumerable: true, get: function () { return bankAccountDetailsV1Document_1.BankAccountDetailsV1Document; } });
|
|
8
|
+
var bankAccountDetailsV2_1 = require("./bankAccountDetailsV2");
|
|
9
|
+
Object.defineProperty(exports, "BankAccountDetailsV2", { enumerable: true, get: function () { return bankAccountDetailsV2_1.BankAccountDetailsV2; } });
|
|
10
|
+
var bankAccountDetailsV2Document_1 = require("./bankAccountDetailsV2Document");
|
|
11
|
+
Object.defineProperty(exports, "BankAccountDetailsV2Document", { enumerable: true, get: function () { return bankAccountDetailsV2Document_1.BankAccountDetailsV2Document; } });
|
|
12
|
+
var bankAccountDetailsV2Bban_1 = require("./bankAccountDetailsV2Bban");
|
|
13
|
+
Object.defineProperty(exports, "BankAccountDetailsV2Bban", { enumerable: true, get: function () { return bankAccountDetailsV2Bban_1.BankAccountDetailsV2Bban; } });
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
2
|
import { CarteVitaleV1Document } from "./carteVitaleV1Document";
|
|
3
|
+
/**
|
|
4
|
+
* Inference prediction for Carte Vitale, API version 1.
|
|
5
|
+
*/
|
|
3
6
|
export declare class CarteVitaleV1 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: CarteVitaleV1Document;
|
|
13
|
+
/** The document's pages. */
|
|
7
14
|
pages: Page<CarteVitaleV1Document>[];
|
|
8
15
|
constructor(rawPrediction: StringDict);
|
|
9
16
|
}
|