mindee 3.10.2 → 4.0.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 +24 -0
- package/README.md +103 -41
- package/package.json +4 -5
- package/src/cli.js +96 -70
- package/src/client.d.ts +34 -65
- package/src/client.js +108 -172
- package/src/geometry/boundingBox.d.ts +5 -0
- package/src/geometry/boundingBox.js +2 -0
- package/src/geometry/boundingBoxUtils.d.ts +22 -0
- package/src/geometry/boundingBoxUtils.js +66 -0
- package/src/geometry/index.d.ts +6 -0
- package/src/geometry/index.js +21 -0
- package/src/geometry/minMax.d.ts +4 -0
- package/src/geometry/minMax.js +2 -0
- package/src/geometry/point.d.ts +2 -0
- package/src/geometry/point.js +2 -0
- package/src/geometry/polygon.d.ts +4 -0
- package/src/geometry/polygon.js +7 -0
- package/src/{geometry.d.ts → geometry/polygonUtils.d.ts} +7 -32
- package/src/{geometry.js → geometry/polygonUtils.js} +41 -64
- package/src/http/endpoint.d.ts +44 -0
- package/src/http/endpoint.js +188 -0
- package/src/http/error.d.ts +2 -0
- package/src/http/error.js +9 -0
- package/src/http/index.d.ts +3 -0
- package/src/http/index.js +11 -0
- package/src/http/mindeeApi.d.ts +20 -0
- package/src/http/mindeeApi.js +73 -0
- package/src/index.d.ts +4 -4
- package/src/index.js +33 -26
- package/src/{inputs → input}/base.d.ts +4 -3
- package/src/{inputs → input}/base.js +9 -7
- package/src/{inputs → input}/index.d.ts +1 -1
- package/src/{inputs → input}/index.js +1 -2
- package/src/{inputs → input}/sources.d.ts +10 -11
- package/src/{inputs → input}/sources.js +9 -9
- package/src/parsing/common/apiRequest.d.ts +10 -0
- package/src/parsing/common/apiRequest.js +13 -0
- package/src/parsing/common/apiResponse.d.ts +6 -0
- package/src/parsing/common/apiResponse.js +10 -0
- package/src/parsing/common/asyncPredictResponse.d.ts +21 -0
- package/src/parsing/common/asyncPredictResponse.js +39 -0
- package/src/parsing/common/document.d.ts +13 -0
- package/src/parsing/common/document.js +34 -0
- package/src/parsing/common/extras/cropperExtra.d.ts +8 -0
- package/src/parsing/common/extras/cropperExtra.js +26 -0
- package/src/parsing/common/extras/extras.d.ts +11 -0
- package/src/parsing/common/extras/extras.js +18 -0
- package/src/parsing/common/index.d.ts +9 -0
- package/src/parsing/common/index.js +20 -0
- package/src/parsing/common/inference.d.ts +26 -0
- package/src/parsing/common/inference.js +56 -0
- package/src/parsing/common/mvisionV1.d.ts +8 -0
- package/src/parsing/common/mvisionV1.js +17 -0
- package/src/parsing/common/ocr.d.ts +8 -0
- package/src/parsing/common/ocr.js +13 -0
- package/src/parsing/common/ocrPage.d.ts +16 -0
- package/src/parsing/common/ocrPage.js +66 -0
- package/src/{fields → parsing/common}/orientation.d.ts +2 -2
- package/src/{fields → parsing/common}/orientation.js +4 -4
- package/src/parsing/common/page.d.ts +12 -0
- package/src/parsing/common/page.js +40 -0
- package/src/parsing/common/predictResponse.d.ts +6 -0
- package/src/parsing/common/predictResponse.js +12 -0
- package/src/parsing/common/prediction.d.ts +2 -0
- package/src/parsing/common/prediction.js +6 -0
- package/src/parsing/common/product.d.ts +4 -0
- package/src/parsing/common/product.js +2 -0
- package/src/parsing/common/stringDict.d.ts +3 -0
- package/src/parsing/common/stringDict.js +2 -0
- package/src/parsing/common/summaryHelper.d.ts +8 -0
- package/src/parsing/common/summaryHelper.js +22 -0
- package/src/parsing/custom/classificationField.d.ts +16 -0
- package/src/parsing/custom/classificationField.js +14 -0
- package/src/parsing/custom/index.d.ts +3 -0
- package/src/parsing/custom/index.js +12 -0
- package/src/{documents/custom/lineitems.d.ts → parsing/custom/lineItems.d.ts} +4 -4
- package/src/{documents/custom/lineitems.js → parsing/custom/lineItems.js} +11 -9
- package/src/{documents/custom/fields.d.ts → parsing/custom/listField.d.ts} +3 -16
- package/src/{documents/custom/fields.js → parsing/custom/listField.js} +4 -14
- package/src/parsing/index.d.ts +3 -0
- package/src/parsing/index.js +29 -0
- package/src/{fields → parsing/standard}/amount.d.ts +2 -2
- package/src/{fields → parsing/standard}/amount.js +5 -5
- package/src/{fields → parsing/standard}/base.d.ts +5 -5
- package/src/{fields → parsing/standard}/base.js +3 -2
- package/src/{fields → parsing/standard}/classification.d.ts +1 -1
- package/src/{fields → parsing/standard}/classification.js +3 -3
- package/src/{fields → parsing/standard}/companyRegistration.d.ts +1 -1
- package/src/parsing/standard/companyRegistration.js +14 -0
- package/src/{fields → parsing/standard}/date.d.ts +1 -1
- package/src/{fields → parsing/standard}/date.js +2 -2
- package/src/{fields → parsing/standard}/field.d.ts +3 -4
- package/src/{fields → parsing/standard}/field.js +6 -7
- package/src/parsing/standard/index.d.ts +12 -0
- package/src/parsing/standard/index.js +27 -0
- package/src/{fields → parsing/standard}/locale.d.ts +4 -4
- package/src/parsing/standard/locale.js +42 -0
- package/src/{fields → parsing/standard}/paymentDetails.d.ts +3 -3
- package/src/{fields → parsing/standard}/paymentDetails.js +11 -11
- package/src/{fields → parsing/standard}/position.d.ts +2 -2
- package/src/{fields → parsing/standard}/position.js +5 -5
- package/src/{fields → parsing/standard}/tax.d.ts +3 -3
- package/src/{fields → parsing/standard}/tax.js +3 -3
- package/src/{fields → parsing/standard}/text.d.ts +2 -2
- package/src/{fields → parsing/standard}/text.js +4 -4
- package/src/parsing/standard/word.d.ts +10 -0
- package/src/parsing/standard/word.js +2 -0
- package/src/pdf/pdfOperation.d.ts +1 -1
- package/src/pdf/pdfOperation.js +3 -3
- package/src/product/cropper/cropperV1.d.ts +9 -0
- package/src/product/cropper/cropperV1.js +16 -0
- package/src/product/cropper/cropperV1Document.d.ts +8 -0
- package/src/product/cropper/cropperV1Document.js +26 -0
- package/src/product/custom/customV1.d.ts +10 -0
- package/src/product/custom/customV1.js +17 -0
- package/src/product/custom/customV1Document.d.ts +9 -0
- package/src/product/custom/customV1Document.js +43 -0
- package/src/product/custom/customV1Page.d.ts +7 -0
- package/src/product/custom/customV1Page.js +24 -0
- package/src/product/eu/licensePlate/licensePlateV1.d.ts +9 -0
- package/src/product/eu/licensePlate/licensePlateV1.js +16 -0
- package/src/product/eu/licensePlate/licensePlateV1Document.d.ts +11 -0
- package/src/product/eu/licensePlate/licensePlateV1Document.js +25 -0
- package/src/product/financialDocument/financialDocumentV1.d.ts +9 -0
- package/src/product/financialDocument/financialDocumentV1.js +16 -0
- package/src/{documents/financialDocument/financialDocumentV1.d.ts → product/financialDocument/financialDocumentV1Document.d.ts} +43 -44
- package/src/product/financialDocument/financialDocumentV1Document.js +158 -0
- package/src/{documents → product}/financialDocument/financialDocumentV1LineItem.d.ts +8 -8
- package/src/{documents → product}/financialDocument/financialDocumentV1LineItem.js +35 -34
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +9 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +16 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +15 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +31 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +9 -0
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +16 -0
- package/src/{documents → product}/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +5 -5
- package/src/{documents → product}/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +1 -1
- package/src/{documents/fr/bankAccountDetails/bankAccountDetailsV2.d.ts → product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts} +7 -7
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +37 -0
- package/src/product/fr/carteVitale/carteVitaleV1.d.ts +9 -0
- package/src/product/fr/carteVitale/carteVitaleV1.js +16 -0
- package/src/product/fr/carteVitale/carteVitaleV1Document.d.ts +17 -0
- package/src/product/fr/carteVitale/carteVitaleV1Document.js +40 -0
- package/src/product/fr/idCard/idCardV1.d.ts +10 -0
- package/src/product/fr/idCard/idCardV1.js +17 -0
- package/src/product/fr/idCard/idCardV1Document.d.ts +29 -0
- package/src/product/fr/idCard/idCardV1Document.js +70 -0
- package/src/product/fr/idCard/idCardV1Page.d.ts +12 -0
- package/src/product/fr/idCard/idCardV1Page.js +23 -0
- package/src/{documents → product}/index.d.ts +2 -7
- package/src/{documents → product}/index.js +3 -14
- package/src/product/invoice/invoiceV4.d.ts +9 -0
- package/src/product/invoice/invoiceV4.js +16 -0
- package/src/product/invoice/invoiceV4Document.d.ts +44 -0
- package/src/product/invoice/invoiceV4Document.js +146 -0
- package/src/{documents/invoice/invoiceLineItem.d.ts → product/invoice/invoiceV4LineItem.d.ts} +10 -8
- package/src/product/invoice/invoiceV4LineItem.js +101 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +9 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1.js +16 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +8 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +23 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.d.ts +7 -0
- package/src/product/invoiceSplitter/invoiceSplitterV1PageGroup.js +14 -0
- package/src/product/passport/passportV1.d.ts +9 -0
- package/src/product/passport/passportV1.js +16 -0
- package/src/product/passport/passportV1Document.d.ts +31 -0
- package/src/product/passport/passportV1Document.js +75 -0
- package/src/product/proofOfAddress/proofOfAddressV1.d.ts +9 -0
- package/src/product/proofOfAddress/proofOfAddressV1.js +16 -0
- package/src/product/proofOfAddress/proofOfAddressV1Document.d.ts +27 -0
- package/src/product/proofOfAddress/proofOfAddressV1Document.js +72 -0
- package/src/product/receipt/receiptV4.d.ts +9 -0
- package/src/product/receipt/receiptV4.js +15 -0
- package/src/{documents/receipt/receiptV4.d.ts → product/receipt/receiptV4Document.d.ts} +12 -12
- package/src/product/receipt/receiptV4Document.js +67 -0
- package/src/product/receipt/receiptV5.d.ts +9 -0
- package/src/product/receipt/receiptV5.js +16 -0
- package/src/{documents/receipt/receiptV5.d.ts → product/receipt/receiptV5Document.d.ts} +16 -17
- package/src/product/receipt/receiptV5Document.js +108 -0
- package/src/{documents → product}/receipt/receiptV5LineItem.d.ts +5 -5
- package/src/{documents → product}/receipt/receiptV5LineItem.js +20 -19
- package/src/product/us/bankCheck/bankCheckV1.d.ts +10 -0
- package/src/product/us/bankCheck/bankCheckV1.js +17 -0
- package/src/product/us/bankCheck/bankCheckV1Document.d.ts +21 -0
- package/src/product/us/bankCheck/bankCheckV1Document.js +50 -0
- package/src/product/us/bankCheck/bankCheckV1Page.d.ts +14 -0
- package/src/product/us/bankCheck/bankCheckV1Page.js +32 -0
- package/src/product/us/driverLicense/driverLicenseV1.d.ts +10 -0
- package/src/product/us/driverLicense/driverLicenseV1.js +17 -0
- package/src/product/us/driverLicense/driverLicenseV1Document.d.ts +43 -0
- package/src/product/us/driverLicense/driverLicenseV1Document.js +101 -0
- package/src/product/us/driverLicense/driverLicenseV1Page.d.ts +14 -0
- package/src/product/us/driverLicense/driverLicenseV1Page.js +29 -0
- package/src/product/us/index.d.ts +2 -0
- package/src/product/us/index.js +7 -0
- package/src/api/documentResponse.d.ts +0 -25
- package/src/api/documentResponse.js +0 -50
- package/src/api/endpoint.d.ts +0 -63
- package/src/api/endpoint.js +0 -216
- package/src/api/index.d.ts +0 -3
- package/src/api/index.js +0 -13
- package/src/api/predictResponse.d.ts +0 -33
- package/src/api/predictResponse.js +0 -52
- package/src/documents/cropper/cropperV1.d.ts +0 -7
- package/src/documents/cropper/cropperV1.js +0 -35
- package/src/documents/custom/customV1.d.ts +0 -10
- package/src/documents/custom/customV1.js +0 -53
- package/src/documents/document.d.ts +0 -47
- package/src/documents/document.js +0 -76
- package/src/documents/documentConfig.d.ts +0 -42
- package/src/documents/documentConfig.js +0 -118
- package/src/documents/eu/licensePlate/licensePlateV1.d.ts +0 -8
- package/src/documents/eu/licensePlate/licensePlateV1.js +0 -32
- package/src/documents/financialDocument/financialDocumentV0.d.ts +0 -28
- package/src/documents/financialDocument/financialDocumentV0.js +0 -140
- package/src/documents/financialDocument/financialDocumentV1.js +0 -197
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +0 -13
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV1.js +0 -39
- package/src/documents/fr/bankAccountDetails/bankAccountDetailsV2.js +0 -48
- package/src/documents/fr/carteVitale/carteVitaleV1.d.ts +0 -14
- package/src/documents/fr/carteVitale/carteVitaleV1.js +0 -45
- package/src/documents/fr/idCard/idCardV1.d.ts +0 -28
- package/src/documents/fr/idCard/idCardV1.js +0 -79
- package/src/documents/invoice/checks.d.ts +0 -5
- package/src/documents/invoice/checks.js +0 -87
- package/src/documents/invoice/invoiceLineItem.js +0 -66
- package/src/documents/invoice/invoiceV3.d.ts +0 -49
- package/src/documents/invoice/invoiceV3.js +0 -156
- package/src/documents/invoice/invoiceV4.d.ts +0 -45
- package/src/documents/invoice/invoiceV4.js +0 -166
- package/src/documents/invoice/reconstruction.d.ts +0 -6
- package/src/documents/invoice/reconstruction.js +0 -78
- package/src/documents/invoiceSplitter/invoiceSplitterV1.d.ts +0 -14
- package/src/documents/invoiceSplitter/invoiceSplitterV1.js +0 -47
- package/src/documents/mindeeVision/mindeeVisionV1.d.ts +0 -8
- package/src/documents/mindeeVision/mindeeVisionV1.js +0 -29
- package/src/documents/passport/passportV1.d.ts +0 -43
- package/src/documents/passport/passportV1.js +0 -220
- package/src/documents/proofOfAddress/proofOfAddressV1.d.ts +0 -24
- package/src/documents/proofOfAddress/proofOfAddressV1.js +0 -77
- package/src/documents/receipt/receiptV3.d.ts +0 -25
- package/src/documents/receipt/receiptV3.js +0 -136
- package/src/documents/receipt/receiptV4.js +0 -78
- package/src/documents/receipt/receiptV5.js +0 -137
- package/src/documents/us/bankCheck/bankCheckV1.d.ts +0 -22
- package/src/documents/us/bankCheck/bankCheckV1.js +0 -63
- package/src/documents/us/index.d.ts +0 -1
- package/src/documents/us/index.js +0 -5
- package/src/fields/companyRegistration.js +0 -14
- package/src/fields/fullText.d.ts +0 -27
- package/src/fields/fullText.js +0 -92
- package/src/fields/index.d.ts +0 -12
- package/src/fields/index.js +0 -28
- package/src/fields/locale.js +0 -45
- package/src/math/index.d.ts +0 -1
- package/src/math/index.js +0 -5
- package/src/math/precision.d.ts +0 -1
- package/src/math/precision.js +0 -13
- /package/src/{inputs → input}/pageOptions.d.ts +0 -0
- /package/src/{inputs → input}/pageOptions.js +0 -0
- /package/src/{documents → product}/eu/index.d.ts +0 -0
- /package/src/{documents → product}/eu/index.js +0 -0
- /package/src/{documents → product}/fr/index.d.ts +0 -0
- /package/src/{documents → product}/fr/index.js +0 -0
package/src/fields/fullText.js
DELETED
|
@@ -1,92 +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.FullText = void 0;
|
|
27
|
-
const geometry = __importStar(require("../geometry"));
|
|
28
|
-
function orderLines(fullText) {
|
|
29
|
-
const lines = [];
|
|
30
|
-
const indexes = [];
|
|
31
|
-
let current = undefined;
|
|
32
|
-
fullText.forEach(() => {
|
|
33
|
-
let line = [];
|
|
34
|
-
fullText.forEach((word, idx) => {
|
|
35
|
-
if (!indexes.includes(idx)) {
|
|
36
|
-
if (current === undefined) {
|
|
37
|
-
current = word;
|
|
38
|
-
indexes.push(idx);
|
|
39
|
-
line = [current];
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
const centroid = geometry.getCentroid(word.polygon);
|
|
43
|
-
if (geometry.isPointInPolygonY(centroid, current.polygon)) {
|
|
44
|
-
line.push(word);
|
|
45
|
-
indexes.push(idx);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
current = undefined;
|
|
51
|
-
if (line.length > 0) {
|
|
52
|
-
lines.push(line);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const orderedLines = [];
|
|
56
|
-
lines.forEach((line) => {
|
|
57
|
-
const sortedLine = line.sort((a, b) => {
|
|
58
|
-
return geometry.relativeX(a.polygon) - geometry.relativeX(b.polygon);
|
|
59
|
-
});
|
|
60
|
-
orderedLines.push(sortedLine);
|
|
61
|
-
});
|
|
62
|
-
orderedLines.reverse();
|
|
63
|
-
return orderedLines;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* OCR extraction from the entire document.
|
|
67
|
-
*/
|
|
68
|
-
class FullText {
|
|
69
|
-
constructor() {
|
|
70
|
-
this.words = [];
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Order all text on a page into lines.
|
|
74
|
-
* WARNING: This feature is experimental.
|
|
75
|
-
*/
|
|
76
|
-
toLines() {
|
|
77
|
-
return orderLines(this.words);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* WARNING: This feature is experimental.
|
|
81
|
-
*/
|
|
82
|
-
toString() {
|
|
83
|
-
let outStr = "";
|
|
84
|
-
const lines = this.toLines();
|
|
85
|
-
lines.forEach((line) => {
|
|
86
|
-
const lineStr = line.map((word) => word.text).join(" ");
|
|
87
|
-
outStr += `${lineStr}\n`;
|
|
88
|
-
});
|
|
89
|
-
return outStr;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.FullText = FullText;
|
package/src/fields/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ClassificationField } from "./classification";
|
|
2
|
-
export { Taxes, TaxField } from "./tax";
|
|
3
|
-
export { PaymentDetails } from "./paymentDetails";
|
|
4
|
-
export { OrientationField } from "./orientation";
|
|
5
|
-
export { Locale } from "./locale";
|
|
6
|
-
export { Amount } from "./amount";
|
|
7
|
-
export { DateField } from "./date";
|
|
8
|
-
export { BaseField, StringDict } from "./base";
|
|
9
|
-
export { FullText, Word } from "./fullText";
|
|
10
|
-
export { CompanyRegistration } from "./companyRegistration";
|
|
11
|
-
export { PositionField } from "./position";
|
|
12
|
-
export { TextField } from "./text";
|
package/src/fields/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextField = exports.PositionField = exports.CompanyRegistration = exports.FullText = exports.BaseField = exports.DateField = exports.Amount = exports.Locale = exports.OrientationField = exports.PaymentDetails = exports.TaxField = exports.Taxes = exports.ClassificationField = void 0;
|
|
4
|
-
var classification_1 = require("./classification");
|
|
5
|
-
Object.defineProperty(exports, "ClassificationField", { enumerable: true, get: function () { return classification_1.ClassificationField; } });
|
|
6
|
-
var tax_1 = require("./tax");
|
|
7
|
-
Object.defineProperty(exports, "Taxes", { enumerable: true, get: function () { return tax_1.Taxes; } });
|
|
8
|
-
Object.defineProperty(exports, "TaxField", { enumerable: true, get: function () { return tax_1.TaxField; } });
|
|
9
|
-
var paymentDetails_1 = require("./paymentDetails");
|
|
10
|
-
Object.defineProperty(exports, "PaymentDetails", { enumerable: true, get: function () { return paymentDetails_1.PaymentDetails; } });
|
|
11
|
-
var orientation_1 = require("./orientation");
|
|
12
|
-
Object.defineProperty(exports, "OrientationField", { enumerable: true, get: function () { return orientation_1.OrientationField; } });
|
|
13
|
-
var locale_1 = require("./locale");
|
|
14
|
-
Object.defineProperty(exports, "Locale", { enumerable: true, get: function () { return locale_1.Locale; } });
|
|
15
|
-
var amount_1 = require("./amount");
|
|
16
|
-
Object.defineProperty(exports, "Amount", { enumerable: true, get: function () { return amount_1.Amount; } });
|
|
17
|
-
var date_1 = require("./date");
|
|
18
|
-
Object.defineProperty(exports, "DateField", { enumerable: true, get: function () { return date_1.DateField; } });
|
|
19
|
-
var base_1 = require("./base");
|
|
20
|
-
Object.defineProperty(exports, "BaseField", { enumerable: true, get: function () { return base_1.BaseField; } });
|
|
21
|
-
var fullText_1 = require("./fullText");
|
|
22
|
-
Object.defineProperty(exports, "FullText", { enumerable: true, get: function () { return fullText_1.FullText; } });
|
|
23
|
-
var companyRegistration_1 = require("./companyRegistration");
|
|
24
|
-
Object.defineProperty(exports, "CompanyRegistration", { enumerable: true, get: function () { return companyRegistration_1.CompanyRegistration; } });
|
|
25
|
-
var position_1 = require("./position");
|
|
26
|
-
Object.defineProperty(exports, "PositionField", { enumerable: true, get: function () { return position_1.PositionField; } });
|
|
27
|
-
var text_1 = require("./text");
|
|
28
|
-
Object.defineProperty(exports, "TextField", { enumerable: true, get: function () { return text_1.TextField; } });
|
package/src/fields/locale.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Locale = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
|
-
/**
|
|
6
|
-
* The locale detected on the document.
|
|
7
|
-
*/
|
|
8
|
-
class Locale extends base_1.BaseField {
|
|
9
|
-
/**
|
|
10
|
-
* @param {Object} prediction - Prediction object from HTTP response
|
|
11
|
-
* @param {String} valueKey - Key to use in the prediction dict
|
|
12
|
-
* @param {boolean} reconstructed - Does the object is reconstructed (not extracted by the API)
|
|
13
|
-
*/
|
|
14
|
-
constructor({ prediction, reconstructed = false }) {
|
|
15
|
-
const valueKey = prediction.value !== undefined ? "value" : "language";
|
|
16
|
-
super({ prediction, valueKey, reconstructed });
|
|
17
|
-
this.confidence = prediction.confidence ? prediction.confidence : 0.0;
|
|
18
|
-
this.language = undefined;
|
|
19
|
-
this.country = undefined;
|
|
20
|
-
this.currency = undefined;
|
|
21
|
-
if ("language" in prediction && prediction.language !== "N/A")
|
|
22
|
-
this.language = prediction.language;
|
|
23
|
-
if ("country" in prediction && prediction.country !== "N/A")
|
|
24
|
-
this.country = prediction.country;
|
|
25
|
-
if ("currency" in prediction && prediction.currency !== "N/A")
|
|
26
|
-
this.currency = prediction.currency;
|
|
27
|
-
}
|
|
28
|
-
toString() {
|
|
29
|
-
let outStr = "";
|
|
30
|
-
if (this.value) {
|
|
31
|
-
outStr += `${this.value}; `;
|
|
32
|
-
}
|
|
33
|
-
if (this.language) {
|
|
34
|
-
outStr += `${this.language}; `;
|
|
35
|
-
}
|
|
36
|
-
if (this.country) {
|
|
37
|
-
outStr += `${this.country}; `;
|
|
38
|
-
}
|
|
39
|
-
if (this.currency) {
|
|
40
|
-
outStr += `${this.currency};`;
|
|
41
|
-
}
|
|
42
|
-
return outStr.trimEnd();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Locale = Locale;
|
package/src/math/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { equals as precisionEquals } from "./precision";
|
package/src/math/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.precisionEquals = void 0;
|
|
4
|
-
var precision_1 = require("./precision");
|
|
5
|
-
Object.defineProperty(exports, "precisionEquals", { enumerable: true, get: function () { return precision_1.equals; } });
|
package/src/math/precision.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function equals(a: number, b: number, tolerance: number): boolean;
|
package/src/math/precision.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.equals = void 0;
|
|
4
|
-
function equals(a, b, tolerance) {
|
|
5
|
-
if (Math.abs(b - a) <= tolerance) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
if (Math.abs(a - b) <= tolerance) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
exports.equals = equals;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|