@compassdigital/sdk.typescript 4.393.0 → 4.395.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.
@@ -3,6 +3,36 @@
3
3
 
4
4
  import { RequestQuery, BaseRequest } from './util';
5
5
 
6
+ export interface DeleteDiscountResponseDTO {
7
+ success: boolean;
8
+ }
9
+
10
+ export interface ErrorDisplayMessage {
11
+ // user message title
12
+ title: string;
13
+ // user message description
14
+ description: string;
15
+ }
16
+
17
+ export interface ErrorData {
18
+ // http status code
19
+ statusCode: number;
20
+ // http status text
21
+ statusText: string;
22
+ timestamp: string;
23
+ // user friendly error message
24
+ displayMessage: ErrorDisplayMessage;
25
+ }
26
+
27
+ export interface Error {
28
+ // business error code
29
+ code: number;
30
+ // business error description
31
+ message: string;
32
+ // additional error data
33
+ data: ErrorData;
34
+ }
35
+
6
36
  export interface DiscountStatus {
7
37
  live?: boolean;
8
38
  publishedTo3rdParty?: boolean;
@@ -69,7 +99,7 @@ export interface DiscountChannelConfig {
69
99
  agilysys: boolean;
70
100
  }
71
101
 
72
- export interface GetDiscountResponseDTO {
102
+ export interface DiscountWithEntities {
73
103
  // discount id
74
104
  id: string;
75
105
  // user id of discount creator
@@ -90,33 +120,11 @@ export interface GetDiscountResponseDTO {
90
120
  channelConfig: DiscountChannelConfig;
91
121
  }
92
122
 
93
- export interface ErrorDisplayMessage {
94
- // user message title
95
- title: string;
96
- // user message description
97
- description: string;
98
- }
99
-
100
- export interface ErrorData {
101
- // http status code
102
- statusCode: number;
103
- // http status text
104
- statusText: string;
105
- timestamp: string;
106
- // user friendly error message
107
- displayMessage: ErrorDisplayMessage;
108
- }
109
-
110
- export interface Error {
111
- // business error code
112
- code: number;
113
- // business error description
114
- message: string;
115
- // additional error data
116
- data: ErrorData;
123
+ export interface GetAllDiscountsResponseDTO {
124
+ discounts: DiscountWithEntities[];
117
125
  }
118
126
 
119
- export interface DiscountDTO {
127
+ export interface GetDiscountResponseDTO {
120
128
  // discount id
121
129
  id: string;
122
130
  // user id of discount creator
@@ -125,6 +133,8 @@ export interface DiscountDTO {
125
133
  updatedBy: string;
126
134
  // What the discount applies to
127
135
  appliesTo: 'order' | 'items';
136
+ sites?: string[];
137
+ brands?: string[];
128
138
  createdAt: string;
129
139
  updatedAt: string;
130
140
  name: string;
@@ -135,11 +145,7 @@ export interface DiscountDTO {
135
145
  channelConfig: DiscountChannelConfig;
136
146
  }
137
147
 
138
- export interface GetDiscountsResponseDTO {
139
- discounts: DiscountDTO[];
140
- }
141
-
142
- export interface DiscountWithEntities {
148
+ export interface DiscountDTO {
143
149
  // discount id
144
150
  id: string;
145
151
  // user id of discount creator
@@ -156,33 +162,25 @@ export interface DiscountWithEntities {
156
162
  meta?: DiscountMeta;
157
163
  schedule?: DiscountSchedule;
158
164
  channelConfig: DiscountChannelConfig;
159
- sites?: string[];
160
- brands?: string[];
161
- }
162
-
163
- export interface GetAllDiscountsResponseDTO {
164
- discounts: DiscountWithEntities[];
165
165
  }
166
166
 
167
- export interface DiscountTaxonomy {
168
- site?: string[];
169
- brand?: string[];
167
+ export interface GetDiscountsResponseDTO {
168
+ discounts: DiscountDTO[];
170
169
  }
171
170
 
172
- export interface PostDiscountRequestDTO {
171
+ export interface PatchDiscountRequestDTO {
173
172
  // What the discount applies to
174
- appliesTo: 'order' | 'items';
175
- createdBy: string;
176
- name: string;
173
+ appliesTo?: 'order' | 'items';
174
+ updatedBy: string;
175
+ status?: DiscountStatus;
176
+ name?: string;
177
177
  is?: DiscountIs;
178
178
  meta?: DiscountMeta;
179
179
  schedule?: DiscountSchedule;
180
- channelConfig: DiscountChannelConfig;
181
- taxonomy?: DiscountTaxonomy;
182
- status?: DiscountStatus;
180
+ channelConfig?: DiscountChannelConfig;
183
181
  }
184
182
 
185
- export interface PostDiscountResponseDTO {
183
+ export interface PatchDiscountResponseDTO {
186
184
  // discount id
187
185
  id: string;
188
186
  // user id of discount creator
@@ -201,20 +199,25 @@ export interface PostDiscountResponseDTO {
201
199
  channelConfig: DiscountChannelConfig;
202
200
  }
203
201
 
204
- export interface PutDiscountRequestDTO {
202
+ export interface DiscountTaxonomy {
203
+ site?: string[];
204
+ brand?: string[];
205
+ }
206
+
207
+ export interface PostDiscountRequestDTO {
205
208
  // What the discount applies to
206
209
  appliesTo: 'order' | 'items';
207
- updatedBy: string;
208
- taxonomy?: DiscountTaxonomy;
209
- status?: DiscountStatus;
210
+ createdBy: string;
210
211
  name: string;
211
212
  is?: DiscountIs;
212
213
  meta?: DiscountMeta;
213
214
  schedule?: DiscountSchedule;
214
215
  channelConfig: DiscountChannelConfig;
216
+ taxonomy?: DiscountTaxonomy;
217
+ status?: DiscountStatus;
215
218
  }
216
219
 
217
- export interface PutDiscountResponseDTO {
220
+ export interface PostDiscountResponseDTO {
218
221
  // discount id
219
222
  id: string;
220
223
  // user id of discount creator
@@ -233,63 +236,28 @@ export interface PutDiscountResponseDTO {
233
236
  channelConfig: DiscountChannelConfig;
234
237
  }
235
238
 
236
- export interface PutDiscountPublishRequestDTO {
237
- // user id of most recent update
238
- updatedBy: string;
239
- }
240
-
241
- export interface PutDiscountPublishResponseDTO {
242
- // discount id
243
- id: string;
244
- // user id of discount creator
245
- createdBy: string;
246
- // user id of most recent update
247
- updatedBy: string;
248
- // What the discount applies to
249
- appliesTo: 'order' | 'items';
250
- is: DiscountIs;
251
- meta: DiscountMeta;
252
- schedule: DiscountSchedule;
253
- channelConfig: DiscountChannelConfig;
254
- createdAt: string;
255
- updatedAt: string;
256
- name: string;
257
- status: DiscountStatus;
239
+ export interface PostDiscountEventRequestDTO {
240
+ // Event type
241
+ type: 'OrderCreatedEvent' | 'ExternalRewardCreatedEvent' | 'ExternalRewardRedeemedEvent';
242
+ // Event version
243
+ version: string;
244
+ // Event source
245
+ source: string;
246
+ // Event payload
247
+ payload: Record<string, any>;
248
+ // Event timestamp epoch seconds
249
+ timestamp?: string;
250
+ // Event ID
251
+ id?: string;
258
252
  }
259
253
 
260
- export interface DeleteDiscountResponseDTO {
254
+ export interface PostDiscountEventResponseDTO {
255
+ // Success indicator
261
256
  success: boolean;
262
- }
263
-
264
- export interface PatchDiscountRequestDTO {
265
- // What the discount applies to
266
- appliesTo?: 'order' | 'items';
267
- updatedBy: string;
268
- status?: DiscountStatus;
269
- name?: string;
270
- is?: DiscountIs;
271
- meta?: DiscountMeta;
272
- schedule?: DiscountSchedule;
273
- channelConfig?: DiscountChannelConfig;
274
- }
275
-
276
- export interface PatchDiscountResponseDTO {
277
- // discount id
278
- id: string;
279
- // user id of discount creator
280
- createdBy: string;
281
- // user id of most recent update
282
- updatedBy: string;
283
- // What the discount applies to
284
- appliesTo: 'order' | 'items';
285
- createdAt: string;
286
- updatedAt: string;
287
- name: string;
288
- status: DiscountStatus;
289
- is?: DiscountIs;
290
- meta?: DiscountMeta;
291
- schedule?: DiscountSchedule;
292
- channelConfig: DiscountChannelConfig;
257
+ // Optional message
258
+ message?: string;
259
+ // Event type
260
+ type?: string;
293
261
  }
294
262
 
295
263
  export interface PostRewardsBodyDTO {
@@ -371,30 +339,71 @@ export interface PostRewardsResponseDTO {
371
339
  campaigns: CustomerRewardCampaignDTO[];
372
340
  }
373
341
 
374
- export interface PostDiscountEventRequestDTO {
375
- // Event type
376
- type: 'OrderCreatedEvent' | 'ExternalRewardCreatedEvent' | 'ExternalRewardRedeemedEvent';
377
- // Event version
378
- version: string;
379
- // Event source
380
- source: string;
381
- // Event payload
382
- payload: Record<string, any>;
383
- // Event timestamp epoch seconds
384
- timestamp?: string;
385
- // Event ID
386
- id?: string;
342
+ export interface PutDiscountRequestDTO {
343
+ // What the discount applies to
344
+ appliesTo: 'order' | 'items';
345
+ updatedBy: string;
346
+ taxonomy?: DiscountTaxonomy;
347
+ status?: DiscountStatus;
348
+ name: string;
349
+ is?: DiscountIs;
350
+ meta?: DiscountMeta;
351
+ schedule?: DiscountSchedule;
352
+ channelConfig: DiscountChannelConfig;
387
353
  }
388
354
 
389
- export interface PostDiscountEventResponseDTO {
390
- // Success indicator
391
- success: boolean;
392
- // Optional message
393
- message?: string;
394
- // Event type
395
- type?: string;
355
+ export interface PutDiscountResponseDTO {
356
+ // discount id
357
+ id: string;
358
+ // user id of discount creator
359
+ createdBy: string;
360
+ // user id of most recent update
361
+ updatedBy: string;
362
+ // What the discount applies to
363
+ appliesTo: 'order' | 'items';
364
+ createdAt: string;
365
+ updatedAt: string;
366
+ name: string;
367
+ status: DiscountStatus;
368
+ is?: DiscountIs;
369
+ meta?: DiscountMeta;
370
+ schedule?: DiscountSchedule;
371
+ channelConfig: DiscountChannelConfig;
372
+ }
373
+
374
+ export interface PutDiscountPublishRequestDTO {
375
+ // user id of most recent update
376
+ updatedBy: string;
377
+ }
378
+
379
+ export interface PutDiscountPublishResponseDTO {
380
+ // discount id
381
+ id: string;
382
+ // user id of discount creator
383
+ createdBy: string;
384
+ // user id of most recent update
385
+ updatedBy: string;
386
+ // What the discount applies to
387
+ appliesTo: 'order' | 'items';
388
+ is: DiscountIs;
389
+ meta: DiscountMeta;
390
+ schedule: DiscountSchedule;
391
+ channelConfig: DiscountChannelConfig;
392
+ createdAt: string;
393
+ updatedAt: string;
394
+ name: string;
395
+ status: DiscountStatus;
396
396
  }
397
397
 
398
+ // DELETE /discount/{id} - Delete a discount
399
+
400
+ export interface DeleteDiscountPath {
401
+ // Discount id
402
+ id: string;
403
+ }
404
+
405
+ export type DeleteDiscountResponse = DeleteDiscountResponseDTO;
406
+
398
407
  // GET /discount/{id} - Get a discount
399
408
 
400
409
  export interface GetDiscountPath {
@@ -409,36 +418,36 @@ export interface GetDiscountQuery {
409
418
 
410
419
  export type GetDiscountResponse = GetDiscountResponseDTO;
411
420
 
412
- // PUT /discount/{id} - Update a discount
421
+ // PATCH /discount/{id} - Patch a discount
413
422
 
414
- export interface PutDiscountPath {
423
+ export interface PatchDiscountPath {
415
424
  // Discount ID
416
425
  id: string;
417
426
  }
418
427
 
419
- export type PutDiscountBody = PutDiscountRequestDTO;
428
+ export type PatchDiscountBody = PatchDiscountRequestDTO;
420
429
 
421
- export type PutDiscountResponse = PutDiscountResponseDTO;
430
+ export type PatchDiscountResponse = PatchDiscountResponseDTO;
422
431
 
423
- // DELETE /discount/{id} - Delete a discount
432
+ // PUT /discount/{id} - Update a discount
424
433
 
425
- export interface DeleteDiscountPath {
426
- // Discount id
434
+ export interface PutDiscountPath {
435
+ // Discount ID
427
436
  id: string;
428
437
  }
429
438
 
430
- export type DeleteDiscountResponse = DeleteDiscountResponseDTO;
439
+ export type PutDiscountBody = PutDiscountRequestDTO;
431
440
 
432
- // PATCH /discount/{id} - Patch a discount
441
+ export type PutDiscountResponse = PutDiscountResponseDTO;
433
442
 
434
- export interface PatchDiscountPath {
435
- // Discount ID
436
- id: string;
437
- }
443
+ // GET /discount/all - Get all discounts
438
444
 
439
- export type PatchDiscountBody = PatchDiscountRequestDTO;
445
+ export interface GetDiscountsAllQuery {
446
+ // Graphql query string
447
+ _query?: string;
448
+ }
440
449
 
441
- export type PatchDiscountResponse = PatchDiscountResponseDTO;
450
+ export type GetDiscountsAllResponse = GetAllDiscountsResponseDTO;
442
451
 
443
452
  // GET /discount - Get discounts by taxonomy
444
453
 
@@ -458,25 +467,11 @@ export type PostDiscountBody = PostDiscountRequestDTO;
458
467
 
459
468
  export type PostDiscountResponse = PostDiscountResponseDTO;
460
469
 
461
- // GET /discount/all - Get all discounts
462
-
463
- export interface GetDiscountsAllQuery {
464
- // Graphql query string
465
- _query?: string;
466
- }
467
-
468
- export type GetDiscountsAllResponse = GetAllDiscountsResponseDTO;
469
-
470
- // PUT /discount/{id}/publish - Publish a discount
471
-
472
- export interface PutDiscountPublishPath {
473
- // Discount ID
474
- id: string;
475
- }
470
+ // POST /discount/event - Handle discount event
476
471
 
477
- export type PutDiscountPublishBody = PutDiscountPublishRequestDTO;
472
+ export type PostDiscountEventBody = PostDiscountEventRequestDTO;
478
473
 
479
- export type PutDiscountPublishResponse = PutDiscountPublishResponseDTO;
474
+ export type PostDiscountEventResponse = PostDiscountEventResponseDTO;
480
475
 
481
476
  // POST /discount/site/{id}/rewards - Get eligible rewards for a customer and site
482
477
 
@@ -494,8 +489,13 @@ export type PostRewardsBody = PostRewardsBodyDTO;
494
489
 
495
490
  export type PostRewardsResponse = PostRewardsResponseDTO;
496
491
 
497
- // POST /discount/event - Handle discount event
492
+ // PUT /discount/{id}/publish - Publish a discount
498
493
 
499
- export type PostDiscountEventBody = PostDiscountEventRequestDTO;
494
+ export interface PutDiscountPublishPath {
495
+ // Discount ID
496
+ id: string;
497
+ }
500
498
 
501
- export type PostDiscountEventResponse = PostDiscountEventResponseDTO;
499
+ export type PutDiscountPublishBody = PutDiscountPublishRequestDTO;
500
+
501
+ export type PutDiscountPublishResponse = PutDiscountPublishResponseDTO;
@@ -1,5 +1,29 @@
1
1
  // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
2
 
3
+ export interface DiscountAssociation {
4
+ id: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ discount: string;
8
+ site?: string;
9
+ brand?: string;
10
+ providerData?: ProviderData;
11
+ }
12
+
13
+ export interface ProviderData {
14
+ voucherify?: {
15
+ id?: string;
16
+ code?: string;
17
+ };
18
+ }
19
+
20
+ export interface ChannelConfig {
21
+ thrive: boolean;
22
+ boost: boolean;
23
+ genius: boolean;
24
+ agilysys: boolean;
25
+ }
26
+
3
27
  export interface DiscountDeletedEvent {
4
28
  id: string;
5
29
  type: 'DiscountDeletedEvent';
@@ -12,7 +36,9 @@ export interface DiscountDeletedEvent {
12
36
  discount: {
13
37
  // discount id
14
38
  id: string;
39
+ channelConfig?: ChannelConfig;
15
40
  };
41
+ discountAssociations?: DiscountAssociation[];
16
42
  };
17
43
  source: string;
18
44
  }