@open-tender/store 1.1.3 → 1.1.4

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 ADDED
Binary file
@@ -40,6 +40,118 @@ export declare const selectKiosk: (state: AppState) => KioskState;
40
40
  export declare const selectKioskVersion: (state: AppState) => string | null | undefined;
41
41
  export declare const selectKioskStore: (state: AppState) => Store | null;
42
42
  export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
43
+ export declare const selectKioskTerminal: ((state: {
44
+ alerts: import("@open-tender/types").Alerts;
45
+ arrivals: import("./arrivals").ArrivalsState;
46
+ cartSummary: import("./cartSummary").CartSummaryState;
47
+ checkout: import("./checkout").CheckoutState;
48
+ config: import("./config").ConfigState;
49
+ customer: import("./customer").CustomerState;
50
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
51
+ deals: import("./deals").DealsState;
52
+ discounts: import("./discounts").DiscountsState;
53
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
54
+ kds: import("./kds").KdsState;
55
+ kiosk: KioskState;
56
+ menu: import("./menu").MenuState;
57
+ menuPages: import("./menuPages").MenuPagesState;
58
+ modal: import("./modal").ModalState;
59
+ notifications: import("@open-tender/types").Notifications;
60
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
61
+ order: import("./order").OrderState;
62
+ pos: import("./pos").PosState;
63
+ punches: import("./punches").PunchesState;
64
+ refund: import("./refund").RefundState;
65
+ settings: import("./settings").SettingsState;
66
+ sidebar: import("./sidebar").SidebarState;
67
+ surcharges: import("./surcharges").SurchargesState;
68
+ taxes: import("./taxes").TaxesState;
69
+ }) => import("@open-tender/types").PosTerminal | null) & {
70
+ clearCache: () => void;
71
+ resultsCount: () => number;
72
+ resetResultsCount: () => void;
73
+ } & {
74
+ resultFunc: (resultFuncArgs_0: {
75
+ devices: Devices | null;
76
+ terminalId: number | null;
77
+ }) => import("@open-tender/types").PosTerminal | null;
78
+ memoizedResultFunc: ((resultFuncArgs_0: {
79
+ devices: Devices | null;
80
+ terminalId: number | null;
81
+ }) => import("@open-tender/types").PosTerminal | null) & {
82
+ clearCache: () => void;
83
+ resultsCount: () => number;
84
+ resetResultsCount: () => void;
85
+ };
86
+ lastResult: () => import("@open-tender/types").PosTerminal | null;
87
+ dependencies: [(state: AppState) => {
88
+ devices: Devices | null;
89
+ terminalId: number | null;
90
+ }];
91
+ recomputations: () => number;
92
+ resetRecomputations: () => void;
93
+ dependencyRecomputations: () => number;
94
+ resetDependencyRecomputations: () => void;
95
+ } & {
96
+ argsMemoize: typeof import("reselect").weakMapMemoize;
97
+ memoize: typeof import("reselect").weakMapMemoize;
98
+ };
99
+ export declare const selectKioskShowPrint: ((state: {
100
+ alerts: import("@open-tender/types").Alerts;
101
+ arrivals: import("./arrivals").ArrivalsState;
102
+ cartSummary: import("./cartSummary").CartSummaryState;
103
+ checkout: import("./checkout").CheckoutState;
104
+ config: import("./config").ConfigState;
105
+ customer: import("./customer").CustomerState;
106
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
107
+ deals: import("./deals").DealsState;
108
+ discounts: import("./discounts").DiscountsState;
109
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
110
+ kds: import("./kds").KdsState;
111
+ kiosk: KioskState;
112
+ menu: import("./menu").MenuState;
113
+ menuPages: import("./menuPages").MenuPagesState;
114
+ modal: import("./modal").ModalState;
115
+ notifications: import("@open-tender/types").Notifications;
116
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
117
+ order: import("./order").OrderState;
118
+ pos: import("./pos").PosState;
119
+ punches: import("./punches").PunchesState;
120
+ refund: import("./refund").RefundState;
121
+ settings: import("./settings").SettingsState;
122
+ sidebar: import("./sidebar").SidebarState;
123
+ surcharges: import("./surcharges").SurchargesState;
124
+ taxes: import("./taxes").TaxesState;
125
+ }) => boolean) & {
126
+ clearCache: () => void;
127
+ resultsCount: () => number;
128
+ resetResultsCount: () => void;
129
+ } & {
130
+ resultFunc: (resultFuncArgs_0: {
131
+ devices: Devices | null;
132
+ terminalId: number | null;
133
+ }) => boolean;
134
+ memoizedResultFunc: ((resultFuncArgs_0: {
135
+ devices: Devices | null;
136
+ terminalId: number | null;
137
+ }) => boolean) & {
138
+ clearCache: () => void;
139
+ resultsCount: () => number;
140
+ resetResultsCount: () => void;
141
+ };
142
+ lastResult: () => boolean;
143
+ dependencies: [(state: AppState) => {
144
+ devices: Devices | null;
145
+ terminalId: number | null;
146
+ }];
147
+ recomputations: () => number;
148
+ resetRecomputations: () => void;
149
+ dependencyRecomputations: () => number;
150
+ resetDependencyRecomputations: () => void;
151
+ } & {
152
+ argsMemoize: typeof import("reselect").weakMapMemoize;
153
+ memoize: typeof import("reselect").weakMapMemoize;
154
+ };
43
155
  export declare const selectKioskApi: ((state: {
44
156
  alerts: import("@open-tender/types").Alerts;
45
157
  arrivals: import("./arrivals").ArrivalsState;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.kioskReducer = exports.selectKioskRatio = exports.selectKioskStyles = exports.selectKioskConfigScreen = exports.selectKioskConfig = exports.selectKioskApi = exports.selectKioskBrand = exports.selectKioskStore = exports.selectKioskVersion = exports.selectKiosk = exports.setKioskStyles = exports.setKioskConfig = exports.setKioskRatio = exports.setKioskVersion = exports.incrementKioskRetries = exports.resetKioskRetries = exports.resetKiosk = exports.fetchKioskConfig = exports.KioskActionType = void 0;
4
+ exports.kioskReducer = exports.selectKioskRatio = exports.selectKioskStyles = exports.selectKioskConfigScreen = exports.selectKioskConfig = exports.selectKioskApi = exports.selectKioskShowPrint = exports.selectKioskTerminal = exports.selectKioskBrand = exports.selectKioskStore = exports.selectKioskVersion = exports.selectKiosk = exports.setKioskStyles = exports.setKioskConfig = exports.setKioskRatio = exports.setKioskVersion = exports.incrementKioskRetries = exports.resetKioskRetries = exports.resetKiosk = exports.fetchKioskConfig = exports.KioskActionType = void 0;
5
5
  var tslib_1 = require("tslib");
6
6
  var toolkit_1 = require("@reduxjs/toolkit");
7
7
  var services_1 = require("../services");
@@ -141,6 +141,29 @@ var selectKioskStore = function (state) { return state.kiosk.store; };
141
141
  exports.selectKioskStore = selectKioskStore;
142
142
  var selectKioskBrand = function (state) { return state.kiosk.brand; };
143
143
  exports.selectKioskBrand = selectKioskBrand;
144
+ exports.selectKioskTerminal = (0, toolkit_1.createSelector)(function (state) {
145
+ var devices = state.kiosk.devices;
146
+ var terminalId = state.pos.terminalId;
147
+ return { devices: devices, terminalId: terminalId };
148
+ }, function (_a) {
149
+ var devices = _a.devices, terminalId = _a.terminalId;
150
+ var terminal = devices === null || devices === void 0 ? void 0 : devices.pos_terminals.find(function (i) { return i.pos_terminal_id === terminalId; });
151
+ return terminal || null;
152
+ });
153
+ exports.selectKioskShowPrint = (0, toolkit_1.createSelector)(function (state) {
154
+ var devices = state.kiosk.devices;
155
+ var terminalId = state.pos.terminalId;
156
+ return { devices: devices, terminalId: terminalId };
157
+ }, function (_a) {
158
+ var devices = _a.devices, terminalId = _a.terminalId;
159
+ var terminal = devices === null || devices === void 0 ? void 0 : devices.pos_terminals.find(function (i) { return i.pos_terminal_id === terminalId; });
160
+ if (!terminal)
161
+ return false;
162
+ var print_receipt = terminal.print_receipt, printers = terminal.printers;
163
+ if (print_receipt === 'never' || !printers.length)
164
+ return false;
165
+ return true;
166
+ });
144
167
  exports.selectKioskApi = (0, toolkit_1.createSelector)(function (state) {
145
168
  var app = state.kiosk.app;
146
169
  return app;
@@ -40,6 +40,118 @@ export declare const selectKiosk: (state: AppState) => KioskState;
40
40
  export declare const selectKioskVersion: (state: AppState) => string | null | undefined;
41
41
  export declare const selectKioskStore: (state: AppState) => Store | null;
42
42
  export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
43
+ export declare const selectKioskTerminal: ((state: {
44
+ alerts: import("@open-tender/types").Alerts;
45
+ arrivals: import("./arrivals").ArrivalsState;
46
+ cartSummary: import("./cartSummary").CartSummaryState;
47
+ checkout: import("./checkout").CheckoutState;
48
+ config: import("./config").ConfigState;
49
+ customer: import("./customer").CustomerState;
50
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
51
+ deals: import("./deals").DealsState;
52
+ discounts: import("./discounts").DiscountsState;
53
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
54
+ kds: import("./kds").KdsState;
55
+ kiosk: KioskState;
56
+ menu: import("./menu").MenuState;
57
+ menuPages: import("./menuPages").MenuPagesState;
58
+ modal: import("./modal").ModalState;
59
+ notifications: import("@open-tender/types").Notifications;
60
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
61
+ order: import("./order").OrderState;
62
+ pos: import("./pos").PosState;
63
+ punches: import("./punches").PunchesState;
64
+ refund: import("./refund").RefundState;
65
+ settings: import("./settings").SettingsState;
66
+ sidebar: import("./sidebar").SidebarState;
67
+ surcharges: import("./surcharges").SurchargesState;
68
+ taxes: import("./taxes").TaxesState;
69
+ }) => import("@open-tender/types").PosTerminal | null) & {
70
+ clearCache: () => void;
71
+ resultsCount: () => number;
72
+ resetResultsCount: () => void;
73
+ } & {
74
+ resultFunc: (resultFuncArgs_0: {
75
+ devices: Devices | null;
76
+ terminalId: number | null;
77
+ }) => import("@open-tender/types").PosTerminal | null;
78
+ memoizedResultFunc: ((resultFuncArgs_0: {
79
+ devices: Devices | null;
80
+ terminalId: number | null;
81
+ }) => import("@open-tender/types").PosTerminal | null) & {
82
+ clearCache: () => void;
83
+ resultsCount: () => number;
84
+ resetResultsCount: () => void;
85
+ };
86
+ lastResult: () => import("@open-tender/types").PosTerminal | null;
87
+ dependencies: [(state: AppState) => {
88
+ devices: Devices | null;
89
+ terminalId: number | null;
90
+ }];
91
+ recomputations: () => number;
92
+ resetRecomputations: () => void;
93
+ dependencyRecomputations: () => number;
94
+ resetDependencyRecomputations: () => void;
95
+ } & {
96
+ argsMemoize: typeof import("reselect").weakMapMemoize;
97
+ memoize: typeof import("reselect").weakMapMemoize;
98
+ };
99
+ export declare const selectKioskShowPrint: ((state: {
100
+ alerts: import("@open-tender/types").Alerts;
101
+ arrivals: import("./arrivals").ArrivalsState;
102
+ cartSummary: import("./cartSummary").CartSummaryState;
103
+ checkout: import("./checkout").CheckoutState;
104
+ config: import("./config").ConfigState;
105
+ customer: import("./customer").CustomerState;
106
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
107
+ deals: import("./deals").DealsState;
108
+ discounts: import("./discounts").DiscountsState;
109
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
110
+ kds: import("./kds").KdsState;
111
+ kiosk: KioskState;
112
+ menu: import("./menu").MenuState;
113
+ menuPages: import("./menuPages").MenuPagesState;
114
+ modal: import("./modal").ModalState;
115
+ notifications: import("@open-tender/types").Notifications;
116
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
117
+ order: import("./order").OrderState;
118
+ pos: import("./pos").PosState;
119
+ punches: import("./punches").PunchesState;
120
+ refund: import("./refund").RefundState;
121
+ settings: import("./settings").SettingsState;
122
+ sidebar: import("./sidebar").SidebarState;
123
+ surcharges: import("./surcharges").SurchargesState;
124
+ taxes: import("./taxes").TaxesState;
125
+ }) => boolean) & {
126
+ clearCache: () => void;
127
+ resultsCount: () => number;
128
+ resetResultsCount: () => void;
129
+ } & {
130
+ resultFunc: (resultFuncArgs_0: {
131
+ devices: Devices | null;
132
+ terminalId: number | null;
133
+ }) => boolean;
134
+ memoizedResultFunc: ((resultFuncArgs_0: {
135
+ devices: Devices | null;
136
+ terminalId: number | null;
137
+ }) => boolean) & {
138
+ clearCache: () => void;
139
+ resultsCount: () => number;
140
+ resetResultsCount: () => void;
141
+ };
142
+ lastResult: () => boolean;
143
+ dependencies: [(state: AppState) => {
144
+ devices: Devices | null;
145
+ terminalId: number | null;
146
+ }];
147
+ recomputations: () => number;
148
+ resetRecomputations: () => void;
149
+ dependencyRecomputations: () => number;
150
+ resetDependencyRecomputations: () => void;
151
+ } & {
152
+ argsMemoize: typeof import("reselect").weakMapMemoize;
153
+ memoize: typeof import("reselect").weakMapMemoize;
154
+ };
43
155
  export declare const selectKioskApi: ((state: {
44
156
  alerts: import("@open-tender/types").Alerts;
45
157
  arrivals: import("./arrivals").ArrivalsState;
@@ -134,6 +134,29 @@ export var selectKiosk = function (state) { return state.kiosk; };
134
134
  export var selectKioskVersion = function (state) { return state.kiosk.version; };
135
135
  export var selectKioskStore = function (state) { return state.kiosk.store; };
136
136
  export var selectKioskBrand = function (state) { return state.kiosk.brand; };
137
+ export var selectKioskTerminal = createSelector(function (state) {
138
+ var devices = state.kiosk.devices;
139
+ var terminalId = state.pos.terminalId;
140
+ return { devices: devices, terminalId: terminalId };
141
+ }, function (_a) {
142
+ var devices = _a.devices, terminalId = _a.terminalId;
143
+ var terminal = devices === null || devices === void 0 ? void 0 : devices.pos_terminals.find(function (i) { return i.pos_terminal_id === terminalId; });
144
+ return terminal || null;
145
+ });
146
+ export var selectKioskShowPrint = createSelector(function (state) {
147
+ var devices = state.kiosk.devices;
148
+ var terminalId = state.pos.terminalId;
149
+ return { devices: devices, terminalId: terminalId };
150
+ }, function (_a) {
151
+ var devices = _a.devices, terminalId = _a.terminalId;
152
+ var terminal = devices === null || devices === void 0 ? void 0 : devices.pos_terminals.find(function (i) { return i.pos_terminal_id === terminalId; });
153
+ if (!terminal)
154
+ return false;
155
+ var print_receipt = terminal.print_receipt, printers = terminal.printers;
156
+ if (print_receipt === 'never' || !printers.length)
157
+ return false;
158
+ return true;
159
+ });
137
160
  export var selectKioskApi = createSelector(function (state) {
138
161
  var app = state.kiosk.app;
139
162
  return app;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
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",
@@ -58,9 +58,9 @@
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@emotion/react": "^11.11.1",
61
- "@open-tender/types": "^0.4.42",
61
+ "@open-tender/types": "^0.4.43",
62
62
  "@open-tender/ui": "^0.2.1",
63
- "@open-tender/utils": "^0.4.20",
63
+ "@open-tender/utils": "^0.4.23",
64
64
  "@reduxjs/toolkit": "^2.0.1",
65
65
  "date-fns": "2.30.0",
66
66
  "date-fns-tz": "^2.0.0",