@open-tender/cloud 0.4.21 → 0.4.23

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.
@@ -163,6 +163,76 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
163
163
  }> & {
164
164
  clearCache: () => void;
165
165
  };
166
+ export declare const selectShowLoyalty: ((state: import("redux").EmptyObject & {
167
+ alerts: import("@open-tender/types").Alerts;
168
+ allergens: import("./allergens").AllergensState;
169
+ announcements: import("./announcements").AnnouncementsState;
170
+ checkout: import("./checkout").CheckoutState;
171
+ completedOrders: import("./completedOrders").CompletedOrdersState;
172
+ config: ConfigState;
173
+ confirmation: import("./confirmation").ConfirmationState;
174
+ customer: import("redux").CombinedState<{
175
+ account: import("./customer").AccountState;
176
+ communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
177
+ creditCards: import("./customer").CustomerCreditCardsState;
178
+ allergens: import("./customer").CustomerAllergensState;
179
+ addresses: import("./customer").CustomerAddressesState;
180
+ favorites: import("./customer").CustomerFavoritesState;
181
+ fcmToken: import("./customer").CustomerFcmTokenState;
182
+ giftCards: import("./customer").CustomerGiftCardsState;
183
+ groupOrders: import("./customer").CustomerGroupOrdersState;
184
+ history: import("./customer").CustomerHistoryState;
185
+ houseAccounts: import("./customer").CustomerHouseAccountsState;
186
+ loyalty: import("./customer").CustomerLoyaltyState;
187
+ order: import("./customer").CustomerOrderState;
188
+ orders: import("./customer").CustomerOrdersState;
189
+ pointsShop: import("./customer").PointsShopState;
190
+ tplsPointsShop: import("./customer").TplsPointsShopState;
191
+ qrcode: import("./customer").CustomerQRCodeState;
192
+ rewards: import("./customer").CustomerRewardsState;
193
+ thanx: import("./customer").CustomerThanxState;
194
+ tpls: import("./customer").CustomerTplsState;
195
+ }>;
196
+ deals: import("./deals").DealsState;
197
+ donations: import("./donations").DonationState;
198
+ geolocation: import("./geolocation").GeoLocationState;
199
+ giftCards: import("./giftCards").GiftCardsState;
200
+ groupOrder: import("./groupOrder").GroupOrderState;
201
+ guest: import("./guest").GuestState;
202
+ loader: import("./loader").LoaderState;
203
+ menu: import("./menu").MenuState;
204
+ menuDisplay: import("./menuDisplay").MenuDisplayState;
205
+ menuItems: import("./menuItems").MenuItemsState;
206
+ modal: import("@open-tender/types").Modal;
207
+ misc: import("./misc").MiscState;
208
+ nav: import("./nav").NavState;
209
+ navSite: import("./navSite").NavSiteState;
210
+ notifications: import("@open-tender/types").Notifications;
211
+ oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
212
+ order: import("./order").OrderState;
213
+ orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
214
+ orderRating: import("./orderRating").OrderRatingState;
215
+ posts: import("./posts").PostsSlice;
216
+ pushNotifications: import("./pushNotifications").PushNotificationsState;
217
+ qr: import("./qr").QrState;
218
+ quote: import("./quote").QuoteState;
219
+ resetPassword: import("./resetPassword").ResetPasswordState;
220
+ revenueCenters: import("./revenueCenters").RevenueCentersState;
221
+ sidebar: import("./sidebar").SidebarState;
222
+ sidebarModal: import("./sidebarModal").SidebarModalState;
223
+ signUp: import("./signUp").SignUpState;
224
+ tags: import("./tags").TagsState;
225
+ terms: import("./terms").TermsSlice;
226
+ validTimes: import("./validTimes").ValidTimesState;
227
+ verifyAccount: import("./verifyAccount").VerifyAccountState;
228
+ }) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
229
+ has_loyalty: boolean | undefined;
230
+ tpls: "COMO" | "THANX" | "PUNCHH" | "SPARKFLY" | null | undefined;
231
+ }) => boolean, {
232
+ clearCache: () => void;
233
+ }> & {
234
+ clearCache: () => void;
235
+ };
166
236
  export declare const selectFulfillment: (state: AppState) => import("@open-tender/types").ConfigFulfillment | undefined;
167
237
  export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
168
238
  export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectBottomTabsTitles = exports.selectBottomTabsDisplayed = exports.selectPage = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectCateringOnly = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
4
+ exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectBottomTabsTitles = exports.selectBottomTabsDisplayed = exports.selectPage = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectShowLoyalty = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectCateringOnly = exports.selectAccountConfig = exports.selectApi = exports.selectPages = exports.selectStylesheet = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const utils_1 = require("@open-tender/utils");
@@ -125,6 +125,16 @@ exports.selectOptIns = (0, toolkit_1.createSelector)((state) => {
125
125
  }, ({ accepts_marketing, order_notifications }) => {
126
126
  return { accepts_marketing, order_notifications };
127
127
  });
