@open-tender/cloud 0.5.7 → 0.5.9

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.
Files changed (283) hide show
  1. package/LICENSE.md +21 -21
  2. package/README.md +3 -3
  3. package/dist/cjs/app/hooks.d.ts +67 -67
  4. package/dist/cjs/app/hooks.js +8 -8
  5. package/dist/cjs/app/index.d.ts +2 -2
  6. package/dist/cjs/app/index.js +5 -5
  7. package/dist/cjs/app/store.d.ts +197 -197
  8. package/dist/cjs/app/store.js +65 -65
  9. package/dist/cjs/index.d.ts +5 -5
  10. package/dist/cjs/index.js +11 -11
  11. package/dist/cjs/services/api.d.ts +173 -173
  12. package/dist/cjs/services/api.js +741 -741
  13. package/dist/cjs/services/errors.d.ts +50 -50
  14. package/dist/cjs/services/errors.js +53 -53
  15. package/dist/cjs/services/index.d.ts +3 -3
  16. package/dist/cjs/services/index.js +7 -7
  17. package/dist/cjs/slices/alerts.d.ts +5 -5
  18. package/dist/cjs/slices/alerts.js +29 -29
  19. package/dist/cjs/slices/allergens.d.ts +101 -101
  20. package/dist/cjs/slices/allergens.js +83 -83
  21. package/dist/cjs/slices/announcements.d.ts +180 -180
  22. package/dist/cjs/slices/announcements.js +81 -81
  23. package/dist/cjs/slices/checkout.d.ts +69 -69
  24. package/dist/cjs/slices/checkout.js +326 -326
  25. package/dist/cjs/slices/completedOrders.d.ts +31 -31
  26. package/dist/cjs/slices/completedOrders.js +61 -61
  27. package/dist/cjs/slices/config.d.ts +317 -317
  28. package/dist/cjs/slices/config.js +195 -195
  29. package/dist/cjs/slices/confirmation.d.ts +8 -8
  30. package/dist/cjs/slices/confirmation.js +23 -23
  31. package/dist/cjs/slices/customer/account.d.ts +128 -128
  32. package/dist/cjs/slices/customer/account.js +351 -351
  33. package/dist/cjs/slices/customer/addresses.d.ts +55 -55
  34. package/dist/cjs/slices/customer/addresses.js +132 -132
  35. package/dist/cjs/slices/customer/allergens.d.ts +37 -37
  36. package/dist/cjs/slices/customer/allergens.js +94 -94
  37. package/dist/cjs/slices/customer/communicationPreferences.d.ts +69 -69
  38. package/dist/cjs/slices/customer/communicationPreferences.js +164 -164
  39. package/dist/cjs/slices/customer/creditCards.d.ts +137 -137
  40. package/dist/cjs/slices/customer/creditCards.js +170 -170
  41. package/dist/cjs/slices/customer/favorites.d.ts +68 -68
  42. package/dist/cjs/slices/customer/favorites.js +173 -173
  43. package/dist/cjs/slices/customer/fcmToken.d.ts +49 -49
  44. package/dist/cjs/slices/customer/fcmToken.js +110 -110
  45. package/dist/cjs/slices/customer/giftCards.d.ts +98 -98
  46. package/dist/cjs/slices/customer/giftCards.js +222 -222
  47. package/dist/cjs/slices/customer/groupOrders.d.ts +118 -118
  48. package/dist/cjs/slices/customer/groupOrders.js +262 -262
  49. package/dist/cjs/slices/customer/history.d.ts +23 -23
  50. package/dist/cjs/slices/customer/history.js +57 -57
  51. package/dist/cjs/slices/customer/houseAccounts.d.ts +26 -26
  52. package/dist/cjs/slices/customer/houseAccounts.js +67 -67
  53. package/dist/cjs/slices/customer/index.d.ts +42 -42
  54. package/dist/cjs/slices/customer/index.js +68 -68
  55. package/dist/cjs/slices/customer/loyalty.d.ts +251 -251
  56. package/dist/cjs/slices/customer/loyalty.js +110 -110
  57. package/dist/cjs/slices/customer/order.d.ts +116 -116
  58. package/dist/cjs/slices/customer/order.js +98 -98
  59. package/dist/cjs/slices/customer/orders.d.ts +27 -27
  60. package/dist/cjs/slices/customer/orders.js +69 -69
  61. package/dist/cjs/slices/customer/pointsShop.d.ts +35 -35
  62. package/dist/cjs/slices/customer/pointsShop.js +86 -86
  63. package/dist/cjs/slices/customer/qrCode.d.ts +23 -23
  64. package/dist/cjs/slices/customer/qrCode.js +57 -57
  65. package/dist/cjs/slices/customer/rewards.d.ts +26 -26
  66. package/dist/cjs/slices/customer/rewards.js +67 -67
  67. package/dist/cjs/slices/customer/thanx.d.ts +23 -23
  68. package/dist/cjs/slices/customer/thanx.js +56 -56
  69. package/dist/cjs/slices/customer/tpls.d.ts +238 -238
  70. package/dist/cjs/slices/customer/tpls.js +102 -102
  71. package/dist/cjs/slices/customer/tplsPointsShop.d.ts +38 -38
  72. package/dist/cjs/slices/customer/tplsPointsShop.js +88 -88
  73. package/dist/cjs/slices/deals.d.ts +25 -25
  74. package/dist/cjs/slices/deals.js +96 -96
  75. package/dist/cjs/slices/donations.d.ts +27 -27
  76. package/dist/cjs/slices/donations.js +57 -57
  77. package/dist/cjs/slices/geolocation.d.ts +11 -11
  78. package/dist/cjs/slices/geolocation.js +36 -36
  79. package/dist/cjs/slices/giftCards.d.ts +27 -27
  80. package/dist/cjs/slices/giftCards.js +58 -58
  81. package/dist/cjs/slices/groupOrder.d.ts +418 -418
  82. package/dist/cjs/slices/groupOrder.js +266 -266
  83. package/dist/cjs/slices/guest.d.ts +51 -51
  84. package/dist/cjs/slices/guest.js +91 -91
  85. package/dist/cjs/slices/index.d.ts +41 -41
  86. package/dist/cjs/slices/index.js +44 -44
  87. package/dist/cjs/slices/loader.d.ts +9 -9
  88. package/dist/cjs/slices/loader.js +25 -25
  89. package/dist/cjs/slices/menu.d.ts +31 -31
  90. package/dist/cjs/slices/menu.js +97 -97
  91. package/dist/cjs/slices/menuDisplay.d.ts +32 -32
  92. package/dist/cjs/slices/menuDisplay.js +59 -59
  93. package/dist/cjs/slices/menuItems.d.ts +26 -26
  94. package/dist/cjs/slices/menuItems.js +57 -57
  95. package/dist/cjs/slices/misc.d.ts +17 -17
  96. package/dist/cjs/slices/misc.js +51 -51
  97. package/dist/cjs/slices/modal.d.ts +5 -5
  98. package/dist/cjs/slices/modal.js +30 -30
  99. package/dist/cjs/slices/nav.d.ts +7 -7
  100. package/dist/cjs/slices/nav.js +23 -23
  101. package/dist/cjs/slices/navSite.d.ts +7 -7
  102. package/dist/cjs/slices/navSite.js +23 -23
  103. package/dist/cjs/slices/notifications.d.ts +5 -5
  104. package/dist/cjs/slices/notifications.js +27 -27
  105. package/dist/cjs/slices/oneTimePasscode.d.ts +40 -40
  106. package/dist/cjs/slices/oneTimePasscode.js +91 -91
  107. package/dist/cjs/slices/order.d.ts +372 -372
  108. package/dist/cjs/slices/order.js +528 -528
  109. package/dist/cjs/slices/orderFulfillment.d.ts +37 -37
  110. package/dist/cjs/slices/orderFulfillment.js +77 -77
  111. package/dist/cjs/slices/orderRating.d.ts +52 -52
  112. package/dist/cjs/slices/orderRating.js +105 -105
  113. package/dist/cjs/slices/posts.d.ts +24 -24
  114. package/dist/cjs/slices/posts.js +55 -55
  115. package/dist/cjs/slices/pushNotifications.d.ts +9 -9
  116. package/dist/cjs/slices/pushNotifications.js +29 -29
  117. package/dist/cjs/slices/qr.d.ts +11 -11
  118. package/dist/cjs/slices/qr.js +34 -34
  119. package/dist/cjs/slices/quote.d.ts +102 -102
  120. package/dist/cjs/slices/quote.js +65 -65
  121. package/dist/cjs/slices/resetPassword.d.ts +41 -41
  122. package/dist/cjs/slices/resetPassword.js +80 -80
  123. package/dist/cjs/slices/revenueCenters.d.ts +35 -35
  124. package/dist/cjs/slices/revenueCenters.js +95 -95
  125. package/dist/cjs/slices/sidebar.d.ts +7 -7
  126. package/dist/cjs/slices/sidebar.js +23 -23
  127. package/dist/cjs/slices/sidebarModal.d.ts +7 -7
  128. package/dist/cjs/slices/sidebarModal.js +23 -23
  129. package/dist/cjs/slices/signUp.d.ts +25 -25
  130. package/dist/cjs/slices/signUp.js +60 -60
  131. package/dist/cjs/slices/tags.d.ts +101 -101
  132. package/dist/cjs/slices/tags.js +90 -90
  133. package/dist/cjs/slices/terms.d.ts +20 -20
  134. package/dist/cjs/slices/terms.js +51 -51
  135. package/dist/cjs/slices/types.d.ts +62 -62
  136. package/dist/cjs/slices/types.js +66 -66
  137. package/dist/cjs/slices/unsubscribe.d.ts +39 -39
  138. package/dist/cjs/slices/unsubscribe.js +78 -78
  139. package/dist/cjs/slices/validTimes.d.ts +23 -23
  140. package/dist/cjs/slices/validTimes.js +57 -57
  141. package/dist/cjs/slices/verifyAccount.d.ts +23 -23
  142. package/dist/cjs/slices/verifyAccount.js +54 -54
  143. package/dist/esm/app/hooks.d.ts +67 -67
  144. package/dist/esm/app/hooks.js +4 -4
  145. package/dist/esm/app/index.d.ts +2 -2
  146. package/dist/esm/app/index.js +2 -2
  147. package/dist/esm/app/store.d.ts +197 -197
  148. package/dist/esm/app/store.js +62 -62
  149. package/dist/esm/index.d.ts +5 -5
  150. package/dist/esm/index.js +5 -5
  151. package/dist/esm/services/api.d.ts +173 -173
  152. package/dist/esm/services/api.js +739 -739
  153. package/dist/esm/services/errors.d.ts +50 -50
  154. package/dist/esm/services/errors.js +50 -50
  155. package/dist/esm/services/index.d.ts +3 -3
  156. package/dist/esm/services/index.js +3 -3
  157. package/dist/esm/slices/alerts.d.ts +5 -5
  158. package/dist/esm/slices/alerts.js +24 -24
  159. package/dist/esm/slices/allergens.d.ts +101 -101
  160. package/dist/esm/slices/allergens.js +77 -77
  161. package/dist/esm/slices/announcements.d.ts +180 -180
  162. package/dist/esm/slices/announcements.js +75 -75
  163. package/dist/esm/slices/checkout.d.ts +69 -69
  164. package/dist/esm/slices/checkout.js +318 -318
  165. package/dist/esm/slices/completedOrders.d.ts +31 -31
  166. package/dist/esm/slices/completedOrders.js +57 -57
  167. package/dist/esm/slices/config.d.ts +317 -317
  168. package/dist/esm/slices/config.js +168 -168
  169. package/dist/esm/slices/confirmation.d.ts +8 -8
  170. package/dist/esm/slices/confirmation.js +18 -18
  171. package/dist/esm/slices/customer/account.d.ts +128 -128
  172. package/dist/esm/slices/customer/account.js +344 -344
  173. package/dist/esm/slices/customer/addresses.d.ts +55 -55
  174. package/dist/esm/slices/customer/addresses.js +127 -127
  175. package/dist/esm/slices/customer/allergens.d.ts +37 -37
  176. package/dist/esm/slices/customer/allergens.js +89 -89
  177. package/dist/esm/slices/customer/communicationPreferences.d.ts +69 -69
  178. package/dist/esm/slices/customer/communicationPreferences.js +159 -159
  179. package/dist/esm/slices/customer/creditCards.d.ts +137 -137
  180. package/dist/esm/slices/customer/creditCards.js +165 -165
  181. package/dist/esm/slices/customer/favorites.d.ts +68 -68
  182. package/dist/esm/slices/customer/favorites.js +168 -168
  183. package/dist/esm/slices/customer/fcmToken.d.ts +49 -49
  184. package/dist/esm/slices/customer/fcmToken.js +106 -106
  185. package/dist/esm/slices/customer/giftCards.d.ts +98 -98
  186. package/dist/esm/slices/customer/giftCards.js +217 -217
  187. package/dist/esm/slices/customer/groupOrders.d.ts +118 -118
  188. package/dist/esm/slices/customer/groupOrders.js +256 -256
  189. package/dist/esm/slices/customer/history.d.ts +23 -23
  190. package/dist/esm/slices/customer/history.js +53 -53
  191. package/dist/esm/slices/customer/houseAccounts.d.ts +26 -26
  192. package/dist/esm/slices/customer/houseAccounts.js +62 -62
  193. package/dist/esm/slices/customer/index.d.ts +42 -42
  194. package/dist/esm/slices/customer/index.js +64 -64
  195. package/dist/esm/slices/customer/loyalty.d.ts +251 -251
  196. package/dist/esm/slices/customer/loyalty.js +102 -102
  197. package/dist/esm/slices/customer/order.d.ts +116 -116
  198. package/dist/esm/slices/customer/order.js +94 -94
  199. package/dist/esm/slices/customer/orders.d.ts +27 -27
  200. package/dist/esm/slices/customer/orders.js +63 -63
  201. package/dist/esm/slices/customer/pointsShop.d.ts +35 -35
  202. package/dist/esm/slices/customer/pointsShop.js +82 -82
  203. package/dist/esm/slices/customer/qrCode.d.ts +23 -23
  204. package/dist/esm/slices/customer/qrCode.js +53 -53
  205. package/dist/esm/slices/customer/rewards.d.ts +26 -26
  206. package/dist/esm/slices/customer/rewards.js +62 -62
  207. package/dist/esm/slices/customer/thanx.d.ts +23 -23
  208. package/dist/esm/slices/customer/thanx.js +52 -52
  209. package/dist/esm/slices/customer/tpls.d.ts +238 -238
  210. package/dist/esm/slices/customer/tpls.js +98 -98
  211. package/dist/esm/slices/customer/tplsPointsShop.d.ts +38 -38
  212. package/dist/esm/slices/customer/tplsPointsShop.js +84 -84
  213. package/dist/esm/slices/deals.d.ts +25 -25
  214. package/dist/esm/slices/deals.js +90 -90
  215. package/dist/esm/slices/donations.d.ts +27 -27
  216. package/dist/esm/slices/donations.js +53 -53
  217. package/dist/esm/slices/geolocation.d.ts +11 -11
  218. package/dist/esm/slices/geolocation.js +30 -30
  219. package/dist/esm/slices/giftCards.d.ts +27 -27
  220. package/dist/esm/slices/giftCards.js +54 -54
  221. package/dist/esm/slices/groupOrder.d.ts +418 -418
  222. package/dist/esm/slices/groupOrder.js +259 -259
  223. package/dist/esm/slices/guest.d.ts +51 -51
  224. package/dist/esm/slices/guest.js +86 -86
  225. package/dist/esm/slices/index.d.ts +41 -41
  226. package/dist/esm/slices/index.js +41 -41
  227. package/dist/esm/slices/loader.d.ts +9 -9
  228. package/dist/esm/slices/loader.js +21 -21
  229. package/dist/esm/slices/menu.d.ts +31 -31
  230. package/dist/esm/slices/menu.js +90 -90
  231. package/dist/esm/slices/menuDisplay.d.ts +32 -32
  232. package/dist/esm/slices/menuDisplay.js +55 -55
  233. package/dist/esm/slices/menuItems.d.ts +26 -26
  234. package/dist/esm/slices/menuItems.js +52 -52
  235. package/dist/esm/slices/misc.d.ts +17 -17
  236. package/dist/esm/slices/misc.js +41 -41
  237. package/dist/esm/slices/modal.d.ts +5 -5
  238. package/dist/esm/slices/modal.js +25 -25
  239. package/dist/esm/slices/nav.d.ts +7 -7
  240. package/dist/esm/slices/nav.js +19 -19
  241. package/dist/esm/slices/navSite.d.ts +7 -7
  242. package/dist/esm/slices/navSite.js +19 -19
  243. package/dist/esm/slices/notifications.d.ts +5 -5
  244. package/dist/esm/slices/notifications.js +22 -22
  245. package/dist/esm/slices/oneTimePasscode.d.ts +40 -40
  246. package/dist/esm/slices/oneTimePasscode.js +86 -86
  247. package/dist/esm/slices/order.d.ts +372 -372
  248. package/dist/esm/slices/order.js +508 -508
  249. package/dist/esm/slices/orderFulfillment.d.ts +37 -37
  250. package/dist/esm/slices/orderFulfillment.js +73 -73
  251. package/dist/esm/slices/orderRating.d.ts +52 -52
  252. package/dist/esm/slices/orderRating.js +101 -101
  253. package/dist/esm/slices/posts.d.ts +24 -24
  254. package/dist/esm/slices/posts.js +51 -51
  255. package/dist/esm/slices/pushNotifications.d.ts +9 -9
  256. package/dist/esm/slices/pushNotifications.js +23 -23
  257. package/dist/esm/slices/qr.d.ts +11 -11
  258. package/dist/esm/slices/qr.js +29 -29
  259. package/dist/esm/slices/quote.d.ts +102 -102
  260. package/dist/esm/slices/quote.js +61 -61
  261. package/dist/esm/slices/resetPassword.d.ts +41 -41
  262. package/dist/esm/slices/resetPassword.js +76 -76
  263. package/dist/esm/slices/revenueCenters.d.ts +35 -35
  264. package/dist/esm/slices/revenueCenters.js +89 -89
  265. package/dist/esm/slices/sidebar.d.ts +7 -7
  266. package/dist/esm/slices/sidebar.js +19 -19
  267. package/dist/esm/slices/sidebarModal.d.ts +7 -7
  268. package/dist/esm/slices/sidebarModal.js +19 -19
  269. package/dist/esm/slices/signUp.d.ts +25 -25
  270. package/dist/esm/slices/signUp.js +56 -56
  271. package/dist/esm/slices/tags.d.ts +101 -101
  272. package/dist/esm/slices/tags.js +84 -84
  273. package/dist/esm/slices/terms.d.ts +20 -20
  274. package/dist/esm/slices/terms.js +47 -47
  275. package/dist/esm/slices/types.d.ts +62 -62
  276. package/dist/esm/slices/types.js +63 -63
  277. package/dist/esm/slices/unsubscribe.d.ts +39 -39
  278. package/dist/esm/slices/unsubscribe.js +74 -74
  279. package/dist/esm/slices/validTimes.d.ts +23 -23
  280. package/dist/esm/slices/validTimes.js +52 -52
  281. package/dist/esm/slices/verifyAccount.d.ts +23 -23
  282. package/dist/esm/slices/verifyAccount.js +50 -50
  283. package/package.json +61 -61
