@compassdigital/sdk.typescript 3.42.1 → 3.43.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/lib/index.d.ts +9 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +12 -8
- package/lib/index.js.map +1 -1
- package/lib/interface/menu.d.ts +11 -3
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/partner.d.ts +98 -67
- package/lib/interface/partner.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +19 -5
- package/src/interface/menu.ts +23 -9
- package/src/interface/partner.ts +110 -70
package/src/interface/menu.ts
CHANGED
|
@@ -387,15 +387,23 @@ export interface PatchMenuV2ModifierPath {
|
|
|
387
387
|
id: string;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
+
export type PatchMenuV2ModifierBody = Modifier;
|
|
391
|
+
|
|
390
392
|
export type PatchMenuV2ModifierResponse = Modifier;
|
|
391
393
|
|
|
392
|
-
export interface PatchMenuV2ModifierRequest extends BaseRequest, PatchMenuV2ModifierPath {
|
|
394
|
+
export interface PatchMenuV2ModifierRequest extends BaseRequest, PatchMenuV2ModifierPath {
|
|
395
|
+
body: PatchMenuV2ModifierBody;
|
|
396
|
+
}
|
|
393
397
|
|
|
394
398
|
// POST /menu/v2/modifier
|
|
395
399
|
|
|
400
|
+
export type PostMenuV2ModifierBody = Modifier;
|
|
401
|
+
|
|
396
402
|
export type PostMenuV2ModifierResponse = Modifier;
|
|
397
403
|
|
|
398
|
-
export interface PostMenuV2ModifierRequest extends BaseRequest {
|
|
404
|
+
export interface PostMenuV2ModifierRequest extends BaseRequest {
|
|
405
|
+
body: PostMenuV2ModifierBody;
|
|
406
|
+
}
|
|
399
407
|
|
|
400
408
|
// GET /menu/v2/modifier/count
|
|
401
409
|
|
|
@@ -427,9 +435,13 @@ export interface GetMenuV2ModifierGroupsRequest
|
|
|
427
435
|
|
|
428
436
|
// POST /menu/v2/modifier-group
|
|
429
437
|
|
|
430
|
-
export type
|
|
438
|
+
export type PostMenuV2ModifierGroupBody = ModifierGroup;
|
|
431
439
|
|
|
432
|
-
export
|
|
440
|
+
export type PostMenuV2ModifierGroupResponse = ModifierGroup;
|
|
441
|
+
|
|
442
|
+
export interface PostMenuV2ModifierGroupRequest extends BaseRequest {
|
|
443
|
+
body: PostMenuV2ModifierGroupBody;
|
|
444
|
+
}
|
|
433
445
|
|
|
434
446
|
// GET /menu/v2/modifier-group/{id}
|
|
435
447
|
|
|
@@ -442,7 +454,7 @@ export interface GetMenuV2ModifierGroupQuery {
|
|
|
442
454
|
_query?: string;
|
|
443
455
|
}
|
|
444
456
|
|
|
445
|
-
export type GetMenuV2ModifierGroupResponse =
|
|
457
|
+
export type GetMenuV2ModifierGroupResponse = ModifierGroup;
|
|
446
458
|
|
|
447
459
|
export interface GetMenuV2ModifierGroupRequest
|
|
448
460
|
extends BaseRequest,
|
|
@@ -455,11 +467,13 @@ export interface PatchMenuV2ModifierGroupPath {
|
|
|
455
467
|
id: string;
|
|
456
468
|
}
|
|
457
469
|
|
|
458
|
-
export type
|
|
470
|
+
export type PatchMenuV2ModifierGroupBody = ModifierGroup;
|
|
459
471
|
|
|
460
|
-
export
|
|
461
|
-
|
|
462
|
-
|
|
472
|
+
export type PatchMenuV2ModifierGroupResponse = ModifierGroup;
|
|
473
|
+
|
|
474
|
+
export interface PatchMenuV2ModifierGroupRequest extends BaseRequest, PatchMenuV2ModifierGroupPath {
|
|
475
|
+
body: PatchMenuV2ModifierGroupBody;
|
|
476
|
+
}
|
|
463
477
|
|
|
464
478
|
// GET /menu/v2/modifier-group/count
|
|
465
479
|
|
package/src/interface/partner.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Error {
|
|
|
7
7
|
code?: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface ShoppingCartResponse {
|
|
11
11
|
// shoppingcart
|
|
12
12
|
id?: string;
|
|
13
13
|
// location
|
|
@@ -17,23 +17,23 @@ export interface ShoppingCart {
|
|
|
17
17
|
// brand
|
|
18
18
|
brand?: string;
|
|
19
19
|
date?: any;
|
|
20
|
-
items?:
|
|
20
|
+
items?: ItemResponse[];
|
|
21
21
|
sub_total?: {
|
|
22
|
-
amount?:
|
|
22
|
+
amount?: MonetaryValue;
|
|
23
23
|
};
|
|
24
24
|
promo?: {
|
|
25
25
|
code?: string;
|
|
26
|
-
amount_off?:
|
|
27
|
-
percent_off?:
|
|
28
|
-
amount?:
|
|
26
|
+
amount_off?: MonetaryValue;
|
|
27
|
+
percent_off?: MonetaryValue;
|
|
28
|
+
amount?: MonetaryValue;
|
|
29
29
|
app?: string;
|
|
30
30
|
};
|
|
31
31
|
//@deprecated
|
|
32
32
|
loyalty?: {
|
|
33
33
|
coupon?: {
|
|
34
34
|
code?: string;
|
|
35
|
-
amount_off?:
|
|
36
|
-
amount?:
|
|
35
|
+
amount_off?: MonetaryValue;
|
|
36
|
+
amount?: MonetaryValue;
|
|
37
37
|
name?: string;
|
|
38
38
|
};
|
|
39
39
|
// Points to be earned for this shopping cart total
|
|
@@ -41,34 +41,34 @@ export interface ShoppingCart {
|
|
|
41
41
|
};
|
|
42
42
|
discount?: {
|
|
43
43
|
code?: string;
|
|
44
|
-
amount_off?:
|
|
45
|
-
percent_off?:
|
|
46
|
-
amount?:
|
|
44
|
+
amount_off?: MonetaryValue;
|
|
45
|
+
percent_off?: MonetaryValue;
|
|
46
|
+
amount?: MonetaryValue;
|
|
47
47
|
};
|
|
48
48
|
payment_method?: {
|
|
49
49
|
email?: string;
|
|
50
50
|
mealplan?: {
|
|
51
51
|
id?: string;
|
|
52
52
|
tender?: string;
|
|
53
|
-
total?:
|
|
53
|
+
total?: MonetaryValue;
|
|
54
54
|
};
|
|
55
55
|
credit_card?: {
|
|
56
56
|
card_type?: string;
|
|
57
57
|
last4?: string;
|
|
58
|
-
total?:
|
|
58
|
+
total?: MonetaryValue;
|
|
59
59
|
};
|
|
60
60
|
digital_wallet_pay?: {
|
|
61
61
|
wallet_type?: string;
|
|
62
|
-
total?:
|
|
62
|
+
total?: MonetaryValue;
|
|
63
63
|
};
|
|
64
64
|
meal_swipes?: {
|
|
65
65
|
id?: string;
|
|
66
66
|
tender?: string;
|
|
67
67
|
tender_type?: string;
|
|
68
68
|
tender_name?: string;
|
|
69
|
-
swipes?:
|
|
70
|
-
rate?:
|
|
71
|
-
total?:
|
|
69
|
+
swipes?: MonetaryValue;
|
|
70
|
+
rate?: MonetaryValue;
|
|
71
|
+
total?: MonetaryValue;
|
|
72
72
|
};
|
|
73
73
|
meal_exchange?: {
|
|
74
74
|
id?: string;
|
|
@@ -76,10 +76,10 @@ export interface ShoppingCart {
|
|
|
76
76
|
};
|
|
77
77
|
badge_pay?: BadgePay;
|
|
78
78
|
};
|
|
79
|
-
taxes?:
|
|
79
|
+
taxes?: Taxes;
|
|
80
80
|
total?: {
|
|
81
|
-
amount?:
|
|
82
|
-
meals?:
|
|
81
|
+
amount?: MonetaryValue;
|
|
82
|
+
meals?: MonetaryValue;
|
|
83
83
|
};
|
|
84
84
|
exemptions?: {
|
|
85
85
|
tax?: boolean;
|
|
@@ -89,10 +89,10 @@ export interface ShoppingCart {
|
|
|
89
89
|
id?: string;
|
|
90
90
|
};
|
|
91
91
|
service_fee?: {
|
|
92
|
-
amount?:
|
|
92
|
+
amount?: MonetaryValue;
|
|
93
93
|
};
|
|
94
94
|
delivery_fee?: {
|
|
95
|
-
amount?:
|
|
95
|
+
amount?: MonetaryValue;
|
|
96
96
|
};
|
|
97
97
|
is?: {
|
|
98
98
|
// Shoppingcart Type: delivery, pickup
|
|
@@ -111,54 +111,72 @@ export interface ShoppingCart {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export interface
|
|
115
|
-
// item
|
|
114
|
+
export interface ItemResponse {
|
|
115
|
+
// can be cdl item id or stringified timestamp
|
|
116
116
|
id: string;
|
|
117
|
-
|
|
117
|
+
description?: Label;
|
|
118
|
+
// index based on cdl id or stringified timestamp
|
|
118
119
|
_index?: string;
|
|
119
|
-
quantity:
|
|
120
|
+
quantity: Quantity;
|
|
120
121
|
unit?: number;
|
|
121
|
-
price?:
|
|
122
|
-
amount?: number;
|
|
123
|
-
};
|
|
122
|
+
price?: Price;
|
|
124
123
|
// Final item price after LTO/Bundle/BOGO etc is applied on the item.
|
|
125
124
|
sale_price?: {
|
|
126
125
|
active?: boolean;
|
|
127
|
-
amount?:
|
|
126
|
+
amount?: MonetaryValue;
|
|
128
127
|
};
|
|
129
128
|
// Subtotal of the item including all options
|
|
130
129
|
_subtotal?: {
|
|
131
|
-
amount?:
|
|
130
|
+
amount?: MonetaryValue;
|
|
132
131
|
};
|
|
133
132
|
// Promo applied to this item
|
|
134
133
|
_promo?: {
|
|
135
|
-
amount?:
|
|
134
|
+
amount?: MonetaryValue;
|
|
135
|
+
};
|
|
136
|
+
// discount applied to this item
|
|
137
|
+
_discount?: {
|
|
138
|
+
amount?: MonetaryValue;
|
|
136
139
|
};
|
|
137
140
|
meta?: {
|
|
138
141
|
// menu id
|
|
139
142
|
menu?: string;
|
|
140
143
|
// brand id
|
|
141
144
|
brand?: string;
|
|
145
|
+
brand_label?: Label;
|
|
146
|
+
taxes?: string[];
|
|
147
|
+
menu_tax_tags?: string[];
|
|
148
|
+
orderable?: boolean;
|
|
149
|
+
volante_id?: string;
|
|
142
150
|
[index: string]: any;
|
|
143
151
|
};
|
|
144
152
|
options?: {
|
|
145
153
|
id?: string;
|
|
146
|
-
label?:
|
|
147
|
-
|
|
154
|
+
label?: Label;
|
|
155
|
+
meta?: {
|
|
156
|
+
taxes?: string[];
|
|
157
|
+
original_label?: Label;
|
|
148
158
|
};
|
|
149
|
-
meta?: any;
|
|
150
159
|
items?: {
|
|
151
|
-
// option
|
|
160
|
+
// option/modifier
|
|
152
161
|
id?: string;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
price?: Price;
|
|
163
|
+
quantity?: Quantity;
|
|
164
|
+
label?: Label;
|
|
156
165
|
// index
|
|
157
166
|
_index?: string;
|
|
158
|
-
meta?:
|
|
159
|
-
|
|
167
|
+
meta?: {
|
|
168
|
+
sort_number?: number;
|
|
169
|
+
original_label?: Label;
|
|
170
|
+
taxes?: string[];
|
|
171
|
+
};
|
|
160
172
|
amount_off_exclusions?: string[];
|
|
173
|
+
is?: {
|
|
174
|
+
disabled?: boolean;
|
|
175
|
+
};
|
|
161
176
|
}[];
|
|
177
|
+
is?: {
|
|
178
|
+
disabled?: boolean;
|
|
179
|
+
};
|
|
162
180
|
}[];
|
|
163
181
|
// Details about discount like BOGO, LTO, Bundle etc.
|
|
164
182
|
item_discount?: any;
|
|
@@ -166,25 +184,41 @@ export interface Item {
|
|
|
166
184
|
special_instructions?: string;
|
|
167
185
|
amount_off_exclusions?: string[];
|
|
168
186
|
added_on?: string;
|
|
169
|
-
|
|
187
|
+
meal_value?: IntegerValue;
|
|
188
|
+
category?: Label;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export type MonetaryValue = number;
|
|
192
|
+
|
|
193
|
+
export interface Label {
|
|
194
|
+
en?: string;
|
|
195
|
+
fr?: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export type IntegerValue = number;
|
|
199
|
+
|
|
200
|
+
export interface Price {
|
|
201
|
+
amount?: MonetaryValue;
|
|
170
202
|
}
|
|
171
203
|
|
|
204
|
+
export type Quantity = number;
|
|
205
|
+
|
|
172
206
|
export interface BadgePay {
|
|
173
207
|
id?: string;
|
|
174
|
-
total?:
|
|
208
|
+
total?: MonetaryValue;
|
|
175
209
|
tender?: string;
|
|
176
210
|
name?: string;
|
|
177
211
|
}
|
|
178
212
|
|
|
179
|
-
export interface
|
|
180
|
-
amount?:
|
|
181
|
-
rate?:
|
|
213
|
+
export interface Taxes {
|
|
214
|
+
amount?: MonetaryValue;
|
|
215
|
+
rate?: MonetaryValue;
|
|
182
216
|
breakdown?: {
|
|
183
|
-
taxable_amount?:
|
|
184
|
-
tax_collectable?:
|
|
185
|
-
combined_tax_rate?:
|
|
186
|
-
gst?:
|
|
187
|
-
pst?:
|
|
217
|
+
taxable_amount?: MonetaryValue;
|
|
218
|
+
tax_collectable?: MonetaryValue;
|
|
219
|
+
combined_tax_rate?: MonetaryValue;
|
|
220
|
+
gst?: MonetaryValue;
|
|
221
|
+
pst?: MonetaryValue;
|
|
188
222
|
[index: string]: any;
|
|
189
223
|
};
|
|
190
224
|
}
|
|
@@ -454,6 +488,8 @@ export interface WaitTime {
|
|
|
454
488
|
max: number;
|
|
455
489
|
// minimum wait time to the next time slot in minutes
|
|
456
490
|
min: number;
|
|
491
|
+
// the epoch timestamp of the next available ready time for a station
|
|
492
|
+
ready_time: number;
|
|
457
493
|
}
|
|
458
494
|
|
|
459
495
|
export interface Menu {
|
|
@@ -526,24 +562,21 @@ export interface Group {
|
|
|
526
562
|
// The number of units that belong to this item. For example, a dozen doughnuts should have a unit value of 12
|
|
527
563
|
unit?: number;
|
|
528
564
|
ingredients?: any[];
|
|
529
|
-
amount_off_exclusions?:
|
|
565
|
+
amount_off_exclusions?: AmountOffExclusionTypes[];
|
|
530
566
|
nutrition?: {
|
|
531
567
|
kcal?: number;
|
|
532
|
-
calories?:
|
|
533
|
-
serving_size?:
|
|
534
|
-
total_fat?:
|
|
535
|
-
saturated_fat?:
|
|
536
|
-
trans_fat?:
|
|
537
|
-
cholesterol?:
|
|
538
|
-
sodium?:
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
sugars?: any;
|
|
545
|
-
protein?: any;
|
|
546
|
-
well_being?: any;
|
|
568
|
+
calories?: Nutrition;
|
|
569
|
+
serving_size?: Nutrition;
|
|
570
|
+
total_fat?: Nutrition;
|
|
571
|
+
saturated_fat?: Nutrition;
|
|
572
|
+
trans_fat?: Nutrition;
|
|
573
|
+
cholesterol?: Nutrition;
|
|
574
|
+
sodium?: Nutrition;
|
|
575
|
+
total_carbohydrate?: Nutrition;
|
|
576
|
+
dietary_fiber?: Nutrition;
|
|
577
|
+
sugars?: Nutrition;
|
|
578
|
+
protein?: Nutrition;
|
|
579
|
+
well_being?: Nutrition;
|
|
547
580
|
[index: string]: any;
|
|
548
581
|
};
|
|
549
582
|
certified?: {
|
|
@@ -593,7 +626,7 @@ export interface Group {
|
|
|
593
626
|
sku?: number;
|
|
594
627
|
nutrition?: {
|
|
595
628
|
kcal?: number;
|
|
596
|
-
calories?:
|
|
629
|
+
calories?: Nutrition;
|
|
597
630
|
};
|
|
598
631
|
certified?: {
|
|
599
632
|
vegan?: boolean;
|
|
@@ -614,7 +647,7 @@ export interface Group {
|
|
|
614
647
|
hidden?: boolean;
|
|
615
648
|
out_of_stock?: boolean;
|
|
616
649
|
};
|
|
617
|
-
amount_off_exclusions?:
|
|
650
|
+
amount_off_exclusions?: AmountOffExclusionTypes[];
|
|
618
651
|
}[];
|
|
619
652
|
min?: number;
|
|
620
653
|
max?: number;
|
|
@@ -685,6 +718,13 @@ export interface Group {
|
|
|
685
718
|
};
|
|
686
719
|
}
|
|
687
720
|
|
|
721
|
+
export interface Nutrition {
|
|
722
|
+
amount?: number;
|
|
723
|
+
unit?: string;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export type AmountOffExclusionTypes = string;
|
|
727
|
+
|
|
688
728
|
export interface CognitionStore {
|
|
689
729
|
// UUID for external store
|
|
690
730
|
uuid?: string;
|
|
@@ -733,7 +773,7 @@ export interface PostPartnerStandardcognitionShoppingcartBody {
|
|
|
733
773
|
meta?: any;
|
|
734
774
|
}
|
|
735
775
|
|
|
736
|
-
export type PostPartnerStandardcognitionShoppingcartResponse =
|
|
776
|
+
export type PostPartnerStandardcognitionShoppingcartResponse = ShoppingCartResponse;
|
|
737
777
|
|
|
738
778
|
export interface PostPartnerStandardcognitionShoppingcartRequest extends BaseRequest {
|
|
739
779
|
body: PostPartnerStandardcognitionShoppingcartBody;
|