@compassdigital/sdk.typescript 4.94.1 → 4.95.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.
- package/lib/index.d.ts +104 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +111 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/announcement.d.ts +17 -9
- package/lib/interface/announcement.d.ts.map +1 -1
- package/lib/interface/compassconnect.d.ts +0 -6
- package/lib/interface/compassconnect.d.ts.map +1 -1
- package/lib/interface/consumer.d.ts +160 -4
- package/lib/interface/consumer.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +319 -1
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/notification.d.ts.map +1 -1
- package/lib/interface/order.d.ts +1 -0
- package/lib/interface/order.d.ts.map +1 -1
- package/lib/interface/partner.d.ts +3 -0
- package/lib/interface/partner.d.ts.map +1 -1
- package/lib/interface/vendor.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +280 -2
- package/src/interface/announcement.ts +26 -10
- package/src/interface/compassconnect.ts +0 -9
- package/src/interface/consumer.ts +220 -4
- package/src/interface/menu.ts +385 -1
- package/src/interface/notification.ts +0 -1
- package/src/interface/order.ts +2 -0
- package/src/interface/partner.ts +3 -0
- package/src/interface/vendor.ts +0 -6
|
@@ -23,11 +23,10 @@ export interface AnnouncementPostRequestBody {
|
|
|
23
23
|
// True if all the sites are linked
|
|
24
24
|
is_global?: boolean;
|
|
25
25
|
allowed_resources?: string[];
|
|
26
|
-
position
|
|
26
|
+
position?: number;
|
|
27
27
|
//@deprecated
|
|
28
28
|
active?: boolean;
|
|
29
|
-
|
|
30
|
-
status?: 'draft' | 'active' | 'disabled';
|
|
29
|
+
status?: Status;
|
|
31
30
|
// Announcement Properties
|
|
32
31
|
info?: {
|
|
33
32
|
en?: AnnouncementInfo;
|
|
@@ -87,7 +86,7 @@ export interface Announcement {
|
|
|
87
86
|
name: string;
|
|
88
87
|
// Announcement Type
|
|
89
88
|
type: string;
|
|
90
|
-
key
|
|
89
|
+
key?: string;
|
|
91
90
|
// App name
|
|
92
91
|
app: 'Boost' | 'Thrive' | 'Nourish' | 'JJKitchen' | 'Rogers';
|
|
93
92
|
// True if all the sites are linked
|
|
@@ -97,7 +96,7 @@ export interface Announcement {
|
|
|
97
96
|
active: boolean;
|
|
98
97
|
// Status of the announcement
|
|
99
98
|
status?: 'draft' | 'active' | 'disabled';
|
|
100
|
-
schedule
|
|
99
|
+
schedule?: Schedule;
|
|
101
100
|
// Date created
|
|
102
101
|
created_at: string;
|
|
103
102
|
// Date modified
|
|
@@ -121,9 +120,9 @@ export interface Announcements {
|
|
|
121
120
|
|
|
122
121
|
export interface AnnouncementInfo {
|
|
123
122
|
image_url?: string;
|
|
124
|
-
title
|
|
125
|
-
description
|
|
126
|
-
sub_text
|
|
123
|
+
title?: string;
|
|
124
|
+
description?: string;
|
|
125
|
+
sub_text?: string;
|
|
127
126
|
button_text?: string;
|
|
128
127
|
}
|
|
129
128
|
|
|
@@ -155,13 +154,20 @@ export interface Schedule {
|
|
|
155
154
|
}[];
|
|
156
155
|
}
|
|
157
156
|
|
|
157
|
+
export type Status = 'draft' | 'active' | 'disabled';
|
|
158
|
+
|
|
158
159
|
// POST /announcement - Create Announcement
|
|
159
160
|
|
|
161
|
+
export interface PostAnnouncementQuery {
|
|
162
|
+
// Bypasses the default schedule creation logic
|
|
163
|
+
no_default_schedule?: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
160
166
|
export type PostAnnouncementBody = AnnouncementPostRequestBody;
|
|
161
167
|
|
|
162
168
|
export type PostAnnouncementResponse = Announcement;
|
|
163
169
|
|
|
164
|
-
export interface PostAnnouncementRequest extends BaseRequest {
|
|
170
|
+
export interface PostAnnouncementRequest extends BaseRequest, RequestQuery<PostAnnouncementQuery> {
|
|
165
171
|
body: PostAnnouncementBody;
|
|
166
172
|
}
|
|
167
173
|
|
|
@@ -199,6 +205,8 @@ export interface GetAnnouncementsQuery {
|
|
|
199
205
|
sort_by?: string;
|
|
200
206
|
// Sort order (ASC or DESC)
|
|
201
207
|
sort_order?: string;
|
|
208
|
+
// Filter by status - 'active', 'draft', 'disabled'
|
|
209
|
+
status?: string;
|
|
202
210
|
// Graphql query string
|
|
203
211
|
_query?: string;
|
|
204
212
|
}
|
|
@@ -233,11 +241,19 @@ export interface PutAnnouncementPath {
|
|
|
233
241
|
id: string;
|
|
234
242
|
}
|
|
235
243
|
|
|
244
|
+
export interface PutAnnouncementQuery {
|
|
245
|
+
// Bypasses the default schedule creation logic
|
|
246
|
+
no_default_schedule?: boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
236
249
|
export type PutAnnouncementBody = AnnouncementPutRequestBody;
|
|
237
250
|
|
|
238
251
|
export type PutAnnouncementResponse = Announcement;
|
|
239
252
|
|
|
240
|
-
export interface PutAnnouncementRequest
|
|
253
|
+
export interface PutAnnouncementRequest
|
|
254
|
+
extends BaseRequest,
|
|
255
|
+
RequestQuery<PutAnnouncementQuery>,
|
|
256
|
+
PutAnnouncementPath {
|
|
241
257
|
body: PutAnnouncementBody;
|
|
242
258
|
}
|
|
243
259
|
|
|
@@ -55,15 +55,6 @@ export interface Auth {
|
|
|
55
55
|
refresh_token?: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export interface Compassconnect {
|
|
59
|
-
// compassconnect
|
|
60
|
-
id: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface Compassconnects {
|
|
64
|
-
compassconnects: Compassconnect[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
58
|
// GET /compassconnect/oms_token - Gets an OMS token
|
|
68
59
|
|
|
69
60
|
export interface GetCompassconnectOmsTokenQuery {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { RequestQuery, BaseRequest } from './util';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface PaymentMethodIsStatus {
|
|
7
7
|
eligible: boolean;
|
|
8
8
|
validated?: boolean;
|
|
9
9
|
preferred?: boolean;
|
|
@@ -16,7 +16,7 @@ export interface Tender {
|
|
|
16
16
|
type?: string;
|
|
17
17
|
currency?: string;
|
|
18
18
|
tender_number?: string;
|
|
19
|
-
is:
|
|
19
|
+
is: PaymentMethodIsStatus;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface TenderList {
|
|
@@ -36,7 +36,7 @@ export interface CreditCard {
|
|
|
36
36
|
billing_address?: BillingAddress;
|
|
37
37
|
card_type?: string;
|
|
38
38
|
expiry?: ExpiryDate;
|
|
39
|
-
is:
|
|
39
|
+
is: PaymentMethodIsStatus;
|
|
40
40
|
masked_card_number?: string;
|
|
41
41
|
name_on_card?: string;
|
|
42
42
|
nickname?: string;
|
|
@@ -49,7 +49,7 @@ export interface CreditCardData {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface DigitalWalletFlavor {
|
|
52
|
-
is:
|
|
52
|
+
is: PaymentMethodIsStatus;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export interface DigitalWallet {
|
|
@@ -76,6 +76,195 @@ export interface NotFoundErrorDTO {
|
|
|
76
76
|
data: Record<string, any>;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
export interface Brand {
|
|
80
|
+
id: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface OrderDate {
|
|
85
|
+
accepted?: string;
|
|
86
|
+
created?: string;
|
|
87
|
+
modified?: string;
|
|
88
|
+
should_start?: string;
|
|
89
|
+
completion_warning?: string;
|
|
90
|
+
ready?: string;
|
|
91
|
+
started?: string;
|
|
92
|
+
show_as_active_until?: string;
|
|
93
|
+
no_show?: string;
|
|
94
|
+
collected?: string;
|
|
95
|
+
delivered?: string;
|
|
96
|
+
pickup?: string;
|
|
97
|
+
cancelled?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface OrderDetails {
|
|
101
|
+
name?: string;
|
|
102
|
+
display_id?: string;
|
|
103
|
+
contact_number?: string;
|
|
104
|
+
country_code?: string;
|
|
105
|
+
order_type?: string;
|
|
106
|
+
duration?: string;
|
|
107
|
+
destination?: string;
|
|
108
|
+
instructions?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface Price {
|
|
112
|
+
amount?: number;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface RefundItem {
|
|
116
|
+
id?: string;
|
|
117
|
+
_index?: string;
|
|
118
|
+
quantity?: number;
|
|
119
|
+
price?: Price;
|
|
120
|
+
reason?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface OrderIsStatus {
|
|
124
|
+
accepted?: boolean;
|
|
125
|
+
in_progress?: boolean;
|
|
126
|
+
ready?: boolean;
|
|
127
|
+
out_for_delivery?: boolean;
|
|
128
|
+
delivered?: boolean;
|
|
129
|
+
checkin_order?: boolean;
|
|
130
|
+
dining_hall_order?: boolean;
|
|
131
|
+
no_show?: boolean;
|
|
132
|
+
collected?: boolean;
|
|
133
|
+
cancelled?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface CartTotal {
|
|
137
|
+
amount?: number;
|
|
138
|
+
meals?: number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface Label {
|
|
142
|
+
en?: string;
|
|
143
|
+
fr?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface QuantityByWeight {
|
|
147
|
+
unit?: string;
|
|
148
|
+
value?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface SalePrice {
|
|
152
|
+
active?: boolean;
|
|
153
|
+
amount?: number;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface Modifier {
|
|
157
|
+
id: string;
|
|
158
|
+
price?: Price;
|
|
159
|
+
quantity?: number;
|
|
160
|
+
label?: Label;
|
|
161
|
+
_index?: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface ModifierGroup {
|
|
165
|
+
id: string;
|
|
166
|
+
label?: Label;
|
|
167
|
+
items?: Modifier[];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface OrderItemRating {
|
|
171
|
+
// order id
|
|
172
|
+
id: string;
|
|
173
|
+
// menu id
|
|
174
|
+
menu: string;
|
|
175
|
+
// item id
|
|
176
|
+
item: string;
|
|
177
|
+
// rating score
|
|
178
|
+
score: number;
|
|
179
|
+
// review comment
|
|
180
|
+
comment: string;
|
|
181
|
+
// review tags
|
|
182
|
+
reason: string[];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface CartItem {
|
|
186
|
+
id: string;
|
|
187
|
+
description?: Label;
|
|
188
|
+
_index?: string;
|
|
189
|
+
quantity: number;
|
|
190
|
+
quantity_by_weight?: QuantityByWeight;
|
|
191
|
+
price?: Price;
|
|
192
|
+
sale_price?: SalePrice;
|
|
193
|
+
weighed_price?: Price;
|
|
194
|
+
_subtotal?: Price;
|
|
195
|
+
options?: ModifierGroup[];
|
|
196
|
+
label?: Label;
|
|
197
|
+
name?: string;
|
|
198
|
+
review: OrderItemRating;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface ShoppingCart {
|
|
202
|
+
id: string;
|
|
203
|
+
total?: CartTotal;
|
|
204
|
+
items?: CartItem[];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Order {
|
|
208
|
+
id?: string;
|
|
209
|
+
reorder_eligibility?:
|
|
210
|
+
| 'eligible'
|
|
211
|
+
| 'order_type_ineligible'
|
|
212
|
+
| 'location_ineligible'
|
|
213
|
+
| 'active_order'
|
|
214
|
+
| 'old_order'
|
|
215
|
+
| 'marketplace_order'
|
|
216
|
+
| 'duplicate_order'
|
|
217
|
+
| 'brand_unavailable'
|
|
218
|
+
| 'menu_unavailable'
|
|
219
|
+
| 'items_unavailable'
|
|
220
|
+
| 'refunded_order'
|
|
221
|
+
| 'modifiers_unavailable'
|
|
222
|
+
| 'modified_items'
|
|
223
|
+
| 'cancelled_order';
|
|
224
|
+
location_brand?: Brand;
|
|
225
|
+
location?: string;
|
|
226
|
+
date?: OrderDate;
|
|
227
|
+
details?: OrderDetails;
|
|
228
|
+
pickup?: string;
|
|
229
|
+
requested_date?: string;
|
|
230
|
+
refunds?: RefundItem[];
|
|
231
|
+
pickup_id?: string;
|
|
232
|
+
is?: OrderIsStatus;
|
|
233
|
+
shoppingcart?: ShoppingCart;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface GetCustomerOrdersResponseDTO {
|
|
237
|
+
orders: Order[];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface BadRequestErrorDTO {
|
|
241
|
+
message: string;
|
|
242
|
+
code: number;
|
|
243
|
+
data: Record<string, any>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface ReviewOrderItemRatings {
|
|
247
|
+
// menu id
|
|
248
|
+
menu: string;
|
|
249
|
+
// item id
|
|
250
|
+
item: string;
|
|
251
|
+
// rating score
|
|
252
|
+
score: number;
|
|
253
|
+
// review comment
|
|
254
|
+
comment: string;
|
|
255
|
+
// review tags
|
|
256
|
+
reason: string[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface PostReviewOrderItemRatingsRequestDTO {
|
|
260
|
+
orderId: string;
|
|
261
|
+
reviews: ReviewOrderItemRatings[];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface PostReviewOrderItemRatingsResponseDTO {
|
|
265
|
+
reviews: OrderItemRating[];
|
|
266
|
+
}
|
|
267
|
+
|
|
79
268
|
// GET /consumer/v1/health-check
|
|
80
269
|
|
|
81
270
|
export interface HealthCheckControllerExecuteQuery {
|
|
@@ -105,3 +294,30 @@ export type GetPaymentListByBrandResponse = ListAvailablePaymentsResponseDTO;
|
|
|
105
294
|
export interface GetPaymentListByBrandRequest
|
|
106
295
|
extends BaseRequest,
|
|
107
296
|
RequestQuery<GetPaymentListByBrandQuery> {}
|
|
297
|
+
|
|
298
|
+
// GET /consumer/customer-orders - Get customer orders
|
|
299
|
+
|
|
300
|
+
export interface GetCustomerOrdersQuery {
|
|
301
|
+
// Filter orders by their requested date. Only return orders that have a date greater than or equal to the date. Default is the current time in milliseconds.
|
|
302
|
+
start?: number;
|
|
303
|
+
// Filter orders by their requested date. Only return orders that have a date less than or equal to the date. Default is 24 hours from the current time in milliseconds.
|
|
304
|
+
end?: number;
|
|
305
|
+
// Graphql query string
|
|
306
|
+
_query?: string;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type GetCustomerOrdersResponse = GetCustomerOrdersResponseDTO;
|
|
310
|
+
|
|
311
|
+
export interface GetCustomerOrdersRequest
|
|
312
|
+
extends BaseRequest,
|
|
313
|
+
RequestQuery<GetCustomerOrdersQuery> {}
|
|
314
|
+
|
|
315
|
+
// POST /consumer/review/order/item-ratings - Submit review containing order item ratings
|
|
316
|
+
|
|
317
|
+
export type PostReviewOrderItemRatingsBody = PostReviewOrderItemRatingsRequestDTO;
|
|
318
|
+
|
|
319
|
+
export type PostReviewOrderItemRatingsResponse = PostReviewOrderItemRatingsResponseDTO;
|
|
320
|
+
|
|
321
|
+
export interface PostReviewOrderItemRatingsRequest extends BaseRequest {
|
|
322
|
+
body: PostReviewOrderItemRatingsBody;
|
|
323
|
+
}
|