@open-tender/utils 0.4.23 → 0.4.25
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/cjs/hooks/useMenuItem.d.ts +1 -1
- package/dist/cjs/hooks/useModifier.d.ts +1 -1
- package/dist/cjs/hooks/useOrderItem.d.ts +1 -1
- package/dist/cjs/utils/cart.d.ts +2 -2
- package/dist/cjs/utils/cart.js +2 -0
- package/dist/cjs/utils/checkout.d.ts +6 -6
- package/dist/esm/hooks/useMenuItem.d.ts +1 -1
- package/dist/esm/hooks/useModifier.d.ts +1 -1
- package/dist/esm/hooks/useOrderItem.d.ts +1 -1
- package/dist/esm/utils/cart.d.ts +2 -2
- package/dist/esm/utils/cart.js +2 -0
- package/dist/esm/utils/checkout.d.ts +6 -6
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
6
6
|
displayPrice: string;
|
|
7
7
|
displayCals: number | null;
|
|
8
8
|
totalPoints: number | null;
|
|
9
|
-
totalAllergens: string[]
|
|
9
|
+
totalAllergens: string[];
|
|
10
10
|
auth: Auth | null;
|
|
11
11
|
favoriteId: number | null;
|
|
12
12
|
isIncomplete: boolean;
|
|
@@ -43,8 +43,8 @@ export declare const useModifier: (group: CartItemGroup, option: CartItemOption,
|
|
|
43
43
|
shortDescription: string | null;
|
|
44
44
|
shortName: string;
|
|
45
45
|
slug: string;
|
|
46
|
+
totalAllergens: string[];
|
|
46
47
|
totalCals: number | null;
|
|
47
48
|
totalPoints: number | null;
|
|
48
49
|
totalPrice: number | null;
|
|
49
|
-
totalAllergens?: string[] | undefined;
|
|
50
50
|
};
|
|
@@ -38,8 +38,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
38
38
|
shortName: string;
|
|
39
39
|
slug: string;
|
|
40
40
|
tags: string[];
|
|
41
|
+
totalAllergens: string[];
|
|
41
42
|
totalCals: number | null;
|
|
42
43
|
totalPoints: number | null;
|
|
43
44
|
totalPrice: number | null;
|
|
44
|
-
totalAllergens?: string[] | undefined;
|
|
45
45
|
};
|
package/dist/cjs/utils/cart.d.ts
CHANGED
|
@@ -44,10 +44,10 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
44
44
|
shortName: string;
|
|
45
45
|
slug: string;
|
|
46
46
|
tags: string[];
|
|
47
|
+
totalAllergens: string[];
|
|
47
48
|
totalCals: number | null;
|
|
48
49
|
totalPoints: number | null;
|
|
49
50
|
totalPrice: number | null;
|
|
50
|
-
totalAllergens?: string[] | undefined;
|
|
51
51
|
}[];
|
|
52
52
|
cartCounts: Record<string, number>;
|
|
53
53
|
};
|
|
@@ -131,10 +131,10 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
131
131
|
shortName: string;
|
|
132
132
|
slug: string;
|
|
133
133
|
tags: string[];
|
|
134
|
+
totalAllergens: string[];
|
|
134
135
|
totalCals: number | null;
|
|
135
136
|
totalPoints: number | null;
|
|
136
137
|
totalPrice: number | null;
|
|
137
|
-
totalAllergens?: string[] | undefined;
|
|
138
138
|
}[];
|
|
139
139
|
export declare const makeItemImageUrl: (images: Images) => any;
|
|
140
140
|
export declare const makeDisplayItemGroups: (optionGroups: OrderItemGroups) => {
|
package/dist/cjs/utils/cart.js
CHANGED
|
@@ -233,6 +233,7 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = []) => {
|
|
|
233
233
|
shortName: o.short_name,
|
|
234
234
|
slug: o.slug,
|
|
235
235
|
tags: (0, helpers_1.convertStringToArray)(o.tags),
|
|
236
|
+
totalAllergens: [],
|
|
236
237
|
totalCals: null,
|
|
237
238
|
totalPoints: null,
|
|
238
239
|
totalPrice: null
|
|
@@ -287,6 +288,7 @@ const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false
|
|
|
287
288
|
similarItems: item.similar_items,
|
|
288
289
|
slug: item.slug,
|
|
289
290
|
tags: (0, helpers_1.convertStringToArray)(item.tags),
|
|
291
|
+
totalAllergens: [],
|
|
290
292
|
totalCals: null,
|
|
291
293
|
totalPoints: null,
|
|
292
294
|
totalPrice: null,
|
|
@@ -16,12 +16,12 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
16
16
|
zip: string;
|
|
17
17
|
} | {
|
|
18
18
|
amount: string;
|
|
19
|
-
card_type
|
|
20
|
-
card_type_name
|
|
19
|
+
card_type?: import("@open-tender/types").CardType | undefined;
|
|
20
|
+
card_type_name?: import("@open-tender/types").CardTypeName | undefined;
|
|
21
21
|
customer_card_id: number;
|
|
22
|
-
is_default
|
|
23
|
-
last4
|
|
24
|
-
masked
|
|
22
|
+
is_default?: boolean | undefined;
|
|
23
|
+
last4?: string | undefined;
|
|
24
|
+
masked?: string | undefined;
|
|
25
25
|
tender_status?: import("@open-tender/types").TenderStatus | undefined;
|
|
26
26
|
tender_type: import("@open-tender/types").TenderType;
|
|
27
27
|
} | {
|
|
@@ -50,4 +50,4 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
50
50
|
})[] | null;
|
|
51
51
|
export declare const makeCreditCardName: (creditCard: CreditCard) => string;
|
|
52
52
|
export declare const makeTenderName: (tender: OrderTender) => string;
|
|
53
|
-
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string;
|
|
53
|
+
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string | undefined;
|
|
@@ -6,7 +6,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
6
6
|
displayPrice: string;
|
|
7
7
|
displayCals: number | null;
|
|
8
8
|
totalPoints: number | null;
|
|
9
|
-
totalAllergens: string[]
|
|
9
|
+
totalAllergens: string[];
|
|
10
10
|
auth: Auth | null;
|
|
11
11
|
favoriteId: number | null;
|
|
12
12
|
isIncomplete: boolean;
|
|
@@ -43,8 +43,8 @@ export declare const useModifier: (group: CartItemGroup, option: CartItemOption,
|
|
|
43
43
|
shortDescription: string | null;
|
|
44
44
|
shortName: string;
|
|
45
45
|
slug: string;
|
|
46
|
+
totalAllergens: string[];
|
|
46
47
|
totalCals: number | null;
|
|
47
48
|
totalPoints: number | null;
|
|
48
49
|
totalPrice: number | null;
|
|
49
|
-
totalAllergens?: string[] | undefined;
|
|
50
50
|
};
|
|
@@ -38,8 +38,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
|
|
|
38
38
|
shortName: string;
|
|
39
39
|
slug: string;
|
|
40
40
|
tags: string[];
|
|
41
|
+
totalAllergens: string[];
|
|
41
42
|
totalCals: number | null;
|
|
42
43
|
totalPoints: number | null;
|
|
43
44
|
totalPrice: number | null;
|
|
44
|
-
totalAllergens?: string[] | undefined;
|
|
45
45
|
};
|
package/dist/esm/utils/cart.d.ts
CHANGED
|
@@ -44,10 +44,10 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
|
|
|
44
44
|
shortName: string;
|
|
45
45
|
slug: string;
|
|
46
46
|
tags: string[];
|
|
47
|
+
totalAllergens: string[];
|
|
47
48
|
totalCals: number | null;
|
|
48
49
|
totalPoints: number | null;
|
|
49
50
|
totalPrice: number | null;
|
|
50
|
-
totalAllergens?: string[] | undefined;
|
|
51
51
|
}[];
|
|
52
52
|
cartCounts: Record<string, number>;
|
|
53
53
|
};
|
|
@@ -131,10 +131,10 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
|
|
|
131
131
|
shortName: string;
|
|
132
132
|
slug: string;
|
|
133
133
|
tags: string[];
|
|
134
|
+
totalAllergens: string[];
|
|
134
135
|
totalCals: number | null;
|
|
135
136
|
totalPoints: number | null;
|
|
136
137
|
totalPrice: number | null;
|
|
137
|
-
totalAllergens?: string[] | undefined;
|
|
138
138
|
}[];
|
|
139
139
|
export declare const makeItemImageUrl: (images: Images) => any;
|
|
140
140
|
export declare const makeDisplayItemGroups: (optionGroups: OrderItemGroups) => {
|
package/dist/esm/utils/cart.js
CHANGED
|
@@ -218,6 +218,7 @@ const makeOrderItemGroups = (optionGroups, isEdit, soldOut = []) => {
|
|
|
218
218
|
shortName: o.short_name,
|
|
219
219
|
slug: o.slug,
|
|
220
220
|
tags: convertStringToArray(o.tags),
|
|
221
|
+
totalAllergens: [],
|
|
221
222
|
totalCals: null,
|
|
222
223
|
totalPoints: null,
|
|
223
224
|
totalPrice: null
|
|
@@ -272,6 +273,7 @@ export const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints
|
|
|
272
273
|
similarItems: item.similar_items,
|
|
273
274
|
slug: item.slug,
|
|
274
275
|
tags: convertStringToArray(item.tags),
|
|
276
|
+
totalAllergens: [],
|
|
275
277
|
totalCals: null,
|
|
276
278
|
totalPoints: null,
|
|
277
279
|
totalPrice: null,
|
|
@@ -16,12 +16,12 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
16
16
|
zip: string;
|
|
17
17
|
} | {
|
|
18
18
|
amount: string;
|
|
19
|
-
card_type
|
|
20
|
-
card_type_name
|
|
19
|
+
card_type?: import("@open-tender/types").CardType | undefined;
|
|
20
|
+
card_type_name?: import("@open-tender/types").CardTypeName | undefined;
|
|
21
21
|
customer_card_id: number;
|
|
22
|
-
is_default
|
|
23
|
-
last4
|
|
24
|
-
masked
|
|
22
|
+
is_default?: boolean | undefined;
|
|
23
|
+
last4?: string | undefined;
|
|
24
|
+
masked?: string | undefined;
|
|
25
25
|
tender_status?: import("@open-tender/types").TenderStatus | undefined;
|
|
26
26
|
tender_type: import("@open-tender/types").TenderType;
|
|
27
27
|
} | {
|
|
@@ -50,4 +50,4 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
50
50
|
})[] | null;
|
|
51
51
|
export declare const makeCreditCardName: (creditCard: CreditCard) => string;
|
|
52
52
|
export declare const makeTenderName: (tender: OrderTender) => string;
|
|
53
|
-
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string;
|
|
53
|
+
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.25",
|
|
4
4
|
"description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"private": false,
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@emotion/react": "^11.10.4",
|
|
39
|
-
"@open-tender/types": "^0.4.
|
|
39
|
+
"@open-tender/types": "^0.4.47",
|
|
40
40
|
"@reduxjs/toolkit": "^1.8.5",
|
|
41
41
|
"@types/google.maps": "^3.53.5",
|
|
42
42
|
"@types/jest": "^29.5.11",
|