mindee 4.23.1 → 4.24.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 +16 -0
- package/package.json +1 -1
- package/src/cli.js +7 -236
- package/src/cliProducts.d.ts +11 -0
- package/src/cliProducts.js +306 -0
- package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.js +1 -1
- package/src/product/deliveryNote/deliveryNoteV1Document.d.ts +1 -1
- package/src/product/deliveryNote/deliveryNoteV1Document.js +1 -1
- package/src/product/financialDocument/financialDocumentV1Document.d.ts +17 -14
- package/src/product/financialDocument/financialDocumentV1Document.js +5 -5
- package/src/product/financialDocument/financialDocumentV1LineItem.d.ts +1 -1
- package/src/product/financialDocument/financialDocumentV1LineItem.js +1 -1
- package/src/product/fr/energyBill/energyBillV1Document.d.ts +1 -1
- package/src/product/fr/energyBill/energyBillV1Document.js +4 -2
- package/src/product/fr/energyBill/energyBillV1EnergyUsage.d.ts +4 -0
- package/src/product/fr/energyBill/energyBillV1EnergyUsage.js +24 -1
- package/src/product/fr/energyBill/energyBillV1MeterDetail.d.ts +1 -1
- package/src/product/fr/energyBill/energyBillV1MeterDetail.js +2 -2
- package/src/product/fr/internal.d.ts +1 -1
- package/src/product/fr/internal.js +2 -2
- package/src/product/ind/internal.d.ts +1 -1
- package/src/product/ind/internal.js +2 -2
- package/src/product/index.d.ts +4 -7
- package/src/product/index.js +6 -11
- package/src/product/internal.d.ts +1 -2
- package/src/product/internal.js +2 -3
- package/src/product/invoice/invoiceV4Document.d.ts +14 -14
- package/src/product/invoice/invoiceV4Document.js +5 -5
- package/src/product/invoice/invoiceV4LineItem.d.ts +2 -2
- package/src/product/invoice/invoiceV4LineItem.js +1 -1
- package/src/product/invoiceSplitter/index.d.ts +1 -0
- package/src/product/invoiceSplitter/index.js +5 -0
- package/src/product/invoiceSplitter/internal.d.ts +1 -1
- package/src/product/invoiceSplitter/internal.js +3 -3
- package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +1 -1
- package/src/product/invoiceSplitter/invoiceSplitterV1.js +7 -2
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +5 -5
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +17 -10
- package/src/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +28 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +53 -0
- package/src/product/receipt/internal.d.ts +0 -2
- package/src/product/receipt/internal.js +1 -5
- package/src/product/receipt/receiptV5Document.d.ts +8 -8
- package/src/product/receipt/receiptV5Document.js +2 -2
- package/src/product/receipt/receiptV5LineItem.d.ts +1 -1
- package/src/product/receipt/receiptV5LineItem.js +1 -1
- package/src/product/us/healthcareCard/healthcareCardV1Document.d.ts +1 -1
- package/src/product/us/healthcareCard/healthcareCardV1Document.js +1 -1
- package/src/product/us/healthcareCard/index.d.ts +0 -2
- package/src/product/us/healthcareCard/index.js +1 -5
- package/src/product/us/index.d.ts +0 -2
- package/src/product/us/index.js +1 -5
- package/src/product/us/internal.d.ts +1 -3
- package/src/product/us/internal.js +2 -4
- package/src/product/eu/driverLicense/driverLicenseV1.d.ts +0 -17
- package/src/product/eu/driverLicense/driverLicenseV1.js +0 -28
- package/src/product/eu/driverLicense/driverLicenseV1Document.d.ts +0 -36
- package/src/product/eu/driverLicense/driverLicenseV1Document.js +0 -79
- package/src/product/eu/driverLicense/driverLicenseV1Page.d.ts +0 -14
- package/src/product/eu/driverLicense/driverLicenseV1Page.js +0 -29
- package/src/product/eu/driverLicense/index.d.ts +0 -1
- package/src/product/eu/driverLicense/index.js +0 -5
- package/src/product/eu/driverLicense/internal.d.ts +0 -3
- package/src/product/eu/driverLicense/internal.js +0 -9
- package/src/product/eu/index.d.ts +0 -2
- package/src/product/eu/index.js +0 -7
- package/src/product/eu/internal.d.ts +0 -2
- package/src/product/eu/internal.js +0 -28
- package/src/product/eu/licensePlate/index.d.ts +0 -1
- package/src/product/eu/licensePlate/index.js +0 -5
- package/src/product/eu/licensePlate/internal.d.ts +0 -2
- package/src/product/eu/licensePlate/internal.js +0 -7
- package/src/product/eu/licensePlate/licensePlateV1.d.ts +0 -16
- package/src/product/eu/licensePlate/licensePlateV1.js +0 -27
- package/src/product/eu/licensePlate/licensePlateV1Document.d.ts +0 -14
- package/src/product/eu/licensePlate/licensePlateV1Document.js +0 -28
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +0 -15
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.js +0 -21
- package/src/product/proofOfAddress/index.d.ts +0 -1
- package/src/product/proofOfAddress/index.js +0 -5
- package/src/product/proofOfAddress/internal.d.ts +0 -2
- package/src/product/proofOfAddress/internal.js +0 -7
- package/src/product/proofOfAddress/proofOfAddressV1.d.ts +0 -16
- package/src/product/proofOfAddress/proofOfAddressV1.js +0 -27
- package/src/product/proofOfAddress/proofOfAddressV1Document.d.ts +0 -30
- package/src/product/proofOfAddress/proofOfAddressV1Document.js +0 -75
- package/src/product/receipt/receiptV4.d.ts +0 -16
- package/src/product/receipt/receiptV4.js +0 -20
- package/src/product/receipt/receiptV4Document.d.ts +0 -36
- package/src/product/receipt/receiptV4Document.js +0 -73
- package/src/product/us/driverLicense/driverLicenseV1.d.ts +0 -17
- package/src/product/us/driverLicense/driverLicenseV1.js +0 -28
- package/src/product/us/driverLicense/driverLicenseV1Document.d.ts +0 -46
- package/src/product/us/driverLicense/driverLicenseV1Document.js +0 -104
- package/src/product/us/driverLicense/driverLicenseV1Page.d.ts +0 -14
- package/src/product/us/driverLicense/driverLicenseV1Page.js +0 -29
- package/src/product/us/driverLicense/index.d.ts +0 -1
- package/src/product/us/driverLicense/index.js +0 -5
- package/src/product/us/driverLicense/internal.d.ts +0 -3
- package/src/product/us/driverLicense/internal.js +0 -9
- package/src/product/us/w9/index.d.ts +0 -1
- package/src/product/us/w9/index.js +0 -5
- package/src/product/us/w9/internal.d.ts +0 -3
- package/src/product/us/w9/internal.js +0 -9
- package/src/product/us/w9/w9V1.d.ts +0 -17
- package/src/product/us/w9/w9V1.js +0 -28
- package/src/product/us/w9/w9V1Document.d.ts +0 -10
- package/src/product/us/w9/w9V1Document.js +0 -15
- package/src/product/us/w9/w9V1Page.d.ts +0 -34
- package/src/product/us/w9/w9V1Page.js +0 -78
|
@@ -1,28 +0,0 @@
|
|
|
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 = exports.driverLicense = void 0;
|
|
27
|
-
exports.driverLicense = __importStar(require("./driverLicense/internal"));
|
|
28
|
-
exports.licensePlate = __importStar(require("./licensePlate/internal"));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { LicensePlateV1 } from "./licensePlateV1";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LicensePlateV1 = void 0;
|
|
4
|
-
var licensePlateV1_1 = require("./licensePlateV1");
|
|
5
|
-
Object.defineProperty(exports, "LicensePlateV1", { enumerable: true, get: function () { return licensePlateV1_1.LicensePlateV1; } });
|
|
@@ -1,7 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
-
import { LicensePlateV1Document } from "./licensePlateV1Document";
|
|
3
|
-
/**
|
|
4
|
-
* License Plate API version 1 inference prediction.
|
|
5
|
-
*/
|
|
6
|
-
export declare class LicensePlateV1 extends Inference {
|
|
7
|
-
/** The endpoint's name. */
|
|
8
|
-
endpointName: string;
|
|
9
|
-
/** The endpoint's version. */
|
|
10
|
-
endpointVersion: string;
|
|
11
|
-
/** The document-level prediction. */
|
|
12
|
-
prediction: LicensePlateV1Document;
|
|
13
|
-
/** The document's pages. */
|
|
14
|
-
pages: Page<LicensePlateV1Document>[];
|
|
15
|
-
constructor(rawPrediction: StringDict);
|
|
16
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LicensePlateV1 = void 0;
|
|
4
|
-
const common_1 = require("../../../parsing/common");
|
|
5
|
-
const licensePlateV1Document_1 = require("./licensePlateV1Document");
|
|
6
|
-
/**
|
|
7
|
-
* License Plate API version 1 inference prediction.
|
|
8
|
-
*/
|
|
9
|
-
class LicensePlateV1 extends common_1.Inference {
|
|
10
|
-
constructor(rawPrediction) {
|
|
11
|
-
super(rawPrediction);
|
|
12
|
-
/** The endpoint's name. */
|
|
13
|
-
this.endpointName = "license_plates";
|
|
14
|
-
/** The endpoint's version. */
|
|
15
|
-
this.endpointVersion = "1";
|
|
16
|
-
/** The document's pages. */
|
|
17
|
-
this.pages = [];
|
|
18
|
-
this.prediction = new licensePlateV1Document_1.LicensePlateV1Document(rawPrediction["prediction"]);
|
|
19
|
-
rawPrediction["pages"].forEach((page) => {
|
|
20
|
-
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
-
Object.keys(page.prediction).length > 0) {
|
|
22
|
-
this.pages.push(new common_1.Page(licensePlateV1Document_1.LicensePlateV1Document, page, page["id"], page["orientation"]));
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.LicensePlateV1 = LicensePlateV1;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
-
import { StringField } from "../../../parsing/standard";
|
|
3
|
-
/**
|
|
4
|
-
* License Plate API version 1.1 document data.
|
|
5
|
-
*/
|
|
6
|
-
export declare class LicensePlateV1Document implements Prediction {
|
|
7
|
-
/** List of all license plates found in the image. */
|
|
8
|
-
licensePlates: StringField[];
|
|
9
|
-
constructor(rawPrediction: StringDict, pageId?: number);
|
|
10
|
-
/**
|
|
11
|
-
* Default string representation.
|
|
12
|
-
*/
|
|
13
|
-
toString(): string;
|
|
14
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LicensePlateV1Document = void 0;
|
|
4
|
-
const common_1 = require("../../../parsing/common");
|
|
5
|
-
const standard_1 = require("../../../parsing/standard");
|
|
6
|
-
/**
|
|
7
|
-
* License Plate API version 1.1 document data.
|
|
8
|
-
*/
|
|
9
|
-
class LicensePlateV1Document {
|
|
10
|
-
constructor(rawPrediction, pageId) {
|
|
11
|
-
/** List of all license plates found in the image. */
|
|
12
|
-
this.licensePlates = [];
|
|
13
|
-
rawPrediction["license_plates"] &&
|
|
14
|
-
rawPrediction["license_plates"].map((itemPrediction) => this.licensePlates.push(new standard_1.StringField({
|
|
15
|
-
prediction: itemPrediction,
|
|
16
|
-
pageId: pageId,
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Default string representation.
|
|
21
|
-
*/
|
|
22
|
-
toString() {
|
|
23
|
-
const licensePlates = this.licensePlates.join("\n ");
|
|
24
|
-
const outStr = `:License Plates: ${licensePlates}`.trimEnd();
|
|
25
|
-
return (0, common_1.cleanOutString)(outStr);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.LicensePlateV1Document = LicensePlateV1Document;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StringDict } from "../../parsing/common";
|
|
2
|
-
/**
|
|
3
|
-
* Pages indexes in a group for Invoice Splitter V1.
|
|
4
|
-
*/
|
|
5
|
-
export declare class InvoiceSplitterV1PageGroup {
|
|
6
|
-
/** List of page indexes. */
|
|
7
|
-
pageIndexes: number[];
|
|
8
|
-
/** Confidence score. */
|
|
9
|
-
confidence: number;
|
|
10
|
-
constructor(prediction: StringDict);
|
|
11
|
-
/**
|
|
12
|
-
* Default string representation.
|
|
13
|
-
*/
|
|
14
|
-
toString(): string;
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvoiceSplitterV1PageGroup = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Pages indexes in a group for Invoice Splitter V1.
|
|
6
|
-
*/
|
|
7
|
-
class InvoiceSplitterV1PageGroup {
|
|
8
|
-
constructor(prediction) {
|
|
9
|
-
/** List of page indexes. */
|
|
10
|
-
this.pageIndexes = [];
|
|
11
|
-
this.pageIndexes = prediction.page_indexes;
|
|
12
|
-
this.confidence = prediction["confidence"];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Default string representation.
|
|
16
|
-
*/
|
|
17
|
-
toString() {
|
|
18
|
-
return `:Page indexes: ${this.pageIndexes.join(", ")}`;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.InvoiceSplitterV1PageGroup = InvoiceSplitterV1PageGroup;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProofOfAddressV1 } from "./proofOfAddressV1";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProofOfAddressV1 = void 0;
|
|
4
|
-
var proofOfAddressV1_1 = require("./proofOfAddressV1");
|
|
5
|
-
Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
|
|
@@ -1,7 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
-
import { ProofOfAddressV1Document } from "./proofOfAddressV1Document";
|
|
3
|
-
/**
|
|
4
|
-
* Proof of Address API version 1 inference prediction.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ProofOfAddressV1 extends Inference {
|
|
7
|
-
/** The endpoint's name. */
|
|
8
|
-
endpointName: string;
|
|
9
|
-
/** The endpoint's version. */
|
|
10
|
-
endpointVersion: string;
|
|
11
|
-
/** The document-level prediction. */
|
|
12
|
-
prediction: ProofOfAddressV1Document;
|
|
13
|
-
/** The document's pages. */
|
|
14
|
-
pages: Page<ProofOfAddressV1Document>[];
|
|
15
|
-
constructor(rawPrediction: StringDict);
|
|
16
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProofOfAddressV1 = void 0;
|
|
4
|
-
const common_1 = require("../../parsing/common");
|
|
5
|
-
const proofOfAddressV1Document_1 = require("./proofOfAddressV1Document");
|
|
6
|
-
/**
|
|
7
|
-
* Proof of Address API version 1 inference prediction.
|
|
8
|
-
*/
|
|
9
|
-
class ProofOfAddressV1 extends common_1.Inference {
|
|
10
|
-
constructor(rawPrediction) {
|
|
11
|
-
super(rawPrediction);
|
|
12
|
-
/** The endpoint's name. */
|
|
13
|
-
this.endpointName = "proof_of_address";
|
|
14
|
-
/** The endpoint's version. */
|
|
15
|
-
this.endpointVersion = "1";
|
|
16
|
-
/** The document's pages. */
|
|
17
|
-
this.pages = [];
|
|
18
|
-
this.prediction = new proofOfAddressV1Document_1.ProofOfAddressV1Document(rawPrediction["prediction"]);
|
|
19
|
-
rawPrediction["pages"].forEach((page) => {
|
|
20
|
-
if (page.prediction !== undefined && page.prediction !== null &&
|
|
21
|
-
Object.keys(page.prediction).length > 0) {
|
|
22
|
-
this.pages.push(new common_1.Page(proofOfAddressV1Document_1.ProofOfAddressV1Document, page, page["id"], page["orientation"]));
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.ProofOfAddressV1 = ProofOfAddressV1;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
-
import { CompanyRegistrationField, DateField, LocaleField, StringField } from "../../parsing/standard";
|
|
3
|
-
/**
|
|
4
|
-
* Proof of Address API version 1.1 document data.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ProofOfAddressV1Document implements Prediction {
|
|
7
|
-
/** The date the document was issued. */
|
|
8
|
-
date: DateField;
|
|
9
|
-
/** List of dates found on the document. */
|
|
10
|
-
dates: DateField[];
|
|
11
|
-
/** The address of the document's issuer. */
|
|
12
|
-
issuerAddress: StringField;
|
|
13
|
-
/** List of company registrations found for the issuer. */
|
|
14
|
-
issuerCompanyRegistration: CompanyRegistrationField[];
|
|
15
|
-
/** The name of the person or company issuing the document. */
|
|
16
|
-
issuerName: StringField;
|
|
17
|
-
/** The locale detected on the document. */
|
|
18
|
-
locale: LocaleField;
|
|
19
|
-
/** The address of the recipient. */
|
|
20
|
-
recipientAddress: StringField;
|
|
21
|
-
/** List of company registrations found for the recipient. */
|
|
22
|
-
recipientCompanyRegistration: CompanyRegistrationField[];
|
|
23
|
-
/** The name of the person or company receiving the document. */
|
|
24
|
-
recipientName: StringField;
|
|
25
|
-
constructor(rawPrediction: StringDict, pageId?: number);
|
|
26
|
-
/**
|
|
27
|
-
* Default string representation.
|
|
28
|
-
*/
|
|
29
|
-
toString(): string;
|
|
30
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProofOfAddressV1Document = void 0;
|
|
4
|
-
const common_1 = require("../../parsing/common");
|
|
5
|
-
const standard_1 = require("../../parsing/standard");
|
|
6
|
-
/**
|
|
7
|
-
* Proof of Address API version 1.1 document data.
|
|
8
|
-
*/
|
|
9
|
-
class ProofOfAddressV1Document {
|
|
10
|
-
constructor(rawPrediction, pageId) {
|
|
11
|
-
/** List of dates found on the document. */
|
|
12
|
-
this.dates = [];
|
|
13
|
-
/** List of company registrations found for the issuer. */
|
|
14
|
-
this.issuerCompanyRegistration = [];
|
|
15
|
-
/** List of company registrations found for the recipient. */
|
|
16
|
-
this.recipientCompanyRegistration = [];
|
|
17
|
-
this.date = new standard_1.DateField({
|
|
18
|
-
prediction: rawPrediction["date"],
|
|
19
|
-
pageId: pageId,
|
|
20
|
-
});
|
|
21
|
-
rawPrediction["dates"] &&
|
|
22
|
-
rawPrediction["dates"].map((itemPrediction) => this.dates.push(new standard_1.DateField({
|
|
23
|
-
prediction: itemPrediction,
|
|
24
|
-
pageId: pageId,
|
|
25
|
-
})));
|
|
26
|
-
this.issuerAddress = new standard_1.StringField({
|
|
27
|
-
prediction: rawPrediction["issuer_address"],
|
|
28
|
-
pageId: pageId,
|
|
29
|
-
});
|
|
30
|
-
rawPrediction["issuer_company_registration"] &&
|
|
31
|
-
rawPrediction["issuer_company_registration"].map((itemPrediction) => this.issuerCompanyRegistration.push(new standard_1.CompanyRegistrationField({
|
|
32
|
-
prediction: itemPrediction,
|
|
33
|
-
pageId: pageId,
|
|
34
|
-
})));
|
|
35
|
-
this.issuerName = new standard_1.StringField({
|
|
36
|
-
prediction: rawPrediction["issuer_name"],
|
|
37
|
-
pageId: pageId,
|
|
38
|
-
});
|
|
39
|
-
this.locale = new standard_1.LocaleField({
|
|
40
|
-
prediction: rawPrediction["locale"],
|
|
41
|
-
});
|
|
42
|
-
this.recipientAddress = new standard_1.StringField({
|
|
43
|
-
prediction: rawPrediction["recipient_address"],
|
|
44
|
-
pageId: pageId,
|
|
45
|
-
});
|
|
46
|
-
rawPrediction["recipient_company_registration"] &&
|
|
47
|
-
rawPrediction["recipient_company_registration"].map((itemPrediction) => this.recipientCompanyRegistration.push(new standard_1.CompanyRegistrationField({
|
|
48
|
-
prediction: itemPrediction,
|
|
49
|
-
pageId: pageId,
|
|
50
|
-
})));
|
|
51
|
-
this.recipientName = new standard_1.StringField({
|
|
52
|
-
prediction: rawPrediction["recipient_name"],
|
|
53
|
-
pageId: pageId,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Default string representation.
|
|
58
|
-
*/
|
|
59
|
-
toString() {
|
|
60
|
-
const issuerCompanyRegistration = this.issuerCompanyRegistration.join("\n ");
|
|
61
|
-
const recipientCompanyRegistration = this.recipientCompanyRegistration.join("\n ");
|
|
62
|
-
const dates = this.dates.join("\n ");
|
|
63
|
-
const outStr = `:Locale: ${this.locale}
|
|
64
|
-
:Issuer Name: ${this.issuerName}
|
|
65
|
-
:Issuer Company Registrations: ${issuerCompanyRegistration}
|
|
66
|
-
:Issuer Address: ${this.issuerAddress}
|
|
67
|
-
:Recipient Name: ${this.recipientName}
|
|
68
|
-
:Recipient Company Registrations: ${recipientCompanyRegistration}
|
|
69
|
-
:Recipient Address: ${this.recipientAddress}
|
|
70
|
-
:Dates: ${dates}
|
|
71
|
-
:Date of Issue: ${this.date}`.trimEnd();
|
|
72
|
-
return (0, common_1.cleanOutString)(outStr);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.ProofOfAddressV1Document = ProofOfAddressV1Document;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "../../parsing/common";
|
|
2
|
-
import { ReceiptV4Document } from "./receiptV4Document";
|
|
3
|
-
/**
|
|
4
|
-
* Inference prediction for Receipt, API version 4.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ReceiptV4 extends Inference {
|
|
7
|
-
/** The endpoint's name. */
|
|
8
|
-
endpointName: string;
|
|
9
|
-
/** The endpoint's version. */
|
|
10
|
-
endpointVersion: string;
|
|
11
|
-
/** The document-level prediction. */
|
|
12
|
-
prediction: ReceiptV4Document;
|
|
13
|
-
/** The document's pages. */
|
|
14
|
-
pages: Page<ReceiptV4Document>[];
|
|
15
|
-
constructor(rawPrediction: StringDict);
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReceiptV4 = void 0;
|
|
4
|
-
const common_1 = require("../../parsing/common");
|
|
5
|
-
const receiptV4Document_1 = require("./receiptV4Document");
|
|
6
|
-
/**
|
|
7
|
-
* Inference prediction for Receipt, API version 4.
|
|
8
|
-
*/
|
|
9
|
-
class ReceiptV4 extends common_1.Inference {
|
|
10
|
-
constructor(rawPrediction) {
|
|
11
|
-
super(rawPrediction);
|
|
12
|
-
/** The endpoint's name. */
|
|
13
|
-
this.endpointName = "expense_receipts";
|
|
14
|
-
/** The endpoint's version. */
|
|
15
|
-
this.endpointVersion = "4";
|
|
16
|
-
this.prediction = new receiptV4Document_1.ReceiptV4Document(rawPrediction["prediction"]);
|
|
17
|
-
this.pages = rawPrediction["pages"].map((page) => new common_1.Page(receiptV4Document_1.ReceiptV4Document, page, page["id"], page["orientation"]));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ReceiptV4 = ReceiptV4;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
|
-
import { ClassificationField, AmountField, DateField, StringField, LocaleField, TaxField } from "../../parsing/standard";
|
|
3
|
-
/**
|
|
4
|
-
* Document data for Receipt, API version 5.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ReceiptV4Document implements Prediction {
|
|
7
|
-
/** Where the purchase was made, the language, and the currency. */
|
|
8
|
-
locale: LocaleField;
|
|
9
|
-
/** The purchase date. */
|
|
10
|
-
date: DateField;
|
|
11
|
-
/** The receipt category among predefined classes. */
|
|
12
|
-
category: ClassificationField;
|
|
13
|
-
/** The receipt sub-category among predefined classes. */
|
|
14
|
-
subCategory: ClassificationField;
|
|
15
|
-
/** Whether the document is an expense receipt or a credit card receipt. */
|
|
16
|
-
documentType: StringField;
|
|
17
|
-
/** The name of the supplier or merchant, as seen on the receipt. */
|
|
18
|
-
supplier: StringField;
|
|
19
|
-
/** Time as seen on the receipt in HH:MM format. */
|
|
20
|
-
time: StringField;
|
|
21
|
-
/** List of taxes detected on the receipt. */
|
|
22
|
-
taxes: TaxField[];
|
|
23
|
-
/** Total amount of tip and gratuity. */
|
|
24
|
-
tip: AmountField;
|
|
25
|
-
/** total spent including taxes, discounts, fees, tips, and gratuity. */
|
|
26
|
-
totalAmount: AmountField;
|
|
27
|
-
/** Total amount of the purchase excluding taxes. */
|
|
28
|
-
totalNet: AmountField;
|
|
29
|
-
/** Total tax amount of the purchase. */
|
|
30
|
-
totalTax: AmountField;
|
|
31
|
-
constructor(rawPrediction: StringDict, pageId?: number);
|
|
32
|
-
/**
|
|
33
|
-
* Default string representation.
|
|
34
|
-
*/
|
|
35
|
-
toString(): string;
|
|
36
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReceiptV4Document = void 0;
|
|
4
|
-
const common_1 = require("../../parsing/common");
|
|
5
|
-
const standard_1 = require("../../parsing/standard");
|
|
6
|
-
/**
|
|
7
|
-
* Document data for Receipt, API version 5.
|
|
8
|
-
*/
|
|
9
|
-
class ReceiptV4Document {
|
|
10
|
-
constructor(rawPrediction, pageId) {
|
|
11
|
-
this.locale = new standard_1.LocaleField({
|
|
12
|
-
prediction: rawPrediction["locale"],
|
|
13
|
-
});
|
|
14
|
-
this.totalTax = new standard_1.AmountField({
|
|
15
|
-
prediction: rawPrediction["total_tax"],
|
|
16
|
-
pageId: pageId,
|
|
17
|
-
});
|
|
18
|
-
this.totalAmount = new standard_1.AmountField({
|
|
19
|
-
prediction: rawPrediction["total_amount"],
|
|
20
|
-
pageId: pageId,
|
|
21
|
-
});
|
|
22
|
-
this.totalNet = new standard_1.AmountField({
|
|
23
|
-
prediction: rawPrediction["total_net"],
|
|
24
|
-
pageId: pageId,
|
|
25
|
-
});
|
|
26
|
-
this.tip = new standard_1.AmountField({
|
|
27
|
-
prediction: rawPrediction["tip"],
|
|
28
|
-
pageId: pageId,
|
|
29
|
-
});
|
|
30
|
-
this.date = new standard_1.DateField({
|
|
31
|
-
prediction: rawPrediction["date"],
|
|
32
|
-
pageId: pageId,
|
|
33
|
-
});
|
|
34
|
-
this.category = new standard_1.ClassificationField({
|
|
35
|
-
prediction: rawPrediction["category"],
|
|
36
|
-
});
|
|
37
|
-
this.subCategory = new standard_1.ClassificationField({
|
|
38
|
-
prediction: rawPrediction["subcategory"],
|
|
39
|
-
});
|
|
40
|
-
this.documentType = new standard_1.StringField({
|
|
41
|
-
prediction: rawPrediction["document_type"],
|
|
42
|
-
pageId: pageId,
|
|
43
|
-
});
|
|
44
|
-
this.supplier = new standard_1.StringField({
|
|
45
|
-
prediction: rawPrediction["supplier"],
|
|
46
|
-
pageId: pageId,
|
|
47
|
-
});
|
|
48
|
-
this.time = new standard_1.StringField({
|
|
49
|
-
prediction: rawPrediction["time"],
|
|
50
|
-
pageId: pageId,
|
|
51
|
-
});
|
|
52
|
-
this.taxes = new standard_1.Taxes().init(rawPrediction["taxes"], pageId);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Default string representation.
|
|
56
|
-
*/
|
|
57
|
-
toString() {
|
|
58
|
-
const outStr = `:Locale: ${this.locale}
|
|
59
|
-
:Date: ${this.date}
|
|
60
|
-
:Category: ${this.category}
|
|
61
|
-
:Subcategory: ${this.subCategory}
|
|
62
|
-
:Document type: ${this.documentType}
|
|
63
|
-
:Time: ${this.time}
|
|
64
|
-
:Supplier name: ${this.supplier}
|
|
65
|
-
:Taxes: ${this.taxes}
|
|
66
|
-
:Total net: ${this.totalNet}
|
|
67
|
-
:Total tax: ${this.totalTax}
|
|
68
|
-
:Tip: ${this.tip}
|
|
69
|
-
:Total amount: ${this.totalAmount}`;
|
|
70
|
-
return (0, common_1.cleanOutString)(outStr);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.ReceiptV4Document = ReceiptV4Document;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Inference, StringDict, Page } from "../../../parsing/common";
|
|
2
|
-
import { DriverLicenseV1Document } from "./driverLicenseV1Document";
|
|
3
|
-
import { DriverLicenseV1Page } from "./driverLicenseV1Page";
|
|
4
|
-
/**
|
|
5
|
-
* Driver License API version 1 inference prediction.
|
|
6
|
-
*/
|
|
7
|
-
export declare class DriverLicenseV1 extends Inference {
|
|
8
|
-
/** The endpoint's name. */
|
|
9
|
-
endpointName: string;
|
|
10
|
-
/** The endpoint's version. */
|
|
11
|
-
endpointVersion: string;
|
|
12
|
-
/** The document-level prediction. */
|
|
13
|
-
prediction: DriverLicenseV1Document;
|
|
14
|
-
/** The document's pages. */
|
|
15
|
-
pages: Page<DriverLicenseV1Page>[];
|
|
16
|
-
constructor(rawPrediction: StringDict);
|
|
17
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DriverLicenseV1 = void 0;
|
|
4
|
-
const common_1 = require("../../../parsing/common");
|
|
5
|
-
const driverLicenseV1Document_1 = require("./driverLicenseV1Document");
|
|
6
|
-
const driverLicenseV1Page_1 = require("./driverLicenseV1Page");
|
|
7
|
-
/**
|
|
8
|
-
* Driver License API version 1 inference prediction.
|
|
9
|
-
*/
|
|
10
|
-
class DriverLicenseV1 extends common_1.Inference {
|
|
11
|
-
constructor(rawPrediction) {
|
|
12
|
-
super(rawPrediction);
|
|
13
|
-
/** The endpoint's name. */
|
|
14
|
-
this.endpointName = "us_driver_license";
|
|
15
|
-
/** The endpoint's version. */
|
|
16
|
-
this.endpointVersion = "1";
|
|
17
|
-
/** The document's pages. */
|
|
18
|
-
this.pages = [];
|
|
19
|
-
this.prediction = new driverLicenseV1Document_1.DriverLicenseV1Document(rawPrediction["prediction"]);
|
|
20
|
-
rawPrediction["pages"].forEach((page) => {
|
|
21
|
-
if (page.prediction !== undefined && page.prediction !== null &&
|
|
22
|
-
Object.keys(page.prediction).length > 0) {
|
|
23
|
-
this.pages.push(new common_1.Page(driverLicenseV1Page_1.DriverLicenseV1Page, page, page["id"], page["orientation"]));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.DriverLicenseV1 = DriverLicenseV1;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Prediction, StringDict } from "../../../parsing/common";
|
|
2
|
-
import { DateField, StringField } from "../../../parsing/standard";
|
|
3
|
-
/**
|
|
4
|
-
* Driver License API version 1.1 document data.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DriverLicenseV1Document implements Prediction {
|
|
7
|
-
/** US driver license holders address */
|
|
8
|
-
address: StringField;
|
|
9
|
-
/** US driver license holders date of birth */
|
|
10
|
-
dateOfBirth: DateField;
|
|
11
|
-
/** Document Discriminator Number of the US Driver License */
|
|
12
|
-
ddNumber: StringField;
|
|
13
|
-
/** US driver license holders class */
|
|
14
|
-
dlClass: StringField;
|
|
15
|
-
/** ID number of the US Driver License. */
|
|
16
|
-
driverLicenseId: StringField;
|
|
17
|
-
/** US driver license holders endorsements */
|
|
18
|
-
endorsements: StringField;
|
|
19
|
-
/** Date on which the documents expires. */
|
|
20
|
-
expiryDate: DateField;
|
|
21
|
-
/** US driver license holders eye colour */
|
|
22
|
-
eyeColor: StringField;
|
|
23
|
-
/** US driver license holders first name(s) */
|
|
24
|
-
firstName: StringField;
|
|
25
|
-
/** US driver license holders hair colour */
|
|
26
|
-
hairColor: StringField;
|
|
27
|
-
/** US driver license holders hight */
|
|
28
|
-
height: StringField;
|
|
29
|
-
/** Date on which the documents was issued. */
|
|
30
|
-
issuedDate: DateField;
|
|
31
|
-
/** US driver license holders last name */
|
|
32
|
-
lastName: StringField;
|
|
33
|
-
/** US driver license holders restrictions */
|
|
34
|
-
restrictions: StringField;
|
|
35
|
-
/** US driver license holders gender */
|
|
36
|
-
sex: StringField;
|
|
37
|
-
/** US State */
|
|
38
|
-
state: StringField;
|
|
39
|
-
/** US driver license holders weight */
|
|
40
|
-
weight: StringField;
|
|
41
|
-
constructor(rawPrediction: StringDict, pageId?: number);
|
|
42
|
-
/**
|
|
43
|
-
* Default string representation.
|
|
44
|
-
*/
|
|
45
|
-
toString(): string;
|
|
46
|
-
}
|