@peabody-soft/mbs-model-ts 1.3.0 → 1.5.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/dist/CartEditor.d.ts +10 -5
- package/dist/CartEditor.js +232 -125
- package/dist/Catalog.js +26 -18
- package/dist/Enums.d.ts +1 -1
- package/dist/Enums.js +2 -1
- package/dist/GeneralSettings.d.ts +4 -2
- package/dist/GeneralSettings.js +18 -7
- package/dist/Ids.d.ts +2 -0
- package/dist/Ids.js +10 -0
- package/dist/Message.js +3 -2
- package/dist/Model.d.ts +5 -0
- package/dist/Model.js +263 -50
- package/dist/Package.js +2 -2
- package/dist/Price.js +6 -2
- package/dist/Product.d.ts +5 -3
- package/dist/Product.js +30 -18
- package/dist/Profile.d.ts +1 -0
- package/dist/Profile.js +91 -4
- package/dist/ProtoMap.d.ts +15 -8
- package/dist/ProtoMap.js +267 -140
- package/dist/ShoppingList.d.ts +30 -1
- package/dist/ShoppingList.js +345 -35
- package/dist/SyncCache.d.ts +9 -0
- package/dist/SyncCache.js +93 -30
- package/dist/SyncState.js +1 -1
- package/dist/Tax.d.ts +12 -4
- package/dist/Tax.js +33 -4
- package/dist/TaxHelper.d.ts +12 -0
- package/dist/TaxHelper.js +93 -0
- package/dist/TaxType.d.ts +7 -0
- package/dist/TaxType.js +32 -0
- package/dist/WorkingDays.d.ts +3 -2
- package/dist/WorkingDays.js +16 -12
- package/dist/generated/AttachmentType.d.ts +19 -1
- package/dist/generated/AttachmentType.js +18 -0
- package/dist/generated/AuthTokens.d.ts +3 -1
- package/dist/generated/BusinessLink.d.ts +4 -1
- package/dist/generated/BusinessSyncInRequest.d.ts +11 -3
- package/dist/generated/BusinessSyncInResponse.d.ts +5 -4
- package/dist/generated/BusinessSyncOutRequest.d.ts +37 -10
- package/dist/generated/BusinessSyncOutRequest.js +42 -29
- package/dist/generated/BusinessSyncOutResponse.d.ts +14 -1
- package/dist/generated/Configuration.d.ts +2 -1
- package/dist/generated/CreateUserRequest.d.ts +8 -2
- package/dist/generated/Entity.d.ts +7 -3
- package/dist/generated/GeneralSettings.d.ts +14 -4
- package/dist/generated/GeneralSettings.js +9 -1
- package/dist/generated/Message.d.ts +4 -2
- package/dist/generated/Product.d.ts +10 -1
- package/dist/generated/Product.js +9 -1
- package/dist/generated/ProfileSyncOutRequest.d.ts +17 -1
- package/dist/generated/ProfileSyncOutResponse.d.ts +8 -3
- package/dist/generated/SalesOrderPayload.d.ts +7 -2
- package/dist/generated/ShoppingList.d.ts +6 -3
- package/dist/generated/ShoppingListItem.d.ts +21 -6
- package/dist/generated/Tax.d.ts +4 -4
- package/dist/generated/Tax.js +7 -8
- package/dist/generated/WorkingDays.d.ts +9 -1
- package/dist/generated/WorkingDays.js +12 -4
- package/dist/generated/WorkingHoursRange.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/package.json +55 -55
- package/dist/generated/TaxType.d.ts +0 -25
- package/dist/generated/TaxType.js +0 -30
|
@@ -8,8 +8,21 @@ import { Tax } from "./Tax";
|
|
|
8
8
|
/**
|
|
9
9
|
* A line item in a shopping list: the package bought, how much, and at what price.
|
|
10
10
|
* Excluded: batches.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* Every field here is exactly the member of the same name in the Java class ShoppingListItem, with the same meaning,
|
|
13
|
+
* and is converted to and from it by copying: nothing is calculated. In particular, the prices (unitPrice and
|
|
14
|
+
* priceDiscount) are the prices WITHOUT taxes. Taxes are calculated from them, as follows:
|
|
15
|
+
* tax base = unitPrice x quantity, rounded half up to a whole amount, where the quantity is
|
|
16
|
+
* (quantity / Constants.QUANTITY_FACTOR) worked out in 32 bit floating point (a float), and then widened to
|
|
17
|
+
* a double to multiply it by unitPrice. Java does Math.round((double) unitPrice * (double) (quantity / 1000f)),
|
|
18
|
+
* and that is to be matched exactly: dividing in double precision, or multiplying the integers first,
|
|
19
|
+
* differs at exact halves. A unitPrice of 5 and a quantity of 700 (0.7) has a tax base of 3 here, because
|
|
20
|
+
* 0.7f is a little under 0.7, and of 4 in double precision
|
|
21
|
+
* each tax = tax base x the rate of the tax / Constants.TAX_RATE_FACTOR, rounded half up (each tax is rounded
|
|
22
|
+
* separately). Taxes only apply to a tax base that is greater than zero
|
|
23
|
+
* finalPrice = tax base + all the taxes - discount (not less than 0). Note that discount is taken off the price
|
|
24
|
+
* with taxes
|
|
25
|
+
* Not included because it is derived: tax amounts, totalTax, finalPrice.
|
|
13
26
|
*
|
|
14
27
|
* @generated from protobuf message com.merabills.storefront.ShoppingListItem
|
|
15
28
|
*/
|
|
@@ -28,14 +41,16 @@ export interface ShoppingListItem {
|
|
|
28
41
|
*/
|
|
29
42
|
quantity: number;
|
|
30
43
|
/**
|
|
31
|
-
* Price of one unit of the package, multiplied by
|
|
44
|
+
* Price of one unit of the package, WITHOUT taxes (the taxes in taxes are calculated on top of it), multiplied by
|
|
45
|
+
* Constants.AMOUNT_FACTOR.
|
|
32
46
|
* This is the offer price when the package is on offer.
|
|
33
47
|
*
|
|
34
48
|
* @generated from protobuf field: int64 unitPrice = 3
|
|
35
49
|
*/
|
|
36
50
|
unitPrice: bigint;
|
|
37
51
|
/**
|
|
38
|
-
* Position of this item in the shopping list (0 to Constants.SHOPPING_LIST_ITEM_MAX_ORDER)
|
|
52
|
+
* Position of this item in the shopping list (0 to Constants.SHOPPING_LIST_ITEM_MAX_ORDER). A message with one that is
|
|
53
|
+
* outside of that is refused (400), and not read as some other position.
|
|
39
54
|
*
|
|
40
55
|
* @generated from protobuf field: int32 shoppingListOrder = 4
|
|
41
56
|
*/
|
|
@@ -57,8 +72,8 @@ export interface ShoppingListItem {
|
|
|
57
72
|
*/
|
|
58
73
|
isStockKeepingRequired: boolean;
|
|
59
74
|
/**
|
|
60
|
-
* Discount in the unit price (regularPrice - offerPrice of the package), multiplied by
|
|
61
|
-
* Constants.AMOUNT_FACTOR
|
|
75
|
+
* Discount in the unit price (regularPrice - offerPrice of the package, both WITHOUT taxes), multiplied by
|
|
76
|
+
* Constants.AMOUNT_FACTOR. So, the regular price of one unit, without taxes, is unitPrice + priceDiscount.
|
|
62
77
|
*
|
|
63
78
|
* @generated from protobuf field: int64 priceDiscount = 8
|
|
64
79
|
*/
|
package/dist/generated/Tax.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
|
4
4
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
5
5
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
6
6
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
|
-
import { TaxType } from "./TaxType";
|
|
8
7
|
/**
|
|
9
8
|
* A tax and the rate at which it applies. Replaces the parallel taxCodes / taxRates arrays in Java.
|
|
10
9
|
*
|
|
@@ -12,11 +11,12 @@ import { TaxType } from "./TaxType";
|
|
|
12
11
|
*/
|
|
13
12
|
export interface Tax {
|
|
14
13
|
/**
|
|
15
|
-
*
|
|
14
|
+
* The raw tax code: 0 to 127, and meaningful only within the country of the business the tax is on,
|
|
15
|
+
* which both ends already hold (Business.countryCode). A client names a tax by combining the two.
|
|
16
16
|
*
|
|
17
|
-
* @generated from protobuf field:
|
|
17
|
+
* @generated from protobuf field: int32 taxCode = 1
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
taxCode: number;
|
|
20
20
|
/**
|
|
21
21
|
* Tax rate, multiplied by Constants.TAX_RATE_FACTOR. 18% is stored as 1800.
|
|
22
22
|
*
|
package/dist/generated/Tax.js
CHANGED
|
@@ -2,18 +2,17 @@ import { WireType } from "@protobuf-ts/runtime";
|
|
|
2
2
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
3
3
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
4
4
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
5
|
-
import { TaxType } from "./TaxType";
|
|
6
5
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
7
6
|
class Tax$Type extends MessageType {
|
|
8
7
|
constructor() {
|
|
9
8
|
super("com.merabills.storefront.Tax", [
|
|
10
|
-
{ no: 1, name: "
|
|
9
|
+
{ no: 1, name: "taxCode", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
|
11
10
|
{ no: 2, name: "rate", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
|
12
11
|
]);
|
|
13
12
|
}
|
|
14
13
|
create(value) {
|
|
15
14
|
const message = globalThis.Object.create((this.messagePrototype));
|
|
16
|
-
message.
|
|
15
|
+
message.taxCode = 0;
|
|
17
16
|
message.rate = 0;
|
|
18
17
|
if (value !== undefined)
|
|
19
18
|
reflectionMergePartial(this, message, value);
|
|
@@ -24,8 +23,8 @@ class Tax$Type extends MessageType {
|
|
|
24
23
|
while (reader.pos < end) {
|
|
25
24
|
let [fieldNo, wireType] = reader.tag();
|
|
26
25
|
switch (fieldNo) {
|
|
27
|
-
case /*
|
|
28
|
-
message.
|
|
26
|
+
case /* int32 taxCode */ 1:
|
|
27
|
+
message.taxCode = reader.int32();
|
|
29
28
|
break;
|
|
30
29
|
case /* int32 rate */ 2:
|
|
31
30
|
message.rate = reader.int32();
|
|
@@ -42,9 +41,9 @@ class Tax$Type extends MessageType {
|
|
|
42
41
|
return message;
|
|
43
42
|
}
|
|
44
43
|
internalBinaryWrite(message, writer, options) {
|
|
45
|
-
/*
|
|
46
|
-
if (message.
|
|
47
|
-
writer.tag(1, WireType.Varint).int32(message.
|
|
44
|
+
/* int32 taxCode = 1; */
|
|
45
|
+
if (message.taxCode !== 0)
|
|
46
|
+
writer.tag(1, WireType.Varint).int32(message.taxCode);
|
|
48
47
|
/* int32 rate = 2; */
|
|
49
48
|
if (message.rate !== 0)
|
|
50
49
|
writer.tag(2, WireType.Varint).int32(message.rate);
|
|
@@ -20,12 +20,20 @@ export interface WorkingDays {
|
|
|
20
20
|
* @generated from protobuf field: repeated bool days = 1
|
|
21
21
|
*/
|
|
22
22
|
days: boolean[];
|
|
23
|
+
/**
|
|
24
|
+
* The IANA ID of the time zone the working hours are specified in, for example "Asia/Kolkata";
|
|
25
|
+
* never an abbreviation like "IST", which is ambiguous. At most 64 characters. Empty means it
|
|
26
|
+
* was never specified, as in settings saved before this field existed.
|
|
27
|
+
*
|
|
28
|
+
* @generated from protobuf field: string timeZone = 2
|
|
29
|
+
*/
|
|
30
|
+
timeZone: string;
|
|
23
31
|
/**
|
|
24
32
|
* Working hours of each day, indexed as days above (entry 0 = Sunday); up to
|
|
25
33
|
* Constants.DAYS_IN_WEEK entries, fewer is normal. A missing entry, or one with no ranges, means
|
|
26
34
|
* work all day; only meaningful on a day whose days entry is true.
|
|
27
35
|
*
|
|
28
|
-
* @generated from protobuf field: repeated com.merabills.storefront.WorkingHours workingHours =
|
|
36
|
+
* @generated from protobuf field: repeated com.merabills.storefront.WorkingHours workingHours = 3
|
|
29
37
|
*/
|
|
30
38
|
workingHours: WorkingHours[];
|
|
31
39
|
}
|
|
@@ -8,12 +8,14 @@ class WorkingDays$Type extends MessageType {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super("com.merabills.storefront.WorkingDays", [
|
|
10
10
|
{ no: 1, name: "days", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 8 /*ScalarType.BOOL*/ },
|
|
11
|
-
{ no: 2, name: "
|
|
11
|
+
{ no: 2, name: "timeZone", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
12
|
+
{ no: 3, name: "workingHours", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => WorkingHours }
|
|
12
13
|
]);
|
|
13
14
|
}
|
|
14
15
|
create(value) {
|
|
15
16
|
const message = globalThis.Object.create((this.messagePrototype));
|
|
16
17
|
message.days = [];
|
|
18
|
+
message.timeZone = "";
|
|
17
19
|
message.workingHours = [];
|
|
18
20
|
if (value !== undefined)
|
|
19
21
|
reflectionMergePartial(this, message, value);
|
|
@@ -31,7 +33,10 @@ class WorkingDays$Type extends MessageType {
|
|
|
31
33
|
else
|
|
32
34
|
message.days.push(reader.bool());
|
|
33
35
|
break;
|
|
34
|
-
case /*
|
|
36
|
+
case /* string timeZone */ 2:
|
|
37
|
+
message.timeZone = reader.string();
|
|
38
|
+
break;
|
|
39
|
+
case /* repeated com.merabills.storefront.WorkingHours workingHours */ 3:
|
|
35
40
|
message.workingHours.push(WorkingHours.internalBinaryRead(reader, reader.uint32(), options));
|
|
36
41
|
break;
|
|
37
42
|
default:
|
|
@@ -53,9 +58,12 @@ class WorkingDays$Type extends MessageType {
|
|
|
53
58
|
writer.bool(message.days[i]);
|
|
54
59
|
writer.join();
|
|
55
60
|
}
|
|
56
|
-
/*
|
|
61
|
+
/* string timeZone = 2; */
|
|
62
|
+
if (message.timeZone !== "")
|
|
63
|
+
writer.tag(2, WireType.LengthDelimited).string(message.timeZone);
|
|
64
|
+
/* repeated com.merabills.storefront.WorkingHours workingHours = 3; */
|
|
57
65
|
for (let i = 0; i < message.workingHours.length; i++)
|
|
58
|
-
WorkingHours.internalBinaryWrite(message.workingHours[i], writer.tag(
|
|
66
|
+
WorkingHours.internalBinaryWrite(message.workingHours[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
59
67
|
let u = options.writeUnknownFields;
|
|
60
68
|
if (u !== false)
|
|
61
69
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -5,8 +5,8 @@ import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
|
5
5
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
6
6
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
7
|
/**
|
|
8
|
-
* A single stretch of working hours within a day, in minutes after local midnight (
|
|
9
|
-
* carried -
|
|
8
|
+
* A single stretch of working hours within a day, in minutes after local midnight (the time zone is
|
|
9
|
+
* not carried here - it is WorkingDays.timeZone).
|
|
10
10
|
* A range never spans midnight; work past midnight is two ranges - one closing at
|
|
11
11
|
* Constants.MINUTES_PER_DAY, one opening at 0 the next day.
|
|
12
12
|
* Not included because it is derived: isAllDay, contains, overlaps.
|
package/dist/index.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export { default as LatLong } from "./LatLong";
|
|
|
37
37
|
export { Dimensions, Weight } from "./Measures";
|
|
38
38
|
export { default as PackageIdentifier } from "./PackageIdentifier";
|
|
39
39
|
export { default as PaymentMethodDetail } from "./PaymentMethodDetail";
|
|
40
|
-
export { default as ShoppingList, ShoppingListItem } from "./ShoppingList";
|
|
41
|
-
export { default as Tax } from "./Tax";
|
|
40
|
+
export { default as ShoppingList, ItemChange, ShoppingListItem } from "./ShoppingList";
|
|
41
|
+
export { default as Tax, TaxAmount } from "./Tax";
|
|
42
42
|
export { default as WorkingDays, WorkingHours, WorkingHoursRange } from "./WorkingDays";
|
|
43
43
|
export * from "./Enums";
|
|
44
44
|
export { Constants, MERABILLS_ONLINE_PRICE_LIST_ID, buildPriceListId } from "./Constants";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The public surface of this library. Deliberately excludes Attachment (UIs get Photo instead), the sync layer's internal cursors,
|
|
2
2
|
// the auth tokens (except BusinessLink.linkToken, which the protocol hands to a client), ProtoMap (the wire boundary, except buildAuthTokensBytes),
|
|
3
|
-
//
|
|
3
|
+
// the scaled-value conversions of Constants.ts (amounts, quantities and tax rates are already unscaled on every getter; ProtoMap is the only caller that needs to convert one),
|
|
4
|
+
// and TaxHelper, the tax arithmetic, which works in those scaled values (a UI reads a tax off a ShoppingListItem, a ShoppingList or a CartLine, which have done it already).
|
|
4
5
|
export { default as Model } from "./Model";
|
|
5
6
|
export * as ContainerNames from "./ContainerNames";
|
|
6
7
|
export { buildAuthTokensBytes } from "./ProtoMap";
|
|
@@ -40,8 +41,8 @@ export { default as LatLong } from "./LatLong";
|
|
|
40
41
|
export { Dimensions, Weight } from "./Measures";
|
|
41
42
|
export { default as PackageIdentifier } from "./PackageIdentifier";
|
|
42
43
|
export { default as PaymentMethodDetail } from "./PaymentMethodDetail";
|
|
43
|
-
export { default as ShoppingList, ShoppingListItem } from "./ShoppingList";
|
|
44
|
-
export { default as Tax } from "./Tax";
|
|
44
|
+
export { default as ShoppingList, ItemChange, ShoppingListItem } from "./ShoppingList";
|
|
45
|
+
export { default as Tax, TaxAmount } from "./Tax";
|
|
45
46
|
export { default as WorkingDays, WorkingHours, WorkingHoursRange } from "./WorkingDays";
|
|
46
47
|
// The enums of the protocol, the limits it obeys, and how an id is read. The price list a
|
|
47
48
|
// storefront sells from is on the surface because a UI naming it on a cart it is building needs
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@peabody-soft/mbs-model-ts",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "MeraBills storefront client-side model (TypeScript)",
|
|
5
|
-
"author": "Peabody Soft",
|
|
6
|
-
"license": "AGPL-3.0-or-later",
|
|
7
|
-
"homepage": "https://merabills.com",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"MeraBills",
|
|
10
|
-
"Peabody Soft",
|
|
11
|
-
"Model",
|
|
12
|
-
"Storefront",
|
|
13
|
-
"Mock",
|
|
14
|
-
"TypeScript"
|
|
15
|
-
],
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
},
|
|
19
|
-
"main": "./dist/index.js",
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./dist/index.d.ts",
|
|
24
|
-
"default": "./dist/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./dist/*": {
|
|
27
|
-
"types": "./dist/*.d.ts",
|
|
28
|
-
"default": "./dist/*.js"
|
|
29
|
-
},
|
|
30
|
-
"./generated/*": {
|
|
31
|
-
"types": "./dist/generated/*.d.ts",
|
|
32
|
-
"default": "./dist/generated/*.js"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"files": [
|
|
36
|
-
"dist/**",
|
|
37
|
-
"!dist/**/*.map",
|
|
38
|
-
"!USAGE.md"
|
|
39
|
-
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"generate": "node generate.mjs",
|
|
42
|
-
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
43
|
-
"build": "npm run generate && npm run clean && tsc",
|
|
44
|
-
"typecheck": "npm run generate && tsc --noEmit",
|
|
45
|
-
"prepack": "npm run build"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@protobuf-ts/plugin": "^2.11.1",
|
|
49
|
-
"typescript": "^7.0.2"
|
|
50
|
-
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@peabody-soft/mbs-protos": "^1.
|
|
53
|
-
"@protobuf-ts/runtime": "^2.11.1"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@peabody-soft/mbs-model-ts",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "MeraBills storefront client-side model (TypeScript)",
|
|
5
|
+
"author": "Peabody Soft",
|
|
6
|
+
"license": "AGPL-3.0-or-later",
|
|
7
|
+
"homepage": "https://merabills.com",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"MeraBills",
|
|
10
|
+
"Peabody Soft",
|
|
11
|
+
"Model",
|
|
12
|
+
"Storefront",
|
|
13
|
+
"Mock",
|
|
14
|
+
"TypeScript"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./dist/*": {
|
|
27
|
+
"types": "./dist/*.d.ts",
|
|
28
|
+
"default": "./dist/*.js"
|
|
29
|
+
},
|
|
30
|
+
"./generated/*": {
|
|
31
|
+
"types": "./dist/generated/*.d.ts",
|
|
32
|
+
"default": "./dist/generated/*.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/**",
|
|
37
|
+
"!dist/**/*.map",
|
|
38
|
+
"!USAGE.md"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"generate": "node generate.mjs",
|
|
42
|
+
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
43
|
+
"build": "npm run generate && npm run clean && tsc",
|
|
44
|
+
"typecheck": "npm run generate && tsc --noEmit",
|
|
45
|
+
"prepack": "npm run build"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@protobuf-ts/plugin": "^2.11.1",
|
|
49
|
+
"typescript": "^7.0.2"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@peabody-soft/mbs-protos": "^1.11.0",
|
|
53
|
+
"@protobuf-ts/runtime": "^2.11.1"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A tax that applies to a product or to a line item. A raw Java tax code is only unique within a
|
|
3
|
-
* country, so values here are not that raw code: they are computed ids, TaxType.createId(country,
|
|
4
|
-
* taxCode) = (country.getNumeric() << 8) | taxCode, making each value globally unique and
|
|
5
|
-
* self-describing rather than meaningful only together with some other, separately carried country
|
|
6
|
-
* code. A client can recover the ISO 3166-1 numeric country code with (value >> 8); it cannot
|
|
7
|
-
* recover the raw tax code beyond the low 8 bits, and does not need to - the enum name already
|
|
8
|
-
* carries that meaning.
|
|
9
|
-
*
|
|
10
|
-
* @generated from protobuf enum com.merabills.storefront.TaxType
|
|
11
|
-
*/
|
|
12
|
-
export declare enum TaxType {
|
|
13
|
-
/**
|
|
14
|
-
* No country's numeric code is ever 0, so this id can never collide with a real one
|
|
15
|
-
*
|
|
16
|
-
* @generated from protobuf enum value: UNSPECIFIED_TAX_TYPE = 0;
|
|
17
|
-
*/
|
|
18
|
-
UNSPECIFIED_TAX_TYPE = 0,
|
|
19
|
-
/**
|
|
20
|
-
* India (countryCode 356): Goods and Services Tax (taxCode 0)
|
|
21
|
-
*
|
|
22
|
-
* @generated from protobuf enum value: GST = 91136;
|
|
23
|
-
*/
|
|
24
|
-
GST = 91136
|
|
25
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// @generated by protobuf-ts 2.11.1 with parameter long_type_bigint
|
|
3
|
-
// @generated from protobuf file "TaxType.proto" (package "com.merabills.storefront", syntax proto3)
|
|
4
|
-
// tslint:disable
|
|
5
|
-
/**
|
|
6
|
-
* A tax that applies to a product or to a line item. A raw Java tax code is only unique within a
|
|
7
|
-
* country, so values here are not that raw code: they are computed ids, TaxType.createId(country,
|
|
8
|
-
* taxCode) = (country.getNumeric() << 8) | taxCode, making each value globally unique and
|
|
9
|
-
* self-describing rather than meaningful only together with some other, separately carried country
|
|
10
|
-
* code. A client can recover the ISO 3166-1 numeric country code with (value >> 8); it cannot
|
|
11
|
-
* recover the raw tax code beyond the low 8 bits, and does not need to - the enum name already
|
|
12
|
-
* carries that meaning.
|
|
13
|
-
*
|
|
14
|
-
* @generated from protobuf enum com.merabills.storefront.TaxType
|
|
15
|
-
*/
|
|
16
|
-
export var TaxType;
|
|
17
|
-
(function (TaxType) {
|
|
18
|
-
/**
|
|
19
|
-
* No country's numeric code is ever 0, so this id can never collide with a real one
|
|
20
|
-
*
|
|
21
|
-
* @generated from protobuf enum value: UNSPECIFIED_TAX_TYPE = 0;
|
|
22
|
-
*/
|
|
23
|
-
TaxType[TaxType["UNSPECIFIED_TAX_TYPE"] = 0] = "UNSPECIFIED_TAX_TYPE";
|
|
24
|
-
/**
|
|
25
|
-
* India (countryCode 356): Goods and Services Tax (taxCode 0)
|
|
26
|
-
*
|
|
27
|
-
* @generated from protobuf enum value: GST = 91136;
|
|
28
|
-
*/
|
|
29
|
-
TaxType[TaxType["GST"] = 91136] = "GST";
|
|
30
|
-
})(TaxType || (TaxType = {}));
|