mindee 3.8.0 → 3.10.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 +18 -0
- package/package.json +1 -1
- package/src/cli.js +0 -10
- package/src/client.js +3 -3
- package/src/documents/documentConfig.js +2 -2
- package/src/documents/financialDocument/financialDocumentV1.d.ts +39 -36
- package/src/documents/financialDocument/financialDocumentV1.js +120 -89
- package/src/documents/financialDocument/financialDocumentV1LineItem.d.ts +40 -0
- package/src/documents/financialDocument/financialDocumentV1LineItem.js +107 -0
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +18 -0
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2.js +48 -0
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +34 -0
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +67 -0
- package/src/documents/fr/index.d.ts +1 -0
- package/src/documents/fr/index.js +3 -1
- package/src/documents/index.d.ts +0 -1
- package/src/documents/index.js +1 -3
- package/src/documents/receipt/receiptV5.d.ts +25 -25
- package/src/documents/receipt/receiptV5.js +46 -44
- package/src/documents/receipt/receiptV5LineItem.d.ts +19 -1
- package/src/documents/receipt/receiptV5LineItem.js +50 -9
- package/src/fields/amount.d.ts +3 -0
- package/src/fields/amount.js +3 -0
- package/src/fields/base.d.ts +3 -0
- package/src/fields/base.js +3 -0
- package/src/fields/classification.d.ts +3 -0
- package/src/fields/classification.js +3 -0
- package/src/fields/companyRegistration.d.ts +3 -0
- package/src/fields/companyRegistration.js +3 -0
- package/src/fields/date.d.ts +3 -0
- package/src/fields/date.js +3 -0
- package/src/fields/field.d.ts +3 -0
- package/src/fields/field.js +3 -0
- package/src/fields/fullText.d.ts +3 -0
- package/src/fields/fullText.js +3 -0
- package/src/fields/locale.d.ts +4 -1
- package/src/fields/locale.js +5 -1
- package/src/fields/orientation.d.ts +3 -0
- package/src/fields/orientation.js +3 -0
- package/src/fields/paymentDetails.d.ts +8 -5
- package/src/fields/paymentDetails.js +3 -0
- package/src/fields/position.d.ts +3 -0
- package/src/fields/position.js +3 -0
- package/src/fields/tax.d.ts +12 -0
- package/src/fields/tax.js +12 -0
- package/src/fields/text.d.ts +3 -0
- package/src/fields/text.js +3 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -2
- package/src/documents/shippingContainer/shippingContainerV1.d.ts +0 -12
- package/src/documents/shippingContainer/shippingContainerV1.js +0 -38
package/src/fields/field.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface FieldConstructor {
|
|
|
6
6
|
reconstructed?: boolean;
|
|
7
7
|
pageId?: number | undefined;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A basic field with position and page information.
|
|
11
|
+
*/
|
|
9
12
|
export declare class Field extends BaseField {
|
|
10
13
|
/**
|
|
11
14
|
* Contains exactly 4 relative vertices coordinates (points) of a right
|
package/src/fields/field.js
CHANGED
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Field = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
const geometry_1 = require("../geometry");
|
|
6
|
+
/**
|
|
7
|
+
* A basic field with position and page information.
|
|
8
|
+
*/
|
|
6
9
|
class Field extends base_1.BaseField {
|
|
7
10
|
/**
|
|
8
11
|
* @param {Object} prediction - Prediction object from HTTP response
|
package/src/fields/fullText.d.ts
CHANGED
package/src/fields/fullText.js
CHANGED
package/src/fields/locale.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseField, BaseFieldConstructor } from "./base";
|
|
2
|
+
/**
|
|
3
|
+
* The locale detected on the document.
|
|
4
|
+
*/
|
|
2
5
|
export declare class Locale extends BaseField {
|
|
3
6
|
/** Locale in ISO format. */
|
|
4
7
|
value?: string;
|
|
@@ -15,6 +18,6 @@ export declare class Locale extends BaseField {
|
|
|
15
18
|
* @param {String} valueKey - Key to use in the prediction dict
|
|
16
19
|
* @param {boolean} reconstructed - Does the object is reconstructed (not extracted by the API)
|
|
17
20
|
*/
|
|
18
|
-
constructor({ prediction, reconstructed
|
|
21
|
+
constructor({ prediction, reconstructed }: BaseFieldConstructor);
|
|
19
22
|
toString(): string;
|
|
20
23
|
}
|
package/src/fields/locale.js
CHANGED
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Locale = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
|
+
/**
|
|
6
|
+
* The locale detected on the document.
|
|
7
|
+
*/
|
|
5
8
|
class Locale extends base_1.BaseField {
|
|
6
9
|
/**
|
|
7
10
|
* @param {Object} prediction - Prediction object from HTTP response
|
|
8
11
|
* @param {String} valueKey - Key to use in the prediction dict
|
|
9
12
|
* @param {boolean} reconstructed - Does the object is reconstructed (not extracted by the API)
|
|
10
13
|
*/
|
|
11
|
-
constructor({ prediction, reconstructed = false
|
|
14
|
+
constructor({ prediction, reconstructed = false }) {
|
|
15
|
+
const valueKey = prediction.value !== undefined ? "value" : "language";
|
|
12
16
|
super({ prediction, valueKey, reconstructed });
|
|
13
17
|
this.confidence = prediction.confidence ? prediction.confidence : 0.0;
|
|
14
18
|
this.language = undefined;
|
|
@@ -2,6 +2,9 @@ import { BaseField, BaseFieldConstructor } from "./base";
|
|
|
2
2
|
interface OrientationFieldConstructor extends BaseFieldConstructor {
|
|
3
3
|
pageId: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* The clockwise rotation to apply (in degrees) to make the image upright.
|
|
7
|
+
*/
|
|
5
8
|
export declare class OrientationField extends BaseField {
|
|
6
9
|
/** Degrees of the rotation. */
|
|
7
10
|
value: number;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrientationField = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
|
+
/**
|
|
6
|
+
* The clockwise rotation to apply (in degrees) to make the image upright.
|
|
7
|
+
*/
|
|
5
8
|
class OrientationField extends base_1.BaseField {
|
|
6
9
|
/**
|
|
7
10
|
* @param {Object} prediction - Prediction object from HTTP response
|
|
@@ -10,18 +10,21 @@ interface PaymentDetailsConstructor {
|
|
|
10
10
|
reconstructed?: boolean;
|
|
11
11
|
pageId?: number;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Information on a single payment.
|
|
15
|
+
*/
|
|
13
16
|
export declare class PaymentDetails extends Field {
|
|
14
17
|
#private;
|
|
15
18
|
/** Synonym for the `iban` property */
|
|
16
19
|
value?: string | undefined;
|
|
17
20
|
/** The account number. */
|
|
18
|
-
accountNumber:
|
|
19
|
-
/** The
|
|
21
|
+
accountNumber: string | undefined;
|
|
22
|
+
/** The International Bank Account Number (IBAN). */
|
|
20
23
|
iban: string | undefined;
|
|
21
24
|
/** The routing number. */
|
|
22
|
-
routingNumber:
|
|
23
|
-
/** The SWIFT
|
|
24
|
-
swift:
|
|
25
|
+
routingNumber: string | undefined;
|
|
26
|
+
/** The bank's SWIFT Business Identifier Code (BIC). */
|
|
27
|
+
swift: string | undefined;
|
|
25
28
|
/**
|
|
26
29
|
* @param {Object} prediction - Prediction object from HTTP response
|
|
27
30
|
* @param {String} valueKey - Key to use in the prediction dict to get the iban
|
|
@@ -8,6 +8,9 @@ var _a, _PaymentDetails_isKeySet;
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.PaymentDetails = void 0;
|
|
10
10
|
const field_1 = require("./field");
|
|
11
|
+
/**
|
|
12
|
+
* Information on a single payment.
|
|
13
|
+
*/
|
|
11
14
|
class PaymentDetails extends field_1.Field {
|
|
12
15
|
/**
|
|
13
16
|
* @param {Object} prediction - Prediction object from HTTP response
|
package/src/fields/position.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export interface PositionFieldConstructor {
|
|
|
5
5
|
valueKey?: string;
|
|
6
6
|
pageId?: number | undefined;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* A field indicating a position or area on the document.
|
|
10
|
+
*/
|
|
8
11
|
export declare class PositionField {
|
|
9
12
|
/** Straight rectangle. */
|
|
10
13
|
boundingBox: Polygon;
|
package/src/fields/position.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PositionField = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A field indicating a position or area on the document.
|
|
6
|
+
*/
|
|
4
7
|
class PositionField {
|
|
5
8
|
constructor({ prediction, pageId }) {
|
|
6
9
|
this.pageId = pageId;
|
package/src/fields/tax.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ interface TaxConstructor {
|
|
|
9
9
|
reconstructed?: boolean;
|
|
10
10
|
pageId?: number;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Represent a single tax line.
|
|
14
|
+
*/
|
|
12
15
|
export declare class TaxField extends Field {
|
|
13
16
|
#private;
|
|
14
17
|
/** The tax amount. */
|
|
@@ -31,9 +34,18 @@ export declare class TaxField extends Field {
|
|
|
31
34
|
* @param {Integer} pageNumber - Page ID for multi-page document
|
|
32
35
|
*/
|
|
33
36
|
constructor({ prediction, valueKey, rateKey, codeKey, baseKey, reconstructed, pageId, }: TaxConstructor);
|
|
37
|
+
/**
|
|
38
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
39
|
+
*/
|
|
34
40
|
toTableLine(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Default string representation.
|
|
43
|
+
*/
|
|
35
44
|
toString(): string;
|
|
36
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Represent all items.
|
|
48
|
+
*/
|
|
37
49
|
export declare class Taxes extends Array<TaxField> {
|
|
38
50
|
#private;
|
|
39
51
|
init(prediction: StringDict[], pageId: number | undefined): this;
|
package/src/fields/tax.js
CHANGED
|
@@ -9,6 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.Taxes = exports.TaxField = void 0;
|
|
10
10
|
const field_1 = require("./field");
|
|
11
11
|
const amount_1 = require("./amount");
|
|
12
|
+
/**
|
|
13
|
+
* Represent a single tax line.
|
|
14
|
+
*/
|
|
12
15
|
class TaxField extends field_1.Field {
|
|
13
16
|
/**
|
|
14
17
|
* @param {Object} prediction - Prediction object from HTTP response
|
|
@@ -46,6 +49,9 @@ class TaxField extends field_1.Field {
|
|
|
46
49
|
if (isNaN(this.base))
|
|
47
50
|
this.base = undefined;
|
|
48
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
54
|
+
*/
|
|
49
55
|
toTableLine() {
|
|
50
56
|
const printable = __classPrivateFieldGet(this, _TaxField_instances, "m", _TaxField_printableValues).call(this);
|
|
51
57
|
return ("| " +
|
|
@@ -58,6 +64,9 @@ class TaxField extends field_1.Field {
|
|
|
58
64
|
printable.value.padEnd(13) +
|
|
59
65
|
" |");
|
|
60
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Default string representation.
|
|
69
|
+
*/
|
|
61
70
|
toString() {
|
|
62
71
|
const printable = __classPrivateFieldGet(this, _TaxField_instances, "m", _TaxField_printableValues).call(this);
|
|
63
72
|
return ("Base: " +
|
|
@@ -79,6 +88,9 @@ _TaxField_instances = new WeakSet(), _TaxField_printableValues = function _TaxFi
|
|
|
79
88
|
value: this.value !== undefined ? (0, amount_1.floatToString)(this.value) : "",
|
|
80
89
|
};
|
|
81
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Represent all items.
|
|
93
|
+
*/
|
|
82
94
|
class Taxes extends Array {
|
|
83
95
|
constructor() {
|
|
84
96
|
super(...arguments);
|
package/src/fields/text.d.ts
CHANGED
package/src/fields/text.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextField = void 0;
|
|
4
4
|
const field_1 = require("./field");
|
|
5
|
+
/**
|
|
6
|
+
* A field containing a text value.
|
|
7
|
+
*/
|
|
5
8
|
class TextField extends field_1.Field {
|
|
6
9
|
constructor({ prediction, valueKey = "value", reconstructed = false, pageId, }) {
|
|
7
10
|
super({ prediction, valueKey, reconstructed, pageId });
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CustomV1, Document, FinancialDocumentV0, FinancialDocumentV1, InvoiceV3, InvoiceV4, InvoiceSplitterV1, PassportV1, ReceiptV3, ReceiptV4, ReceiptV5, CropperV1,
|
|
1
|
+
export { CustomV1, Document, FinancialDocumentV0, FinancialDocumentV1, InvoiceV3, InvoiceV4, InvoiceSplitterV1, PassportV1, ReceiptV3, ReceiptV4, ReceiptV5, CropperV1, MindeeVisionV1, ProofOfAddressV1, fr, us, eu, } from "./documents";
|
|
2
2
|
export { Client, ClientOptions, CustomConfigParams, DocumentClient, PredictOptions, } from "./client";
|
|
3
3
|
export { ResponseSig, Response, AsyncPredictResponse } from "./api";
|
|
4
4
|
export { InputSource, PageOptionsOperation } from "./inputs";
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageOptionsOperation = exports.InputSource = exports.AsyncPredictResponse = exports.Response = exports.DocumentClient = exports.Client = exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.
|
|
3
|
+
exports.PageOptionsOperation = exports.InputSource = exports.AsyncPredictResponse = exports.Response = exports.DocumentClient = exports.Client = exports.eu = exports.us = exports.fr = exports.ProofOfAddressV1 = exports.MindeeVisionV1 = exports.CropperV1 = exports.ReceiptV5 = exports.ReceiptV4 = exports.ReceiptV3 = exports.PassportV1 = exports.InvoiceSplitterV1 = exports.InvoiceV4 = exports.InvoiceV3 = exports.FinancialDocumentV1 = exports.FinancialDocumentV0 = exports.Document = exports.CustomV1 = void 0;
|
|
4
4
|
var documents_1 = require("./documents");
|
|
5
5
|
Object.defineProperty(exports, "CustomV1", { enumerable: true, get: function () { return documents_1.CustomV1; } });
|
|
6
6
|
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return documents_1.Document; } });
|
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "ReceiptV3", { enumerable: true, get: function ()
|
|
|
14
14
|
Object.defineProperty(exports, "ReceiptV4", { enumerable: true, get: function () { return documents_1.ReceiptV4; } });
|
|
15
15
|
Object.defineProperty(exports, "ReceiptV5", { enumerable: true, get: function () { return documents_1.ReceiptV5; } });
|
|
16
16
|
Object.defineProperty(exports, "CropperV1", { enumerable: true, get: function () { return documents_1.CropperV1; } });
|
|
17
|
-
Object.defineProperty(exports, "ShippingContainerV1", { enumerable: true, get: function () { return documents_1.ShippingContainerV1; } });
|
|
18
17
|
Object.defineProperty(exports, "MindeeVisionV1", { enumerable: true, get: function () { return documents_1.MindeeVisionV1; } });
|
|
19
18
|
Object.defineProperty(exports, "ProofOfAddressV1", { enumerable: true, get: function () { return documents_1.ProofOfAddressV1; } });
|
|
20
19
|
Object.defineProperty(exports, "fr", { enumerable: true, get: function () { return documents_1.fr; } });
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Document, DocumentConstructorProps } from "../document";
|
|
2
|
-
import { TextField } from "../../fields";
|
|
3
|
-
export declare class ShippingContainerV1 extends Document {
|
|
4
|
-
/** ISO 6346 code for container owner prefix + equipment identifier. */
|
|
5
|
-
owner: TextField;
|
|
6
|
-
/** ISO 6346 code for container serial number (6+1 digits). */
|
|
7
|
-
serialNumber: TextField;
|
|
8
|
-
/** ISO 6346 code for container length, height and type. */
|
|
9
|
-
sizeType: TextField;
|
|
10
|
-
constructor({ prediction, orientation, extras, inputSource, pageId, }: DocumentConstructorProps);
|
|
11
|
-
toString(): string;
|
|
12
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShippingContainerV1 = void 0;
|
|
4
|
-
const document_1 = require("../document");
|
|
5
|
-
const fields_1 = require("../../fields");
|
|
6
|
-
class ShippingContainerV1 extends document_1.Document {
|
|
7
|
-
constructor({ prediction, orientation = undefined, extras = undefined, inputSource = undefined, pageId = undefined, }) {
|
|
8
|
-
super({
|
|
9
|
-
inputSource: inputSource,
|
|
10
|
-
pageId: pageId,
|
|
11
|
-
orientation: orientation,
|
|
12
|
-
extras: extras,
|
|
13
|
-
});
|
|
14
|
-
this.owner = new fields_1.TextField({
|
|
15
|
-
prediction: prediction.owner,
|
|
16
|
-
pageId: pageId,
|
|
17
|
-
});
|
|
18
|
-
this.serialNumber = new fields_1.TextField({
|
|
19
|
-
prediction: prediction.serial_number,
|
|
20
|
-
pageId: pageId,
|
|
21
|
-
});
|
|
22
|
-
this.sizeType = new fields_1.TextField({
|
|
23
|
-
prediction: prediction.size_type,
|
|
24
|
-
pageId: pageId,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
toString() {
|
|
28
|
-
const outStr = `----- Shipping Container V1 -----
|
|
29
|
-
Filename: ${this.filename}
|
|
30
|
-
Owner: ${this.owner}
|
|
31
|
-
Serial Number: ${this.serialNumber}
|
|
32
|
-
Size and Type: ${this.sizeType}
|
|
33
|
-
----------------------
|
|
34
|
-
`;
|
|
35
|
-
return ShippingContainerV1.cleanOutString(outStr);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.ShippingContainerV1 = ShippingContainerV1;
|