@compassdigital/sdk.typescript 4.128.0 → 4.130.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.
Files changed (40) hide show
  1. package/lib/index.d.ts +8 -4
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +591 -591
  4. package/lib/index.js.map +1 -1
  5. package/lib/interface/ai.d.ts +12 -8
  6. package/lib/interface/ai.d.ts.map +1 -1
  7. package/lib/interface/centricos.d.ts +13 -12
  8. package/lib/interface/centricos.d.ts.map +1 -1
  9. package/lib/interface/consumer.d.ts +12 -12
  10. package/lib/interface/consumer.d.ts.map +1 -1
  11. package/lib/interface/discount.d.ts +12 -12
  12. package/lib/interface/discount.d.ts.map +1 -1
  13. package/lib/interface/frictionless.d.ts +0 -5
  14. package/lib/interface/frictionless.d.ts.map +1 -1
  15. package/lib/interface/menu.d.ts +13 -0
  16. package/lib/interface/menu.d.ts.map +1 -1
  17. package/lib/interface/promo.d.ts +15 -1
  18. package/lib/interface/promo.d.ts.map +1 -1
  19. package/lib/interface/review.d.ts +13 -8
  20. package/lib/interface/review.d.ts.map +1 -1
  21. package/lib/interface/shoppingcart.d.ts +6 -1
  22. package/lib/interface/shoppingcart.d.ts.map +1 -1
  23. package/lib/interface/tax.d.ts +11 -11
  24. package/lib/interface/tax.d.ts.map +1 -1
  25. package/lib/interface/vendor.d.ts +8 -2
  26. package/lib/interface/vendor.d.ts.map +1 -1
  27. package/package.json +2 -2
  28. package/src/index.ts +602 -593
  29. package/src/interface/ai.ts +19 -9
  30. package/src/interface/centricos.ts +21 -17
  31. package/src/interface/consumer.ts +19 -13
  32. package/src/interface/discount.ts +19 -14
  33. package/src/interface/frictionless.ts +0 -6
  34. package/src/interface/menu.ts +13 -0
  35. package/src/interface/promo.ts +16 -1
  36. package/src/interface/review.ts +20 -8
  37. package/src/interface/shoppingcart.ts +6 -1
  38. package/src/interface/tax.ts +17 -11
  39. package/src/interface/vendor.ts +15 -2
  40. package/test/client.test.ts +1 -1
@@ -22,19 +22,29 @@ export interface GenerateTextResponse {
22
22
  messages: MessageDTO[];
23
23
  }
24
24
 
