mindee 4.15.0 → 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 +15 -0
- package/package.json +1 -1
- package/src/parsing/common/index.d.ts +1 -0
- package/src/parsing/common/index.js +4 -1
- package/src/parsing/common/summaryHelper.d.ts +10 -0
- package/src/parsing/common/summaryHelper.js +27 -1
- 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/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/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,36 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The amount of nutrients in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1Nutrient {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of nutrients to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The name of nutrients of the product. */
|
|
11
|
+
name: string | null;
|
|
12
|
+
/** The amount of nutrients per 100g of the product. */
|
|
13
|
+
per100G: number | null;
|
|
14
|
+
/** The amount of nutrients per serving of the product. */
|
|
15
|
+
perServing: number | null;
|
|
16
|
+
/** The unit of measurement for the amount of nutrients. */
|
|
17
|
+
unit: string | null;
|
|
18
|
+
/** Confidence score */
|
|
19
|
+
confidence: number;
|
|
20
|
+
/** The document page on which the information was found. */
|
|
21
|
+
pageId: number;
|
|
22
|
+
/**
|
|
23
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
24
|
+
* the field in the document.
|
|
25
|
+
*/
|
|
26
|
+
polygon: Polygon;
|
|
27
|
+
constructor({ prediction }: StringDict);
|
|
28
|
+
/**
|
|
29
|
+
* Default string representation.
|
|
30
|
+
*/
|
|
31
|
+
toString(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
34
|
+
*/
|
|
35
|
+
toTableLine(): string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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 _NutritionFactsLabelV1Nutrient_instances, _NutritionFactsLabelV1Nutrient_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1Nutrient = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The amount of nutrients in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1Nutrient {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1Nutrient_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
|
+
this.name = prediction["name"];
|
|
33
|
+
if (prediction["per_100g"] !== undefined &&
|
|
34
|
+
prediction["per_100g"] !== null &&
|
|
35
|
+
!isNaN(prediction["per_100g"])) {
|
|
36
|
+
this.per100G = +parseFloat(prediction["per_100g"]);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.per100G = null;
|
|
40
|
+
}
|
|
41
|
+
if (prediction["per_serving"] !== undefined &&
|
|
42
|
+
prediction["per_serving"] !== null &&
|
|
43
|
+
!isNaN(prediction["per_serving"])) {
|
|
44
|
+
this.perServing = +parseFloat(prediction["per_serving"]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.perServing = null;
|
|
48
|
+
}
|
|
49
|
+
this.unit = prediction["unit"];
|
|
50
|
+
this.pageId = prediction["page_id"];
|
|
51
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
52
|
+
if (prediction["polygon"]) {
|
|
53
|
+
this.polygon = prediction.polygon;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Default string representation.
|
|
58
|
+
*/
|
|
59
|
+
toString() {
|
|
60
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1Nutrient_instances, "m", _NutritionFactsLabelV1Nutrient_printableValues).call(this);
|
|
61
|
+
return ("Daily Value: " +
|
|
62
|
+
printable.dailyValue +
|
|
63
|
+
", Name: " +
|
|
64
|
+
printable.name +
|
|
65
|
+
", Per 100g: " +
|
|
66
|
+
printable.per100G +
|
|
67
|
+
", Per Serving: " +
|
|
68
|
+
printable.perServing +
|
|
69
|
+
", Unit: " +
|
|
70
|
+
printable.unit);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Output in a format suitable for inclusion in an rST table.
|
|
74
|
+
*/
|
|
75
|
+
toTableLine() {
|
|
76
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1Nutrient_instances, "m", _NutritionFactsLabelV1Nutrient_printableValues).call(this);
|
|
77
|
+
return ("| " +
|
|
78
|
+
printable.dailyValue.padEnd(11) +
|
|
79
|
+
" | " +
|
|
80
|
+
printable.name.padEnd(20) +
|
|
81
|
+
" | " +
|
|
82
|
+
printable.per100G.padEnd(8) +
|
|
83
|
+
" | " +
|
|
84
|
+
printable.perServing.padEnd(11) +
|
|
85
|
+
" | " +
|
|
86
|
+
printable.unit.padEnd(4) +
|
|
87
|
+
" |");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.NutritionFactsLabelV1Nutrient = NutritionFactsLabelV1Nutrient;
|
|
91
|
+
_NutritionFactsLabelV1Nutrient_instances = new WeakSet(), _NutritionFactsLabelV1Nutrient_printableValues = function _NutritionFactsLabelV1Nutrient_printableValues() {
|
|
92
|
+
return {
|
|
93
|
+
dailyValue: this.dailyValue !== undefined ? (0, common_1.floatToString)(this.dailyValue) : "",
|
|
94
|
+
name: this.name ?
|
|
95
|
+
this.name.length <= 20 ?
|
|
96
|
+
(0, common_1.cleanSpecialChars)(this.name) :
|
|
97
|
+
(0, common_1.cleanSpecialChars)(this.name).slice(0, 17) + "..." :
|
|
98
|
+
"",
|
|
99
|
+
per100G: this.per100G !== undefined ? (0, common_1.floatToString)(this.per100G) : "",
|
|
100
|
+
perServing: this.perServing !== undefined ? (0, common_1.floatToString)(this.perServing) : "",
|
|
101
|
+
unit: this.unit ?
|
|
102
|
+
this.unit.length <= 4 ?
|
|
103
|
+
(0, common_1.cleanSpecialChars)(this.unit) :
|
|
104
|
+
(0, common_1.cleanSpecialChars)(this.unit).slice(0, 1) + "..." :
|
|
105
|
+
"",
|
|
106
|
+
};
|
|
107
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The amount of protein in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1Protein {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of protein to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of protein per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of protein 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 _NutritionFactsLabelV1Protein_instances, _NutritionFactsLabelV1Protein_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1Protein = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The amount of protein in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1Protein {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1Protein_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, _NutritionFactsLabelV1Protein_instances, "m", _NutritionFactsLabelV1Protein_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, _NutritionFactsLabelV1Protein_instances, "m", _NutritionFactsLabelV1Protein_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.NutritionFactsLabelV1Protein = NutritionFactsLabelV1Protein;
|
|
78
|
+
_NutritionFactsLabelV1Protein_instances = new WeakSet(), _NutritionFactsLabelV1Protein_printableValues = function _NutritionFactsLabelV1Protein_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 saturated fat in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1SaturatedFat {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of saturated fat to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of saturated fat per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of saturated 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 _NutritionFactsLabelV1SaturatedFat_instances, _NutritionFactsLabelV1SaturatedFat_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1SaturatedFat = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The amount of saturated fat in the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1SaturatedFat {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1SaturatedFat_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, _NutritionFactsLabelV1SaturatedFat_instances, "m", _NutritionFactsLabelV1SaturatedFat_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, _NutritionFactsLabelV1SaturatedFat_instances, "m", _NutritionFactsLabelV1SaturatedFat_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.NutritionFactsLabelV1SaturatedFat = NutritionFactsLabelV1SaturatedFat;
|
|
78
|
+
_NutritionFactsLabelV1SaturatedFat_instances = new WeakSet(), _NutritionFactsLabelV1SaturatedFat_printableValues = function _NutritionFactsLabelV1SaturatedFat_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,30 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The size of a single serving of the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1ServingSize {
|
|
7
|
+
#private;
|
|
8
|
+
/** The amount of a single serving. */
|
|
9
|
+
amount: number | null;
|
|
10
|
+
/** The unit for the amount of a single serving. */
|
|
11
|
+
unit: string | null;
|
|
12
|
+
/** Confidence score */
|
|
13
|
+
confidence: number;
|
|
14
|
+
/** The document page on which the information was found. */
|
|
15
|
+
pageId: number;
|
|
16
|
+
/**
|
|
17
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
18
|
+
* the field in the document.
|
|
19
|
+
*/
|
|
20
|
+
polygon: Polygon;
|
|
21
|
+
constructor({ prediction }: StringDict);
|
|
22
|
+
/**
|
|
23
|
+
* Default string representation.
|
|
24
|
+
*/
|
|
25
|
+
toString(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Output in a format suitable for inclusion in a field list.
|
|
28
|
+
*/
|
|
29
|
+
toFieldList(): string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 _NutritionFactsLabelV1ServingSize_instances, _NutritionFactsLabelV1ServingSize_printableValues;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NutritionFactsLabelV1ServingSize = void 0;
|
|
10
|
+
const common_1 = require("../../parsing/common");
|
|
11
|
+
/**
|
|
12
|
+
* The size of a single serving of the product.
|
|
13
|
+
*/
|
|
14
|
+
class NutritionFactsLabelV1ServingSize {
|
|
15
|
+
constructor({ prediction = {} }) {
|
|
16
|
+
_NutritionFactsLabelV1ServingSize_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["amount"] !== undefined &&
|
|
25
|
+
prediction["amount"] !== null &&
|
|
26
|
+
!isNaN(prediction["amount"])) {
|
|
27
|
+
this.amount = +parseFloat(prediction["amount"]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.amount = null;
|
|
31
|
+
}
|
|
32
|
+
this.unit = prediction["unit"];
|
|
33
|
+
this.pageId = prediction["page_id"];
|
|
34
|
+
this.confidence = prediction["confidence"] ? prediction.confidence : 0.0;
|
|
35
|
+
if (prediction["polygon"]) {
|
|
36
|
+
this.polygon = prediction.polygon;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Default string representation.
|
|
41
|
+
*/
|
|
42
|
+
toString() {
|
|
43
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1ServingSize_instances, "m", _NutritionFactsLabelV1ServingSize_printableValues).call(this);
|
|
44
|
+
return ("Amount: " +
|
|
45
|
+
printable.amount +
|
|
46
|
+
", Unit: " +
|
|
47
|
+
printable.unit);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Output in a format suitable for inclusion in a field list.
|
|
51
|
+
*/
|
|
52
|
+
toFieldList() {
|
|
53
|
+
const printable = __classPrivateFieldGet(this, _NutritionFactsLabelV1ServingSize_instances, "m", _NutritionFactsLabelV1ServingSize_printableValues).call(this);
|
|
54
|
+
return `
|
|
55
|
+
:Amount: ${printable.amount}
|
|
56
|
+
:Unit: ${printable.unit}`.trimEnd();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.NutritionFactsLabelV1ServingSize = NutritionFactsLabelV1ServingSize;
|
|
60
|
+
_NutritionFactsLabelV1ServingSize_instances = new WeakSet(), _NutritionFactsLabelV1ServingSize_printableValues = function _NutritionFactsLabelV1ServingSize_printableValues() {
|
|
61
|
+
return {
|
|
62
|
+
amount: this.amount !== undefined ? (0, common_1.floatToString)(this.amount) : "",
|
|
63
|
+
unit: this.unit ?? "",
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StringDict } from "../../parsing/common";
|
|
2
|
+
import { Polygon } from "../../geometry";
|
|
3
|
+
/**
|
|
4
|
+
* The amount of sodium in the product.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NutritionFactsLabelV1Sodium {
|
|
7
|
+
#private;
|
|
8
|
+
/** DVs are the recommended amounts of sodium to consume or not to exceed each day. */
|
|
9
|
+
dailyValue: number | null;
|
|
10
|
+
/** The amount of sodium per 100g of the product. */
|
|
11
|
+
per100G: number | null;
|
|
12
|
+
/** The amount of sodium per serving of the product. */
|
|
13
|
+
perServing: number | null;
|
|
14
|
+
/** The unit of measurement for the amount of sodium. */
|
|
15
|
+
unit: string | null;
|
|
16
|
+
/** Confidence score */
|
|
17
|
+
confidence: number;
|
|
18
|
+
/** The document page on which the information was found. */
|
|
19
|
+
pageId: number;
|
|
20
|
+
/**
|
|
21
|
+
* Contains the relative vertices coordinates (points) of a polygon containing
|
|
22
|
+
* the field in the document.
|
|
23
|
+
*/
|
|
24
|
+
polygon: Polygon;
|
|
25
|
+
constructor({ prediction }: StringDict);
|
|
26
|
+
/**
|
|
27
|
+
* Default string representation.
|
|
28
|
+
*/
|
|
29
|
+
toString(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Output in a format suitable for inclusion in a field list.
|
|
32
|
+
*/
|
|
33
|
+
toFieldList(): string;
|
|
34
|
+
}
|
|
@@ -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
|
+
}
|