@open-tender/cloud 0.1.99 → 0.1.101

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.
@@ -67,16 +67,6 @@ const selectAllergens = (state) => state.allergens;
67
67
  exports.selectAllergens = selectAllergens;
68
68
  const selectSelectedAllergens = (state) => state.allergens.selectedAllergens;
69
69
  exports.selectSelectedAllergens = selectSelectedAllergens;
70
- // export const selectSelectedAllergenNames = (state: AppState) => {
71
- // const { entities: allergens, selectedAllergens } = state.allergens
72
- // if (!allergens.length || !selectedAllergens || !selectedAllergens.length) {
73
- // return []
74
- // }
75
- // return selectedAllergens.map(i => {
76
- // const allergen = allergens.find(a => a.allergen_id === i.allergen_id)
77
- // return allergen ? allergen.name ?? '' : ''
78
- // })
79
- // }
80
70
  exports.selectSelectedAllergenNames = (0, toolkit_1.createSelector)((state) => {
81
71
  const { entities: allergens, selectedAllergens } = state.allergens;
82
72
  return { allergens, selectedAllergens };
@@ -66,5 +66,67 @@ export declare const addCustomerCreditCard: import("@reduxjs/toolkit").AsyncThun
66
66
  }>;
67
67
  export declare const resetCustomerCreditCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditCards/resetCustomerCreditCards">, resetCustomerCreditCardsError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditCards/resetCustomerCreditCardsError">, setCustomerCreditCards: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "creditCards/setCustomerCreditCards">;
68
68
  export declare const selectCustomerCreditCards: (state: AppState) => CustomerCreditCardsState;
69
- export declare const selectCustomerCreditCardsForPayment: (state: AppState) => import("@open-tender/types").CreditCard[];
69
+ export declare const selectCustomerCreditCardsForPayment: ((state: import("redux").EmptyObject & {
70
+ alerts: import("@open-tender/types").Alerts;
71
+ allergens: import("..").AllergensState;
72
+ announcements: import("..").AnnouncementsState;
73
+ checkout: import("..").CheckoutState;
74
+ completedOrders: import("..").CompletedOrdersState;
75
+ config: import("..").ConfigState;
76
+ confirmation: import("..").ConfirmationState;
77
+ customer: import("redux").CombinedState<{
78
+ account: import("./account").AccountState;
79
+ communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
80
+ creditCards: CustomerCreditCardsState;
81
+ allergens: import("./allergens").CustomerAllergensState;
82
+ addresses: import("./addresses").CustomerAddressesState;
83
+ favorites: import("./favorites").CustomerFavoritesState;
84
+ fcmToken: import("./fcmToken").CustomerFcmTokenState;
85
+ giftCards: import("./giftCards").CustomerGiftCardsState;
86
+ groupOrders: import("./groupOrders").CustomerGroupOrdersState;
87
+ houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
88
+ loyalty: import("./loyalty").CustomerLoyaltyState;
89
+ order: import("./order").CustomerOrderState;
90
+ orders: import("./orders").CustomerOrdersState;
91
+ pointsShop: import("./pointsShop").PointsShopState;
92
+ qrcode: import("./qrCode").CustomerQRCodeState;
93
+ rewards: import("./rewards").CustomerRewardsState;
94
+ thanx: import("./thanx").CustomerThanxState;
95
+ tpls: import("./tpls").CustomerTplsState;
96
+ }>;
97
+ deals: import("..").DealsState;
98
+ donations: import("..").DonationState;
99
+ geolocation: import("..").GeoLocationState;
100
+ giftCards: import("..").GiftCardsState;
101
+ groupOrder: import("..").GroupOrderState;
102
+ guest: import("..").GuestState;
103
+ loader: import("..").LoaderState;
104
+ menu: import("..").MenuState;
105
+ menuDisplay: import("..").MenuDisplayState;
106
+ menuItems: import("..").MenuItemsState;
107
+ modal: import("@open-tender/types").Modal;
108
+ misc: import("..").MiscState;
109
+ nav: import("..").NavState;
110
+ navSite: import("..").NavSiteState;
111
+ notifications: import("@open-tender/types").Notifications;
112
+ oneTimePasscode: import("..").OneTimePasscodeState;
113
+ order: import("..").OrderState;
114
+ orderFulfillment: import("..").OrderFulfillmentState;
115
+ orderRating: import("..").OrderRatingState;
116
+ posts: import("..").PostsSlice;
117
+ qr: import("..").QrState;
118
+ resetPassword: import("..").ResetPasswordState;
119
+ revenueCenters: import("..").RevenueCentersState;
120
+ sidebar: import("..").SidebarState;
121
+ sidebarModal: import("..").SidebarModalState;
122
+ signUp: import("..").SignUpState;
123
+ tags: import("..").TagsState;
124
+ terms: import("..").TermsSlice;
125
+ validTimes: import("..").ValidTimesState;
126
+ verifyAccount: import("..").VerifyAccountState;
127
+ }) => import("@open-tender/types").CreditCard[]) & import("reselect").OutputSelectorFields<(args_0: CreditCards) => import("@open-tender/types").CreditCard[], {
128
+ clearCache: () => void;
129
+ }> & {
130
+ clearCache: () => void;
131
+ };
70
132
  export declare const customerCreditCardsReducer: import("redux").Reducer<CustomerCreditCardsState, import("redux").AnyAction>;
@@ -161,9 +161,10 @@ const customerCreditCardsSlice = (0, toolkit_1.createSlice)({
161
161
  _a = customerCreditCardsSlice.actions, exports.resetCustomerCreditCards = _a.resetCustomerCreditCards, exports.resetCustomerCreditCardsError = _a.resetCustomerCreditCardsError, exports.setCustomerCreditCards = _a.setCustomerCreditCards;
162
162
  const selectCustomerCreditCards = (state) => state.customer.creditCards;
163
163
  exports.selectCustomerCreditCards = selectCustomerCreditCards;
164
- const selectCustomerCreditCardsForPayment = (state) => {
164
+ exports.selectCustomerCreditCardsForPayment = (0, toolkit_1.createSelector)((state) => {
165
165
  const creditCards = state.customer.creditCards.entities;
166
+ return creditCards;
167
+ }, creditCards => {
166
168
  return creditCards.filter(i => i.has_profile);
167
- };
168
- exports.selectCustomerCreditCardsForPayment = selectCustomerCreditCardsForPayment;
169
+ });
169
170
  exports.customerCreditCardsReducer = customerCreditCardsSlice.reducer;
@@ -23,10 +23,5 @@ export declare const purchaseGiftCards: import("@reduxjs/toolkit").AsyncThunk<Gi
23
23
  rejectedMeta?: unknown;
24
24
  }>;
25
25
  export declare const resetGiftCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"giftCards/resetGiftCards">;
26
- export declare const selectGiftCards: (state: AppState) => {
27
- success: boolean;
28
- loading: RequestStatus;
29
- error: RequestError;
30
- giftCards: GiftCardsPurchased;
31
- };
26
+ export declare const selectGiftCards: (state: AppState) => GiftCardsState;
32
27
  export declare const giftCardsReducer: import("redux").Reducer<GiftCardsState, import("redux").AnyAction>;
@@ -53,9 +53,6 @@ const giftCardsSlice = (0, toolkit_1.createSlice)({
53
53
  }
54
54
  });
55
55
  exports.resetGiftCards = giftCardsSlice.actions.resetGiftCards;
56
- const selectGiftCards = (state) => {
57
- const { success, loading, error, giftCards } = state.giftCards;
58
- return { success, loading, error, giftCards };
59
- };
56
+ const selectGiftCards = (state) => state.giftCards;
60
57
  exports.selectGiftCards = selectGiftCards;
61
58
  exports.giftCardsReducer = giftCardsSlice.reducer;
@@ -61,16 +61,6 @@ const allergensSlice = createSlice({
61
61
  export const { resetAllergens, setSelectedAllergens } = allergensSlice.actions;
62
62
  export const selectAllergens = (state) => state.allergens;
63
63
  export const selectSelectedAllergens = (state) => state.allergens.selectedAllergens;
64
- // export const selectSelectedAllergenNames = (state: AppState) => {
65
- // const { entities: allergens, selectedAllergens } = state.allergens
66
- // if (!allergens.length || !selectedAllergens || !selectedAllergens.length) {
67
- // return []
68
- // }
69
- // return selectedAllergens.map(i => {
70
- // const allergen = allergens.find(a => a.allergen_id === i.allergen_id)
71
- // return allergen ? allergen.name ?? '' : ''
72
- // })
73
- // }
74
64
  export const selectSelectedAllergenNames = createSelector((state) => {
75
65
  const { entities: allergens, selectedAllergens } = state.allergens;
76
66
  return { allergens, selectedAllergens };
@@ -66,5 +66,67 @@ export declare const addCustomerCreditCard: import("@reduxjs/toolkit").AsyncThun
66
66
  }>;
67
67
  export declare const resetCustomerCreditCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditCards/resetCustomerCreditCards">, resetCustomerCreditCardsError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditCards/resetCustomerCreditCardsError">, setCustomerCreditCards: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "creditCards/setCustomerCreditCards">;
68
68
  export declare const selectCustomerCreditCards: (state: AppState) => CustomerCreditCardsState;
69
- export declare const selectCustomerCreditCardsForPayment: (state: AppState) => import("@open-tender/types").CreditCard[];
69
+ export declare const selectCustomerCreditCardsForPayment: ((state: import("redux").EmptyObject & {
70
+ alerts: import("@open-tender/types").Alerts;
71
+ allergens: import("..").AllergensState;
72
+ announcements: import("..").AnnouncementsState;
73
+ checkout: import("..").CheckoutState;
74
+ completedOrders: import("..").CompletedOrdersState;
75
+ config: import("..").ConfigState;
76
+ confirmation: import("..").ConfirmationState;
77
+ customer: import("redux").CombinedState<{
78
+ account: import("./account").AccountState;
79
+ communicationPreferences: import("./communicationPreferences").CustomerCommunicationPrefsState;
80
+ creditCards: CustomerCreditCardsState;
81
+ allergens: import("./allergens").CustomerAllergensState;
82
+ addresses: import("./addresses").CustomerAddressesState;
83
+ favorites: import("./favorites").CustomerFavoritesState;
84
+ fcmToken: import("./fcmToken").CustomerFcmTokenState;
85
+ giftCards: import("./giftCards").CustomerGiftCardsState;
86
+ groupOrders: import("./groupOrders").CustomerGroupOrdersState;
87
+ houseAccounts: import("./houseAccounts").CustomerHouseAccountsState;
88
+ loyalty: import("./loyalty").CustomerLoyaltyState;
89
+ order: import("./order").CustomerOrderState;
90
+ orders: import("./orders").CustomerOrdersState;
91
+ pointsShop: import("./pointsShop").PointsShopState;
92
+ qrcode: import("./qrCode").CustomerQRCodeState;
93
+ rewards: import("./rewards").CustomerRewardsState;
94
+ thanx: import("./thanx").CustomerThanxState;
95
+ tpls: import("./tpls").CustomerTplsState;
96
+ }>;
97
+ deals: import("..").DealsState;
98
+ donations: import("..").DonationState;
99
+ geolocation: import("..").GeoLocationState;
100
+ giftCards: import("..").GiftCardsState;
101
+ groupOrder: import("..").GroupOrderState;
102
+ guest: import("..").GuestState;
103
+ loader: import("..").LoaderState;
104
+ menu: import("..").MenuState;
105
+ menuDisplay: import("..").MenuDisplayState;
106
+ menuItems: import("..").MenuItemsState;
107
+ modal: import("@open-tender/types").Modal;
108
+ misc: import("..").MiscState;
109
+ nav: import("..").NavState;
110
+ navSite: import("..").NavSiteState;
111
+ notifications: import("@open-tender/types").Notifications;
112
+ oneTimePasscode: import("..").OneTimePasscodeState;
113
+ order: import("..").OrderState;
114
+ orderFulfillment: import("..").OrderFulfillmentState;
115
+ orderRating: import("..").OrderRatingState;
116
+ posts: import("..").PostsSlice;
117
+ qr: import("..").QrState;
118
+ resetPassword: import("..").ResetPasswordState;
119
+ revenueCenters: import("..").RevenueCentersState;
120
+ sidebar: import("..").SidebarState;
121
+ sidebarModal: import("..").SidebarModalState;
122
+ signUp: import("..").SignUpState;
123
+ tags: import("..").TagsState;
124
+ terms: import("..").TermsSlice;
125
+ validTimes: import("..").ValidTimesState;
126
+ verifyAccount: import("..").VerifyAccountState;
127
+ }) => import("@open-tender/types").CreditCard[]) & import("reselect").OutputSelectorFields<(args_0: CreditCards) => import("@open-tender/types").CreditCard[], {
128
+ clearCache: () => void;
129
+ }> & {
130
+ clearCache: () => void;
131
+ };
70
132
  export declare const customerCreditCardsReducer: import("redux").Reducer<CustomerCreditCardsState, import("redux").AnyAction>;
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
2
+ import { createAsyncThunk, createSelector, createSlice } from '@reduxjs/toolkit';
3
3
  import { ReducerType } from '../types';
4
4
  import { MISSING_CUSTOMER } from '@open-tender/types';
5
5
  import { checkAuth, selectToken } from './account';
@@ -156,8 +156,10 @@ const customerCreditCardsSlice = createSlice({
156
156
  });
157
157
  export const { resetCustomerCreditCards, resetCustomerCreditCardsError, setCustomerCreditCards } = customerCreditCardsSlice.actions;
158
158
  export const selectCustomerCreditCards = (state) => state.customer.creditCards;
159
- export const selectCustomerCreditCardsForPayment = (state) => {
159
+ export const selectCustomerCreditCardsForPayment = createSelector((state) => {
160
160
  const creditCards = state.customer.creditCards.entities;
161
+ return creditCards;
162
+ }, creditCards => {
161
163
  return creditCards.filter(i => i.has_profile);
162
- };
164
+ });
163
165
  export const customerCreditCardsReducer = customerCreditCardsSlice.reducer;
@@ -23,10 +23,5 @@ export declare const purchaseGiftCards: import("@reduxjs/toolkit").AsyncThunk<Gi
23
23
  rejectedMeta?: unknown;
24
24
  }>;
25
25
  export declare const resetGiftCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"giftCards/resetGiftCards">;
26
- export declare const selectGiftCards: (state: AppState) => {
27
- success: boolean;
28
- loading: RequestStatus;
29
- error: RequestError;
30
- giftCards: GiftCardsPurchased;
31
- };
26
+ export declare const selectGiftCards: (state: AppState) => GiftCardsState;
32
27
  export declare const giftCardsReducer: import("redux").Reducer<GiftCardsState, import("redux").AnyAction>;
@@ -50,8 +50,5 @@ const giftCardsSlice = createSlice({
50
50
  }
51
51
  });
52
52
  export const { resetGiftCards } = giftCardsSlice.actions;
53
- export const selectGiftCards = (state) => {
54
- const { success, loading, error, giftCards } = state.giftCards;
55
- return { success, loading, error, giftCards };
56
- };
53
+ export const selectGiftCards = (state) => state.giftCards;
57
54
  export const giftCardsReducer = giftCardsSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.99",
3
+ "version": "0.1.101",
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",