25
- export interface BadRequestErrorDTO {
26
- message: string;
27
- code: number;
28
- data: Record<string, any>;
25
+ export interface ErrorDisplayMessage {
26
+ // user message title
27
+ title: string;
28
+ // user message description
29
+ description: string;
29
30
  }
30
31
 
31
- export interface UnauthorizedErrorDTO {
32
- message: string;
33
- code: number;
34
- data: Record<string, any>;
32
+ export interface ErrorData {
33
+ // http status code
34
+ statusCode: number;
35
+ // http status text
36
+ statusText: string;
37
+ timestamp: string;
38
+ displayMessage: ErrorDisplayMessage;
35
39
  }
36
40
 
37
- export type InternalServerErrorException = Record<string, any>;
41
+ export interface Error {
42
+ // business error code
43
+ code: number;
44
+ // business error description
45
+ message: string;
46
+ data: ErrorData;
47
+ }
38
48
 
39
49
  export interface GenerateImageRequest {
40
50
  prompt: string;
@@ -12,19 +12,29 @@ export interface AIItemDescriptionResponse {
12
12
  description: string;
13
13
  }
14
14
 
15
- export interface BadRequestErrorDTO {
16
- message: string;
17
- code: number;
18
- data: Record<string, any>;
15
+ export interface ErrorDisplayMessage {
16
+ // user message title
17
+ title: string;
18
+ // user message description
19
+ description: string;
19
20
  }
20
21
 
21
- export interface UnauthorizedErrorDTO {
22
- message: string;
23
- code: number;
24
- data: Record<string, any>;
22
+ export interface ErrorData {
23
+ // http status code
24
+ statusCode: number;
25
+ // http status text
26
+ statusText: string;
27
+ timestamp: string;
28
+ displayMessage: ErrorDisplayMessage;
25
29
  }
26
30
 
27
- export type InternalServerErrorException = Record<string, any>;
31
+ export interface Error {
32
+ // business error code
33
+ code: number;
34
+ // business error description
35
+ message: string;
36
+ data: ErrorData;
37
+ }
28
38
 
29
39
  export interface AIItemImageRequest {
30
40
  name?: string;
@@ -65,6 +75,8 @@ export interface ReportGroupConfigResponse {
65
75
  is_default: boolean;
66
76
  }
67
77
 
78
+ export type InternalServerErrorException = Record<string, any>;
79
+
68
80
  export interface ReportGroupConfigRequest {
69
81
  day_time: string;
70
82
  day_parts: DayPart[];
@@ -276,10 +288,6 @@ export interface PutDiscountVoucherifyResponseDTO {
276
288
  discount: DiscountResponseDTO;
277
289
  }
278
290
 
279
- export type DiscountValidationError = Record<string, any>;
280
-
281
- export type DiscountCreateError = Record<string, any>;
282
-
283
291
  export interface SiteDTO {
284
292
  // The ID of the site
285
293
  id: string;
@@ -306,14 +314,10 @@ export interface PutDiscountVoucherifyPublishResponseDTO {
306
314
  is?: CentricDiscountIs;
307
315
  }
308
316
 
309
- export type DiscountPublishError = Record<string, any>;
310
-
311
317
  export interface DeleteDiscountsVoucherifyResponseDTO {
312
318
  success: boolean;
313
319
  }
314
320
 
315
- export type DiscountDeleteError = Record<string, any>;
316
-
317
321
  export interface DiscountDTO {
318
322
  // user is of discount creator
319
323
  createdBy: string;
@@ -64,16 +64,28 @@ export interface ListAvailablePaymentsResponseDTO {
64
64
  digital_wallet_pay: DigitalWallet;
65
65
  }
66
66
 
67
- export interface UnauthorizedErrorDTO {
68
- message: string;
69
- code: number;
70
- data: Record<string, any>;
67
+ export interface ErrorDisplayMessage {
68
+ // user message title
69
+ title: string;
70
+ // user message description
71
+ description: string;
71
72
  }
72
73
 
73
- export interface NotFoundErrorDTO {
74
- message: string;
74
+ export interface ErrorData {
75
+ // http status code
76
+ statusCode: number;
77
+ // http status text
78
+ statusText: string;
79
+ timestamp: string;
80
+ displayMessage: ErrorDisplayMessage;
81
+ }
82
+
83
+ export interface Error {
84
+ // business error code
75
85
  code: number;
76
- data: Record<string, any>;
86
+ // business error description
87
+ message: string;
88
+ data: ErrorData;
77
89
  }
78
90
 
79
91
  export interface OrderTotals {
@@ -736,12 +748,6 @@ export interface GetCustomerOrdersResponseDTO {
736
748
  orders: CustomerOrder[];
737
749
  }
738
750
 
739
- export interface BadRequestErrorDTO {
740
- message: string;
741
- code: number;
742
- data: Record<string, any>;
743
- }
744
-
745
751
  export interface PostReviewOrderItemRequest {
746
752
  // rating score
747
753
  score: number;
@@ -52,26 +52,30 @@ export interface GetDiscountResponseDTO {
52
52
  meta?: DiscountMeta;
53
53
  }
54
54
 
55
- export interface BadRequestErrorDTO {
56
- message: string;
57
- code: number;
58
- data: Record<string, any>;
55
+ export interface ErrorDisplayMessage {
56
+ // user message title
57
+ title: string;
58
+ // user message description
59
+ description: string;
59
60
  }
60
61
 
61
- export interface UnauthorizedErrorDTO {
62
- message: string;
63
- code: number;
64
- data: Record<string, any>;
62
+ export interface ErrorData {
63
+ // http status code
64
+ statusCode: number;
65
+ // http status text
66
+ statusText: string;
67
+ timestamp: string;
68
+ displayMessage: ErrorDisplayMessage;
65
69
  }
66
70
 
67
- export interface NotFoundErrorDTO {
68
- message: string;
71
+ export interface Error {
72
+ // business error code
69
73
  code: number;
70
- data: Record<string, any>;
74
+ // business error description
75
+ message: string;
76
+ data: ErrorData;
71
77
  }
72
78
 
73
- export type InternalServerErrorException = Record<string, any>;
74
-
75
79
  export interface DiscountDTO {
76
80
  // discount id
77
81
  id: string;
@@ -226,6 +230,7 @@ export type DeleteDiscountResponse = DeleteDiscountResponseDTO;
226
230
 
227
231
  export interface GetDiscountsQuery {
228
232
  taxonomyFilter: string;
233
+ statusFilter?: string;
229
234
  // Graphql query string
230
235
  _query?: string;
231
236
  }
@@ -238,7 +243,7 @@ export type PostDiscountBody = PostDiscountRequestDTO;
238
243
 
239
244
  export type PostDiscountResponse = PostDiscountResponseDTO;
240
245
 
241
- // GET /discount/all - Get all discount
246
+ // GET /discount/all - Get all discounts
242
247
 
243
248
  export interface GetDiscountsAllQuery {
244
249
  // Graphql query string
@@ -147,12 +147,6 @@ export interface AmazonJWOIdentityKeysRequestDTO {
147
147
 
148
148
  export type AmazonJWOIdentityKeysResponseDTO = Record<string, any>;
149
149
 
150
- export interface BadRequestError {
151
- message: string;
152
- code: number;
153
- data: Record<string, any>;
154
- }
155
-
156
150
  export interface ShoppingTrip {
157
151
  // Contains a timestamp for the time the shopping trip starts. This value is not validated on our service.
158
152
  startTime: string;
@@ -425,6 +425,7 @@ export interface GlobalMenuGroupDTO {
425
425
  posid_segment?: string;
426
426
  auto_push_to_local?: boolean;
427
427
  price_levels?: Record<string, any>;
428
+ show_v4?: boolean;
428
429
  id?: string;
429
430
  permissions?: Record<string, any>;
430
431
  [index: string]: any;
@@ -585,6 +586,7 @@ export interface LocalMenuGroupDTO {
585
586
  draft_brands?: DraftBrandDTO[];
586
587
  published_brands?: PublishedBrandDTO[];
587
588
  price_levels?: Record<string, any>;
589
+ show_v4?: boolean;
588
590
  id: string;
589
591
  created_at?: string;
590
592
  updated_at?: string;
@@ -2096,6 +2098,7 @@ export interface PostMenuV3LocalMenuGroupBody {
2096
2098
  draft_brands?: DraftBrandDTO[];
2097
2099
  published_brands?: PublishedBrandDTO[];
2098
2100
  price_levels?: Record<string, any>;
2101
+ show_v4?: boolean;
2099
2102
  vendor_metadata?: VendorMetadataDTO[];
2100
2103
  permissions?: Record<string, any>;
2101
2104
  [index: string]: any;
@@ -2108,6 +2111,7 @@ export interface PostMenuV3LocalMenuGroupResponse {
2108
2111
  draft_brands?: DraftBrandDTO[];
2109
2112
  published_brands?: PublishedBrandDTO[];
2110
2113
  price_levels?: Record<string, any>;
2114
+ show_v4?: boolean;
2111
2115
  id: string;
2112
2116
  created_at?: string;
2113
2117
  updated_at?: string;
@@ -2144,6 +2148,7 @@ export interface GetMenuV3LocalMenuGroupResponse {
2144
2148
  draft_brands?: DraftBrandDTO[];
2145
2149
  published_brands?: PublishedBrandDTO[];
2146
2150
  price_levels?: Record<string, any>;
2151
+ show_v4?: boolean;
2147
2152
  id: string;
2148
2153
  created_at?: string;
2149
2154
  updated_at?: string;
@@ -2172,6 +2177,7 @@ export interface PatchMenuV3LocalMenuGroupBody {
2172
2177
  draft_brands?: DraftBrandDTO[];
2173
2178
  published_brands?: PublishedBrandDTO[];
2174
2179
  price_levels?: Record<string, any>;
2180
+ show_v4?: boolean;
2175
2181
  id?: string;
2176
2182
  version?: number;
2177
2183
  vendor_metadata?: VendorMetadataDTO[];
@@ -2186,6 +2192,7 @@ export interface PatchMenuV3LocalMenuGroupResponse {
2186
2192
  draft_brands?: DraftBrandDTO[];
2187
2193
  published_brands?: PublishedBrandDTO[];
2188
2194
  price_levels?: Record<string, any>;
2195
+ show_v4?: boolean;
2189
2196
  id: string;
2190
2197
  created_at?: string;
2191
2198
  updated_at?: string;
@@ -2220,6 +2227,7 @@ export interface DeleteMenuV3LocalMenuGroupResponse {
2220
2227
  draft_brands?: DraftBrandDTO[];
2221
2228
  published_brands?: PublishedBrandDTO[];
2222
2229
  price_levels?: Record<string, any>;
2230
+ show_v4?: boolean;
2223
2231
  id: string;
2224
2232
  created_at?: string;
2225
2233
  updated_at?: string;
@@ -2275,6 +2283,7 @@ export type PostMenuV3LocalMenuGroupsBody = {
2275
2283
  draft_brands?: DraftBrandDTO[];
2276
2284
  published_brands?: PublishedBrandDTO[];
2277
2285
  price_levels?: Record<string, any>;
2286
+ show_v4?: boolean;
2278
2287
  vendor_metadata?: VendorMetadataDTO[];
2279
2288
  permissions?: Record<string, any>;
2280
2289
  [index: string]: any;
@@ -2655,6 +2664,7 @@ export interface PostMenuV3GlobalMenuGroupBody {
2655
2664
  posid_segment: string;
2656
2665
  auto_push_to_local?: boolean;
2657
2666
  price_levels?: Record<string, any>;
2667
+ show_v4?: boolean;
2658
2668
  vendor_metadata?: VendorMetadataDTO[];
2659
2669
  permissions?: Record<string, any>;
2660
2670
  [index: string]: any;
@@ -2703,6 +2713,7 @@ export interface PatchMenuV3GlobalMenuGroupBody {
2703
2713
  posid_segment?: string;
2704
2714
  auto_push_to_local?: boolean;
2705
2715
  price_levels?: Record<string, any>;
2716
+ show_v4?: boolean;
2706
2717
  id?: string;
2707
2718
  version?: number;
2708
2719
  vendor_metadata?: VendorMetadataDTO[];
@@ -2738,6 +2749,7 @@ export interface DeleteMenuV3GlobalMenuGroupResponse {
2738
2749
  posid_segment: string;
2739
2750
  auto_push_to_local?: boolean;
2740
2751
  price_levels?: Record<string, any>;
2752
+ show_v4?: boolean;
2741
2753
  id: string;
2742
2754
  created_at?: string;
2743
2755
  updated_at?: string;
@@ -2795,6 +2807,7 @@ export type PostMenuV3GlobalMenuGroupsBody = {
2795
2807
  posid_segment: string;
2796
2808
  auto_push_to_local?: boolean;
2797
2809
  price_levels?: Record<string, any>;
2810
+ show_v4?: boolean;
2798
2811
  vendor_metadata?: VendorMetadataDTO[];
2799
2812
  permissions?: Record<string, any>;
2800
2813
  [index: string]: any;
@@ -298,6 +298,21 @@ export interface PromoReverseRequest {
298
298
  redemption?: Redemption;
299
299
  }
300
300
 
301
+ export interface PromoReverseStackableRequest {
302
+ reason?: string;
303
+ app?: string;
304
+ location_brand?: string;
305
+ totals?: {
306
+ amount?: number;
307
+ currency?: string;
308
+ };
309
+ shoppingcart?: {
310
+ id?: string;
311
+ date_created?: string;
312
+ };
313
+ redemptions?: Redemption[];
314
+ }
315
+
301
316
  export interface Customer {
302
317
  id?: string;
303
318
  source_id?: string;
@@ -686,7 +701,7 @@ export interface PostPromoVoucherReverseStackablePath {
686
701
  redemption_id: string;
687
702
  }
688
703
 
689
- export type PostPromoVoucherReverseStackableBody = PromoReverseRequest;
704
+ export type PostPromoVoucherReverseStackableBody = PromoReverseStackableRequest;
690
705
 
691
706
  export type PostPromoVoucherReverseStackableResponse = RedemptionReversal;
692
707
 
@@ -17,16 +17,28 @@ export interface GetReviewsResponseDTO {
17
17
  reviews: ReviewDTO[];
18
18
  }
19
19
 
20
- export interface BadRequestErrorDTO {
21
- message: string;
22
- code: number;
23
- data: Record<string, any>;
20
+ export interface ErrorDisplayMessage {
21
+ // user message title
22
+ title: string;
23
+ // user message description
24
+ description: string;
24
25
  }
25
26
 
26
- export interface UnauthorizedErrorDTO {
27
- message: string;
27
+ export interface ErrorData {
28
+ // http status code
29
+ statusCode: number;
30
+ // http status text
31
+ statusText: string;
32
+ timestamp: string;
33
+ displayMessage: ErrorDisplayMessage;
34
+ }
35
+
36
+ export interface Error {
37
+ // business error code
28
38
  code: number;
29
- data: Record<string, any>;
39
+ // business error description
40
+ message: string;
41
+ data: ErrorData;
30
42
  }
31
43
 
32
44
  export interface GetReviewResponseDTO {
@@ -39,7 +51,7 @@ export interface GetReviewResponseDTO {
39
51
  reason?: string[];
40
52
  }
41
53
 
42
- export interface NotFoundErrorDTO {
54
+ export interface NotFoundError {
43
55
  message: string;
44
56
  code: number;
45
57
  data: Record<string, any>;
@@ -326,7 +326,11 @@ export interface ShoppingCartResponse {
326
326
  order_loyalty_points?: boolean;
327
327
  };
328
328
  discount?: PromoDetails;
329
- discounts?: Discount[];
329
+ discounts?: {
330
+ stacked_total?: MonetaryValue;
331
+ stacked_discounts?: Discount[];
332
+ app?: string;
333
+ };
330
334
  payment_method?: PaymentMethod;
331
335
  taxes?: Taxes;
332
336
  total?: {
@@ -609,6 +613,7 @@ export interface Discount {
609
613
  };
610
614
  [index: string]: any;
611
615
  };
616
+ applied_amount: MonetaryValue;
612
617
  }
613
618
 
614
619
  // POST /shoppingcart - Create a new ShoppingCart
@@ -80,22 +80,28 @@ export interface TaxResponseDTO {
80
80
  provider: string;
81
81
  }
82
82
 
83
- export interface BadRequestErrorDTO {
84
- message: string;
85
- code: number;
86
- data: Record<string, any>;
83
+ export interface ErrorDisplayMessage {
84
+ // user message title
85
+ title: string;
86
+ // user message description
87
+ description: string;
87
88
  }
88
89
 
89
- export interface UnauthorizedErrorDTO {
90
- message: string;
91
- code: number;
92
- data: Record<string, any>;
90
+ export interface ErrorData {
91
+ // http status code
92
+ statusCode: number;
93
+ // http status text
94
+ statusText: string;
95
+ timestamp: string;
96
+ displayMessage: ErrorDisplayMessage;
93
97
  }
94
98
 
95
- export interface ServiceUnavailableErrorDTO {
96
- message: string;
99
+ export interface Error {
100
+ // business error code
97
101
  code: number;
98
- data: Record<string, any>;
102
+ // business error description
103
+ message: string;
104
+ data: ErrorData;
99
105
  }
100
106
 
101
107
  // GET /tax/v1/health-check - Health Check
@@ -252,11 +252,16 @@ export interface PatchVendorApplicationRequest extends BaseRequest, PatchVendorA
252
252
 
253
253
  // POST /vendor - Create new vendor
254
254
 
255
+ export interface PostVendorQuery {
256
+ // Send email notification to vendor (default true)
257
+ email?: boolean;
258
+ }
259
+
255
260
  export type PostVendorBody = VendorPostBody;
256
261
 
257
262
  export type PostVendorResponse = Vendor;
258
263
 
259
- export interface PostVendorRequest extends BaseRequest {
264
+ export interface PostVendorRequest extends BaseRequest, RequestQuery<PostVendorQuery> {
260
265
  body: PostVendorBody;
261
266
  }
262
267
 
@@ -409,9 +414,17 @@ export interface DeleteVendorKeyPath {
409
414
  key: string;
410
415
  }
411
416
 
417
+ export interface DeleteVendorKeyQuery {
418
+ // If true, performs a hard delete instead of marking as expired
419
+ hard?: boolean;
420
+ }
421
+
412
422
  export type DeleteVendorKeyResponse = Key;
413
423
 
414
- export interface DeleteVendorKeyRequest extends BaseRequest, DeleteVendorKeyPath {}
424
+ export interface DeleteVendorKeyRequest
425
+ extends BaseRequest,
426
+ RequestQuery<DeleteVendorKeyQuery>,
427
+ DeleteVendorKeyPath {}
415
428
 
416
429
  // POST /vendor/{id}/key/{key}/rotate - Rotate vendor key
417
430
 
@@ -29,7 +29,7 @@ describe('ServiceClient', () => {
29
29
  route: '/task/{id}',
30
30
  service: 'task',
31
31
  url: 'https://dev.api.compassdigital.org/task/some_id',
32
- method: 'get',
32
+ method: 'GET',
33
33
  headers: {
34
34
  'User-Agent': 'CDL/ServiceClient',
35
35
  },