@@ -1,168 +1,168 @@
1
- import { __awaiter } from "tslib";
2
- import { createSlice, createAsyncThunk, createSelector } from '@reduxjs/toolkit';
3
- import { capitalize, decorateTheme } from '@open-tender/utils';
4
- import { ReducerType } from './types';
5
- import OpenTenderAPI from '../services/api';
6
- const initialState = {
7
- api: null,
8
- app: null,
9
- appTheme: null,
10
- brand: null,
11
- content: null,
12
- error: null,
13
- isApp: false,
14
- isBackgroundFetch: false,
15
- loading: 'idle',
16
- pages: null,
17
- retries: 0,
18
- settings: null,
19
- stylesheet: null,
20
- theme: null
21
- };
22
- export var ConfigActionType;
23
- (function (ConfigActionType) {
24
- ConfigActionType["FetchConfig"] = "config/getConfig";
25
- })(ConfigActionType || (ConfigActionType = {}));
26
- export const fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, (options, { rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
27
- try {
28
- const api = new OpenTenderAPI(options);
29
- const response = yield api.getConfig();
30
- const { baseUrl, authUrl, clientId, brandId, callback, isApp } = options;
31
- const app = { baseUrl, authUrl, clientId, brandId };
32
- if (!app.clientId)
33
- app.clientId = response.clientId;
34
- if (!app.brandId)
35
- app.brandId = response.brand.brandId;
36
- if (callback)
37
- callback();
38
- return Object.assign(Object.assign({}, response), { isApp, app });
39
- }
40
- catch (err) {
41
- return rejectWithValue(err);
42
- }
43
- }));
44
- const configSlice = createSlice({
45
- name: ReducerType.Config,
46
- initialState: initialState,
47
- reducers: {
48
- resetConfig: () => initialState,
49
- resetRetries: state => {
50
- state.retries = 0;
51
- },
52
- incrementRetries: state => {
53
- state.retries = state.retries + 1;
54
- }
55
- },
56
- extraReducers: builder => {
57
- builder
58
- .addCase(fetchConfig.fulfilled, (state, action) => {
59
- const { app, isApp, brand, content, theme, settings, stylesheet, pages } = action.payload;
60
- state.app = app;
61
- state.brand = brand;
62
- state.content = content;
63
- state.theme = !isApp && theme ? theme : null;
64
- state.appTheme = isApp && theme ? decorateTheme(theme) : null;
65
- state.settings = settings;
66
- state.stylesheet = stylesheet;
67
- state.pages = pages;
68
- state.loading = 'idle';
69
- state.api = new OpenTenderAPI(app);
70
- state.error = null;
71
- state.retries = 0;
72
- })
73
- .addCase(fetchConfig.pending, (state, action) => {
74
- var _a;
75
- state.loading = 'pending';
76
- state.isBackgroundFetch = ((_a = action === null || action === void 0 ? void 0 : action.meta) === null || _a === void 0 ? void 0 : _a.arg) !== undefined ? true : false;
77
- })
78
- .addCase(fetchConfig.rejected, (state, action) => {
79
- state.error = action.payload;
80
- state.loading = 'idle';
81
- });
82
- }
83
- });
84
- export const { resetConfig, resetRetries, incrementRetries } = configSlice.actions;
85
- export const selectConfig = (state) => state.config;
86
- export const selectBrand = (state) => state.config.brand;
87
- export const selectTheme = (state) => state.config.theme;
88
- export const selectContent = (state) => state.config.content;
89
- export const selectSettings = (state) => state.config.settings;
90
- export const selectStylesheet = (state) => state.config.stylesheet;
91
- export const selectPages = (state) => state.config.pages;
92
- export const selectApi = (state) => state.config.api;
93
- export const selectAccountConfig = (state) => { var _a; return (_a = state.config.content) === null || _a === void 0 ? void 0 : _a.account; };
94
- export const selectCateringOnly = (state) => {
95
- const { orderTypes } = state.config.settings || {};
96
- return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
97
- };
98
- export const selectDisplaySettings = (state) => {
99
- var _a;
100
- const orderType = state.order.orderType || 'OLO';
101
- return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.displaySettings[orderType];
102
- };
103
- export const selectConfigRetries = (state) => state.config.retries;
104
- export const selectLightColor = (state) => state.config.theme ? state.config.theme.colors.light : '#ffffff';
105
- export const selectOptIns = createSelector((state) => {
106
- const { accepts_marketing, order_notifications } = state.config.brand || {};
107
- return { accepts_marketing, order_notifications };
108
- }, ({ accepts_marketing, order_notifications }) => {
109
- return { accepts_marketing, order_notifications };
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
- });
121
- export const selectFulfillment = (state) => { var _a; return (_a = state.config.brand) === null || _a === void 0 ? void 0 : _a.fulfillment; };
122
- export const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
123
- export const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
124
- export const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
125
- export const selectBottomTabsDisplayed = (state) => { var _a; return ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.bottomTabs.displayed) || []; };
126
- export const selectBottomTabsTitles = createSelector((state) => {
127
- const { bottomTabs } = state.config.content || {};
128
- return bottomTabs;
129
- }, bottomTabs => {
130
- if (!bottomTabs)
131
- return {};
132
- return Object.entries(bottomTabs).reduce((obj, [key, value]) => {
133
- if (key === 'displayed')
134
- return obj;
135
- return Object.assign(Object.assign({}, obj), { [key]: value.title });
136
- }, {});
137
- });
138
- export const selectSoldOutMsg = (state) => {
139
- var _a;
140
- const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
141
- return soldOutMessage || 'Sold out for day';
142
- };
143
- export const selectHeaderHeight = (state) => (isBrowser) => {
144
- if (!state.config.theme)
145
- return 0;
146
- const { navHeight, navHeightMobile } = state.config.theme.layout;
147
- const height = isBrowser ? navHeight : navHeightMobile;
148
- return parseInt(height.replace('rem', '')) * 10;
149
- };
150
- export const selectOutpostName = (state) => {
151
- var _a, _b, _c;
152
- return ((_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.locationName.OUTPOST)
153
- ? capitalize((_c = (_b = state.config.settings) === null || _b === void 0 ? void 0 : _b.locationName.OUTPOST[0]) !== null && _c !== void 0 ? _c : '')
154
- : undefined;
155
- };
156
- export const selectHasCatering = (state) => {
157
- var _a;
158
- const { orderTypes } = state.config.settings || {};
159
- return (_a = orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) !== null && _a !== void 0 ? _a : false;
160
- };
161
- export const selectCategoryType = (isMobile) => (state) => {
162
- const { categories } = state.config.theme || {};
163
- if (!categories)
164
- return 'LIST';
165
- const { desktop, mobile } = categories;
166
- return isMobile ? mobile.displayType : desktop.displayType;
167
- };
168
- export const configReducer = configSlice.reducer;
1
+ import { __awaiter } from "tslib";
2
+ import { createSlice, createAsyncThunk, createSelector } from '@reduxjs/toolkit';
3
+ import { capitalize, decorateTheme } from '@open-tender/utils';
4
+ import { ReducerType } from './types';
5
+ import OpenTenderAPI from '../services/api';
6
+ const initialState = {
7
+ api: null,
8
+ app: null,
9
+ appTheme: null,
10
+ brand: null,
11
+ content: null,
12
+ error: null,
13
+ isApp: false,
14
+ isBackgroundFetch: false,
15
+ loading: 'idle',
16
+ pages: null,
17
+ retries: 0,
18
+ settings: null,
19
+ stylesheet: null,
20
+ theme: null
21
+ };
22
+ export var ConfigActionType;
23
+ (function (ConfigActionType) {
24
+ ConfigActionType["FetchConfig"] = "config/getConfig";
25
+ })(ConfigActionType || (ConfigActionType = {}));
26
+ export const fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, (options, { rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
27
+ try {
28
+ const api = new OpenTenderAPI(options);
29
+ const response = yield api.getConfig();
30
+ const { baseUrl, authUrl, clientId, brandId, callback, isApp } = options;
31
+ const app = { baseUrl, authUrl, clientId, brandId };
32
+ if (!app.clientId)
33
+ app.clientId = response.clientId;
34
+ if (!app.brandId)
35
+ app.brandId = response.brand.brandId;
36
+ if (callback)
37
+ callback();
38
+ return Object.assign(Object.assign({}, response), { isApp, app });
39
+ }
40
+ catch (err) {
41
+ return rejectWithValue(err);
42
+ }
43
+ }));
44
+ const configSlice = createSlice({
45
+ name: ReducerType.Config,
46
+ initialState: initialState,
47
+ reducers: {
48
+ resetConfig: () => initialState,
49
+ resetRetries: state => {
50
+ state.retries = 0;
51
+ },
52
+ incrementRetries: state => {
53
+ state.retries = state.retries + 1;
54
+ }
55
+ },
56
+ extraReducers: builder => {
57
+ builder
58
+ .addCase(fetchConfig.fulfilled, (state, action) => {
59
+ const { app, isApp, brand, content, theme, settings, stylesheet, pages } = action.payload;
60
+ state.app = app;
61
+ state.brand = brand;
62
+ state.content = content;
63
+ state.theme = !isApp && theme ? theme : null;
64
+ state.appTheme = isApp && theme ? decorateTheme(theme) : null;
65
+ state.settings = settings;
66
+ state.stylesheet = stylesheet;
67
+ state.pages = pages;
68
+ state.loading = 'idle';
69
+ state.api = new OpenTenderAPI(app);
70
+ state.error = null;
71
+ state.retries = 0;
72
+ })
73
+ .addCase(fetchConfig.pending, (state, action) => {
74
+ var _a;
75
+ state.loading = 'pending';
76
+ state.isBackgroundFetch = ((_a = action === null || action === void 0 ? void 0 : action.meta) === null || _a === void 0 ? void 0 : _a.arg) !== undefined ? true : false;
77
+ })
78
+ .addCase(fetchConfig.rejected, (state, action) => {
79
+ state.error = action.payload;
80
+ state.loading = 'idle';
81
+ });
82
+ }
83
+ });
84
+ export const { resetConfig, resetRetries, incrementRetries } = configSlice.actions;
85
+ export const selectConfig = (state) => state.config;
86
+ export const selectBrand = (state) => state.config.brand;
87
+ export const selectTheme = (state) => state.config.theme;
88
+ export const selectContent = (state) => state.config.content;
89
+ export const selectSettings = (state) => state.config.settings;
90
+ export const selectStylesheet = (state) => state.config.stylesheet;
91
+ export const selectPages = (state) => state.config.pages;
92
+ export const selectApi = (state) => state.config.api;
93
+ export const selectAccountConfig = (state) => { var _a; return (_a = state.config.content) === null || _a === void 0 ? void 0 : _a.account; };
94
+ export const selectCateringOnly = (state) => {
95
+ const { orderTypes } = state.config.settings || {};
96
+ return !!((orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) && orderTypes.length === 1);
97
+ };
98
+ export const selectDisplaySettings = (state) => {
99
+ var _a;
100
+ const orderType = state.order.orderType || 'OLO';
101
+ return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.displaySettings[orderType];
102
+ };
103
+ export const selectConfigRetries = (state) => state.config.retries;
104
+ export const selectLightColor = (state) => state.config.theme ? state.config.theme.colors.light : '#ffffff';
105
+ export const selectOptIns = createSelector((state) => {
106
+ const { accepts_marketing, order_notifications } = state.config.brand || {};
107
+ return { accepts_marketing, order_notifications };
108
+ }, ({ accepts_marketing, order_notifications }) => {
109
+ return { accepts_marketing, order_notifications };
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
+ });
121
+ export const selectFulfillment = (state) => { var _a; return (_a = state.config.brand) === null || _a === void 0 ? void 0 : _a.fulfillment; };
122
+ export const selectRecaptcha = (state) => { var _a; return (_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.recaptcha; };
123
+ export const selectContentSection = (page) => (state) => state.config.content ? state.config.content[page] : undefined;
124
+ export const selectPage = (page) => (state) => state.config.pages ? state.config.pages[page] : undefined;
125
+ export const selectBottomTabsDisplayed = (state) => { var _a; return ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.bottomTabs.displayed) || []; };
126
+ export const selectBottomTabsTitles = createSelector((state) => {
127
+ const { bottomTabs } = state.config.content || {};
128
+ return bottomTabs;
129
+ }, bottomTabs => {
130
+ if (!bottomTabs)
131
+ return {};
132
+ return Object.entries(bottomTabs).reduce((obj, [key, value]) => {
133
+ if (key === 'displayed')
134
+ return obj;
135
+ return Object.assign(Object.assign({}, obj), { [key]: value.title });
136
+ }, {});
137
+ });
138
+ export const selectSoldOutMsg = (state) => {
139
+ var _a;
140
+ const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
141
+ return soldOutMessage || 'Sold out for day';
142
+ };
143
+ export const selectHeaderHeight = (state) => (isBrowser) => {
144
+ if (!state.config.theme)
145
+ return 0;
146
+ const { navHeight, navHeightMobile } = state.config.theme.layout;
147
+ const height = isBrowser ? navHeight : navHeightMobile;
148
+ return parseInt(height.replace('rem', '')) * 10;
149
+ };
150
+ export const selectOutpostName = (state) => {
151
+ var _a, _b, _c;
152
+ return ((_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.locationName.OUTPOST)
153
+ ? capitalize((_c = (_b = state.config.settings) === null || _b === void 0 ? void 0 : _b.locationName.OUTPOST[0]) !== null && _c !== void 0 ? _c : '')
154
+ : undefined;
155
+ };
156
+ export const selectHasCatering = (state) => {
157
+ var _a;
158
+ const { orderTypes } = state.config.settings || {};
159
+ return (_a = orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) !== null && _a !== void 0 ? _a : false;
160
+ };
161
+ export const selectCategoryType = (isMobile) => (state) => {
162
+ const { categories } = state.config.theme || {};
163
+ if (!categories)
164
+ return 'LIST';
165
+ const { desktop, mobile } = categories;
166
+ return isMobile ? mobile.displayType : desktop.displayType;
167
+ };
168
+ export const configReducer = configSlice.reducer;
@@ -1,8 +1,8 @@
1
- import { Order } from '@open-tender/types';
2
- import { AppState } from '../app';
3
- export interface ConfirmationState {
4
- order: Order | null;
5
- }
6
- export declare const resetConfirmation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"confirmation/resetConfirmation">, setConfirmationOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "confirmation/setConfirmationOrder">;
7
- export declare const selectConfirmationOrder: (state: AppState) => Order | null;
8
- export declare const confirmationReducer: import("redux").Reducer<ConfirmationState, import("redux").AnyAction>;
1
+ import { Order } from '@open-tender/types';
2
+ import { AppState } from '../app';
3
+ export interface ConfirmationState {
4
+ order: Order | null;
5
+ }
6
+ export declare const resetConfirmation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"confirmation/resetConfirmation">, setConfirmationOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "confirmation/setConfirmationOrder">;
7
+ export declare const selectConfirmationOrder: (state: AppState) => Order | null;
8
+ export declare const confirmationReducer: import("redux").Reducer<ConfirmationState, import("redux").AnyAction>;
@@ -1,18 +1,18 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- import { ReducerType } from './types';
3
- const initialState = {
4
- order: null
5
- };
6
- const confirmationSlice = createSlice({
7
- name: ReducerType.Confirmation,
8
- initialState,
9
- reducers: {
10
- resetConfirmation: () => initialState,
11
- setConfirmationOrder: (state, action) => {
12
- state.order = action.payload;
13
- }
14
- }
15
- });
16
- export const { resetConfirmation, setConfirmationOrder } = confirmationSlice.actions;
17
- export const selectConfirmationOrder = (state) => state.confirmation.order;
18
- export const confirmationReducer = confirmationSlice.reducer;
1
+ import { createSlice } from '@reduxjs/toolkit';
2
+ import { ReducerType } from './types';
3
+ const initialState = {
4
+ order: null
5
+ };
6
+ const confirmationSlice = createSlice({
7
+ name: ReducerType.Confirmation,
8
+ initialState,
9
+ reducers: {
10
+ resetConfirmation: () => initialState,
11
+ setConfirmationOrder: (state, action) => {
12
+ state.order = action.payload;
13
+ }
14
+ }
15
+ });
16
+ export const { resetConfirmation, setConfirmationOrder } = confirmationSlice.actions;
17
+ export const selectConfirmationOrder = (state) => state.confirmation.order;
18
+ export const confirmationReducer = confirmationSlice.reducer;
@@ -1,128 +1,128 @@
1
- import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
2
- import { AppState } from '../../app';
3
- import { Auth, Customer, CustomerCreate, LoginData, RequestError, RequestStatus } from '@open-tender/types';
4
- export interface AccountState {
5
- auth: Auth | null;
6
- profile: Customer | null;
7
- loading: RequestStatus;
8
- error: any;
9
- }
10
- export declare enum AccountActionType {
11
- LoginCustomer = "customer/loginCustomer",
12
- LogoutCustomer = "customer/logoutCustomer",
13
- FetchCustomer = "customer/fetchCustomer",
14
- UpdateCustomer = "customer/updateCustomer",
15
- VerifyCustomer = "customer/verifyCustomer",
16
- LinkPosToken = "customer/linkPosToken",
17
- DeleteCustomer = "customer/deleteCustomer",
18
- LoginCustomerThanx = "customer/loginCustomerThanx",
19
- AuthCustomerThanx = "customer/authCustomerThanx"
20
- }
21
- export declare const checkAuth: (err: RequestError, dispatch: ThunkDispatch<AppState, unknown, AnyAction>, rejectWithValue: () => any) => Promise<any>;
22
- export declare const fetchCustomer: import("@reduxjs/toolkit").AsyncThunk<Customer, void, {
23
- state: AppState;
24
- rejectValue: RequestError;
25
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
26
- extra?: unknown;
27
- serializedErrorType?: unknown;
28
- pendingMeta?: unknown;
29
- fulfilledMeta?: unknown;
30
- rejectedMeta?: unknown;
31
- }>;
32
- export declare const loginCustomer: import("@reduxjs/toolkit").AsyncThunk<void, LoginData, {
33
- state: AppState;
34
- rejectValue: RequestError;
35
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
36
- extra?: unknown;
37
- serializedErrorType?: unknown;
38
- pendingMeta?: unknown;
39
- fulfilledMeta?: unknown;
40
- rejectedMeta?: unknown;
41
- }>;
42
- export declare const logoutCustomer: import("@reduxjs/toolkit").AsyncThunk<null, boolean | undefined, {
43
- state: AppState;
44
- rejectValue: RequestError;
45
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
46
- extra?: unknown;
47
- serializedErrorType?: unknown;
48
- pendingMeta?: unknown;
49
- fulfilledMeta?: unknown;
50
- rejectedMeta?: unknown;
51
- }>;
52
- export declare const linkPosToken: import("@reduxjs/toolkit").AsyncThunk<void, string, {
53
- state: AppState;
54
- rejectValue: RequestError;
55
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
56
- extra?: unknown;
57
- serializedErrorType?: unknown;
58
- pendingMeta?: unknown;
59
- fulfilledMeta?: unknown;
60
- rejectedMeta?: unknown;
61
- }>;
62
- export declare const updateCustomer: import("@reduxjs/toolkit").AsyncThunk<Customer, {
63
- data: CustomerCreate;
64
- callback?: ((data: CustomerCreate) => void) | undefined;
65
- }, {
66
- state: AppState;
67
- rejectValue: RequestError;
68
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
69
- extra?: unknown;
70
- serializedErrorType?: unknown;
71
- pendingMeta?: unknown;
72
- fulfilledMeta?: unknown;
73
- rejectedMeta?: unknown;
74
- }>;
75
- export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").AsyncThunk<void, string, {
76
- state: AppState;
77
- rejectValue: RequestError;
78
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
79
- extra?: unknown;
80
- serializedErrorType?: unknown;
81
- pendingMeta?: unknown;
82
- fulfilledMeta?: unknown;
83
- rejectedMeta?: unknown;
84
- }>;
85
- export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
86
- email: string;
87
- origin?: string | undefined;
88
- }, {
89
- state: AppState;
90
- rejectValue: RequestError;
91
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
92
- extra?: unknown;
93
- serializedErrorType?: unknown;
94
- pendingMeta?: unknown;
95
- fulfilledMeta?: unknown;
96
- rejectedMeta?: unknown;
97
- }>;
98
- export declare const authCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
99
- code: any;
100
- path: string | null;
101
- origin: string | null;
102
- }, {
103
- state: AppState;
104
- rejectValue: RequestError;
105
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
106
- extra?: unknown;
107
- serializedErrorType?: unknown;
108
- pendingMeta?: unknown;
109
- fulfilledMeta?: unknown;
110
- rejectedMeta?: unknown;
111
- }>;
112
- export declare const deleteCustomer: import("@reduxjs/toolkit").AsyncThunk<void, {
113
- data?: CustomerCreate | undefined;
114
- callback?: ((data?: CustomerCreate) => void) | undefined;
115
- }, {
116
- state: AppState;
117
- rejectValue: RequestError;
118
- dispatch?: import("redux").Dispatch<AnyAction> | undefined;
119
- extra?: unknown;
120
- serializedErrorType?: unknown;
121
- pendingMeta?: unknown;
122
- fulfilledMeta?: unknown;
123
- rejectedMeta?: unknown;
124
- }>;
125
- export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"account/resetCustomer">, resetLoginError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"account/resetLoginError">, setCustomerAuth: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "account/setCustomerAuth">;
126
- export declare const selectToken: (state: AppState) => string | null;
127
- export declare const selectCustomer: (state: AppState) => AccountState;
128
- export declare const accountReducer: import("redux").Reducer<AccountState, AnyAction>;
1
+ import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
2
+ import { AppState } from '../../app';
3
+ import { Auth, Customer, CustomerCreate, LoginData, RequestError, RequestStatus } from '@open-tender/types';
4
+ export interface AccountState {
5
+ auth: Auth | null;
6
+ profile: Customer | null;
7
+ loading: RequestStatus;
8
+ error: any;
9
+ }
10
+ export declare enum AccountActionType {
11
+ LoginCustomer = "customer/loginCustomer",
12
+ LogoutCustomer = "customer/logoutCustomer",
13
+ FetchCustomer = "customer/fetchCustomer",
14
+ UpdateCustomer = "customer/updateCustomer",
15
+ VerifyCustomer = "customer/verifyCustomer",
16
+ LinkPosToken = "customer/linkPosToken",
17
+ DeleteCustomer = "customer/deleteCustomer",
18
+ LoginCustomerThanx = "customer/loginCustomerThanx",
19
+ AuthCustomerThanx = "customer/authCustomerThanx"
20
+ }
21
+ export declare const checkAuth: (err: RequestError, dispatch: ThunkDispatch<AppState, unknown, AnyAction>, rejectWithValue: () => any) => Promise<any>;
22
+ export declare const fetchCustomer: import("@reduxjs/toolkit").AsyncThunk<Customer, void, {
23
+ state: AppState;
24
+ rejectValue: RequestError;
25
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
26
+ extra?: unknown;
27
+ serializedErrorType?: unknown;
28
+ pendingMeta?: unknown;
29
+ fulfilledMeta?: unknown;
30
+ rejectedMeta?: unknown;
31
+ }>;
32
+ export declare const loginCustomer: import("@reduxjs/toolkit").AsyncThunk<void, LoginData, {
33
+ state: AppState;
34
+ rejectValue: RequestError;
35
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
36
+ extra?: unknown;
37
+ serializedErrorType?: unknown;
38
+ pendingMeta?: unknown;
39
+ fulfilledMeta?: unknown;
40
+ rejectedMeta?: unknown;
41
+ }>;
42
+ export declare const logoutCustomer: import("@reduxjs/toolkit").AsyncThunk<null, boolean | undefined, {
43
+ state: AppState;
44
+ rejectValue: RequestError;
45
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
46
+ extra?: unknown;
47
+ serializedErrorType?: unknown;
48
+ pendingMeta?: unknown;
49
+ fulfilledMeta?: unknown;
50
+ rejectedMeta?: unknown;
51
+ }>;
52
+ export declare const linkPosToken: import("@reduxjs/toolkit").AsyncThunk<void, string, {
53
+ state: AppState;
54
+ rejectValue: RequestError;
55
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
56
+ extra?: unknown;
57
+ serializedErrorType?: unknown;
58
+ pendingMeta?: unknown;
59
+ fulfilledMeta?: unknown;
60
+ rejectedMeta?: unknown;
61
+ }>;
62
+ export declare const updateCustomer: import("@reduxjs/toolkit").AsyncThunk<Customer, {
63
+ data: CustomerCreate;
64
+ callback?: ((data: CustomerCreate) => void) | undefined;
65
+ }, {
66
+ state: AppState;
67
+ rejectValue: RequestError;
68
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
69
+ extra?: unknown;
70
+ serializedErrorType?: unknown;
71
+ pendingMeta?: unknown;
72
+ fulfilledMeta?: unknown;
73
+ rejectedMeta?: unknown;
74
+ }>;
75
+ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").AsyncThunk<void, string, {
76
+ state: AppState;
77
+ rejectValue: RequestError;
78
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
79
+ extra?: unknown;
80
+ serializedErrorType?: unknown;
81
+ pendingMeta?: unknown;
82
+ fulfilledMeta?: unknown;
83
+ rejectedMeta?: unknown;
84
+ }>;
85
+ export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
86
+ email: string;
87
+ origin?: string | undefined;
88
+ }, {
89
+ state: AppState;
90
+ rejectValue: RequestError;
91
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
92
+ extra?: unknown;
93
+ serializedErrorType?: unknown;
94
+ pendingMeta?: unknown;
95
+ fulfilledMeta?: unknown;
96
+ rejectedMeta?: unknown;
97
+ }>;
98
+ export declare const authCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
99
+ code: any;
100
+ path: string | null;
101
+ origin: string | null;
102
+ }, {
103
+ state: AppState;
104
+ rejectValue: RequestError;
105
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
106
+ extra?: unknown;
107
+ serializedErrorType?: unknown;
108
+ pendingMeta?: unknown;
109
+ fulfilledMeta?: unknown;
110
+ rejectedMeta?: unknown;
111
+ }>;
112
+ export declare const deleteCustomer: import("@reduxjs/toolkit").AsyncThunk<void, {
113
+ data?: CustomerCreate | undefined;
114
+ callback?: ((data?: CustomerCreate) => void) | undefined;
115
+ }, {
116
+ state: AppState;
117
+ rejectValue: RequestError;
118
+ dispatch?: import("redux").Dispatch<AnyAction> | undefined;
119
+ extra?: unknown;
120
+ serializedErrorType?: unknown;
121
+ pendingMeta?: unknown;
122
+ fulfilledMeta?: unknown;
123
+ rejectedMeta?: unknown;
124
+ }>;
125
+ export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"account/resetCustomer">, resetLoginError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"account/resetLoginError">, setCustomerAuth: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "account/setCustomerAuth">;
126
+ export declare const selectToken: (state: AppState) => string | null;
127
+ export declare const selectCustomer: (state: AppState) => AccountState;
128
+ export declare const accountReducer: import("redux").Reducer<AccountState, AnyAction>;