mindee 4.14.1 → 4.16.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 +24 -0
- package/package.json +2 -1
- package/src/client.d.ts +5 -3
- package/src/client.js +7 -1
- package/src/http/endpoint.d.ts +3 -1
- package/src/http/endpoint.js +12 -8
- package/src/http/responseValidation.js +11 -4
- package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +2 -1
- package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.js +2 -1
- package/src/imageOperations/multiReceiptsExtractor/multiReceiptsExtractor.js +3 -1
- package/src/input/localResponse.d.ts +1 -0
- package/src/input/localResponse.js +1 -0
- package/src/parsing/common/document.d.ts +1 -0
- package/src/parsing/common/document.js +27 -6
- package/src/parsing/common/extras/fullTextOcrExtra.d.ts +11 -0
- package/src/parsing/common/extras/fullTextOcrExtra.js +20 -0
- package/src/parsing/common/extras/index.d.ts +3 -0
- package/src/parsing/common/extras/index.js +9 -0
- package/src/parsing/common/index.d.ts +2 -0
- package/src/parsing/common/index.js +28 -1
- package/src/parsing/common/page.d.ts +1 -0
- package/src/parsing/common/page.js +30 -7
- package/src/parsing/common/summaryHelper.d.ts +10 -0
- package/src/parsing/common/summaryHelper.js +27 -1
- package/src/parsing/generated/generatedObject.d.ts +3 -3
- package/src/parsing/generated/generatedObject.js +14 -5
- package/src/parsing/standard/amount.d.ts +0 -1
- package/src/parsing/standard/amount.js +4 -11
- package/src/parsing/standard/index.d.ts +1 -1
- package/src/parsing/standard/index.js +1 -2
- package/src/parsing/standard/tax.js +4 -4
- package/src/pdf/pdfOperation.d.ts +1 -1
- package/src/pdf/pdfOperation.js +12 -7
- package/src/product/billOfLading/billOfLadingV1.d.ts +16 -0
- package/src/product/billOfLading/billOfLadingV1.js +27 -0
- package/src/product/billOfLading/billOfLadingV1Carrier.d.ts +32 -0
- package/src/product/billOfLading/billOfLadingV1Carrier.js +62 -0
- package/src/product/billOfLading/billOfLadingV1CarrierItem.d.ts +38 -0
- package/src/product/billOfLading/billOfLadingV1CarrierItem.js +117 -0
- package/src/product/billOfLading/billOfLadingV1Consignee.d.ts +34 -0
- package/src/product/billOfLading/billOfLadingV1Consignee.js +67 -0
- package/src/product/billOfLading/billOfLadingV1Document.d.ts +39 -0
- package/src/product/billOfLading/billOfLadingV1Document.js +95 -0
- package/src/product/billOfLading/billOfLadingV1NotifyParty.d.ts +34 -0
- package/src/product/billOfLading/billOfLadingV1NotifyParty.js +67 -0
- package/src/product/billOfLading/billOfLadingV1Shipper.d.ts +34 -0
- package/src/product/billOfLading/billOfLadingV1Shipper.js +67 -0
- package/src/product/billOfLading/index.d.ts +1 -0
- package/src/product/billOfLading/index.js +5 -0
- package/src/product/billOfLading/internal.d.ts +7 -0
- package/src/product/billOfLading/internal.js +17 -0
- package/src/product/financialDocument/financialDocumentV1LineItem.d.ts +8 -8
- package/src/product/financialDocument/financialDocumentV1LineItem.js +47 -22
- package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +4 -4
- package/src/product/fr/energyBill/energyBillV1.d.ts +16 -0
- package/src/product/fr/energyBill/energyBillV1.js +27 -0
- package/src/product/fr/energyBill/energyBillV1Document.d.ts +49 -0
- package/src/product/fr/energyBill/energyBillV1Document.js +143 -0
- package/src/product/fr/energyBill/energyBillV1EnergyConsumer.d.ts +30 -0
- package/src/product/fr/energyBill/energyBillV1EnergyConsumer.js +57 -0
- package/src/product/fr/energyBill/energyBillV1EnergySupplier.d.ts +30 -0
- package/src/product/fr/energyBill/energyBillV1EnergySupplier.js +57 -0
- package/src/product/fr/energyBill/energyBillV1EnergyUsage.d.ts +38 -0
- package/src/product/fr/energyBill/energyBillV1EnergyUsage.js +117 -0
- package/src/product/fr/energyBill/energyBillV1MeterDetail.d.ts +32 -0
- package/src/product/fr/energyBill/energyBillV1MeterDetail.js +62 -0
- package/src/product/fr/energyBill/energyBillV1Subscription.d.ts +38 -0
- package/src/product/fr/energyBill/energyBillV1Subscription.js +117 -0
- package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.d.ts +38 -0
- package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.js +117 -0
- package/src/product/fr/energyBill/index.d.ts +1 -0
- package/src/product/fr/energyBill/index.js +5 -0
- package/src/product/fr/energyBill/internal.d.ts +8 -0
- package/src/product/fr/energyBill/internal.js +19 -0
- package/src/product/fr/index.d.ts +2 -0
- package/src/product/fr/index.js +5 -1
- package/src/product/fr/internal.d.ts +2 -0
- package/src/product/fr/internal.js +3 -1
- package/src/product/fr/payslip/index.d.ts +1 -0
- package/src/product/fr/payslip/index.js +5 -0
- package/src/product/fr/payslip/internal.d.ts +10 -0
- package/src/product/fr/payslip/internal.js +23 -0
- package/src/product/fr/payslip/payslipV2.d.ts +16 -0
- package/src/product/fr/payslip/payslipV2.js +27 -0
- package/src/product/fr/payslip/payslipV2BankAccountDetail.d.ts +32 -0
- package/src/product/fr/payslip/payslipV2BankAccountDetail.js +62 -0
- package/src/product/fr/payslip/payslipV2Document.d.ts +35 -0
- package/src/product/fr/payslip/payslipV2Document.js +80 -0
- package/src/product/fr/payslip/payslipV2Employee.d.ts +40 -0
- package/src/product/fr/payslip/payslipV2Employee.js +82 -0
- package/src/product/fr/payslip/payslipV2Employer.d.ts +40 -0
- package/src/product/fr/payslip/payslipV2Employer.js +82 -0
- package/src/product/fr/payslip/payslipV2Employment.d.ts +38 -0
- package/src/product/fr/payslip/payslipV2Employment.js +85 -0
- package/src/product/fr/payslip/payslipV2PayDetail.d.ts +46 -0
- package/src/product/fr/payslip/payslipV2PayDetail.js +168 -0
- package/src/product/fr/payslip/payslipV2PayPeriod.d.ts +36 -0
- package/src/product/fr/payslip/payslipV2PayPeriod.js +72 -0
- package/src/product/fr/payslip/payslipV2Pto.d.ts +32 -0
- package/src/product/fr/payslip/payslipV2Pto.js +84 -0
- package/src/product/fr/payslip/payslipV2SalaryDetail.d.ts +34 -0
- package/src/product/fr/payslip/payslipV2SalaryDetail.js +97 -0
- package/src/product/generated/generatedV1.js +2 -1
- package/src/product/index.d.ts +2 -0
- package/src/product/index.js +5 -1
- package/src/product/internal.d.ts +2 -0
- package/src/product/internal.js +3 -1
- package/src/product/invoice/invoiceV4LineItem.d.ts +8 -8
- package/src/product/invoice/invoiceV4LineItem.js +47 -22
- package/src/product/nutritionFactsLabel/index.d.ts +1 -0
- package/src/product/nutritionFactsLabel/index.js +5 -0
- package/src/product/nutritionFactsLabel/internal.d.ts +15 -0
- package/src/product/nutritionFactsLabel/internal.js +33 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.d.ts +16 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.js +27 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.d.ts +53 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.js +117 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.d.ts +36 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.js +107 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.d.ts +30 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.js +65 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.d.ts +34 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.js +89 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.js +84 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.d.ts +32 -0
- package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.js +84 -0
- package/src/product/receipt/receiptV5LineItem.d.ts +4 -4
- package/src/product/receipt/receiptV5LineItem.js +27 -12
- package/src/product/resume/resumeV1Certificate.d.ts +4 -4
- package/src/product/resume/resumeV1Certificate.js +9 -8
- package/src/product/resume/resumeV1Education.d.ts +7 -7
- package/src/product/resume/resumeV1Education.js +15 -14
- package/src/product/resume/resumeV1Language.d.ts +2 -2
- package/src/product/resume/resumeV1Language.js +5 -4
- package/src/product/resume/resumeV1ProfessionalExperience.d.ts +8 -8
- package/src/product/resume/resumeV1ProfessionalExperience.js +17 -16
- package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +2 -2
- package/src/product/resume/resumeV1SocialNetworksUrl.js +5 -4
- package/src/product/us/healthcareCard/healthcareCardV1Copay.d.ts +2 -2
- package/src/product/us/healthcareCard/healthcareCardV1Copay.js +11 -6
- package/src/product/us/usMail/index.d.ts +1 -0
- package/src/product/us/usMail/index.js +5 -0
- package/src/product/us/usMail/usMailV2RecipientAddress.d.ts +7 -7
- package/src/product/us/usMail/usMailV2RecipientAddress.js +17 -15
- package/src/product/us/usMail/usMailV2SenderAddress.d.ts +5 -5
- package/src/product/us/usMail/usMailV2SenderAddress.js +5 -25
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _NutritionFactsLabelV1Sodium_instances, _NutritionFactsLabelV1Sodium_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1Sodium = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The amount of sodium in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1Sodium {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1Sodium_instances.add(this);
|
|
17
|
+
/** Confidence score */
|
|
18
|
+
this.confidence = 0.0;
|
|
19
|
+
/**
|
|
20
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
21
|
+
* the field in the document.
|
|
22
|
+
*/
|
|
23
|
+
this.polygon = [];
|
|
24
|
+
if (prediction["daily_value"] !== undefined &&
|
|
25
|
+
prediction["daily_value"] !== null &&
|
|
26
|
+
!isNaN(prediction["daily_value"])) {
|
|
27
|
+
this.dailyValue = +parseFloat(prediction["daily_value"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dailyValue = null;
|
|
31
|
+
}
|
|
32
|
+
if (prediction["per_100g"] !== undefined &&
|
|
33
|
+
prediction["per_100g"] !== null &&
|
|
34
|
+
!isNaN(prediction["per_100g"])) {
|
|
35
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.per100G = null;
|
|
39
|
+
}
|
|
40
|
+
if (prediction["per_serving"] !== undefined &&
|
|
41
|
+
prediction["per_serving"] !== null &&
|
|
42
|
+
!isNaN(prediction["per_serving"])) {
|
|
43
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.perServing = null;
|
|
47
|
+
}
|
|
48
|
+
this.unit = prediction["unit"];
|
|
49
|
+
this.pageId = prediction["page_id"];
|
|
50
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
51
|
+
if (prediction["polygon"]) {
|
|
52
|
+
this.polygon = prediction.polygon;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Default string representation.
|
|
57
|
+
*/
|
|
58
|
+
toString() {
|
|
59
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1Sodium_instances, "m", _NutritionFactsLabelV1Sodium_printableValues).call(this);
|
|
60
|
+
return ("Daily Value: " +
|
|
61
|
+
printable.dailyValue +
|
|
62
|
+
", Per 100g: " +
|
|
63
|
+
printable.per100G +
|
|
64
|
+
", Per Serving: " +
|
|
65
|
+
printable.perServing +
|
|
66
|
+
", Unit: " +
|
|
67
|
+
printable.unit);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Output in a format suitable for inclusion in a field list.
|
|
71
|
+
*/
|
|
72
|
+
toFieldList() {
|
|
73
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1Sodium_instances, "m", _NutritionFactsLabelV1Sodium_printableValues).call(this);
|
|
74
|
+
return `
|
|
75
|
+
:Daily Value: ${printable.dailyValue}
|
|
76
|
+
:Per 100g: ${printable.per100G}
|
|
77
|
+
:Per Serving: ${printable.perServing}
|
|
78
|
+
:Unit: ${printable.unit}`.trimEnd();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.NutritionFactsLabelV1Sodium = NutritionFactsLabelV1Sodium;
|
|
82
|
+
_NutritionFactsLabelV1Sodium_instances = new WeakSet(), _NutritionFactsLabelV1Sodium_printableValues = function _NutritionFactsLabelV1Sodium_printableValues() {
|
|
83
|
+
return {
|
|
84
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
85
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
86
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
87
|
+
unit: this.unit ?? "",
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The total amount of carbohydrates in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1TotalCarbohydrate {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of total carbohydrates to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of total carbohydrates per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of total carbohydrates per serving of the product. */
|
|
13
|
+
perServing: number | null;
|
|
14
|
+
/** Confidence score */
|
|
15
|
+
confidence: number;
|
|
16
|
+
/** The document page on which the information was found. */
|
|
17
|
+
pageId: number;
|
|
18
|
+
/**
|
|
19
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
20
|
+
* the field in the document.
|
|
21
|
+
*/
|
|
22
|
+
polygon: Polygon;
|
|
23
|
+
constructor({ prediction }: StringDict);
|
|
24
|
+
/**
|
|
25
|
+
* Default string representation.
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Output in a format suitable for inclusion in a field list.
|
|
30
|
+
*/
|
|
31
|
+
toFieldList(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _NutritionFactsLabelV1TotalCarbohydrate_instances, _NutritionFactsLabelV1TotalCarbohydrate_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1TotalCarbohydrate = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The total amount of carbohydrates in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1TotalCarbohydrate {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1TotalCarbohydrate_instances.add(this);
|
|
17
|
+
/** Confidence score */
|
|
18
|
+
this.confidence = 0.0;
|
|
19
|
+
/**
|
|
20
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
21
|
+
* the field in the document.
|
|
22
|
+
*/
|
|
23
|
+
this.polygon = [];
|
|
24
|
+
if (prediction["daily_value"] !== undefined &&
|
|
25
|
+
prediction["daily_value"] !== null &&
|
|
26
|
+
!isNaN(prediction["daily_value"])) {
|
|
27
|
+
this.dailyValue = +parseFloat(prediction["daily_value"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dailyValue = null;
|
|
31
|
+
}
|
|
32
|
+
if (prediction["per_100g"] !== undefined &&
|
|
33
|
+
prediction["per_100g"] !== null &&
|
|
34
|
+
!isNaN(prediction["per_100g"])) {
|
|
35
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.per100G = null;
|
|
39
|
+
}
|
|
40
|
+
if (prediction["per_serving"] !== undefined &&
|
|
41
|
+
prediction["per_serving"] !== null &&
|
|
42
|
+
!isNaN(prediction["per_serving"])) {
|
|
43
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.perServing = null;
|
|
47
|
+
}
|
|
48
|
+
this.pageId = prediction["page_id"];
|
|
49
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
50
|
+
if (prediction["polygon"]) {
|
|
51
|
+
this.polygon = prediction.polygon;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default string representation.
|
|
56
|
+
*/
|
|
57
|
+
toString() {
|
|
58
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalCarbohydrate_instances, "m", _NutritionFactsLabelV1TotalCarbohydrate_printableValues).call(this);
|
|
59
|
+
return ("Daily Value: " +
|
|
60
|
+
printable.dailyValue +
|
|
61
|
+
", Per 100g: " +
|
|
62
|
+
printable.per100G +
|
|
63
|
+
", Per Serving: " +
|
|
64
|
+
printable.perServing);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Output in a format suitable for inclusion in a field list.
|
|
68
|
+
*/
|
|
69
|
+
toFieldList() {
|
|
70
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalCarbohydrate_instances, "m", _NutritionFactsLabelV1TotalCarbohydrate_printableValues).call(this);
|
|
71
|
+
return `
|
|
72
|
+
:Daily Value: ${printable.dailyValue}
|
|
73
|
+
:Per 100g: ${printable.per100G}
|
|
74
|
+
:Per Serving: ${printable.perServing}`.trimEnd();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.NutritionFactsLabelV1TotalCarbohydrate = NutritionFactsLabelV1TotalCarbohydrate;
|
|
78
|
+
_NutritionFactsLabelV1TotalCarbohydrate_instances = new WeakSet(), _NutritionFactsLabelV1TotalCarbohydrate_printableValues = function _NutritionFactsLabelV1TotalCarbohydrate_printableValues() {
|
|
79
|
+
return {
|
|
80
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
81
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
82
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The total amount of fat in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1TotalFat {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of total fat to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of total fat per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of total fat per serving of the product. */
|
|
13
|
+
perServing: number | null;
|
|
14
|
+
/** Confidence score */
|
|
15
|
+
confidence: number;
|
|
16
|
+
/** The document page on which the information was found. */
|
|
17
|
+
pageId: number;
|
|
18
|
+
/**
|
|
19
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
20
|
+
* the field in the document.
|
|
21
|
+
*/
|
|
22
|
+
polygon: Polygon;
|
|
23
|
+
constructor({ prediction }: StringDict);
|
|
24
|
+
/**
|
|
25
|
+
* Default string representation.
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Output in a format suitable for inclusion in a field list.
|
|
30
|
+
*/
|
|
31
|
+
toFieldList(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _NutritionFactsLabelV1TotalFat_instances, _NutritionFactsLabelV1TotalFat_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1TotalFat = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The total amount of fat in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1TotalFat {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1TotalFat_instances.add(this);
|
|
17
|
+
/** Confidence score */
|
|
18
|
+
this.confidence = 0.0;
|
|
19
|
+
/**
|
|
20
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
21
|
+
* the field in the document.
|
|
22
|
+
*/
|
|
23
|
+
this.polygon = [];
|
|
24
|
+
if (prediction["daily_value"] !== undefined &&
|
|
25
|
+
prediction["daily_value"] !== null &&
|
|
26
|
+
!isNaN(prediction["daily_value"])) {
|
|
27
|
+
this.dailyValue = +parseFloat(prediction["daily_value"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dailyValue = null;
|
|
31
|
+
}
|
|
32
|
+
if (prediction["per_100g"] !== undefined &&
|
|
33
|
+
prediction["per_100g"] !== null &&
|
|
34
|
+
!isNaN(prediction["per_100g"])) {
|
|
35
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.per100G = null;
|
|
39
|
+
}
|
|
40
|
+
if (prediction["per_serving"] !== undefined &&
|
|
41
|
+
prediction["per_serving"] !== null &&
|
|
42
|
+
!isNaN(prediction["per_serving"])) {
|
|
43
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.perServing = null;
|
|
47
|
+
}
|
|
48
|
+
this.pageId = prediction["page_id"];
|
|
49
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
50
|
+
if (prediction["polygon"]) {
|
|
51
|
+
this.polygon = prediction.polygon;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default string representation.
|
|
56
|
+
*/
|
|
57
|
+
toString() {
|
|
58
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalFat_instances, "m", _NutritionFactsLabelV1TotalFat_printableValues).call(this);
|
|
59
|
+
return ("Daily Value: " +
|
|
60
|
+
printable.dailyValue +
|
|
61
|
+
", Per 100g: " +
|
|
62
|
+
printable.per100G +
|
|
63
|
+
", Per Serving: " +
|
|
64
|
+
printable.perServing);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Output in a format suitable for inclusion in a field list.
|
|
68
|
+
*/
|
|
69
|
+
toFieldList() {
|
|
70
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalFat_instances, "m", _NutritionFactsLabelV1TotalFat_printableValues).call(this);
|
|
71
|
+
return `
|
|
72
|
+
:Daily Value: ${printable.dailyValue}
|
|
73
|
+
:Per 100g: ${printable.per100G}
|
|
74
|
+
:Per Serving: ${printable.perServing}`.trimEnd();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.NutritionFactsLabelV1TotalFat = NutritionFactsLabelV1TotalFat;
|
|
78
|
+
_NutritionFactsLabelV1TotalFat_instances = new WeakSet(), _NutritionFactsLabelV1TotalFat_printableValues = function _NutritionFactsLabelV1TotalFat_printableValues() {
|
|
79
|
+
return {
|
|
80
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
81
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
82
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The total amount of sugars in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1TotalSugar {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of total sugars to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of total sugars per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of total sugars per serving of the product. */
|
|
13
|
+
perServing: number | null;
|
|
14
|
+
/** Confidence score */
|
|
15
|
+
confidence: number;
|
|
16
|
+
/** The document page on which the information was found. */
|
|
17
|
+
pageId: number;
|
|
18
|
+
/**
|
|
19
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
20
|
+
* the field in the document.
|
|
21
|
+
*/
|
|
22
|
+
polygon: Polygon;
|
|
23
|
+
constructor({ prediction }: StringDict);
|
|
24
|
+
/**
|
|
25
|
+
* Default string representation.
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Output in a format suitable for inclusion in a field list.
|
|
30
|
+
*/
|
|
31
|
+
toFieldList(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _NutritionFactsLabelV1TotalSugar_instances, _NutritionFactsLabelV1TotalSugar_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1TotalSugar = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The total amount of sugars in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1TotalSugar {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1TotalSugar_instances.add(this);
|
|
17
|
+
/** Confidence score */
|
|
18
|
+
this.confidence = 0.0;
|
|
19
|
+
/**
|
|
20
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
21
|
+
* the field in the document.
|
|
22
|
+
*/
|
|
23
|
+
this.polygon = [];
|
|
24
|
+
if (prediction["daily_value"] !== undefined &&
|
|
25
|
+
prediction["daily_value"] !== null &&
|
|
26
|
+
!isNaN(prediction["daily_value"])) {
|
|
27
|
+
this.dailyValue = +parseFloat(prediction["daily_value"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dailyValue = null;
|
|
31
|
+
}
|
|
32
|
+
if (prediction["per_100g"] !== undefined &&
|
|
33
|
+
prediction["per_100g"] !== null &&
|
|
34
|
+
!isNaN(prediction["per_100g"])) {
|
|
35
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.per100G = null;
|
|
39
|
+
}
|
|
40
|
+
if (prediction["per_serving"] !== undefined &&
|
|
41
|
+
prediction["per_serving"] !== null &&
|
|
42
|
+
!isNaN(prediction["per_serving"])) {
|
|
43
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.perServing = null;
|
|
47
|
+
}
|
|
48
|
+
this.pageId = prediction["page_id"];
|
|
49
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
50
|
+
if (prediction["polygon"]) {
|
|
51
|
+
this.polygon = prediction.polygon;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default string representation.
|
|
56
|
+
*/
|
|
57
|
+
toString() {
|
|
58
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalSugar_instances, "m", _NutritionFactsLabelV1TotalSugar_printableValues).call(this);
|
|
59
|
+
return ("Daily Value: " +
|
|
60
|
+
printable.dailyValue +
|
|
61
|
+
", Per 100g: " +
|
|
62
|
+
printable.per100G +
|
|
63
|
+
", Per Serving: " +
|
|
64
|
+
printable.perServing);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Output in a format suitable for inclusion in a field list.
|
|
68
|
+
*/
|
|
69
|
+
toFieldList() {
|
|
70
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TotalSugar_instances, "m", _NutritionFactsLabelV1TotalSugar_printableValues).call(this);
|
|
71
|
+
return `
|
|
72
|
+
:Daily Value: ${printable.dailyValue}
|
|
73
|
+
:Per 100g: ${printable.per100G}
|
|
74
|
+
:Per Serving: ${printable.perServing}`.trimEnd();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.NutritionFactsLabelV1TotalSugar = NutritionFactsLabelV1TotalSugar;
|
|
78
|
+
_NutritionFactsLabelV1TotalSugar_instances = new WeakSet(), _NutritionFactsLabelV1TotalSugar_printableValues = function _NutritionFactsLabelV1TotalSugar_printableValues() {
|
|
79
|
+
return {
|
|
80
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
81
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
82
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The amount of trans fat in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1TransFat {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of trans fat to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of trans fat per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of trans fat per serving of the product. */
|
|
13
|
+
perServing: number | null;
|
|
14
|
+
/** Confidence score */
|
|
15
|
+
confidence: number;
|
|
16
|
+
/** The document page on which the information was found. */
|
|
17
|
+
pageId: number;
|
|
18
|
+
/**
|
|
19
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
20
|
+
* the field in the document.
|
|
21
|
+
*/
|
|
22
|
+
polygon: Polygon;
|
|
23
|
+
constructor({ prediction }: StringDict);
|
|
24
|
+
/**
|
|
25
|
+
* Default string representation.
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Output in a format suitable for inclusion in a field list.
|
|
30
|
+
*/
|
|
31
|
+
toFieldList(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _NutritionFactsLabelV1TransFat_instances, _NutritionFactsLabelV1TransFat_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1TransFat = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The amount of trans fat in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1TransFat {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1TransFat_instances.add(this);
|
|
17
|
+
/** Confidence score */
|
|
18
|
+
this.confidence = 0.0;
|
|
19
|
+
/**
|
|
20
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
21
|
+
* the field in the document.
|
|
22
|
+
*/
|
|
23
|
+
this.polygon = [];
|
|
24
|
+
if (prediction["daily_value"] !== undefined &&
|
|
25
|
+
prediction["daily_value"] !== null &&
|
|
26
|
+
!isNaN(prediction["daily_value"])) {
|
|
27
|
+
this.dailyValue = +parseFloat(prediction["daily_value"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dailyValue = null;
|
|
31
|
+
}
|
|
32
|
+
if (prediction["per_100g"] !== undefined &&
|
|
33
|
+
prediction["per_100g"] !== null &&
|
|
34
|
+
!isNaN(prediction["per_100g"])) {
|
|
35
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.per100G = null;
|
|
39
|
+
}
|
|
40
|
+
if (prediction["per_serving"] !== undefined &&
|
|
41
|
+
prediction["per_serving"] !== null &&
|
|
42
|
+
!isNaN(prediction["per_serving"])) {
|
|
43
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.perServing = null;
|
|
47
|
+
}
|
|
48
|
+
this.pageId = prediction["page_id"];
|
|
49
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
50
|
+
if (prediction["polygon"]) {
|
|
51
|
+
this.polygon = prediction.polygon;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default string representation.
|
|
56
|
+
*/
|
|
57
|
+
toString() {
|
|
58
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TransFat_instances, "m", _NutritionFactsLabelV1TransFat_printableValues).call(this);
|
|
59
|
+
return ("Daily Value: " +
|
|
60
|
+
printable.dailyValue +
|
|
61
|
+
", Per 100g: " +
|
|
62
|
+
printable.per100G +
|
|
63
|
+
", Per Serving: " +
|
|
64
|
+
printable.perServing);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Output in a format suitable for inclusion in a field list.
|
|
68
|
+
*/
|
|
69
|
+
toFieldList() {
|
|
70
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1TransFat_instances, "m", _NutritionFactsLabelV1TransFat_printableValues).call(this);
|
|
71
|
+
return `
|
|
72
|
+
:Daily Value: ${printable.dailyValue}
|
|
73
|
+
:Per 100g: ${printable.per100G}
|
|
74
|
+
:Per Serving: ${printable.perServing}`.trimEnd();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.NutritionFactsLabelV1TransFat = NutritionFactsLabelV1TransFat;
|
|
78
|
+
_NutritionFactsLabelV1TransFat_instances = new WeakSet(), _NutritionFactsLabelV1TransFat_printableValues = function _NutritionFactsLabelV1TransFat_printableValues() {
|
|
79
|
+
return {
|
|
80
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
81
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
82
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -6,13 +6,13 @@ import { Polygon } from "../../geometry";
|
|
|
6
6
|
export declare class ReceiptV5LineItem {
|
|
7
7
|
#private;
|
|
8
8
|
/** The item description. */
|
|
9
|
-
description: string |
|
|
9
|
+
description: string | null;
|
|
10
10
|
/** The item quantity. */
|
|
11
|
-
quantity: number |
|
|
11
|
+
quantity: number | null;
|
|
12
12
|
/** The item total amount. */
|
|
13
|
-
totalAmount: number |
|
|
13
|
+
totalAmount: number | null;
|
|
14
14
|
/** The item unit price. */
|
|
15
|
-
unitPrice: number |
|
|
15
|
+
unitPrice: number | null;
|
|
16
16
|
/** Confidence score */
|
|
17
17
|
confidence: number;
|
|
18
18
|
/** The document page on which the information was found. */
|
|
@@ -7,7 +7,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
7
7
|
var _ReceiptV5LineItem_instances, _ReceiptV5LineItem_printableValues;
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ReceiptV5LineItem = void 0;
|
|
10
|
-
const
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
11
|
/**
|
|
12
12
|
* List of line item details.
|
|
13
13
|
*/
|
|
@@ -22,14 +22,29 @@ class ReceiptV5LineItem {
|
|
|
22
22
|
*/
|
|
23
23
|
this.polygon = [];
|
|
24
24
|
this.description = prediction["description"];
|
|
25
|
-
if (prediction["quantity"]
|
|
26
|
-
|
|
25
|
+
if (prediction["quantity"] !== undefined &&
|
|
26
|
+
prediction["quantity"] !== null &&
|
|
27
|
+
!isNaN(prediction["quantity"])) {
|
|
28
|
+
this.quantity = +parseFloat(prediction["quantity"]);
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
+
else {
|
|
31
|
+
this.quantity = null;
|
|
30
32
|
}
|
|
31
|
-
if (prediction["
|
|
32
|
-
|
|
33
|
+
if (prediction["total_amount"] !== undefined &&
|
|
34
|
+
prediction["total_amount"] !== null &&
|
|
35
|
+
!isNaN(prediction["total_amount"])) {
|
|
36
|
+
this.totalAmount = +parseFloat(prediction["total_amount"]);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.totalAmount = null;
|
|
40
|
+
}
|
|
41
|
+
if (prediction["unit_price"] !== undefined &&
|
|
42
|
+
prediction["unit_price"] !== null &&
|
|
43
|
+
!isNaN(prediction["unit_price"])) {
|
|
44
|
+
this.unitPrice = +parseFloat(prediction["unit_price"]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.unitPrice = null;
|
|
33
48
|
}
|
|
34
49
|
this.pageId = prediction["page_id"];
|
|
35
50
|
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
@@ -72,11 +87,11 @@ _ReceiptV5LineItem_instances = new WeakSet(), _ReceiptV5LineItem_printableValues
|
|
|
72
87
|
return {
|
|
73
88
|
description: this.description ?
|
|
74
89
|
this.description.length <= 36 ?
|
|
75
|
-
this.description :
|
|
76
|
-
this.description.slice(0, 33) + "..." :
|
|
90
|
+
(0, common_1.cleanSpecialChars)(this.description) :
|
|
91
|
+
(0, common_1.cleanSpecialChars)(this.description).slice(0, 33) + "..." :
|
|
77
92
|
"",
|
|
78
|
-
quantity: this.quantity !== undefined ? (0,
|
|
79
|
-
totalAmount: this.totalAmount !== undefined ? (0,
|
|
80
|
-
unitPrice: this.unitPrice !== undefined ? (0,
|
|
93
|
+
quantity: this.quantity !== undefined ? (0, common_1.floatToString)(this.quantity) : "",
|
|
94
|
+
totalAmount: this.totalAmount !== undefined ? (0, common_1.floatToString)(this.totalAmount) : "",
|
|
95
|
+
unitPrice: this.unitPrice !== undefined ? (0, common_1.floatToString)(this.unitPrice) : "",
|
|
81
96
|
};
|
|
82
97
|
};
|
|
@@ -6,13 +6,13 @@ import { Polygon } from "../../geometry";
|
|
|
6
6
|
export declare class ResumeV1Certificate {
|
|
7
7
|
#private;
|
|
8
8
|
/** The grade obtained for the certificate. */
|
|
9
|
-
grade: string |
|
|
9
|
+
grade: string | null;
|
|
10
10
|
/** The name of certification. */
|
|
11
|
-
name: string |
|
|
11
|
+
name: string | null;
|
|
12
12
|
/** The organization or institution that issued the certificate. */
|
|
13
|
-
provider: string |
|
|
13
|
+
provider: string | null;
|
|
14
14
|
/** The year when a certificate was issued or received. */
|
|
15
|
-
year: string |
|
|
15
|
+
year: string | null;
|
|
16
16
|
/** Confidence score */
|
|
17
17
|
confidence: number;
|
|
18
18
|
/** The document page on which the information was found. */
|