@open-tender/store 0.8.4 → 0.8.5
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/cjs/services/api.d.ts +3 -4
- package/dist/cjs/services/api.js +4 -7
- package/dist/cjs/slices/config.d.ts +2 -2
- package/dist/cjs/types/api/config.d.ts +0 -26
- package/dist/esm/services/api.d.ts +3 -4
- package/dist/esm/services/api.js +4 -7
- package/dist/esm/slices/config.d.ts +2 -2
- package/dist/esm/types/api/config.d.ts +0 -26
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Arrivals, CashEvent, CashSummary,
|
|
2
|
-
export interface
|
|
1
|
+
import { Arrivals, CashEvent, CashSummary, CustomerCheckout, CustomerIdentifier, DeviceRead, Discount, Discounts, Employee, Employees, PosSettingType, ErrorAlert, ErrorAlerts, FetchOrdersAPIArgs, GiftCardBalance, GiftCardCredit, InternalSettings, ItemTypes, KioskConfig, LevelUp, Menu, MenuColors, MenuPages, OfflineAuths, OfflineAuthsResult, Order, OrderCreate, Orders, OrderTender, OrderType, OrderUpdate, Punch, Refund, RequestedAt, RevenueCenter, SelectOptions, ServiceType, Settings, Store, Surcharges, Taxes, Tender, TicketStatusUpdate, TicketsUpdate, TicketUpdate } from '../types';
|
|
2
|
+
export interface InitAPI {
|
|
3
3
|
apiUrl: string;
|
|
4
4
|
posTerminalId?: number;
|
|
5
5
|
kdsTerminalId?: number;
|
|
@@ -8,10 +8,9 @@ declare class PosAPI {
|
|
|
8
8
|
apiUrl: string;
|
|
9
9
|
posTerminalId?: number;
|
|
10
10
|
kdsTerminalId?: number;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(init: InitAPI);
|
|
12
12
|
request: <T>(endpoint: string, method?: string, data?: any) => Promise<T>;
|
|
13
13
|
post(endpoint: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
14
|
-
getConfig(): Promise<Config>;
|
|
15
14
|
getKioskConfig(): Promise<KioskConfig>;
|
|
16
15
|
getStore(): Promise<Store>;
|
|
17
16
|
getSelectOptions(): Promise<SelectOptions>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -63,7 +63,7 @@ var makeHeaders = function (posTerminalId, kdsTerminalId) {
|
|
|
63
63
|
return headers;
|
|
64
64
|
};
|
|
65
65
|
var PosAPI = /** @class */ (function () {
|
|
66
|
-
function PosAPI(
|
|
66
|
+
function PosAPI(init) {
|
|
67
67
|
var _this = this;
|
|
68
68
|
this.request = function (endpoint, method, data) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
69
69
|
var _this = this;
|
|
@@ -105,16 +105,13 @@ var PosAPI = /** @class */ (function () {
|
|
|
105
105
|
}); })];
|
|
106
106
|
});
|
|
107
107
|
}); };
|
|
108
|
-
this.apiUrl =
|
|
109
|
-
this.posTerminalId =
|
|
110
|
-
this.kdsTerminalId =
|
|
108
|
+
this.apiUrl = init.apiUrl;
|
|
109
|
+
this.posTerminalId = init.posTerminalId;
|
|
110
|
+
this.kdsTerminalId = init.kdsTerminalId;
|
|
111
111
|
}
|
|
112
112
|
PosAPI.prototype.post = function (endpoint, data) {
|
|
113
113
|
return this.request("/".concat(endpoint), 'POST', data);
|
|
114
114
|
};
|
|
115
|
-
PosAPI.prototype.getConfig = function () {
|
|
116
|
-
return this.request("/config");
|
|
117
|
-
};
|
|
118
115
|
PosAPI.prototype.getKioskConfig = function () {
|
|
119
116
|
return this.request("/config-kiosk");
|
|
120
117
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PosAPI } from '../services';
|
|
2
2
|
import { Devices, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
|
|
3
3
|
import { AppState } from '../app';
|
|
4
|
-
import {
|
|
4
|
+
import { InitAPI } from '../services/api';
|
|
5
5
|
export interface ConfigApp {
|
|
6
6
|
apiUrl: string;
|
|
7
7
|
}
|
|
@@ -36,7 +36,7 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
36
36
|
fulfilledMeta?: unknown;
|
|
37
37
|
rejectedMeta?: unknown;
|
|
38
38
|
}>;
|
|
39
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
|
39
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">;
|
|
40
40
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
41
41
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
42
42
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
import { IpAddress } from '../global';
|
|
2
|
-
import { PrepStations } from './devices';
|
|
3
1
|
import { PrepStatus } from './kds';
|
|
4
|
-
export interface Config {
|
|
5
|
-
backup_printer_ip_address: IpAddress | null;
|
|
6
|
-
backup_printer_use_beeper: boolean;
|
|
7
|
-
brand_id: number;
|
|
8
|
-
cardreader_id: string;
|
|
9
|
-
has_cardreader: boolean;
|
|
10
|
-
has_cardwriter: boolean;
|
|
11
|
-
has_cashdrawer: boolean;
|
|
12
|
-
has_pinpad: boolean;
|
|
13
|
-
has_qrcode: boolean;
|
|
14
|
-
has_timeclock: boolean;
|
|
15
|
-
ip_address: IpAddress;
|
|
16
|
-
name: string;
|
|
17
|
-
pos_server_id: number;
|
|
18
|
-
pos_terminal_id: number;
|
|
19
|
-
prep_stations?: PrepStations | null;
|
|
20
|
-
print_kds: boolean;
|
|
21
|
-
print_receipt: 'never' | 'always' | 'prompt';
|
|
22
|
-
printer: IpAddress;
|
|
23
|
-
printer_use_beeper: boolean;
|
|
24
|
-
scanner_id: string;
|
|
25
|
-
server: IpAddress;
|
|
26
|
-
terminal_type: 'POS_TERMINAL' | 'KDS_TERMINAL' | 'KIOSK';
|
|
27
|
-
}
|
|
28
2
|
export interface ItemType {
|
|
29
3
|
default_prep_status: PrepStatus;
|
|
30
4
|
display_order: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Arrivals, CashEvent, CashSummary,
|
|
2
|
-
export interface
|
|
1
|
+
import { Arrivals, CashEvent, CashSummary, CustomerCheckout, CustomerIdentifier, DeviceRead, Discount, Discounts, Employee, Employees, PosSettingType, ErrorAlert, ErrorAlerts, FetchOrdersAPIArgs, GiftCardBalance, GiftCardCredit, InternalSettings, ItemTypes, KioskConfig, LevelUp, Menu, MenuColors, MenuPages, OfflineAuths, OfflineAuthsResult, Order, OrderCreate, Orders, OrderTender, OrderType, OrderUpdate, Punch, Refund, RequestedAt, RevenueCenter, SelectOptions, ServiceType, Settings, Store, Surcharges, Taxes, Tender, TicketStatusUpdate, TicketsUpdate, TicketUpdate } from '../types';
|
|
2
|
+
export interface InitAPI {
|
|
3
3
|
apiUrl: string;
|
|
4
4
|
posTerminalId?: number;
|
|
5
5
|
kdsTerminalId?: number;
|
|
@@ -8,10 +8,9 @@ declare class PosAPI {
|
|
|
8
8
|
apiUrl: string;
|
|
9
9
|
posTerminalId?: number;
|
|
10
10
|
kdsTerminalId?: number;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(init: InitAPI);
|
|
12
12
|
request: <T>(endpoint: string, method?: string, data?: any) => Promise<T>;
|
|
13
13
|
post(endpoint: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
14
|
-
getConfig(): Promise<Config>;
|
|
15
14
|
getKioskConfig(): Promise<KioskConfig>;
|
|
16
15
|
getStore(): Promise<Store>;
|
|
17
16
|
getSelectOptions(): Promise<SelectOptions>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -61,7 +61,7 @@ var makeHeaders = function (posTerminalId, kdsTerminalId) {
|
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
var PosAPI = /** @class */ (function () {
|
|
64
|
-
function PosAPI(
|
|
64
|
+
function PosAPI(init) {
|
|
65
65
|
var _this = this;
|
|
66
66
|
this.request = function (endpoint, method, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
67
67
|
var _this = this;
|
|
@@ -103,16 +103,13 @@ var PosAPI = /** @class */ (function () {
|
|
|
103
103
|
}); })];
|
|
104
104
|
});
|
|
105
105
|
}); };
|
|
106
|
-
this.apiUrl =
|
|
107
|
-
this.posTerminalId =
|
|
108
|
-
this.kdsTerminalId =
|
|
106
|
+
this.apiUrl = init.apiUrl;
|
|
107
|
+
this.posTerminalId = init.posTerminalId;
|
|
108
|
+
this.kdsTerminalId = init.kdsTerminalId;
|
|
109
109
|
}
|
|
110
110
|
PosAPI.prototype.post = function (endpoint, data) {
|
|
111
111
|
return this.request("/".concat(endpoint), 'POST', data);
|
|
112
112
|
};
|
|
113
|
-
PosAPI.prototype.getConfig = function () {
|
|
114
|
-
return this.request("/config");
|
|
115
|
-
};
|
|
116
113
|
PosAPI.prototype.getKioskConfig = function () {
|
|
117
114
|
return this.request("/config-kiosk");
|
|
118
115
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PosAPI } from '../services';
|
|
2
2
|
import { Devices, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '../types';
|
|
3
3
|
import { AppState } from '../app';
|
|
4
|
-
import {
|
|
4
|
+
import { InitAPI } from '../services/api';
|
|
5
5
|
export interface ConfigApp {
|
|
6
6
|
apiUrl: string;
|
|
7
7
|
}
|
|
@@ -36,7 +36,7 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
36
36
|
fulfilledMeta?: unknown;
|
|
37
37
|
rejectedMeta?: unknown;
|
|
38
38
|
}>;
|
|
39
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
|
39
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">;
|
|
40
40
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
41
41
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
42
42
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
import { IpAddress } from '../global';
|
|
2
|
-
import { PrepStations } from './devices';
|
|
3
1
|
import { PrepStatus } from './kds';
|
|
4
|
-
export interface Config {
|
|
5
|
-
backup_printer_ip_address: IpAddress | null;
|
|
6
|
-
backup_printer_use_beeper: boolean;
|
|
7
|
-
brand_id: number;
|
|
8
|
-
cardreader_id: string;
|
|
9
|
-
has_cardreader: boolean;
|
|
10
|
-
has_cardwriter: boolean;
|
|
11
|
-
has_cashdrawer: boolean;
|
|
12
|
-
has_pinpad: boolean;
|
|
13
|
-
has_qrcode: boolean;
|
|
14
|
-
has_timeclock: boolean;
|
|
15
|
-
ip_address: IpAddress;
|
|
16
|
-
name: string;
|
|
17
|
-
pos_server_id: number;
|
|
18
|
-
pos_terminal_id: number;
|
|
19
|
-
prep_stations?: PrepStations | null;
|
|
20
|
-
print_kds: boolean;
|
|
21
|
-
print_receipt: 'never' | 'always' | 'prompt';
|
|
22
|
-
printer: IpAddress;
|
|
23
|
-
printer_use_beeper: boolean;
|
|
24
|
-
scanner_id: string;
|
|
25
|
-
server: IpAddress;
|
|
26
|
-
terminal_type: 'POS_TERMINAL' | 'KDS_TERMINAL' | 'KIOSK';
|
|
27
|
-
}
|
|
28
2
|
export interface ItemType {
|
|
29
3
|
default_prep_status: PrepStatus;
|
|
30
4
|
display_order: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
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",
|