@compassdigital/sdk.typescript 3.21.0 → 3.22.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,558 @@
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?: {
358
+ items?: Item[];
359
+ };
360
+ }
361
+
362
+ export type PostLoyaltyOrderpointsResponse = Points;
363
+
364
+ export interface PostLoyaltyOrderpointsRequest extends BaseRequest, PostLoyaltyOrderpointsPath {
365
+ body: PostLoyaltyOrderpointsBody;
366
+ }
367
+
368
+ // POST /loyalty/{id}/purchase/{user_id} - Record purchase event
369
+
370
+ export interface PostLoyaltyPurchasePath {
371
+ // Loyalty Provider id
372
+ id: string;
373
+ // CompassDigital User id
374
+ user_id: string;
375
+ }
376
+
377
+ export interface PostLoyaltyPurchaseQuery {
378
+ // Purchase Channel
379
+ channel?: string;
380
+ }
381
+
382
+ export interface PostLoyaltyPurchaseBody {
383
+ // Order id
384
+ order_id: string;
385
+ // Order total amount before taxes
386
+ order_total: number;
387
+ // List of order items
388
+ items: {
389
+ items?: Item[];
390
+ };
391
+ }
392
+
393
+ export type PostLoyaltyPurchaseResponse = RecordResponse;
394
+
395
+ export interface PostLoyaltyPurchaseRequest
396
+ extends BaseRequest,
397
+ RequestQuery<PostLoyaltyPurchaseQuery>,
398
+ PostLoyaltyPurchasePath {
399
+ body: PostLoyaltyPurchaseBody;
400
+ }
401
+
402
+ // POST /loyalty/{id}/buyreward/{user_id} - Redeem rewards to coupons
403
+
404
+ export interface PostLoyaltyBuyrewardPath {
405
+ // Loyalty Provider id
406
+ id: string;
407
+ // CompassDigital User id
408
+ user_id: string;
409
+ }
410
+
411
+ export interface PostLoyaltyBuyrewardQuery {
412
+ // buy reward Channel
413
+ channel?: string;
414
+ }
415
+
416
+ export interface PostLoyaltyBuyrewardBody {
417
+ reward_id: string;
418
+ }
419
+
420
+ export type PostLoyaltyBuyrewardResponse = RewardInfo;
421
+
422
+ export interface PostLoyaltyBuyrewardRequest
423
+ extends BaseRequest,
424
+ RequestQuery<PostLoyaltyBuyrewardQuery>,
425
+ PostLoyaltyBuyrewardPath {
426
+ body: PostLoyaltyBuyrewardBody;
427
+ }
428
+
429
+ // GET /loyalty/{id}/history/{user_id} - Get history of loyalty transactions for user
430
+
431
+ export interface GetLoyaltyHistoryPath {
432
+ // Loyalty Provider id
433
+ id: string;
434
+ // CompassDigital User id
435
+ user_id: string;
436
+ }
437
+
438
+ export interface GetLoyaltyHistoryQuery {
439
+ // Page number to return for pagination. If not specified will return first 1000 events
440
+ page_number?: number;
441
+ // How many entries to return per request. If not specified will return first 1000 events
442
+ entries_per_page?: number;
443
+ }
444
+
445
+ export interface GetLoyaltyHistoryResponse {
446
+ transactions?: HistoryTransaction[];
447
+ }
448
+
449
+ export interface GetLoyaltyHistoryRequest
450
+ extends BaseRequest,
451
+ RequestQuery<GetLoyaltyHistoryQuery>,
452
+ GetLoyaltyHistoryPath {}
453
+
454
+ // GET /loyalty/{id}/coupon/{user_id}/{coupon_id} - get coupon's information
455
+
456
+ export interface GetLoyaltyCouponPath {
457
+ // Loyalty Provider id
458
+ id: string;
459
+ // CompassDigital User id
460
+ user_id: string;
461
+ // Coupon code to get coupon information
462
+ coupon_id: string;
463
+ }
464
+
465
+ export interface GetLoyaltyCouponResponse {
466
+ coupon?: Coupon;
467
+ // This will be true if the coupon status is either 'redeemed' or 'reissued'
468
+ is_valid?: boolean;
469
+ }
470
+
471
+ export interface GetLoyaltyCouponRequest extends BaseRequest, GetLoyaltyCouponPath {}
472
+
473
+ // PATCH /loyalty/{id}/coupon/{user_id}/{coupon_id} - Update coupon's status
474
+
475
+ export interface PatchLoyaltyCouponPath {
476
+ // Loyalty Provider id
477
+ id: string;
478
+ // CompassDigital User id
479
+ user_id: string;
480
+ // Coupon code to update
481
+ coupon_id: string;
482
+ }
483
+
484
+ export interface PatchLoyaltyCouponBody {
485
+ // Coupon status to set
486
+ status: string;
487
+ }
488
+
489
+ export type PatchLoyaltyCouponResponse = Success;
490
+
491
+ export interface PatchLoyaltyCouponRequest extends BaseRequest, PatchLoyaltyCouponPath {
492
+ body: PatchLoyaltyCouponBody;
493
+ }
494
+
495
+ // GET /loyalty/{id}/search - Search CDL user id by internal 500friends id
496
+
497
+ export interface GetLoyaltySearchPath {
498
+ // Loyalty Provider id
499
+ id: string;
500
+ }
501
+
502
+ export interface GetLoyaltySearchQuery {
503
+ // User id in 500friends
504
+ search_id: number;
505
+ }
506
+
507
+ export type GetLoyaltySearchResponse = UserId;
508
+
509
+ export interface GetLoyaltySearchRequest
510
+ extends BaseRequest,
511
+ RequestQuery<GetLoyaltySearchQuery>,
512
+ GetLoyaltySearchPath {}
513
+
514
+ // GET /loyalty/{id}/users - Get all loyalty users updated after specific date
515
+
516
+ export interface GetLoyaltyUsersPath {
517
+ // Loyalty Provider id
518
+ id: string;
519
+ }
520
+
521
+ export interface GetLoyaltyUsersQuery {
522
+ // Page number if more than 1000 records available. Equal to 1 by default
523
+ page_number?: number;
524
+ // Start date to search from
525
+ from_date: string;
526
+ }
527
+
528
+ export interface GetLoyaltyUsersResponse {
529
+ users?: LoyaltyUser[];
530
+ }
531
+
532
+ export interface GetLoyaltyUsersRequest
533
+ extends BaseRequest,
534
+ RequestQuery<GetLoyaltyUsersQuery>,
535
+ GetLoyaltyUsersPath {}
536
+
537
+ // GET /loyalty/{id}/events - Get all loyalty events updated after specific date
538
+
539
+ export interface GetLoyaltyEventsPath {
540
+ // Loyalty Provider id
541
+ id: string;
542
+ }
543
+
544
+ export interface GetLoyaltyEventsQuery {
545
+ // Page number if more than 1000 records available. Equal to 1 by default
546
+ page_number?: number;
547
+ // Start date to search from
548
+ from_date: string;
549
+ }
550
+
551
+ export interface GetLoyaltyEventsResponse {
552
+ events?: Event[];
553
+ }
554
+
555
+ export interface GetLoyaltyEventsRequest
556
+ extends BaseRequest,
557
+ RequestQuery<GetLoyaltyEventsQuery>,
558
+ GetLoyaltyEventsPath {}