@orderingstack/ordering-types 1.1.6 → 1.1.8
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/index.d.ts +21 -0
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/kiosk.d.ts +18 -2
- package/dist/cjs/kioskErrors.d.ts +146 -0
- package/dist/cjs/kioskErrors.js +144 -0
- package/dist/esm/index.d.ts +21 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/kiosk.d.ts +18 -2
- package/dist/esm/kioskErrors.d.ts +146 -0
- package/dist/esm/kioskErrors.js +141 -0
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./kiosk";
|
|
2
|
+
export * from "./kioskErrors";
|
|
2
3
|
export interface IRestaurant {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
@@ -487,3 +488,23 @@ export interface IFiscalizeData {
|
|
|
487
488
|
}
|
|
488
489
|
declare const sizes: readonly [48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900];
|
|
489
490
|
export type TMediaSize = typeof sizes[number];
|
|
491
|
+
export declare enum ENotificationType {
|
|
492
|
+
ORDER_EVENT_ERROR = "OrderEventError",
|
|
493
|
+
ORDER_APPLIED_EVENTS = "OrderAppliedEvents",
|
|
494
|
+
ORDER_EVENT_FISCAL = "OrderEventFiscal",
|
|
495
|
+
ORDER_UPSELL = "OrderUpsell"
|
|
496
|
+
}
|
|
497
|
+
export type TUpsellKind = 'ANY' | 'POPUP' | 'SIDE' | 'BASKET';
|
|
498
|
+
export interface IUpsellNotification {
|
|
499
|
+
details: {
|
|
500
|
+
literals?: Record<string, string>;
|
|
501
|
+
media?: {
|
|
502
|
+
url?: string;
|
|
503
|
+
name: string;
|
|
504
|
+
}[];
|
|
505
|
+
};
|
|
506
|
+
orderId: string;
|
|
507
|
+
items: string[];
|
|
508
|
+
showAs: TUpsellKind;
|
|
509
|
+
type: ENotificationType.ORDER_UPSELL;
|
|
510
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.EChannelName = exports.EOrderProductKind = exports.EOrderLineStatus = exports.EOrderSource = exports.EOrderPaymentType = exports.EOrderStatus = exports.EOrderType = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
|
|
17
|
+
exports.ENotificationType = exports.EChannelName = exports.EOrderProductKind = exports.EOrderLineStatus = exports.EOrderSource = exports.EOrderPaymentType = exports.EOrderStatus = exports.EOrderType = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
|
|
18
18
|
__exportStar(require("./kiosk"), exports);
|
|
19
|
+
__exportStar(require("./kioskErrors"), exports);
|
|
19
20
|
var ECouponViewType;
|
|
20
21
|
(function (ECouponViewType) {
|
|
21
22
|
ECouponViewType["CAROUSEL"] = "carousel";
|
|
@@ -129,3 +130,10 @@ var EChannelName;
|
|
|
129
130
|
const sizes = [
|
|
130
131
|
48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900,
|
|
131
132
|
];
|
|
133
|
+
var ENotificationType;
|
|
134
|
+
(function (ENotificationType) {
|
|
135
|
+
ENotificationType["ORDER_EVENT_ERROR"] = "OrderEventError";
|
|
136
|
+
ENotificationType["ORDER_APPLIED_EVENTS"] = "OrderAppliedEvents";
|
|
137
|
+
ENotificationType["ORDER_EVENT_FISCAL"] = "OrderEventFiscal";
|
|
138
|
+
ENotificationType["ORDER_UPSELL"] = "OrderUpsell";
|
|
139
|
+
})(ENotificationType = exports.ENotificationType || (exports.ENotificationType = {}));
|
package/dist/cjs/kiosk.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import { UseFormRegisterReturn } from "react-hook-form";
|
|
3
3
|
import { UseTransitionProps } from "react-spring";
|
|
4
|
-
import { IProduct, IOrder, IProductStateSelected, IProductStateFilter } from "./index";
|
|
4
|
+
import { IProduct, IOrder, IProductStateSelected, IProductStateFilter, EOrderPaymentType, IKioskError, TUpsellKind } from "./index";
|
|
5
5
|
import { IOrderLine } from "./index";
|
|
6
6
|
export declare enum EPaymentStatus {
|
|
7
7
|
UNINITIALIZED = "UNINITIALIZED",
|
|
@@ -191,7 +191,7 @@ export interface IMenuComponentProps {
|
|
|
191
191
|
menu: IProduct[];
|
|
192
192
|
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
193
193
|
goToCheckout: (state?: any) => void;
|
|
194
|
-
goToStart: (state?: any) => void;
|
|
194
|
+
goToStart: (state?: any, statusInfo?: string, inactivity?: boolean) => void;
|
|
195
195
|
order?: IOrder;
|
|
196
196
|
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
197
197
|
components: IMenuComponents & {
|
|
@@ -200,3 +200,19 @@ export interface IMenuComponentProps {
|
|
|
200
200
|
currency?: string;
|
|
201
201
|
timeZone?: string;
|
|
202
202
|
}
|
|
203
|
+
export interface ICheckoutComponentProps {
|
|
204
|
+
checkoutStatus?: EPaymentStatus;
|
|
205
|
+
checkoutError?: IKioskError;
|
|
206
|
+
initializePayment: (type: EOrderPaymentType) => void;
|
|
207
|
+
initializePrinting: () => void;
|
|
208
|
+
navigateToMainScreen: () => void;
|
|
209
|
+
removeLines: (line: IOrderLine | IOrderLine[]) => void;
|
|
210
|
+
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
211
|
+
order?: IOrder;
|
|
212
|
+
addProduct: (product: IProduct, data: IAddToCartData) => void;
|
|
213
|
+
getUpsellProducts: () => Promise<IProduct[]>;
|
|
214
|
+
haveUpsellProducts: (kind?: TUpsellKind) => boolean;
|
|
215
|
+
onCheckoutBegun: () => void;
|
|
216
|
+
abandonOrder: (statusInfo?: string) => void;
|
|
217
|
+
currency: string;
|
|
218
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export declare const KioskErrors: {
|
|
2
|
+
"10": string;
|
|
3
|
+
"11": string;
|
|
4
|
+
"12": string;
|
|
5
|
+
"20": string;
|
|
6
|
+
"21": string;
|
|
7
|
+
"22": string;
|
|
8
|
+
"23": string;
|
|
9
|
+
"30": string;
|
|
10
|
+
"31": string;
|
|
11
|
+
"40": string;
|
|
12
|
+
"41": string;
|
|
13
|
+
"42": string;
|
|
14
|
+
"43": string;
|
|
15
|
+
"50": string;
|
|
16
|
+
"101": string;
|
|
17
|
+
"102": string;
|
|
18
|
+
"103": string;
|
|
19
|
+
"104": string;
|
|
20
|
+
"105": string;
|
|
21
|
+
"106": string;
|
|
22
|
+
"107": string;
|
|
23
|
+
"108": string;
|
|
24
|
+
"109": string;
|
|
25
|
+
"110": string;
|
|
26
|
+
"111": string;
|
|
27
|
+
"112": string;
|
|
28
|
+
"113": string;
|
|
29
|
+
"114": string;
|
|
30
|
+
"115": string;
|
|
31
|
+
"116": string;
|
|
32
|
+
"117": string;
|
|
33
|
+
"118": string;
|
|
34
|
+
"119": string;
|
|
35
|
+
"120": string;
|
|
36
|
+
"121": string;
|
|
37
|
+
"130": string;
|
|
38
|
+
"140": string;
|
|
39
|
+
"141": string;
|
|
40
|
+
"142": string;
|
|
41
|
+
"143": string;
|
|
42
|
+
"150": string;
|
|
43
|
+
"201": string;
|
|
44
|
+
"202": string;
|
|
45
|
+
"203": string;
|
|
46
|
+
"204": string;
|
|
47
|
+
"205": string;
|
|
48
|
+
"206": string;
|
|
49
|
+
"207": string;
|
|
50
|
+
"208": string;
|
|
51
|
+
"209": string;
|
|
52
|
+
"210": string;
|
|
53
|
+
"211": string;
|
|
54
|
+
"212": string;
|
|
55
|
+
"213": string;
|
|
56
|
+
"214": string;
|
|
57
|
+
"215": string;
|
|
58
|
+
"216": string;
|
|
59
|
+
"217": string;
|
|
60
|
+
"218": string;
|
|
61
|
+
"219": string;
|
|
62
|
+
"220": string;
|
|
63
|
+
"221": string;
|
|
64
|
+
"230": string;
|
|
65
|
+
"240": string;
|
|
66
|
+
"241": string;
|
|
67
|
+
"242": string;
|
|
68
|
+
"243": string;
|
|
69
|
+
"250": string;
|
|
70
|
+
"301": string;
|
|
71
|
+
"302": string;
|
|
72
|
+
"303": string;
|
|
73
|
+
"304": string;
|
|
74
|
+
"305": string;
|
|
75
|
+
"306": string;
|
|
76
|
+
"307": string;
|
|
77
|
+
"308": string;
|
|
78
|
+
"309": string;
|
|
79
|
+
"310": string;
|
|
80
|
+
"311": string;
|
|
81
|
+
"312": string;
|
|
82
|
+
"313": string;
|
|
83
|
+
"314": string;
|
|
84
|
+
"315": string;
|
|
85
|
+
"316": string;
|
|
86
|
+
"317": string;
|
|
87
|
+
"318": string;
|
|
88
|
+
"319": string;
|
|
89
|
+
"320": string;
|
|
90
|
+
"321": string;
|
|
91
|
+
"330": string;
|
|
92
|
+
"340": string;
|
|
93
|
+
"341": string;
|
|
94
|
+
"342": string;
|
|
95
|
+
"343": string;
|
|
96
|
+
"350": string;
|
|
97
|
+
"401": string;
|
|
98
|
+
"402": string;
|
|
99
|
+
"409": string;
|
|
100
|
+
"410": string;
|
|
101
|
+
"411": string;
|
|
102
|
+
"415": string;
|
|
103
|
+
"440": string;
|
|
104
|
+
"441": string;
|
|
105
|
+
"442": string;
|
|
106
|
+
"443": string;
|
|
107
|
+
"460": string;
|
|
108
|
+
"461": string;
|
|
109
|
+
"462": string;
|
|
110
|
+
"463": string;
|
|
111
|
+
"464": string;
|
|
112
|
+
"470": string;
|
|
113
|
+
"471": string;
|
|
114
|
+
"472": string;
|
|
115
|
+
"473": string;
|
|
116
|
+
"502": string;
|
|
117
|
+
"580": string;
|
|
118
|
+
"581": string;
|
|
119
|
+
"582": string;
|
|
120
|
+
"590": string;
|
|
121
|
+
"591": string;
|
|
122
|
+
"592": string;
|
|
123
|
+
"593": string;
|
|
124
|
+
"670": string;
|
|
125
|
+
"680": string;
|
|
126
|
+
"690": string;
|
|
127
|
+
"691": string;
|
|
128
|
+
"692": string;
|
|
129
|
+
"701": string;
|
|
130
|
+
"702": string;
|
|
131
|
+
x1: string;
|
|
132
|
+
x2: string;
|
|
133
|
+
x3: string;
|
|
134
|
+
x4: string;
|
|
135
|
+
x5: string;
|
|
136
|
+
x6: string;
|
|
137
|
+
x7: string;
|
|
138
|
+
x500: string;
|
|
139
|
+
x501: string;
|
|
140
|
+
};
|
|
141
|
+
export type TErrorCode = keyof typeof KioskErrors;
|
|
142
|
+
export interface IKioskError {
|
|
143
|
+
errorType: string;
|
|
144
|
+
errorCode: TErrorCode;
|
|
145
|
+
errorDesc: string;
|
|
146
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KioskErrors = void 0;
|
|
4
|
+
exports.KioskErrors = {
|
|
5
|
+
"10": "Connection error with ResPos",
|
|
6
|
+
"11": "Connection error with the database",
|
|
7
|
+
"12": "Error reading / writing data in the kiosk repository on the local disk",
|
|
8
|
+
"20": "Error updating menu (no connection, wrong product definitions)",
|
|
9
|
+
"21": "Error updating a single product in the menu",
|
|
10
|
+
"22": "Can not read the menu from the local kiosk repository",
|
|
11
|
+
"23": "Error updating menu due to server error",
|
|
12
|
+
"30": "Error when placing an order",
|
|
13
|
+
"31": "Error when canceling the order",
|
|
14
|
+
"40": "JavaScript Error reported by the kiosk UI",
|
|
15
|
+
"41": "Hardware Error reported by the kiosk UI",
|
|
16
|
+
"42": "Versions not compatible (KioskAPI , M4B API, Frontend)",
|
|
17
|
+
"43": "Problem connecting to the APIs",
|
|
18
|
+
"50": "Unknown error",
|
|
19
|
+
"101": "No printer connected to the port (automatic configuration not possible)",
|
|
20
|
+
"102": "The printer is not ready",
|
|
21
|
+
"103": "No power",
|
|
22
|
+
"104": "Low paper",
|
|
23
|
+
"105": "Invalid printer status: in the menu",
|
|
24
|
+
"106": "Invalid printer status: waiting for a key",
|
|
25
|
+
"107": "Invalid printer status: waiting for user response",
|
|
26
|
+
"108": "Invalid printer status: other",
|
|
27
|
+
"109": "The printer is not responding",
|
|
28
|
+
"110": "Invalid printer status (error of the last command)",
|
|
29
|
+
"111": "Invalid printer mechanism status: lever raised",
|
|
30
|
+
"112": "Invalid printer mechanism status: no access to the mechanism",
|
|
31
|
+
"113": "Invalid printer mechanism status: raised cover",
|
|
32
|
+
"114": "Invalid printer mechanism status: no paper - copy",
|
|
33
|
+
"115": "Invalid printer mechanism status: no paper - original",
|
|
34
|
+
"116": "Invalid printer mechanism status: incorrect temperature or power",
|
|
35
|
+
"117": "Invalid printer mechanism status: temporary power loss",
|
|
36
|
+
"118": "Invalid printer mechanism status: cutter error",
|
|
37
|
+
"119": "Invalid printer mechanism status: power supply error",
|
|
38
|
+
"120": "Invalid printer mechanism status: raised cover when cutting",
|
|
39
|
+
"121": "Invalid printer mechanism status: other",
|
|
40
|
+
"130": "Error in communication with the kiosk controller",
|
|
41
|
+
"140": "Terminal not ready",
|
|
42
|
+
"141": "Terminal error",
|
|
43
|
+
"142": "The terminal is not responding",
|
|
44
|
+
"143": "No connection to the terminal (port)",
|
|
45
|
+
"150": "The local server is not reachable",
|
|
46
|
+
"201": "No printer connected to the port (automatic configuration not possible)",
|
|
47
|
+
"202": "The printer is not ready",
|
|
48
|
+
"203": "No power",
|
|
49
|
+
"204": "Low paper",
|
|
50
|
+
"205": "Invalid printer status: in the menu",
|
|
51
|
+
"206": "Invalid printer status: waiting for a key",
|
|
52
|
+
"207": "Invalid printer status: waiting for user response",
|
|
53
|
+
"208": "Invalid printer status: other",
|
|
54
|
+
"209": "The printer is not responding",
|
|
55
|
+
"210": "Invalid printer status (error of the last command)",
|
|
56
|
+
"211": "Invalid printer mechanism status: lever raised",
|
|
57
|
+
"212": "Invalid printer mechanism status: no access to the mechanism",
|
|
58
|
+
"213": "Invalid printer mechanism status: raised cover",
|
|
59
|
+
"214": "Invalid printer mechanism status: no paper - copy",
|
|
60
|
+
"215": "Invalid printer mechanism status: no paper - original",
|
|
61
|
+
"216": "Invalid printer mechanism status: incorrect temperature or power",
|
|
62
|
+
"217": "Invalid printer mechanism status: temporary power loss",
|
|
63
|
+
"218": "Invalid printer mechanism status: cutter error",
|
|
64
|
+
"219": "Invalid printer mechanism status: power supply error",
|
|
65
|
+
"220": "Invalid printer mechanism status: raised cover when cutting",
|
|
66
|
+
"221": "Invalid printer mechanism status: other",
|
|
67
|
+
"230": "Error in communication with the kiosk controller",
|
|
68
|
+
"240": "Terminal not ready",
|
|
69
|
+
"241": "Terminal error",
|
|
70
|
+
"242": "The terminal is not responding",
|
|
71
|
+
"243": "No connection to the terminal (port)",
|
|
72
|
+
"250": "The local server is not reachable",
|
|
73
|
+
"301": "No printer connected to the port (automatic configuration not possible)",
|
|
74
|
+
"302": "The printer is not ready",
|
|
75
|
+
"303": "No power",
|
|
76
|
+
"304": "Low paper",
|
|
77
|
+
"305": "Invalid printer status: in the menu",
|
|
78
|
+
"306": "Invalid printer status: waiting for a key",
|
|
79
|
+
"307": "Invalid printer status: waiting for user response",
|
|
80
|
+
"308": "Invalid printer status: other",
|
|
81
|
+
"309": "The printer is not responding",
|
|
82
|
+
"310": "Invalid printer status (error of the last command)",
|
|
83
|
+
"311": "Invalid printer mechanism status: lever raised",
|
|
84
|
+
"312": "Invalid printer mechanism status: no access to the mechanism",
|
|
85
|
+
"313": "Invalid printer mechanism status: raised cover",
|
|
86
|
+
"314": "Invalid printer mechanism status: no paper - copy",
|
|
87
|
+
"315": "Invalid printer mechanism status: no paper - original",
|
|
88
|
+
"316": "Invalid printer mechanism status: incorrect temperature or power",
|
|
89
|
+
"317": "Invalid printer mechanism status: temporary power loss",
|
|
90
|
+
"318": "Invalid printer mechanism status: cutter error",
|
|
91
|
+
"319": "Invalid printer mechanism status: power supply error",
|
|
92
|
+
"320": "Invalid printer mechanism status: raised cover when cutting",
|
|
93
|
+
"321": "Invalid printer mechanism status: other",
|
|
94
|
+
"330": "Error in communication with the kiosk controller",
|
|
95
|
+
"340": "Terminal not ready",
|
|
96
|
+
"341": "Terminal error",
|
|
97
|
+
"342": "The terminal is not responding",
|
|
98
|
+
"343": "No connection to the terminal (port)",
|
|
99
|
+
"350": "The local server is not reachable",
|
|
100
|
+
"401": "The previous transaction has not been completed",
|
|
101
|
+
"402": "The printer is not ready",
|
|
102
|
+
"409": "The printer is not responding",
|
|
103
|
+
"410": "Invalid printer status (error of the last command)",
|
|
104
|
+
"411": "Invalid printer mechanism status",
|
|
105
|
+
"415": "There is no paper in the printer",
|
|
106
|
+
"440": "The terminal is not ready",
|
|
107
|
+
"441": "Terminal error",
|
|
108
|
+
"442": "The terminal is not responding",
|
|
109
|
+
"443": "No connection to the terminal",
|
|
110
|
+
"460": "The terminal returned an incorrect result *",
|
|
111
|
+
"461": "The terminal has returned transaction data that is already in the database *",
|
|
112
|
+
"462": "Transaction automatically canceled *",
|
|
113
|
+
"463": "Error during automatic transaction cancellation *",
|
|
114
|
+
"464": "Terminal stopped responding during transaction - if the transaction was successful, it will be reversed on reconnection",
|
|
115
|
+
"470": "Transaction rejected",
|
|
116
|
+
"471": "Problem connecting to the billing center",
|
|
117
|
+
"472": "Transaction canceled by the client",
|
|
118
|
+
"473": "The operation (request to initiate the transaction) failed",
|
|
119
|
+
"502": "The printer is not ready",
|
|
120
|
+
"580": "Error during printing payment confirming or receipt - transaction canceled",
|
|
121
|
+
"581": "Error during printing payment confirming or receipt + transaction cancellation error",
|
|
122
|
+
"582": "Error during printing order number (fiscalization correct)",
|
|
123
|
+
"590": "Error during printing - database error when searching for transaction",
|
|
124
|
+
"591": "Error during printing - transaction not found",
|
|
125
|
+
"592": "Error during printing - wrong transaction status (it's not valid for printing)",
|
|
126
|
+
"593": "Error during printing - transaction is being reversed",
|
|
127
|
+
"670": "Payment cancellation was unsuccessful",
|
|
128
|
+
"680": "Error while printing confirmation of payment cancellation",
|
|
129
|
+
"690": "Error when downloading data to cancel payment from DB",
|
|
130
|
+
"691": "The transaction indicated for cancellation does not exist in the database",
|
|
131
|
+
"692": "Inappropriate status of the transaction indicated for cancellation",
|
|
132
|
+
"701": "Setting open times unsuccesfull",
|
|
133
|
+
"702": "Time differs by more then 30 seconds",
|
|
134
|
+
// 3e errors
|
|
135
|
+
x1: "POS data timeout",
|
|
136
|
+
x2: "Order was cancelled",
|
|
137
|
+
x3: "Missing fiscal data",
|
|
138
|
+
x4: "Missing queuePos",
|
|
139
|
+
x5: "Missing transactionId",
|
|
140
|
+
x6: "OrderEvent timeout",
|
|
141
|
+
x7: "Received OrderEventError",
|
|
142
|
+
x500: "Unknown error",
|
|
143
|
+
x501: "Not implemented",
|
|
144
|
+
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./kiosk";
|
|
2
|
+
export * from "./kioskErrors";
|
|
2
3
|
export interface IRestaurant {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
@@ -487,3 +488,23 @@ export interface IFiscalizeData {
|
|
|
487
488
|
}
|
|
488
489
|
declare const sizes: readonly [48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900];
|
|
489
490
|
export type TMediaSize = typeof sizes[number];
|
|
491
|
+
export declare enum ENotificationType {
|
|
492
|
+
ORDER_EVENT_ERROR = "OrderEventError",
|
|
493
|
+
ORDER_APPLIED_EVENTS = "OrderAppliedEvents",
|
|
494
|
+
ORDER_EVENT_FISCAL = "OrderEventFiscal",
|
|
495
|
+
ORDER_UPSELL = "OrderUpsell"
|
|
496
|
+
}
|
|
497
|
+
export type TUpsellKind = 'ANY' | 'POPUP' | 'SIDE' | 'BASKET';
|
|
498
|
+
export interface IUpsellNotification {
|
|
499
|
+
details: {
|
|
500
|
+
literals?: Record<string, string>;
|
|
501
|
+
media?: {
|
|
502
|
+
url?: string;
|
|
503
|
+
name: string;
|
|
504
|
+
}[];
|
|
505
|
+
};
|
|
506
|
+
orderId: string;
|
|
507
|
+
items: string[];
|
|
508
|
+
showAs: TUpsellKind;
|
|
509
|
+
type: ENotificationType.ORDER_UPSELL;
|
|
510
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./kiosk";
|
|
2
|
+
export * from "./kioskErrors";
|
|
2
3
|
export var ECouponViewType;
|
|
3
4
|
(function (ECouponViewType) {
|
|
4
5
|
ECouponViewType["CAROUSEL"] = "carousel";
|
|
@@ -112,3 +113,10 @@ export var EChannelName;
|
|
|
112
113
|
const sizes = [
|
|
113
114
|
48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900,
|
|
114
115
|
];
|
|
116
|
+
export var ENotificationType;
|
|
117
|
+
(function (ENotificationType) {
|
|
118
|
+
ENotificationType["ORDER_EVENT_ERROR"] = "OrderEventError";
|
|
119
|
+
ENotificationType["ORDER_APPLIED_EVENTS"] = "OrderAppliedEvents";
|
|
120
|
+
ENotificationType["ORDER_EVENT_FISCAL"] = "OrderEventFiscal";
|
|
121
|
+
ENotificationType["ORDER_UPSELL"] = "OrderUpsell";
|
|
122
|
+
})(ENotificationType || (ENotificationType = {}));
|
package/dist/esm/kiosk.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import { UseFormRegisterReturn } from "react-hook-form";
|
|
3
3
|
import { UseTransitionProps } from "react-spring";
|
|
4
|
-
import { IProduct, IOrder, IProductStateSelected, IProductStateFilter } from "./index";
|
|
4
|
+
import { IProduct, IOrder, IProductStateSelected, IProductStateFilter, EOrderPaymentType, IKioskError, TUpsellKind } from "./index";
|
|
5
5
|
import { IOrderLine } from "./index";
|
|
6
6
|
export declare enum EPaymentStatus {
|
|
7
7
|
UNINITIALIZED = "UNINITIALIZED",
|
|
@@ -191,7 +191,7 @@ export interface IMenuComponentProps {
|
|
|
191
191
|
menu: IProduct[];
|
|
192
192
|
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
193
193
|
goToCheckout: (state?: any) => void;
|
|
194
|
-
goToStart: (state?: any) => void;
|
|
194
|
+
goToStart: (state?: any, statusInfo?: string, inactivity?: boolean) => void;
|
|
195
195
|
order?: IOrder;
|
|
196
196
|
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
197
197
|
components: IMenuComponents & {
|
|
@@ -200,3 +200,19 @@ export interface IMenuComponentProps {
|
|
|
200
200
|
currency?: string;
|
|
201
201
|
timeZone?: string;
|
|
202
202
|
}
|
|
203
|
+
export interface ICheckoutComponentProps {
|
|
204
|
+
checkoutStatus?: EPaymentStatus;
|
|
205
|
+
checkoutError?: IKioskError;
|
|
206
|
+
initializePayment: (type: EOrderPaymentType) => void;
|
|
207
|
+
initializePrinting: () => void;
|
|
208
|
+
navigateToMainScreen: () => void;
|
|
209
|
+
removeLines: (line: IOrderLine | IOrderLine[]) => void;
|
|
210
|
+
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
211
|
+
order?: IOrder;
|
|
212
|
+
addProduct: (product: IProduct, data: IAddToCartData) => void;
|
|
213
|
+
getUpsellProducts: () => Promise<IProduct[]>;
|
|
214
|
+
haveUpsellProducts: (kind?: TUpsellKind) => boolean;
|
|
215
|
+
onCheckoutBegun: () => void;
|
|
216
|
+
abandonOrder: (statusInfo?: string) => void;
|
|
217
|
+
currency: string;
|
|
218
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export declare const KioskErrors: {
|
|
2
|
+
"10": string;
|
|
3
|
+
"11": string;
|
|
4
|
+
"12": string;
|
|
5
|
+
"20": string;
|
|
6
|
+
"21": string;
|
|
7
|
+
"22": string;
|
|
8
|
+
"23": string;
|
|
9
|
+
"30": string;
|
|
10
|
+
"31": string;
|
|
11
|
+
"40": string;
|
|
12
|
+
"41": string;
|
|
13
|
+
"42": string;
|
|
14
|
+
"43": string;
|
|
15
|
+
"50": string;
|
|
16
|
+
"101": string;
|
|
17
|
+
"102": string;
|
|
18
|
+
"103": string;
|
|
19
|
+
"104": string;
|
|
20
|
+
"105": string;
|
|
21
|
+
"106": string;
|
|
22
|
+
"107": string;
|
|
23
|
+
"108": string;
|
|
24
|
+
"109": string;
|
|
25
|
+
"110": string;
|
|
26
|
+
"111": string;
|
|
27
|
+
"112": string;
|
|
28
|
+
"113": string;
|
|
29
|
+
"114": string;
|
|
30
|
+
"115": string;
|
|
31
|
+
"116": string;
|
|
32
|
+
"117": string;
|
|
33
|
+
"118": string;
|
|
34
|
+
"119": string;
|
|
35
|
+
"120": string;
|
|
36
|
+
"121": string;
|
|
37
|
+
"130": string;
|
|
38
|
+
"140": string;
|
|
39
|
+
"141": string;
|
|
40
|
+
"142": string;
|
|
41
|
+
"143": string;
|
|
42
|
+
"150": string;
|
|
43
|
+
"201": string;
|
|
44
|
+
"202": string;
|
|
45
|
+
"203": string;
|
|
46
|
+
"204": string;
|
|
47
|
+
"205": string;
|
|
48
|
+
"206": string;
|
|
49
|
+
"207": string;
|
|
50
|
+
"208": string;
|
|
51
|
+
"209": string;
|
|
52
|
+
"210": string;
|
|
53
|
+
"211": string;
|
|
54
|
+
"212": string;
|
|
55
|
+
"213": string;
|
|
56
|
+
"214": string;
|
|
57
|
+
"215": string;
|
|
58
|
+
"216": string;
|
|
59
|
+
"217": string;
|
|
60
|
+
"218": string;
|
|
61
|
+
"219": string;
|
|
62
|
+
"220": string;
|
|
63
|
+
"221": string;
|
|
64
|
+
"230": string;
|
|
65
|
+
"240": string;
|
|
66
|
+
"241": string;
|
|
67
|
+
"242": string;
|
|
68
|
+
"243": string;
|
|
69
|
+
"250": string;
|
|
70
|
+
"301": string;
|
|
71
|
+
"302": string;
|
|
72
|
+
"303": string;
|
|
73
|
+
"304": string;
|
|
74
|
+
"305": string;
|
|
75
|
+
"306": string;
|
|
76
|
+
"307": string;
|
|
77
|
+
"308": string;
|
|
78
|
+
"309": string;
|
|
79
|
+
"310": string;
|
|
80
|
+
"311": string;
|
|
81
|
+
"312": string;
|
|
82
|
+
"313": string;
|
|
83
|
+
"314": string;
|
|
84
|
+
"315": string;
|
|
85
|
+
"316": string;
|
|
86
|
+
"317": string;
|
|
87
|
+
"318": string;
|
|
88
|
+
"319": string;
|
|
89
|
+
"320": string;
|
|
90
|
+
"321": string;
|
|
91
|
+
"330": string;
|
|
92
|
+
"340": string;
|
|
93
|
+
"341": string;
|
|
94
|
+
"342": string;
|
|
95
|
+
"343": string;
|
|
96
|
+
"350": string;
|
|
97
|
+
"401": string;
|
|
98
|
+
"402": string;
|
|
99
|
+
"409": string;
|
|
100
|
+
"410": string;
|
|
101
|
+
"411": string;
|
|
102
|
+
"415": string;
|
|
103
|
+
"440": string;
|
|
104
|
+
"441": string;
|
|
105
|
+
"442": string;
|
|
106
|
+
"443": string;
|
|
107
|
+
"460": string;
|
|
108
|
+
"461": string;
|
|
109
|
+
"462": string;
|
|
110
|
+
"463": string;
|
|
111
|
+
"464": string;
|
|
112
|
+
"470": string;
|
|
113
|
+
"471": string;
|
|
114
|
+
"472": string;
|
|
115
|
+
"473": string;
|
|
116
|
+
"502": string;
|
|
117
|
+
"580": string;
|
|
118
|
+
"581": string;
|
|
119
|
+
"582": string;
|
|
120
|
+
"590": string;
|
|
121
|
+
"591": string;
|
|
122
|
+
"592": string;
|
|
123
|
+
"593": string;
|
|
124
|
+
"670": string;
|
|
125
|
+
"680": string;
|
|
126
|
+
"690": string;
|
|
127
|
+
"691": string;
|
|
128
|
+
"692": string;
|
|
129
|
+
"701": string;
|
|
130
|
+
"702": string;
|
|
131
|
+
x1: string;
|
|
132
|
+
x2: string;
|
|
133
|
+
x3: string;
|
|
134
|
+
x4: string;
|
|
135
|
+
x5: string;
|
|
136
|
+
x6: string;
|
|
137
|
+
x7: string;
|
|
138
|
+
x500: string;
|
|
139
|
+
x501: string;
|
|
140
|
+
};
|
|
141
|
+
export type TErrorCode = keyof typeof KioskErrors;
|
|
142
|
+
export interface IKioskError {
|
|
143
|
+
errorType: string;
|
|
144
|
+
errorCode: TErrorCode;
|
|
145
|
+
errorDesc: string;
|
|
146
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export const KioskErrors = {
|
|
2
|
+
"10": "Connection error with ResPos",
|
|
3
|
+
"11": "Connection error with the database",
|
|
4
|
+
"12": "Error reading / writing data in the kiosk repository on the local disk",
|
|
5
|
+
"20": "Error updating menu (no connection, wrong product definitions)",
|
|
6
|
+
"21": "Error updating a single product in the menu",
|
|
7
|
+
"22": "Can not read the menu from the local kiosk repository",
|
|
8
|
+
"23": "Error updating menu due to server error",
|
|
9
|
+
"30": "Error when placing an order",
|
|
10
|
+
"31": "Error when canceling the order",
|
|
11
|
+
"40": "JavaScript Error reported by the kiosk UI",
|
|
12
|
+
"41": "Hardware Error reported by the kiosk UI",
|
|
13
|
+
"42": "Versions not compatible (KioskAPI , M4B API, Frontend)",
|
|
14
|
+
"43": "Problem connecting to the APIs",
|
|
15
|
+
"50": "Unknown error",
|
|
16
|
+
"101": "No printer connected to the port (automatic configuration not possible)",
|
|
17
|
+
"102": "The printer is not ready",
|
|
18
|
+
"103": "No power",
|
|
19
|
+
"104": "Low paper",
|
|
20
|
+
"105": "Invalid printer status: in the menu",
|
|
21
|
+
"106": "Invalid printer status: waiting for a key",
|
|
22
|
+
"107": "Invalid printer status: waiting for user response",
|
|
23
|
+
"108": "Invalid printer status: other",
|
|
24
|
+
"109": "The printer is not responding",
|
|
25
|
+
"110": "Invalid printer status (error of the last command)",
|
|
26
|
+
"111": "Invalid printer mechanism status: lever raised",
|
|
27
|
+
"112": "Invalid printer mechanism status: no access to the mechanism",
|
|
28
|
+
"113": "Invalid printer mechanism status: raised cover",
|
|
29
|
+
"114": "Invalid printer mechanism status: no paper - copy",
|
|
30
|
+
"115": "Invalid printer mechanism status: no paper - original",
|
|
31
|
+
"116": "Invalid printer mechanism status: incorrect temperature or power",
|
|
32
|
+
"117": "Invalid printer mechanism status: temporary power loss",
|
|
33
|
+
"118": "Invalid printer mechanism status: cutter error",
|
|
34
|
+
"119": "Invalid printer mechanism status: power supply error",
|
|
35
|
+
"120": "Invalid printer mechanism status: raised cover when cutting",
|
|
36
|
+
"121": "Invalid printer mechanism status: other",
|
|
37
|
+
"130": "Error in communication with the kiosk controller",
|
|
38
|
+
"140": "Terminal not ready",
|
|
39
|
+
"141": "Terminal error",
|
|
40
|
+
"142": "The terminal is not responding",
|
|
41
|
+
"143": "No connection to the terminal (port)",
|
|
42
|
+
"150": "The local server is not reachable",
|
|
43
|
+
"201": "No printer connected to the port (automatic configuration not possible)",
|
|
44
|
+
"202": "The printer is not ready",
|
|
45
|
+
"203": "No power",
|
|
46
|
+
"204": "Low paper",
|
|
47
|
+
"205": "Invalid printer status: in the menu",
|
|
48
|
+
"206": "Invalid printer status: waiting for a key",
|
|
49
|
+
"207": "Invalid printer status: waiting for user response",
|
|
50
|
+
"208": "Invalid printer status: other",
|
|
51
|
+
"209": "The printer is not responding",
|
|
52
|
+
"210": "Invalid printer status (error of the last command)",
|
|
53
|
+
"211": "Invalid printer mechanism status: lever raised",
|
|
54
|
+
"212": "Invalid printer mechanism status: no access to the mechanism",
|
|
55
|
+
"213": "Invalid printer mechanism status: raised cover",
|
|
56
|
+
"214": "Invalid printer mechanism status: no paper - copy",
|
|
57
|
+
"215": "Invalid printer mechanism status: no paper - original",
|
|
58
|
+
"216": "Invalid printer mechanism status: incorrect temperature or power",
|
|
59
|
+
"217": "Invalid printer mechanism status: temporary power loss",
|
|
60
|
+
"218": "Invalid printer mechanism status: cutter error",
|
|
61
|
+
"219": "Invalid printer mechanism status: power supply error",
|
|
62
|
+
"220": "Invalid printer mechanism status: raised cover when cutting",
|
|
63
|
+
"221": "Invalid printer mechanism status: other",
|
|
64
|
+
"230": "Error in communication with the kiosk controller",
|
|
65
|
+
"240": "Terminal not ready",
|
|
66
|
+
"241": "Terminal error",
|
|
67
|
+
"242": "The terminal is not responding",
|
|
68
|
+
"243": "No connection to the terminal (port)",
|
|
69
|
+
"250": "The local server is not reachable",
|
|
70
|
+
"301": "No printer connected to the port (automatic configuration not possible)",
|
|
71
|
+
"302": "The printer is not ready",
|
|
72
|
+
"303": "No power",
|
|
73
|
+
"304": "Low paper",
|
|
74
|
+
"305": "Invalid printer status: in the menu",
|
|
75
|
+
"306": "Invalid printer status: waiting for a key",
|
|
76
|
+
"307": "Invalid printer status: waiting for user response",
|
|
77
|
+
"308": "Invalid printer status: other",
|
|
78
|
+
"309": "The printer is not responding",
|
|
79
|
+
"310": "Invalid printer status (error of the last command)",
|
|
80
|
+
"311": "Invalid printer mechanism status: lever raised",
|
|
81
|
+
"312": "Invalid printer mechanism status: no access to the mechanism",
|
|
82
|
+
"313": "Invalid printer mechanism status: raised cover",
|
|
83
|
+
"314": "Invalid printer mechanism status: no paper - copy",
|
|
84
|
+
"315": "Invalid printer mechanism status: no paper - original",
|
|
85
|
+
"316": "Invalid printer mechanism status: incorrect temperature or power",
|
|
86
|
+
"317": "Invalid printer mechanism status: temporary power loss",
|
|
87
|
+
"318": "Invalid printer mechanism status: cutter error",
|
|
88
|
+
"319": "Invalid printer mechanism status: power supply error",
|
|
89
|
+
"320": "Invalid printer mechanism status: raised cover when cutting",
|
|
90
|
+
"321": "Invalid printer mechanism status: other",
|
|
91
|
+
"330": "Error in communication with the kiosk controller",
|
|
92
|
+
"340": "Terminal not ready",
|
|
93
|
+
"341": "Terminal error",
|
|
94
|
+
"342": "The terminal is not responding",
|
|
95
|
+
"343": "No connection to the terminal (port)",
|
|
96
|
+
"350": "The local server is not reachable",
|
|
97
|
+
"401": "The previous transaction has not been completed",
|
|
98
|
+
"402": "The printer is not ready",
|
|
99
|
+
"409": "The printer is not responding",
|
|
100
|
+
"410": "Invalid printer status (error of the last command)",
|
|
101
|
+
"411": "Invalid printer mechanism status",
|
|
102
|
+
"415": "There is no paper in the printer",
|
|
103
|
+
"440": "The terminal is not ready",
|
|
104
|
+
"441": "Terminal error",
|
|
105
|
+
"442": "The terminal is not responding",
|
|
106
|
+
"443": "No connection to the terminal",
|
|
107
|
+
"460": "The terminal returned an incorrect result *",
|
|
108
|
+
"461": "The terminal has returned transaction data that is already in the database *",
|
|
109
|
+
"462": "Transaction automatically canceled *",
|
|
110
|
+
"463": "Error during automatic transaction cancellation *",
|
|
111
|
+
"464": "Terminal stopped responding during transaction - if the transaction was successful, it will be reversed on reconnection",
|
|
112
|
+
"470": "Transaction rejected",
|
|
113
|
+
"471": "Problem connecting to the billing center",
|
|
114
|
+
"472": "Transaction canceled by the client",
|
|
115
|
+
"473": "The operation (request to initiate the transaction) failed",
|
|
116
|
+
"502": "The printer is not ready",
|
|
117
|
+
"580": "Error during printing payment confirming or receipt - transaction canceled",
|
|
118
|
+
"581": "Error during printing payment confirming or receipt + transaction cancellation error",
|
|
119
|
+
"582": "Error during printing order number (fiscalization correct)",
|
|
120
|
+
"590": "Error during printing - database error when searching for transaction",
|
|
121
|
+
"591": "Error during printing - transaction not found",
|
|
122
|
+
"592": "Error during printing - wrong transaction status (it's not valid for printing)",
|
|
123
|
+
"593": "Error during printing - transaction is being reversed",
|
|
124
|
+
"670": "Payment cancellation was unsuccessful",
|
|
125
|
+
"680": "Error while printing confirmation of payment cancellation",
|
|
126
|
+
"690": "Error when downloading data to cancel payment from DB",
|
|
127
|
+
"691": "The transaction indicated for cancellation does not exist in the database",
|
|
128
|
+
"692": "Inappropriate status of the transaction indicated for cancellation",
|
|
129
|
+
"701": "Setting open times unsuccesfull",
|
|
130
|
+
"702": "Time differs by more then 30 seconds",
|
|
131
|
+
// 3e errors
|
|
132
|
+
x1: "POS data timeout",
|
|
133
|
+
x2: "Order was cancelled",
|
|
134
|
+
x3: "Missing fiscal data",
|
|
135
|
+
x4: "Missing queuePos",
|
|
136
|
+
x5: "Missing transactionId",
|
|
137
|
+
x6: "OrderEvent timeout",
|
|
138
|
+
x7: "Received OrderEventError",
|
|
139
|
+
x500: "Unknown error",
|
|
140
|
+
x501: "Not implemented",
|
|
141
|
+
};
|