@compassdigital/sdk.typescript 4.103.0 → 4.104.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.103.0",
3
+ "version": "4.104.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
package/src/index.ts CHANGED
@@ -1144,16 +1144,16 @@ import {
1144
1144
  } from './interface/review';
1145
1145
 
1146
1146
  import {
1147
- PostDiscountBody,
1148
- PostDiscountResponse,
1149
- GetDiscountsQuery,
1150
- GetDiscountsResponse,
1151
1147
  GetDiscountQuery,
1152
1148
  GetDiscountResponse,
1153
1149
  PutDiscountBody,
1154
1150
  PutDiscountResponse,
1155
1151
  DeleteDiscountBody,
1156
1152
  DeleteDiscountResponse,
1153
+ GetDiscountsQuery,
1154
+ GetDiscountsResponse,
1155
+ PostDiscountBody,
1156
+ PostDiscountResponse,
1157
1157
  PutDiscountPublishBody,
1158
1158
  PutDiscountPublishResponse,
1159
1159
  } from './interface/discount';
@@ -11768,32 +11768,6 @@ export class ServiceClient extends BaseServiceClient {
11768
11768
  return this.request('review', '/review/{id}', 'get', `/review/${id}`, null, options);
11769
11769
  }
11770
11770
 
11771
- /**
11772
- * POST /discount - Post a discount
11773
- *
11774
- * @param body
11775
- * @param options - additional request options
11776
- */
11777
- post_discount(
11778
- body: PostDiscountBody,
11779
- options?: RequestOptions,
11780
- ): ResponsePromise<PostDiscountResponse> {
11781
- return this.request('discount', '/discount', 'post', `/discount`, body, options);
11782
- }
11783
-
11784
- /**
11785
- * GET /discount - Get discounts by taxonomy
11786
- *
11787
- * @param options - additional request options
11788
- */
11789
- get_discounts(
11790
- options: {
11791
- query: GetDiscountsQuery;
11792
- } & RequestOptions,
11793
- ): ResponsePromise<GetDiscountsResponse> {
11794
- return this.request('discount', '/discount', 'get', `/discount`, null, options);
11795
- }
11796
-
11797
11771
  /**
11798
11772
  * GET /discount/{id} - Get a discount
11799
11773
  *
@@ -11839,6 +11813,32 @@ export class ServiceClient extends BaseServiceClient {
11839
11813
  return this.request('discount', '/discount/{id}', 'delete', `/discount/${id}`, body, options);
11840
11814
  }
11841
11815
 
11816
+ /**
11817
+ * GET /discount - Get discounts by taxonomy
11818
+ *
11819
+ * @param options - additional request options
11820
+ */
11821
+ get_discounts(
11822
+ options: {
11823
+ query: GetDiscountsQuery;
11824
+ } & RequestOptions,
11825
+ ): ResponsePromise<GetDiscountsResponse> {
11826
+ return this.request('discount', '/discount', 'get', `/discount`, null, options);
11827
+ }
11828
+
11829
+ /**
11830
+ * POST /discount - Post a discount
11831
+ *
11832
+ * @param body
11833
+ * @param options - additional request options
11834
+ */
11835
+ post_discount(
11836
+ body: PostDiscountBody,
11837
+ options?: RequestOptions,
11838
+ ): ResponsePromise<PostDiscountResponse> {
11839
+ return this.request('discount', '/discount', 'post', `/discount`, body, options);
11840
+ }
11841
+
11842
11842
  /**
11843
11843
  * PUT /discount/{id}/publish - update and publish a discount
11844
11844
  *
@@ -5,6 +5,7 @@ import { RequestQuery, BaseRequest } from './util';
5
5
 
6
6
  export interface DiscountStatus {
7
7
  live?: boolean;
8
+ publishedTo3rdParty?: boolean;
8
9
  readyToPublish?: boolean;
9
10
  }
10
11
 
@@ -15,39 +16,6 @@ export interface DiscountIs {
15
16
  voucherPromo?: boolean;
16
17
  }
17
18
 
18
- export interface PostDiscountRequestDTO {
19
- // user is of discount creator
20
- createdBy?: string;
21
- name?: string;
22
- status?: DiscountStatus;
23
- is?: DiscountIs;
24
- app?: string;
25
- }
26
-
27
- export interface PostDiscountResponseDTO {
28
- // user is of discount creator
29
- createdBy?: string;
30
- id: string;
31
- createdAt: string;
32
- updatedAt: string;
33
- name?: string;
34
- status?: DiscountStatus;
35
- is?: DiscountIs;
36
- app?: string;
37
- }
38
-
39
- export interface BadRequestErrorDTO {
40
- message: string;
41
- code: number;
42
- data: Record<string, any>;
43
- }
44
-
45
- export interface UnauthorizedErrorDTO {
46
- message: string;
47
- code: number;
48
- data: Record<string, any>;
49
- }
50
-
51
19
  export interface VoucherifyMetaDataDiscount {
52
20
  type: string;
53
21
  amountOff?: number;
@@ -74,6 +42,7 @@ export interface GetDiscountResponseDTO {
74
42
  id: string;
75
43
  createdAt: string;
76
44
  updatedAt: string;
45
+ updatedBy?: string;
77
46
  name?: string;
78
47
  status?: DiscountStatus;
79
48
  is?: DiscountIs;
@@ -81,6 +50,12 @@ export interface GetDiscountResponseDTO {
81
50
  meta?: DiscountMeta;
82
51
  }
83
52
 
53
+ export interface UnauthorizedErrorDTO {
54
+ message: string;
55
+ code: number;
56
+ data: Record<string, any>;
57
+ }
58
+
84
59
  export interface NotFoundErrorDTO {
85
60
  message: string;
86
61
  code: number;
@@ -93,6 +68,7 @@ export interface DiscountDTO {
93
68
  id: string;
94
69
  createdAt: string;
95
70
  updatedAt: string;
71
+ updatedBy?: string;
96
72
  name?: string;
97
73
  status?: DiscountStatus;
98
74
  is?: DiscountIs;
@@ -104,9 +80,30 @@ export interface GetDiscountsResponseDTO {
104
80
  discounts: DiscountDTO[];
105
81
  }
106
82
 
83
+ export interface BadRequestErrorDTO {
84
+ message: string;
85
+ code: number;
86
+ data: Record<string, any>;
87
+ }
88
+
89
+ export interface PostDiscountRequestDTO {
90
+ createdBy: string;
91
+ name: string;
92
+ app: string;
93
+ }
94
+
95
+ export interface PostDiscountResponseDTO {
96
+ createdBy: string;
97
+ name: string;
98
+ app: string;
99
+ id: string;
100
+ createdAt: string;
101
+ updatedAt: string;
102
+ }
103
+
107
104
  export interface PutDiscountRequestDTO {
108
105
  taxonomy?: Record<string, any>;
109
- id: string;
106
+ updatedBy?: string;
110
107
  name?: string;
111
108
  status?: DiscountStatus;
112
109
  is?: DiscountIs;
@@ -120,6 +117,7 @@ export interface PutDiscountResponseDTO {
120
117
  id: string;
121
118
  createdAt: string;
122
119
  updatedAt: string;
120
+ updatedBy?: string;
123
121
  name?: string;
124
122
  status?: DiscountStatus;
125
123
  is?: DiscountIs;
@@ -131,7 +129,7 @@ export type InternalServerErrorException = Record<string, any>;
131
129
 
132
130
  export interface PutDiscountPublishRequestDTO {
133
131
  taxonomy?: Record<string, any>;
134
- id: string;
132
+ updatedBy?: string;
135
133
  name?: string;
136
134
  status?: DiscountStatus;
137
135
  is?: DiscountIs;
@@ -145,6 +143,7 @@ export interface PutDiscountPublishResponseDTO {
145
143
  id: string;
146
144
  createdAt: string;
147
145
  updatedAt: string;
146
+ updatedBy?: string;
148
147
  name?: string;
149
148
  status?: DiscountStatus;
150
149
  is?: DiscountIs;
@@ -162,29 +161,6 @@ export interface DeleteDiscountResponseDTO {
162
161
  success: boolean;
163
162
  }
164
163
 
165
- // POST /discount - Post a discount
166
-
167
- export type PostDiscountBody = PostDiscountRequestDTO;
168
-
169
- export type PostDiscountResponse = PostDiscountResponseDTO;
170
-
171
- export interface PostDiscountRequest extends BaseRequest {
172
- body: PostDiscountBody;
173
- }
174
-
175
- // GET /discount - Get discounts by taxonomy
176
-
177
- export interface GetDiscountsQuery {
178
- taxonomyFilter: string;
179
- active: boolean;
180
- // Graphql query string
181
- _query?: string;
182
- }
183
-
184
- export type GetDiscountsResponse = GetDiscountsResponseDTO;
185
-
186
- export interface GetDiscountsRequest extends BaseRequest, RequestQuery<GetDiscountsQuery> {}
187
-
188
164
  // GET /discount/{id} - Get a discount
189
165
 
190
166
  export interface GetDiscountPath {
@@ -233,6 +209,29 @@ export interface DeleteDiscountRequest extends BaseRequest, DeleteDiscountPath {
233
209
  body: DeleteDiscountBody;
234
210
  }
235
211
 
212
+ // GET /discount - Get discounts by taxonomy
213
+
214
+ export interface GetDiscountsQuery {
215
+ taxonomyFilter: string;
216
+ active: boolean;
217
+ // Graphql query string
218
+ _query?: string;
219
+ }
220
+
221
+ export type GetDiscountsResponse = GetDiscountsResponseDTO;
222
+
223
+ export interface GetDiscountsRequest extends BaseRequest, RequestQuery<GetDiscountsQuery> {}
224
+
225
+ // POST /discount - Post a discount
226
+
227
+ export type PostDiscountBody = PostDiscountRequestDTO;
228
+
229
+ export type PostDiscountResponse = PostDiscountResponseDTO;
230
+
231
+ export interface PostDiscountRequest extends BaseRequest {
232
+ body: PostDiscountBody;
233
+ }
234
+
236
235
  // PUT /discount/{id}/publish - update and publish a discount
237
236
 
238
237
  export interface PutDiscountPublishPath {