@compassdigital/sdk.typescript 4.83.0 → 4.85.0

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.
Files changed (46) hide show
  1. package/lib/index.d.ts +22 -12
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +20 -12
  4. package/lib/index.js.map +1 -1
  5. package/lib/interface/announcement.d.ts +18 -7
  6. package/lib/interface/announcement.d.ts.map +1 -1
  7. package/lib/interface/centricos.d.ts +1 -3
  8. package/lib/interface/centricos.d.ts.map +1 -1
  9. package/lib/interface/datalake.d.ts +1 -3
  10. package/lib/interface/datalake.d.ts.map +1 -1
  11. package/lib/interface/location.d.ts +9 -19
  12. package/lib/interface/location.d.ts.map +1 -1
  13. package/lib/interface/mealplan.d.ts +1 -3
  14. package/lib/interface/mealplan.d.ts.map +1 -1
  15. package/lib/interface/menu.d.ts +126 -7
  16. package/lib/interface/menu.d.ts.map +1 -1
  17. package/lib/interface/order.d.ts +4 -20
  18. package/lib/interface/order.d.ts.map +1 -1
  19. package/lib/interface/partner.d.ts +7 -13
  20. package/lib/interface/partner.d.ts.map +1 -1
  21. package/lib/interface/promo.d.ts +5 -15
  22. package/lib/interface/promo.d.ts.map +1 -1
  23. package/lib/interface/search.d.ts +1 -3
  24. package/lib/interface/search.d.ts.map +1 -1
  25. package/lib/interface/shoppingcart.d.ts +38 -31
  26. package/lib/interface/shoppingcart.d.ts.map +1 -1
  27. package/lib/interface/task.d.ts +4 -12
  28. package/lib/interface/task.d.ts.map +1 -1
  29. package/lib/interface/util.d.ts +9 -2
  30. package/lib/interface/util.d.ts.map +1 -1
  31. package/manifest.json +1 -1
  32. package/package.json +2 -2
  33. package/src/index.ts +45 -27
  34. package/src/interface/announcement.ts +30 -9
  35. package/src/interface/centricos.ts +1 -3
  36. package/src/interface/datalake.ts +1 -3
  37. package/src/interface/location.ts +9 -16
  38. package/src/interface/mealplan.ts +1 -3
  39. package/src/interface/menu.ts +159 -6
  40. package/src/interface/order.ts +5 -28
  41. package/src/interface/partner.ts +7 -10
  42. package/src/interface/promo.ts +5 -15
  43. package/src/interface/search.ts +1 -3
  44. package/src/interface/shoppingcart.ts +43 -31
  45. package/src/interface/task.ts +4 -12
  46. package/src/interface/util.ts +16 -2
