@compassdigital/sdk.typescript 4.394.0 → 4.396.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/src/index.ts CHANGED
@@ -1410,26 +1410,26 @@ import {
1410
1410
  } from './interface/review';
1411
1411
 
1412
1412
  import {
1413
+ DeleteDiscountResponse,
1413
1414
  GetDiscountQuery,
1414
1415
  GetDiscountResponse,
1415
- PutDiscountBody,
1416
- PutDiscountResponse,
1417
- DeleteDiscountResponse,
1418
1416
  PatchDiscountBody,
1419
1417
  PatchDiscountResponse,
1418
+ PutDiscountBody,
1419
+ PutDiscountResponse,
1420
+ GetDiscountsAllQuery,
1421
+ GetDiscountsAllResponse,
1420
1422
  GetDiscountsQuery,
1421
1423
  GetDiscountsResponse,
1422
1424
  PostDiscountBody,
1423
1425
  PostDiscountResponse,
1424
- GetDiscountsAllQuery,
1425
- GetDiscountsAllResponse,
1426
- PutDiscountPublishBody,
1427
- PutDiscountPublishResponse,
1426
+ PostDiscountEventBody,
1427
+ PostDiscountEventResponse,
1428
1428
  PostRewardsQuery,
1429
1429
  PostRewardsBody,
1430
1430
  PostRewardsResponse,
1431
- PostDiscountEventBody,
1432
- PostDiscountEventResponse,
1431
+ PutDiscountPublishBody,
1432
+ PutDiscountPublishResponse,
1433
1433
  } from './interface/discount';
1434
1434
 
