@open-tender/cloud 0.4.22 → 0.4.24
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/slices/customer/account.js +2 -0
- package/dist/cjs/slices/customer/loyalty.d.ts +69 -0
- package/dist/cjs/slices/customer/loyalty.js +7 -1
- package/dist/esm/slices/customer/account.js +2 -0
- package/dist/esm/slices/customer/loyalty.d.ts +69 -0
- package/dist/esm/slices/customer/loyalty.js +6 -0
- package/package.json +3 -3
|
@@ -24,6 +24,7 @@ const order_2 = require("../order");
|
|
|
24
24
|
const checkout_1 = require("../checkout");
|
|
25
25
|
const groupOrder_1 = require("../groupOrder");
|
|
26
26
|
const guest_1 = require("../guest");
|
|
27
|
+
const tpls_1 = require("./tpls");
|
|
27
28
|
const initialState = {
|
|
28
29
|
auth: null,
|
|
29
30
|
profile: null,
|
|
@@ -115,6 +116,7 @@ exports.logoutCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.Logou
|
|
|
115
116
|
dispatch((0, rewards_1.resetCustomerRewards)());
|
|
116
117
|
dispatch((0, communicationPreferences_1.resetCustomerCommunicationPreferences)());
|
|
117
118
|
dispatch((0, guest_1.resetGuest)());
|
|
119
|
+
dispatch((0, tpls_1.resetCustomerTpls)());
|
|
118
120
|
return null;
|
|
119
121
|
}
|
|
120
122
|
catch (err) {
|
|
@@ -102,6 +102,75 @@ export declare const selectCustomerLoyaltyProgram: ((state: import("redux").Empt
|
|
|
102
102
|
}> & {
|
|
103
103
|
clearCache: () => void;
|
|
104
104
|
};
|
|
105
|
+
export declare const selectHasPointsShop: ((state: import("redux").EmptyObject & {
|
|
106
|
+
alerts: import("@open-tender/types").Alerts;
|
|
107
|
+
allergens: import("..").AllergensState;
|
|
108
|
+
announcements: import("..").AnnouncementsState;
|
|
109
|
+
checkout: import("..").CheckoutState;
|
|
110
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
111
|
+
config: import("..").ConfigState;
|
|
112
|
+
confirmation: import("..").ConfirmationState;
|
|
113
|
+
customer: import("redux").CombinedState<{
|
|
114
|
+
account: import("./account").AccountState;
|
|
115
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
116
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
117
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
118
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
119
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
120
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
121
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
122
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
123
|
+
history: import("./history").CustomerHistoryState;
|
|
124
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
125
|
+
loyalty: CustomerLoyaltyState;
|
|
126
|
+
order: import("./order").CustomerOrderState;
|
|
127
|
+
orders: import("./orders").CustomerOrdersState;
|
|
128
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
129
|
+
tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
|
|
130
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
131
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
132
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
133
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
134
|
+
}>;
|
|
135
|
+
deals: import("..").DealsState;
|
|
136
|
+
donations: import("..").DonationState;
|
|
137
|
+
geolocation: import("..").GeoLocationState;
|
|
138
|
+
giftCards: import("..").GiftCardsState;
|
|
139
|
+
groupOrder: import("..").GroupOrderState;
|
|
140
|
+
guest: import("..").GuestState;
|
|
141
|
+
loader: import("..").LoaderState;
|
|
142
|
+
menu: import("..").MenuState;
|
|
143
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
144
|
+
menuItems: import("..").MenuItemsState;
|
|
145
|
+
modal: import("@open-tender/types").Modal;
|
|
146
|
+
misc: import("..").MiscState;
|
|
147
|
+
nav: import("..").NavState;
|
|
148
|
+
navSite: import("..").NavSiteState;
|
|
149
|
+
notifications: import("@open-tender/types").Notifications;
|
|
150
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
151
|
+
order: import("..").OrderState;
|
|
152
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
153
|
+
orderRating: import("..").OrderRatingState;
|
|
154
|
+
posts: import("..").PostsSlice;
|
|
155
|
+
pushNotifications: import("..").PushNotificationsState;
|
|
156
|
+
qr: import("..").QrState;
|
|
157
|
+
quote: import("..").QuoteState;
|
|
158
|
+
resetPassword: import("..").ResetPasswordState;
|
|
159
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
160
|
+
sidebar: import("..").SidebarState;
|
|
161
|
+
sidebarModal: import("..").SidebarModalState;
|
|
162
|
+
signUp: import("..").SignUpState;
|
|
163
|
+
tags: import("..").TagsState;
|
|
164
|
+
terms: import("..").TermsSlice;
|
|
165
|
+
validTimes: import("..").ValidTimesState;
|
|
166
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
167
|
+
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
168
|
+
entities: LoyaltyPrograms;
|
|
169
|
+
}) => boolean, {
|
|
170
|
+
clearCache: () => void;
|
|
171
|
+
}> & {
|
|
172
|
+
clearCache: () => void;
|
|
173
|
+
};
|
|
105
174
|
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
106
175
|
alerts: import("@open-tender/types").Alerts;
|
|
107
176
|
allergens: import("..").AllergensState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.customerLoyaltyReducer = exports.selectPointsProgram = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
|
|
4
|
+
exports.customerLoyaltyReducer = exports.selectPointsProgram = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectHasPointsShop = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const types_1 = require("../types");
|
|
@@ -71,6 +71,12 @@ exports.selectCustomerLoyaltyProgram = (0, toolkit_1.createSelector)((state) =>
|
|
|
71
71
|
const program = programs.length ? programs[0] : null;
|
|
72
72
|
return { program, loading, error };
|
|
73
73
|
});
|
|
74
|
+
exports.selectHasPointsShop = (0, toolkit_1.createSelector)((state) => {
|
|
75
|
+
const { entities } = state.customer.loyalty;
|
|
76
|
+
return { entities };
|
|
77
|
+
}, ({ entities }) => {
|
|
78
|
+
return !!entities.find(i => i.is_points_shop_enabled);
|
|
79
|
+
});
|
|
74
80
|
const selectCustomerPointsProgram = (orderType) => (0, toolkit_1.createSelector)((state) => {
|
|
75
81
|
const { loyalty } = state.customer;
|
|
76
82
|
const { entities: loyaltyPrograms } = loyalty;
|
|
@@ -20,6 +20,7 @@ import { addMessage, resetOrder, setAlert } from '../order';
|
|
|
20
20
|
import { resetCheckout, updateCheckoutCustomer } from '../checkout';
|
|
21
21
|
import { resetGroupOrder } from '../groupOrder';
|
|
22
22
|
import { resetGuest } from '../guest';
|
|
23
|
+
import { resetCustomerTpls } from './tpls';
|
|
23
24
|
const initialState = {
|
|
24
25
|
auth: null,
|
|
25
26
|
profile: null,
|
|
@@ -110,6 +111,7 @@ export const logoutCustomer = createAsyncThunk(AccountActionType.LogoutCustomer,
|
|
|
110
111
|
dispatch(resetCustomerRewards());
|
|
111
112
|
dispatch(resetCustomerCommunicationPreferences());
|
|
112
113
|
dispatch(resetGuest());
|
|
114
|
+
dispatch(resetCustomerTpls());
|
|
113
115
|
return null;
|
|
114
116
|
}
|
|
115
117
|
catch (err) {
|
|
@@ -102,6 +102,75 @@ export declare const selectCustomerLoyaltyProgram: ((state: import("redux").Empt
|
|
|
102
102
|
}> & {
|
|
103
103
|
clearCache: () => void;
|
|
104
104
|
};
|
|
105
|
+
export declare const selectHasPointsShop: ((state: import("redux").EmptyObject & {
|
|
106
|
+
alerts: import("@open-tender/types").Alerts;
|
|
107
|
+
allergens: import("..").AllergensState;
|
|
108
|
+
announcements: import("..").AnnouncementsState;
|
|
109
|
+
checkout: import("..").CheckoutState;
|
|
110
|
+
completedOrders: import("..").CompletedOrdersState;
|
|
111
|
+
config: import("..").ConfigState;
|
|
112
|
+
confirmation: import("..").ConfirmationState;
|
|
113
|
+
customer: import("redux").CombinedState<{
|
|
114
|
+
account: import("./account").AccountState;
|
|
115
|
+
communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
|
|
116
|
+
creditCards: import("./creditCards").CustomerCreditCardsState;
|
|
117
|
+
allergens: import("./allergens").CustomerAllergensState;
|
|
118
|
+
addresses: import("./addresses").CustomerAddressesState;
|
|
119
|
+
favorites: import("./favorites").CustomerFavoritesState;
|
|
120
|
+
fcmToken: import("./fcmToken").CustomerFcmTokenState;
|
|
121
|
+
giftCards: import("./giftCards").CustomerGiftCardsState;
|
|
122
|
+
groupOrders: import("./groupOrders").CustomerGroupOrdersState;
|
|
123
|
+
history: import("./history").CustomerHistoryState;
|
|
124
|
+
houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
|
|
125
|
+
loyalty: CustomerLoyaltyState;
|
|
126
|
+
order: import("./order").CustomerOrderState;
|
|
127
|
+
orders: import("./orders").CustomerOrdersState;
|
|
128
|
+
pointsShop: import("./pointsShop").PointsShopState;
|
|
129
|
+
tplsPointsShop: import("./tplsPointsShop").TplsPointsShopState;
|
|
130
|
+
qrcode: import("./qrCode").CustomerQRCodeState;
|
|
131
|
+
rewards: import("./rewards").CustomerRewardsState;
|
|
132
|
+
thanx: import("./thanx").CustomerThanxState;
|
|
133
|
+
tpls: import("./tpls").CustomerTplsState;
|
|
134
|
+
}>;
|
|
135
|
+
deals: import("..").DealsState;
|
|
136
|
+
donations: import("..").DonationState;
|
|
137
|
+
geolocation: import("..").GeoLocationState;
|
|
138
|
+
giftCards: import("..").GiftCardsState;
|
|
139
|
+
groupOrder: import("..").GroupOrderState;
|
|
140
|
+
guest: import("..").GuestState;
|
|
141
|
+
loader: import("..").LoaderState;
|
|
142
|
+
menu: import("..").MenuState;
|
|
143
|
+
menuDisplay: import("..").MenuDisplayState;
|
|
144
|
+
menuItems: import("..").MenuItemsState;
|
|
145
|
+
modal: import("@open-tender/types").Modal;
|
|
146
|
+
misc: import("..").MiscState;
|
|
147
|
+
nav: import("..").NavState;
|
|
148
|
+
navSite: import("..").NavSiteState;
|
|
149
|
+
notifications: import("@open-tender/types").Notifications;
|
|
150
|
+
oneTimePasscode: import("..").OneTimePasscodeState;
|
|
151
|
+
order: import("..").OrderState;
|
|
152
|
+
orderFulfillment: import("..").OrderFulfillmentState;
|
|
153
|
+
orderRating: import("..").OrderRatingState;
|
|
154
|
+
posts: import("..").PostsSlice;
|
|
155
|
+
pushNotifications: import("..").PushNotificationsState;
|
|
156
|
+
qr: import("..").QrState;
|
|
157
|
+
quote: import("..").QuoteState;
|
|
158
|
+
resetPassword: import("..").ResetPasswordState;
|
|
159
|
+
revenueCenters: import("..").RevenueCentersState;
|
|
160
|
+
sidebar: import("..").SidebarState;
|
|
161
|
+
sidebarModal: import("..").SidebarModalState;
|
|
162
|
+
signUp: import("..").SignUpState;
|
|
163
|
+
tags: import("..").TagsState;
|
|
164
|
+
terms: import("..").TermsSlice;
|
|
165
|
+
validTimes: import("..").ValidTimesState;
|
|
166
|
+
verifyAccount: import("..").VerifyAccountState;
|
|
167
|
+
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
168
|
+
entities: LoyaltyPrograms;
|
|
169
|
+
}) => boolean, {
|
|
170
|
+
clearCache: () => void;
|
|
171
|
+
}> & {
|
|
172
|
+
clearCache: () => void;
|
|
173
|
+
};
|
|
105
174
|
export declare const selectCustomerPointsProgram: (orderType: OrderType | null) => ((state: import("redux").EmptyObject & {
|
|
106
175
|
alerts: import("@open-tender/types").Alerts;
|
|
107
176
|
allergens: import("..").AllergensState;
|
|
@@ -66,6 +66,12 @@ export const selectCustomerLoyaltyProgram = createSelector((state) => {
|
|
|
66
66
|
const program = programs.length ? programs[0] : null;
|
|
67
67
|
return { program, loading, error };
|
|
68
68
|
});
|
|
69
|
+
export const selectHasPointsShop = createSelector((state) => {
|
|
70
|
+
const { entities } = state.customer.loyalty;
|
|
71
|
+
return { entities };
|
|
72
|
+
}, ({ entities }) => {
|
|
73
|
+
return !!entities.find(i => i.is_points_shop_enabled);
|
|
74
|
+
});
|
|
69
75
|
export const selectCustomerPointsProgram = (orderType) => createSelector((state) => {
|
|
70
76
|
const { loyalty } = state.customer;
|
|
71
77
|
const { entities: loyaltyPrograms } = loyalty;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.24",
|
|
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@open-tender/types": "^0.4.
|
|
60
|
-
"@open-tender/utils": "^0.4.
|
|
59
|
+
"@open-tender/types": "^0.4.51",
|
|
60
|
+
"@open-tender/utils": "^0.4.28"
|
|
61
61
|
}
|
|
62
62
|
}
|