@open-tender/cloud 0.4.31 → 0.4.34
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/app/hooks.d.ts +1 -0
- package/dist/cjs/app/store.d.ts +3 -0
- package/dist/cjs/app/store.js +1 -0
- package/dist/cjs/services/api.d.ts +1 -0
- package/dist/cjs/services/api.js +3 -0
- package/dist/cjs/slices/allergens.d.ts +1 -0
- package/dist/cjs/slices/announcements.d.ts +2 -0
- package/dist/cjs/slices/config.d.ts +3 -0
- package/dist/cjs/slices/customer/creditCards.d.ts +1 -0
- package/dist/cjs/slices/customer/loyalty.d.ts +3 -0
- package/dist/cjs/slices/customer/order.d.ts +1 -0
- package/dist/cjs/slices/customer/tpls.d.ts +3 -0
- package/dist/cjs/slices/groupOrder.d.ts +4 -0
- package/dist/cjs/slices/groupOrder.js +1 -1
- package/dist/cjs/slices/guest.js +3 -1
- package/dist/cjs/slices/index.d.ts +1 -0
- package/dist/cjs/slices/index.js +1 -0
- package/dist/cjs/slices/order.d.ts +3 -0
- package/dist/cjs/slices/quote.d.ts +1 -0
- package/dist/cjs/slices/tags.d.ts +1 -0
- package/dist/cjs/slices/types.d.ts +1 -0
- package/dist/cjs/slices/types.js +1 -0
- package/dist/cjs/slices/unsubscribe.d.ts +26 -0
- package/dist/cjs/slices/unsubscribe.js +53 -0
- package/dist/esm/app/hooks.d.ts +1 -0
- package/dist/esm/app/store.d.ts +3 -0
- package/dist/esm/app/store.js +2 -1
- package/dist/esm/services/api.d.ts +1 -0
- package/dist/esm/services/api.js +3 -0
- package/dist/esm/slices/allergens.d.ts +1 -0
- package/dist/esm/slices/announcements.d.ts +2 -0
- package/dist/esm/slices/config.d.ts +3 -0
- package/dist/esm/slices/customer/creditCards.d.ts +1 -0
- package/dist/esm/slices/customer/loyalty.d.ts +3 -0
- package/dist/esm/slices/customer/order.d.ts +1 -0
- package/dist/esm/slices/customer/tpls.d.ts +3 -0
- package/dist/esm/slices/groupOrder.d.ts +4 -0
- package/dist/esm/slices/groupOrder.js +2 -2
- package/dist/esm/slices/guest.js +3 -1
- package/dist/esm/slices/index.d.ts +1 -0
- package/dist/esm/slices/index.js +1 -0
- package/dist/esm/slices/order.d.ts +3 -0
- package/dist/esm/slices/quote.d.ts +1 -0
- package/dist/esm/slices/tags.d.ts +1 -0
- package/dist/esm/slices/types.d.ts +1 -0
- package/dist/esm/slices/types.js +1 -0
- package/dist/esm/slices/unsubscribe.d.ts +26 -0
- package/dist/esm/slices/unsubscribe.js +49 -0
- package/package.json +3 -2
package/dist/cjs/app/hooks.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
60
60
|
signUp: import("..").SignUpState;
|
|
61
61
|
tags: import("..").TagsState;
|
|
62
62
|
terms: import("..").TermsSlice;
|
|
63
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
63
64
|
validTimes: import("..").ValidTimesState;
|
|
64
65
|
verifyAccount: import("..").VerifyAccountState;
|
|
65
66
|
}>, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").Action<any>>;
|
package/dist/cjs/app/store.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
59
59
|
signUp: import("../slices").SignUpState;
|
|
60
60
|
tags: import("../slices").TagsState;
|
|
61
61
|
terms: import("../slices").TermsSlice;
|
|
62
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
62
63
|
validTimes: import("../slices").ValidTimesState;
|
|
63
64
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
64
65
|
}>, import("redux").AnyAction>;
|
|
@@ -123,6 +124,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
123
124
|
signUp: import("../slices").SignUpState;
|
|
124
125
|
tags: import("../slices").TagsState;
|
|
125
126
|
terms: import("../slices").TermsSlice;
|
|
127
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
126
128
|
validTimes: import("../slices").ValidTimesState;
|
|
127
129
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
128
130
|
}, Action<any>, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<import("redux").CombinedState<{
|
|
@@ -185,6 +187,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
185
187
|
signUp: import("../slices").SignUpState;
|
|
186
188
|
tags: import("../slices").TagsState;
|
|
187
189
|
terms: import("../slices").TermsSlice;
|
|
190
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
188
191
|
validTimes: import("../slices").ValidTimesState;
|
|
189
192
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
190
193
|
}>, import("redux").AnyAction, undefined>]>>;
|
package/dist/cjs/app/store.js
CHANGED
|
@@ -43,6 +43,7 @@ exports.appReducer = (0, toolkit_1.combineReducers)({
|
|
|
43
43
|
[types_1.ReducerType.SignUp]: slices_1.signUpReducer,
|
|
44
44
|
[types_1.ReducerType.Tags]: slices_1.tagsReducer,
|
|
45
45
|
[types_1.ReducerType.Terms]: slices_1.termsReducer,
|
|
46
|
+
[types_1.ReducerType.Unsubscribe]: slices_1.unsubscribeReducer,
|
|
46
47
|
[types_1.ReducerType.ValidTimes]: slices_1.validTimesReducer,
|
|
47
48
|
[types_1.ReducerType.VerifyAccount]: slices_1.verifyAccountReducer
|
|
48
49
|
});
|
|
@@ -103,6 +103,7 @@ declare class OpenTenderAPI {
|
|
|
103
103
|
getGuest(email: string): Promise<unknown>;
|
|
104
104
|
getSubscriber(email: string): Promise<unknown>;
|
|
105
105
|
postSubscriber(email: string): Promise<unknown>;
|
|
106
|
+
postUnsubscribe(customer_id: string, campaign_id: string): Promise<unknown>;
|
|
106
107
|
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
107
108
|
postCustomerSignIn(data: CustomerSignIn): Promise<void | Auth | null | undefined>;
|
|
108
109
|
postThanxLogin(email: string, origin?: string): Promise<unknown>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -509,6 +509,9 @@ class OpenTenderAPI {
|
|
|
509
509
|
postSubscriber(email) {
|
|
510
510
|
return this.request(`/subscribers`, 'POST', { email });
|
|
511
511
|
}
|
|
512
|
+
postUnsubscribe(customer_id, campaign_id) {
|
|
513
|
+
return this.request(`/unsubscribe/campaign/${customer_id}/${campaign_id}`, 'POST');
|
|
514
|
+
}
|
|
512
515
|
postSignUp(data) {
|
|
513
516
|
return this.request(`/customer`, 'POST', data);
|
|
514
517
|
}
|
|
@@ -87,6 +87,7 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
87
87
|
signUp: import("./signUp").SignUpState;
|
|
88
88
|
tags: import("./tags").TagsState;
|
|
89
89
|
terms: import("./terms").TermsSlice;
|
|
90
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
90
91
|
validTimes: import("./validTimes").ValidTimesState;
|
|
91
92
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
92
93
|
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -84,6 +84,7 @@ export declare const selectAnnouncementsPage: (page: AnnouncementPageType) => ((
|
|
|
84
84
|
signUp: import("./signUp").SignUpState;
|
|
85
85
|
tags: import("./tags").TagsState;
|
|
86
86
|
terms: import("./terms").TermsSlice;
|
|
87
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
87
88
|
validTimes: import("./validTimes").ValidTimesState;
|
|
88
89
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
89
90
|
}) => {
|
|
@@ -165,6 +166,7 @@ export declare const selectHasAnnouncementsPage: (page: AnnouncementPageType) =>
|
|
|
165
166
|
signUp: import("./signUp").SignUpState;
|
|
166
167
|
tags: import("./tags").TagsState;
|
|
167
168
|
terms: import("./terms").TermsSlice;
|
|
169
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
168
170
|
validTimes: import("./validTimes").ValidTimesState;
|
|
169
171
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
170
172
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -147,6 +147,7 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
147
147
|
signUp: import("./signUp").SignUpState;
|
|
148
148
|
tags: import("./tags").TagsState;
|
|
149
149
|
terms: import("./terms").TermsSlice;
|
|
150
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
150
151
|
validTimes: import("./validTimes").ValidTimesState;
|
|
151
152
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
152
153
|
}) => {
|
|
@@ -223,6 +224,7 @@ export declare const selectShowLoyalty: ((state: import("redux").EmptyObject & {
|
|
|
223
224
|
signUp: import("./signUp").SignUpState;
|
|
224
225
|
tags: import("./tags").TagsState;
|
|
225
226
|
terms: import("./terms").TermsSlice;
|
|
227
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
226
228
|
validTimes: import("./validTimes").ValidTimesState;
|
|
227
229
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
228
230
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -298,6 +300,7 @@ export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObjec
|
|
|
298
300
|
signUp: import("./signUp").SignUpState;
|
|
299
301
|
tags: import("./tags").TagsState;
|
|
300
302
|
terms: import("./terms").TermsSlice;
|
|
303
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
301
304
|
validTimes: import("./validTimes").ValidTimesState;
|
|
302
305
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
303
306
|
}) => {}) & import("reselect").OutputSelectorFields<(args_0: (import("@open-tender/types").BottomTabsDisplayed & import("@open-tender/types").BottomTabsTitles) | undefined) => {}, {
|
|
@@ -126,6 +126,7 @@ export declare const selectCustomerCreditCardsForPayment: ((state: import("redux
|
|
|
126
126
|
signUp: import("..").SignUpState;
|
|
127
127
|
tags: import("..").TagsState;
|
|
128
128
|
terms: import("..").TermsSlice;
|
|
129
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
129
130
|
validTimes: import("..").ValidTimesState;
|
|
130
131
|
verifyAccount: import("..").VerifyAccountState;
|
|
131
132
|
}) => import("@open-tender/types").CreditCard[]) & import("reselect").OutputSelectorFields<(args_0: CreditCards) => import("@open-tender/types").CreditCard[], {
|
|
@@ -83,6 +83,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: import("redux").Empt
|
|
|
83
83
|
signUp: import("..").SignUpState;
|
|
84
84
|
tags: import("..").TagsState;
|
|
85
85
|
terms: import("..").TermsSlice;
|
|
86
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
86
87
|
validTimes: import("..").ValidTimesState;
|
|
87
88
|
verifyAccount: import("..").VerifyAccountState;
|
|
88
89
|
}) => {
|
|
@@ -162,6 +163,7 @@ export declare const selectHasPointsShop: ((state: import("redux").EmptyObject &
|
|
|
162
163
|
signUp: import("..").SignUpState;
|
|
163
164
|
tags: import("..").TagsState;
|
|
164
165
|
terms: import("..").TermsSlice;
|
|
166
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
165
167
|
validTimes: import("..").ValidTimesState;
|
|
166
168
|
verifyAccount: import("..").VerifyAccountState;
|
|
167
169
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -231,6 +233,7 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
231
233
|
signUp: import("..").SignUpState;
|
|
232
234
|
tags: import("..").TagsState;
|
|
233
235
|
terms: import("..").TermsSlice;
|
|
236
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
234
237
|
validTimes: import("..").ValidTimesState;
|
|
235
238
|
verifyAccount: import("..").VerifyAccountState;
|
|
236
239
|
}) => import("@open-tender/types").LoyaltyProgram | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -93,6 +93,7 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
93
93
|
signUp: import("..").SignUpState;
|
|
94
94
|
tags: import("..").TagsState;
|
|
95
95
|
terms: import("..").TermsSlice;
|
|
96
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
96
97
|
validTimes: import("..").ValidTimesState;
|
|
97
98
|
verifyAccount: import("..").VerifyAccountState;
|
|
98
99
|
}) => {
|
|
@@ -91,6 +91,7 @@ export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObj
|
|
|
91
91
|
signUp: import("..").SignUpState;
|
|
92
92
|
tags: import("..").TagsState;
|
|
93
93
|
terms: import("..").TermsSlice;
|
|
94
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
94
95
|
validTimes: import("..").ValidTimesState;
|
|
95
96
|
verifyAccount: import("..").VerifyAccountState;
|
|
96
97
|
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSPoints | null | undefined) => number | null, {
|
|
@@ -158,6 +159,7 @@ export declare const selectCustomerTplsRewards: ((state: import("redux").EmptyOb
|
|
|
158
159
|
signUp: import("..").SignUpState;
|
|
159
160
|
tags: import("..").TagsState;
|
|
160
161
|
terms: import("..").TermsSlice;
|
|
162
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
161
163
|
validTimes: import("..").ValidTimesState;
|
|
162
164
|
verifyAccount: import("..").VerifyAccountState;
|
|
163
165
|
}) => import("@open-tender/types").TPLSRewards) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSRewards | undefined) => import("@open-tender/types").TPLSRewards, {
|
|
@@ -225,6 +227,7 @@ export declare const selectCustomerTplsProgress: ((state: import("redux").EmptyO
|
|
|
225
227
|
signUp: import("..").SignUpState;
|
|
226
228
|
tags: import("..").TagsState;
|
|
227
229
|
terms: import("..").TermsSlice;
|
|
230
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
228
231
|
validTimes: import("..").ValidTimesState;
|
|
229
232
|
verifyAccount: import("..").VerifyAccountState;
|
|
230
233
|
}) => import("@open-tender/types").TPLSProgress | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSProgress | null | undefined) => import("@open-tender/types").TPLSProgress | null, {
|
|
@@ -166,6 +166,7 @@ export declare const selectSpendingLimit: ((state: import("redux").EmptyObject &
|
|
|
166
166
|
signUp: import("./signUp").SignUpState;
|
|
167
167
|
tags: import("./tags").TagsState;
|
|
168
168
|
terms: import("./terms").TermsSlice;
|
|
169
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
169
170
|
validTimes: import("./validTimes").ValidTimesState;
|
|
170
171
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
171
172
|
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -236,6 +237,7 @@ export declare const selectGroupOrderClosed: ((state: import("redux").EmptyObjec
|
|
|
236
237
|
signUp: import("./signUp").SignUpState;
|
|
237
238
|
tags: import("./tags").TagsState;
|
|
238
239
|
terms: import("./terms").TermsSlice;
|
|
240
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
239
241
|
validTimes: import("./validTimes").ValidTimesState;
|
|
240
242
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
241
243
|
}) => boolean | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -308,6 +310,7 @@ export declare const selectGroupOrderTests: ((state: import("redux").EmptyObject
|
|
|
308
310
|
signUp: import("./signUp").SignUpState;
|
|
309
311
|
tags: import("./tags").TagsState;
|
|
310
312
|
terms: import("./terms").TermsSlice;
|
|
313
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
311
314
|
validTimes: import("./validTimes").ValidTimesState;
|
|
312
315
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
313
316
|
}) => {
|
|
@@ -389,6 +392,7 @@ export declare const selectGroupOrderPrepTimes: ((state: import("redux").EmptyOb
|
|
|
389
392
|
signUp: import("./signUp").SignUpState;
|
|
390
393
|
tags: import("./tags").TagsState;
|
|
391
394
|
terms: import("./terms").TermsSlice;
|
|
395
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
392
396
|
validTimes: import("./validTimes").ValidTimesState;
|
|
393
397
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
394
398
|
}) => {
|
|
@@ -236,7 +236,7 @@ exports.selectGroupOrderClosed = (0, toolkit_1.createSelector)((state) => {
|
|
|
236
236
|
return { cartGuest, cutoffAt, closed, tz };
|
|
237
237
|
}, ({ cartGuest, cutoffAt, closed, tz }) => {
|
|
238
238
|
const cutoffDate = cutoffAt ? (0, utils_1.isoToDate)(cutoffAt, tz) : null;
|
|
239
|
-
const pastCutoff = cutoffDate ?
|
|
239
|
+
const pastCutoff = cutoffDate ? (0, utils_1.currentLocalDate)(tz) > cutoffDate : false;
|
|
240
240
|
return cartGuest && (closed || pastCutoff);
|
|
241
241
|
});
|
|
242
242
|
exports.selectGroupOrderTests = (0, toolkit_1.createSelector)((state) => {
|
package/dist/cjs/slices/guest.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.guestReducer = exports.selectGuest = exports.setGuestEmail = exports.res
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const types_1 = require("./types");
|
|
8
|
+
const order_1 = require("./order");
|
|
8
9
|
const initialState = {
|
|
9
10
|
brands: null,
|
|
10
11
|
email: null,
|
|
@@ -32,7 +33,7 @@ exports.fetchGuest = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuest,
|
|
|
32
33
|
return rejectWithValue(error);
|
|
33
34
|
}
|
|
34
35
|
}));
|
|
35
|
-
exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue, dispatch }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
37
|
const { api } = getState().config;
|
|
37
38
|
if (!api)
|
|
38
39
|
return;
|
|
@@ -40,6 +41,7 @@ exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchG
|
|
|
40
41
|
yield api.postThanxLogin(email, origin);
|
|
41
42
|
if (callback)
|
|
42
43
|
callback();
|
|
44
|
+
dispatch((0, order_1.addMessage)('Thanks! Please check your email on this device.'));
|
|
43
45
|
return { email: email };
|
|
44
46
|
}
|
|
45
47
|
catch (err) {
|
package/dist/cjs/slices/index.js
CHANGED
|
@@ -39,5 +39,6 @@ tslib_1.__exportStar(require("./sidebarModal"), exports);
|
|
|
39
39
|
tslib_1.__exportStar(require("./signUp"), exports);
|
|
40
40
|
tslib_1.__exportStar(require("./tags"), exports);
|
|
41
41
|
tslib_1.__exportStar(require("./terms"), exports);
|
|
42
|
+
tslib_1.__exportStar(require("./unsubscribe"), exports);
|
|
42
43
|
tslib_1.__exportStar(require("./validTimes"), exports);
|
|
43
44
|
tslib_1.__exportStar(require("./verifyAccount"), exports);
|
|
@@ -194,6 +194,7 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
194
194
|
signUp: import("./signUp").SignUpState;
|
|
195
195
|
tags: import("./tags").TagsState;
|
|
196
196
|
terms: import("./terms").TermsSlice;
|
|
197
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
197
198
|
validTimes: import("./validTimes").ValidTimesState;
|
|
198
199
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
199
200
|
}) => {
|
|
@@ -272,6 +273,7 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
272
273
|
signUp: import("./signUp").SignUpState;
|
|
273
274
|
tags: import("./tags").TagsState;
|
|
274
275
|
terms: import("./terms").TermsSlice;
|
|
276
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
275
277
|
validTimes: import("./validTimes").ValidTimesState;
|
|
276
278
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
277
279
|
}) => number[]) & import("reselect").OutputSelectorFields<(args_0: Cart | null) => number[], {
|
|
@@ -345,6 +347,7 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
345
347
|
signUp: import("./signUp").SignUpState;
|
|
346
348
|
tags: import("./tags").TagsState;
|
|
347
349
|
terms: import("./terms").TermsSlice;
|
|
350
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
348
351
|
validTimes: import("./validTimes").ValidTimesState;
|
|
349
352
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
350
353
|
}) => {
|
|
@@ -79,6 +79,7 @@ export declare const selectQuote: ((state: import("redux").EmptyObject & {
|
|
|
79
79
|
signUp: import("./signUp").SignUpState;
|
|
80
80
|
tags: import("./tags").TagsState;
|
|
81
81
|
terms: import("./terms").TermsSlice;
|
|
82
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
82
83
|
validTimes: import("./validTimes").ValidTimesState;
|
|
83
84
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
84
85
|
}) => {
|
|
@@ -87,6 +87,7 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
87
87
|
signUp: import("./signUp").SignUpState;
|
|
88
88
|
tags: TagsState;
|
|
89
89
|
terms: import("./terms").TermsSlice;
|
|
90
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
90
91
|
validTimes: import("./validTimes").ValidTimesState;
|
|
91
92
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
92
93
|
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
|
package/dist/cjs/slices/types.js
CHANGED
|
@@ -60,6 +60,7 @@ var ReducerType;
|
|
|
60
60
|
ReducerType["Thanx"] = "thanx";
|
|
61
61
|
ReducerType["Tpls"] = "tpls";
|
|
62
62
|
ReducerType["TplsPointsShop"] = "tplsPointsShop";
|
|
63
|
+
ReducerType["Unsubscribe"] = "Unsubscribe";
|
|
63
64
|
ReducerType["ValidTimes"] = "validTimes";
|
|
64
65
|
ReducerType["VerifyAccount"] = "verifyAccount";
|
|
65
66
|
})(ReducerType = exports.ReducerType || (exports.ReducerType = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppState } from '../app';
|
|
2
|
+
import { RequestError, RequestStatus } from '@open-tender/types';
|
|
3
|
+
export interface UnsubscribeState {
|
|
4
|
+
loading: RequestStatus;
|
|
5
|
+
error: RequestError;
|
|
6
|
+
success: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare enum UnsubscribeActionType {
|
|
9
|
+
Unsubscribe = "unsubscribe/unsubscribe"
|
|
10
|
+
}
|
|
11
|
+
export declare const unsubscribe: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
12
|
+
customer_id: string;
|
|
13
|
+
campaign_id: string;
|
|
14
|
+
}, {
|
|
15
|
+
state: AppState;
|
|
16
|
+
rejectValue: RequestError;
|
|
17
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
18
|
+
extra?: unknown;
|
|
19
|
+
serializedErrorType?: unknown;
|
|
20
|
+
pendingMeta?: unknown;
|
|
21
|
+
fulfilledMeta?: unknown;
|
|
22
|
+
rejectedMeta?: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const resetUnsubscribe: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Unsubscribe/resetUnsubscribe">;
|
|
25
|
+
export declare const selectUnsubscribe: (state: AppState) => UnsubscribeState;
|
|
26
|
+
export declare const unsubscribeReducer: import("redux").Reducer<UnsubscribeState, import("redux").AnyAction>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unsubscribeReducer = exports.selectUnsubscribe = exports.resetUnsubscribe = exports.unsubscribe = exports.UnsubscribeActionType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const initialState = {
|
|
8
|
+
loading: 'idle',
|
|
9
|
+
error: null,
|
|
10
|
+
success: false
|
|
11
|
+
};
|
|
12
|
+
var UnsubscribeActionType;
|
|
13
|
+
(function (UnsubscribeActionType) {
|
|
14
|
+
UnsubscribeActionType["Unsubscribe"] = "unsubscribe/unsubscribe";
|
|
15
|
+
})(UnsubscribeActionType = exports.UnsubscribeActionType || (exports.UnsubscribeActionType = {}));
|
|
16
|
+
exports.unsubscribe = (0, toolkit_1.createAsyncThunk)(UnsubscribeActionType.Unsubscribe, ({ customer_id, campaign_id }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const { api } = getState().config;
|
|
18
|
+
if (!api)
|
|
19
|
+
return;
|
|
20
|
+
try {
|
|
21
|
+
yield api.postUnsubscribe(customer_id, campaign_id);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return rejectWithValue(err);
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
const unsubscribeSlice = (0, toolkit_1.createSlice)({
|
|
29
|
+
name: types_1.ReducerType.Unsubscribe,
|
|
30
|
+
initialState,
|
|
31
|
+
reducers: {
|
|
32
|
+
resetUnsubscribe: () => initialState
|
|
33
|
+
},
|
|
34
|
+
extraReducers: builder => {
|
|
35
|
+
builder
|
|
36
|
+
.addCase(exports.unsubscribe.fulfilled, state => {
|
|
37
|
+
state.success = true;
|
|
38
|
+
state.loading = 'idle';
|
|
39
|
+
state.error = null;
|
|
40
|
+
})
|
|
41
|
+
.addCase(exports.unsubscribe.pending, state => {
|
|
42
|
+
state.loading = 'pending';
|
|
43
|
+
})
|
|
44
|
+
.addCase(exports.unsubscribe.rejected, (state, action) => {
|
|
45
|
+
state.loading = 'idle';
|
|
46
|
+
state.error = action.payload;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
exports.resetUnsubscribe = unsubscribeSlice.actions.resetUnsubscribe;
|
|
51
|
+
const selectUnsubscribe = (state) => state.Unsubscribe;
|
|
52
|
+
exports.selectUnsubscribe = selectUnsubscribe;
|
|
53
|
+
exports.unsubscribeReducer = unsubscribeSlice.reducer;
|
package/dist/esm/app/hooks.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
60
60
|
signUp: import("..").SignUpState;
|
|
61
61
|
tags: import("..").TagsState;
|
|
62
62
|
terms: import("..").TermsSlice;
|
|
63
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
63
64
|
validTimes: import("..").ValidTimesState;
|
|
64
65
|
verifyAccount: import("..").VerifyAccountState;
|
|
65
66
|
}>, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").Action<any>>;
|
package/dist/esm/app/store.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare const appReducer: import("redux").Reducer<import("redux").Combine
|
|
|
59
59
|
signUp: import("../slices").SignUpState;
|
|
60
60
|
tags: import("../slices").TagsState;
|
|
61
61
|
terms: import("../slices").TermsSlice;
|
|
62
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
62
63
|
validTimes: import("../slices").ValidTimesState;
|
|
63
64
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
64
65
|
}>, import("redux").AnyAction>;
|
|
@@ -123,6 +124,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
123
124
|
signUp: import("../slices").SignUpState;
|
|
124
125
|
tags: import("../slices").TagsState;
|
|
125
126
|
terms: import("../slices").TermsSlice;
|
|
127
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
126
128
|
validTimes: import("../slices").ValidTimesState;
|
|
127
129
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
128
130
|
}, Action<any>, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<import("redux").CombinedState<{
|
|
@@ -185,6 +187,7 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
|
|
|
185
187
|
signUp: import("../slices").SignUpState;
|
|
186
188
|
tags: import("../slices").TagsState;
|
|
187
189
|
terms: import("../slices").TermsSlice;
|
|
190
|
+
Unsubscribe: import("../slices").UnsubscribeState;
|
|
188
191
|
validTimes: import("../slices").ValidTimesState;
|
|
189
192
|
verifyAccount: import("../slices").VerifyAccountState;
|
|
190
193
|
}>, import("redux").AnyAction, undefined>]>>;
|
package/dist/esm/app/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { alertsReducer, allergensReducer, announcementsReducer, checkoutReducer, completedOrdersReducer, configReducer, confirmationReducer, customerReducer, dealsReducer, donationsReducer, geolocationReducer, giftCardsReducer, groupOrderReducer, guestReducer, loaderReducer, menuDisplayReducer, menuItemsReducer, menuReducer, miscReducer, modalReducer, navReducer, navSiteReducer, notificationsReducer, oneTimePasscodeReducer, orderFulfillmentReducer, orderRatingReducer, orderReducer, postsReducer, pushNotificationsReducer, qrReducer, quoteReducer, resetPasswordReducer, revenueCentersReducer, sidebarModalReducer, sidebarReducer, signUpReducer, tagsReducer, termsReducer, validTimesReducer, verifyAccountReducer } from '../slices';
|
|
2
|
+
import { alertsReducer, allergensReducer, announcementsReducer, checkoutReducer, completedOrdersReducer, configReducer, confirmationReducer, customerReducer, dealsReducer, donationsReducer, geolocationReducer, giftCardsReducer, groupOrderReducer, guestReducer, loaderReducer, menuDisplayReducer, menuItemsReducer, menuReducer, miscReducer, modalReducer, navReducer, navSiteReducer, notificationsReducer, oneTimePasscodeReducer, orderFulfillmentReducer, orderRatingReducer, orderReducer, postsReducer, pushNotificationsReducer, qrReducer, quoteReducer, resetPasswordReducer, revenueCentersReducer, sidebarModalReducer, sidebarReducer, signUpReducer, tagsReducer, termsReducer, unsubscribeReducer, validTimesReducer, verifyAccountReducer } from '../slices';
|
|
3
3
|
import { ReducerType } from '../slices/types';
|
|
4
4
|
export const appReducer = combineReducers({
|
|
5
5
|
[ReducerType.Alerts]: alertsReducer,
|
|
@@ -40,6 +40,7 @@ export const appReducer = combineReducers({
|
|
|
40
40
|
[ReducerType.SignUp]: signUpReducer,
|
|
41
41
|
[ReducerType.Tags]: tagsReducer,
|
|
42
42
|
[ReducerType.Terms]: termsReducer,
|
|
43
|
+
[ReducerType.Unsubscribe]: unsubscribeReducer,
|
|
43
44
|
[ReducerType.ValidTimes]: validTimesReducer,
|
|
44
45
|
[ReducerType.VerifyAccount]: verifyAccountReducer
|
|
45
46
|
});
|
|
@@ -103,6 +103,7 @@ declare class OpenTenderAPI {
|
|
|
103
103
|
getGuest(email: string): Promise<unknown>;
|
|
104
104
|
getSubscriber(email: string): Promise<unknown>;
|
|
105
105
|
postSubscriber(email: string): Promise<unknown>;
|
|
106
|
+
postUnsubscribe(customer_id: string, campaign_id: string): Promise<unknown>;
|
|
106
107
|
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
107
108
|
postCustomerSignIn(data: CustomerSignIn): Promise<void | Auth | null | undefined>;
|
|
108
109
|
postThanxLogin(email: string, origin?: string): Promise<unknown>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -507,6 +507,9 @@ class OpenTenderAPI {
|
|
|
507
507
|
postSubscriber(email) {
|
|
508
508
|
return this.request(`/subscribers`, 'POST', { email });
|
|
509
509
|
}
|
|
510
|
+
postUnsubscribe(customer_id, campaign_id) {
|
|
511
|
+
return this.request(`/unsubscribe/campaign/${customer_id}/${campaign_id}`, 'POST');
|
|
512
|
+
}
|
|
510
513
|
postSignUp(data) {
|
|
511
514
|
return this.request(`/customer`, 'POST', data);
|
|
512
515
|
}
|
|
@@ -87,6 +87,7 @@ export declare const selectSelectedAllergenNames: ((state: import("redux").Empty
|
|
|
87
87
|
signUp: import("./signUp").SignUpState;
|
|
88
88
|
tags: import("./tags").TagsState;
|
|
89
89
|
terms: import("./terms").TermsSlice;
|
|
90
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
90
91
|
validTimes: import("./validTimes").ValidTimesState;
|
|
91
92
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
92
93
|
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -84,6 +84,7 @@ export declare const selectAnnouncementsPage: (page: AnnouncementPageType) => ((
|
|
|
84
84
|
signUp: import("./signUp").SignUpState;
|
|
85
85
|
tags: import("./tags").TagsState;
|
|
86
86
|
terms: import("./terms").TermsSlice;
|
|
87
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
87
88
|
validTimes: import("./validTimes").ValidTimesState;
|
|
88
89
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
89
90
|
}) => {
|
|
@@ -165,6 +166,7 @@ export declare const selectHasAnnouncementsPage: (page: AnnouncementPageType) =>
|
|
|
165
166
|
signUp: import("./signUp").SignUpState;
|
|
166
167
|
tags: import("./tags").TagsState;
|
|
167
168
|
terms: import("./terms").TermsSlice;
|
|
169
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
168
170
|
validTimes: import("./validTimes").ValidTimesState;
|
|
169
171
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
170
172
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -147,6 +147,7 @@ export declare const selectOptIns: ((state: import("redux").EmptyObject & {
|
|
|
147
147
|
signUp: import("./signUp").SignUpState;
|
|
148
148
|
tags: import("./tags").TagsState;
|
|
149
149
|
terms: import("./terms").TermsSlice;
|
|
150
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
150
151
|
validTimes: import("./validTimes").ValidTimesState;
|
|
151
152
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
152
153
|
}) => {
|
|
@@ -223,6 +224,7 @@ export declare const selectShowLoyalty: ((state: import("redux").EmptyObject & {
|
|
|
223
224
|
signUp: import("./signUp").SignUpState;
|
|
224
225
|
tags: import("./tags").TagsState;
|
|
225
226
|
terms: import("./terms").TermsSlice;
|
|
227
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
226
228
|
validTimes: import("./validTimes").ValidTimesState;
|
|
227
229
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
228
230
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -298,6 +300,7 @@ export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObjec
|
|
|
298
300
|
signUp: import("./signUp").SignUpState;
|
|
299
301
|
tags: import("./tags").TagsState;
|
|
300
302
|
terms: import("./terms").TermsSlice;
|
|
303
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
301
304
|
validTimes: import("./validTimes").ValidTimesState;
|
|
302
305
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
303
306
|
}) => {}) & import("reselect").OutputSelectorFields<(args_0: (import("@open-tender/types").BottomTabsDisplayed & import("@open-tender/types").BottomTabsTitles) | undefined) => {}, {
|
|
@@ -126,6 +126,7 @@ export declare const selectCustomerCreditCardsForPayment: ((state: import("redux
|
|
|
126
126
|
signUp: import("..").SignUpState;
|
|
127
127
|
tags: import("..").TagsState;
|
|
128
128
|
terms: import("..").TermsSlice;
|
|
129
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
129
130
|
validTimes: import("..").ValidTimesState;
|
|
130
131
|
verifyAccount: import("..").VerifyAccountState;
|
|
131
132
|
}) => import("@open-tender/types").CreditCard[]) & import("reselect").OutputSelectorFields<(args_0: CreditCards) => import("@open-tender/types").CreditCard[], {
|
|
@@ -83,6 +83,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: import("redux").Empt
|
|
|
83
83
|
signUp: import("..").SignUpState;
|
|
84
84
|
tags: import("..").TagsState;
|
|
85
85
|
terms: import("..").TermsSlice;
|
|
86
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
86
87
|
validTimes: import("..").ValidTimesState;
|
|
87
88
|
verifyAccount: import("..").VerifyAccountState;
|
|
88
89
|
}) => {
|
|
@@ -162,6 +163,7 @@ export declare const selectHasPointsShop: ((state: import("redux").EmptyObject &
|
|
|
162
163
|
signUp: import("..").SignUpState;
|
|
163
164
|
tags: import("..").TagsState;
|
|
164
165
|
terms: import("..").TermsSlice;
|
|
166
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
165
167
|
validTimes: import("..").ValidTimesState;
|
|
166
168
|
verifyAccount: import("..").VerifyAccountState;
|
|
167
169
|
}) => boolean) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -231,6 +233,7 @@ export declare const selectCustomerPointsProgram: (orderType: OrderType | null)
|
|
|
231
233
|
signUp: import("..").SignUpState;
|
|
232
234
|
tags: import("..").TagsState;
|
|
233
235
|
terms: import("..").TermsSlice;
|
|
236
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
234
237
|
validTimes: import("..").ValidTimesState;
|
|
235
238
|
verifyAccount: import("..").VerifyAccountState;
|
|
236
239
|
}) => import("@open-tender/types").LoyaltyProgram | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -93,6 +93,7 @@ export declare const selectCustomerOrder: ((state: import("redux").EmptyObject &
|
|
|
93
93
|
signUp: import("..").SignUpState;
|
|
94
94
|
tags: import("..").TagsState;
|
|
95
95
|
terms: import("..").TermsSlice;
|
|
96
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
96
97
|
validTimes: import("..").ValidTimesState;
|
|
97
98
|
verifyAccount: import("..").VerifyAccountState;
|
|
98
99
|
}) => {
|
|
@@ -91,6 +91,7 @@ export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObj
|
|
|
91
91
|
signUp: import("..").SignUpState;
|
|
92
92
|
tags: import("..").TagsState;
|
|
93
93
|
terms: import("..").TermsSlice;
|
|
94
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
94
95
|
validTimes: import("..").ValidTimesState;
|
|
95
96
|
verifyAccount: import("..").VerifyAccountState;
|
|
96
97
|
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSPoints | null | undefined) => number | null, {
|
|
@@ -158,6 +159,7 @@ export declare const selectCustomerTplsRewards: ((state: import("redux").EmptyOb
|
|
|
158
159
|
signUp: import("..").SignUpState;
|
|
159
160
|
tags: import("..").TagsState;
|
|
160
161
|
terms: import("..").TermsSlice;
|
|
162
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
161
163
|
validTimes: import("..").ValidTimesState;
|
|
162
164
|
verifyAccount: import("..").VerifyAccountState;
|
|
163
165
|
}) => import("@open-tender/types").TPLSRewards) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSRewards | undefined) => import("@open-tender/types").TPLSRewards, {
|
|
@@ -225,6 +227,7 @@ export declare const selectCustomerTplsProgress: ((state: import("redux").EmptyO
|
|
|
225
227
|
signUp: import("..").SignUpState;
|
|
226
228
|
tags: import("..").TagsState;
|
|
227
229
|
terms: import("..").TermsSlice;
|
|
230
|
+
Unsubscribe: import("..").UnsubscribeState;
|
|
228
231
|
validTimes: import("..").ValidTimesState;
|
|
229
232
|
verifyAccount: import("..").VerifyAccountState;
|
|
230
233
|
}) => import("@open-tender/types").TPLSProgress | null) & import("reselect").OutputSelectorFields<(args_0: import("@open-tender/types").TPLSProgress | null | undefined) => import("@open-tender/types").TPLSProgress | null, {
|
|
@@ -166,6 +166,7 @@ export declare const selectSpendingLimit: ((state: import("redux").EmptyObject &
|
|
|
166
166
|
signUp: import("./signUp").SignUpState;
|
|
167
167
|
tags: import("./tags").TagsState;
|
|
168
168
|
terms: import("./terms").TermsSlice;
|
|
169
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
169
170
|
validTimes: import("./validTimes").ValidTimesState;
|
|
170
171
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
171
172
|
}) => number | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -236,6 +237,7 @@ export declare const selectGroupOrderClosed: ((state: import("redux").EmptyObjec
|
|
|
236
237
|
signUp: import("./signUp").SignUpState;
|
|
237
238
|
tags: import("./tags").TagsState;
|
|
238
239
|
terms: import("./terms").TermsSlice;
|
|
240
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
239
241
|
validTimes: import("./validTimes").ValidTimesState;
|
|
240
242
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
241
243
|
}) => boolean | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
@@ -308,6 +310,7 @@ export declare const selectGroupOrderTests: ((state: import("redux").EmptyObject
|
|
|
308
310
|
signUp: import("./signUp").SignUpState;
|
|
309
311
|
tags: import("./tags").TagsState;
|
|
310
312
|
terms: import("./terms").TermsSlice;
|
|
313
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
311
314
|
validTimes: import("./validTimes").ValidTimesState;
|
|
312
315
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
313
316
|
}) => {
|
|
@@ -389,6 +392,7 @@ export declare const selectGroupOrderPrepTimes: ((state: import("redux").EmptyOb
|
|
|
389
392
|
signUp: import("./signUp").SignUpState;
|
|
390
393
|
tags: import("./tags").TagsState;
|
|
391
394
|
terms: import("./terms").TermsSlice;
|
|
395
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
392
396
|
validTimes: import("./validTimes").ValidTimesState;
|
|
393
397
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
394
398
|
}) => {
|
|
@@ -2,7 +2,7 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
import { createAsyncThunk, createSelector, createSlice } from '@reduxjs/toolkit';
|
|
3
3
|
import { ReducerType } from './types';
|
|
4
4
|
import { MISSING_CUSTOMER } from '@open-tender/types';
|
|
5
|
-
import { isoToDate, makeSimpleCart, rehydrateCart } from '@open-tender/utils';
|
|
5
|
+
import { currentLocalDate, isoToDate, makeSimpleCart, rehydrateCart } from '@open-tender/utils';
|
|
6
6
|
import { resetOrder, selectTimezone, setCart, setMenuVars } from './order';
|
|
7
7
|
import { checkAuth, makeCartData, selectToken } from './customer';
|
|
8
8
|
const initialState = {
|
|
@@ -229,7 +229,7 @@ export const selectGroupOrderClosed = createSelector((state) => {
|
|
|
229
229
|
return { cartGuest, cutoffAt, closed, tz };
|
|
230
230
|
}, ({ cartGuest, cutoffAt, closed, tz }) => {
|
|
231
231
|
const cutoffDate = cutoffAt ? isoToDate(cutoffAt, tz) : null;
|
|
232
|
-
const pastCutoff = cutoffDate ?
|
|
232
|
+
const pastCutoff = cutoffDate ? currentLocalDate(tz) > cutoffDate : false;
|
|
233
233
|
return cartGuest && (closed || pastCutoff);
|
|
234
234
|
});
|
|
235
235
|
export const selectGroupOrderTests = createSelector((state) => {
|
package/dist/esm/slices/guest.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
3
|
import { ReducerType } from './types';
|
|
4
|
+
import { addMessage } from './order';
|
|
4
5
|
const initialState = {
|
|
5
6
|
brands: null,
|
|
6
7
|
email: null,
|
|
@@ -28,7 +29,7 @@ export const fetchGuest = createAsyncThunk(GuestActionType.FetchGuest, ({ email,
|
|
|
28
29
|
return rejectWithValue(error);
|
|
29
30
|
}
|
|
30
31
|
}));
|
|
31
|
-
export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
33
|
const { api } = getState().config;
|
|
33
34
|
if (!api)
|
|
34
35
|
return;
|
|
@@ -36,6 +37,7 @@ export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx,
|
|
|
36
37
|
yield api.postThanxLogin(email, origin);
|
|
37
38
|
if (callback)
|
|
38
39
|
callback();
|
|
40
|
+
dispatch(addMessage('Thanks! Please check your email on this device.'));
|
|
39
41
|
return { email: email };
|
|
40
42
|
}
|
|
41
43
|
catch (err) {
|
package/dist/esm/slices/index.js
CHANGED
|
@@ -194,6 +194,7 @@ export declare const selectOrderLimits: ((state: import("redux").EmptyObject & {
|
|
|
194
194
|
signUp: import("./signUp").SignUpState;
|
|
195
195
|
tags: import("./tags").TagsState;
|
|
196
196
|
terms: import("./terms").TermsSlice;
|
|
197
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
197
198
|
validTimes: import("./validTimes").ValidTimesState;
|
|
198
199
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
199
200
|
}) => {
|
|
@@ -272,6 +273,7 @@ export declare const selectCartIds: ((state: import("redux").EmptyObject & {
|
|
|
272
273
|
signUp: import("./signUp").SignUpState;
|
|
273
274
|
tags: import("./tags").TagsState;
|
|
274
275
|
terms: import("./terms").TermsSlice;
|
|
276
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
275
277
|
validTimes: import("./validTimes").ValidTimesState;
|
|
276
278
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
277
279
|
}) => number[]) & import("reselect").OutputSelectorFields<(args_0: Cart | null) => number[], {
|
|
@@ -345,6 +347,7 @@ export declare const selectMenuVars: ((state: import("redux").EmptyObject & {
|
|
|
345
347
|
signUp: import("./signUp").SignUpState;
|
|
346
348
|
tags: import("./tags").TagsState;
|
|
347
349
|
terms: import("./terms").TermsSlice;
|
|
350
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
348
351
|
validTimes: import("./validTimes").ValidTimesState;
|
|
349
352
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
350
353
|
}) => {
|
|
@@ -79,6 +79,7 @@ export declare const selectQuote: ((state: import("redux").EmptyObject & {
|
|
|
79
79
|
signUp: import("./signUp").SignUpState;
|
|
80
80
|
tags: import("./tags").TagsState;
|
|
81
81
|
terms: import("./terms").TermsSlice;
|
|
82
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
82
83
|
validTimes: import("./validTimes").ValidTimesState;
|
|
83
84
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
84
85
|
}) => {
|
|
@@ -87,6 +87,7 @@ export declare const selectSelectedTagNames: ((state: import("redux").EmptyObjec
|
|
|
87
87
|
signUp: import("./signUp").SignUpState;
|
|
88
88
|
tags: TagsState;
|
|
89
89
|
terms: import("./terms").TermsSlice;
|
|
90
|
+
Unsubscribe: import("./unsubscribe").UnsubscribeState;
|
|
90
91
|
validTimes: import("./validTimes").ValidTimesState;
|
|
91
92
|
verifyAccount: import("./verifyAccount").VerifyAccountState;
|
|
92
93
|
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: {
|
package/dist/esm/slices/types.js
CHANGED
|
@@ -57,6 +57,7 @@ export var ReducerType;
|
|
|
57
57
|
ReducerType["Thanx"] = "thanx";
|
|
58
58
|
ReducerType["Tpls"] = "tpls";
|
|
59
59
|
ReducerType["TplsPointsShop"] = "tplsPointsShop";
|
|
60
|
+
ReducerType["Unsubscribe"] = "Unsubscribe";
|
|
60
61
|
ReducerType["ValidTimes"] = "validTimes";
|
|
61
62
|
ReducerType["VerifyAccount"] = "verifyAccount";
|
|
62
63
|
})(ReducerType || (ReducerType = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppState } from '../app';
|
|
2
|
+
import { RequestError, RequestStatus } from '@open-tender/types';
|
|
3
|
+
export interface UnsubscribeState {
|
|
4
|
+
loading: RequestStatus;
|
|
5
|
+
error: RequestError;
|
|
6
|
+
success: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare enum UnsubscribeActionType {
|
|
9
|
+
Unsubscribe = "unsubscribe/unsubscribe"
|
|
10
|
+
}
|
|
11
|
+
export declare const unsubscribe: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
12
|
+
customer_id: string;
|
|
13
|
+
campaign_id: string;
|
|
14
|
+
}, {
|
|
15
|
+
state: AppState;
|
|
16
|
+
rejectValue: RequestError;
|
|
17
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
18
|
+
extra?: unknown;
|
|
19
|
+
serializedErrorType?: unknown;
|
|
20
|
+
pendingMeta?: unknown;
|
|
21
|
+
fulfilledMeta?: unknown;
|
|
22
|
+
rejectedMeta?: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const resetUnsubscribe: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Unsubscribe/resetUnsubscribe">;
|
|
25
|
+
export declare const selectUnsubscribe: (state: AppState) => UnsubscribeState;
|
|
26
|
+
export declare const unsubscribeReducer: import("redux").Reducer<UnsubscribeState, import("redux").AnyAction>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
import { ReducerType } from './types';
|
|
4
|
+
const initialState = {
|
|
5
|
+
loading: 'idle',
|
|
6
|
+
error: null,
|
|
7
|
+
success: false
|
|
8
|
+
};
|
|
9
|
+
export var UnsubscribeActionType;
|
|
10
|
+
(function (UnsubscribeActionType) {
|
|
11
|
+
UnsubscribeActionType["Unsubscribe"] = "unsubscribe/unsubscribe";
|
|
12
|
+
})(UnsubscribeActionType || (UnsubscribeActionType = {}));
|
|
13
|
+
export const unsubscribe = createAsyncThunk(UnsubscribeActionType.Unsubscribe, ({ customer_id, campaign_id }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const { api } = getState().config;
|
|
15
|
+
if (!api)
|
|
16
|
+
return;
|
|
17
|
+
try {
|
|
18
|
+
yield api.postUnsubscribe(customer_id, campaign_id);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
return rejectWithValue(err);
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
const unsubscribeSlice = createSlice({
|
|
26
|
+
name: ReducerType.Unsubscribe,
|
|
27
|
+
initialState,
|
|
28
|
+
reducers: {
|
|
29
|
+
resetUnsubscribe: () => initialState
|
|
30
|
+
},
|
|
31
|
+
extraReducers: builder => {
|
|
32
|
+
builder
|
|
33
|
+
.addCase(unsubscribe.fulfilled, state => {
|
|
34
|
+
state.success = true;
|
|
35
|
+
state.loading = 'idle';
|
|
36
|
+
state.error = null;
|
|
37
|
+
})
|
|
38
|
+
.addCase(unsubscribe.pending, state => {
|
|
39
|
+
state.loading = 'pending';
|
|
40
|
+
})
|
|
41
|
+
.addCase(unsubscribe.rejected, (state, action) => {
|
|
42
|
+
state.loading = 'idle';
|
|
43
|
+
state.error = action.payload;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export const { resetUnsubscribe } = unsubscribeSlice.actions;
|
|
48
|
+
export const selectUnsubscribe = (state) => state.Unsubscribe;
|
|
49
|
+
export const unsubscribeReducer = unsubscribeSlice.reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.34",
|
|
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",
|
|
@@ -54,5 +54,6 @@
|
|
|
54
54
|
"@open-tender/utils": "^0.4.45",
|
|
55
55
|
"@reduxjs/toolkit": "^1.8.5",
|
|
56
56
|
"react": "^18.2.0"
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
58
59
|
}
|