1435
1435
  import {
@@ -15133,6 +15133,23 @@ export class ServiceClient extends BaseServiceClient {
15133
15133
  return this.request('review', '/review/{id}', 'DELETE', `/review/${id}`, null, options);
15134
15134
  }
15135
15135
 
15136
+ /**
15137
+ * DELETE /discount/{id} - Delete a discount
15138
+ *
15139
+ * @param id - Discount id
15140
+ * @param options - additional request options
15141
+ */
15142
+ delete_discount(id: string, options?: RequestOptions): ResponsePromise<DeleteDiscountResponse> {
15143
+ return this.request(
15144
+ 'discount',
15145
+ '/discount/{id}',
15146
+ 'DELETE',
15147
+ `/discount/${id}`,
15148
+ null,
15149
+ options,
15150
+ );
15151
+ }
15152
+
15136
15153
  /**
15137
15154
  * GET /discount/{id} - Get a discount
15138
15155
  *
@@ -15149,57 +15166,53 @@ export class ServiceClient extends BaseServiceClient {
15149
15166
  }
15150
15167
 
15151
15168
  /**
15152
- * PUT /discount/{id} - Update a discount
15169
+ * PATCH /discount/{id} - Patch a discount
15153
15170
  *
15154
15171
  * @param id - Discount ID
15155
15172
  * @param body
15156
15173
  * @param options - additional request options
15157
15174
  */
15158
- put_discount(
15175
+ patch_discount(
15159
15176
  id: string,
15160
- body: PutDiscountBody,
15177
+ body: PatchDiscountBody,
15161
15178
  options?: RequestOptions,
15162
- ): ResponsePromise<PutDiscountResponse> {
15163
- return this.request('discount', '/discount/{id}', 'PUT', `/discount/${id}`, body, options);
15164
- }
15165
-
15166
- /**
15167
- * DELETE /discount/{id} - Delete a discount
15168
- *
15169
- * @param id - Discount id
15170
- * @param options - additional request options
15171
- */
15172
- delete_discount(id: string, options?: RequestOptions): ResponsePromise<DeleteDiscountResponse> {
15179
+ ): ResponsePromise<PatchDiscountResponse> {
15173
15180
  return this.request(
15174
15181
  'discount',
15175
15182
  '/discount/{id}',
15176
- 'DELETE',
15183
+ 'PATCH',
15177
15184
  `/discount/${id}`,
15178
- null,
15185
+ body,
15179
15186
  options,
15180
15187
  );
15181
15188
  }
15182
15189
 
15183
15190
  /**
15184
- * PATCH /discount/{id} - Patch a discount
15191
+ * PUT /discount/{id} - Update a discount
15185
15192
  *
15186
15193
  * @param id - Discount ID
15187
15194
  * @param body
15188
15195
  * @param options - additional request options
15189
15196
  */
15190
- patch_discount(
15197
+ put_discount(
15191
15198
  id: string,
15192
- body: PatchDiscountBody,
15199
+ body: PutDiscountBody,
15193
15200
  options?: RequestOptions,
15194
- ): ResponsePromise<PatchDiscountResponse> {
15195
- return this.request(
15196
- 'discount',
15197
- '/discount/{id}',
15198
- 'PATCH',
15199
- `/discount/${id}`,
15200
- body,
15201
- options,
15202
- );
15201
+ ): ResponsePromise<PutDiscountResponse> {
15202
+ return this.request('discount', '/discount/{id}', 'PUT', `/discount/${id}`, body, options);
15203
+ }
15204
+
15205
+ /**
15206
+ * GET /discount/all - Get all discounts
15207
+ *
15208
+ * @param options - additional request options
15209
+ */
15210
+ get_discounts_all(
15211
+ options?: {
15212
+ query?: GetDiscountsAllQuery;
15213
+ } & RequestOptions,
15214
+ ): ResponsePromise<GetDiscountsAllResponse> {
15215
+ return this.request('discount', '/discount/all', 'GET', `/discount/all`, null, options);
15203
15216
  }
15204
15217
 
15205
15218
  /**
@@ -15229,35 +15242,20 @@ export class ServiceClient extends BaseServiceClient {
15229
15242
  }
15230
15243
 
15231
15244
  /**
15232
- * GET /discount/all - Get all discounts
15233
- *
15234
- * @param options - additional request options
15235
- */
15236
- get_discounts_all(
15237
- options?: {
15238
- query?: GetDiscountsAllQuery;
15239
- } & RequestOptions,
15240
- ): ResponsePromise<GetDiscountsAllResponse> {
15241
- return this.request('discount', '/discount/all', 'GET', `/discount/all`, null, options);
15242
- }
15243
-
15244
- /**
15245
- * PUT /discount/{id}/publish - Publish a discount
15245
+ * POST /discount/event - Handle discount event
15246
15246
  *
15247
- * @param id - Discount ID
15248
15247
  * @param body
15249
15248
  * @param options - additional request options
15250
15249
  */
15251
- put_discount_publish(
15252
- id: string,
15253
- body: PutDiscountPublishBody,
15250
+ post_discount_event(
15251
+ body: PostDiscountEventBody,
15254
15252
  options?: RequestOptions,
15255
- ): ResponsePromise<PutDiscountPublishResponse> {
15253
+ ): ResponsePromise<PostDiscountEventResponse> {
15256
15254
  return this.request(
15257
15255
  'discount',
15258
- '/discount/{id}/publish',
15259
- 'PUT',
15260
- `/discount/${id}/publish`,
15256
+ '/discount/event',
15257
+ 'POST',
15258
+ `/discount/event`,
15261
15259
  body,
15262
15260
  options,
15263
15261
  );
@@ -15288,20 +15286,22 @@ export class ServiceClient extends BaseServiceClient {
15288
15286
  }
15289
15287
 
15290
15288
  /**
15291
- * POST /discount/event - Handle discount event
15289
+ * PUT /discount/{id}/publish - Publish a discount
15292
15290
  *
15291
+ * @param id - Discount ID
15293
15292
  * @param body
15294
15293
  * @param options - additional request options
15295
15294
  */
15296
- post_discount_event(
15297
- body: PostDiscountEventBody,
15295
+ put_discount_publish(
15296
+ id: string,
15297
+ body: PutDiscountPublishBody,
15298
15298
  options?: RequestOptions,
15299
- ): ResponsePromise<PostDiscountEventResponse> {
15299
+ ): ResponsePromise<PutDiscountPublishResponse> {
15300
15300
  return this.request(
15301
15301
  'discount',
15302
- '/discount/event',
15303
- 'POST',
15304
- `/discount/event`,
15302
+ '/discount/{id}/publish',
15303
+ 'PUT',
15304
+ `/discount/${id}/publish`,
15305
15305
  body,
15306
15306
  options,
15307
15307
  );
@@ -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;
@@ -181,6 +181,7 @@ export interface Taxes {
181
181
  export interface Promo {
182
182
  code?: string;
183
183
  email?: string;
184
+ associated_brands?: string[];
184
185
  }
185
186
 
186
187
  export type BadgePay = CashlessTender;