128
+ exports.selectShowLoyalty = (0, toolkit_1.createSelector)((state) => {
129
+ const { has_loyalty, tpls } = state.config.brand || {};
130
+ return { has_loyalty, tpls };
131
+ }, ({ has_loyalty, tpls }) => {
132
+ if (has_loyalty)
133
+ return true;
134
+ if (tpls === 'PUNCHH' || tpls === 'COMO')
135
+ return true;
136
+ return false;
137
+ });
128
138
  const selectFulfillment = (state) => { var _a; return (_a = state.config.brand) === null || _a === void 0 ? void 0 : _a.fulfillment; };
129
139
  exports.selectFulfillment = selectFulfillment;
130
140
  const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
@@ -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;
@@ -23,4 +23,5 @@ export declare const fetchCustomerOrders: import("@reduxjs/toolkit").AsyncThunk<
23
23
  }>;
24
24
  export declare const resetCustomerOrders: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orders/resetCustomerOrders">, resetCustomerOrdersError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orders/resetCustomerOrdersError">, setCustomerOrders: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "orders/setCustomerOrders">;
25
25
  export declare const selectCustomerOrders: (state: AppState) => CustomerOrdersState;
26
+ export declare const selectHasOrders: (state: AppState) => boolean;
26
27
  export declare const customerOrdersReducer: import("redux").Reducer<CustomerOrdersState, import("redux").AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.customerOrdersReducer = exports.selectCustomerOrders = exports.setCustomerOrders = exports.resetCustomerOrdersError = exports.resetCustomerOrders = exports.fetchCustomerOrders = exports.CustomerOrdersActionType = void 0;
4
+ exports.customerOrdersReducer = exports.selectHasOrders = exports.selectCustomerOrders = exports.setCustomerOrders = exports.resetCustomerOrdersError = exports.resetCustomerOrders = exports.fetchCustomerOrders = exports.CustomerOrdersActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const types_1 = require("../types");
@@ -64,4 +64,6 @@ const customerOrdersSlice = (0, toolkit_1.createSlice)({
64
64
  _a = customerOrdersSlice.actions, exports.resetCustomerOrders = _a.resetCustomerOrders, exports.resetCustomerOrdersError = _a.resetCustomerOrdersError, exports.setCustomerOrders = _a.setCustomerOrders;
65
65
  const selectCustomerOrders = (state) => state.customer.orders;
66
66
  exports.selectCustomerOrders = selectCustomerOrders;
67
+ const selectHasOrders = (state) => state.customer.orders.entities.length > 0;
68
+ exports.selectHasOrders = selectHasOrders;
67
69
  exports.customerOrdersReducer = customerOrdersSlice.reducer;
@@ -163,6 +163,76 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
163
163
  }> & {
164
164
  clearCache: () => void;
165
165
  };
166
+ export declare const selectShowLoyalty: ((state: import("redux").EmptyObject & {
167
+ alerts: import("@open-tender/types").Alerts;
168
+ allergens: import("./allergens").AllergensState;
169
+ announcements: import("./announcements").AnnouncementsState;
170
+ checkout: import("./checkout").CheckoutState;
171
+ completedOrders: import("./completedOrders").CompletedOrdersState;
172
+ config: ConfigState;
173
+ confirmation: import("./confirmation").ConfirmationState;
174
+ customer: import("redux").CombinedState<{
175
+ account: import("./customer").AccountState;
176
+ communicationPreferences: import("./customer").CustomerCommunicationPrefsState;
177
+ creditCards: import("./customer").CustomerCreditCardsState;
178
+ allergens: import("./customer").CustomerAllergensState;
179
+ addresses: import("./customer").CustomerAddressesState;
180
+ favorites: import("./customer").CustomerFavoritesState;
181
+ fcmToken: import("./customer").CustomerFcmTokenState;
182
+ giftCards: import("./customer").CustomerGiftCardsState;
183
+ groupOrders: import("./customer").CustomerGroupOrdersState;
184
+ history: import("./customer").CustomerHistoryState;
185
+ houseAccounts: import("./customer").CustomerHouseAccountsState;
186
+ loyalty: import("./customer").CustomerLoyaltyState;
187
+ order: import("./customer").CustomerOrderState;
188
+ orders: import("./customer").CustomerOrdersState;
189
+ pointsShop: import("./customer").PointsShopState;
190
+ tplsPointsShop: import("./customer").TplsPointsShopState;
191
+ qrcode: import("./customer").CustomerQRCodeState;
192
+ rewards: import("./customer").CustomerRewardsState;
193
+ thanx: import("./customer").CustomerThanxState;
194
+ tpls: import("./customer").CustomerTplsState;
195
+ }>;
196
+ deals: import("./deals").DealsState;
197
+ donations: import("./donations").DonationState;
198
+ geolocation: import("./geolocation").GeoLocationState;
199
+ giftCards: import("./giftCards").GiftCardsState;
200
+ groupOrder: import("./groupOrder").GroupOrderState;
201
+ guest: import("./guest").GuestState;
202
+ loader: import("./loader").LoaderState;
203
+ menu: import("./menu").MenuState;
204
+ menuDisplay: import("./menuDisplay").MenuDisplayState;
205
+ menuItems: import("./menuItems").MenuItemsState;
206
+ modal: import("@open-tender/types").Modal;
207
+ misc: import("./misc").MiscState;
208
+ nav: import("./nav").NavState;
209
+ navSite: import("./navSite").NavSiteState;
210
+ notifications: import("@open-tender/types").Notifications;
211
+ oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState;
212
+ order: import("./order").OrderState;
213
+ orderFulfillment: import("./orderFulfillment").OrderFulfillmentState;
214
+ orderRating: import("./orderRating").OrderRatingState;
215
+ posts: import("./posts").PostsSlice;
216
+ pushNotifications: import("./pushNotifications").PushNotificationsState;
217
+ qr: import("./qr").QrState;
218
+ quote: import("./quote").QuoteState;
219
+ resetPassword: import("./resetPassword").ResetPasswordState;
220
+ revenueCenters: import("./revenueCenters").RevenueCentersState;
221
+ sidebar: import("./sidebar").SidebarState;
222
+ sidebarModal: import("./sidebarModal").SidebarModalState;
223
+ signUp: import("./signUp").SignUpState;
224
+ tags: import("./tags").TagsState;
225
+ terms: import("./terms").TermsSlice;
226
+ validTimes: import("./validTimes").ValidTimesState;
227
+ verifyAccount: import("./verifyAccount").VerifyAccountState;
228
+ }) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
229
+ has_loyalty: boolean | undefined;
230
+ tpls: "COMO" | "THANX" | "PUNCHH" | "SPARKFLY" | null | undefined;
231
+ }) => boolean, {
232
+ clearCache: () => void;
233
+ }> & {
234
+ clearCache: () => void;
235
+ };
166
236
  export declare const selectFulfillment: (state: AppState) => import("@open-tender/types").ConfigFulfillment | undefined;
