mindee 4.23.1 → 4.24.1
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 +21 -0
- package/README.md +0 -5
- 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/parsing/common/document.js +4 -1
- package/src/parsing/common/page.js +17 -7
- 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
|
@@ -29,13 +29,15 @@ class Page {
|
|
|
29
29
|
Object.keys(rawPrediction["extras"].length > 0)) {
|
|
30
30
|
const extras = {};
|
|
31
31
|
Object.entries(rawPrediction["extras"]).forEach(([extraKey, extraValue]) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
if (extraValue) {
|
|
33
|
+
switch (extraKey) {
|
|
34
|
+
case "cropper":
|
|
35
|
+
extras["cropper"] = new extras_1.CropperExtra(extraValue);
|
|
36
|
+
break;
|
|
37
|
+
case "full_text_ocr":
|
|
38
|
+
extras["fullTextOcr"] = new extras_1.FullTextOcrExtra(extraValue);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
43
|
this.extras = new extras_2.Extras(extras);
|
|
@@ -58,6 +60,14 @@ ${this.prediction.toString()}
|
|
|
58
60
|
if (!("extras" in rawPrediction) || !("full_text_ocr" in rawPrediction["extras"])) {
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
63
|
+
if (!rawPrediction["extras"]
|
|
64
|
+
|| rawPrediction["extras"] === null ||
|
|
65
|
+
!rawPrediction["extras"]["full_text_ocr"] ||
|
|
66
|
+
rawPrediction["extras"]["full_text_ocr"] === null ||
|
|
67
|
+
!rawPrediction["extras"]["full_text_ocr"]["content"] ||
|
|
68
|
+
rawPrediction["extras"]["full_text_ocr"]["content"] === null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
61
71
|
const fullTextOcr = rawPrediction["extras"]["full_text_ocr"]["content"];
|
|
62
72
|
const artificialTextObj = {
|
|
63
73
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Prediction, StringDict } from "../../parsing/common";
|
|
2
2
|
import { AmountField, DateField, StringField } from "../../parsing/standard";
|
|
3
3
|
/**
|
|
4
|
-
* Delivery note API version 1.
|
|
4
|
+
* Delivery note API version 1.2 document data.
|
|
5
5
|
*/
|
|
6
6
|
export declare class DeliveryNoteV1Document implements Prediction {
|
|
7
7
|
/** The address of the customer receiving the goods. */
|
|
@@ -4,7 +4,7 @@ exports.DeliveryNoteV1Document = void 0;
|
|
|
4
4
|
const common_1 = require("../../parsing/common");
|
|
5
5
|
const standard_1 = require("../../parsing/standard");
|
|
6
6
|
/**
|
|
7
|
-
* Delivery note API version 1.
|
|
7
|
+
* Delivery note API version 1.2 document data.
|
|
8
8
|
*/
|
|
9
9
|
class DeliveryNoteV1Document {
|
|
10
10
|
constructor(rawPrediction, pageId) {
|
|
@@ -7,11 +7,11 @@ import { AmountField, ClassificationField, CompanyRegistrationField, DateField,
|
|
|
7
7
|
export declare class FinancialDocumentV1Document implements Prediction {
|
|
8
8
|
/** The customer's address used for billing. */
|
|
9
9
|
billingAddress: StringField;
|
|
10
|
-
/** The purchase category
|
|
10
|
+
/** The purchase category, only for receipts. */
|
|
11
11
|
category: ClassificationField;
|
|
12
12
|
/** The address of the customer. */
|
|
13
13
|
customerAddress: StringField;
|
|
14
|
-
/** List of company
|
|
14
|
+
/** List of company registration numbers associated to the customer. */
|
|
15
15
|
customerCompanyRegistrations: CompanyRegistrationField[];
|
|
16
16
|
/** The customer account number or identifier from the supplier. */
|
|
17
17
|
customerId: StringField;
|
|
@@ -19,47 +19,50 @@ export declare class FinancialDocumentV1Document implements Prediction {
|
|
|
19
19
|
customerName: StringField;
|
|
20
20
|
/** The date the purchase was made. */
|
|
21
21
|
date: DateField;
|
|
22
|
-
/** The document number or identifier. */
|
|
22
|
+
/** The document number or identifier (invoice number or receipt number). */
|
|
23
23
|
documentNumber: StringField;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The type of the document: INVOICE or CREDIT NOTE if it is an invoice, CREDIT CARD RECEIPT or EXPENSE RECEIPT if it
|
|
26
|
+
* is a receipt.
|
|
27
|
+
*/
|
|
25
28
|
documentType: ClassificationField;
|
|
26
29
|
/** The date on which the payment is due. */
|
|
27
30
|
dueDate: DateField;
|
|
28
31
|
/** The invoice number or identifier only if document is an invoice. */
|
|
29
32
|
invoiceNumber: StringField;
|
|
30
|
-
/** List of line item
|
|
33
|
+
/** List of line item present on the document. */
|
|
31
34
|
lineItems: FinancialDocumentV1LineItem[];
|
|
32
|
-
/** The locale
|
|
35
|
+
/** The locale of the document. */
|
|
33
36
|
locale: LocaleField;
|
|
34
37
|
/** The date on which the payment is due / fullfilled. */
|
|
35
38
|
paymentDate: DateField;
|
|
36
|
-
/** The purchase order number. */
|
|
39
|
+
/** The purchase order number, only if the document is an invoice. */
|
|
37
40
|
poNumber: StringField;
|
|
38
41
|
/** The receipt number or identifier only if document is a receipt. */
|
|
39
42
|
receiptNumber: StringField;
|
|
40
|
-
/** List of Reference numbers, including PO number. */
|
|
43
|
+
/** List of Reference numbers, including PO number, only if the document is an invoice. */
|
|
41
44
|
referenceNumbers: StringField[];
|
|
42
45
|
/** The customer's address used for shipping. */
|
|
43
46
|
shippingAddress: StringField;
|
|
44
|
-
/** The purchase subcategory
|
|
47
|
+
/** The purchase subcategory for transport and food, only for receipts. */
|
|
45
48
|
subcategory: ClassificationField;
|
|
46
49
|
/** The address of the supplier or merchant. */
|
|
47
50
|
supplierAddress: StringField;
|
|
48
|
-
/** List of company
|
|
51
|
+
/** List of company registration numbers associated to the supplier. */
|
|
49
52
|
supplierCompanyRegistrations: CompanyRegistrationField[];
|
|
50
53
|
/** The email of the supplier or merchant. */
|
|
51
54
|
supplierEmail: StringField;
|
|
52
55
|
/** The name of the supplier or merchant. */
|
|
53
56
|
supplierName: StringField;
|
|
54
|
-
/** List of payment details associated to the supplier. */
|
|
57
|
+
/** List of payment details associated to the supplier (only for invoices). */
|
|
55
58
|
supplierPaymentDetails: PaymentDetailsField[];
|
|
56
59
|
/** The phone number of the supplier or merchant. */
|
|
57
60
|
supplierPhoneNumber: StringField;
|
|
58
61
|
/** The website URL of the supplier or merchant. */
|
|
59
62
|
supplierWebsite: StringField;
|
|
60
|
-
/** List of
|
|
63
|
+
/** List of all taxes on the document. */
|
|
61
64
|
taxes: Taxes;
|
|
62
|
-
/** The time the purchase was made. */
|
|
65
|
+
/** The time the purchase was made (only for receipts). */
|
|
63
66
|
time: StringField;
|
|
64
67
|
/** The total amount of tip and gratuity */
|
|
65
68
|
tip: AmountField;
|
|
@@ -67,7 +70,7 @@ export declare class FinancialDocumentV1Document implements Prediction {
|
|
|
67
70
|
totalAmount: AmountField;
|
|
68
71
|
/** The net amount paid: does not include taxes, fees, and discounts. */
|
|
69
72
|
totalNet: AmountField;
|
|
70
|
-
/** The
|
|
73
|
+
/** The sum of all taxes present on the document. */
|
|
71
74
|
totalTax: AmountField;
|
|
72
75
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
73
76
|
/**
|
|
@@ -9,15 +9,15 @@ const standard_1 = require("../../parsing/standard");
|
|
|
9
9
|
*/
|
|
10
10
|
class FinancialDocumentV1Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
12
|
-
/** List of company
|
|
12
|
+
/** List of company registration numbers associated to the customer. */
|
|
13
13
|
this.customerCompanyRegistrations = [];
|
|
14
|
-
/** List of line item
|
|
14
|
+
/** List of line item present on the document. */
|
|
15
15
|
this.lineItems = [];
|
|
16
|
-
/** List of Reference numbers, including PO number. */
|
|
16
|
+
/** List of Reference numbers, including PO number, only if the document is an invoice. */
|
|
17
17
|
this.referenceNumbers = [];
|
|
18
|
-
/** List of company
|
|
18
|
+
/** List of company registration numbers associated to the supplier. */
|
|
19
19
|
this.supplierCompanyRegistrations = [];
|
|
20
|
-
/** List of payment details associated to the supplier. */
|
|
20
|
+
/** List of payment details associated to the supplier (only for invoices). */
|
|
21
21
|
this.supplierPaymentDetails = [];
|
|
22
22
|
this.billingAddress = new standard_1.StringField({
|
|
23
23
|
prediction: rawPrediction["billing_address"],
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.FinancialDocumentV1LineItem = void 0;
|
|
10
10
|
const common_1 = require("../../parsing/common");
|
|
11
11
|
/**
|
|
12
|
-
* List of line item
|
|
12
|
+
* List of line item present on the document.
|
|
13
13
|
*/
|
|
14
14
|
class FinancialDocumentV1LineItem {
|
|
15
15
|
constructor({ prediction = {} }) {
|
|
@@ -7,7 +7,7 @@ import { EnergyBillV1TaxesAndContribution } from "./energyBillV1TaxesAndContribu
|
|
|
7
7
|
import { EnergyBillV1MeterDetail } from "./energyBillV1MeterDetail";
|
|
8
8
|
import { AmountField, DateField, StringField } from "../../../parsing/standard";
|
|
9
9
|
/**
|
|
10
|
-
* Energy Bill API version 1.
|
|
10
|
+
* Energy Bill API version 1.2 document data.
|
|
11
11
|
*/
|
|
12
12
|
export declare class EnergyBillV1Document implements Prediction {
|
|
13
13
|
/** The unique identifier associated with a specific contract. */
|
|
@@ -10,7 +10,7 @@ const energyBillV1TaxesAndContribution_1 = require("./energyBillV1TaxesAndContri
|
|
|
10
10
|
const energyBillV1MeterDetail_1 = require("./energyBillV1MeterDetail");
|
|
11
11
|
const standard_1 = require("../../../parsing/standard");
|
|
12
12
|
/**
|
|
13
|
-
* Energy Bill API version 1.
|
|
13
|
+
* Energy Bill API version 1.2 document data.
|
|
14
14
|
*/
|
|
15
15
|
class EnergyBillV1Document {
|
|
16
16
|
constructor(rawPrediction, pageId) {
|
|
@@ -99,13 +99,15 @@ class EnergyBillV1Document {
|
|
|
99
99
|
}
|
|
100
100
|
let energyUsageSummary = "";
|
|
101
101
|
if (this.energyUsage && this.energyUsage.length > 0) {
|
|
102
|
-
const energyUsageColSizes = [38, 12, 12, 10, 11, 12];
|
|
102
|
+
const energyUsageColSizes = [13, 38, 12, 12, 10, 11, 17, 12];
|
|
103
103
|
energyUsageSummary += "\n" + (0, common_1.lineSeparator)(energyUsageColSizes, "-") + "\n ";
|
|
104
|
+
energyUsageSummary += "| Consumption ";
|
|
104
105
|
energyUsageSummary += "| Description ";
|
|
105
106
|
energyUsageSummary += "| End Date ";
|
|
106
107
|
energyUsageSummary += "| Start Date ";
|
|
107
108
|
energyUsageSummary += "| Tax Rate ";
|
|
108
109
|
energyUsageSummary += "| Total ";
|
|
110
|
+
energyUsageSummary += "| Unit of Measure ";
|
|
109
111
|
energyUsageSummary += "| Unit Price ";
|
|
110
112
|
energyUsageSummary += "|\n" + (0, common_1.lineSeparator)(energyUsageColSizes, "=");
|
|
111
113
|
energyUsageSummary += this.energyUsage.map((item) => "\n " + item.toTableLine() + "\n" + (0, common_1.lineSeparator)(energyUsageColSizes, "-")).join("");
|
|
@@ -5,6 +5,8 @@ import { Polygon } from "../../../geometry";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class EnergyBillV1EnergyUsage {
|
|
7
7
|
#private;
|
|
8
|
+
/** The price per unit of energy consumed. */
|
|
9
|
+
consumption: number | null;
|
|
8
10
|
/** Description or details of the energy usage. */
|
|
9
11
|
description: string | null;
|
|
10
12
|
/** The end date of the energy usage. */
|
|
@@ -15,6 +17,8 @@ export declare class EnergyBillV1EnergyUsage {
|
|
|
15
17
|
taxRate: number | null;
|
|
16
18
|
/** The total cost of energy consumed. */
|
|
17
19
|
total: number | null;
|
|
20
|
+
/** The unit of measurement for energy consumption. */
|
|
21
|
+
unit: string | null;
|
|
18
22
|
/** The price per unit of energy consumed. */
|
|
19
23
|
unitPrice: number | null;
|
|
20
24
|
/** Confidence score */
|
|
@@ -21,6 +21,14 @@ class EnergyBillV1EnergyUsage {
|
|
|
21
21
|
* the field in the document.
|
|
22
22
|
*/
|
|
23
23
|
this.polygon = [];
|
|
24
|
+
if (prediction["consumption"] !== undefined &&
|
|
25
|
+
prediction["consumption"] !== null &&
|
|
26
|
+
!isNaN(prediction["consumption"])) {
|
|
27
|
+
this.consumption = +parseFloat(prediction["consumption"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.consumption = null;
|
|
31
|
+
}
|
|
24
32
|
this.description = prediction["description"];
|
|
25
33
|
this.endDate = prediction["end_date"];
|
|
26
34
|
this.startDate = prediction["start_date"];
|
|
@@ -40,6 +48,7 @@ class EnergyBillV1EnergyUsage {
|
|
|
40
48
|
else {
|
|
41
49
|
this.total = null;
|
|
42
50
|
}
|
|
51
|
+
this.unit = prediction["unit"];
|
|
43
52
|
if (prediction["unit_price"] !== undefined &&
|
|
44
53
|
prediction["unit_price"] !== null &&
|
|
45
54
|
!isNaN(prediction["unit_price"])) {
|
|
@@ -59,7 +68,9 @@ class EnergyBillV1EnergyUsage {
|
|
|
59
68
|
*/
|
|
60
69
|
toString() {
|
|
61
70
|
const printable = __classPrivateFieldGet(this, _EnergyBillV1EnergyUsage_instances, "m", _EnergyBillV1EnergyUsage_printableValues).call(this);
|
|
62
|
-
return ("
|
|
71
|
+
return ("Consumption: " +
|
|
72
|
+
printable.consumption +
|
|
73
|
+
", Description: " +
|
|
63
74
|
printable.description +
|
|
64
75
|
", End Date: " +
|
|
65
76
|
printable.endDate +
|
|
@@ -69,6 +80,8 @@ class EnergyBillV1EnergyUsage {
|
|
|
69
80
|
printable.taxRate +
|
|
70
81
|
", Total: " +
|
|
71
82
|
printable.total +
|
|
83
|
+
", Unit of Measure: " +
|
|
84
|
+
printable.unit +
|
|
72
85
|
", Unit Price: " +
|
|
73
86
|
printable.unitPrice);
|
|
74
87
|
}
|
|
@@ -78,6 +91,8 @@ class EnergyBillV1EnergyUsage {
|
|
|
78
91
|
toTableLine() {
|
|
79
92
|
const printable = __classPrivateFieldGet(this, _EnergyBillV1EnergyUsage_instances, "m", _EnergyBillV1EnergyUsage_printableValues).call(this);
|
|
80
93
|
return ("| " +
|
|
94
|
+
printable.consumption.padEnd(11) +
|
|
95
|
+
" | " +
|
|
81
96
|
printable.description.padEnd(36) +
|
|
82
97
|
" | " +
|
|
83
98
|
printable.endDate.padEnd(10) +
|
|
@@ -88,6 +103,8 @@ class EnergyBillV1EnergyUsage {
|
|
|
88
103
|
" | " +
|
|
89
104
|
printable.total.padEnd(9) +
|
|
90
105
|
" | " +
|
|
106
|
+
printable.unit.padEnd(15) +
|
|
107
|
+
" | " +
|
|
91
108
|
printable.unitPrice.padEnd(10) +
|
|
92
109
|
" |");
|
|
93
110
|
}
|
|
@@ -95,6 +112,7 @@ class EnergyBillV1EnergyUsage {
|
|
|
95
112
|
exports.EnergyBillV1EnergyUsage = EnergyBillV1EnergyUsage;
|
|
96
113
|
_EnergyBillV1EnergyUsage_instances = new WeakSet(), _EnergyBillV1EnergyUsage_printableValues = function _EnergyBillV1EnergyUsage_printableValues() {
|
|
97
114
|
return {
|
|
115
|
+
consumption: this.consumption !== undefined ? (0, common_1.floatToString)(this.consumption) : "",
|
|
98
116
|
description: this.description ?
|
|
99
117
|
this.description.length <= 36 ?
|
|
100
118
|
(0, common_1.cleanSpecialChars)(this.description) :
|
|
@@ -112,6 +130,11 @@ _EnergyBillV1EnergyUsage_instances = new WeakSet(), _EnergyBillV1EnergyUsage_pri
|
|
|
112
130
|
"",
|
|
113
131
|
taxRate: this.taxRate !== undefined ? (0, common_1.floatToString)(this.taxRate) : "",
|
|
114
132
|
total: this.total !== undefined ? (0, common_1.floatToString)(this.total) : "",
|
|
133
|
+
unit: this.unit ?
|
|
134
|
+
this.unit.length <= 15 ?
|
|
135
|
+
(0, common_1.cleanSpecialChars)(this.unit) :
|
|
136
|
+
(0, common_1.cleanSpecialChars)(this.unit).slice(0, 12) + "..." :
|
|
137
|
+
"",
|
|
115
138
|
unitPrice: this.unitPrice !== undefined ? (0, common_1.floatToString)(this.unitPrice) : "",
|
|
116
139
|
};
|
|
117
140
|
};
|
|
@@ -9,7 +9,7 @@ export declare class EnergyBillV1MeterDetail {
|
|
|
9
9
|
meterNumber: string | null;
|
|
10
10
|
/** The type of energy meter. */
|
|
11
11
|
meterType: string | null;
|
|
12
|
-
/** The unit of
|
|
12
|
+
/** The unit of power for energy consumption. */
|
|
13
13
|
unit: string | null;
|
|
14
14
|
/** Confidence score */
|
|
15
15
|
confidence: number;
|
|
@@ -38,7 +38,7 @@ class EnergyBillV1MeterDetail {
|
|
|
38
38
|
printable.meterNumber +
|
|
39
39
|
", Meter Type: " +
|
|
40
40
|
printable.meterType +
|
|
41
|
-
", Unit of
|
|
41
|
+
", Unit of Power: " +
|
|
42
42
|
printable.unit);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
@@ -49,7 +49,7 @@ class EnergyBillV1MeterDetail {
|
|
|
49
49
|
return `
|
|
50
50
|
:Meter Number: ${printable.meterNumber}
|
|
51
51
|
:Meter Type: ${printable.meterType}
|
|
52
|
-
:Unit of
|
|
52
|
+
:Unit of Power: ${printable.unit}`.trimEnd();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
exports.EnergyBillV1MeterDetail = EnergyBillV1MeterDetail;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as bankAccountDetails from "./bankAccountDetails/internal";
|
|
2
2
|
export * as carteGrise from "./carteGrise/internal";
|
|
3
3
|
export * as energyBill from "./energyBill/internal";
|
|
4
|
-
export * as
|
|
4
|
+
export * as healthCard from "./healthCard/internal";
|
|
5
5
|
export * as idCard from "./idCard/internal";
|
|
6
6
|
export * as payslip from "./payslip/internal";
|
|
@@ -23,10 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.payslip = exports.idCard = exports.
|
|
26
|
+
exports.payslip = exports.idCard = exports.healthCard = exports.energyBill = exports.carteGrise = exports.bankAccountDetails = void 0;
|
|
27
27
|
exports.bankAccountDetails = __importStar(require("./bankAccountDetails/internal"));
|
|
28
28
|
exports.carteGrise = __importStar(require("./carteGrise/internal"));
|
|
29
29
|
exports.energyBill = __importStar(require("./energyBill/internal"));
|
|
30
|
-
exports.
|
|
30
|
+
exports.healthCard = __importStar(require("./healthCard/internal"));
|
|
31
31
|
exports.idCard = __importStar(require("./idCard/internal"));
|
|
32
32
|
exports.payslip = __importStar(require("./payslip/internal"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as indianPassport from "./indianPassport/internal";
|
|
@@ -23,5 +23,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.indianPassport = void 0;
|
|
27
|
+
exports.indianPassport = __importStar(require("./indianPassport/internal"));
|
package/src/product/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * as fr from "./fr";
|
|
2
|
+
export * as ind from "./ind";
|
|
3
|
+
export * as us from "./us";
|
|
1
4
|
export { BarcodeReaderV1 } from "./barcodeReader/barcodeReaderV1";
|
|
2
5
|
export { BillOfLadingV1 } from "./billOfLading/billOfLadingV1";
|
|
3
6
|
export { BusinessCardV1 } from "./businessCard/businessCardV1";
|
|
@@ -8,16 +11,10 @@ export { DriverLicenseV1 } from "./driverLicense/driverLicenseV1";
|
|
|
8
11
|
export { FinancialDocumentV1 } from "./financialDocument/financialDocumentV1";
|
|
9
12
|
export { GeneratedV1 } from "./generated/generatedV1";
|
|
10
13
|
export { InternationalIdV2 } from "./internationalId/internationalIdV2";
|
|
11
|
-
export { InvoiceV4 } from "./invoice/invoiceV4";
|
|
12
14
|
export { InvoiceSplitterV1 } from "./invoiceSplitter/invoiceSplitterV1";
|
|
15
|
+
export { InvoiceV4 } from "./invoice/invoiceV4";
|
|
13
16
|
export { MultiReceiptsDetectorV1 } from "./multiReceiptsDetector/multiReceiptsDetectorV1";
|
|
14
17
|
export { NutritionFactsLabelV1 } from "./nutritionFactsLabel/nutritionFactsLabelV1";
|
|
15
18
|
export { PassportV1 } from "./passport/passportV1";
|
|
16
|
-
export { ProofOfAddressV1 } from "./proofOfAddress/proofOfAddressV1";
|
|
17
|
-
export { ReceiptV4 } from "./receipt/receiptV4";
|
|
18
19
|
export { ReceiptV5 } from "./receipt/receiptV5";
|
|
19
20
|
export { ResumeV1 } from "./resume/resumeV1";
|
|
20
|
-
export * as eu from "./eu";
|
|
21
|
-
export * as fr from "./fr";
|
|
22
|
-
export * as ind from "./ind";
|
|
23
|
-
export * as us from "./us";
|
package/src/product/index.js
CHANGED
|
@@ -23,7 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.ResumeV1 = exports.ReceiptV5 = exports.PassportV1 = exports.NutritionFactsLabelV1 = exports.MultiReceiptsDetectorV1 = exports.InvoiceV4 = exports.InvoiceSplitterV1 = exports.InternationalIdV2 = exports.GeneratedV1 = exports.FinancialDocumentV1 = exports.DriverLicenseV1 = exports.DeliveryNoteV1 = exports.CustomV1 = exports.CropperV1 = exports.BusinessCardV1 = exports.BillOfLadingV1 = exports.BarcodeReaderV1 = exports.us = exports.ind = exports.fr = void 0;
|
|
27
|
+
exports.fr = __importStar(require("./fr"));
|
|
28
|
+
exports.ind = __importStar(require("./ind"));
|
|
29
|
+
exports.us = __importStar(require("./us"));
|
|
27
30
|
var barcodeReaderV1_1 = require("./barcodeReader/barcodeReaderV1");
|
|
28
31
|
Object.defineProperty(exports, "BarcodeReaderV1", { enumerable: true, get: function () { return barcodeReaderV1_1.BarcodeReaderV1; } });
|
|
29
32
|
var billOfLadingV1_1 = require("./billOfLading/billOfLadingV1");
|
|
@@ -44,25 +47,17 @@ var generatedV1_1 = require("./generated/generatedV1");
|
|
|
44
47
|
Object.defineProperty(exports, "GeneratedV1", { enumerable: true, get: function () { return generatedV1_1.GeneratedV1; } });
|
|
45
48
|
var internationalIdV2_1 = require("./internationalId/internationalIdV2");
|
|
46
49
|
Object.defineProperty(exports, "InternationalIdV2", { enumerable: true, get: function () { return internationalIdV2_1.InternationalIdV2; } });
|
|
47
|
-
var invoiceV4_1 = require("./invoice/invoiceV4");
|
|
48
|
-
Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
|
|
49
50
|
var invoiceSplitterV1_1 = require("./invoiceSplitter/invoiceSplitterV1");
|
|
50
51
|
Object.defineProperty(exports, "InvoiceSplitterV1", { enumerable: true, get: function () { return invoiceSplitterV1_1.InvoiceSplitterV1; } });
|
|
52
|
+
var invoiceV4_1 = require("./invoice/invoiceV4");
|
|
53
|
+
Object.defineProperty(exports, "InvoiceV4", { enumerable: true, get: function () { return invoiceV4_1.InvoiceV4; } });
|
|
51
54
|
var multiReceiptsDetectorV1_1 = require("./multiReceiptsDetector/multiReceiptsDetectorV1");
|
|
52
55
|
Object.defineProperty(exports, "MultiReceiptsDetectorV1", { enumerable: true, get: function () { return multiReceiptsDetectorV1_1.MultiReceiptsDetectorV1; } });
|
|
53
56
|
var nutritionFactsLabelV1_1 = require("./nutritionFactsLabel/nutritionFactsLabelV1");
|
|
54
57
|
Object.defineProperty(exports, "NutritionFactsLabelV1", { enumerable: true, get: function () { return nutritionFactsLabelV1_1.NutritionFactsLabelV1; } });
|
|
55
58
|
var passportV1_1 = require("./passport/passportV1");
|
|
56
59
|
Object.defineProperty(exports, "PassportV1", { enumerable: true, get: function () { return passportV1_1.PassportV1; } });
|
|
57
|
-
var proofOfAddressV1_1 = require("./proofOfAddress/proofOfAddressV1");
|
|
58
|
-
Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return proofOfAddressV1_1.ProofOfAddressV1; } });
|
|
59
|
-
var receiptV4_1 = require("./receipt/receiptV4");
|
|
60
|
-
Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return receiptV4_1.ReceiptV4; } });
|
|
61
60
|
var receiptV5_1 = require("./receipt/receiptV5");
|
|
62
61
|
Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return receiptV5_1.ReceiptV5; } });
|
|
63
62
|
var resumeV1_1 = require("./resume/resumeV1");
|
|
64
63
|
Object.defineProperty(exports, "ResumeV1", { enumerable: true, get: function () { return resumeV1_1.ResumeV1; } });
|
|
65
|
-
exports.eu = __importStar(require("./eu"));
|
|
66
|
-
exports.fr = __importStar(require("./fr"));
|
|
67
|
-
exports.ind = __importStar(require("./ind"));
|
|
68
|
-
exports.us = __importStar(require("./us"));
|
|
@@ -5,17 +5,16 @@ export * as cropper from "./cropper/internal";
|
|
|
5
5
|
export * as custom from "./custom/internal";
|
|
6
6
|
export * as deliveryNote from "./deliveryNote/internal";
|
|
7
7
|
export * as driverLicense from "./driverLicense/internal";
|
|
8
|
-
export * as eu from "./eu/internal";
|
|
9
8
|
export * as financialDocument from "./financialDocument/internal";
|
|
10
9
|
export * as fr from "./fr/internal";
|
|
11
10
|
export * as generated from "./generated/internal";
|
|
11
|
+
export * as ind from "./ind/internal";
|
|
12
12
|
export * as internationalId from "./internationalId/internal";
|
|
13
13
|
export * as invoice from "./invoice/internal";
|
|
14
14
|
export * as invoiceSplitter from "./invoiceSplitter/internal";
|
|
15
15
|
export * as multiReceiptsDetector from "./multiReceiptsDetector/internal";
|
|
16
16
|
export * as nutritionFactsLabel from "./nutritionFactsLabel/internal";
|
|
17
17
|
export * as passport from "./passport/internal";
|
|
18
|
-
export * as proofOfAddress from "./proofOfAddress/internal";
|
|
19
18
|
export * as receipt from "./receipt/internal";
|
|
20
19
|
export * as resume from "./resume/internal";
|
|
21
20
|
export * as us from "./us/internal";
|
package/src/product/internal.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.us = exports.resume = exports.receipt = exports.
|
|
26
|
+
exports.us = exports.resume = exports.receipt = exports.passport = exports.nutritionFactsLabel = exports.multiReceiptsDetector = exports.invoiceSplitter = exports.invoice = exports.internationalId = exports.ind = exports.generated = exports.fr = exports.financialDocument = exports.driverLicense = exports.deliveryNote = exports.custom = exports.cropper = exports.businessCard = exports.billOfLading = exports.barcodeReader = void 0;
|
|
27
27
|
exports.barcodeReader = __importStar(require("./barcodeReader/internal"));
|
|
28
28
|
exports.billOfLading = __importStar(require("./billOfLading/internal"));
|
|
29
29
|
exports.businessCard = __importStar(require("./businessCard/internal"));
|
|
@@ -31,17 +31,16 @@ exports.cropper = __importStar(require("./cropper/internal"));
|
|
|
31
31
|
exports.custom = __importStar(require("./custom/internal"));
|
|
32
32
|
exports.deliveryNote = __importStar(require("./deliveryNote/internal"));
|
|
33
33
|
exports.driverLicense = __importStar(require("./driverLicense/internal"));
|
|
34
|
-
exports.eu = __importStar(require("./eu/internal"));
|
|
35
34
|
exports.financialDocument = __importStar(require("./financialDocument/internal"));
|
|
36
35
|
exports.fr = __importStar(require("./fr/internal"));
|
|
37
36
|
exports.generated = __importStar(require("./generated/internal"));
|
|
37
|
+
exports.ind = __importStar(require("./ind/internal"));
|
|
38
38
|
exports.internationalId = __importStar(require("./internationalId/internal"));
|
|
39
39
|
exports.invoice = __importStar(require("./invoice/internal"));
|
|
40
40
|
exports.invoiceSplitter = __importStar(require("./invoiceSplitter/internal"));
|
|
41
41
|
exports.multiReceiptsDetector = __importStar(require("./multiReceiptsDetector/internal"));
|
|
42
42
|
exports.nutritionFactsLabel = __importStar(require("./nutritionFactsLabel/internal"));
|
|
43
43
|
exports.passport = __importStar(require("./passport/internal"));
|
|
44
|
-
exports.proofOfAddress = __importStar(require("./proofOfAddress/internal"));
|
|
45
44
|
exports.receipt = __importStar(require("./receipt/internal"));
|
|
46
45
|
exports.resume = __importStar(require("./resume/internal"));
|
|
47
46
|
exports.us = __importStar(require("./us/internal"));
|
|
@@ -5,11 +5,11 @@ import { AmountField, ClassificationField, CompanyRegistrationField, DateField,
|
|
|
5
5
|
* Invoice API version 4.9 document data.
|
|
6
6
|
*/
|
|
7
7
|
export declare class InvoiceV4Document implements Prediction {
|
|
8
|
-
/** The customer
|
|
8
|
+
/** The customer billing address. */
|
|
9
9
|
billingAddress: StringField;
|
|
10
10
|
/** The address of the customer. */
|
|
11
11
|
customerAddress: StringField;
|
|
12
|
-
/** List of company
|
|
12
|
+
/** List of company registration numbers associated to the customer. */
|
|
13
13
|
customerCompanyRegistrations: CompanyRegistrationField[];
|
|
14
14
|
/** The customer account number or identifier from the supplier. */
|
|
15
15
|
customerId: StringField;
|
|
@@ -17,45 +17,45 @@ export declare class InvoiceV4Document implements Prediction {
|
|
|
17
17
|
customerName: StringField;
|
|
18
18
|
/** The date the purchase was made. */
|
|
19
19
|
date: DateField;
|
|
20
|
-
/**
|
|
20
|
+
/** Document type: INVOICE or CREDIT NOTE. */
|
|
21
21
|
documentType: ClassificationField;
|
|
22
22
|
/** The date on which the payment is due. */
|
|
23
23
|
dueDate: DateField;
|
|
24
24
|
/** The invoice number or identifier. */
|
|
25
25
|
invoiceNumber: StringField;
|
|
26
|
-
/** List of line
|
|
26
|
+
/** List of all the line items present on the invoice. */
|
|
27
27
|
lineItems: InvoiceV4LineItem[];
|
|
28
|
-
/** The locale
|
|
28
|
+
/** The locale of the document. */
|
|
29
29
|
locale: LocaleField;
|
|
30
|
-
/** The date on which the payment is due/ was full-filled. */
|
|
30
|
+
/** The date on which the payment is due / was full-filled. */
|
|
31
31
|
paymentDate: DateField;
|
|
32
32
|
/** The purchase order number. */
|
|
33
33
|
poNumber: StringField;
|
|
34
|
-
/** List of
|
|
34
|
+
/** List of all reference numbers on the invoice, including the purchase order number. */
|
|
35
35
|
referenceNumbers: StringField[];
|
|
36
36
|
/** Customer's delivery address. */
|
|
37
37
|
shippingAddress: StringField;
|
|
38
38
|
/** The address of the supplier or merchant. */
|
|
39
39
|
supplierAddress: StringField;
|
|
40
|
-
/** List of company
|
|
40
|
+
/** List of company registration numbers associated to the supplier. */
|
|
41
41
|
supplierCompanyRegistrations: CompanyRegistrationField[];
|
|
42
|
-
/** The email of the supplier or merchant. */
|
|
42
|
+
/** The email address of the supplier or merchant. */
|
|
43
43
|
supplierEmail: StringField;
|
|
44
44
|
/** The name of the supplier or merchant. */
|
|
45
45
|
supplierName: StringField;
|
|
46
|
-
/** List of payment details associated to the supplier. */
|
|
46
|
+
/** List of payment details associated to the supplier of the invoice. */
|
|
47
47
|
supplierPaymentDetails: PaymentDetailsField[];
|
|
48
48
|
/** The phone number of the supplier or merchant. */
|
|
49
49
|
supplierPhoneNumber: StringField;
|
|
50
50
|
/** The website URL of the supplier or merchant. */
|
|
51
51
|
supplierWebsite: StringField;
|
|
52
|
-
/** List of
|
|
52
|
+
/** List of taxes. Each item contains the detail of the tax. */
|
|
53
53
|
taxes: Taxes;
|
|
54
|
-
/** The total amount
|
|
54
|
+
/** The total amount of the invoice: includes taxes, tips, fees, and other charges. */
|
|
55
55
|
totalAmount: AmountField;
|
|
56
|
-
/** The net amount
|
|
56
|
+
/** The net amount of the invoice: does not include taxes, fees, and discounts. */
|
|
57
57
|
totalNet: AmountField;
|
|
58
|
-
/** The total tax:
|
|
58
|
+
/** The total tax: the sum of all the taxes for this invoice. */
|
|
59
59
|
totalTax: AmountField;
|
|
60
60
|
constructor(rawPrediction: StringDict, pageId?: number);
|
|
61
61
|
/**
|
|
@@ -9,15 +9,15 @@ const standard_1 = require("../../parsing/standard");
|
|
|
9
9
|
*/
|
|
10
10
|
class InvoiceV4Document {
|
|
11
11
|
constructor(rawPrediction, pageId) {
|
|
12
|
-
/** List of company
|
|
12
|
+
/** List of company registration numbers associated to the customer. */
|
|
13
13
|
this.customerCompanyRegistrations = [];
|
|
14
|
-
/** List of line
|
|
14
|
+
/** List of all the line items present on the invoice. */
|
|
15
15
|
this.lineItems = [];
|
|
16
|
-
/** List of
|
|
16
|
+
/** List of all reference numbers on the invoice, including the purchase order number. */
|
|
17
17
|
this.referenceNumbers = [];
|
|
18
|
-
/** List of company
|
|
18
|
+
/** List of company registration numbers associated to the supplier. */
|
|
19
19
|
this.supplierCompanyRegistrations = [];
|
|
20
|
-
/** List of payment details associated to the supplier. */
|
|
20
|
+
/** List of payment details associated to the supplier of the invoice. */
|
|
21
21
|
this.supplierPaymentDetails = [];
|
|
22
22
|
this.billingAddress = new standard_1.StringField({
|
|
23
23
|
prediction: rawPrediction["billing_address"],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { StringDict } from "../../parsing/common";
|
|
2
2
|
import { Polygon } from "../../geometry";
|
|
3
3
|
/**
|
|
4
|
-
* List of line
|
|
4
|
+
* List of all the line items present on the invoice.
|
|
5
5
|
*/
|
|
6
6
|
export declare class InvoiceV4LineItem {
|
|
7
7
|
#private;
|
|
8
8
|
/** The item description. */
|
|
9
9
|
description: string | null;
|
|
10
|
-
/** The product code
|
|
10
|
+
/** The product code of the item. */
|
|
11
11
|
productCode: string | null;
|
|
12
12
|
/** The item quantity */
|
|
13
13
|
quantity: number | null;
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.InvoiceV4LineItem = void 0;
|
|
10
10
|
const common_1 = require("../../parsing/common");
|
|
11
11
|
/**
|
|
12
|
-
* List of line
|
|
12
|
+
* List of all the line items present on the invoice.
|
|
13
13
|
*/
|
|
14
14
|
class InvoiceV4LineItem {
|
|
15
15
|
constructor({ prediction = {} }) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InvoiceSplitterV1 } from "./invoiceSplitterV1";
|