mindee 4.0.1 → 4.0.2
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 +8 -0
- package/package.json +1 -1
- package/src/client.d.ts +58 -32
- package/src/client.js +50 -19
- package/src/http/endpoint.js +9 -11
- package/src/index.d.ts +1 -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/parsing/common/apiRequest.d.ts +9 -0
- package/src/parsing/common/apiRequest.js +5 -0
- package/src/parsing/common/apiResponse.d.ts +9 -0
- package/src/parsing/common/apiResponse.js +8 -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/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/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/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/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/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/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/invoiceSplitterV1.d.ts +7 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1.js +6 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +6 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +6 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +8 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.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/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/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/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
|
@@ -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) => {
|
|
@@ -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 ");
|
|
@@ -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()}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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: " +
|
|
@@ -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
2
|
import { PageGroup } 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
8
|
invoicePageGroups: PageGroup[];
|
|
6
9
|
constructor(rawPrediction: StringDict);
|
|
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.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);
|
|
@@ -11,6 +14,9 @@ class InvoiceSplitterV1Document extends common_1.Inference {
|
|
|
11
14
|
rawPrediction["invoice_page_groups"] &&
|
|
12
15
|
rawPrediction["invoice_page_groups"].forEach((prediction) => this.invoicePageGroups.push(new invoiceSplitterV1PageGroup_1.PageGroup(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
|
+
/**
|
|
3
|
+
* Pages indexes in a group.
|
|
4
|
+
*/
|
|
2
5
|
export declare class PageGroup {
|
|
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
|
}
|