@@ -273,9 +273,7 @@ export interface LocationGroup {
273
273
  distance?: number;
274
274
  locations?: Location[];
275
275
  address?: Address;
276
- meta?: {
277
- [index: string]: any;
278
- };
276
+ meta?: Record<string, any>;
279
277
  style?: Record<string, any>;
280
278
  timezone?: string;
281
279
  [index: string]: any;
@@ -296,9 +294,7 @@ export interface Location {
296
294
  latitude?: number;
297
295
  longitude?: number;
298
296
  brands?: Brand[];
299
- meta?: {
300
- [index: string]: any;
301
- };
297
+ meta?: Record<string, any>;
302
298
  phone?: string;
303
299
  // group
304
300
  location_group?: string;
@@ -374,13 +370,14 @@ export interface Brand {
374
370
  // pos
375
371
  pos?: string;
376
372
  terminals?: Record<string, any>[];
377
- device_mapping?: {
378
- [index: string]: {
373
+ device_mapping?: Record<
374
+ string,
375
+ {
379
376
  device_type: string;
380
377
  site_device_id: string;
381
378
  business_units: string[];
382
- }[];
383
- };
379
+ }[]
380
+ >;
384
381
  timeslots?: {
385
382
  time?: string;
386
383
  averagePrepTime?: string;
@@ -93,9 +93,7 @@ export interface Event {
93
93
  }
94
94
 
95
95
  export interface Calendar {
96
- timezones: {
97
- [index: string]: string;
98
- };
96
+ timezones: Record<string, string>;
99
97
  events: Event[];
100
98
  }
101
99
 
@@ -114,9 +112,7 @@ export type PromotionMenuItems = {
114
112
  min?: number;
115
113
  max?: number;
116
114
  quantity?: number;
117
- meta?: {
118
- [index: string]: any;
119
- };
115
+ meta?: Record<string, any>;
120
116
  }[];
121
117
 
122
118
  export interface PromoMeta {
@@ -256,16 +252,10 @@ export interface Customer {
256
252
  name?: string;
257
253
  email?: string;
258
254
  description?: string;
259
- address?: {
260
- [index: string]: any;
261
- };
255
+ address?: Record<string, any>;
262
256
  phone?: string;
263
- summary?: {
264
- [index: string]: any;
265
- };
266
- loyalty?: {
267
- [index: string]: any;
268
- };
257
+ summary?: Record<string, any>;
258
+ loyalty?: Record<string, any>;
269
259
  metadata?: {
270
260
  origin?: string;
271
261
  [index: string]: any;
@@ -18,9 +18,7 @@ export interface GetShoppingcartDto {
18
18
  source_id: string;
19
19
  menu: string;
20
20
  location: string;
21
- meta: {
22
- [index: string]: any;
23
- };
21
+ meta: Record<string, any>;
24
22
  sub_total: Record<string, any>;
25
23
  payment_method: Record<string, any>;
26
24
  loyalty: Record<string, any>;
@@ -262,6 +262,19 @@ export interface ShoppingCartRequest {
262
262
  menu?: string;
263
263
  // brand
264
264
  brand?: string;
265
+ promo?: PromoDetails;
266
+ discount?: PromoDetails;
267
+ payment_method?: PaymentMethod;
268
+ taxes?: Taxes;
269
+ exemptions?: {
270
+ tax?: boolean;
271
+ };
272
+ service_fee?: {
273
+ amount?: MonetaryValue;
274
+ };
275
+ delivery_fee?: {
276
+ amount?: MonetaryValue;
277
+ };
265
278
  is?: {
266
279
  // Shoppingcart Type: delivery, pickup
267
280
  type?: 'delivery' | 'pickup' | 'scan_and_go' | 'frictionless';
@@ -295,17 +308,7 @@ export interface ShoppingCartResponse {
295
308
  sub_total?: {
296
309
  amount?: MonetaryValue;
297
310
  };
298
- promo?: {
299
- code?: string;
300
- provider?: 'fp' | 'voucherify';
301
- amount_off?: MonetaryValue;
302
- percent_off?: MonetaryValue;
303
- amount?: MonetaryValue;
304
- app?: string;
305
- discount?: Record<string, any>;
306
- provider_data?: FPValidationData;
307
- order?: PromoOrder;
308
- };
311
+ promo?: PromoDetails;
309
312
  //@deprecated
310
313
  loyalty?: {
311
314
  coupon?: {
@@ -317,26 +320,8 @@ export interface ShoppingCartResponse {
317
320
  // Points to be earned for this shopping cart total
318
321
  order_loyalty_points?: boolean;
319
322
  };
320
- discount?: {
321
- code?: string;
322
- provider?: 'fp' | 'voucherify';
323
- amount_off?: MonetaryValue;
324
- percent_off?: MonetaryValue;
325
- amount?: MonetaryValue;
326
- discount?: Record<string, any>;
327
- provider_data?: FPValidationData;
328
- };
329
- payment_method?: {
330
- mealplan?: Mealplan;
331
- credit_card?: CreditCard;
332
- digital_wallet_pay?: DigitalWalletPay;
333
- meal_swipes?: MealSwipes;
334
- meal_exchange?: MealExchange;
335
- badge_pay?: CashlessTender;
336
- stipend?: CashlessTender;
337
- voucher?: CashlessTender;
338
- coupon_voucher?: CashlessTender;
339
- };
323
+ discount?: PromoDetails;
324
+ payment_method?: PaymentMethod;
340
325
  taxes?: Taxes;
341
326
  total?: {
342
327
  amount?: MonetaryValue;
@@ -377,6 +362,18 @@ export interface ShoppingCartResponse {
377
362
 
378
363
  export type ShoppingCart = ShoppingCartResponse;
379
364
 
365
+ export interface PaymentMethod {
366
+ mealplan?: Mealplan;
367
+ credit_card?: CreditCard;
368
+ digital_wallet_pay?: DigitalWalletPay;
369
+ meal_swipes?: MealSwipes;
370
+ meal_exchange?: MealExchange;
371
+ badge_pay?: CashlessTender;
372
+ stipend?: CashlessTender;
373
+ voucher?: CashlessTender;
374
+ coupon_voucher?: CashlessTender;
375
+ }
376
+
380
377
  export interface PaymentMethods {
381
378
  mealplan: {
382
379
  tenders: Tender[];
@@ -497,6 +494,7 @@ export interface DrainOrderType {
497
494
  }
498
495
 
499
496
  export interface TaxRequestDTO {
497
+ // a unique identifier representing the transaction
500
498
  id: string;
501
499
  // the app to associate the transaction with
502
500
  appName: string;
@@ -516,6 +514,7 @@ export interface TaxRequestDTO {
516
514
  }
517
515
 
518
516
  export interface TaxLocationData {
517
+ // unique location identifier
519
518
  id: string;
520
519
  // country of transaction
521
520
  country: string;
@@ -530,6 +529,7 @@ export interface TaxLocationData {
530
529
  }
531
530
 
532
531
  export interface TaxItemDTO {
532
+ // unique item identifier
533
533
  id: string;
534
534
  // indicates a tax rule for an item
535
535
  taxTagCode: string;
@@ -554,6 +554,18 @@ export type ModifierSizing = {
554
554
  posid?: string;
555
555
  }[];
556
556
 
557
+ export interface PromoDetails {
558
+ code?: string;
559
+ provider?: 'fp' | 'voucherify';
560
+ amount_off?: MonetaryValue;
561
+ percent_off?: MonetaryValue;
562
+ amount?: MonetaryValue;
563
+ app?: string;
564
+ discount?: Record<string, any>;
565
+ provider_data?: FPValidationData;
566
+ order?: PromoOrder;
567
+ }
568
+
557
569
  // POST /shoppingcart - Create a new ShoppingCart
558
570
 
559
571
  export interface PostShoppingcartCartQuery {
@@ -43,9 +43,7 @@ export interface Task {
43
43
  dropoff_details?: TaskLocation;
44
44
  status?: TaskStatus;
45
45
  // Any related metadata information about this Task
46
- meta?: {
47
- [index: string]: any;
48
- };
46
+ meta?: Record<string, any>;
49
47
  // Date when Task was created
50
48
  created?: string;
51
49
  // Date when Task expires
@@ -84,9 +82,7 @@ export interface TaskCreate {
84
82
  dropoff_details: TaskLocation;
85
83
  status: TaskStatus;
86
84
  // Any related metadata information about this Task
87
- meta?: {
88
- [index: string]: any;
89
- };
85
+ meta?: Record<string, any>;
90
86
  // Task Type
91
87
  type: 'bolter' | 'kds';
92
88
  }
@@ -107,9 +103,7 @@ export interface TaskUpdate {
107
103
  status?: TaskStatus;
108
104
  assignee?: string;
109
105
  // Any related metadata information about this Task
110
- meta?: {
111
- [index: string]: any;
112
- };
106
+ meta?: Record<string, any>;
113
107
  }
114
108
 
115
109
  export interface OrderUpdate {
@@ -137,9 +131,7 @@ export interface OrderIssue {
137
131
  id?: string;
138
132
  type?: string;
139
133
  //@deprecated
140
- item?: {
141
- [index: string]: any;
142
- };
134
+ item?: Record<string, any>;
143
135
  // Array of Items with issues
144
136
  items?: Record<string, any>[];
145
137
  // Optional additional explanation for issue: 5,10,15 for late issues, SOLD_OUT, MODIFICATION, DIETARY_RESTRICTION for see kitchen issues
@@ -1,8 +1,22 @@
1
1
  /**
2
- * Convert number query parameters to string.
2
+ * Convert a query parameter value to the request type.
3
+ *
4
+ * - number types are converted to string
5
+ * - Array<T> types are converted to Array<T> | T
6
+ */
7
+ export type RequestQueryParam<T> = T extends undefined
8
+ ? undefined
9
+ : T extends number
10
+ ? string
11
+ : T extends any[]
12
+ ? RequestQueryParam<T[number]>[] | RequestQueryParam<T[number]>
13
+ : T;
14
+
15
+ /**
16
+ * Convert the query parameters to the request types.
3
17
  */
4
18
  export type RequestQuery<T extends object> = {
5
- [K in keyof T]: T[K] extends number | undefined ? string : T[K];
19
+ [K in keyof T]: RequestQueryParam<T[K]>;
6
20
  };
7
21
 
8
22
  /**