167
237
  export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined;
168
238
  export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined;
@@ -108,6 +108,16 @@ export const selectOptIns = createSelector((state) => {
108
108
  }, ({ accepts_marketing, order_notifications }) => {
109
109
  return { accepts_marketing, order_notifications };
110
110
  });
111
+ export const selectShowLoyalty = createSelector((state) => {
112
+ const { has_loyalty, tpls } = state.config.brand || {};
113
+ return { has_loyalty, tpls };
114
+ }, ({ has_loyalty, tpls }) => {
115
+ if (has_loyalty)
116
+ return true;
117
+ if (tpls === 'PUNCHH' || tpls === 'COMO')
118
+ return true;
119
+ return false;
120
+ });
111
121
  export const selectFulfillment = (state) => { var _a; return (_a = state.config.brand) === null || _a === void 0 ? void 0 : _a.fulfillment; };
112
122
  export const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
113
123
  export const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
@@ -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;
@@ -23,4 +23,5 @@ export declare const fetchCustomerOrders: import("@reduxjs/toolkit").AsyncThunk<
23
23
  }>;
24
24
  export declare const resetCustomerOrders: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orders/resetCustomerOrders">, resetCustomerOrdersError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orders/resetCustomerOrdersError">, setCustomerOrders: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "orders/setCustomerOrders">;
25
25
  export declare const selectCustomerOrders: (state: AppState) => CustomerOrdersState;
26
+ export declare const selectHasOrders: (state: AppState) => boolean;
26
27
  export declare const customerOrdersReducer: import("redux").Reducer<CustomerOrdersState, import("redux").AnyAction>;
@@ -59,4 +59,5 @@ const customerOrdersSlice = createSlice({
59
59
  });
60
60
  export const { resetCustomerOrders, resetCustomerOrdersError, setCustomerOrders } = customerOrdersSlice.actions;
61
61
  export const selectCustomerOrders = (state) => state.customer.orders;
62
+ export const selectHasOrders = (state) => state.customer.orders.entities.length > 0;
62
63
  export const customerOrdersReducer = customerOrdersSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
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.47",
60
- "@open-tender/utils": "^0.4.25"
59
+ "@open-tender/types": "^0.4.49",
60
+ "@open-tender/utils": "^0.4.27"
61
61
  }
62
62
  }