@open-tender/store 0.6.1 → 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 ADDED
Binary file
@@ -17,7 +17,7 @@ declare class PosAPI {
17
17
  postCardCancel(): Promise<null | undefined>;
18
18
  getBarcodeRead(): Promise<DeviceRead | null | undefined>;
19
19
  postBarcodeCancel(): Promise<null | undefined>;
20
- getSettings(posSettingType: PosSettingType): Promise<any>;
20
+ getSettings<T>(posSettingType: PosSettingType): Promise<T | null | undefined>;
21
21
  postSettings(posSettingType: PosSettingType): Promise<Settings | null | undefined>;
22
22
  getInternalSettings(): Promise<InternalSettings | null | undefined>;
23
23
  postInternalSettings(data: InternalSettings): Promise<InternalSettings | null | undefined>;
@@ -1,4 +1,4 @@
1
- import { IpAddress, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
1
+ import { Devices, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
2
2
  import { AppState } from '../app';
3
3
  export interface ConfigApp {
4
4
  apiUrl: string;
@@ -7,14 +7,15 @@ export interface ConfigState {
7
7
  api: any;
8
8
  app: ConfigApp | null;
9
9
  version?: string | null;
10
- name: string | null;
11
- ipAddress: IpAddress | null;
12
- hasPinpad: boolean;
13
- hasCashDrawer: boolean;
10
+ devices: Devices | null;
14
11
  store: Store | null;
15
12
  revenueCenterId: number | null;
16
13
  selectOptions: SelectOptions | null;
17
14
  menuColors: MenuColors | null;
15
+ name: string | null;
16
+ ipAddress: string | null;
17
+ hasPinpad: boolean;
18
+ hasCashDrawer: boolean;
18
19
  loading: RequestStatus;
19
20
  error: RequestError | null;
20
21
  retries: number;
@@ -32,12 +33,12 @@ export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithou
32
33
  export declare const selectConfig: (state: AppState) => ConfigState;
33
34
  export declare const selectApi: (state: AppState) => any;
34
35
  export declare const selectVersion: (state: AppState) => string | null | undefined;
35
- export declare const selectPinpad: (state: AppState) => boolean;
36
- export declare const selectCashDrawer: (state: AppState) => boolean;
37
36
  export declare const selectRevenueCenterId: (state: AppState) => number | null;
38
37
  export declare const selectStore: (state: AppState) => Store | null;
39
38
  export declare const selectSelectOptions: (state: AppState) => SelectOptions;
40
39
  export declare const selectMenuColors: (state: AppState) => MenuColors;
41
40
  export declare const selectTimezone: (state: AppState) => Timezone;
42
41
  export declare const selectLoyalty: (state: AppState) => boolean;
42
+ export declare const selectPinpad: (state: AppState) => boolean;
43
+ export declare const selectCashDrawer: (state: AppState) => boolean;
43
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.selectCashDrawer = exports.selectPinpad = 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");
@@ -10,18 +10,21 @@ var utils_1 = require("../utils");
10
10
  var errors_1 = require("../services/errors");
11
11
  var pos_1 = require("./pos");
12
12
  var kds_1 = require("./kds");
13
+ // const defaultApiUrl = `http://${window.location.hostname}:5001/pos-api`
13
14
  var initialState = {
15
+ // api: new PosAPI({ apiUrl: defaultApiUrl }),
14
16
  api: null,
15
17
  app: null,
16
18
  version: null,
17
- name: null,
18
- ipAddress: null,
19
- hasPinpad: false,
20
- hasCashDrawer: false,
19
+ devices: null,
21
20
  store: null,
22
21
  revenueCenterId: null,
23
22
  selectOptions: null,
24
23
  menuColors: null,
24
+ name: null,
25
+ ipAddress: null,
26
+ hasPinpad: false,
27
+ hasCashDrawer: false,
25
28
  loading: 'idle',
26
29
  error: null,
27
30
  retries: 0
@@ -34,73 +37,68 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
34
37
  var apiUrl = _a.apiUrl;
35
38
  var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
36
39
  return tslib_1.__awaiter(void 0, void 0, void 0, function () {
37
- var app, api, _c,
40
+ var app, api, _c, _d,
38
41
  // config,
39
- store, _d,
40
- // selectOptions = null,
41
- // menuColors = null,
42
- itemTypes, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, selectOptions, menuColors, err_2;
43
- return tslib_1.__generator(this, function (_e) {
44
- switch (_e.label) {
42
+ devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
43
+ return tslib_1.__generator(this, function (_h) {
44
+ switch (_h.label) {
45
45
  case 0:
46
- _e.trys.push([0, 6, , 7]);
46
+ _h.trys.push([0, 6, , 7]);
47
47
  app = { apiUrl: apiUrl };
48
48
  api = new services_1.PosAPI(app);
49
49
  return [4 /*yield*/, Promise.all([
50
50
  // api.getConfig(),
51
- api.getStore(),
52
- // api.getSelectOptions(),
51
+ api.getSettings('DEVICES'),
52
+ api.getSettings('STORE'),
53
+ api.getSettings('SELECT_OPTION'),
54
+ api.getSettings('ITEM_TYPE')
53
55
  // api.getMenuColors(),
54
- api.getItemTypes()
55
56
  ])];
56
57
  case 1:
57
- _c = _e.sent(), store = _c[0], _d = _c[1], itemTypes = _d === void 0 ? null : _d;
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;
58
60
  if (!store) {
59
61
  err = errors_1.errorsApi.internalServerError;
60
62
  return [2 /*return*/, rejectWithValue(err)];
61
63
  }
62
64
  cashier = getState().pos.cashier;
63
65
  if (!!cashier) return [3 /*break*/, 5];
64
- _e.label = 2;
66
+ _h.label = 2;
65
67
  case 2:
66
- _e.trys.push([2, 4, , 5]);
68
+ _h.trys.push([2, 4, , 5]);
67
69
  return [4 /*yield*/, api.getCashier()];
68
70
  case 3:
69
- employee = _e.sent();
71
+ employee = _h.sent();
70
72
  tz = utils_1.timezoneMap[store.timezone];
71
73
  businessDate = (0, utils_1.currentLocalDateStr)(tz);
72
74
  dispatch((0, pos_1.setCashier)(tslib_1.__assign(tslib_1.__assign({}, employee), { businessDate: businessDate })));
73
75
  return [3 /*break*/, 5];
74
76
  case 4:
75
- err_1 = _e.sent();
77
+ err_1 = _h.sent();
76
78
  return [3 /*break*/, 5];
77
79
  case 5:
78
80
  revenueCenterId = store.revenue_center_id;
79
- name_1 = null;
80
- ipAddress = null;
81
- hasPinpad = false;
82
- hasCashDrawer = false;
83
- selectOptions = null;
84
- menuColors = null;
85
81
  dispatch((0, kds_1.setKdsItemTypes)(itemTypes));
86
- // dispatch(setKdsPrepStations(prep_stations))
82
+ dispatch((0, kds_1.setKdsPrepStations)(devices === null || devices === void 0 ? void 0 : devices.prep_stations));
83
+ menuColors = [];
87
84
  return [2 /*return*/, {
88
85
  api: api,
89
86
  app: app,
87
+ devices: devices,
90
88
  store: store,
91
89
  revenueCenterId: revenueCenterId,
92
- name: name_1,
93
- ipAddress: ipAddress,
94
- hasPinpad: hasPinpad,
95
- hasCashDrawer: hasCashDrawer,
96
90
  selectOptions: selectOptions,
97
91
  menuColors: menuColors,
92
+ name: 'Name',
93
+ ipAddress: '10.0.0.1',
94
+ hasPinpad: false,
95
+ hasCashDrawer: false,
98
96
  error: null,
99
97
  loading: 'idle',
100
98
  retries: 0
101
99
  }];
102
100
  case 6:
103
- err_2 = _e.sent();
101
+ err_2 = _h.sent();
104
102
  return [2 /*return*/, rejectWithValue(err_2)];
105
103
  case 7: return [2 /*return*/];
106
104
  }
@@ -131,15 +129,12 @@ var configSlice = (0, toolkit_1.createSlice)({
131
129
  state.loading = 'pending';
132
130
  })
133
131
  .addCase(exports.fetchConfig.fulfilled, function (state, action) {
134
- var _a = action.payload, api = _a.api, app = _a.app, store = _a.store, revenueCenterId = _a.revenueCenterId, name = _a.name, ipAddress = _a.ipAddress, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer, selectOptions = _a.selectOptions, menuColors = _a.menuColors;
132
+ var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, revenueCenterId = _a.revenueCenterId, selectOptions = _a.selectOptions, menuColors = _a.menuColors;
135
133
  state.api = api;
136
134
  state.app = app;
137
135
  state.store = store;
136
+ state.devices = devices;
138
137
  state.revenueCenterId = revenueCenterId;
139
- state.name = name;
140
- state.ipAddress = ipAddress;
141
- state.hasPinpad = hasPinpad;
142
- state.hasCashDrawer = hasCashDrawer;
143
138
  state.selectOptions = selectOptions;
144
139
  state.menuColors = menuColors;
145
140
  state.loading = 'idle';
@@ -159,10 +154,6 @@ var selectApi = function (state) { return state.config.api; };
159
154
  exports.selectApi = selectApi;
160
155
  var selectVersion = function (state) { return state.config.version; };
161
156
  exports.selectVersion = selectVersion;
162
- var selectPinpad = function (state) { return state.config.hasPinpad; };
163
- exports.selectPinpad = selectPinpad;
164
- var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
165
- exports.selectCashDrawer = selectCashDrawer;
166
157
  var selectRevenueCenterId = function (state) {
167
158
  return state.config.revenueCenterId;
168
159
  };
@@ -187,4 +178,8 @@ var selectLoyalty = function (state) {
187
178
  return state.config.store ? state.config.store.has_loyalty : false;
188
179
  };
189
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;
190
185
  exports.configReducer = configSlice.reducer;
@@ -235,7 +235,7 @@ export declare const selectKdsItemTypes: (state: AppState) => ItemTypes | null;
235
235
  export declare const selectKdsPrepStations: (state: AppState) => PrepStations;
236
236
  export declare const selectKdsPrepStationId: (state: AppState) => number | null;
237
237
  export declare const selectKdsPrepStation: (state: AppState) => PrepStation | null;
238
- export declare const selectKdsPrepType: (state: AppState) => import("../types").KdsPrepType | null;
238
+ export declare const selectKdsPrepType: (state: AppState) => import("../types").PrepStationPrepType | null;
239
239
  export declare const selectKdsOrderType: (state: AppState) => KdsOrderType;
240
240
  export declare const selectKdsColumns: (state: AppState) => number;
241
241
  export declare const selectKdsBoxes: (state: AppState) => number;
@@ -398,7 +398,7 @@ exports.kdsSlice = (0, toolkit_1.createSlice)({
398
398
  .map(function (i) { return (tslib_1.__assign(tslib_1.__assign({}, i), { fireAt: (0, utils_1.isoToDate)(i.fire_at, tz) })); })
399
399
  .sort(function (a, b) { return a.fireAt.getTime() - b.fireAt.getTime(); });
400
400
  // const counts = makeKdsCounts(state.itemTypes, orders)
401
- var stationCounts = (0, utils_1.makeKdsStationCounts)(updatedOrders, state.prepStations);
401
+ var stationCounts = (0, utils_1.makeKdsStationCounts)(updatedOrders, state.prepStations || []);
402
402
  var order = state.order ? updated : null;
403
403
  return tslib_1.__assign(tslib_1.__assign({}, state), { orders: orders, order: order, stationCounts: stationCounts });
404
404
  }
@@ -525,7 +525,7 @@ exports.selectKdsPrepStationId = selectKdsPrepStationId;
525
525
  var selectKdsPrepStation = function (state) {
526
526
  var _a;
527
527
  var _b = state.kds, prepStations = _b.prepStations, prepStationId = _b.prepStationId;
528
- return (_a = prepStations.find(function (i) { return i.prep_station_id === prepStationId; })) !== null && _a !== void 0 ? _a : null;
528
+ return (_a = prepStations === null || prepStations === void 0 ? void 0 : prepStations.find(function (i) { return i.prep_station_id === prepStationId; })) !== null && _a !== void 0 ? _a : null;
529
529
  };
530
530
  exports.selectKdsPrepStation = selectKdsPrepStation;
531
531
  var selectKdsPrepType = function (state) {
@@ -1,5 +1,6 @@
1
1
  import { IpAddress } from '../global';
2
- import { PrepStations, PrepStatus } from './kds';
2
+ import { PrepStations } from './devices';
3
+ import { PrepStatus } from './kds';
3
4
  export interface Config {
4
5
  backup_printer_ip_address: IpAddress | null;
5
6
  backup_printer_use_beeper: boolean;
@@ -0,0 +1,88 @@
1
+ export interface PosPrinter {
2
+ backup_pos_printer_v2_id: number;
3
+ description: string;
4
+ ipv4_address: string;
5
+ name: string;
6
+ pos_printer_v2_id: number;
7
+ use_beeper: boolean;
8
+ }
9
+ export declare type PosPrinters = PosPrinter[];
10
+ export interface PosScanner {
11
+ description: string;
12
+ identifier: string;
13
+ name: string;
14
+ pos_scanner_id: number;
15
+ }
16
+ export declare type PosScanners = PosScanner[];
17
+ export declare type PosTerminalPrintReceipt = 'never' | 'always' | 'prompt';
18
+ export interface PosTerminal {
19
+ description: string;
20
+ name: string;
21
+ pos_chipdna_terminal_id: number | null;
22
+ pos_printer_v2_id: number | null;
23
+ pos_scanner: PosScanner;
24
+ pos_scanner_id: number | null;
25
+ pos_terminal_id: number;
26
+ print_kds: boolean;
27
+ print_receipt: PosTerminalPrintReceipt;
28
+ printer: PosPrinters;
29
+ }
30
+ export declare type PosTerminals = PosTerminal[];
31
+ export declare type PrepStationPrepType = 'ASSEMBLY' | 'EXPO';
32
+ export interface PrepStation {
33
+ assembly_done: boolean;
34
+ assembly_print: boolean;
35
+ expo_complete: boolean;
36
+ expo_complete_all: boolean;
37
+ expo_done_only: boolean;
38
+ expo_print: boolean;
39
+ expo_reset: boolean;
40
+ item_type_ids: number[];
41
+ name: string;
42
+ prep_station_id: number;
43
+ prep_type: PrepStationPrepType;
44
+ show_counts: boolean;
45
+ show_groups: boolean;
46
+ show_modifiers: boolean;
47
+ }
48
+ export declare type PrepStations = PrepStation[];
49
+ export interface KdsTerminal {
50
+ auto_print: boolean;
51
+ description: string;
52
+ kds_terminal_id: number;
53
+ name: string;
54
+ pos_printer_v2_id: number | null;
55
+ prep_stations: PrepStations;
56
+ printer: PosPrinters;
57
+ }
58
+ export declare type KdsTerminals = KdsTerminal[];
59
+ export interface PosServer {
60
+ ipv4_address: string;
61
+ name: string;
62
+ pos_server_id: number;
63
+ }
64
+ export declare type PosServers = PosServer[];
65
+ export interface PaymentTerminal {
66
+ api_key: string;
67
+ application_identifier: string;
68
+ description: string;
69
+ identifier: string;
70
+ is_active: boolean;
71
+ mac_address: string;
72
+ model: string;
73
+ name: string;
74
+ pos_chipdna_terminal_id: number;
75
+ revenue_center_id: number;
76
+ standby_message: string;
77
+ use_production: boolean;
78
+ }
79
+ export declare type PaymentTerminals = PaymentTerminal[];
80
+ export interface Devices {
81
+ kds_terminals: KdsTerminals;
82
+ pos_chipdna_terminals: PaymentTerminals;
83
+ pos_scanners: PosScanners;
84
+ pos_terminals: PosTerminals;
85
+ prep_stations: PrepStations;
86
+ printers: PosPrinters;
87
+ servers: PosServers;
88
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ export * from './checkout';
5
5
  export * from './config';
6
6
  export * from './customer';
7
7
  export * from './device';
8
+ export * from './devices';
8
9
  export * from './discounts';
9
10
  export * from './employee';
10
11
  export * from './errorAlerts';
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./checkout"), exports);
8
8
  tslib_1.__exportStar(require("./config"), exports);
9
9
  tslib_1.__exportStar(require("./customer"), exports);
10
10
  tslib_1.__exportStar(require("./device"), exports);
11
+ tslib_1.__exportStar(require("./devices"), exports);
11
12
  tslib_1.__exportStar(require("./discounts"), exports);
12
13
  tslib_1.__exportStar(require("./employee"), exports);
13
14
  tslib_1.__exportStar(require("./errorAlerts"), exports);
@@ -2,7 +2,6 @@ import { OrdersKds } from './order';
2
2
  export declare type DeviceFontSize = 'xsmall' | 'small' | 'medium' | 'large';
3
3
  export declare type DeviceColorScheme = 'dark' | 'light';
4
4
  export declare type KdsView = 'column' | 'grid' | 'list' | 'tiles';
5
- export declare type KdsPrepType = 'ASSEMBLY' | 'EXPO';
6
5
  export declare type KdsOrderType = 'CURRENT' | 'FUTURE' | 'COMPLETED' | 'INCOMPLETE';
7
6
  export declare type KdsAssemblyOptions = 'AUTO_PRINT' | 'PRINT_DONE' | 'MARK_DONE' | 'PRINT_AND_DONE' | null;
8
7
  export declare type PrepStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'COMPLETED' | 'FULFILLED';
@@ -10,33 +9,6 @@ export declare type PrepStatusMap = {
10
9
  [Property in PrepStatus]: PrepStatus;
11
10
  };
12
11
  export declare type TicketStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'COMPLETED';
13
- export interface PrepStation {
14
- prep_station_id: number;
15
- name: string;
16
- item_type_ids: number[] | null;
17
- prep_type: KdsPrepType;
18
- assembly_options: KdsAssemblyOptions;
19
- expo_done_only: boolean;
20
- expo_print: boolean;
21
- expo_reset: boolean;
22
- expo_complete: boolean;
23
- expo_complete_all: boolean;
24
- show_modifiers: boolean;
25
- show_groups: boolean;
26
- show_counts: boolean;
27
- }
28
- export declare type PrepStations = PrepStation[];
29
- export interface KdsTerminal {
30
- name: string;
31
- ipAddress: string;
32
- prepStations: PrepStations;
33
- defaultView: KdsView;
34
- columns: number;
35
- boxes: number;
36
- cardWidth: number;
37
- fontSize: DeviceFontSize;
38
- colorScheme: DeviceColorScheme;
39
- }
40
12
  export interface KdsStationOrderTypeCount {
41
13
  orders: number;
42
14
  tickets: number;
@@ -110,3 +110,4 @@ export interface Store {
110
110
  warning_minutes: number;
111
111
  week_start_day: Weekday;
112
112
  }
113
+ export declare type Stores = Store[];
@@ -1,4 +1,4 @@
1
- import { FetchOrdersAPIArgs, FetchOrdersArgs, HeaderColors, ItemType, ItemTypes, KdsOrderType, KdsPrepType, KdsStationCounts, KdsStationOrderTypeCount, ModifiersMetadata, Order, OrderBuckets, OrderCart, OrderItem, OrderItemCount, OrderKds, Orders, OrdersKds, OrderTickets, OrderTimes, PrepStation, PrepStations, PrepStatus, PrepStatusMap, Store, TicketGroups, Timezone } from '../types';
1
+ import { FetchOrdersAPIArgs, FetchOrdersArgs, HeaderColors, ItemType, ItemTypes, KdsOrderType, PrepStationPrepType, KdsStationCounts, KdsStationOrderTypeCount, ModifiersMetadata, Order, OrderBuckets, OrderCart, OrderItem, OrderItemCount, OrderKds, Orders, OrdersKds, OrderTickets, OrderTimes, PrepStation, PrepStations, PrepStatus, PrepStatusMap, Store, TicketGroups, Timezone } from '../types';
2
2
  export declare const prepStatus: PrepStatusMap;
3
3
  export declare const makeFetchOrdersArgs: ({ businessDate, receiptType, channelType, prepStatus, search, sortBy, sortDirection, parentOrderId }: FetchOrdersArgs) => FetchOrdersAPIArgs;
4
4
  export declare const notDone: (prep_status: PrepStatus) => boolean;
@@ -14,7 +14,7 @@ export declare const makeIncompleteOrders: (orders: OrdersKds) => OrdersKds;
14
14
  export declare const makeCompletedOrders: (orders: OrdersKds) => OrdersKds;
15
15
  export declare const makeOrdersOfType: (orders: OrdersKds, orderType: KdsOrderType) => OrdersKds;
16
16
  export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[] | null) => OrdersKds;
17
- export declare const filterOrdersByPrepType: (orders: OrdersKds, prepType: KdsPrepType) => OrdersKds;
17
+ export declare const filterOrdersByPrepType: (orders: OrdersKds, prepType: PrepStationPrepType) => OrdersKds;
18
18
  export declare const filterOrdersToday: (orders: OrdersKds) => OrdersKds;
19
19
  export declare const makeOrdersForPrepStation: (orders: OrdersKds, prepStation: PrepStation, orderType: KdsOrderType) => OrdersKds;
20
20
  export declare const makeOrderItemSignature: (item: OrderItem, withNotes?: boolean) => string;
@@ -32,7 +32,7 @@ export declare const makeCurrentAndFutureOrders: (orders: OrdersKds) => {
32
32
  current: OrdersKds;
33
33
  future: OrdersKds;
34
34
  };
35
- export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null, prepType: KdsPrepType) => KdsStationOrderTypeCount;
35
+ export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null, prepType: PrepStationPrepType) => KdsStationOrderTypeCount;
36
36
  export declare const makeKdsStationCounts: (orders: OrdersKds, prepStations: PrepStations) => KdsStationCounts;
37
37
  export declare const makeOrderBuckets: (orders: OrdersKds, tz: Timezone) => OrderBuckets;
38
38
  export declare const makeOrderBucketsCounts: (itemTypes?: ItemTypes, orders?: OrdersKds) => Record<string, number>;
@@ -17,7 +17,7 @@ declare class PosAPI {
17
17
  postCardCancel(): Promise<null | undefined>;
18
18
  getBarcodeRead(): Promise<DeviceRead | null | undefined>;
19
19
  postBarcodeCancel(): Promise<null | undefined>;
20
- getSettings(posSettingType: PosSettingType): Promise<any>;
20
+ getSettings<T>(posSettingType: PosSettingType): Promise<T | null | undefined>;
21
21
  postSettings(posSettingType: PosSettingType): Promise<Settings | null | undefined>;
22
22
  getInternalSettings(): Promise<InternalSettings | null | undefined>;
23
23
  postInternalSettings(data: InternalSettings): Promise<InternalSettings | null | undefined>;
@@ -1,4 +1,4 @@
1
- import { IpAddress, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
1
+ import { Devices, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
2
2
  import { AppState } from '../app';
3
3
  export interface ConfigApp {
4
4
  apiUrl: string;
@@ -7,14 +7,15 @@ export interface ConfigState {
7
7
  api: any;
8
8
  app: ConfigApp | null;
9
9
  version?: string | null;
10
- name: string | null;
11
- ipAddress: IpAddress | null;
12
- hasPinpad: boolean;
13
- hasCashDrawer: boolean;
10
+ devices: Devices | null;
14
11
  store: Store | null;
15
12
  revenueCenterId: number | null;
16
13
  selectOptions: SelectOptions | null;
17
14
  menuColors: MenuColors | null;
15
+ name: string | null;
16
+ ipAddress: string | null;
17
+ hasPinpad: boolean;
18
+ hasCashDrawer: boolean;
18
19
  loading: RequestStatus;
19
20
  error: RequestError | null;
20
21
  retries: number;
@@ -32,12 +33,12 @@ export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithou
32
33
  export declare const selectConfig: (state: AppState) => ConfigState;
33
34
  export declare const selectApi: (state: AppState) => any;
34
35
  export declare const selectVersion: (state: AppState) => string | null | undefined;
35
- export declare const selectPinpad: (state: AppState) => boolean;
36
- export declare const selectCashDrawer: (state: AppState) => boolean;
37
36
  export declare const selectRevenueCenterId: (state: AppState) => number | null;
38
37
  export declare const selectStore: (state: AppState) => Store | null;
39
38
  export declare const selectSelectOptions: (state: AppState) => SelectOptions;
40
39
  export declare const selectMenuColors: (state: AppState) => MenuColors;
41
40
  export declare const selectTimezone: (state: AppState) => Timezone;
42
41
  export declare const selectLoyalty: (state: AppState) => boolean;
42
+ export declare const selectPinpad: (state: AppState) => boolean;
43
+ export declare const selectCashDrawer: (state: AppState) => boolean;
43
44
  export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
@@ -6,19 +6,22 @@ import { ReducerType } from './types';
6
6
  import { timezoneMap, getUserTimezone, currentLocalDateStr } from '../utils';
7
7
  import { errorsApi } from '../services/errors';
8
8
  import { setCashier } from './pos';
9
- import { setKdsItemTypes } from './kds';
9
+ import { setKdsItemTypes, setKdsPrepStations } from './kds';
10
+ // const defaultApiUrl = `http://${window.location.hostname}:5001/pos-api`
10
11
  var initialState = {
12
+ // api: new PosAPI({ apiUrl: defaultApiUrl }),
11
13
  api: null,
12
14
  app: null,
13
15
  version: null,
14
- name: null,
15
- ipAddress: null,
16
- hasPinpad: false,
17
- hasCashDrawer: false,
16
+ devices: null,
18
17
  store: null,
19
18
  revenueCenterId: null,
20
19
  selectOptions: null,
21
20
  menuColors: null,
21
+ name: null,
22
+ ipAddress: null,
23
+ hasPinpad: false,
24
+ hasCashDrawer: false,
22
25
  loading: 'idle',
23
26
  error: null,
24
27
  retries: 0
@@ -31,73 +34,68 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
31
34
  var apiUrl = _a.apiUrl;
32
35
  var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
33
36
  return __awaiter(void 0, void 0, void 0, function () {
34
- var app, api, _c,
37
+ var app, api, _c, _d,
35
38
  // config,
36
- store, _d,
37
- // selectOptions = null,
38
- // menuColors = null,
39
- itemTypes, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, selectOptions, menuColors, err_2;
40
- return __generator(this, function (_e) {
41
- switch (_e.label) {
39
+ devices, _e, stores, _f, selectOptions, _g, itemTypes, store, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, menuColors, err_2;
40
+ return __generator(this, function (_h) {
41
+ switch (_h.label) {
42
42
  case 0:
43
- _e.trys.push([0, 6, , 7]);
43
+ _h.trys.push([0, 6, , 7]);
44
44
  app = { apiUrl: apiUrl };
45
45
  api = new PosAPI(app);
46
46
  return [4 /*yield*/, Promise.all([
47
47
  // api.getConfig(),
48
- api.getStore(),
49
- // api.getSelectOptions(),
48
+ api.getSettings('DEVICES'),
49
+ api.getSettings('STORE'),
50
+ api.getSettings('SELECT_OPTION'),
51
+ api.getSettings('ITEM_TYPE')
50
52
  // api.getMenuColors(),
51
- api.getItemTypes()
52
53
  ])];
53
54
  case 1:
54
- _c = _e.sent(), store = _c[0], _d = _c[1], itemTypes = _d === void 0 ? null : _d;
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;
55
57
  if (!store) {
56
58
  err = errorsApi.internalServerError;
57
59
  return [2 /*return*/, rejectWithValue(err)];
58
60
  }
59
61
  cashier = getState().pos.cashier;
60
62
  if (!!cashier) return [3 /*break*/, 5];
61
- _e.label = 2;
63
+ _h.label = 2;
62
64
  case 2:
63
- _e.trys.push([2, 4, , 5]);
65
+ _h.trys.push([2, 4, , 5]);
64
66
  return [4 /*yield*/, api.getCashier()];
65
67
  case 3:
66
- employee = _e.sent();
68
+ employee = _h.sent();
67
69
  tz = timezoneMap[store.timezone];
68
70
  businessDate = currentLocalDateStr(tz);
69
71
  dispatch(setCashier(__assign(__assign({}, employee), { businessDate: businessDate })));
70
72
  return [3 /*break*/, 5];
71
73
  case 4:
72
- err_1 = _e.sent();
74
+ err_1 = _h.sent();
73
75
  return [3 /*break*/, 5];
74
76
  case 5:
75
77
  revenueCenterId = store.revenue_center_id;
76
- name_1 = null;
77
- ipAddress = null;
78
- hasPinpad = false;
79
- hasCashDrawer = false;
80
- selectOptions = null;
81
- menuColors = null;
82
78
  dispatch(setKdsItemTypes(itemTypes));
83
- // dispatch(setKdsPrepStations(prep_stations))
79
+ dispatch(setKdsPrepStations(devices === null || devices === void 0 ? void 0 : devices.prep_stations));
80
+ menuColors = [];
84
81
  return [2 /*return*/, {
85
82
  api: api,
86
83
  app: app,
84
+ devices: devices,
87
85
  store: store,
88
86
  revenueCenterId: revenueCenterId,
89
- name: name_1,
90
- ipAddress: ipAddress,
91
- hasPinpad: hasPinpad,
92
- hasCashDrawer: hasCashDrawer,
93
87
  selectOptions: selectOptions,
94
88
  menuColors: menuColors,
89
+ name: 'Name',
90
+ ipAddress: '10.0.0.1',
91
+ hasPinpad: false,
92
+ hasCashDrawer: false,
95
93
  error: null,
96
94
  loading: 'idle',
97
95
  retries: 0
98
96
  }];
99
97
  case 6:
100
- err_2 = _e.sent();
98
+ err_2 = _h.sent();
101
99
  return [2 /*return*/, rejectWithValue(err_2)];
102
100
  case 7: return [2 /*return*/];
103
101
  }
@@ -128,15 +126,12 @@ var configSlice = createSlice({
128
126
  state.loading = 'pending';
129
127
  })
130
128
  .addCase(fetchConfig.fulfilled, function (state, action) {
131
- var _a = action.payload, api = _a.api, app = _a.app, store = _a.store, revenueCenterId = _a.revenueCenterId, name = _a.name, ipAddress = _a.ipAddress, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer, selectOptions = _a.selectOptions, menuColors = _a.menuColors;
129
+ var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, revenueCenterId = _a.revenueCenterId, selectOptions = _a.selectOptions, menuColors = _a.menuColors;
132
130
  state.api = api;
133
131
  state.app = app;
134
132
  state.store = store;
133
+ state.devices = devices;
135
134
  state.revenueCenterId = revenueCenterId;
136
- state.name = name;
137
- state.ipAddress = ipAddress;
138
- state.hasPinpad = hasPinpad;
139
- state.hasCashDrawer = hasCashDrawer;
140
135
  state.selectOptions = selectOptions;
141
136
  state.menuColors = menuColors;
142
137
  state.loading = 'idle';
@@ -153,8 +148,6 @@ export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetrie
153
148
  export var selectConfig = function (state) { return state.config; };
154
149
  export var selectApi = function (state) { return state.config.api; };
155
150
  export var selectVersion = function (state) { return state.config.version; };
156
- export var selectPinpad = function (state) { return state.config.hasPinpad; };
157
- export var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
158
151
  export var selectRevenueCenterId = function (state) {
159
152
  return state.config.revenueCenterId;
160
153
  };
@@ -173,4 +166,6 @@ export var selectTimezone = function (state) {
173
166
  export var selectLoyalty = function (state) {
174
167
  return state.config.store ? state.config.store.has_loyalty : false;
175
168
  };
169
+ export var selectPinpad = function (state) { return state.config.hasPinpad; };
170
+ export var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
176
171
  export var configReducer = configSlice.reducer;
@@ -235,7 +235,7 @@ export declare const selectKdsItemTypes: (state: AppState) => ItemTypes | null;
235
235
  export declare const selectKdsPrepStations: (state: AppState) => PrepStations;
236
236
  export declare const selectKdsPrepStationId: (state: AppState) => number | null;
237
237
  export declare const selectKdsPrepStation: (state: AppState) => PrepStation | null;
238
- export declare const selectKdsPrepType: (state: AppState) => import("../types").KdsPrepType | null;
238
+ export declare const selectKdsPrepType: (state: AppState) => import("../types").PrepStationPrepType | null;
239
239
  export declare const selectKdsOrderType: (state: AppState) => KdsOrderType;
240
240
  export declare const selectKdsColumns: (state: AppState) => number;
241
241
  export declare const selectKdsBoxes: (state: AppState) => number;
@@ -394,7 +394,7 @@ export var kdsSlice = createSlice({
394
394
  .map(function (i) { return (__assign(__assign({}, i), { fireAt: isoToDate(i.fire_at, tz) })); })
395
395
  .sort(function (a, b) { return a.fireAt.getTime() - b.fireAt.getTime(); });
396
396
  // const counts = makeKdsCounts(state.itemTypes, orders)
397
- var stationCounts = makeKdsStationCounts(updatedOrders, state.prepStations);
397
+ var stationCounts = makeKdsStationCounts(updatedOrders, state.prepStations || []);
398
398
  var order = state.order ? updated : null;
399
399
  return __assign(__assign({}, state), { orders: orders, order: order, stationCounts: stationCounts });
400
400
  }
@@ -517,7 +517,7 @@ export var selectKdsPrepStationId = function (state) {
517
517
  export var selectKdsPrepStation = function (state) {
518
518
  var _a;
519
519
  var _b = state.kds, prepStations = _b.prepStations, prepStationId = _b.prepStationId;
520
- return (_a = prepStations.find(function (i) { return i.prep_station_id === prepStationId; })) !== null && _a !== void 0 ? _a : null;
520
+ return (_a = prepStations === null || prepStations === void 0 ? void 0 : prepStations.find(function (i) { return i.prep_station_id === prepStationId; })) !== null && _a !== void 0 ? _a : null;
521
521
  };
522
522
  export var selectKdsPrepType = function (state) {
523
523
  var prepStation = selectKdsPrepStation(state);
@@ -1,5 +1,6 @@
1
1
  import { IpAddress } from '../global';
2
- import { PrepStations, PrepStatus } from './kds';
2
+ import { PrepStations } from './devices';
3
+ import { PrepStatus } from './kds';
3
4
  export interface Config {
4
5
  backup_printer_ip_address: IpAddress | null;
5
6
  backup_printer_use_beeper: boolean;
@@ -0,0 +1,88 @@
1
+ export interface PosPrinter {
2
+ backup_pos_printer_v2_id: number;
3
+ description: string;
4
+ ipv4_address: string;
5
+ name: string;
6
+ pos_printer_v2_id: number;
7
+ use_beeper: boolean;
8
+ }
9
+ export declare type PosPrinters = PosPrinter[];
10
+ export interface PosScanner {
11
+ description: string;
12
+ identifier: string;
13
+ name: string;
14
+ pos_scanner_id: number;
15
+ }
16
+ export declare type PosScanners = PosScanner[];
17
+ export declare type PosTerminalPrintReceipt = 'never' | 'always' | 'prompt';
18
+ export interface PosTerminal {
19
+ description: string;
20
+ name: string;
21
+ pos_chipdna_terminal_id: number | null;
22
+ pos_printer_v2_id: number | null;
23
+ pos_scanner: PosScanner;
24
+ pos_scanner_id: number | null;
25
+ pos_terminal_id: number;
26
+ print_kds: boolean;
27
+ print_receipt: PosTerminalPrintReceipt;
28
+ printer: PosPrinters;
29
+ }
30
+ export declare type PosTerminals = PosTerminal[];
31
+ export declare type PrepStationPrepType = 'ASSEMBLY' | 'EXPO';
32
+ export interface PrepStation {
33
+ assembly_done: boolean;
34
+ assembly_print: boolean;
35
+ expo_complete: boolean;
36
+ expo_complete_all: boolean;
37
+ expo_done_only: boolean;
38
+ expo_print: boolean;
39
+ expo_reset: boolean;
40
+ item_type_ids: number[];
41
+ name: string;
42
+ prep_station_id: number;
43
+ prep_type: PrepStationPrepType;
44
+ show_counts: boolean;
45
+ show_groups: boolean;
46
+ show_modifiers: boolean;
47
+ }
48
+ export declare type PrepStations = PrepStation[];
49
+ export interface KdsTerminal {
50
+ auto_print: boolean;
51
+ description: string;
52
+ kds_terminal_id: number;
53
+ name: string;
54
+ pos_printer_v2_id: number | null;
55
+ prep_stations: PrepStations;
56
+ printer: PosPrinters;
57
+ }
58
+ export declare type KdsTerminals = KdsTerminal[];
59
+ export interface PosServer {
60
+ ipv4_address: string;
61
+ name: string;
62
+ pos_server_id: number;
63
+ }
64
+ export declare type PosServers = PosServer[];
65
+ export interface PaymentTerminal {
66
+ api_key: string;
67
+ application_identifier: string;
68
+ description: string;
69
+ identifier: string;
70
+ is_active: boolean;
71
+ mac_address: string;
72
+ model: string;
73
+ name: string;
74
+ pos_chipdna_terminal_id: number;
75
+ revenue_center_id: number;
76
+ standby_message: string;
77
+ use_production: boolean;
78
+ }
79
+ export declare type PaymentTerminals = PaymentTerminal[];
80
+ export interface Devices {
81
+ kds_terminals: KdsTerminals;
82
+ pos_chipdna_terminals: PaymentTerminals;
83
+ pos_scanners: PosScanners;
84
+ pos_terminals: PosTerminals;
85
+ prep_stations: PrepStations;
86
+ printers: PosPrinters;
87
+ servers: PosServers;
88
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -5,6 +5,7 @@ export * from './checkout';
5
5
  export * from './config';
6
6
  export * from './customer';
7
7
  export * from './device';
8
+ export * from './devices';
8
9
  export * from './discounts';
9
10
  export * from './employee';
10
11
  export * from './errorAlerts';
@@ -5,6 +5,7 @@ export * from './checkout';
5
5
  export * from './config';
6
6
  export * from './customer';
7
7
  export * from './device';
8
+ export * from './devices';
8
9
  export * from './discounts';
9
10
  export * from './employee';
10
11
  export * from './errorAlerts';
@@ -2,7 +2,6 @@ import { OrdersKds } from './order';
2
2
  export declare type DeviceFontSize = 'xsmall' | 'small' | 'medium' | 'large';
3
3
  export declare type DeviceColorScheme = 'dark' | 'light';
4
4
  export declare type KdsView = 'column' | 'grid' | 'list' | 'tiles';
5
- export declare type KdsPrepType = 'ASSEMBLY' | 'EXPO';
6
5
  export declare type KdsOrderType = 'CURRENT' | 'FUTURE' | 'COMPLETED' | 'INCOMPLETE';
7
6
  export declare type KdsAssemblyOptions = 'AUTO_PRINT' | 'PRINT_DONE' | 'MARK_DONE' | 'PRINT_AND_DONE' | null;
8
7
  export declare type PrepStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'COMPLETED' | 'FULFILLED';
@@ -10,33 +9,6 @@ export declare type PrepStatusMap = {
10
9
  [Property in PrepStatus]: PrepStatus;
11
10
  };
12
11
  export declare type TicketStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'COMPLETED';
13
- export interface PrepStation {
14
- prep_station_id: number;
15
- name: string;
16
- item_type_ids: number[] | null;
17
- prep_type: KdsPrepType;
18
- assembly_options: KdsAssemblyOptions;
19
- expo_done_only: boolean;
20
- expo_print: boolean;
21
- expo_reset: boolean;
22
- expo_complete: boolean;
23
- expo_complete_all: boolean;
24
- show_modifiers: boolean;
25
- show_groups: boolean;
26
- show_counts: boolean;
27
- }
28
- export declare type PrepStations = PrepStation[];
29
- export interface KdsTerminal {
30
- name: string;
31
- ipAddress: string;
32
- prepStations: PrepStations;
33
- defaultView: KdsView;
34
- columns: number;
35
- boxes: number;
36
- cardWidth: number;
37
- fontSize: DeviceFontSize;
38
- colorScheme: DeviceColorScheme;
39
- }
40
12
  export interface KdsStationOrderTypeCount {
41
13
  orders: number;
42
14
  tickets: number;
@@ -110,3 +110,4 @@ export interface Store {
110
110
  warning_minutes: number;
111
111
  week_start_day: Weekday;
112
112
  }
113
+ export declare type Stores = Store[];
@@ -1,4 +1,4 @@
1
- import { FetchOrdersAPIArgs, FetchOrdersArgs, HeaderColors, ItemType, ItemTypes, KdsOrderType, KdsPrepType, KdsStationCounts, KdsStationOrderTypeCount, ModifiersMetadata, Order, OrderBuckets, OrderCart, OrderItem, OrderItemCount, OrderKds, Orders, OrdersKds, OrderTickets, OrderTimes, PrepStation, PrepStations, PrepStatus, PrepStatusMap, Store, TicketGroups, Timezone } from '../types';
1
+ import { FetchOrdersAPIArgs, FetchOrdersArgs, HeaderColors, ItemType, ItemTypes, KdsOrderType, PrepStationPrepType, KdsStationCounts, KdsStationOrderTypeCount, ModifiersMetadata, Order, OrderBuckets, OrderCart, OrderItem, OrderItemCount, OrderKds, Orders, OrdersKds, OrderTickets, OrderTimes, PrepStation, PrepStations, PrepStatus, PrepStatusMap, Store, TicketGroups, Timezone } from '../types';
2
2
  export declare const prepStatus: PrepStatusMap;
3
3
  export declare const makeFetchOrdersArgs: ({ businessDate, receiptType, channelType, prepStatus, search, sortBy, sortDirection, parentOrderId }: FetchOrdersArgs) => FetchOrdersAPIArgs;
4
4
  export declare const notDone: (prep_status: PrepStatus) => boolean;
@@ -14,7 +14,7 @@ export declare const makeIncompleteOrders: (orders: OrdersKds) => OrdersKds;
14
14
  export declare const makeCompletedOrders: (orders: OrdersKds) => OrdersKds;
15
15
  export declare const makeOrdersOfType: (orders: OrdersKds, orderType: KdsOrderType) => OrdersKds;
16
16
  export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[] | null) => OrdersKds;
17
- export declare const filterOrdersByPrepType: (orders: OrdersKds, prepType: KdsPrepType) => OrdersKds;
17
+ export declare const filterOrdersByPrepType: (orders: OrdersKds, prepType: PrepStationPrepType) => OrdersKds;
18
18
  export declare const filterOrdersToday: (orders: OrdersKds) => OrdersKds;
19
19
  export declare const makeOrdersForPrepStation: (orders: OrdersKds, prepStation: PrepStation, orderType: KdsOrderType) => OrdersKds;
20
20
  export declare const makeOrderItemSignature: (item: OrderItem, withNotes?: boolean) => string;
@@ -32,7 +32,7 @@ export declare const makeCurrentAndFutureOrders: (orders: OrdersKds) => {
32
32
  current: OrdersKds;
33
33
  future: OrdersKds;
34
34
  };
35
- export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null, prepType: KdsPrepType) => KdsStationOrderTypeCount;
35
+ export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null, prepType: PrepStationPrepType) => KdsStationOrderTypeCount;
36
36
  export declare const makeKdsStationCounts: (orders: OrdersKds, prepStations: PrepStations) => KdsStationCounts;
37
37
  export declare const makeOrderBuckets: (orders: OrdersKds, tz: Timezone) => OrderBuckets;
38
38
  export declare const makeOrderBucketsCounts: (itemTypes?: ItemTypes, orders?: OrdersKds) => Record<string, number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.6.1",
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",