@gofynd/fdk-client-javascript 1.6.4 → 2.0.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 (146) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -268
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
  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 +24 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +222 -191
  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 +16 -56
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
  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 +2 -12
  23. package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
  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/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
  38. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
  40. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
  41. package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
  42. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
  43. package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
  45. package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
  46. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +5 -0
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -0
  49. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
  50. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
  51. package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
  52. package/sdk/platform/Cart/CartPlatformModel.js +38 -5
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
  57. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
  58. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
  63. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
  65. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
  67. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
  69. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
  70. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
  72. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
  74. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
  75. package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
  76. package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
  77. package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
  78. package/sdk/platform/Content/ContentPlatformModel.js +717 -34
  79. package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
  80. package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
  81. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
  82. package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
  83. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
  84. package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
  85. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
  86. package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
  87. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
  88. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
  89. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
  90. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
  91. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
  92. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
  93. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
  94. package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
  95. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  98. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  99. package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
  100. package/sdk/platform/Order/OrderPlatformClient.js +397 -0
  101. package/sdk/platform/Order/OrderPlatformModel.d.ts +41 -9
  102. package/sdk/platform/Order/OrderPlatformModel.js +20 -7
  103. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  104. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
  107. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
  108. package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
  109. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
  110. package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
  114. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
  115. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
  117. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
  118. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
  119. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
  120. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
  121. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
  122. package/sdk/platform/Share/SharePlatformModel.js +2 -0
  123. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +10 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +79 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +13 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +12 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +52 -1
  128. package/sdk/platform/User/UserPlatformModel.js +36 -0
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +5 -0
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +2 -0
  131. package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
  132. package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
  133. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  134. package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
  135. package/sdk/public/Content/ContentPublicClient.js +261 -104
  136. package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
  137. package/sdk/public/Content/ContentPublicModel.js +102 -0
  138. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
  139. package/sdk/public/Content/ContentPublicValidator.js +26 -0
  140. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  141. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  142. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  143. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  144. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  145. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  146. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -6,11 +6,16 @@ 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 Content {
11
12
  constructor(_conf) {
12
13
  this._conf = _conf;
13
14
  this._relativeUrls = {
15
+ fetchResourceTranslations:
16
+ "/service/application/content/v1.0/resource/translations/{type}/{locale}",
17
+ fetchResourceTranslationsWithPayload:
18
+ "/service/application/content/v1.0/resource/translations/{type}/{locale}",
14
19
  getAnnouncements: "/service/application/content/v1.0/announcements",
15
20
  getBlog: "/service/application/content/v1.0/blogs/{slug}",
16
21
  getBlogs: "/service/application/content/v1.0/blogs",
@@ -34,7 +39,10 @@ class Content {
34
39
  getSEOConfiguration: "/service/application/content/v1.0/seo",
35
40
  getSEOMarkupSchemas: "/service/application/content/v1.0/seo/schema",
36
41
  getSupportInformation: "/service/application/content/v1.0/support",
42
+ getSupportedLanguages: "/service/application/content/v1.0/languages",
37
43
  getTags: "/service/application/content/v1.0/tags",
44
+ getTranslateUILabels:
45
+ "/service/application/content/v1.0/translate-ui-labels",
38
46
  };
39
47
  this._urls = Object.entries(this._relativeUrls).reduce(
40
48
  (urls, [method, relativeUrl]) => {
@@ -52,6 +60,100 @@ class Content {
52
60
  };
53
61
  }
54
62
 
63
+ /**
64
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
65
+ * @param {import("../ApplicationAPIClient").Options} - Options
66
+ * @returns {Promise<ResourceTranslations>} - Success response
67
+ * @name fetchResourceTranslations
68
+ * @summary: Get Resource Translations
69
+ * @description: Fetch translations for specific resource IDs based on type and locale settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/fetchResourceTranslations/).
70
+ */
71
+ async fetchResourceTranslations(
72
+ { type, locale, resourceId, requestHeaders } = { requestHeaders: {} },
73
+ { responseHeaders } = { responseHeaders: false }
74
+ ) {
75
+ const errors = validateRequiredParams(arguments[0], ["type", "locale"]);
76
+ if (errors.length > 0) {
77
+ const error = new FDKClientValidationError({
78
+ message: "Missing required field",
79
+ details: errors,
80
+ });
81
+ return Promise.reject(new FDKClientValidationError(error));
82
+ }
83
+
84
+ const query_params = {};
85
+ query_params["resource_id"] = resourceId;
86
+
87
+ const xHeaders = {};
88
+
89
+ const response = await ApplicationAPIClient.execute(
90
+ this._conf,
91
+ "get",
92
+ constructUrl({
93
+ url: this._urls["fetchResourceTranslations"],
94
+ params: { type, locale },
95
+ }),
96
+ query_params,
97
+ undefined,
98
+ { ...xHeaders, ...requestHeaders },
99
+ { responseHeaders }
100
+ );
101
+
102
+ let responseData = response;
103
+ if (responseHeaders) {
104
+ responseData = response[0];
105
+ }
106
+
107
+ return response;
108
+ }
109
+
110
+ /**
111
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
112
+ * @param {import("../ApplicationAPIClient").Options} - Options
113
+ * @returns {Promise<ResourceTranslations>} - Success response
114
+ * @name fetchResourceTranslationsWithPayload
115
+ * @summary: Post Resource Translations
116
+ * @description: Submit and retrieve translations for resources using payload data and locale settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/fetchResourceTranslationsWithPayload/).
117
+ */
118
+ async fetchResourceTranslationsWithPayload(
119
+ { type, locale, resourceId, body, requestHeaders } = { requestHeaders: {} },
120
+ { responseHeaders } = { responseHeaders: false }
121
+ ) {
122
+ const errors = validateRequiredParams(arguments[0], ["type", "locale"]);
123
+ if (errors.length > 0) {
124
+ const error = new FDKClientValidationError({
125
+ message: "Missing required field",
126
+ details: errors,
127
+ });
128
+ return Promise.reject(new FDKClientValidationError(error));
129
+ }
130
+
131
+ const query_params = {};
132
+ query_params["resource_id"] = resourceId;
133
+
134
+ const xHeaders = {};
135
+
136
+ const response = await ApplicationAPIClient.execute(
137
+ this._conf,
138
+ "post",
139
+ constructUrl({
140
+ url: this._urls["fetchResourceTranslationsWithPayload"],
141
+ params: { type, locale },
142
+ }),
143
+ query_params,
144
+ body,
145
+ { ...xHeaders, ...requestHeaders },
146
+ { responseHeaders }
147
+ );
148
+
149
+ let responseData = response;
150
+ if (responseHeaders) {
151
+ responseData = response[0];
152
+ }
153
+
154
+ return response;
155
+ }
156
+
55
157
  /**
56
158
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
57
159
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -64,14 +166,6 @@ class Content {
64
166
  { requestHeaders } = { requestHeaders: {} },
65
167
  { responseHeaders } = { responseHeaders: false }
66
168
  ) {
67
- let invalidInput = [];
68
- if (invalidInput.length) {
69
- const error = new Error();
70
- error.message = "Missing required field";
71
- error.details = invalidInput;
72
- return Promise.reject(new FDKClientValidationError(error));
73
- }
74
-
75
169
  const query_params = {};
76
170
 
77
171
  const xHeaders = {};
@@ -109,18 +203,12 @@ class Content {
109
203
  { slug, rootId, preview, requestHeaders } = { requestHeaders: {} },
110
204
  { responseHeaders } = { responseHeaders: false }
111
205
  ) {
112
- let invalidInput = [];
113
-
114
- if (!slug) {
115
- invalidInput.push({
116
- message: `The 'slug' field is required.`,
117
- path: ["slug"],
206
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
207
+ if (errors.length > 0) {
208
+ const error = new FDKClientValidationError({
209
+ message: "Missing required field",
210
+ details: errors,
118
211
  });
119
- }
120
- if (invalidInput.length) {
121
- const error = new Error();
122
- error.message = "Missing required field";
123
- error.details = invalidInput;
124
212
  return Promise.reject(new FDKClientValidationError(error));
125
213
  }
126
214
 
@@ -163,14 +251,6 @@ class Content {
163
251
  { pageNo, pageSize, tags, search, requestHeaders } = { requestHeaders: {} },
164
252
  { responseHeaders } = { responseHeaders: false }
165
253
  ) {
166
- let invalidInput = [];
167
- if (invalidInput.length) {
168
- const error = new Error();
169
- error.message = "Missing required field";
170
- error.details = invalidInput;
171
- return Promise.reject(new FDKClientValidationError(error));
172
- }
173
-
174
254
  const query_params = {};
175
255
  query_params["page_no"] = pageNo;
176
256
  query_params["page_size"] = pageSize;
@@ -212,24 +292,15 @@ class Content {
212
292
  { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
213
293
  { responseHeaders } = { responseHeaders: false }
214
294
  ) {
215
- let invalidInput = [];
216
-
217
- if (!resource) {
218
- invalidInput.push({
219
- message: `The 'resource' field is required.`,
220
- path: ["resource"],
295
+ const errors = validateRequiredParams(arguments[0], [
296
+ "resource",
297
+ "resourceSlug",
298
+ ]);
299
+ if (errors.length > 0) {
300
+ const error = new FDKClientValidationError({
301
+ message: "Missing required field",
302
+ details: errors,
221
303
  });
222
- }
223
- if (!resourceSlug) {
224
- invalidInput.push({
225
- message: `The 'resourceSlug' field is required.`,
226
- path: ["resourceSlug"],
227
- });
228
- }
229
- if (invalidInput.length) {
230
- const error = new Error();
231
- error.message = "Missing required field";
232
- error.details = invalidInput;
233
304
  return Promise.reject(new FDKClientValidationError(error));
234
305
  }
235
306
 
@@ -270,24 +341,15 @@ class Content {
270
341
  { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
271
342
  { responseHeaders } = { responseHeaders: false }
272
343
  ) {
273
- let invalidInput = [];
274
-
275
- if (!definitionSlug) {
276
- invalidInput.push({
277
- message: `The 'definitionSlug' field is required.`,
278
- path: ["definitionSlug"],
279
- });
280
- }
281
- if (!slug) {
282
- invalidInput.push({
283
- message: `The 'slug' field is required.`,
284
- path: ["slug"],
344
+ const errors = validateRequiredParams(arguments[0], [
345
+ "definitionSlug",
346
+ "slug",
347
+ ]);
348
+ if (errors.length > 0) {
349
+ const error = new FDKClientValidationError({
350
+ message: "Missing required field",
351
+ details: errors,
285
352
  });
286
- }
287
- if (invalidInput.length) {
288
- const error = new Error();
289
- error.message = "Missing required field";
290
- error.details = invalidInput;
291
353
  return Promise.reject(new FDKClientValidationError(error));
292
354
  }
293
355
 
@@ -328,14 +390,6 @@ class Content {
328
390
  { requestHeaders } = { requestHeaders: {} },
329
391
  { responseHeaders } = { responseHeaders: false }
330
392
  ) {
331
- let invalidInput = [];
332
- if (invalidInput.length) {
333
- const error = new Error();
334
- error.message = "Missing required field";
335
- error.details = invalidInput;
336
- return Promise.reject(new FDKClientValidationError(error));
337
- }
338
-
339
393
  const query_params = {};
340
394
 
341
395
  const xHeaders = {};
@@ -373,18 +427,12 @@ class Content {
373
427
  { slug, requestHeaders } = { requestHeaders: {} },
374
428
  { responseHeaders } = { responseHeaders: false }
375
429
  ) {
376
- let invalidInput = [];
377
-
378
- if (!slug) {
379
- invalidInput.push({
380
- message: `The 'slug' field is required.`,
381
- path: ["slug"],
430
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
431
+ if (errors.length > 0) {
432
+ const error = new FDKClientValidationError({
433
+ message: "Missing required field",
434
+ details: errors,
382
435
  });
383
- }
384
- if (invalidInput.length) {
385
- const error = new Error();
386
- error.message = "Missing required field";
387
- error.details = invalidInput;
388
436
  return Promise.reject(new FDKClientValidationError(error));
389
437
  }
390
438
 
@@ -425,14 +473,6 @@ class Content {
425
473
  { requestHeaders } = { requestHeaders: {} },
426
474
  { responseHeaders } = { responseHeaders: false }
427
475
  ) {
428
- let invalidInput = [];
429
- if (invalidInput.length) {
430
- const error = new Error();
431
- error.message = "Missing required field";
432
- error.details = invalidInput;
433
- return Promise.reject(new FDKClientValidationError(error));
434
- }
435
-
436
476
  const query_params = {};
437
477
 
438
478
  const xHeaders = {};
@@ -470,18 +510,12 @@ class Content {
470
510
  { slug, requestHeaders } = { requestHeaders: {} },
471
511
  { responseHeaders } = { responseHeaders: false }
472
512
  ) {
473
- let invalidInput = [];
474
-
475
- if (!slug) {
476
- invalidInput.push({
477
- message: `The 'slug' field is required.`,
478
- path: ["slug"],
513
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
514
+ if (errors.length > 0) {
515
+ const error = new FDKClientValidationError({
516
+ message: "Missing required field",
517
+ details: errors,
479
518
  });
480
- }
481
- if (invalidInput.length) {
482
- const error = new Error();
483
- error.message = "Missing required field";
484
- error.details = invalidInput;
485
519
  return Promise.reject(new FDKClientValidationError(error));
486
520
  }
487
521
 
@@ -522,14 +556,6 @@ class Content {
522
556
  { requestHeaders } = { requestHeaders: {} },
523
557
  { responseHeaders } = { responseHeaders: false }
524
558
  ) {
525
- let invalidInput = [];
526
- if (invalidInput.length) {
527
- const error = new Error();
528
- error.message = "Missing required field";
529
- error.details = invalidInput;
530
- return Promise.reject(new FDKClientValidationError(error));
531
- }
532
-
533
559
  const query_params = {};
534
560
 
535
561
  const xHeaders = {};
@@ -567,18 +593,12 @@ class Content {
567
593
  { slug, requestHeaders } = { requestHeaders: {} },
568
594
  { responseHeaders } = { responseHeaders: false }
569
595
  ) {
570
- let invalidInput = [];
571
-
572
- if (!slug) {
573
- invalidInput.push({
574
- message: `The 'slug' field is required.`,
575
- path: ["slug"],
596
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
597
+ if (errors.length > 0) {
598
+ const error = new FDKClientValidationError({
599
+ message: "Missing required field",
600
+ details: errors,
576
601
  });
577
- }
578
- if (invalidInput.length) {
579
- const error = new Error();
580
- error.message = "Missing required field";
581
- error.details = invalidInput;
582
602
  return Promise.reject(new FDKClientValidationError(error));
583
603
  }
584
604
 
@@ -619,14 +639,6 @@ class Content {
619
639
  { requestHeaders } = { requestHeaders: {} },
620
640
  { responseHeaders } = { responseHeaders: false }
621
641
  ) {
622
- let invalidInput = [];
623
- if (invalidInput.length) {
624
- const error = new Error();
625
- error.message = "Missing required field";
626
- error.details = invalidInput;
627
- return Promise.reject(new FDKClientValidationError(error));
628
- }
629
-
630
642
  const query_params = {};
631
643
 
632
644
  const xHeaders = {};
@@ -664,14 +676,6 @@ class Content {
664
676
  { requestHeaders } = { requestHeaders: {} },
665
677
  { responseHeaders } = { responseHeaders: false }
666
678
  ) {
667
- let invalidInput = [];
668
- if (invalidInput.length) {
669
- const error = new Error();
670
- error.message = "Missing required field";
671
- error.details = invalidInput;
672
- return Promise.reject(new FDKClientValidationError(error));
673
- }
674
-
675
679
  const query_params = {};
676
680
 
677
681
  const xHeaders = {};
@@ -709,14 +713,6 @@ class Content {
709
713
  { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
710
714
  { responseHeaders } = { responseHeaders: false }
711
715
  ) {
712
- let invalidInput = [];
713
- if (invalidInput.length) {
714
- const error = new Error();
715
- error.message = "Missing required field";
716
- error.details = invalidInput;
717
- return Promise.reject(new FDKClientValidationError(error));
718
- }
719
-
720
716
  const query_params = {};
721
717
  query_params["page_no"] = pageNo;
722
718
  query_params["page_size"] = pageSize;
@@ -756,18 +752,12 @@ class Content {
756
752
  { slug, rootId, requestHeaders } = { requestHeaders: {} },
757
753
  { responseHeaders } = { responseHeaders: false }
758
754
  ) {
759
- let invalidInput = [];
760
-
761
- if (!slug) {
762
- invalidInput.push({
763
- message: `The 'slug' field is required.`,
764
- path: ["slug"],
755
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
756
+ if (errors.length > 0) {
757
+ const error = new FDKClientValidationError({
758
+ message: "Missing required field",
759
+ details: errors,
765
760
  });
766
- }
767
- if (invalidInput.length) {
768
- const error = new Error();
769
- error.message = "Missing required field";
770
- error.details = invalidInput;
771
761
  return Promise.reject(new FDKClientValidationError(error));
772
762
  }
773
763
 
@@ -809,14 +799,6 @@ class Content {
809
799
  { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
810
800
  { responseHeaders } = { responseHeaders: false }
811
801
  ) {
812
- let invalidInput = [];
813
- if (invalidInput.length) {
814
- const error = new Error();
815
- error.message = "Missing required field";
816
- error.details = invalidInput;
817
- return Promise.reject(new FDKClientValidationError(error));
818
- }
819
-
820
802
  const query_params = {};
821
803
  query_params["page_no"] = pageNo;
822
804
  query_params["page_size"] = pageSize;
@@ -856,14 +838,6 @@ class Content {
856
838
  { requestHeaders } = { requestHeaders: {} },
857
839
  { responseHeaders } = { responseHeaders: false }
858
840
  ) {
859
- let invalidInput = [];
860
- if (invalidInput.length) {
861
- const error = new Error();
862
- error.message = "Missing required field";
863
- error.details = invalidInput;
864
- return Promise.reject(new FDKClientValidationError(error));
865
- }
866
-
867
841
  const query_params = {};
868
842
 
869
843
  const xHeaders = {};
@@ -901,14 +875,6 @@ class Content {
901
875
  { pageType, active, requestHeaders } = { requestHeaders: {} },
902
876
  { responseHeaders } = { responseHeaders: false }
903
877
  ) {
904
- let invalidInput = [];
905
- if (invalidInput.length) {
906
- const error = new Error();
907
- error.message = "Missing required field";
908
- error.details = invalidInput;
909
- return Promise.reject(new FDKClientValidationError(error));
910
- }
911
-
912
878
  const query_params = {};
913
879
  query_params["page_type"] = pageType;
914
880
  query_params["active"] = active;
@@ -948,14 +914,43 @@ class Content {
948
914
  { requestHeaders } = { requestHeaders: {} },
949
915
  { responseHeaders } = { responseHeaders: false }
950
916
  ) {
951
- let invalidInput = [];
952
- if (invalidInput.length) {
953
- const error = new Error();
954
- error.message = "Missing required field";
955
- error.details = invalidInput;
956
- return Promise.reject(new FDKClientValidationError(error));
917
+ const query_params = {};
918
+
919
+ const xHeaders = {};
920
+
921
+ const response = await ApplicationAPIClient.execute(
922
+ this._conf,
923
+ "get",
924
+ constructUrl({
925
+ url: this._urls["getSupportInformation"],
926
+ params: {},
927
+ }),
928
+ query_params,
929
+ undefined,
930
+ { ...xHeaders, ...requestHeaders },
931
+ { responseHeaders }
932
+ );
933
+
934
+ let responseData = response;
935
+ if (responseHeaders) {
936
+ responseData = response[0];
957
937
  }
958
938
 
939
+ return response;
940
+ }
941
+
942
+ /**
943
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
944
+ * @param {import("../ApplicationAPIClient").Options} - Options
945
+ * @returns {Promise<Object>} - Success response
946
+ * @name getSupportedLanguages
947
+ * @summary: List App Languages
948
+ * @description: Retrieve available languages and their configurations for the specified application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSupportedLanguages/).
949
+ */
950
+ async getSupportedLanguages(
951
+ { requestHeaders } = { requestHeaders: {} },
952
+ { responseHeaders } = { responseHeaders: false }
953
+ ) {
959
954
  const query_params = {};
960
955
 
961
956
  const xHeaders = {};
@@ -964,7 +959,7 @@ class Content {
964
959
  this._conf,
965
960
  "get",
966
961
  constructUrl({
967
- url: this._urls["getSupportInformation"],
962
+ url: this._urls["getSupportedLanguages"],
968
963
  params: {},
969
964
  }),
970
965
  query_params,
@@ -993,15 +988,51 @@ class Content {
993
988
  { requestHeaders } = { requestHeaders: {} },
994
989
  { responseHeaders } = { responseHeaders: false }
995
990
  ) {
996
- let invalidInput = [];
997
- if (invalidInput.length) {
998
- const error = new Error();
999
- error.message = "Missing required field";
1000
- error.details = invalidInput;
1001
- return Promise.reject(new FDKClientValidationError(error));
991
+ const query_params = {};
992
+
993
+ const xHeaders = {};
994
+
995
+ const response = await ApplicationAPIClient.execute(
996
+ this._conf,
997
+ "get",
998
+ constructUrl({
999
+ url: this._urls["getTags"],
1000
+ params: {},
1001
+ }),
1002
+ query_params,
1003
+ undefined,
1004
+ { ...xHeaders, ...requestHeaders },
1005
+ { responseHeaders }
1006
+ );
1007
+
1008
+ let responseData = response;
1009
+ if (responseHeaders) {
1010
+ responseData = response[0];
1002
1011
  }
1003
1012
 
1013
+ return response;
1014
+ }
1015
+
1016
+ /**
1017
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1018
+ * @param {import("../ApplicationAPIClient").Options} - Options
1019
+ * @returns {Promise<TranslateUiLabelsPage>} - Success response
1020
+ * @name getTranslateUILabels
1021
+ * @summary: Get Translate Ui Labels
1022
+ * @description: Retrieve Translate Ui Labels with filtering options for type, template, and locale settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getTranslateUILabels/).
1023
+ */
1024
+ async getTranslateUILabels(
1025
+ { template, templateThemeId, themeId, locale, type, requestHeaders } = {
1026
+ requestHeaders: {},
1027
+ },
1028
+ { responseHeaders } = { responseHeaders: false }
1029
+ ) {
1004
1030
  const query_params = {};
1031
+ query_params["template"] = template;
1032
+ query_params["template_theme_id"] = templateThemeId;
1033
+ query_params["theme_id"] = themeId;
1034
+ query_params["locale"] = locale;
1035
+ query_params["type"] = type;
1005
1036
 
1006
1037
  const xHeaders = {};
1007
1038
 
@@ -1009,7 +1040,7 @@ class Content {
1009
1040
  this._conf,
1010
1041
  "get",
1011
1042
  constructUrl({
1012
- url: this._urls["getTags"],
1043
+ url: this._urls["getTranslateUILabels"],
1013
1044
  params: {},
1014
1045
  }),
1015
1046
  query_params,
@@ -17,7 +17,7 @@ declare class FileStorage {
17
17
  * @summary: Finalizes upload process.
18
18
  * @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
19
19
  */
20
- completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<FileUploadComplete>;
20
+ completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<FileUploadComplete>;
21
21
  /**
22
22
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
23
23
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -35,7 +35,7 @@ declare class FileStorage {
35
35
  * @summary: Initiates file upload
36
36
  * @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
37
37
  */
38
- startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<FileUpload>;
38
+ startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<FileUpload>;
39
39
  /**
40
40
  * @param data
41
41
  * @param {string} file_name
@@ -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
  const { fdkAxios } = require("../../common/AxiosHelper.js");
11
12
 
@@ -47,18 +48,12 @@ class FileStorage {
47
48
  { namespace, body, requestHeaders } = { requestHeaders: {} },
48
49
  { responseHeaders } = { responseHeaders: false }
49
50
  ) {
50
- let invalidInput = [];
51
-
52
- if (!namespace) {
53
- invalidInput.push({
54
- message: `The 'namespace' field is required.`,
55
- path: ["namespace"],
51
+ const errors = validateRequiredParams(arguments[0], ["namespace"]);
52
+ if (errors.length > 0) {
53
+ const error = new FDKClientValidationError({
54
+ message: "Missing required field",
55
+ details: errors,
56
56
  });
57
- }
58
- if (invalidInput.length) {
59
- const error = new Error();
60
- error.message = "Missing required field";
61
- error.details = invalidInput;
62
57
  return Promise.reject(new FDKClientValidationError(error));
63
58
  }
64
59
 
@@ -99,14 +94,6 @@ class FileStorage {
99
94
  { body, requestHeaders } = { requestHeaders: {} },
100
95
  { responseHeaders } = { responseHeaders: false }
101
96
  ) {
102
- let invalidInput = [];
103
- if (invalidInput.length) {
104
- const error = new Error();
105
- error.message = "Missing required field";
106
- error.details = invalidInput;
107
- return Promise.reject(new FDKClientValidationError(error));
108
- }
109
-
110
97
  const query_params = {};
111
98
 
112
99
  const xHeaders = {};
@@ -144,18 +131,12 @@ class FileStorage {
144
131
  { namespace, body, requestHeaders } = { requestHeaders: {} },
145
132
  { responseHeaders } = { responseHeaders: false }
146
133
  ) {
147
- let invalidInput = [];
148
-
149
- if (!namespace) {
150
- invalidInput.push({
151
- message: `The 'namespace' field is required.`,
152
- path: ["namespace"],
134
+ const errors = validateRequiredParams(arguments[0], ["namespace"]);
135
+ if (errors.length > 0) {
136
+ const error = new FDKClientValidationError({
137
+ message: "Missing required field",
138
+ details: errors,
153
139
  });
154
- }
155
- if (invalidInput.length) {
156
- const error = new Error();
157
- error.message = "Missing required field";
158
- error.details = invalidInput;
159
140
  return Promise.reject(new FDKClientValidationError(error));
160
141
  }
161
142