@open-tender/store 0.6.4 → 0.6.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.
package/dist/.DS_Store CHANGED
Binary file
Binary file
@@ -33,8 +33,9 @@ export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithou
33
33
  export declare const selectConfig: (state: AppState) => ConfigState;
34
34
  export declare const selectApi: (state: AppState) => any;
35
35
  export declare const selectVersion: (state: AppState) => string | null | undefined;
36
- export declare const selectRevenueCenterId: (state: AppState) => number | null;
36
+ export declare const selectDevices: (state: AppState) => Devices | null;
37
37
  export declare const selectStore: (state: AppState) => Store | null;
38
+ export declare const selectRevenueCenterId: (state: AppState) => number | null;
38
39
  export declare const selectSelectOptions: (state: AppState) => SelectOptions;
39
40
  export declare const selectMenuColors: (state: AppState) => MenuColors;
40
41
  export declare const selectTimezone: (state: AppState) => Timezone;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.configReducer = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectStore = exports.selectRevenueCenterId = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
4
+ exports.configReducer = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectRevenueCenterId = exports.selectStore = exports.selectDevices = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
5
5
  var tslib_1 = require("tslib");
6
6
  var toolkit_1 = require("@reduxjs/toolkit");
7
7
  var services_1 = require("../services");
