@compassdigital/sdk.typescript 3.29.0 → 3.31.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.
@@ -114,6 +114,9 @@ export interface Options {
114
114
  pickup_id?: string;
115
115
  // user_id
116
116
  user_id?: string;
117
+ payment_type?: string;
118
+ // ID('payment', '<provider>', 'tender', <timestamp via Data.now()>
119
+ tender_id?: string;
117
120
  }
118
121
 
119
122
  export interface Success {
@@ -125,6 +128,12 @@ export interface Error {
125
128
  code?: number;
126
129
  }
127
130
 
131
+ export interface BadgePayTender {
132
+ balance?: number;
133
+ // ID('payment', '<provider>', 'tender', <timestamp via Data.now()>
134
+ id?: string;
135
+ }
136
+
128
137
  // POST /payment/{id}/transaction
129
138
 
130
139
  export interface PostPaymentTransactionPath {
@@ -134,7 +143,7 @@ export interface PostPaymentTransactionPath {
134
143
 
135
144
  export interface PostPaymentTransactionBody {
136
145
  // The payment method token to use for the payment
137
- payment_method_token: string;
146
+ payment_method_token?: string;
138
147
  // The amount to charge to the payment method
139
148
  amount: string;
140
149
  options?: Options;
@@ -405,3 +414,36 @@ export interface GetPaymentHcaptchaVerifyResponse {
405
414
  export interface GetPaymentHcaptchaVerifyRequest
406
415
  extends BaseRequest,
407
416
  RequestQuery<GetPaymentHcaptchaVerifyQuery> {}
417
+
418
+ // GET /payment/{id}/badgepay
419
+
420
+ export interface GetPaymentBadgepayPath {
421
+ // TODO: add parameter to swagger.json
422
+ id: string;
423
+ }
424
+
425
+ export interface GetPaymentBadgepayResponse {
426
+ tenders?: BadgePayTender[];
427
+ }
428
+
429
+ export interface GetPaymentBadgepayRequest extends BaseRequest, GetPaymentBadgepayPath {}
430
+
431
+ // POST /payment/{id}/badgepay
432
+
433
+ export interface PostPaymentBadgepayPath {
434
+ // TODO: add parameter to swagger.json
435
+ id: string;
436
+ }
437
+
438
+ export interface PostPaymentBadgepayBody {
439
+ // The reference ID returned from FP account confirmation
440
+ token: string;
441
+ }
442
+
443
+ export interface PostPaymentBadgepayResponse {
444
+ tenders?: BadgePayTender[];
445
+ }
446
+
447
+ export interface PostPaymentBadgepayRequest extends BaseRequest, PostPaymentBadgepayPath {
448
+ body: PostPaymentBadgepayBody;
449
+ }
@@ -87,6 +87,12 @@ export interface Promo {
87
87
  email?: string;
88
88
  }
89
89
 
90
+ export interface BadgePay {
91
+ id?: string;
92
+ total?: number;
93
+ tender?: string;
94
+ }
95
+
90
96
  export interface Payment {
91
97
  email?: string;
92
98
  mealplan?: {
@@ -113,6 +119,11 @@ export interface Payment {
113
119
  rate?: number;
114
120
  total?: number;
115
121
  };
122
+ meal_exchange?: {
123
+ id?: string;
124
+ tender?: string;
125
+ };
126
+ badge_pay?: BadgePay;
116
127
  }
117
128
 
118
129
  export interface MenuID {
@@ -120,7 +131,7 @@ export interface MenuID {
120
131
  }
121
132
 
122
133
  export interface ShoppingCarts {
123
- shoppingcarts?: ShoppingCart[];
134
+ shoppingcarts?: ShoppingCartResponse[];
124
135
  }
125
136
 
126
137
  export interface OrderId {
@@ -128,7 +139,31 @@ export interface OrderId {
128
139
  id?: string;
129
140
  }
130
141
 
131
- export interface ShoppingCart {
142
+ export interface ShoppingCartRequest {
143
+ // location
144
+ location?: string;
145
+ // menu
146
+ menu?: string;
147
+ // brand
148
+ brand?: string;
149
+ is?: {
150
+ // Shoppingcart Type: delivery, pickup
151
+ type?: string;
152
+ // If an order should be paid with meal exchange. If true, this will calculate meals total.
153
+ mx_cart?: boolean;
154
+ // If a user's email domain is a match in a sites list of tax exempt domains
155
+ email_tax_exempt?: boolean;
156
+ // Indicates to clients that a tax recalculation is required
157
+ tax_calculation_required?: boolean;
158
+ };
159
+ meta?: {
160
+ // Raw request from any vendor integrated with CDL
161
+ vendor?: any;
162
+ [index: string]: any;
163
+ };
164
+ }
165
+
166
+ export interface ShoppingCartResponse {
132
167
  // shoppingcart
133
168
  id?: string;
134
169
  // location
@@ -195,6 +230,7 @@ export interface ShoppingCart {
195
230
  id?: string;
196
231
  tender?: string;
197
232
  };
233
+ badge_pay?: BadgePay;
198
234
  };
199
235
  taxes?: taxes;
200
236
  total?: {
@@ -219,8 +255,8 @@ export interface ShoppingCart {
219
255
  type?: string;
220
256
  // If an order should be paid with meal exchange. If true, this will calculate meals total.
221
257
  mx_cart?: boolean;
222
- // If a user's email domain is a match in a sites list of tax exempt domains
223
- domain_tax_exempt?: boolean;
258
+ // If a user's email or email domain is a match in a sites list of tax exempt emails or domains
259
+ email_tax_exempt?: boolean;
224
260
  // Indicates to clients that a tax recalculation is required
225
261
  tax_calculation_required?: boolean;
226
262
  };
@@ -231,11 +267,13 @@ export interface ShoppingCart {
231
267
  };
232
268
  }
233
269
 
270
+ export type ShoppingCart = ShoppingCartResponse;
271
+
234
272
  // POST /shoppingcart/ - Create a new ShoppingCart
235
273
 
236
- export type PostShoppingcartCartBody = ShoppingCart;
274
+ export type PostShoppingcartCartBody = ShoppingCartRequest;
237
275
 
238
- export type PostShoppingcartCartResponse = ShoppingCart;
276
+ export type PostShoppingcartCartResponse = ShoppingCartResponse;
239
277
 
240
278
  export interface PostShoppingcartCartRequest extends BaseRequest {
241
279
  body: PostShoppingcartCartBody;
@@ -250,7 +288,7 @@ export interface PutShoppingcartCartItemsPath {
250
288
 
251
289
  export type PutShoppingcartCartItemsBody = Items;
252
290
 
253
- export type PutShoppingcartCartItemsResponse = ShoppingCart;
291
+ export type PutShoppingcartCartItemsResponse = ShoppingCartResponse;
254
292
 
255
293
  export interface PutShoppingcartCartItemsRequest extends BaseRequest, PutShoppingcartCartItemsPath {
256
294
  body: PutShoppingcartCartItemsBody;
@@ -265,7 +303,7 @@ export interface DeleteShoppingcartCartItemsPath {
265
303
 
266
304
  export type DeleteShoppingcartCartItemsBody = Items;
267
305
 
268
- export type DeleteShoppingcartCartItemsResponse = ShoppingCart;
306
+ export type DeleteShoppingcartCartItemsResponse = ShoppingCartResponse;
269
307
 
270
308
  export interface DeleteShoppingcartCartItemsRequest
271
309
  extends BaseRequest,
@@ -280,7 +318,7 @@ export interface GetShoppingcartCartPath {
280
318
  id: string;
281
319
  }
282
320
 
283
- export type GetShoppingcartCartResponse = ShoppingCart;
321
+ export type GetShoppingcartCartResponse = ShoppingCartResponse;
284
322
 
285
323
  export interface GetShoppingcartCartRequest extends BaseRequest, GetShoppingcartCartPath {}
286
324
 
@@ -291,9 +329,9 @@ export interface PatchShoppingcartCartPath {
291
329
  id: string;
292
330
  }
293
331
 
294
- export type PatchShoppingcartCartBody = ShoppingCart;
332
+ export type PatchShoppingcartCartBody = ShoppingCartResponse;
295
333
 
296
- export type PatchShoppingcartCartResponse = ShoppingCart;
334
+ export type PatchShoppingcartCartResponse = ShoppingCartResponse;
297
335
 
298
336
  export interface PatchShoppingcartCartRequest extends BaseRequest, PatchShoppingcartCartPath {
299
337
  body: PatchShoppingcartCartBody;
@@ -308,7 +346,7 @@ export interface PutShoppingcartCartPromoPath {
308
346
 
309
347
  export type PutShoppingcartCartPromoBody = Promo;
310
348
 
311
- export type PutShoppingcartCartPromoResponse = ShoppingCart;
349
+ export type PutShoppingcartCartPromoResponse = ShoppingCartResponse;
312
350
 
313
351
  export interface PutShoppingcartCartPromoRequest extends BaseRequest, PutShoppingcartCartPromoPath {
314
352
  body: PutShoppingcartCartPromoBody;
@@ -321,7 +359,7 @@ export interface DeleteShoppingcartCartPromoPath {
321
359
  id: string;
322
360
  }
323
361
 
324
- export type DeleteShoppingcartCartPromoResponse = ShoppingCart;
362
+ export type DeleteShoppingcartCartPromoResponse = ShoppingCartResponse;
325
363
 
326
364
  export interface DeleteShoppingcartCartPromoRequest
327
365
  extends BaseRequest,
@@ -336,7 +374,7 @@ export interface PutShoppingcartCartPaymentPath {
336
374
 
337
375
  export type PutShoppingcartCartPaymentBody = Payment;
338
376
 
339
- export type PutShoppingcartCartPaymentResponse = ShoppingCart;
377
+ export type PutShoppingcartCartPaymentResponse = ShoppingCartResponse;
340
378
 
341
379
  export interface PutShoppingcartCartPaymentRequest
342
380
  extends BaseRequest,
@@ -353,7 +391,7 @@ export interface PutShoppingcartCartOrderPath {
353
391
 
354
392
  export type PutShoppingcartCartOrderBody = OrderId;
355
393
 
356
- export type PutShoppingcartCartOrderResponse = ShoppingCart;
394
+ export type PutShoppingcartCartOrderResponse = ShoppingCartResponse;
357
395
 
358
396
  export interface PutShoppingcartCartOrderRequest extends BaseRequest, PutShoppingcartCartOrderPath {
359
397
  body: PutShoppingcartCartOrderBody;
@@ -371,7 +409,7 @@ export interface PostShoppingcartCloneCartBody {
371
409
  order_type?: string;
372
410
  }
373
411
 
374
- export type PostShoppingcartCloneCartResponse = ShoppingCart;
412
+ export type PostShoppingcartCloneCartResponse = ShoppingCartResponse;
375
413
 
376
414
  export interface PostShoppingcartCloneCartRequest
377
415
  extends BaseRequest,
@@ -386,7 +424,7 @@ export interface PutShoppingcartCheckoutPath {
386
424
  id: string;
387
425
  }
388
426
 
389
- export type PutShoppingcartCheckoutResponse = ShoppingCart;
427
+ export type PutShoppingcartCheckoutResponse = ShoppingCartResponse;
390
428
 
391
429
  export interface PutShoppingcartCheckoutRequest extends BaseRequest, PutShoppingcartCheckoutPath {}
392
430
 
@@ -74,6 +74,11 @@ export interface GuestUserCreate {
74
74
  realm?: string;
75
75
  }
76
76
 
77
+ export interface GuestUserToken {
78
+ // realm
79
+ realm?: string;
80
+ }
81
+
77
82
  export interface Changepassword {
78
83
  password?: string;
79
84
  new_password?: string;
@@ -90,6 +95,7 @@ export interface Resetpassword {
90
95
 
91
96
  export interface ResetpasswordSuccess {
92
97
  code?: number;
98
+ success?: boolean;
93
99
  }
94
100
 
95
101
  export interface VerifyEmail {
@@ -124,6 +130,15 @@ export interface guestAuth {
124
130
  };
125
131
  // user
126
132
  user?: string;
133
+ profile?: User;
134
+ }
135
+
136
+ export interface guestAuthToken {
137
+ token?: string;
138
+ access?: {
139
+ token?: string;
140
+ expires?: string;
141
+ };
127
142
  }
128
143
 
129
144
  export type Permission = string;
@@ -695,3 +710,13 @@ export type PostUserGuestUserResponse = guestAuth;
695
710
  export interface PostUserGuestUserRequest extends BaseRequest {
696
711
  body: PostUserGuestUserBody;
697
712
  }
713
+
714
+ // POST /user/guest/token - Creates a temporary guest token
715
+
716
+ export type PostUserGuestTokenBody = GuestUserToken;
717
+
718
+ export type PostUserGuestTokenResponse = guestAuthToken;
719
+
720
+ export interface PostUserGuestTokenRequest extends BaseRequest {
721
+ body: PostUserGuestTokenBody;
722
+ }