@open-tender/cloud 0.0.62 → 0.0.64

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.
@@ -286,4 +286,5 @@ export declare const selectContentSection: (page: keyof ConfigContent) => (state
286
286
  };
287
287
  } | null;
288
288
  export declare const selectSoldOutMsg: (state: AppState) => string;
289
+ export declare const selectOutpostName: (state: AppState) => string | undefined;
289
290
  export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.configReducer = exports.selectSoldOutMsg = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectAccountConfig = exports.selectApi = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.selectCateringOnly = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
4
+ exports.configReducer = exports.selectOutpostName = exports.selectSoldOutMsg = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectAccountConfig = exports.selectApi = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.selectCateringOnly = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const utils_1 = require("@open-tender/utils");
@@ -120,4 +120,6 @@ const selectSoldOutMsg = (state) => {
120
120
  return soldOutMessage || 'Sold out for day';
121
121
  };
122
122
  exports.selectSoldOutMsg = selectSoldOutMsg;
123
+ const selectOutpostName = (state) => { var _a, _b, _c; return ((_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.locationName.OUTPOST) ? (0, utils_1.capitalize)((_c = (_b = state.config.settings) === null || _b === void 0 ? void 0 : _b.locationName.OUTPOST[0]) !== null && _c !== void 0 ? _c : '') : undefined; };
124
+ exports.selectOutpostName = selectOutpostName;
123
125
  exports.configReducer = configSlice.reducer;
@@ -253,7 +253,7 @@ const customerGroupOrdersSlice = (0, toolkit_1.createSlice)({
253
253
  state.loading = 'idle';
254
254
  })
255
255
  .addCase(exports.reopenGroupOrder.fulfilled, (state, action) => {
256
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
256
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
257
257
  })
258
258
  .addCase(exports.reopenGroupOrder.pending, state => {
259
259
  state.loading = 'pending';
@@ -263,7 +263,7 @@ const customerGroupOrdersSlice = (0, toolkit_1.createSlice)({
263
263
  state.loading = 'idle';
264
264
  })
265
265
  .addCase(exports.updateCustomerGroupOrder.fulfilled, (state, action) => {
266
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
266
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
267
267
  })
268
268
  .addCase(exports.updateCustomerGroupOrder.pending, state => {
269
269
  state.loading = 'pending';
@@ -273,7 +273,7 @@ const customerGroupOrdersSlice = (0, toolkit_1.createSlice)({
273
273
  state.loading = 'idle';
274
274
  })
275
275
  .addCase(exports.closeGroupOrder.fulfilled, (state, action) => {
276
- state = Object.assign(Object.assign({}, state), { closed: action.payload, loading: 'idle', error: null });
276
+ return Object.assign(Object.assign({}, state), { closed: action.payload, loading: 'idle', error: null });
277
277
  })
278
278
  .addCase(exports.closeGroupOrder.pending, state => {
279
279
  state.loading = 'pending';
@@ -151,7 +151,7 @@ const groupOrderSlice = (0, toolkit_1.createSlice)({
151
151
  state.error = action.payload;
152
152
  })
153
153
  .addCase(exports.fetchGroupOrder.fulfilled, (state, action) => {
154
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
154
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
155
155
  })
156
156
  .addCase(exports.fetchGroupOrder.pending, state => {
157
157
  state.loading = 'pending';
@@ -161,7 +161,7 @@ const groupOrderSlice = (0, toolkit_1.createSlice)({
161
161
  state.error = action.payload;
162
162
  })
163
163
  .addCase(exports.updateGroupOrder.fulfilled, (state, action) => {
164
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
164
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
165
165
  })
166
166
  .addCase(exports.updateGroupOrder.pending, state => {
167
167
  state.loading = 'pending';
@@ -67,7 +67,7 @@ const guestSlice = (0, toolkit_1.createSlice)({
67
67
  extraReducers: builder => {
68
68
  builder
69
69
  .addCase(exports.fetchGuest.fulfilled, (state, action) => {
70
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null }), action.payload);
70
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null }), action.payload);
71
71
  })
72
72
  .addCase(exports.fetchGuest.pending, state => {
73
73
  state.loading = 'pending';
@@ -80,7 +80,7 @@ const guestSlice = (0, toolkit_1.createSlice)({
80
80
  state.brands = null;
81
81
  })
82
82
  .addCase(exports.fetchGuestThanx.fulfilled, (state, action) => {
83
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null, showMagicLink: true }), action.payload);
83
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null, showMagicLink: true }), action.payload);
84
84
  })
85
85
  .addCase(exports.fetchGuestThanx.pending, state => {
86
86
  state.loading = 'pending';
@@ -69,7 +69,7 @@ const menuSlice = (0, toolkit_1.createSlice)({
69
69
  extraReducers: builder => {
70
70
  builder
71
71
  .addCase(exports.fetchMenu.fulfilled, (state, action) => {
72
- state = Object.assign(Object.assign(Object.assign({}, state), { previousMenuVars: state.menuVars || null, loading: 'idle', error: null }), action.payload);
72
+ return Object.assign(Object.assign(Object.assign({}, state), { previousMenuVars: state.menuVars || null, loading: 'idle', error: null }), action.payload);
73
73
  })
74
74
  .addCase(exports.fetchMenu.pending, state => {
75
75
  state.loading = 'pending';
@@ -404,7 +404,7 @@ const orderSlice = (0, toolkit_1.createSlice)({
404
404
  state.loading = 'idle';
405
405
  })
406
406
  .addCase(exports.editOrder.fulfilled, (state, action) => {
407
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
407
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
408
408
  })
409
409
  .addCase(exports.editOrder.pending, state => {
410
410
  state.loading = 'pending';
@@ -413,7 +413,7 @@ const orderSlice = (0, toolkit_1.createSlice)({
413
413
  state.loading = 'idle';
414
414
  })
415
415
  .addCase(exports.reorderPastOrder.fulfilled, (state, action) => {
416
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
416
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
417
417
  })
418
418
  .addCase(exports.reorderPastOrder.pending, state => {
419
419
  state.loading = 'pending';
@@ -286,4 +286,5 @@ export declare const selectContentSection: (page: keyof ConfigContent) => (state
286
286
  };
287
287
  } | null;
288
288
  export declare const selectSoldOutMsg: (state: AppState) => string;
289
+ export declare const selectOutpostName: (state: AppState) => string | undefined;
289
290
  export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
3
- import { decorateTheme } from '@open-tender/utils';
3
+ import { capitalize, decorateTheme } from '@open-tender/utils';
4
4
  import { ReducerType } from './types';
5
5
  import OpenTenderAPI from '../services/api';
6
6
  const initialState = {
@@ -100,4 +100,5 @@ export const selectSoldOutMsg = (state) => {
100
100
  const { soldOutMessage } = ((_a = state.config.content) === null || _a === void 0 ? void 0 : _a.menu) || {};
101
101
  return soldOutMessage || 'Sold out for day';
102
102
  };
103
+ export const selectOutpostName = (state) => { var _a, _b, _c; return ((_a = state.config.settings) === null || _a === void 0 ? void 0 : _a.locationName.OUTPOST) ? capitalize((_c = (_b = state.config.settings) === null || _b === void 0 ? void 0 : _b.locationName.OUTPOST[0]) !== null && _c !== void 0 ? _c : '') : undefined; };
103
104
  export const configReducer = configSlice.reducer;
@@ -249,7 +249,7 @@ const customerGroupOrdersSlice = createSlice({
249
249
  state.loading = 'idle';
250
250
  })
251
251
  .addCase(reopenGroupOrder.fulfilled, (state, action) => {
252
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
252
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
253
253
  })
254
254
  .addCase(reopenGroupOrder.pending, state => {
255
255
  state.loading = 'pending';
@@ -259,7 +259,7 @@ const customerGroupOrdersSlice = createSlice({
259
259
  state.loading = 'idle';
260
260
  })
261
261
  .addCase(updateCustomerGroupOrder.fulfilled, (state, action) => {
262
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
262
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
263
263
  })
264
264
  .addCase(updateCustomerGroupOrder.pending, state => {
265
265
  state.loading = 'pending';
@@ -269,7 +269,7 @@ const customerGroupOrdersSlice = createSlice({
269
269
  state.loading = 'idle';
270
270
  })
271
271
  .addCase(closeGroupOrder.fulfilled, (state, action) => {
272
- state = Object.assign(Object.assign({}, state), { closed: action.payload, loading: 'idle', error: null });
272
+ return Object.assign(Object.assign({}, state), { closed: action.payload, loading: 'idle', error: null });
273
273
  })
274
274
  .addCase(closeGroupOrder.pending, state => {
275
275
  state.loading = 'pending';
@@ -147,7 +147,7 @@ const groupOrderSlice = createSlice({
147
147
  state.error = action.payload;
148
148
  })
149
149
  .addCase(fetchGroupOrder.fulfilled, (state, action) => {
150
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
150
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
151
151
  })
152
152
  .addCase(fetchGroupOrder.pending, state => {
153
153
  state.loading = 'pending';
@@ -157,7 +157,7 @@ const groupOrderSlice = createSlice({
157
157
  state.error = action.payload;
158
158
  })
159
159
  .addCase(updateGroupOrder.fulfilled, (state, action) => {
160
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
160
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', error: null }), action.payload);
161
161
  })
162
162
  .addCase(updateGroupOrder.pending, state => {
163
163
  state.loading = 'pending';
@@ -64,7 +64,7 @@ const guestSlice = createSlice({
64
64
  extraReducers: builder => {
65
65
  builder
66
66
  .addCase(fetchGuest.fulfilled, (state, action) => {
67
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null }), action.payload);
67
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null }), action.payload);
68
68
  })
69
69
  .addCase(fetchGuest.pending, state => {
70
70
  state.loading = 'pending';
@@ -77,7 +77,7 @@ const guestSlice = createSlice({
77
77
  state.brands = null;
78
78
  })
79
79
  .addCase(fetchGuestThanx.fulfilled, (state, action) => {
80
- state = Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null, showMagicLink: true }), action.payload);
80
+ return Object.assign(Object.assign(Object.assign({}, state), { loading: 'idle', errors: null, showMagicLink: true }), action.payload);
81
81
  })
82
82
  .addCase(fetchGuestThanx.pending, state => {
83
83
  state.loading = 'pending';
@@ -65,7 +65,7 @@ const menuSlice = createSlice({
65
65
  extraReducers: builder => {
66
66
  builder
67
67
  .addCase(fetchMenu.fulfilled, (state, action) => {
68
- state = Object.assign(Object.assign(Object.assign({}, state), { previousMenuVars: state.menuVars || null, loading: 'idle', error: null }), action.payload);
68
+ return Object.assign(Object.assign(Object.assign({}, state), { previousMenuVars: state.menuVars || null, loading: 'idle', error: null }), action.payload);
69
69
  })
70
70
  .addCase(fetchMenu.pending, state => {
71
71
  state.loading = 'pending';
@@ -399,7 +399,7 @@ const orderSlice = createSlice({
399
399
  state.loading = 'idle';
400
400
  })
401
401
  .addCase(editOrder.fulfilled, (state, action) => {
402
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
402
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
403
403
  })
404
404
  .addCase(editOrder.pending, state => {
405
405
  state.loading = 'pending';
@@ -408,7 +408,7 @@ const orderSlice = createSlice({
408
408
  state.loading = 'idle';
409
409
  })
410
410
  .addCase(reorderPastOrder.fulfilled, (state, action) => {
411
- state = Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
411
+ return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
412
412
  })
413
413
  .addCase(reorderPastOrder.pending, state => {
414
414
  state.loading = 'pending';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
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",