@compassdigital/sdk.typescript 4.394.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.
- package/lib/index.d.ts +23 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +27 -27
- package/lib/index.js.map +1 -1
- package/lib/interface/discount.d.ts +112 -112
- package/lib/interface/discount.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +66 -66
- package/src/interface/discount.ts +162 -162
|
@@ -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
|
|
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
|
|
94
|
-
|
|
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
|
|
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
|
|
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
|
|
168
|
-
|
|
169
|
-
brand?: string[];
|
|
167
|
+
export interface GetDiscountsResponseDTO {
|
|
168
|
+
discounts: DiscountDTO[];
|
|
170
169
|
}
|
|
171
170
|
|
|
172
|
-
export interface
|
|
171
|
+
export interface PatchDiscountRequestDTO {
|
|
173
172
|
// What the discount applies to
|
|
174
|
-
appliesTo
|
|
175
|
-
|
|
176
|
-
|
|
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
|
|
181
|
-
taxonomy?: DiscountTaxonomy;
|
|
182
|
-
status?: DiscountStatus;
|
|
180
|
+
channelConfig?: DiscountChannelConfig;
|
|
183
181
|
}
|
|
184
182
|
|
|
185
|
-
export interface
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
|
254
|
+
export interface PostDiscountEventResponseDTO {
|
|
255
|
+
// Success indicator
|
|
261
256
|
success: boolean;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
|
375
|
-
//
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
//
|
|
393
|
-
|
|
394
|
-
//
|
|
395
|
-
|
|
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
|
-
//
|
|
421
|
+
// PATCH /discount/{id} - Patch a discount
|
|
413
422
|
|
|
414
|
-
export interface
|
|
423
|
+
export interface PatchDiscountPath {
|
|
415
424
|
// Discount ID
|
|
416
425
|
id: string;
|
|
417
426
|
}
|
|
418
427
|
|
|
419
|
-
export type
|
|
428
|
+
export type PatchDiscountBody = PatchDiscountRequestDTO;
|
|
420
429
|
|
|
421
|
-
export type
|
|
430
|
+
export type PatchDiscountResponse = PatchDiscountResponseDTO;
|
|
422
431
|
|
|
423
|
-
//
|
|
432
|
+
// PUT /discount/{id} - Update a discount
|
|
424
433
|
|
|
425
|
-
export interface
|
|
426
|
-
// Discount
|
|
434
|
+
export interface PutDiscountPath {
|
|
435
|
+
// Discount ID
|
|
427
436
|
id: string;
|
|
428
437
|
}
|
|
429
438
|
|
|
430
|
-
export type
|
|
439
|
+
export type PutDiscountBody = PutDiscountRequestDTO;
|
|
431
440
|
|
|
432
|
-
|
|
441
|
+
export type PutDiscountResponse = PutDiscountResponseDTO;
|
|
433
442
|
|
|
434
|
-
|
|
435
|
-
// Discount ID
|
|
436
|
-
id: string;
|
|
437
|
-
}
|
|
443
|
+
// GET /discount/all - Get all discounts
|
|
438
444
|
|
|
439
|
-
export
|
|
445
|
+
export interface GetDiscountsAllQuery {
|
|
446
|
+
// Graphql query string
|
|
447
|
+
_query?: string;
|
|
448
|
+
}
|
|
440
449
|
|
|
441
|
-
export type
|
|
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
|
-
//
|
|
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
|
|
472
|
+
export type PostDiscountEventBody = PostDiscountEventRequestDTO;
|
|
478
473
|
|
|
479
|
-
export type
|
|
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
|
-
//
|
|
492
|
+
// PUT /discount/{id}/publish - Publish a discount
|
|
498
493
|
|
|
499
|
-
export
|
|
494
|
+
export interface PutDiscountPublishPath {
|
|
495
|
+
// Discount ID
|
|
496
|
+
id: string;
|
|
497
|
+
}
|
|
500
498
|
|
|
501
|
-
export type
|
|
499
|
+
export type PutDiscountPublishBody = PutDiscountPublishRequestDTO;
|
|
500
|
+
|
|
501
|
+
export type PutDiscountPublishResponse = PutDiscountPublishResponseDTO;
|