@gofynd/fdk-client-javascript 1.4.16-beta.1 → 1.4.16-beta.3

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 (73) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +6 -6
  4. package/sdk/application/Cart/CartApplicationClient.js +30 -269
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +90 -339
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +2 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +11 -134
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +40 -8
  12. package/sdk/application/Content/ContentApplicationClient.js +174 -211
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
  15. package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +6 -6
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +40 -153
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +68 -153
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
  23. package/sdk/application/Payment/PaymentApplicationClient.js +6 -437
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  30. package/sdk/application/User/UserApplicationClient.js +1 -407
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  32. package/sdk/common/Utility.d.ts +1 -1
  33. package/sdk/common/Utility.js +4 -4
  34. package/sdk/common/Validator.d.ts +1 -0
  35. package/sdk/common/Validator.js +20 -0
  36. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -0
  37. package/sdk/platform/Cart/CartPlatformModel.js +16 -0
  38. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
  39. package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
  40. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +80 -0
  41. package/sdk/platform/Content/ContentPlatformApplicationClient.js +571 -0
  42. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +75 -1
  43. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +88 -0
  44. package/sdk/platform/Content/ContentPlatformModel.d.ts +131 -5
  45. package/sdk/platform/Content/ContentPlatformModel.js +110 -4
  46. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  47. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  48. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  49. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  50. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  51. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  52. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  53. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  54. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -10
  55. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -118
  56. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -53
  57. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -29
  58. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +10 -0
  59. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
  60. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +58 -1
  61. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -0
  62. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +3 -3
  63. package/sdk/platform/Share/SharePlatformApplicationClient.js +7 -7
  64. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +3 -6
  65. package/sdk/platform/Share/SharePlatformApplicationValidator.js +2 -2
  66. package/sdk/platform/Share/SharePlatformModel.d.ts +10 -2
  67. package/sdk/platform/Share/SharePlatformModel.js +4 -2
  68. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  69. package/sdk/public/Content/ContentPublicClient.d.ts +3 -3
  70. package/sdk/public/Content/ContentPublicClient.js +16 -104
  71. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  72. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  73. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -30,7 +30,7 @@ declare class Rewards {
30
30
  * @summary: Get specific offer
31
31
  * @description: Retrieves detailed information about an offer by its name. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/rewards/getOfferByName/).
32
32
  */
