@orderingstack/ordering-types 1.23.0 → 1.24.1

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 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 declare type TAggregator = typeof aggregators[number];
4
- declare type TOrderDir = "DESC" | "ASC";
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>;
@@ -39,7 +39,7 @@ export interface ILanguage {
39
39
  key: string;
40
40
  icon: any;
41
41
  }
42
- export declare type TStringBoolean = "true" | "false";
42
+ export type TStringBoolean = "true" | "false";
43
43
  export declare enum EProductKind {
44
44
  GROUP = "3e/group",
45
45
  PRODUCT = "3e/product",
@@ -48,20 +48,21 @@ export declare enum EProductKind {
48
48
  CONFIG = "3e/group/config",
49
49
  STATIC = "3e/static",
50
50
  REF = "3e/ref",
51
- QUERY = "3e/query"
51
+ QUERY = "3e/query",
52
+ CMS = "3e/cms"
52
53
  }
53
54
  export declare enum EProductKindBucket {
54
55
  GROUP = "group",
55
56
  PRODUCT = "product"
56
57
  }
57
- export declare type TLiterals = {
58
+ export type TLiterals = {
58
59
  name: string;
59
60
  upsizeName?: string;
60
61
  fiscal?: string;
61
62
  "target-product-id"?: string;
62
63
  description?: string;
63
64
  } & IStringKeyRecord<string | undefined>;
64
- export declare type TMedia = {
65
+ export type TMedia = {
65
66
  url: string;
66
67
  name: string;
67
68
  };
@@ -81,8 +82,38 @@ export interface IProductAvailability {
81
82
  * @related {string} comma separated related products IDs
82
83
  */
83
84
  export interface IProductExtra extends IStringKeyRecord<string | undefined> {
85
+ /**
86
+ * comma separated values
87
+ */
88
+ tags?: string;
89
+ /**
90
+ * stringified nutrients object
91
+ */
92
+ nutrients?: string;
84
93
  related?: string;
85
94
  category?: string;
95
+ "ALLOW-MULTIPLE-LINE"?: "true" | "false";
96
+ "rbi-reward"?: "true" | "false";
97
+ "rbi-offer"?: "true" | "false";
98
+ "rbi-rewards-cat"?: "true" | "false";
99
+ "rbi-offers-cat"?: "true" | "false";
100
+ "rbi-reward-points"?: string;
101
+ /**
102
+ * CSS column span of ui item in grid
103
+ */
104
+ viewCols?: string;
105
+ /**
106
+ * CSS column span of ui item in grid
107
+ */
108
+ viewRows?: string;
109
+ /**
110
+ * CSS column start of ui item in grid
111
+ */
112
+ "col-start"?: string;
113
+ /**
114
+ * CSS row start of ui item in grid
115
+ */
116
+ "row-start"?: string;
86
117
  }
87
118
  /**
88
119
  * IProductFrontAttributes
@@ -93,11 +124,13 @@ export interface IProductExtra extends IStringKeyRecord<string | undefined> {
93
124
  export interface IProductFrontAttributes {
94
125
  isHiddenByEnableKey?: boolean;
95
126
  lineExtra?: IStringKeyRecord<string>;
127
+ cmsData?: any;
96
128
  }
97
129
  export interface IProduct {
98
130
  availability?: IProductAvailability;
99
131
  id: string;
100
132
  img?: string;
133
+ cmsId?: string;
101
134
  items?: IProduct[];
102
135
  kind: EProductKind | EProductKindBucket;
103
136
  literals?: TLiterals;
@@ -166,7 +199,7 @@ export interface IUser {
166
199
  export declare enum EOrderUserRole {
167
200
  CREATOR = "CREATOR",
168
201
  CUSTOMER = "CUSTOMER",
169
- COUPON = "COUPON",
202
+ COUPONS = "COUPON",
170
203
  KIOSK = "KIOSK",
171
204
  WAITER = "WAITER",
172
205
  MANAGER = "MANAGER",
@@ -326,6 +359,7 @@ export interface IOrderPayment {
326
359
  user: string;
327
360
  timestamp?: string;
328
361
  extra?: IStringKeyRecord<string>;
362
+ deferred?: boolean;
329
363
  }
330
364
  export declare enum EOrderPaymentType {
331
365
  CASH = "CASH",
@@ -455,7 +489,7 @@ export interface ISubTotalDiscount {
455
489
  discount: number;
456
490
  vat: string;
457
491
  }
458
- export declare type IOrderGroupProduct = Pick<IOrderProduct, "kind" | "id" | "literals" | "items" | "extra">;
492
+ export type IOrderGroupProduct = Pick<IOrderProduct, "kind" | "id" | "literals" | "items" | "extra">;
459
493
  export interface IOrderProduct {
460
494
  id: string;
461
495
  kind: EOrderProductKind;
@@ -465,7 +499,7 @@ export interface IOrderProduct {
465
499
  quantity: string;
466
500
  price: string;
467
501
  vat?: string;
468
- extra?: IStringKeyRecord<string>;
502
+ extra?: IProductExtra;
469
503
  }
470
504
  export declare enum EOrderLineStatus {
471
505
  NEW = "NEW",
@@ -492,8 +526,8 @@ export declare enum EOrderProductKind {
492
526
  export interface IProductLiterals {
493
527
  [propName: string]: any;
494
528
  }
495
- declare type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
496
- export declare type TSaleChannelWeek = Partial<Record<TWeekDay, {
529
+ type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
530
+ export type TSaleChannelWeek = Partial<Record<TWeekDay, {
497
531
  from: string;
498
532
  to: string;
499
533
  }[]>>;
@@ -567,14 +601,14 @@ export interface IFiscalizeData {
567
601
  };
568
602
  }
569
603
  export declare const sizes: readonly [48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900];
570
- export declare type TMediaSize = (typeof sizes)[number];
604
+ export type TMediaSize = (typeof sizes)[number];
571
605
  export declare enum ENotificationType {
572
606
  ORDER_EVENT_ERROR = "OrderEventError",
573
607
  ORDER_APPLIED_EVENTS = "OrderAppliedEvents",
574
608
  ORDER_EVENT_FISCAL = "OrderEventFiscal",
575
609
  ORDER_UPSELL = "OrderUpsell"
576
610
  }
577
- export declare type TUpsellKind = "ANY" | "POPUP" | "SIDE" | "BASKET";
611
+ export type TUpsellKind = "ANY" | "POPUP" | "SIDE" | "BASKET";
578
612
  export interface IUpsellNotification {
579
613
  details: {
580
614
  literals?: IStringKeyRecord<string>;
package/dist/cjs/index.js CHANGED
@@ -35,6 +35,7 @@ var EProductKind;
35
35
  EProductKind["STATIC"] = "3e/static";
36
36
  EProductKind["REF"] = "3e/ref";
37
37
  EProductKind["QUERY"] = "3e/query";
38
+ EProductKind["CMS"] = "3e/cms";
38
39
  })(EProductKind = exports.EProductKind || (exports.EProductKind = {}));
39
40
  var EProductKindBucket;
40
41
  (function (EProductKindBucket) {
@@ -45,7 +46,7 @@ var EOrderUserRole;
45
46
  (function (EOrderUserRole) {
46
47
  EOrderUserRole["CREATOR"] = "CREATOR";
47
48
  EOrderUserRole["CUSTOMER"] = "CUSTOMER";
48
- EOrderUserRole["COUPON"] = "COUPON";
49
+ EOrderUserRole["COUPONS"] = "COUPON";
49
50
  EOrderUserRole["KIOSK"] = "KIOSK";
50
51
  EOrderUserRole["WAITER"] = "WAITER";
51
52
  EOrderUserRole["MANAGER"] = "MANAGER";
@@ -138,7 +138,7 @@ export declare const KioskErrors: {
138
138
  x500: string;
139
139
  x501: string;
140
140
  };
141
- export declare type TErrorCode = keyof typeof KioskErrors;
141
+ export type TErrorCode = keyof typeof KioskErrors;
142
142
  export interface IKioskError {
143
143
  errorType: string;
144
144
  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 {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aggregators = void 0;
4
+ exports.aggregators = [
5
+ "GLOVO",
6
+ "JUSTEAT",
7
+ "UBER",
8
+ "WOLT",
9
+ "BOLT",
10
+ "TAZZ",
11
+ "_ANY_",
12
+ ];