@compassdigital/sdk.typescript 4.455.0 → 4.457.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compassdigital/sdk.typescript",
3
- "version": "4.455.0",
3
+ "version": "4.457.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
package/src/index.ts CHANGED
@@ -927,6 +927,8 @@ import {
927
927
  DeleteMenuV4BrandCategoryResponse,
928
928
  PostMenuV4BrandCategoryAttachItemsBody,
929
929
  PostMenuV4BrandCategoryAttachItemsResponse,
930
+ PostMenuV4BrandSwapCategoryItemsBody,
931
+ PostMenuV4BrandSwapCategoryItemsResponse,
930
932
  PostMenuV4BrandPublishResponse,
931
933
  PostMenuV4BrandV3ToV4Query,
932
934
  PostMenuV4BrandV3ToV4Response,
@@ -1347,7 +1349,6 @@ import {
1347
1349
  PatchDiscountResponse,
1348
1350
  PutDiscountBody,
1349
1351
  PutDiscountResponse,
1350
- GetDiscountsAllResponse,
1351
1352
  GetDiscountsQuery,
1352
1353
  GetDiscountsResponse,
1353
1354
  PostDiscountBody,
@@ -10731,6 +10732,28 @@ export class ServiceClient extends BaseServiceClient {
10731
10732
  );
10732
10733
  }
10733
10734
 
10735
+ /**
10736
+ * POST /menu/v4/brand/{id}/swap-category-items
10737
+ *
10738
+ * @param id
10739
+ * @param body
10740
+ * @param options - additional request options
10741
+ */
10742
+ post_menu_v4_brand_swap_category_items(
10743
+ id: string,
10744
+ body: PostMenuV4BrandSwapCategoryItemsBody,
10745
+ options?: RequestOptions,
10746
+ ): ResponsePromise<PostMenuV4BrandSwapCategoryItemsResponse> {
10747
+ return this.request(
10748
+ 'menu',
10749
+ '/menu/v4/brand/{id}/swap-category-items',
10750
+ 'POST',
10751
+ `/menu/v4/brand/${id}/swap-category-items`,
10752
+ body,
10753
+ options,
10754
+ );
10755
+ }
10756
+
10734
10757
  /**
10735
10758
  * POST /menu/v4/brand/{id}/publish
10736
10759
  *
@@ -15168,15 +15191,6 @@ export class ServiceClient extends BaseServiceClient {
15168
15191
  return this.request('discount', '/discount/{id}', 'PUT', `/discount/${id}`, body, options);
15169
15192
  }
15170
15193
 
15171
- /**
15172
- * GET /discount/all - Get all discounts
15173
- *
15174
- * @param options - additional request options
15175
- */
15176
- get_discounts_all(options?: RequestOptions): ResponsePromise<GetDiscountsAllResponse> {
15177
- return this.request('discount', '/discount/all', 'GET', `/discount/all`, null, options);
15178
- }
15179
-
15180
15194
  /**
15181
15195
  * GET /discount - Get discounts by taxonomy
15182
15196
  *
@@ -33,6 +33,33 @@ export interface Error {
33
33
  data: ErrorData;
34
34
  }
35
35
 
36
+ export interface EntityBase {
37
+ id: string;
38
+ name: string;
39
+ }
40
+
41
+ export interface DiscountSiteMeta {
42
+ appName: string;
43
+ brandsOfSite: EntityBase[];
44
+ }
45
+
46
+ export interface DiscountSite {
47
+ id: string;
48
+ name: string;
49
+ meta: DiscountSiteMeta;
50
+ }
51
+
52
+ export interface DiscountBrandMeta {
53
+ appName: string;
54
+ siteOfBrand: EntityBase;
55
+ }
56
+
57
+ export interface DiscountBrand {
58
+ id: string;
59
+ name: string;
60
+ meta: DiscountBrandMeta;
61
+ }
62
+
36
63
  export interface DiscountStatus {
37
64
  live?: boolean;
38
65
  publishedTo3rdParty?: boolean;
@@ -99,15 +126,10 @@ export interface DiscountChannelConfig {
99
126
  agilysys: boolean;
100
127
  }
101
128
 
102
- export interface Item {
103
- id: string;
104
- name: string;
105
- }
106
-
107
129
  export interface Category {
108
130
  id: string;
109
131
  name: string;
110
- items: Item[];
132
+ items: EntityBase[];
111
133
  }
112
134
 
113
135
  export interface Menu {
@@ -148,36 +170,6 @@ export interface ItemLevelConfig {
148
170
  details: ItemLevelConfigDetails[];
149
171
  }
150
172
 
151
- export interface DiscountWithEntities {
152
- // discount id
153
- id: string;
154
- // user id of discount creator
155
- createdBy: string;
156
- // user id of most recent update
157
- updatedBy: string;
158
- // What the discount applies to
159
- appliesTo: 'order' | 'items';
160
- // What the discount type is
161
- type: 'Total Order' | 'Single Items' | 'Bundle';
162
- sites?: string[];
163
- brands?: string[];
164
- createdAt: string;
165
- updatedAt: string;
166
- name: string;
167
- status: DiscountStatus;
168
- is?: DiscountIs;
169
- meta?: DiscountMeta;
170
- schedule?: DiscountSchedule;
171
- channelConfig: DiscountChannelConfig;
172
- itemLevelConfig?: ItemLevelConfig;
173
- siteCount: number;
174
- brandCount: number;
175
- }
176
-
177
- export interface GetAllDiscountsResponseDTO {
178
- discounts: DiscountWithEntities[];
179
- }
180
-
181
173
  export interface GetDiscountResponseDTO {
182
174
  // discount id
183
175
  id: string;
@@ -189,8 +181,8 @@ export interface GetDiscountResponseDTO {
189
181
  appliesTo: 'order' | 'items';
190
182
  // What the discount type is
191
183
  type: 'Total Order' | 'Single Items' | 'Bundle';
192
- sites?: string[];
193
- brands?: string[];
184
+ sites?: DiscountSite[];
185
+ brands?: DiscountBrand[];
194
186
  createdAt: string;
195
187
  updatedAt: string;
196
188
  name: string;
@@ -274,8 +266,8 @@ export interface PatchDiscountResponseDTO {
274
266
  }
275
267
 
276
268
  export interface DiscountTaxonomy {
277
- site?: string[];
278
- brand?: string[];
269
+ site?: DiscountSite[];
270
+ brand?: DiscountBrand[];
279
271
  }
280
272
 
281
273
  export interface PostDiscountRequestDTO {
@@ -534,10 +526,6 @@ export type PutDiscountBody = PutDiscountRequestDTO;
534
526
 
535
527
  export type PutDiscountResponse = PutDiscountResponseDTO;
536
528
 
537
- // GET /discount/all - Get all discounts
538
-
539
- export type GetDiscountsAllResponse = GetAllDiscountsResponseDTO;
540
-
541
529
  // GET /discount - Get discounts by taxonomy
542
530
 
543
531
  export interface GetDiscountsQuery {
@@ -2013,6 +2013,11 @@ export interface CategoryItemRelationshipDTO {
2013
2013
  [index: string]: any;
2014
2014
  }
2015
2015
 
2016
+ export interface SwappedCategoryDTO {
2017
+ category_id?: string;
2018
+ sequence?: number;
2019
+ }
2020
+
2016
2021
  export interface PartialItemDTO {
2017
2022
  base_item_id?: string;
2018
2023
  is_published?: boolean;
@@ -8496,6 +8501,31 @@ export interface PostMenuV4BrandCategoryAttachItemsRequest
8496
8501
  body: PostMenuV4BrandCategoryAttachItemsBody;
8497
8502
  }
8498
8503
 
8504
+ // POST /menu/v4/brand/{id}/swap-category-items
8505
+
8506
+ export interface PostMenuV4BrandSwapCategoryItemsPath {
8507
+ id: string;
8508
+ }
8509
+
8510
+ export interface PostMenuV4BrandSwapCategoryItemsBody {
8511
+ menu_id: string;
8512
+ category_ids: string[];
8513
+ swap_out_item_id: string;
8514
+ swap_in_item_id: string;
8515
+ [index: string]: any;
8516
+ }
8517
+
8518
+ export interface PostMenuV4BrandSwapCategoryItemsResponse {
8519
+ status?: string;
8520
+ swapped_categories?: SwappedCategoryDTO[];
8521
+ }
8522
+
8523
+ export interface PostMenuV4BrandSwapCategoryItemsRequest
8524
+ extends BaseRequest,
8525
+ PostMenuV4BrandSwapCategoryItemsPath {
8526
+ body: PostMenuV4BrandSwapCategoryItemsBody;
8527
+ }
8528
+
8499
8529
  // POST /menu/v4/brand/{id}/publish
8500
8530
 
8501
8531
  export interface PostMenuV4BrandPublishPath {