@compassdigital/sdk.typescript 3.21.0 → 3.23.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.
@@ -0,0 +1,554 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
3
+ import { RequestQuery, BaseRequest } from "./util";
4
+
5
+ export interface Error {
6
+ message?: string;
7
+ code?: number;
8
+ }
9
+
10
+ export interface EnrollResponse {
11
+ points?: number;
12
+ loyalty_card_id?: number;
13
+ }
14
+
15
+ export interface Points {
16
+ points?: number;
17
+ }
18
+
19
+ export interface UserId {
20
+ user_id?: string;
21
+ }
22
+
23
+ export interface Offer {
24
+ id?: number;
25
+ name?: string;
26
+ promotion_type?: string;
27
+ target?: string;
28
+ image_url?: string;
29
+ description?: string;
30
+ terms_and_conditions?: string;
31
+ instructions?: string;
32
+ pos_code?: string;
33
+ pos_instructions?: string;
34
+ destination_url?: string;
35
+ created_at?: string;
36
+ updated_at?: string;
37
+ start_date?: string;
38
+ end_date?: string;
39
+ }
40
+
41
+ export interface EnrollmentStatus {
42
+ is_enrolled?: boolean;
43
+ loyalty_card_id?: number;
44
+ }
45
+
46
+ export interface Success {
47
+ success?: boolean;
48
+ }
49
+
50
+ export interface EarningOpportunity {
51
+ name?: string;
52
+ event_type?: string;
53
+ description?: string;
54
+ order_index?: number;
55
+ destination_url?: string;
56
+ image_url?: string;
57
+ points?: number;
58
+ cap_reached?: boolean;
59
+ rule_type?: string;
60
+ }
61
+
62
+ export interface Reward {
63
+ id?: number;
64
+ name?: string;
65
+ description?: string;
66
+ image_url?: string;
67
+ instructions?: string;
68
+ points_needed_to_redeem?: number;
69
+ status?: boolean;
70
+ expiration_date?: string;
71
+ points_remaining_to_redeem?: number;
72
+ dollar_value?: number;
73
+ }
74
+
75
+ export interface Coupon {
76
+ id?: string;
77
+ name?: string;
78
+ status?: string;
79
+ email?: string;
80
+ description?: string;
81
+ expiry_date?: string;
82
+ redeem_instructions?: string;
83
+ image_url?: string;
84
+ dollar_value?: number;
85
+ }
86
+
87
+ export interface RecordResponse {
88
+ points?: number;
89
+ event_id?: string;
90
+ }
91
+
92
+ export interface Item {
93
+ // item id
94
+ id: string;
95
+ label?: string;
96
+ quantity: number;
97
+ price: {
98
+ amount?: number;
99
+ };
100
+ [index: string]: any;
101
+ }
102
+
103
+ export interface HistoryTransaction {
104
+ event_type?: string;
105
+ created_at?: string;
106
+ points?: number;
107
+ value?: number;
108
+ channel?: string;
109
+ display_detail?: string;
110
+ }
111
+
112
+ export interface RewardInfo {
113
+ id?: number;
114
+ points?: number;
115
+ cost?: number;
116
+ description?: string;
117
+ expiry_date?: string;
118
+ event_id?: number;
119
+ image_url?: string;
120
+ name?: string;
121
+ pos_code?: string;
122
+ pos_instructions?: string;
123
+ redeem_instructions?: string;
124
+ reward_type?: string;
125
+ coupon_id?: string;
126
+ }
127
+
128
+ export interface LoyaltyUser {
129
+ id?: string;
130
+ channel?: string;
131
+ email?: string;
132
+ first_name?: string;
133
+ last_name?: string;
134
+ birthday?: string;
135
+ balance?: number;
136
+ lifetime_balance?: number;
137
+ loyalty_provider_user_id?: number;
138
+ enrolled_at?: string;
139
+ last_activity?: string;
140
+ updated_at?: string;
141
+ last_reward_date?: string;
142
+ last_reward_event_id?: string;
143
+ }
144
+
145
+ export interface Event {
146
+ id?: string;
147
+ external_id?: string;
148
+ created_at?: string;
149
+ updated_at?: string;
150
+ points?: number;
151
+ value?: number;
152
+ loyalty_provider_user_id?: number;
153
+ detail?: string;
154
+ display_detail?: string;
155
+ event_type?: string;
156
+ channel?: string;
157
+ status?: number;
158
+ email?: string;
159
+ expires_at?: string;
160
+ }
161
+
162
+ // POST /loyalty/{id}/enroll/{user_id} - Enroll logged in user in Loyalty program
163
+
164
+ export interface PostLoyaltyEnrollPath {
165
+ // Loyalty Provider id
166
+ id: string;
167
+ // CompassDigital User id
168
+ user_id: string;
169
+ }
170
+
171
+ export interface PostLoyaltyEnrollQuery {
172
+ // Enrollment Channel
173
+ channel?: string;
174
+ }
175
+
176
+ export type PostLoyaltyEnrollResponse = EnrollResponse;
177
+
178
+ export interface PostLoyaltyEnrollRequest
179
+ extends BaseRequest,
180
+ RequestQuery<PostLoyaltyEnrollQuery>,
181
+ PostLoyaltyEnrollPath {}
182
+
183
+ // GET /loyalty/{id}/points - Get potential points user could earn from certain event in Loyalty program
184
+
185
+ export interface GetLoyaltyPointsPath {
186
+ // Loyalty Provider id
187
+ id: string;
188
+ // CompassDigital User id
189
+ user_id: string;
190
+ }
191
+
192
+ export interface GetLoyaltyPointsQuery {
193
+ // event type
194
+ event: string;
195
+ }
196
+
197
+ export type GetLoyaltyPointsResponse = Points;
198
+
199
+ export interface GetLoyaltyPointsRequest
200
+ extends BaseRequest,
201
+ RequestQuery<GetLoyaltyPointsQuery>,
202
+ GetLoyaltyPointsPath {}
203
+
204
+ // GET /loyalty/{id}/offers/{user_id} - Get offers for the logged in user
205
+
206
+ export interface GetLoyaltyOffersPath {
207
+ // Loyalty Provider id
208
+ id: string;
209
+ // CompassDigital User id
210
+ user_id: string;
211
+ }
212
+
213
+ export interface GetLoyaltyOffersResponse {
214
+ offers?: Offer[];
215
+ }
216
+
217
+ export interface GetLoyaltyOffersRequest extends BaseRequest, GetLoyaltyOffersPath {}
218
+
219
+ // GET /loyalty/{id}/enrollmentstatus/{user_id} - Get enrollment status for logged in user
220
+
221
+ export interface GetLoyaltyEnrollmentstatusPath {
222
+ // Loyalty Provider id
223
+ id: string;
224
+ // CompassDigital User id
225
+ user_id: string;
226
+ }
227
+
228
+ export type GetLoyaltyEnrollmentstatusResponse = EnrollmentStatus;
229
+
230
+ export interface GetLoyaltyEnrollmentstatusRequest
231
+ extends BaseRequest,
232
+ GetLoyaltyEnrollmentstatusPath {}
233
+
234
+ // GET /loyalty/{id}/balance/{user_id} - Get loyalty point balance for logged in user
235
+
236
+ export interface GetLoyaltyBalancePath {
237
+ // Loyalty Provider id
238
+ id: string;
239
+ // CompassDigital User id
240
+ user_id: string;
241
+ }
242
+
243
+ export type GetLoyaltyBalanceResponse = Points;
244
+
245
+ export interface GetLoyaltyBalanceRequest extends BaseRequest, GetLoyaltyBalancePath {}
246
+
247
+ // GET /loyalty/{id}/opportunities/{user_id} - Get earning opportunities for the logged in user
248
+
249
+ export interface GetLoyaltyOpportunitiesPath {
250
+ // Loyalty Provider id
251
+ id: string;
252
+ // CompassDigital User id
253
+ user_id: string;
254
+ }
255
+
256
+ export interface GetLoyaltyOpportunitiesQuery {
257
+ // Choose what opportunities should not be returned, can be several comma separated
258
+ filter?: string;
259
+ }
260
+
261
+ export interface GetLoyaltyOpportunitiesResponse {
262
+ opportunities?: EarningOpportunity[];
263
+ }
264
+
265
+ export interface GetLoyaltyOpportunitiesRequest
266
+ extends BaseRequest,
267
+ RequestQuery<GetLoyaltyOpportunitiesQuery>,
268
+ GetLoyaltyOpportunitiesPath {}
269
+
270
+ // POST /loyalty/{id}/opportunities/{user_id} - Record an event for the logged in user
271
+
272
+ export interface PostLoyaltyOpportunitiesPath {
273
+ // Loyalty Provider id
274
+ id: string;
275
+ // CompassDigital User id
276
+ user_id: string;
277
+ }
278
+
279
+ export interface PostLoyaltyOpportunitiesQuery {
280
+ // Event type that should be recorded for the logged in user
281
+ event: string;
282
+ // Event occurence channel
283
+ channel?: string;
284
+ }
285
+
286
+ export type PostLoyaltyOpportunitiesResponse = RecordResponse;
287
+
288
+ export interface PostLoyaltyOpportunitiesRequest
289
+ extends BaseRequest,
290
+ RequestQuery<PostLoyaltyOpportunitiesQuery>,
291
+ PostLoyaltyOpportunitiesPath {}
292
+
293
+ // GET /loyalty/{id}/rewards/{user_id} - Get rewards available for the logged in user
294
+
295
+ export interface GetLoyaltyRewardsPath {
296
+ // Loyalty Provider id
297
+ id: string;
298
+ // CompassDigital User id
299
+ user_id: string;
300
+ }
301
+
302
+ export interface GetLoyaltyRewardsResponse {
303
+ rewards?: Reward[];
304
+ }
305
+
306
+ export interface GetLoyaltyRewardsRequest extends BaseRequest, GetLoyaltyRewardsPath {}
307
+
308
+ // GET /loyalty/{id}/coupons/{user_id} - Get coupons available for the logged in user
309
+
310
+ export interface GetLoyaltyCouponsPath {
311
+ // Loyalty Provider id
312
+ id: string;
313
+ // CompassDigital User id
314
+ user_id: string;
315
+ }
316
+
317
+ export interface GetLoyaltyCouponsResponse {
318
+ coupons?: Coupon[];
319
+ }
320
+
321
+ export interface GetLoyaltyCouponsRequest extends BaseRequest, GetLoyaltyCouponsPath {}
322
+
323
+ // GET /loyalty/{id}/orderpoints/{user_id} - Get potential loyalty point points for an order based on amount.
324
+
325
+ export interface GetLoyaltyOrderpointsPath {
326
+ // Loyalty Provider id
327
+ id: string;
328
+ // CompassDigital User id
329
+ user_id: string;
330
+ }
331
+
332
+ export interface GetLoyaltyOrderpointsQuery {
333
+ // Order amount before taxes to check potential loyalty points
334
+ order_amount: number;
335
+ }
336
+
337
+ export type GetLoyaltyOrderpointsResponse = Points;
338
+
339
+ export interface GetLoyaltyOrderpointsRequest
340
+ extends BaseRequest,
341
+ RequestQuery<GetLoyaltyOrderpointsQuery>,
342
+ GetLoyaltyOrderpointsPath {}
343
+
344
+ // POST /loyalty/{id}/orderpoints/{user_id} - Get potential loyalty point points for a order based on amount and items
345
+
346
+ export interface PostLoyaltyOrderpointsPath {
347
+ // Loyalty Provider id
348
+ id: string;
349
+ // CompassDigital User id
350
+ user_id: string;
351
+ }
352
+
353
+ export interface PostLoyaltyOrderpointsBody {
354
+ // Order total amount before taxes
355
+ order_amount: number;
356
+ // List of items in the cart
357
+ items?: Item[];
358
+ }
359
+
360
+ export type PostLoyaltyOrderpointsResponse = Points;
361
+
362
+ export interface PostLoyaltyOrderpointsRequest extends BaseRequest, PostLoyaltyOrderpointsPath {
363
+ body: PostLoyaltyOrderpointsBody;
364
+ }
365
+
366
+ // POST /loyalty/{id}/purchase/{user_id} - Record purchase event
367
+
368
+ export interface PostLoyaltyPurchasePath {
369
+ // Loyalty Provider id
370
+ id: string;
371
+ // CompassDigital User id
372
+ user_id: string;
373
+ }
374
+
375
+ export interface PostLoyaltyPurchaseQuery {
376
+ // Purchase Channel
377
+ channel?: string;
378
+ }
379
+
380
+ export interface PostLoyaltyPurchaseBody {
381
+ // Order id
382
+ order_id: string;
383
+ // Order total amount before taxes
384
+ order_total: number;
385
+ // List of order items
386
+ items: Item[];
387
+ }
388
+
389
+ export type PostLoyaltyPurchaseResponse = RecordResponse;
390
+
391
+ export interface PostLoyaltyPurchaseRequest
392
+ extends BaseRequest,
393
+ RequestQuery<PostLoyaltyPurchaseQuery>,
394
+ PostLoyaltyPurchasePath {
395
+ body: PostLoyaltyPurchaseBody;
396
+ }
397
+
398
+ // POST /loyalty/{id}/buyreward/{user_id} - Redeem rewards to coupons
399
+
400
+ export interface PostLoyaltyBuyrewardPath {
401
+ // Loyalty Provider id
402
+ id: string;
403
+ // CompassDigital User id
404
+ user_id: string;
405
+ }
406
+
407
+ export interface PostLoyaltyBuyrewardQuery {
408
+ // buy reward Channel
409
+ channel?: string;
410
+ }
411
+
412
+ export interface PostLoyaltyBuyrewardBody {
413
+ reward_id: string;
414
+ }
415
+
416
+ export type PostLoyaltyBuyrewardResponse = RewardInfo;
417
+
418
+ export interface PostLoyaltyBuyrewardRequest
419
+ extends BaseRequest,
420
+ RequestQuery<PostLoyaltyBuyrewardQuery>,
421
+ PostLoyaltyBuyrewardPath {
422
+ body: PostLoyaltyBuyrewardBody;
423
+ }
424
+
425
+ // GET /loyalty/{id}/history/{user_id} - Get history of loyalty transactions for user
426
+
427
+ export interface GetLoyaltyHistoryPath {
428
+ // Loyalty Provider id
429
+ id: string;
430
+ // CompassDigital User id
431
+ user_id: string;
432
+ }
433
+
434
+ export interface GetLoyaltyHistoryQuery {
435
+ // Page number to return for pagination. If not specified will return first 1000 events
436
+ page_number?: number;
437
+ // How many entries to return per request. If not specified will return first 1000 events
438
+ entries_per_page?: number;
439
+ }
440
+
441
+ export interface GetLoyaltyHistoryResponse {
442
+ transactions?: HistoryTransaction[];
443
+ }
444
+
445
+ export interface GetLoyaltyHistoryRequest
446
+ extends BaseRequest,
447
+ RequestQuery<GetLoyaltyHistoryQuery>,
448
+ GetLoyaltyHistoryPath {}
449
+
450
+ // GET /loyalty/{id}/coupon/{user_id}/{coupon_id} - get coupon's information
451
+
452
+ export interface GetLoyaltyCouponPath {
453
+ // Loyalty Provider id
454
+ id: string;
455
+ // CompassDigital User id
456
+ user_id: string;
457
+ // Coupon code to get coupon information
458
+ coupon_id: string;
459
+ }
460
+
461
+ export interface GetLoyaltyCouponResponse {
462
+ coupon?: Coupon;
463
+ // This will be true if the coupon status is either 'redeemed' or 'reissued'
464
+ is_valid?: boolean;
465
+ }
466
+
467
+ export interface GetLoyaltyCouponRequest extends BaseRequest, GetLoyaltyCouponPath {}
468
+
469
+ // PATCH /loyalty/{id}/coupon/{user_id}/{coupon_id} - Update coupon's status
470
+
471
+ export interface PatchLoyaltyCouponPath {
472
+ // Loyalty Provider id
473
+ id: string;
474
+ // CompassDigital User id
475
+ user_id: string;
476
+ // Coupon code to update
477
+ coupon_id: string;
478
+ }
479
+
480
+ export interface PatchLoyaltyCouponBody {
481
+ // Coupon status to set
482
+ status: string;
483
+ }
484
+
485
+ export type PatchLoyaltyCouponResponse = Success;
486
+
487
+ export interface PatchLoyaltyCouponRequest extends BaseRequest, PatchLoyaltyCouponPath {
488
+ body: PatchLoyaltyCouponBody;
489
+ }
490
+
491
+ // GET /loyalty/{id}/search - Search CDL user id by internal 500friends id
492
+
493
+ export interface GetLoyaltySearchPath {
494
+ // Loyalty Provider id
495
+ id: string;
496
+ }
497
+
498
+ export interface GetLoyaltySearchQuery {
499
+ // User id in 500friends
500
+ search_id: number;
501
+ }
502
+
503
+ export type GetLoyaltySearchResponse = UserId;
504
+
505
+ export interface GetLoyaltySearchRequest
506
+ extends BaseRequest,
507
+ RequestQuery<GetLoyaltySearchQuery>,
508
+ GetLoyaltySearchPath {}
509
+
510
+ // GET /loyalty/{id}/users - Get all loyalty users updated after specific date
511
+
512
+ export interface GetLoyaltyUsersPath {
513
+ // Loyalty Provider id
514
+ id: string;
515
+ }
516
+
517
+ export interface GetLoyaltyUsersQuery {
518
+ // Page number if more than 1000 records available. Equal to 1 by default
519
+ page_number?: number;
520
+ // Start date to search from
521
+ from_date: string;
522
+ }
523
+
524
+ export interface GetLoyaltyUsersResponse {
525
+ users?: LoyaltyUser[];
526
+ }
527
+
528
+ export interface GetLoyaltyUsersRequest
529
+ extends BaseRequest,
530
+ RequestQuery<GetLoyaltyUsersQuery>,
531
+ GetLoyaltyUsersPath {}
532
+
533
+ // GET /loyalty/{id}/events - Get all loyalty events updated after specific date
534
+
535
+ export interface GetLoyaltyEventsPath {
536
+ // Loyalty Provider id
537
+ id: string;
538
+ }
539
+
540
+ export interface GetLoyaltyEventsQuery {
541
+ // Page number if more than 1000 records available. Equal to 1 by default
542
+ page_number?: number;
543
+ // Start date to search from
544
+ from_date: string;
545
+ }
546
+
547
+ export interface GetLoyaltyEventsResponse {
548
+ events?: Event[];
549
+ }
550
+
551
+ export interface GetLoyaltyEventsRequest
552
+ extends BaseRequest,
553
+ RequestQuery<GetLoyaltyEventsQuery>,
554
+ GetLoyaltyEventsPath {}
@@ -56,12 +56,15 @@ export interface Item {
56
56
  // index
57
57
  _index?: string;
58
58
  meta?: any;
59
+ quantity?: number;
60
+ amount_off_exclusions?: string[];
59
61
  }[];
60
62
  }[];
61
63
  // Details about discount like BOGO, LTO, Bundle etc.
62
64
  item_discount?: any;
63
65
  // user specified instructions for the item
64
66
  special_instructions?: string;
67
+ amount_off_exclusions?: string[];
65
68
  [index: string]: any;
66
69
  }
67
70