@@ -39,7 +39,7 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
39
39
  return tslib_1.__awaiter(void 0, void 0, void 0, function () {
40
40
  var app, api, _c, _d,
41
41
  // config,
42
- devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
42
+ devicesList, _e, stores, _f, selectOptions, _g, itemTypes, store, devices, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
43
43
  return tslib_1.__generator(this, function (_h) {
44
44
  switch (_h.label) {
45
45
  case 0:
@@ -55,9 +55,10 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
55
55
  // api.getMenuColors(),
56
56
  ])];
57
57
  case 1:
58
- _c = _h.sent(), _d = _c[0], devices = _d === void 0 ? null : _d, _e = _c[1], stores = _e === void 0 ? null : _e, _f = _c[2], selectOptions = _f === void 0 ? null : _f, _g = _c[3], itemTypes = _g === void 0 ? null : _g;
58
+ _c = _h.sent(), _d = _c[0], devicesList = _d === void 0 ? null : _d, _e = _c[1], stores = _e === void 0 ? null : _e, _f = _c[2], selectOptions = _f === void 0 ? null : _f, _g = _c[3], itemTypes = _g === void 0 ? null : _g;
59
59
  store = stores ? stores[0] : null;
60
- if (!store) {
60
+ devices = devicesList ? devicesList[0] : null;
61
+ if (!store || !devices) {
61
62
  err = errors_1.errorsApi.internalServerError;
62
63
  return [2 /*return*/, rejectWithValue(err)];
63
64
  }
@@ -79,7 +80,7 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
79
80
  case 5:
80
81
  revenueCenterId = store.revenue_center_id;
81
82
  dispatch((0, kds_1.setKdsItemTypes)(itemTypes));
82
- dispatch((0, kds_1.setKdsPrepStations)(devices === null || devices === void 0 ? void 0 : devices.prep_stations));
83
+ dispatch((0, kds_1.setKdsPrepStations)(devices.prep_stations));
83
84
  menuColors = [];
84
85
  return [2 /*return*/, {
85
86
  api: api,
@@ -154,12 +155,14 @@ var selectApi = function (state) { return state.config.api; };
154
155
  exports.selectApi = selectApi;
155
156
  var selectVersion = function (state) { return state.config.version; };
156
157
  exports.selectVersion = selectVersion;
158
+ var selectDevices = function (state) { return state.config.devices; };
159
+ exports.selectDevices = selectDevices;
160
+ var selectStore = function (state) { return state.config.store; };
161
+ exports.selectStore = selectStore;
157
162
  var selectRevenueCenterId = function (state) {
158
163
  return state.config.revenueCenterId;
159
164
  };
160
165
  exports.selectRevenueCenterId = selectRevenueCenterId;
161
- var selectStore = function (state) { return state.config.store; };
162
- exports.selectStore = selectStore;
163
166
  var selectSelectOptions = function (state) {
164
167
  return state.config.selectOptions || [];
165
168
  };
@@ -86,3 +86,4 @@ export interface Devices {
86
86
  printers: PosPrinters;
87
87
  servers: PosServers;
88
88
  }
89
+ export declare type DevicesList = Devices[];
@@ -33,8 +33,9 @@ export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithou
33
33
  export declare const selectConfig: (state: AppState) => ConfigState;
34
34
  export declare const selectApi: (state: AppState) => any;
35
35
  export declare const selectVersion: (state: AppState) => string | null | undefined;
36
- export declare const selectRevenueCenterId: (state: AppState) => number | null;
36
+ export declare const selectDevices: (state: AppState) => Devices | null;
37
37
  export declare const selectStore: (state: AppState) => Store | null;
38
+ export declare const selectRevenueCenterId: (state: AppState) => number | null;
38
39
  export declare const selectSelectOptions: (state: AppState) => SelectOptions;
39
40
  export declare const selectMenuColors: (state: AppState) => MenuColors;
40
41
  export declare const selectTimezone: (state: AppState) => Timezone;
@@ -36,7 +36,7 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
36
36
  return __awaiter(void 0, void 0, void 0, function () {
37
37
  var app, api, _c, _d,
38
38
  // config,
39
- devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
39
+ devicesList, _e, stores, _f, selectOptions, _g, itemTypes, store, devices, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
40
40
  return __generator(this, function (_h) {
41
41
  switch (_h.label) {
42
42
  case 0:
@@ -52,9 +52,10 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
52
52
  // api.getMenuColors(),
53
53
  ])];
54
54
  case 1:
55
- _c = _h.sent(), _d = _c[0], devices = _d === void 0 ? null : _d, _e = _c[1], stores = _e === void 0 ? null : _e, _f = _c[2], selectOptions = _f === void 0 ? null : _f, _g = _c[3], itemTypes = _g === void 0 ? null : _g;
55
+ _c = _h.sent(), _d = _c[0], devicesList = _d === void 0 ? null : _d, _e = _c[1], stores = _e === void 0 ? null : _e, _f = _c[2], selectOptions = _f === void 0 ? null : _f, _g = _c[3], itemTypes = _g === void 0 ? null : _g;
56
56
  store = stores ? stores[0] : null;
57
- if (!store) {
57
+ devices = devicesList ? devicesList[0] : null;
58
+ if (!store || !devices) {
58
59
  err = errorsApi.internalServerError;
59
60
  return [2 /*return*/, rejectWithValue(err)];
60
61
  }
@@ -76,7 +77,7 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
76
77
  case 5:
77
78
  revenueCenterId = store.revenue_center_id;
78
79
  dispatch(setKdsItemTypes(itemTypes));
79
- dispatch(setKdsPrepStations(devices === null || devices === void 0 ? void 0 : devices.prep_stations));
80
+ dispatch(setKdsPrepStations(devices.prep_stations));
80
81
  menuColors = [];
81
82
  return [2 /*return*/, {
82
83
  api: api,
@@ -148,10 +149,11 @@ export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetrie
148
149
  export var selectConfig = function (state) { return state.config; };
149
150
  export var selectApi = function (state) { return state.config.api; };
150
151
  export var selectVersion = function (state) { return state.config.version; };
152
+ export var selectDevices = function (state) { return state.config.devices; };
153
+ export var selectStore = function (state) { return state.config.store; };
151
154
  export var selectRevenueCenterId = function (state) {
152
155
  return state.config.revenueCenterId;
153
156
  };
154
- export var selectStore = function (state) { return state.config.store; };
155
157
  export var selectSelectOptions = function (state) {
156
158
  return state.config.selectOptions || [];
157
159
  };
@@ -86,3 +86,4 @@ export interface Devices {
86
86
  printers: PosPrinters;
87
87
  servers: PosServers;
88
88
  }
89
+ export declare type DevicesList = Devices[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.6.4",
3
+ "version": "0.6.9",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",