@compassdigital/sdk.typescript 4.83.0 → 4.84.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 (45) 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.map +1 -1
  26. package/lib/interface/task.d.ts +4 -12
  27. package/lib/interface/task.d.ts.map +1 -1
  28. package/lib/interface/util.d.ts +9 -2
  29. package/lib/interface/util.d.ts.map +1 -1
  30. package/manifest.json +1 -1
  31. package/package.json +2 -2
  32. package/src/index.ts +45 -27
  33. package/src/interface/announcement.ts +30 -9
  34. package/src/interface/centricos.ts +1 -3
  35. package/src/interface/datalake.ts +1 -3
  36. package/src/interface/location.ts +9 -16
  37. package/src/interface/mealplan.ts +1 -3
  38. package/src/interface/menu.ts +159 -6
  39. package/src/interface/order.ts +5 -28
  40. package/src/interface/partner.ts +7 -10
  41. package/src/interface/promo.ts +5 -15
  42. package/src/interface/search.ts +1 -3
  43. package/src/interface/shoppingcart.ts +3 -0
  44. package/src/interface/task.ts +4 -12
  45. package/src/interface/util.ts +16 -2
@@ -497,6 +497,7 @@ export interface DrainOrderType {
497
497
  }
498
498
 
499
499
  export interface TaxRequestDTO {
500
+ // a unique identifier representing the transaction
500
501
  id: string;
501
502
  // the app to associate the transaction with
502
503
  appName: string;
@@ -516,6 +517,7 @@ export interface TaxRequestDTO {
516
517
  }
517
518
 
518
519
  export interface TaxLocationData {
520
+ // unique location identifier
519
521
  id: string;
520
522
  // country of transaction
521
523
  country: string;
@@ -530,6 +532,7 @@ export interface TaxLocationData {
530
532
  }
531
533
 
532
534
  export interface TaxItemDTO {
535
+ // unique item identifier
533
536
  id: string;
534
537
  // indicates a tax rule for an item
535
538
  taxTagCode: string;
@@ -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
  /**