@open-tender/store 0.6.2 → 0.6.3
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 +0 -0
- package/dist/cjs/slices/config.d.ts +6 -0
- package/dist/cjs/slices/config.js +16 -3
- package/dist/cjs/types/api/store.d.ts +1 -0
- package/dist/esm/slices/config.d.ts +6 -0
- package/dist/esm/slices/config.js +13 -2
- package/dist/esm/types/api/store.d.ts +1 -0
- package/package.json +1 -1
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -12,6 +12,10 @@ export interface ConfigState {
|
|
|
12
12
|
revenueCenterId: number | null;
|
|
13
13
|
selectOptions: SelectOptions | null;
|
|
14
14
|
menuColors: MenuColors | null;
|
|
15
|
+
name: string | null;
|
|
16
|
+
ipAddress: string | null;
|
|
17
|
+
hasPinpad: boolean;
|
|
18
|
+
hasCashDrawer: boolean;
|
|
15
19
|
loading: RequestStatus;
|
|
16
20
|
error: RequestError | null;
|
|
17
21
|
retries: number;
|
|
@@ -35,4 +39,6 @@ export declare const selectSelectOptions: (state: AppState) => SelectOptions;
|
|
|
35
39
|
export declare const selectMenuColors: (state: AppState) => MenuColors;
|
|
36
40
|
export declare const selectTimezone: (state: AppState) => Timezone;
|
|
37
41
|
export declare const selectLoyalty: (state: AppState) => boolean;
|
|
42
|
+
export declare const selectPinpad: (state: AppState) => boolean;
|
|
43
|
+
export declare const selectCashDrawer: (state: AppState) => boolean;
|
|
38
44
|
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.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.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;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
var services_1 = require("../services");
|
|
@@ -21,6 +21,10 @@ var initialState = {
|
|
|
21
21
|
revenueCenterId: null,
|
|
22
22
|
selectOptions: null,
|
|
23
23
|
menuColors: null,
|
|
24
|
+
name: null,
|
|
25
|
+
ipAddress: null,
|
|
26
|
+
hasPinpad: false,
|
|
27
|
+
hasCashDrawer: false,
|
|
24
28
|
loading: 'idle',
|
|
25
29
|
error: null,
|
|
26
30
|
retries: 0
|
|
@@ -35,7 +39,7 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
|
|
|
35
39
|
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
36
40
|
var app, api, _c, _d,
|
|
37
41
|
// config,
|
|
38
|
-
devices, _e,
|
|
42
|
+
devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
|
|
39
43
|
return tslib_1.__generator(this, function (_h) {
|
|
40
44
|
switch (_h.label) {
|
|
41
45
|
case 0:
|
|
@@ -51,7 +55,8 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
|
|
|
51
55
|
// api.getMenuColors(),
|
|
52
56
|
])];
|
|
53
57
|
case 1:
|
|
54
|
-
_c = _h.sent(), _d = _c[0], devices = _d === void 0 ? null : _d, _e = _c[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;
|
|
59
|
+
store = stores ? stores[0] : null;
|
|
55
60
|
if (!store) {
|
|
56
61
|
err = errors_1.errorsApi.internalServerError;
|
|
57
62
|
return [2 /*return*/, rejectWithValue(err)];
|
|
@@ -84,6 +89,10 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
|
|
|
84
89
|
revenueCenterId: revenueCenterId,
|
|
85
90
|
selectOptions: selectOptions,
|
|
86
91
|
menuColors: menuColors,
|
|
92
|
+
name: 'Name',
|
|
93
|
+
ipAddress: '10.0.0.1',
|
|
94
|
+
hasPinpad: false,
|
|
95
|
+
hasCashDrawer: false,
|
|
87
96
|
error: null,
|
|
88
97
|
loading: 'idle',
|
|
89
98
|
retries: 0
|
|
@@ -169,4 +178,8 @@ var selectLoyalty = function (state) {
|
|
|
169
178
|
return state.config.store ? state.config.store.has_loyalty : false;
|
|
170
179
|
};
|
|
171
180
|
exports.selectLoyalty = selectLoyalty;
|
|
181
|
+
var selectPinpad = function (state) { return state.config.hasPinpad; };
|
|
182
|
+
exports.selectPinpad = selectPinpad;
|
|
183
|
+
var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
|
|
184
|
+
exports.selectCashDrawer = selectCashDrawer;
|
|
172
185
|
exports.configReducer = configSlice.reducer;
|
|
@@ -12,6 +12,10 @@ export interface ConfigState {
|
|
|
12
12
|
revenueCenterId: number | null;
|
|
13
13
|
selectOptions: SelectOptions | null;
|
|
14
14
|
menuColors: MenuColors | null;
|
|
15
|
+
name: string | null;
|
|
16
|
+
ipAddress: string | null;
|
|
17
|
+
hasPinpad: boolean;
|
|
18
|
+
hasCashDrawer: boolean;
|
|
15
19
|
loading: RequestStatus;
|
|
16
20
|
error: RequestError | null;
|
|
17
21
|
retries: number;
|
|
@@ -35,4 +39,6 @@ export declare const selectSelectOptions: (state: AppState) => SelectOptions;
|
|
|
35
39
|
export declare const selectMenuColors: (state: AppState) => MenuColors;
|
|
36
40
|
export declare const selectTimezone: (state: AppState) => Timezone;
|
|
37
41
|
export declare const selectLoyalty: (state: AppState) => boolean;
|
|
42
|
+
export declare const selectPinpad: (state: AppState) => boolean;
|
|
43
|
+
export declare const selectCashDrawer: (state: AppState) => boolean;
|
|
38
44
|
export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
|
|
@@ -18,6 +18,10 @@ var initialState = {
|
|
|
18
18
|
revenueCenterId: null,
|
|
19
19
|
selectOptions: null,
|
|
20
20
|
menuColors: null,
|
|
21
|
+
name: null,
|
|
22
|
+
ipAddress: null,
|
|
23
|
+
hasPinpad: false,
|
|
24
|
+
hasCashDrawer: false,
|
|
21
25
|
loading: 'idle',
|
|
22
26
|
error: null,
|
|
23
27
|
retries: 0
|
|
@@ -32,7 +36,7 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
|
|
|
32
36
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
33
37
|
var app, api, _c, _d,
|
|
34
38
|
// config,
|
|
35
|
-
devices, _e,
|
|
39
|
+
devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
|
|
36
40
|
return __generator(this, function (_h) {
|
|
37
41
|
switch (_h.label) {
|
|
38
42
|
case 0:
|
|
@@ -48,7 +52,8 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
|
|
|
48
52
|
// api.getMenuColors(),
|
|
49
53
|
])];
|
|
50
54
|
case 1:
|
|
51
|
-
_c = _h.sent(), _d = _c[0], devices = _d === void 0 ? null : _d, _e = _c[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;
|
|
56
|
+
store = stores ? stores[0] : null;
|
|
52
57
|
if (!store) {
|
|
53
58
|
err = errorsApi.internalServerError;
|
|
54
59
|
return [2 /*return*/, rejectWithValue(err)];
|
|
@@ -81,6 +86,10 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
|
|
|
81
86
|
revenueCenterId: revenueCenterId,
|
|
82
87
|
selectOptions: selectOptions,
|
|
83
88
|
menuColors: menuColors,
|
|
89
|
+
name: 'Name',
|
|
90
|
+
ipAddress: '10.0.0.1',
|
|
91
|
+
hasPinpad: false,
|
|
92
|
+
hasCashDrawer: false,
|
|
84
93
|
error: null,
|
|
85
94
|
loading: 'idle',
|
|
86
95
|
retries: 0
|
|
@@ -157,4 +166,6 @@ export var selectTimezone = function (state) {
|
|
|
157
166
|
export var selectLoyalty = function (state) {
|
|
158
167
|
return state.config.store ? state.config.store.has_loyalty : false;
|
|
159
168
|
};
|
|
169
|
+
export var selectPinpad = function (state) { return state.config.hasPinpad; };
|
|
170
|
+
export var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
|
|
160
171
|
export var configReducer = configSlice.reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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",
|