@compassdigital/sdk.typescript 4.15.0 → 4.16.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 (101) hide show
  1. package/lib/base.d.ts +1 -11
  2. package/lib/base.d.ts.map +1 -1
  3. package/lib/base.js +3 -21
  4. package/lib/base.js.map +1 -1
  5. package/lib/index.d.ts +46 -5
  6. package/lib/index.d.ts.map +1 -1
  7. package/lib/index.js +47 -2
  8. package/lib/index.js.map +1 -1
  9. package/lib/interface/ai.d.ts +3 -3
  10. package/lib/interface/ai.d.ts.map +1 -1
  11. package/lib/interface/announcement.d.ts +2 -2
  12. package/lib/interface/announcement.d.ts.map +1 -1
  13. package/lib/interface/calendar.d.ts +1 -1
  14. package/lib/interface/calendar.d.ts.map +1 -1
  15. package/lib/interface/centricos.d.ts +46 -4
  16. package/lib/interface/centricos.d.ts.map +1 -1
  17. package/lib/interface/compassconnect.d.ts +1 -1
  18. package/lib/interface/compassconnect.d.ts.map +1 -1
  19. package/lib/interface/config.d.ts +2 -2
  20. package/lib/interface/config.d.ts.map +1 -1
  21. package/lib/interface/datalake.d.ts +2 -2
  22. package/lib/interface/datalake.d.ts.map +1 -1
  23. package/lib/interface/delivery.d.ts +1 -1
  24. package/lib/interface/delivery.d.ts.map +1 -1
  25. package/lib/interface/email.d.ts +2 -2
  26. package/lib/interface/email.d.ts.map +1 -1
  27. package/lib/interface/file.d.ts +1 -1
  28. package/lib/interface/file.d.ts.map +1 -1
  29. package/lib/interface/frictionless.d.ts +26 -7
  30. package/lib/interface/frictionless.d.ts.map +1 -1
  31. package/lib/interface/kds.d.ts +1 -1
  32. package/lib/interface/kds.d.ts.map +1 -1
  33. package/lib/interface/location.d.ts +21 -12
  34. package/lib/interface/location.d.ts.map +1 -1
  35. package/lib/interface/location.js +12 -0
  36. package/lib/interface/location.js.map +1 -1
  37. package/lib/interface/mealplan.d.ts +1 -1
  38. package/lib/interface/mealplan.d.ts.map +1 -1
  39. package/lib/interface/menu.d.ts +255 -249
  40. package/lib/interface/menu.d.ts.map +1 -1
  41. package/lib/interface/menu.js +6 -0
  42. package/lib/interface/menu.js.map +1 -1
  43. package/lib/interface/notification.d.ts +2 -2
  44. package/lib/interface/notification.d.ts.map +1 -1
  45. package/lib/interface/order.d.ts +3 -3
  46. package/lib/interface/order.d.ts.map +1 -1
  47. package/lib/interface/partner.d.ts +26 -18
  48. package/lib/interface/partner.d.ts.map +1 -1
  49. package/lib/interface/partner.js +11 -0
  50. package/lib/interface/partner.js.map +1 -1
  51. package/lib/interface/payment.d.ts +1 -1
  52. package/lib/interface/payment.d.ts.map +1 -1
  53. package/lib/interface/promo.d.ts +12 -5
  54. package/lib/interface/promo.d.ts.map +1 -1
  55. package/lib/interface/promo.js +8 -0
  56. package/lib/interface/promo.js.map +1 -1
  57. package/lib/interface/report.d.ts +11 -5
  58. package/lib/interface/report.d.ts.map +1 -1
  59. package/lib/interface/shoppingcart.d.ts +12 -8
  60. package/lib/interface/shoppingcart.d.ts.map +1 -1
  61. package/lib/interface/shoppingcart.js +5 -0
  62. package/lib/interface/shoppingcart.js.map +1 -1
  63. package/lib/interface/task.d.ts +14 -6
  64. package/lib/interface/task.d.ts.map +1 -1
  65. package/lib/interface/task.js +9 -0
  66. package/lib/interface/task.js.map +1 -1
  67. package/lib/interface/user.d.ts +4 -4
  68. package/lib/interface/user.d.ts.map +1 -1
  69. package/lib/interface/util.d.ts +19 -0
  70. package/lib/interface/util.d.ts.map +1 -1
  71. package/lib/interface/vendor.d.ts +1 -1
  72. package/lib/interface/vendor.d.ts.map +1 -1
  73. package/package.json +1 -1
  74. package/src/base.ts +6 -25
  75. package/src/index.ts +117 -2
  76. package/src/interface/ai.ts +3 -3
  77. package/src/interface/announcement.ts +2 -2
  78. package/src/interface/calendar.ts +1 -1
  79. package/src/interface/centricos.ts +76 -4
  80. package/src/interface/compassconnect.ts +1 -1
  81. package/src/interface/config.ts +2 -2
  82. package/src/interface/datalake.ts +2 -2
  83. package/src/interface/delivery.ts +1 -1
  84. package/src/interface/email.ts +2 -2
  85. package/src/interface/file.ts +1 -1
  86. package/src/interface/frictionless.ts +49 -7
  87. package/src/interface/kds.ts +1 -1
  88. package/src/interface/location.ts +20 -12
  89. package/src/interface/mealplan.ts +1 -1
  90. package/src/interface/menu.ts +254 -249
  91. package/src/interface/notification.ts +2 -2
  92. package/src/interface/order.ts +3 -3
  93. package/src/interface/partner.ts +25 -18
  94. package/src/interface/payment.ts +1 -1
  95. package/src/interface/promo.ts +11 -5
  96. package/src/interface/report.ts +17 -7
  97. package/src/interface/shoppingcart.ts +11 -8
  98. package/src/interface/task.ts +13 -12
  99. package/src/interface/user.ts +4 -4
  100. package/src/interface/util.ts +21 -0
  101. package/src/interface/vendor.ts +1 -1
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  error?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface Notification {
@@ -33,7 +33,7 @@ export interface PushNotificationBody {
33
33
  text: string;
34
34
  // Recipient of the notifications. Example: specific realm, role or user id
35
35
  target: string;
36
- data?: Record<string, any>;
36
+ data?: any;
37
37
  }
38
38
 
39
39
  export interface NotificationStatus {
@@ -49,7 +49,7 @@ export interface CreateOrder {
49
49
  export interface Error {
50
50
  error?: string;
51
51
  code?: number;
52
- data?: Record<string, any>;
52
+ data?: any;
53
53
  }
54
54
 
55
55
  export interface Issue {
@@ -327,7 +327,7 @@ export interface OrderedItem {
327
327
  id?: string;
328
328
  // index
329
329
  _index?: string;
330
- meta?: Record<string, any>;
330
+ meta?: any;
331
331
  }[];
332
332
  }[];
333
333
  [index: string]: any;
@@ -338,7 +338,7 @@ export interface Orders {
338
338
  lastKey?: string;
339
339
  count?: number;
340
340
  // url to query next set of data
341
- links?: Record<string, any>;
341
+ links?: any;
342
342
  }
343
343
 
344
344
  export interface ItemsWithIssue extends OrderedItem {
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  message?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface ShoppingCartResponse {
@@ -18,7 +18,7 @@ export interface ShoppingCartResponse {
18
18
  menu?: string;
19
19
  // brand
20
20
  brand?: string;
21
- date?: Record<string, any>;
21
+ date?: any;
22
22
  items?: ItemResponse[];
23
23
  sub_total?: {
24
24
  amount?: MonetaryValue;
@@ -30,7 +30,7 @@ export interface ShoppingCartResponse {
30
30
  percent_off?: MonetaryValue;
31
31
  amount?: MonetaryValue;
32
32
  app?: string;
33
- discount?: Record<string, any>;
33
+ discount?: any;
34
34
  provider_data?: FPValidationData;
35
35
  };
36
36
  //@deprecated
@@ -50,7 +50,7 @@ export interface ShoppingCartResponse {
50
50
  amount_off?: MonetaryValue;
51
51
  percent_off?: MonetaryValue;
52
52
  amount?: MonetaryValue;
53
- discount?: Record<string, any>;
53
+ discount?: any;
54
54
  provider_data?: FPValidationData;
55
55
  };
56
56
  payment_method?: {
@@ -126,7 +126,7 @@ export interface ShoppingCartResponse {
126
126
  };
127
127
  meta?: {
128
128
  // Raw request from any vendor integrated with CDL
129
- vendor?: Record<string, any>;
129
+ vendor?: any;
130
130
  [index: string]: any;
131
131
  };
132
132
  }
@@ -199,7 +199,7 @@ export interface ItemResponse {
199
199
  };
200
200
  }[];
201
201
  // Details about discount like BOGO, LTO, Bundle etc.
202
- item_discount?: Record<string, any>;
202
+ item_discount?: any;
203
203
  // user specified instructions for the item
204
204
  special_instructions?: string;
205
205
  amount_off_exclusions?: AmountOffExclusion[];
@@ -225,7 +225,10 @@ export interface FPValidationData {
225
225
  [index: string]: any;
226
226
  }
227
227
 
228
- export type AmountOffExclusion = "discount" | "promo";
228
+ enum AmountOffExclusion {
229
+ DISCOUNT = "discount",
230
+ PROMO = "promo",
231
+ }
229
232
 
230
233
  export interface Label {
231
234
  en?: string;
@@ -276,7 +279,7 @@ export interface LocationGroup {
276
279
  meta?: {
277
280
  [index: string]: any;
278
281
  };
279
- style?: Record<string, any>;
282
+ style?: any;
280
283
  [index: string]: any;
281
284
  }
282
285
 
@@ -334,8 +337,8 @@ export interface Location {
334
337
  en?: string;
335
338
  fr?: string;
336
339
  };
337
- hours?: Record<string, any>;
338
- deliveryHours?: Record<string, any>;
340
+ hours?: any;
341
+ deliveryHours?: any;
339
342
  service_fee?: {
340
343
  type?: string;
341
344
  value?: number;
@@ -367,10 +370,10 @@ export interface Brand {
367
370
  };
368
371
  hours?: Hours[];
369
372
  deliveryHours?: DeliveryHours[];
370
- style?: Record<string, any>;
373
+ style?: any;
371
374
  // pos
372
375
  pos?: string;
373
- terminals?: Record<string, any>[];
376
+ terminals?: any[];
374
377
  timeslots?: {
375
378
  time?: string;
376
379
  averagePrepTime?: string;
@@ -417,8 +420,8 @@ export interface Brand {
417
420
  // company
418
421
  company?: string;
419
422
  config?: {
420
- private?: Record<string, any>;
421
- public?: Record<string, any>;
423
+ private?: any;
424
+ public?: any;
422
425
  };
423
426
  tax_rate?: number;
424
427
  meta?: {
@@ -608,7 +611,7 @@ export interface Group {
608
611
  };
609
612
  // The number of units that belong to this item. For example, a dozen doughnuts should have a unit value of 12
610
613
  unit?: number;
611
- ingredients?: Record<string, any>[];
614
+ ingredients?: any[];
612
615
  amount_off_exclusions?: AmountOffExclusionTypes[];
613
616
  nutrition?: {
614
617
  kcal?: number;
@@ -778,7 +781,11 @@ export interface Nutrition {
778
781
  unit?: string;
779
782
  }
780
783
 
781
- export type AmountOffExclusionTypes = "loyalty" | "discount" | "promo";
784
+ enum AmountOffExclusionTypes {
785
+ LOYALTY = "loyalty",
786
+ DISCOUNT = "discount",
787
+ PROMO = "promo",
788
+ }
782
789
 
783
790
  export interface CognitionStore {
784
791
  // UUID for external store
@@ -813,7 +820,7 @@ export interface PostPartnerStandardcognitionShoppingcartBody {
813
820
  // shoppingcart
814
821
  shoppingcart?: string;
815
822
  // Meta data from Standard Cognition shoppingcart
816
- meta?: Record<string, any>;
823
+ meta?: any;
817
824
  }
818
825
 
819
826
  export type PostPartnerStandardcognitionShoppingcartResponse = ShoppingCartResponse;
@@ -876,7 +883,7 @@ export interface PostPartnerEventPath {
876
883
  id: string;
877
884
  }
878
885
 
879
- export type PostPartnerEventBody = Record<string, any>;
886
+ export type PostPartnerEventBody = any;
880
887
 
881
888
  export type PostPartnerEventResponse = Success;
882
889
 
@@ -149,7 +149,7 @@ export interface Success {
149
149
  export interface Error {
150
150
  error?: string;
151
151
  code?: number;
152
- data?: Record<string, any>;
152
+ data?: any;
153
153
  }
154
154
 
155
155
  export interface CashlessTender {
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  message?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface PromotionBody {
@@ -58,7 +58,13 @@ export interface Promotion {
58
58
  meta?: PromoMeta;
59
59
  }
60
60
 
61
- export type Status = "active" | "scheduled" | "paused" | "expired" | "archived";
61
+ enum Status {
62
+ ACTIVE = "active",
63
+ SCHEDULED = "scheduled",
64
+ PAUSED = "paused",
65
+ EXPIRED = "expired",
66
+ ARCHIVED = "archived",
67
+ }
62
68
 
63
69
  export interface DatetimeObject {
64
70
  year: number;
@@ -254,10 +260,10 @@ export interface Customer {
254
260
  name?: string;
255
261
  email?: string;
256
262
  description?: string;
257
- address?: Record<string, any>;
263
+ address?: any;
258
264
  phone?: string;
259
- summary?: Record<string, any>;
260
- loyalty?: Record<string, any>;
265
+ summary?: any;
266
+ loyalty?: any;
261
267
  metadata?: {
262
268
  origin?: string;
263
269
  };
@@ -10,7 +10,7 @@ export interface Success {
10
10
  export interface Error {
11
11
  message?: string;
12
12
  code?: number;
13
- data?: Record<string, any>;
13
+ data?: any;
14
14
  }
15
15
 
16
16
  export interface EODReports {
@@ -329,11 +329,11 @@ export interface ReportGroupConfigRequest {
329
329
  }
330
330
 
331
331
  export interface ReportGroupConfigResponse {
332
- location_group_id?: string;
332
+ location_group_id: string;
333
333
  // Time in 24-hour format (HH:MM).
334
- day_start?: string;
335
- day_parts?: DayPartConfig;
336
- is_default?: boolean;
334
+ day_start: string;
335
+ day_parts: DayPartConfig;
336
+ is_default: boolean;
337
337
  }
338
338
 
339
339
  // GET /report/analytics/group/{location_group}/{report_type}
@@ -503,7 +503,7 @@ export interface GetReportEodGroupItemsRequest
503
503
  RequestQuery<GetReportEodGroupItemsQuery>,
504
504
  GetReportEodGroupItemsPath {}
505
505
 
506
- // PUT /report/group/{location_group}/config - Update report configuration for a location group
506
+ // PUT /report/group/{location_group}/config - Update report configuration for a location group. Times are in UTC.
507
507
 
508
508
  export interface PutReportGroupConfigPath {
509
509
  location_group: string;
@@ -517,7 +517,7 @@ export interface PutReportGroupConfigRequest extends BaseRequest, PutReportGroup
517
517
  body: PutReportGroupConfigBody;
518
518
  }
519
519
 
520
- // GET /report/group/{location_group}/config - Get report configuration for a location group
520
+ // GET /report/group/{location_group}/config - Get report configuration for a location group. Times are in UTC.
521
521
 
522
522
  export interface GetReportGroupConfigPath {
523
523
  location_group: string;
@@ -534,3 +534,13 @@ export interface GetReportGroupConfigRequest
534
534
  extends BaseRequest,
535
535
  RequestQuery<GetReportGroupConfigQuery>,
536
536
  GetReportGroupConfigPath {}
537
+
538
+ // DELETE /report/group/{location_group}/config - Delete report configuration for a location group
539
+
540
+ export interface DeleteReportGroupConfigPath {
541
+ location_group: string;
542
+ }
543
+
544
+ export type DeleteReportGroupConfigResponse = ReportGroupConfigResponse;
545
+
546
+ export interface DeleteReportGroupConfigRequest extends BaseRequest, DeleteReportGroupConfigPath {}
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  message?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface ItemsRequest {
@@ -69,7 +69,7 @@ export interface ItemResponse {
69
69
  };
70
70
  options?: ModifierGroupResponse[];
71
71
  // Details about discount like BOGO, LTO, Bundle etc.
72
- item_discount?: Record<string, any>;
72
+ item_discount?: any;
73
73
  // user specified instructions for the item
74
74
  special_instructions?: string;
75
75
  amount_off_exclusions?: AmountOffExclusion[];
@@ -239,7 +239,7 @@ export interface ShoppingCartRequest {
239
239
  };
240
240
  meta?: {
241
241
  // Raw request from any vendor integrated with CDL
242
- vendor?: Record<string, any>;
242
+ vendor?: any;
243
243
  [index: string]: any;
244
244
  };
245
245
  }
@@ -253,7 +253,7 @@ export interface ShoppingCartResponse {
253
253
  menu?: string;
254
254
  // brand
255
255
  brand?: string;
256
- date?: Record<string, any>;
256
+ date?: any;
257
257
  items?: ItemResponse[];
258
258
  sub_total?: {
259
259
  amount?: MonetaryValue;
@@ -265,7 +265,7 @@ export interface ShoppingCartResponse {
265
265
  percent_off?: MonetaryValue;
266
266
  amount?: MonetaryValue;
267
267
  app?: string;
268
- discount?: Record<string, any>;
268
+ discount?: any;
269
269
  provider_data?: FPValidationData;
270
270
  };
271
271
  //@deprecated
@@ -285,7 +285,7 @@ export interface ShoppingCartResponse {
285
285
  amount_off?: MonetaryValue;
286
286
  percent_off?: MonetaryValue;
287
287
  amount?: MonetaryValue;
288
- discount?: Record<string, any>;
288
+ discount?: any;
289
289
  provider_data?: FPValidationData;
290
290
  };
291
291
  payment_method?: {
@@ -329,7 +329,7 @@ export interface ShoppingCartResponse {
329
329
  };
330
330
  meta?: {
331
331
  // Raw request from any vendor integrated with CDL
332
- vendor?: Record<string, any>;
332
+ vendor?: any;
333
333
  [index: string]: any;
334
334
  };
335
335
  }
@@ -428,7 +428,10 @@ export interface FPValidationData {
428
428
  [index: string]: any;
429
429
  }
430
430
 
431
- export type AmountOffExclusion = "discount" | "promo";
431
+ enum AmountOffExclusion {
432
+ DISCOUNT = "discount",
433
+ PROMO = "promo",
434
+ }
432
435
 
433
436
  // POST /shoppingcart/ - Create a new ShoppingCart
434
437
 
@@ -15,13 +15,13 @@ export interface TaskLocation {
15
15
  // Pickup or Dropoff time
16
16
  action_time: string;
17
17
  // optional details
18
- details?: Record<string, any>;
18
+ details?: any;
19
19
  }
20
20
 
21
21
  export interface Error {
22
22
  code?: number;
23
23
  message?: string;
24
- data?: Record<string, any>;
24
+ data?: any;
25
25
  }
26
26
 
27
27
  export interface Task {
@@ -131,8 +131,8 @@ export interface ActionResponse {
131
131
  export interface TaskOrder {
132
132
  order_id?: string;
133
133
  customer_id?: string;
134
- customer?: Record<string, any>;
135
- order_details?: Record<string, any>;
134
+ customer?: any;
135
+ order_details?: any;
136
136
  delivery_instructions?: string;
137
137
  issue?: OrderIssue;
138
138
  past_issues?: OrderIssue[];
@@ -146,7 +146,7 @@ export interface OrderIssue {
146
146
  [index: string]: any;
147
147
  };
148
148
  // Array of Items with issues
149
- items?: Record<string, any>[];
149
+ items?: any[];
150
150
  // Optional additional explanation for issue: 5,10,15 for late issues, SOLD_OUT, MODIFICATION, DIETARY_RESTRICTION for see kitchen issues
151
151
  reason?: string;
152
152
  meta?: {
@@ -155,13 +155,14 @@ export interface OrderIssue {
155
155
  };
156
156
  }
157
157
 
158
- export type TaskStatus =
159
- | "new"
160
- | "in_progress"
161
- | "ready"
162
- | "out_for_delivery"
163
- | "delivered"
164
- | "order_is_ready";
158
+ enum TaskStatus {
159
+ NEW = "new",
160
+ IN_PROGRESS = "in_progress",
161
+ READY = "ready",
162
+ OUT_FOR_DELIVERY = "out_for_delivery",
163
+ DELIVERED = "delivered",
164
+ ORDER_IS_READY = "order_is_ready",
165
+ }
165
166
 
166
167
  // POST /task/ - Create new Task
167
168
 
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  message?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface User {
@@ -184,7 +184,7 @@ export interface guestAuthToken {
184
184
  export type Permission = string;
185
185
 
186
186
  export interface KDSToken {
187
- device?: Record<string, any>;
187
+ device?: any;
188
188
  access?: {
189
189
  token?: string;
190
190
  expires?: number;
@@ -512,7 +512,7 @@ export interface PatchUserAuthKdsPath {
512
512
  device_id: string;
513
513
  }
514
514
 
515
- export type PatchUserAuthKdsBody = Record<string, any>;
515
+ export type PatchUserAuthKdsBody = any;
516
516
 
517
517
  export type PatchUserAuthKdsResponse = KDSDevice;
518
518
 
@@ -549,7 +549,7 @@ export interface PostUserAddSecretPath {
549
549
  key: string;
550
550
  }
551
551
 
552
- export type PostUserAddSecretBody = Record<string, any>;
552
+ export type PostUserAddSecretBody = any;
553
553
 
554
554
  export type PostUserAddSecretResponse = Key;
555
555
 
@@ -5,9 +5,30 @@ export type RequestQuery<T extends object> = {
5
5
  [K in keyof T]: T[K] extends number|undefined ? string : T[K];
6
6
  }
7
7
 
8
+ /**
9
+ * Provider TokenDetails
10
+ */
11
+ export interface RequestContextSession {
12
+ user_id: string;
13
+ expiry: Date | null;
14
+ iat: Date;
15
+ scopes: string;
16
+ sub: string;
17
+ domain?: string;
18
+ }
19
+
20
+ /**
21
+ * Provider request context.
22
+ */
23
+ export interface RequestContext {
24
+ method?: string;
25
+ session?: RequestContextSession;
26
+ }
27
+
8
28
  /**
9
29
  * All requests implement this interface.
10
30
  */
11
31
  export interface BaseRequest {
32
+ context?: RequestContext;
12
33
  headers?: Record<string, string>;
13
34
  }
@@ -6,7 +6,7 @@ import { RequestQuery, BaseRequest } from "./util";
6
6
  export interface Error {
7
7
  message?: string;
8
8
  code?: number;
9
- data?: Record<string, any>;
9
+ data?: any;
10
10
  }
11
11
 
12
12
  export interface ApplicationPostBody {