33
- getOfferByName({ name, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Offer>;
33
+ getOfferByName({ name, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<Offer>;
34
34
  /**
35
35
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
36
36
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Rewards {
11
12
  constructor(_conf) {
@@ -52,14 +53,6 @@ class Rewards {
52
53
  { body, requestHeaders } = { requestHeaders: {} },
53
54
  { responseHeaders } = { responseHeaders: false }
54
55
  ) {
55
- let invalidInput = [];
56
- if (invalidInput.length) {
57
- const error = new Error();
58
- error.message = "Missing required field";
59
- error.details = invalidInput;
60
- return Promise.reject(new FDKClientValidationError(error));
61
- }
62
-
63
56
  const query_params = {};
64
57
 
65
58
  const xHeaders = {};
@@ -97,18 +90,12 @@ class Rewards {
97
90
  { name, requestHeaders } = { requestHeaders: {} },
98
91
  { responseHeaders } = { responseHeaders: false }
99
92
  ) {
100
- let invalidInput = [];
101
-
102
- if (!name) {
103
- invalidInput.push({
104
- message: `The 'name' field is required.`,
105
- path: ["name"],
93
+ const errors = validateRequiredParams(arguments[0], ["name"]);
94
+ if (errors.length > 0) {
95
+ const error = new FDKClientValidationError({
96
+ message: "Missing required field",
97
+ details: errors,
106
98
  });
107
- }
108
- if (invalidInput.length) {
109
- const error = new Error();
110
- error.message = "Missing required field";
111
- error.details = invalidInput;
112
99
  return Promise.reject(new FDKClientValidationError(error));
113
100
  }
114
101
 
@@ -149,14 +136,6 @@ class Rewards {
149
136
  { body, requestHeaders } = { requestHeaders: {} },
150
137
  { responseHeaders } = { responseHeaders: false }
151
138
  ) {
152
- let invalidInput = [];
153
- if (invalidInput.length) {
154
- const error = new Error();
155
- error.message = "Missing required field";
156
- error.details = invalidInput;
157
- return Promise.reject(new FDKClientValidationError(error));
158
- }
159
-
160
139
  const query_params = {};
161
140
 
162
141
  const xHeaders = {};
@@ -194,14 +173,6 @@ class Rewards {
194
173
  { requestHeaders } = { requestHeaders: {} },
195
174
  { responseHeaders } = { responseHeaders: false }
196
175
  ) {
197
- let invalidInput = [];
198
- if (invalidInput.length) {
199
- const error = new Error();
200
- error.message = "Missing required field";
201
- error.details = invalidInput;
202
- return Promise.reject(new FDKClientValidationError(error));
203
- }
204
-
205
176
  const query_params = {};
206
177
 
207
178
  const xHeaders = {};
@@ -239,14 +210,6 @@ class Rewards {
239
210
  { pageId, pageSize, requestHeaders } = { requestHeaders: {} },
240
211
  { responseHeaders } = { responseHeaders: false }
241
212
  ) {
242
- let invalidInput = [];
243
- if (invalidInput.length) {
244
- const error = new Error();
245
- error.message = "Missing required field";
246
- error.details = invalidInput;
247
- return Promise.reject(new FDKClientValidationError(error));
248
- }
249
-
250
213
  const query_params = {};
251
214
  query_params["page_id"] = pageId;
252
215
  query_params["page_size"] = pageSize;
@@ -286,14 +249,6 @@ class Rewards {
286
249
  { requestHeaders } = { requestHeaders: {} },
287
250
  { responseHeaders } = { responseHeaders: false }
288
251
  ) {
289
- let invalidInput = [];
290
- if (invalidInput.length) {
291
- const error = new Error();
292
- error.message = "Missing required field";
293
- error.details = invalidInput;
294
- return Promise.reject(new FDKClientValidationError(error));
295
- }
296
-
297
252
  const query_params = {};
298
253
 
299
254
  const xHeaders = {};
@@ -331,14 +286,6 @@ class Rewards {
331
286
  { body, requestHeaders } = { requestHeaders: {} },
332
287
  { responseHeaders } = { responseHeaders: false }
333
288
  ) {
334
- let invalidInput = [];
335
- if (invalidInput.length) {
336
- const error = new Error();
337
- error.message = "Missing required field";
338
- error.details = invalidInput;
339
- return Promise.reject(new FDKClientValidationError(error));
340
- }
341
-
342
289
  const query_params = {};
343
290
 
344
291
  const xHeaders = {};
@@ -39,7 +39,7 @@ declare class Share {
39
39
  * @summary: Collection QR code
40
40
  * @description: Generates a QR code for a specific product collection using its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getCollectionQRCodeBySlug/).
41
41
  */
42
- getCollectionQRCodeBySlug({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<QRCodeResp>;
42
+ getCollectionQRCodeBySlug({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<QRCodeResp>;
43
43
  /**
44
44
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
45
45
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -48,7 +48,7 @@ declare class Share {
48
48
  * @summary: Original URL
49
49
  * @description: Retrieve the original link from a short-link by using a hash value. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getOriginalShortLinkByHash/).
50
50
  */
51
- getOriginalShortLinkByHash({ hash, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShortLinkRes>;
51
+ getOriginalShortLinkByHash({ hash, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShortLinkRes>;
52
52
  /**
53
53
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
54
54
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -57,7 +57,7 @@ declare class Share {
57
57
  * @summary: Product QR code
58
58
  * @description: Creates a QR code for a specific product identified by its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getProductQRCodeBySlug/).
59
59
  */
60
- getProductQRCodeBySlug({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<QRCodeResp>;
60
+ getProductQRCodeBySlug({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<QRCodeResp>;
61
61
  /**
62
62
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
63
63
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -66,7 +66,7 @@ declare class Share {
66
66
  * @summary: Get short link
67
67
  * @description: Retrieves a previously created short link using its hash identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getShortLinkByHash/).
68
68
  */
69
- getShortLinkByHash({ hash, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShortLinkRes>;
69
+ getShortLinkByHash({ hash, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShortLinkRes>;
70
70
  /**
71
71
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
72
72
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Share {
11
12
  constructor(_conf) {
@@ -51,14 +52,6 @@ class Share {
51
52
  { body, requestHeaders } = { requestHeaders: {} },
52
53
  { responseHeaders } = { responseHeaders: false }
53
54
  ) {
54
- let invalidInput = [];
55
- if (invalidInput.length) {
56
- const error = new Error();
57
- error.message = "Missing required field";
58
- error.details = invalidInput;
59
- return Promise.reject(new FDKClientValidationError(error));
60
- }
61
-
62
55
  const query_params = {};
63
56
 
64
57
  const xHeaders = {};
@@ -96,14 +89,6 @@ class Share {
96
89
  { requestHeaders } = { requestHeaders: {} },
97
90
  { responseHeaders } = { responseHeaders: false }
98
91
  ) {
99
- let invalidInput = [];
100
- if (invalidInput.length) {
101
- const error = new Error();
102
- error.message = "Missing required field";
103
- error.details = invalidInput;
104
- return Promise.reject(new FDKClientValidationError(error));
105
- }
106
-
107
92
  const query_params = {};
108
93
 
109
94
  const xHeaders = {};
@@ -141,18 +126,12 @@ class Share {
141
126
  { slug, requestHeaders } = { requestHeaders: {} },
142
127
  { responseHeaders } = { responseHeaders: false }
143
128
  ) {
144
- let invalidInput = [];
145
-
146
- if (!slug) {
147
- invalidInput.push({
148
- message: `The 'slug' field is required.`,
149
- path: ["slug"],
129
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
130
+ if (errors.length > 0) {
131
+ const error = new FDKClientValidationError({
132
+ message: "Missing required field",
133
+ details: errors,
150
134
  });
151
- }
152
- if (invalidInput.length) {
153
- const error = new Error();
154
- error.message = "Missing required field";
155
- error.details = invalidInput;
156
135
  return Promise.reject(new FDKClientValidationError(error));
157
136
  }
158
137
 
@@ -193,18 +172,12 @@ class Share {
193
172
  { hash, requestHeaders } = { requestHeaders: {} },
194
173
  { responseHeaders } = { responseHeaders: false }
195
174
  ) {
196
- let invalidInput = [];
197
-
198
- if (!hash) {
199
- invalidInput.push({
200
- message: `The 'hash' field is required.`,
201
- path: ["hash"],
175
+ const errors = validateRequiredParams(arguments[0], ["hash"]);
176
+ if (errors.length > 0) {
177
+ const error = new FDKClientValidationError({
178
+ message: "Missing required field",
179
+ details: errors,
202
180
  });
203
- }
204
- if (invalidInput.length) {
205
- const error = new Error();
206
- error.message = "Missing required field";
207
- error.details = invalidInput;
208
181
  return Promise.reject(new FDKClientValidationError(error));
209
182
  }
210
183
 
@@ -245,18 +218,12 @@ class Share {
245
218
  { slug, requestHeaders } = { requestHeaders: {} },
246
219
  { responseHeaders } = { responseHeaders: false }
247
220
  ) {
248
- let invalidInput = [];
249
-
250
- if (!slug) {
251
- invalidInput.push({
252
- message: `The 'slug' field is required.`,
253
- path: ["slug"],
221
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
222
+ if (errors.length > 0) {
223
+ const error = new FDKClientValidationError({
224
+ message: "Missing required field",
225
+ details: errors,
254
226
  });
255
- }
256
- if (invalidInput.length) {
257
- const error = new Error();
258
- error.message = "Missing required field";
259
- error.details = invalidInput;
260
227
  return Promise.reject(new FDKClientValidationError(error));
261
228
  }
262
229
 
@@ -297,18 +264,12 @@ class Share {
297
264
  { hash, requestHeaders } = { requestHeaders: {} },
298
265
  { responseHeaders } = { responseHeaders: false }
299
266
  ) {
300
- let invalidInput = [];
301
-
302
- if (!hash) {
303
- invalidInput.push({
304
- message: `The 'hash' field is required.`,
305
- path: ["hash"],
267
+ const errors = validateRequiredParams(arguments[0], ["hash"]);
268
+ if (errors.length > 0) {
269
+ const error = new FDKClientValidationError({
270
+ message: "Missing required field",
271
+ details: errors,
306
272
  });
307
- }
308
- if (invalidInput.length) {
309
- const error = new Error();
310
- error.message = "Missing required field";
311
- error.details = invalidInput;
312
273
  return Promise.reject(new FDKClientValidationError(error));
313
274
  }
314
275
 
@@ -349,21 +310,6 @@ class Share {
349
310
  { url, requestHeaders } = { requestHeaders: {} },
350
311
  { responseHeaders } = { responseHeaders: false }
351
312
  ) {
352
- let invalidInput = [];
353
-
354
- if (!url) {
355
- invalidInput.push({
356
- message: `The 'url' field is required.`,
357
- path: ["url"],
358
- });
359
- }
360
- if (invalidInput.length) {
361
- const error = new Error();
362
- error.message = "Missing required field";
363
- error.details = invalidInput;
364
- return Promise.reject(new FDKClientValidationError(error));
365
- }
366
-
367
313
  const query_params = {};
368
314
  query_params["url"] = url;
369
315
 
@@ -18,7 +18,7 @@ declare class Theme {
18
18
  * @summary: List pages
19
19
  * @description: Get all page level configs, sections and seo data of a theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getAllPages/).
20
20
  */
21
- getAllPages({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AllAvailablePageSchema>;
21
+ getAllPages({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AllAvailablePageSchema>;
22
22
  /**
23
23
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
24
24
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -36,7 +36,7 @@ declare class Theme {
36
36
  * @summary: Get theme page
37
37
  * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getPage/).
38
38
  */
39
- getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AvailablePageSchema>;
39
+ getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AvailablePageSchema>;
40
40
  /**
41
41
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
42
42
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -45,5 +45,5 @@ declare class Theme {
45
45
  * @summary: Get theme for preview
46
46
  * @description: Gets the theme configuration and template details of a theme by theme id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getThemeForPreview/).
47
47
  */
48
- getThemeForPreview({ themeId, filters, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ThemesSchema>;
48
+ getThemeForPreview({ themeId, filters, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ThemesSchema>;
49
49
  }
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Theme {
11
12
  constructor(_conf) {
@@ -44,18 +45,12 @@ class Theme {
44
45
  { themeId, requestHeaders } = { requestHeaders: {} },
45
46
  { responseHeaders } = { responseHeaders: false }
46
47
  ) {
47
- let invalidInput = [];
48
-
49
- if (!themeId) {
50
- invalidInput.push({
51
- message: `The 'themeId' field is required.`,
52
- path: ["themeId"],
48
+ const errors = validateRequiredParams(arguments[0], ["themeId"]);
49
+ if (errors.length > 0) {
50
+ const error = new FDKClientValidationError({
51
+ message: "Missing required field",
52
+ details: errors,
53
53
  });
54
- }
55
- if (invalidInput.length) {
56
- const error = new Error();
57
- error.message = "Missing required field";
58
- error.details = invalidInput;
59
54
  return Promise.reject(new FDKClientValidationError(error));
60
55
  }
61
56
 
@@ -96,14 +91,6 @@ class Theme {
96
91
  { filters, requestHeaders } = { requestHeaders: {} },
97
92
  { responseHeaders } = { responseHeaders: false }
98
93
  ) {
99
- let invalidInput = [];
100
- if (invalidInput.length) {
101
- const error = new Error();
102
- error.message = "Missing required field";
103
- error.details = invalidInput;
104
- return Promise.reject(new FDKClientValidationError(error));
105
- }
106
-
107
94
  const query_params = {};
108
95
  query_params["filters"] = filters;
109
96
 
@@ -149,24 +136,15 @@ class Theme {
149
136
  } = { requestHeaders: {} },
150
137
  { responseHeaders } = { responseHeaders: false }
151
138
  ) {
152
- let invalidInput = [];
153
-
154
- if (!themeId) {
155
- invalidInput.push({
156
- message: `The 'themeId' field is required.`,
157
- path: ["themeId"],
139
+ const errors = validateRequiredParams(arguments[0], [
140
+ "themeId",
141
+ "pageValue",
142
+ ]);
143
+ if (errors.length > 0) {
144
+ const error = new FDKClientValidationError({
145
+ message: "Missing required field",
146
+ details: errors,
158
147
  });
159
- }
160
- if (!pageValue) {
161
- invalidInput.push({
162
- message: `The 'pageValue' field is required.`,
163
- path: ["pageValue"],
164
- });
165
- }
166
- if (invalidInput.length) {
167
- const error = new Error();
168
- error.message = "Missing required field";
169
- error.details = invalidInput;
170
148
  return Promise.reject(new FDKClientValidationError(error));
171
149
  }
172
150
 
@@ -210,18 +188,12 @@ class Theme {
210
188
  { themeId, filters, requestHeaders } = { requestHeaders: {} },
211
189
  { responseHeaders } = { responseHeaders: false }
212
190
  ) {
213
- let invalidInput = [];
214
-
215
- if (!themeId) {
216
- invalidInput.push({
217
- message: `The 'themeId' field is required.`,
218
- path: ["themeId"],
191
+ const errors = validateRequiredParams(arguments[0], ["themeId"]);
192
+ if (errors.length > 0) {
193
+ const error = new FDKClientValidationError({
194
+ message: "Missing required field",
195
+ details: errors,
219
196
  });
220
- }
221
- if (invalidInput.length) {
222
- const error = new Error();
223
- error.message = "Missing required field";
224
- error.details = invalidInput;
225
197
  return Promise.reject(new FDKClientValidationError(error));
226
198
  }
227
199