@orderingstack/ordering-types 1.27.0 → 1.27.2
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/api.d.ts +2 -2
- package/dist/cjs/index.d.ts +13 -11
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/kioskErrors.d.ts +1 -1
- package/dist/cjs/src/api.d.ts +97 -0
- package/dist/cjs/src/api.js +12 -0
- package/dist/cjs/src/index.d.ts +599 -0
- package/dist/cjs/src/index.js +158 -0
- package/dist/cjs/src/kiosk.d.ts +239 -0
- package/dist/cjs/src/kiosk.js +15 -0
- package/dist/cjs/src/kioskErrors.d.ts +146 -0
- package/dist/cjs/src/kioskErrors.js +144 -0
- package/dist/esm/api.d.ts +2 -2
- package/dist/esm/index.d.ts +13 -11
- package/dist/esm/index.js +2 -0
- package/dist/esm/kioskErrors.d.ts +1 -1
- package/dist/esm/src/api.d.ts +97 -0
- package/dist/esm/src/api.js +9 -0
- package/dist/esm/src/index.d.ts +599 -0
- package/dist/esm/src/index.js +141 -0
- package/dist/esm/src/kiosk.d.ts +239 -0
- package/dist/esm/src/kiosk.js +12 -0
- package/dist/esm/src/kioskErrors.d.ts +146 -0
- package/dist/esm/src/kioskErrors.js +141 -0
- package/package.json +4 -3
package/dist/cjs/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EOrderPaymentType, EOrderStatus, EOrderType, IProductState, IStringKeyRecord } from "./index";
|
|
2
2
|
export declare const aggregators: readonly ["BOLT", "GLOVO", "JUSTEAT", "TAZZ", "UBER", "UPMENU", "WOLT", "_ANY_"];
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type TAggregator = typeof aggregators[number];
|
|
4
|
+
type TOrderDir = "DESC" | "ASC";
|
|
5
5
|
interface ApiParams {
|
|
6
6
|
query?: any;
|
|
7
7
|
headers?: IStringKeyRecord<string>;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export interface ILanguage {
|
|
|
39
39
|
key: string;
|
|
40
40
|
icon: any;
|
|
41
41
|
}
|
|
42
|
-
export
|
|
42
|
+
export type TStringBoolean = "true" | "false";
|
|
43
43
|
export declare enum EProductKind {
|
|
44
44
|
GROUP = "3e/group",
|
|
45
45
|
PRODUCT = "3e/product",
|
|
@@ -55,18 +55,18 @@ export declare enum EProductKindBucket {
|
|
|
55
55
|
GROUP = "group",
|
|
56
56
|
PRODUCT = "product"
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export type TLiterals = {
|
|
59
59
|
name: string;
|
|
60
60
|
upsizeName?: string;
|
|
61
61
|
fiscal?: string;
|
|
62
62
|
"target-product-id"?: string;
|
|
63
63
|
description?: string;
|
|
64
64
|
} & IStringKeyRecord<string | undefined>;
|
|
65
|
-
export
|
|
65
|
+
export type TMedia = {
|
|
66
66
|
url: string;
|
|
67
67
|
name: string;
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
type TDetails = {
|
|
70
70
|
literals?: TLiterals;
|
|
71
71
|
media?: TMedia[];
|
|
72
72
|
};
|
|
@@ -173,7 +173,7 @@ export interface IMenuCategory extends Pick<IMenuItem, "id" | "kind" | "_" | "__
|
|
|
173
173
|
export interface IMenuProduct extends IMenuItem {
|
|
174
174
|
kind: EProductKind.PRODUCT;
|
|
175
175
|
}
|
|
176
|
-
export
|
|
176
|
+
export type MenuProduct = IMenuCategory | ICmsReference | IStatic | IGroupConfig | IGroupOptions | IMenuProduct;
|
|
177
177
|
/**
|
|
178
178
|
* IProductFrontAttributes
|
|
179
179
|
*
|
|
@@ -301,8 +301,10 @@ export declare enum EOrderSource {
|
|
|
301
301
|
BOLT = "BOLT",
|
|
302
302
|
TAZZ = "TAZZ",
|
|
303
303
|
POS = "POS",
|
|
304
|
-
UPMENU = "UPMENU"
|
|
304
|
+
UPMENU = "UPMENU",
|
|
305
|
+
APP = "APP"
|
|
305
306
|
}
|
|
307
|
+
export declare const CHANNEL_NAMES: readonly ["DINE_IN", "TAKE_AWAY", "DELIVERY", "GLOVO", "JUSTEAT", "UBER", "BOLT", "WOLT", "TAZZ", "UPMENU"];
|
|
306
308
|
export declare enum EChannelName {
|
|
307
309
|
DINE_IN = "DINE_IN",
|
|
308
310
|
TAKE_AWAY = "TAKE_AWAY",
|
|
@@ -548,7 +550,7 @@ export interface ISubTotalDiscount {
|
|
|
548
550
|
discount: number;
|
|
549
551
|
vat: string;
|
|
550
552
|
}
|
|
551
|
-
export
|
|
553
|
+
export type IOrderGroupProduct = Pick<IOrderProduct, "kind" | "id" | "literals" | "items" | "extra">;
|
|
552
554
|
export interface IOrderProduct {
|
|
553
555
|
id: string;
|
|
554
556
|
kind: EOrderProductKind;
|
|
@@ -585,8 +587,8 @@ export declare enum EOrderProductKind {
|
|
|
585
587
|
export interface IProductLiterals {
|
|
586
588
|
[propName: string]: any;
|
|
587
589
|
}
|
|
588
|
-
|
|
589
|
-
export
|
|
590
|
+
type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
|
|
591
|
+
export type TSaleChannelWeek = Partial<Record<TWeekDay, {
|
|
590
592
|
from: string;
|
|
591
593
|
to: string;
|
|
592
594
|
}[]>>;
|
|
@@ -660,14 +662,14 @@ export interface IFiscalizeData {
|
|
|
660
662
|
};
|
|
661
663
|
}
|
|
662
664
|
export declare const sizes: readonly [48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900];
|
|
663
|
-
export
|
|
665
|
+
export type TMediaSize = (typeof sizes)[number];
|
|
664
666
|
export declare enum ENotificationType {
|
|
665
667
|
ORDER_EVENT_ERROR = "OrderEventError",
|
|
666
668
|
ORDER_APPLIED_EVENTS = "OrderAppliedEvents",
|
|
667
669
|
ORDER_EVENT_FISCAL = "OrderEventFiscal",
|
|
668
670
|
ORDER_UPSELL = "OrderUpsell"
|
|
669
671
|
}
|
|
670
|
-
export
|
|
672
|
+
export type TUpsellKind = "ANY" | "POPUP" | "SIDE" | "BASKET";
|
|
671
673
|
export interface IUpsellNotification {
|
|
672
674
|
details: {
|
|
673
675
|
literals?: IStringKeyRecord<string>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ 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.modules = exports.ENotificationType = exports.sizes = exports.EOrderProductKind = exports.EOrderLineStatus = exports.ERbiOrderExtra = exports.EOrderPaymentType = exports.EOrderStatus = exports.EChannelName = exports.EOrderSource = exports.EOrderType = exports.EOrderUserRole = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
|
|
17
|
+
exports.modules = exports.ENotificationType = exports.sizes = exports.EOrderProductKind = exports.EOrderLineStatus = exports.ERbiOrderExtra = exports.EOrderPaymentType = exports.EOrderStatus = exports.EChannelName = exports.CHANNEL_NAMES = exports.EOrderSource = exports.EOrderType = exports.EOrderUserRole = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
|
|
18
18
|
__exportStar(require("./kiosk"), exports);
|
|
19
19
|
__exportStar(require("./kioskErrors"), exports);
|
|
20
20
|
__exportStar(require("./api"), exports);
|
|
@@ -94,7 +94,9 @@ var EOrderSource;
|
|
|
94
94
|
EOrderSource["TAZZ"] = "TAZZ";
|
|
95
95
|
EOrderSource["POS"] = "POS";
|
|
96
96
|
EOrderSource["UPMENU"] = "UPMENU";
|
|
97
|
+
EOrderSource["APP"] = "APP";
|
|
97
98
|
})(EOrderSource = exports.EOrderSource || (exports.EOrderSource = {}));
|
|
99
|
+
exports.CHANNEL_NAMES = ["DINE_IN", "TAKE_AWAY", "DELIVERY", "GLOVO", "JUSTEAT", "UBER", "BOLT", "WOLT", "TAZZ", "UPMENU"];
|
|
98
100
|
var EChannelName;
|
|
99
101
|
(function (EChannelName) {
|
|
100
102
|
EChannelName["DINE_IN"] = "DINE_IN";
|
|
@@ -140,7 +140,7 @@ export declare const KioskErrors: {
|
|
|
140
140
|
x500: string;
|
|
141
141
|
x501: string;
|
|
142
142
|
};
|
|
143
|
-
export
|
|
143
|
+
export type TErrorCode = keyof typeof KioskErrors;
|
|
144
144
|
export interface IKioskError {
|
|
145
145
|
errorType: string;
|
|
146
146
|
errorCode: TErrorCode;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { EOrderPaymentType, EOrderStatus, EOrderType, IProductState, IStringKeyRecord } from "./index";
|
|
2
|
+
export declare const aggregators: readonly ["GLOVO", "JUSTEAT", "UBER", "WOLT", "BOLT", "TAZZ", "_ANY_"];
|
|
3
|
+
export type TAggregator = typeof aggregators[number];
|
|
4
|
+
type TOrderDir = "DESC" | "ASC";
|
|
5
|
+
interface ApiParams {
|
|
6
|
+
query?: any;
|
|
7
|
+
headers?: IStringKeyRecord<string>;
|
|
8
|
+
data?: any;
|
|
9
|
+
}
|
|
10
|
+
export interface IOrderApiGetListParams extends ApiParams {
|
|
11
|
+
query: {
|
|
12
|
+
_sort?: string;
|
|
13
|
+
_order?: TOrderDir;
|
|
14
|
+
_start?: number;
|
|
15
|
+
_end?: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
extId?: string;
|
|
18
|
+
status?: EOrderStatus;
|
|
19
|
+
type?: EOrderType;
|
|
20
|
+
completed?: boolean;
|
|
21
|
+
closed?: boolean;
|
|
22
|
+
phone?: string;
|
|
23
|
+
mail?: string;
|
|
24
|
+
createdFrom?: string;
|
|
25
|
+
createdTo?: string;
|
|
26
|
+
completedFrom?: string;
|
|
27
|
+
completedTo?: string;
|
|
28
|
+
venue?: string;
|
|
29
|
+
aggregator?: TAggregator;
|
|
30
|
+
payment?: EOrderPaymentType;
|
|
31
|
+
};
|
|
32
|
+
headers: {
|
|
33
|
+
"x-tenant"?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
interface IDiscount {
|
|
37
|
+
/**
|
|
38
|
+
* Discount layer. It is used to distinguish discounts from loyalty, manual discounts, etc.
|
|
39
|
+
* @pattern [a-zA-Z0-9_.-]+
|
|
40
|
+
*/
|
|
41
|
+
layer: string;
|
|
42
|
+
/**
|
|
43
|
+
* Name that describes this discount
|
|
44
|
+
* @minLength 0
|
|
45
|
+
* @maxLength 128
|
|
46
|
+
*/
|
|
47
|
+
name?: string;
|
|
48
|
+
/** Discount price (subtracted from line total) */
|
|
49
|
+
discountPrice: number;
|
|
50
|
+
/** Extra params */
|
|
51
|
+
extra?: IStringKeyRecord<string>;
|
|
52
|
+
type: string;
|
|
53
|
+
}
|
|
54
|
+
interface ILineDiscount {
|
|
55
|
+
/** Applied discounts */
|
|
56
|
+
discount: IDiscount;
|
|
57
|
+
/** @format date-time */
|
|
58
|
+
expires?: string;
|
|
59
|
+
/**
|
|
60
|
+
* @minLength 0
|
|
61
|
+
* @maxLength 128
|
|
62
|
+
* @pattern [a-zA-Z0-9_. -]+
|
|
63
|
+
*/
|
|
64
|
+
sign: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IAppendedLine {
|
|
67
|
+
/**
|
|
68
|
+
* @format int32
|
|
69
|
+
* @min 1
|
|
70
|
+
* @max 100000
|
|
71
|
+
*/
|
|
72
|
+
quantity: number;
|
|
73
|
+
/**
|
|
74
|
+
* One should not provide price - it will be automatically calculated. If user is privileged (internal system user or has role 'SU' or 'ALTERPRICE') OrderingStack will use provided price and override one from menu. Please be careful when providing value '0' as privileged user here! If you do not want to override price - do not provide 'price' attribute at all (null).
|
|
75
|
+
* @min 0
|
|
76
|
+
* @exclusiveMin false
|
|
77
|
+
*/
|
|
78
|
+
price?: number;
|
|
79
|
+
/** @pattern [a-zA-Z0-9_.-]+ */
|
|
80
|
+
productId: string;
|
|
81
|
+
/** Configuration of product */
|
|
82
|
+
productConfig?: IProductState;
|
|
83
|
+
/** @default "NEW" */
|
|
84
|
+
status: "NEW" | "CONFIRMED";
|
|
85
|
+
/**
|
|
86
|
+
* @minLength 0
|
|
87
|
+
* @maxLength 255
|
|
88
|
+
*/
|
|
89
|
+
comment?: string;
|
|
90
|
+
/**
|
|
91
|
+
* @maxItems 10
|
|
92
|
+
* @minItems 0
|
|
93
|
+
*/
|
|
94
|
+
discounts?: ILineDiscount[];
|
|
95
|
+
extra?: IStringKeyRecord<string>;
|
|
96
|
+
}
|
|
97
|
+
export {};
|