@open-tender/cloud 0.4.22 → 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.
@@ -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;
@@ -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.22",
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
  }