@open-tender/cloud 0.1.85 → 0.1.86
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.
|
@@ -23,10 +23,80 @@ export declare const fetchCustomerLoyalty: import("@reduxjs/toolkit").AsyncThunk
|
|
|
23
23
|
}>;
|
|
24
24
|
export declare const resetCustomerLoyalty: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"loyalty/resetCustomerLoyalty">, resetCustomerLoyaltyError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"loyalty/resetCustomerLoyaltyError">, setCustomerLoyalty: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "loyalty/setCustomerLoyalty">;
|
|
25
25
|
export declare const selectCustomerLoyalty: (state: AppState) => CustomerLoyaltyState;
|
|
26
|
-
export declare const selectCustomerLoyaltyProgram: (state:
|
|
26
|
+
export declare const selectCustomerLoyaltyProgram: ((state: import("redux").EmptyObject & {
|
|
27
|
+
alerts: import("@open-tender/types").Alerts;
|
|
28
|
+
allergens: import("..").AllergensState;
|
|
29
|
+
announcements: import("..").AnnouncementsState;
|
|
30
|
+
checkout: import("..").CheckoutState;
|
|
31
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
32
|
+
config: import("..").ConfigState;
|
|
33
|
+
confirmation: import("..").ConfirmationState;
|
|
34
|
+
customer: import("redux").CombinedState<{
|
|
35
|
+
account: import("./account").AccountState;
|
|
36
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
37
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
38
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
39
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
40
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
41
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
42
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
43
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
44
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
45
|
+
loyalty: CustomerLoyaltyState;
|
|
46
|
+
order: import("./order").CustomerOrderState;
|
|
47
|
+
orders: import("./orders").CustomerOrdersState;
|
|
48
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
49
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
50
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
51
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
52
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
53
|
+
}>;
|
|
54
|
+
deals: import("..").DealsState;
|
|
55
|
+
donations: import("..").DonationState;
|
|
56
|
+
geolocation: import("..").GeoLocationState;
|
|
57
|
+
giftCards: import("..").GiftCardsState;
|
|
58
|
+
groupOrder: import("..").GroupOrderState;
|
|
59
|
+
guest: import("..").GuestState;
|
|
60
|
+
loader: import("..").LoaderState;
|
|
61
|
+
menu: import("..").MenuState;
|
|
62
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
63
|
+
menuItems: import("..").MenuItemsState;
|
|
64
|
+
modal: import("@open-tender/types").Modal;
|
|
65
|
+
misc: import("..").MiscState;
|
|
66
|
+
nav: import("..").NavState;
|
|
67
|
+
navSite: import("..").NavSiteState;
|
|
68
|
+
notifications: import("@open-tender/types").Notifications;
|
|
69
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
70
|
+
order: import("..").OrderState;
|
|
71
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
72
|
+
orderRating: import("..").OrderRatingState;
|
|
73
|
+
posts: import("..").PostsSlice;
|
|
74
|
+
qr: import("..").QrState;
|
|
75
|
+
resetPassword: import("..").ResetPasswordState;
|
|
76
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
77
|
+
sidebar: import("..").SidebarState;
|
|
78
|
+
sidebarModal: import("..").SidebarModalState;
|
|
79
|
+
signUp: import("..").SignUpState;
|
|
80
|
+
tags: import("..").TagsState;
|
|
81
|
+
terms: import("..").TermsSlice;
|
|
82
|
+
validTimes: import("..").ValidTimesState;
|
|
83
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
84
|
+
}) => {
|
|
85
|
+
program: import("@open-tender/types").CustomerLoyalty | null;
|
|
86
|
+
loading: RequestStatus;
|
|
87
|
+
error: RequestError;
|
|
88
|
+
}) & import("reselect").OutputSelectorFields<(args_0: {
|
|
89
|
+
entities: CustomerLoyalties;
|
|
90
|
+
loading: RequestStatus;
|
|
91
|
+
error: RequestError;
|
|
92
|
+
}) => {
|
|
27
93
|
program: import("@open-tender/types").CustomerLoyalty | null;
|
|
28
94
|
loading: RequestStatus;
|
|
29
95
|
error: RequestError;
|
|
96
|
+
}, {
|
|
97
|
+
clearCache: () => void;
|
|
98
|
+
}> & {
|
|
99
|
+
clearCache: () => void;
|
|
30
100
|
};
|
|
31
101
|
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
32
102
|
alerts: import("@open-tender/types").Alerts;
|
|
@@ -64,14 +64,15 @@ const customerLoyaltySlice = (0, toolkit_1.createSlice)({
|
|
|
64
64
|
_a = customerLoyaltySlice.actions, exports.resetCustomerLoyalty = _a.resetCustomerLoyalty, exports.resetCustomerLoyaltyError = _a.resetCustomerLoyaltyError, exports.setCustomerLoyalty = _a.setCustomerLoyalty;
|
|
65
65
|
const selectCustomerLoyalty = (state) => state.customer.loyalty;
|
|
66
66
|
exports.selectCustomerLoyalty = selectCustomerLoyalty;
|
|
67
|
-
|
|
67
|
+
exports.selectCustomerLoyaltyProgram = (0, toolkit_1.createSelector)((state) => {
|
|
68
68
|
const { entities, loading, error } = state.customer.loyalty;
|
|
69
|
+
return { entities, loading, error };
|
|
70
|
+
}, ({ entities, loading, error }) => {
|
|
69
71
|
const programs = entities.filter(i => (i.loyalty_type === 'CREDIT' || i.loyalty_type === 'POINTS') &&
|
|
70
72
|
(i.spend.order_type === null || i.spend.order_type === 'OLO'));
|
|
71
73
|
const program = programs.length ? programs[0] : null;
|
|
72
74
|
return { program, loading, error };
|
|
73
|
-
};
|
|
74
|
-
exports.selectCustomerLoyaltyProgram = selectCustomerLoyaltyProgram;
|
|
75
|
+
});
|
|
75
76
|
const selectCustomerPointsProgram = (orderType) => (0, toolkit_1.createSelector)((state) => {
|
|
76
77
|
const { loyalty } = state.customer;
|
|
77
78
|
return { loyalty };
|
|
@@ -23,10 +23,80 @@ export declare const fetchCustomerLoyalty: import("@reduxjs/toolkit").AsyncThunk
|
|
|
23
23
|
}>;
|
|
24
24
|
export declare const resetCustomerLoyalty: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"loyalty/resetCustomerLoyalty">, resetCustomerLoyaltyError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"loyalty/resetCustomerLoyaltyError">, setCustomerLoyalty: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "loyalty/setCustomerLoyalty">;
|
|
25
25
|
export declare const selectCustomerLoyalty: (state: AppState) => CustomerLoyaltyState;
|
|
26
|
-
export declare const selectCustomerLoyaltyProgram: (state:
|
|
26
|
+
export declare const selectCustomerLoyaltyProgram: ((state: import("redux").EmptyObject & {
|
|
27
|
+
alerts: import("@open-tender/types").Alerts;
|
|
28
|
+
allergens: import("..").AllergensState;
|
|
29
|
+
announcements: import("..").AnnouncementsState;
|
|
30
|
+
checkout: import("..").CheckoutState;
|
|
31
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
32
|
+
config: import("..").ConfigState;
|
|
33
|
+
confirmation: import("..").ConfirmationState;
|
|
34
|
+
customer: import("redux").CombinedState<{
|
|
35
|
+
account: import("./account").AccountState;
|
|
36
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
37
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
38
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
39
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
40
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
41
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
42
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
43
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
44
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
45
|
+
loyalty: CustomerLoyaltyState;
|
|
46
|
+
order: import("./order").CustomerOrderState;
|
|
47
|
+
orders: import("./orders").CustomerOrdersState;
|
|
48
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
49
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
50
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
51
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
52
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
53
|
+
}>;
|
|
54
|
+
deals: import("..").DealsState;
|
|
55
|
+
donations: import("..").DonationState;
|
|
56
|
+
geolocation: import("..").GeoLocationState;
|
|
57
|
+
giftCards: import("..").GiftCardsState;
|
|
58
|
+
groupOrder: import("..").GroupOrderState;
|
|
59
|
+
guest: import("..").GuestState;
|
|
60
|
+
loader: import("..").LoaderState;
|
|
61
|
+
menu: import("..").MenuState;
|
|
62
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
63
|
+
menuItems: import("..").MenuItemsState;
|
|
64
|
+
modal: import("@open-tender/types").Modal;
|
|
65
|
+
misc: import("..").MiscState;
|
|
66
|
+
nav: import("..").NavState;
|
|
67
|
+
navSite: import("..").NavSiteState;
|
|
68
|
+
notifications: import("@open-tender/types").Notifications;
|
|
69
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
70
|
+
order: import("..").OrderState;
|
|
71
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
72
|
+
orderRating: import("..").OrderRatingState;
|
|
73
|
+
posts: import("..").PostsSlice;
|
|
74
|
+
qr: import("..").QrState;
|
|
75
|
+
resetPassword: import("..").ResetPasswordState;
|
|
76
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
77
|
+
sidebar: import("..").SidebarState;
|
|
78
|
+
sidebarModal: import("..").SidebarModalState;
|
|
79
|
+
signUp: import("..").SignUpState;
|
|
80
|
+
tags: import("..").TagsState;
|
|
81
|
+
terms: import("..").TermsSlice;
|
|
82
|
+
validTimes: import("..").ValidTimesState;
|
|
83
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
84
|
+
}) => {
|
|
85
|
+
program: import("@open-tender/types").CustomerLoyalty | null;
|
|
86
|
+
loading: RequestStatus;
|
|
87
|
+
error: RequestError;
|
|
88
|
+
}) & import("reselect").OutputSelectorFields<(args_0: {
|
|
89
|
+
entities: CustomerLoyalties;
|
|
90
|
+
loading: RequestStatus;
|
|
91
|
+
error: RequestError;
|
|
92
|
+
}) => {
|
|
27
93
|
program: import("@open-tender/types").CustomerLoyalty | null;
|
|
28
94
|
loading: RequestStatus;
|
|
29
95
|
error: RequestError;
|
|
96
|
+
}, {
|
|
97
|
+
clearCache: () => void;
|
|
98
|
+
}> & {
|
|
99
|
+
clearCache: () => void;
|
|
30
100
|
};
|
|
31
101
|
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
32
102
|
alerts: import("@open-tender/types").Alerts;
|
|
@@ -59,13 +59,15 @@ const customerLoyaltySlice = createSlice({
|
|
|
59
59
|
});
|
|
60
60
|
export const { resetCustomerLoyalty, resetCustomerLoyaltyError, setCustomerLoyalty } = customerLoyaltySlice.actions;
|
|
61
61
|
export const selectCustomerLoyalty = (state) => state.customer.loyalty;
|
|
62
|
-
export const selectCustomerLoyaltyProgram = (state) => {
|
|
62
|
+
export const selectCustomerLoyaltyProgram = createSelector((state) => {
|
|
63
63
|
const { entities, loading, error } = state.customer.loyalty;
|
|
64
|
+
return { entities, loading, error };
|
|
65
|
+
}, ({ entities, loading, error }) => {
|
|
64
66
|
const programs = entities.filter(i => (i.loyalty_type === 'CREDIT' || i.loyalty_type === 'POINTS') &&
|
|
65
67
|
(i.spend.order_type === null || i.spend.order_type === 'OLO'));
|
|
66
68
|
const program = programs.length ? programs[0] : null;
|
|
67
69
|
return { program, loading, error };
|
|
68
|
-
};
|
|
70
|
+
});
|
|
69
71
|
export const selectCustomerPointsProgram = (orderType) => createSelector((state) => {
|
|
70
72
|
const { loyalty } = state.customer;
|
|
71
73
|
return { loyalty };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.86",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types 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",
|