@gofynd/fdk-client-javascript 1.0.0 → 1.0.2

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 (156) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +393 -393
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +268 -268
  5. package/documentation/application/PAYMENT.md +249 -249
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3497 -3097
  9. package/documentation/platform/COMPANYPROFILE.md +207 -207
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1518 -1324
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +96 -96
  14. package/index.js +7 -1
  15. package/package.json +1 -1
  16. package/sdk/application/ApplicationConfig.js +1 -1
  17. package/sdk/application/Cart/CartApplicationClient.js +865 -52
  18. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  19. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  20. package/sdk/application/Cart/CartApplicationValidator.js +1 -0
  21. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  22. package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
  23. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
  24. package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
  25. package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
  26. package/sdk/application/Common/CommonApplicationClient.js +66 -4
  27. package/sdk/application/Common/CommonApplicationValidator.js +1 -0
  28. package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
  29. package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
  30. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  31. package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  33. package/sdk/application/Content/ContentApplicationClient.js +621 -38
  34. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  35. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  36. package/sdk/application/Content/ContentApplicationValidator.js +1 -0
  37. package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
  38. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
  39. package/sdk/application/Lead/LeadApplicationClient.js +229 -14
  40. package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
  41. package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
  42. package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  44. package/sdk/application/Order/OrderApplicationClient.js +403 -24
  45. package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
  46. package/sdk/application/Order/OrderApplicationModel.js +334 -334
  47. package/sdk/application/Order/OrderApplicationValidator.js +1 -0
  48. package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
  49. package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
  50. package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
  51. package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
  52. package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
  53. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  54. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  55. package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
  56. package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
  57. package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
  58. package/sdk/application/Share/ShareApplicationClient.js +226 -14
  59. package/sdk/application/Share/ShareApplicationValidator.js +1 -0
  60. package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
  61. package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
  62. package/sdk/application/User/UserApplicationClient.js +1133 -70
  63. package/sdk/application/User/UserApplicationValidator.js +1 -0
  64. package/sdk/common/AxiosHelper.js +1 -1
  65. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  66. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
  67. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  68. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
  69. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  70. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
  71. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  72. package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
  73. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  74. package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
  75. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  76. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  77. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
  78. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
  79. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
  80. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
  81. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
  82. package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
  83. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
  84. package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
  85. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
  86. package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
  87. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  88. package/sdk/platform/Common/CommonPlatformClient.js +73 -4
  89. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  90. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
  91. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  92. package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
  93. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  94. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
  95. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
  96. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
  97. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  98. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
  99. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  100. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
  101. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  102. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
  103. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  104. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  105. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  106. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  107. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  108. package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
  109. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  110. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
  111. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  112. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
  113. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  114. package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
  115. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  116. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
  117. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  118. package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
  119. package/sdk/platform/OAuthClient.js +8 -8
  120. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  121. package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
  122. package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
  123. package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
  124. package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
  125. package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
  126. package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
  127. package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
  128. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  129. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
  130. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  131. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  132. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  133. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
  134. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  135. package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
  136. package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
  137. package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
  138. package/sdk/platform/PlatformApplicationClient.js +3461 -3263
  139. package/sdk/platform/PlatformClient.d.ts +2973 -2827
  140. package/sdk/platform/PlatformClient.js +3461 -3263
  141. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  142. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
  143. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  144. package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
  145. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  146. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
  147. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  148. package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
  149. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  150. package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
  151. package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
  152. package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
  153. package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
  154. package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
  155. package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
  156. package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
3
3
  const Paginator = require("../../common/Paginator");
4
4
  const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const ContentValidator = require("./ContentApplicationValidator");
6
+ const ContentModel = require("./ContentApplicationModel");
7
+ const { Logger } = require("./../../common/Logger");
6
8
 
7
9
  class Content {
8
10
  constructor(_conf) {
@@ -52,7 +54,7 @@ class Content {
52
54
  * @summary: Get live announcements
53
55
  * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages.
54
56
  */
55
- getAnnouncements({} = {}) {
57
+ async getAnnouncements({} = {}) {
56
58
  const { error } = ContentValidator.getAnnouncements().validate(
57
59
  {},
58
60
  { abortEarly: false, allowUnknown: true }
@@ -60,11 +62,25 @@ class Content {
60
62
  if (error) {
61
63
  return Promise.reject(new FDKClientValidationError(error));
62
64
  }
65
+
66
+ // Showing warrnings if extra unknown parameters are found
67
+ const { error: warrning } = ContentValidator.getAnnouncements().validate(
68
+ {},
69
+ { abortEarly: false, allowUnknown: false }
70
+ );
71
+ if (warrning) {
72
+ Logger({
73
+ level: "WARN",
74
+ message: "Parameter Validation warrnings for getAnnouncements",
75
+ });
76
+ Logger({ level: "WARN", message: warrning });
77
+ }
78
+
63
79
  const query_params = {};
64
80
 
65
81
  const xHeaders = {};
66
82
 
67
- return APIClient.execute(
83
+ const response = await APIClient.execute(
68
84
  this._conf,
69
85
  "get",
70
86
  constructUrl({
@@ -75,6 +91,23 @@ class Content {
75
91
  undefined,
76
92
  xHeaders
77
93
  );
94
+
95
+ const {
96
+ error: res_error,
97
+ } = ContentModel.AnnouncementsResponseSchema().validate(response, {
98
+ abortEarly: false,
99
+ allowUnknown: false,
100
+ });
101
+
102
+ if (res_error) {
103
+ Logger({
104
+ level: "WARN",
105
+ message: "Response Validation Warnnings for getAnnouncements",
106
+ });
107
+ Logger({ level: "WARN", message: res_error });
108
+ }
109
+
110
+ return response;
78
111
  }
79
112
 
80
113
  /**
@@ -87,7 +120,7 @@ class Content {
87
120
  * @summary: Get a blog
88
121
  * @description: Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc.
89
122
  */
90
- getBlog({ slug, rootId } = {}) {
123
+ async getBlog({ slug, rootId } = {}) {
91
124
  const { error } = ContentValidator.getBlog().validate(
92
125
  { slug, rootId },
93
126
  { abortEarly: false, allowUnknown: true }
@@ -95,12 +128,26 @@ class Content {
95
128
  if (error) {
96
129
  return Promise.reject(new FDKClientValidationError(error));
97
130
  }
131
+
132
+ // Showing warrnings if extra unknown parameters are found
133
+ const { error: warrning } = ContentValidator.getBlog().validate(
134
+ { slug, rootId },
135
+ { abortEarly: false, allowUnknown: false }
136
+ );
137
+ if (warrning) {
138
+ Logger({
139
+ level: "WARN",
140
+ message: "Parameter Validation warrnings for getBlog",
141
+ });
142
+ Logger({ level: "WARN", message: warrning });
143
+ }
144
+
98
145
  const query_params = {};
99
146
  query_params["root_id"] = rootId;
100
147
 
101
148
  const xHeaders = {};
102
149
 
103
- return APIClient.execute(
150
+ const response = await APIClient.execute(
104
151
  this._conf,
105
152
  "get",
106
153
  constructUrl({
@@ -111,6 +158,21 @@ class Content {
111
158
  undefined,
112
159
  xHeaders
113
160
  );
161
+
162
+ const { error: res_error } = ContentModel.BlogSchema().validate(response, {
163
+ abortEarly: false,
164
+ allowUnknown: false,
165
+ });
166
+
167
+ if (res_error) {
168
+ Logger({
169
+ level: "WARN",
170
+ message: "Response Validation Warnnings for getBlog",
171
+ });
172
+ Logger({ level: "WARN", message: res_error });
173
+ }
174
+
175
+ return response;
114
176
  }
115
177
 
116
178
  /**
@@ -122,7 +184,7 @@ class Content {
122
184
  * @summary: Get a list of blogs
123
185
  * @description: Use this API to get all the blogs.
124
186
  */
125
- getBlogs({ pageNo, pageSize } = {}) {
187
+ async getBlogs({ pageNo, pageSize } = {}) {
126
188
  const { error } = ContentValidator.getBlogs().validate(
127
189
  { pageNo, pageSize },
128
190
  { abortEarly: false, allowUnknown: true }
@@ -130,13 +192,27 @@ class Content {
130
192
  if (error) {
131
193
  return Promise.reject(new FDKClientValidationError(error));
132
194
  }
195
+
196
+ // Showing warrnings if extra unknown parameters are found
197
+ const { error: warrning } = ContentValidator.getBlogs().validate(
198
+ { pageNo, pageSize },
199
+ { abortEarly: false, allowUnknown: false }
200
+ );
201
+ if (warrning) {
202
+ Logger({
203
+ level: "WARN",
204
+ message: "Parameter Validation warrnings for getBlogs",
205
+ });
206
+ Logger({ level: "WARN", message: warrning });
207
+ }
208
+
133
209
  const query_params = {};
134
210
  query_params["page_no"] = pageNo;
135
211
  query_params["page_size"] = pageSize;
136
212
 
137
213
  const xHeaders = {};
138
214
 
139
- return APIClient.execute(
215
+ const response = await APIClient.execute(
140
216
  this._conf,
141
217
  "get",
142
218
  constructUrl({
@@ -147,6 +223,23 @@ class Content {
147
223
  undefined,
148
224
  xHeaders
149
225
  );
226
+
227
+ const {
228
+ error: res_error,
229
+ } = ContentModel.BlogGetResponse().validate(response, {
230
+ abortEarly: false,
231
+ allowUnknown: false,
232
+ });
233
+
234
+ if (res_error) {
235
+ Logger({
236
+ level: "WARN",
237
+ message: "Response Validation Warnnings for getBlogs",
238
+ });
239
+ Logger({ level: "WARN", message: res_error });
240
+ }
241
+
242
+ return response;
150
243
  }
151
244
 
152
245
  /**
@@ -181,7 +274,7 @@ class Content {
181
274
  * @summary: Get the data loaders associated with an application
182
275
  * @description: Use this API to get all selected data loaders of the application in the form of tags.
183
276
  */
184
- getDataLoaders({} = {}) {
277
+ async getDataLoaders({} = {}) {
185
278
  const { error } = ContentValidator.getDataLoaders().validate(
186
279
  {},
187
280
  { abortEarly: false, allowUnknown: true }
@@ -189,11 +282,25 @@ class Content {
189
282
  if (error) {
190
283
  return Promise.reject(new FDKClientValidationError(error));
191
284
  }
285
+
286
+ // Showing warrnings if extra unknown parameters are found
287
+ const { error: warrning } = ContentValidator.getDataLoaders().validate(
288
+ {},
289
+ { abortEarly: false, allowUnknown: false }
290
+ );
291
+ if (warrning) {
292
+ Logger({
293
+ level: "WARN",
294
+ message: "Parameter Validation warrnings for getDataLoaders",
295
+ });
296
+ Logger({ level: "WARN", message: warrning });
297
+ }
298
+
192
299
  const query_params = {};
193
300
 
194
301
  const xHeaders = {};
195
302
 
196
- return APIClient.execute(
303
+ const response = await APIClient.execute(
197
304
  this._conf,
198
305
  "get",
199
306
  constructUrl({
@@ -204,6 +311,23 @@ class Content {
204
311
  undefined,
205
312
  xHeaders
206
313
  );
314
+
315
+ const {
316
+ error: res_error,
317
+ } = ContentModel.DataLoadersSchema().validate(response, {
318
+ abortEarly: false,
319
+ allowUnknown: false,
320
+ });
321
+
322
+ if (res_error) {
323
+ Logger({
324
+ level: "WARN",
325
+ message: "Response Validation Warnnings for getDataLoaders",
326
+ });
327
+ Logger({ level: "WARN", message: res_error });
328
+ }
329
+
330
+ return response;
207
331
  }
208
332
 
209
333
  /**
@@ -212,7 +336,7 @@ class Content {
212
336
  * @summary: Get a list of FAQs
213
337
  * @description: Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website.
214
338
  */
215
- getFaqs({} = {}) {
339
+ async getFaqs({} = {}) {
216
340
  const { error } = ContentValidator.getFaqs().validate(
217
341
  {},
218
342
  { abortEarly: false, allowUnknown: true }
@@ -220,11 +344,25 @@ class Content {
220
344
  if (error) {
221
345
  return Promise.reject(new FDKClientValidationError(error));
222
346
  }
347
+
348
+ // Showing warrnings if extra unknown parameters are found
349
+ const { error: warrning } = ContentValidator.getFaqs().validate(
350
+ {},
351
+ { abortEarly: false, allowUnknown: false }
352
+ );
353
+ if (warrning) {
354
+ Logger({
355
+ level: "WARN",
356
+ message: "Parameter Validation warrnings for getFaqs",
357
+ });
358
+ Logger({ level: "WARN", message: warrning });
359
+ }
360
+
223
361
  const query_params = {};
224
362
 
225
363
  const xHeaders = {};
226
364
 
227
- return APIClient.execute(
365
+ const response = await APIClient.execute(
228
366
  this._conf,
229
367
  "get",
230
368
  constructUrl({
@@ -235,6 +373,23 @@ class Content {
235
373
  undefined,
236
374
  xHeaders
237
375
  );
376
+
377
+ const {
378
+ error: res_error,
379
+ } = ContentModel.FaqResponseSchema().validate(response, {
380
+ abortEarly: false,
381
+ allowUnknown: false,
382
+ });
383
+
384
+ if (res_error) {
385
+ Logger({
386
+ level: "WARN",
387
+ message: "Response Validation Warnnings for getFaqs",
388
+ });
389
+ Logger({ level: "WARN", message: res_error });
390
+ }
391
+
392
+ return response;
238
393
  }
239
394
 
240
395
  /**
@@ -243,7 +398,7 @@ class Content {
243
398
  * @summary: Get a list of FAQ categories
244
399
  * @description: FAQs can be divided into categories. Use this API to get a list of FAQ categories.
245
400
  */
246
- getFaqCategories({} = {}) {
401
+ async getFaqCategories({} = {}) {
247
402
  const { error } = ContentValidator.getFaqCategories().validate(
248
403
  {},
249
404
  { abortEarly: false, allowUnknown: true }
@@ -251,11 +406,25 @@ class Content {
251
406
  if (error) {
252
407
  return Promise.reject(new FDKClientValidationError(error));
253
408
  }
409
+
410
+ // Showing warrnings if extra unknown parameters are found
411
+ const { error: warrning } = ContentValidator.getFaqCategories().validate(
412
+ {},
413
+ { abortEarly: false, allowUnknown: false }
414
+ );
415
+ if (warrning) {
416
+ Logger({
417
+ level: "WARN",
418
+ message: "Parameter Validation warrnings for getFaqCategories",
419
+ });
420
+ Logger({ level: "WARN", message: warrning });
421
+ }
422
+
254
423
  const query_params = {};
255
424
 
256
425
  const xHeaders = {};
257
426
 
258
- return APIClient.execute(
427
+ const response = await APIClient.execute(
259
428
  this._conf,
260
429
  "get",
261
430
  constructUrl({
@@ -266,6 +435,23 @@ class Content {
266
435
  undefined,
267
436
  xHeaders
268
437
  );
438
+
439
+ const {
440
+ error: res_error,
441
+ } = ContentModel.GetFaqCategoriesSchema().validate(response, {
442
+ abortEarly: false,
443
+ allowUnknown: false,
444
+ });
445
+
446
+ if (res_error) {
447
+ Logger({
448
+ level: "WARN",
449
+ message: "Response Validation Warnnings for getFaqCategories",
450
+ });
451
+ Logger({ level: "WARN", message: res_error });
452
+ }
453
+
454
+ return response;
269
455
  }
270
456
 
271
457
  /**
@@ -277,7 +463,7 @@ class Content {
277
463
  * @summary: Get an FAQ
278
464
  * @description: Use this API to get a particular FAQ by its slug.
279
465
  */
280
- getFaqBySlug({ slug } = {}) {
466
+ async getFaqBySlug({ slug } = {}) {
281
467
  const { error } = ContentValidator.getFaqBySlug().validate(
282
468
  { slug },
283
469
  { abortEarly: false, allowUnknown: true }
@@ -285,11 +471,25 @@ class Content {
285
471
  if (error) {
286
472
  return Promise.reject(new FDKClientValidationError(error));
287
473
  }
474
+
475
+ // Showing warrnings if extra unknown parameters are found
476
+ const { error: warrning } = ContentValidator.getFaqBySlug().validate(
477
+ { slug },
478
+ { abortEarly: false, allowUnknown: false }
479
+ );
480
+ if (warrning) {
481
+ Logger({
482
+ level: "WARN",
483
+ message: "Parameter Validation warrnings for getFaqBySlug",
484
+ });
485
+ Logger({ level: "WARN", message: warrning });
486
+ }
487
+
288
488
  const query_params = {};
289
489
 
290
490
  const xHeaders = {};
291
491
 
292
- return APIClient.execute(
492
+ const response = await APIClient.execute(
293
493
  this._conf,
294
494
  "get",
295
495
  constructUrl({
@@ -300,6 +500,21 @@ class Content {
300
500
  undefined,
301
501
  xHeaders
302
502
  );
503
+
504
+ const { error: res_error } = ContentModel.FaqSchema().validate(response, {
505
+ abortEarly: false,
506
+ allowUnknown: false,
507
+ });
508
+
509
+ if (res_error) {
510
+ Logger({
511
+ level: "WARN",
512
+ message: "Response Validation Warnnings for getFaqBySlug",
513
+ });
514
+ Logger({ level: "WARN", message: res_error });
515
+ }
516
+
517
+ return response;
303
518
  }
304
519
 
305
520
  /**
@@ -311,7 +526,7 @@ class Content {
311
526
  * @summary: Get the FAQ category
312
527
  * @description: FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs.
313
528
  */
314
- getFaqCategoryBySlug({ slug } = {}) {
529
+ async getFaqCategoryBySlug({ slug } = {}) {
315
530
  const { error } = ContentValidator.getFaqCategoryBySlug().validate(
316
531
  { slug },
317
532
  { abortEarly: false, allowUnknown: true }
@@ -319,11 +534,27 @@ class Content {
319
534
  if (error) {
320
535
  return Promise.reject(new FDKClientValidationError(error));
321
536
  }
537
+
538
+ // Showing warrnings if extra unknown parameters are found
539
+ const {
540
+ error: warrning,
541
+ } = ContentValidator.getFaqCategoryBySlug().validate(
542
+ { slug },
543
+ { abortEarly: false, allowUnknown: false }
544
+ );
545
+ if (warrning) {
546
+ Logger({
547
+ level: "WARN",
548
+ message: "Parameter Validation warrnings for getFaqCategoryBySlug",
549
+ });
550
+ Logger({ level: "WARN", message: warrning });
551
+ }
552
+
322
553
  const query_params = {};
323
554
 
324
555
  const xHeaders = {};
325
556
 
326
- return APIClient.execute(
557
+ const response = await APIClient.execute(
327
558
  this._conf,
328
559
  "get",
329
560
  constructUrl({
@@ -334,6 +565,23 @@ class Content {
334
565
  undefined,
335
566
  xHeaders
336
567
  );
568
+
569
+ const {
570
+ error: res_error,
571
+ } = ContentModel.GetFaqCategoryBySlugSchema().validate(response, {
572
+ abortEarly: false,
573
+ allowUnknown: false,
574
+ });
575
+
576
+ if (res_error) {
577
+ Logger({
578
+ level: "WARN",
579
+ message: "Response Validation Warnnings for getFaqCategoryBySlug",
580
+ });
581
+ Logger({ level: "WARN", message: res_error });
582
+ }
583
+
584
+ return response;
337
585
  }
338
586
 
339
587
  /**
@@ -345,7 +593,7 @@ class Content {
345
593
  * @summary: Get FAQs using the slug of FAQ category
346
594
  * @description: FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug.
347
595
  */
348
- getFaqsByCategorySlug({ slug } = {}) {
596
+ async getFaqsByCategorySlug({ slug } = {}) {
349
597
  const { error } = ContentValidator.getFaqsByCategorySlug().validate(
350
598
  { slug },
351
599
  { abortEarly: false, allowUnknown: true }
@@ -353,11 +601,27 @@ class Content {
353
601
  if (error) {
354
602
  return Promise.reject(new FDKClientValidationError(error));
355
603
  }
604
+
605
+ // Showing warrnings if extra unknown parameters are found
606
+ const {
607
+ error: warrning,
608
+ } = ContentValidator.getFaqsByCategorySlug().validate(
609
+ { slug },
610
+ { abortEarly: false, allowUnknown: false }
611
+ );
612
+ if (warrning) {
613
+ Logger({
614
+ level: "WARN",
615
+ message: "Parameter Validation warrnings for getFaqsByCategorySlug",
616
+ });
617
+ Logger({ level: "WARN", message: warrning });
618
+ }
619
+
356
620
  const query_params = {};
357
621
 
358
622
  const xHeaders = {};
359
623
 
360
- return APIClient.execute(
624
+ const response = await APIClient.execute(
361
625
  this._conf,
362
626
  "get",
363
627
  constructUrl({
@@ -368,6 +632,21 @@ class Content {
368
632
  undefined,
369
633
  xHeaders
370
634
  );
635
+
636
+ const { error: res_error } = ContentModel.GetFaqSchema().validate(
637
+ response,
638
+ { abortEarly: false, allowUnknown: false }
639
+ );
640
+
641
+ if (res_error) {
642
+ Logger({
643
+ level: "WARN",
644
+ message: "Response Validation Warnnings for getFaqsByCategorySlug",
645
+ });
646
+ Logger({ level: "WARN", message: res_error });
647
+ }
648
+
649
+ return response;
371
650
  }
372
651
 
373
652
  /**
@@ -376,7 +655,7 @@ class Content {
376
655
  * @summary: Get the landing page
377
656
  * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page.
378
657
  */
379
- getLandingPage({} = {}) {
658
+ async getLandingPage({} = {}) {
380
659
  const { error } = ContentValidator.getLandingPage().validate(
381
660
  {},
382
661
  { abortEarly: false, allowUnknown: true }
@@ -384,11 +663,25 @@ class Content {
384
663
  if (error) {
385
664
  return Promise.reject(new FDKClientValidationError(error));
386
665
  }
666
+
667
+ // Showing warrnings if extra unknown parameters are found
668
+ const { error: warrning } = ContentValidator.getLandingPage().validate(
669
+ {},
670
+ { abortEarly: false, allowUnknown: false }
671
+ );
672
+ if (warrning) {
673
+ Logger({
674
+ level: "WARN",
675
+ message: "Parameter Validation warrnings for getLandingPage",
676
+ });
677
+ Logger({ level: "WARN", message: warrning });
678
+ }
679
+
387
680
  const query_params = {};
388
681
 
389
682
  const xHeaders = {};
390
683
 
391
- return APIClient.execute(
684
+ const response = await APIClient.execute(
392
685
  this._conf,
393
686
  "get",
394
687
  constructUrl({
@@ -399,6 +692,23 @@ class Content {
399
692
  undefined,
400
693
  xHeaders
401
694
  );
695
+
696
+ const {
697
+ error: res_error,
698
+ } = ContentModel.LandingPageSchema().validate(response, {
699
+ abortEarly: false,
700
+ allowUnknown: false,
701
+ });
702
+
703
+ if (res_error) {
704
+ Logger({
705
+ level: "WARN",
706
+ message: "Response Validation Warnnings for getLandingPage",
707
+ });
708
+ Logger({ level: "WARN", message: res_error });
709
+ }
710
+
711
+ return response;
402
712
  }
403
713
 
404
714
  /**
@@ -407,7 +717,7 @@ class Content {
407
717
  * @summary: Get legal information
408
718
  * @description: Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application.
409
719
  */
410
- getLegalInformation({} = {}) {
720
+ async getLegalInformation({} = {}) {
411
721
  const { error } = ContentValidator.getLegalInformation().validate(
412
722
  {},
413
723
  { abortEarly: false, allowUnknown: true }
@@ -415,11 +725,25 @@ class Content {
415
725
  if (error) {
416
726
  return Promise.reject(new FDKClientValidationError(error));
417
727
  }
728
+
729
+ // Showing warrnings if extra unknown parameters are found
730
+ const { error: warrning } = ContentValidator.getLegalInformation().validate(
731
+ {},
732
+ { abortEarly: false, allowUnknown: false }
733
+ );
734
+ if (warrning) {
735
+ Logger({
736
+ level: "WARN",
737
+ message: "Parameter Validation warrnings for getLegalInformation",
738
+ });
739
+ Logger({ level: "WARN", message: warrning });
740
+ }
741
+
418
742
  const query_params = {};
419
743
 
420
744
  const xHeaders = {};
421
745
 
422
- return APIClient.execute(
746
+ const response = await APIClient.execute(
423
747
  this._conf,
424
748
  "get",
425
749
  constructUrl({
@@ -430,6 +754,23 @@ class Content {
430
754
  undefined,
431
755
  xHeaders
432
756
  );
757
+
758
+ const {
759
+ error: res_error,
760
+ } = ContentModel.ApplicationLegal().validate(response, {
761
+ abortEarly: false,
762
+ allowUnknown: false,
763
+ });
764
+
765
+ if (res_error) {
766
+ Logger({
767
+ level: "WARN",
768
+ message: "Response Validation Warnnings for getLegalInformation",
769
+ });
770
+ Logger({ level: "WARN", message: res_error });
771
+ }
772
+
773
+ return response;
433
774
  }
434
775
 
435
776
  /**
@@ -441,7 +782,7 @@ class Content {
441
782
  * @summary: Get the navigation
442
783
  * @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations.
443
784
  */
444
- getNavigations({ pageNo, pageSize } = {}) {
785
+ async getNavigations({ pageNo, pageSize } = {}) {
445
786
  const { error } = ContentValidator.getNavigations().validate(
446
787
  { pageNo, pageSize },
447
788
  { abortEarly: false, allowUnknown: true }
@@ -449,13 +790,27 @@ class Content {
449
790
  if (error) {
450
791
  return Promise.reject(new FDKClientValidationError(error));
451
792
  }
793
+
794
+ // Showing warrnings if extra unknown parameters are found
795
+ const { error: warrning } = ContentValidator.getNavigations().validate(
796
+ { pageNo, pageSize },
797
+ { abortEarly: false, allowUnknown: false }
798
+ );
799
+ if (warrning) {
800
+ Logger({
801
+ level: "WARN",
802
+ message: "Parameter Validation warrnings for getNavigations",
803
+ });
804
+ Logger({ level: "WARN", message: warrning });
805
+ }
806
+
452
807
  const query_params = {};
453
808
  query_params["page_no"] = pageNo;
454
809
  query_params["page_size"] = pageSize;
455
810
 
456
811
  const xHeaders = {};
457
812
 
458
- return APIClient.execute(
813
+ const response = await APIClient.execute(
459
814
  this._conf,
460
815
  "get",
461
816
  constructUrl({
@@ -466,6 +821,23 @@ class Content {
466
821
  undefined,
467
822
  xHeaders
468
823
  );
824
+
825
+ const {
826
+ error: res_error,
827
+ } = ContentModel.NavigationGetResponse().validate(response, {
828
+ abortEarly: false,
829
+ allowUnknown: false,
830
+ });
831
+
832
+ if (res_error) {
833
+ Logger({
834
+ level: "WARN",
835
+ message: "Response Validation Warnnings for getNavigations",
836
+ });
837
+ Logger({ level: "WARN", message: res_error });
838
+ }
839
+
840
+ return response;
469
841
  }
470
842
 
471
843
  /**
@@ -500,7 +872,7 @@ class Content {
500
872
  * @summary: Get the SEO of an application
501
873
  * @description: Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap.
502
874
  */
503
- getSEOConfiguration({} = {}) {
875
+ async getSEOConfiguration({} = {}) {
504
876
  const { error } = ContentValidator.getSEOConfiguration().validate(
505
877
  {},
506
878
  { abortEarly: false, allowUnknown: true }
@@ -508,11 +880,25 @@ class Content {
508
880
  if (error) {
509
881
  return Promise.reject(new FDKClientValidationError(error));
510
882
  }
883
+
884
+ // Showing warrnings if extra unknown parameters are found
885
+ const { error: warrning } = ContentValidator.getSEOConfiguration().validate(
886
+ {},
887
+ { abortEarly: false, allowUnknown: false }
888
+ );
889
+ if (warrning) {
890
+ Logger({
891
+ level: "WARN",
892
+ message: "Parameter Validation warrnings for getSEOConfiguration",
893
+ });
894
+ Logger({ level: "WARN", message: warrning });
895
+ }
896
+
511
897
  const query_params = {};
512
898
 
513
899
  const xHeaders = {};
514
900
 
515
- return APIClient.execute(
901
+ const response = await APIClient.execute(
516
902
  this._conf,
517
903
  "get",
518
904
  constructUrl({
@@ -523,6 +909,21 @@ class Content {
523
909
  undefined,
524
910
  xHeaders
525
911
  );
912
+
913
+ const { error: res_error } = ContentModel.SeoComponent().validate(
914
+ response,
915
+ { abortEarly: false, allowUnknown: false }
916
+ );
917
+
918
+ if (res_error) {
919
+ Logger({
920
+ level: "WARN",
921
+ message: "Response Validation Warnnings for getSEOConfiguration",
922
+ });
923
+ Logger({ level: "WARN", message: res_error });
924
+ }
925
+
926
+ return response;
526
927
  }
527
928
 
528
929
  /**
@@ -534,7 +935,7 @@ class Content {
534
935
  * @summary: Get the slideshows
535
936
  * @description: Use this API to get a list of slideshows along with their details.
536
937
  */
537
- getSlideshows({ pageNo, pageSize } = {}) {
938
+ async getSlideshows({ pageNo, pageSize } = {}) {
538
939
  const { error } = ContentValidator.getSlideshows().validate(
539
940
  { pageNo, pageSize },
540
941
  { abortEarly: false, allowUnknown: true }
@@ -542,13 +943,27 @@ class Content {
542
943
  if (error) {
543
944
  return Promise.reject(new FDKClientValidationError(error));
544
945
  }
946
+
947
+ // Showing warrnings if extra unknown parameters are found
948
+ const { error: warrning } = ContentValidator.getSlideshows().validate(
949
+ { pageNo, pageSize },
950
+ { abortEarly: false, allowUnknown: false }
951
+ );
952
+ if (warrning) {
953
+ Logger({
954
+ level: "WARN",
955
+ message: "Parameter Validation warrnings for getSlideshows",
956
+ });
957
+ Logger({ level: "WARN", message: warrning });
958
+ }
959
+
545
960
  const query_params = {};
546
961
  query_params["page_no"] = pageNo;
547
962
  query_params["page_size"] = pageSize;
548
963
 
549
964
  const xHeaders = {};
550
965
 
551
- return APIClient.execute(
966
+ const response = await APIClient.execute(
552
967
  this._conf,
553
968
  "get",
554
969
  constructUrl({
@@ -559,6 +974,23 @@ class Content {
559
974
  undefined,
560
975
  xHeaders
561
976
  );
977
+
978
+ const {
979
+ error: res_error,
980
+ } = ContentModel.SlideshowGetResponse().validate(response, {
981
+ abortEarly: false,
982
+ allowUnknown: false,
983
+ });
984
+
985
+ if (res_error) {
986
+ Logger({
987
+ level: "WARN",
988
+ message: "Response Validation Warnnings for getSlideshows",
989
+ });
990
+ Logger({ level: "WARN", message: res_error });
991
+ }
992
+
993
+ return response;
562
994
  }
563
995
 
564
996
  /**
@@ -596,7 +1028,7 @@ class Content {
596
1028
  * @summary: Get a slideshow
597
1029
  * @description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`.
598
1030
  */
599
- getSlideshow({ slug } = {}) {
1031
+ async getSlideshow({ slug } = {}) {
600
1032
  const { error } = ContentValidator.getSlideshow().validate(
601
1033
  { slug },
602
1034
  { abortEarly: false, allowUnknown: true }
@@ -604,11 +1036,25 @@ class Content {
604
1036
  if (error) {
605
1037
  return Promise.reject(new FDKClientValidationError(error));
606
1038
  }
1039
+
1040
+ // Showing warrnings if extra unknown parameters are found
1041
+ const { error: warrning } = ContentValidator.getSlideshow().validate(
1042
+ { slug },
1043
+ { abortEarly: false, allowUnknown: false }
1044
+ );
1045
+ if (warrning) {
1046
+ Logger({
1047
+ level: "WARN",
1048
+ message: "Parameter Validation warrnings for getSlideshow",
1049
+ });
1050
+ Logger({ level: "WARN", message: warrning });
1051
+ }
1052
+
607
1053
  const query_params = {};
608
1054
 
609
1055
  const xHeaders = {};
610
1056
 
611
- return APIClient.execute(
1057
+ const response = await APIClient.execute(
612
1058
  this._conf,
613
1059
  "get",
614
1060
  constructUrl({
@@ -619,6 +1065,23 @@ class Content {
619
1065
  undefined,
620
1066
  xHeaders
621
1067
  );
1068
+
1069
+ const {
1070
+ error: res_error,
1071
+ } = ContentModel.SlideshowSchema().validate(response, {
1072
+ abortEarly: false,
1073
+ allowUnknown: false,
1074
+ });
1075
+
1076
+ if (res_error) {
1077
+ Logger({
1078
+ level: "WARN",
1079
+ message: "Response Validation Warnnings for getSlideshow",
1080
+ });
1081
+ Logger({ level: "WARN", message: res_error });
1082
+ }
1083
+
1084
+ return response;
622
1085
  }
623
1086
 
624
1087
  /**
@@ -627,7 +1090,7 @@ class Content {
627
1090
  * @summary: Get the support information
628
1091
  * @description: Use this API to get contact details for customer support including emails and phone numbers.
629
1092
  */
630
- getSupportInformation({} = {}) {
1093
+ async getSupportInformation({} = {}) {
631
1094
  const { error } = ContentValidator.getSupportInformation().validate(
632
1095
  {},
633
1096
  { abortEarly: false, allowUnknown: true }
@@ -635,11 +1098,27 @@ class Content {
635
1098
  if (error) {
636
1099
  return Promise.reject(new FDKClientValidationError(error));
637
1100
  }
1101
+
1102
+ // Showing warrnings if extra unknown parameters are found
1103
+ const {
1104
+ error: warrning,
1105
+ } = ContentValidator.getSupportInformation().validate(
1106
+ {},
1107
+ { abortEarly: false, allowUnknown: false }
1108
+ );
1109
+ if (warrning) {
1110
+ Logger({
1111
+ level: "WARN",
1112
+ message: "Parameter Validation warrnings for getSupportInformation",
1113
+ });
1114
+ Logger({ level: "WARN", message: warrning });
1115
+ }
1116
+
638
1117
  const query_params = {};
639
1118
 
640
1119
  const xHeaders = {};
641
1120
 
642
- return APIClient.execute(
1121
+ const response = await APIClient.execute(
643
1122
  this._conf,
644
1123
  "get",
645
1124
  constructUrl({
@@ -650,6 +1129,21 @@ class Content {
650
1129
  undefined,
651
1130
  xHeaders
652
1131
  );
1132
+
1133
+ const { error: res_error } = ContentModel.Support().validate(response, {
1134
+ abortEarly: false,
1135
+ allowUnknown: false,
1136
+ });
1137
+
1138
+ if (res_error) {
1139
+ Logger({
1140
+ level: "WARN",
1141
+ message: "Response Validation Warnnings for getSupportInformation",
1142
+ });
1143
+ Logger({ level: "WARN", message: res_error });
1144
+ }
1145
+
1146
+ return response;
653
1147
  }
654
1148
 
655
1149
  /**
@@ -658,7 +1152,7 @@ class Content {
658
1152
  * @summary: Get the tags associated with an application
659
1153
  * @description: Use this API to get all the CSS and JS injected in the application in the form of tags.
660
1154
  */
661
- getTags({} = {}) {
1155
+ async getTags({} = {}) {
662
1156
  const { error } = ContentValidator.getTags().validate(
663
1157
  {},
664
1158
  { abortEarly: false, allowUnknown: true }
@@ -666,11 +1160,25 @@ class Content {
666
1160
  if (error) {
667
1161
  return Promise.reject(new FDKClientValidationError(error));
668
1162
  }
1163
+
1164
+ // Showing warrnings if extra unknown parameters are found
1165
+ const { error: warrning } = ContentValidator.getTags().validate(
1166
+ {},
1167
+ { abortEarly: false, allowUnknown: false }
1168
+ );
1169
+ if (warrning) {
1170
+ Logger({
1171
+ level: "WARN",
1172
+ message: "Parameter Validation warrnings for getTags",
1173
+ });
1174
+ Logger({ level: "WARN", message: warrning });
1175
+ }
1176
+
669
1177
  const query_params = {};
670
1178
 
671
1179
  const xHeaders = {};
672
1180
 
673
- return APIClient.execute(
1181
+ const response = await APIClient.execute(
674
1182
  this._conf,
675
1183
  "get",
676
1184
  constructUrl({
@@ -681,6 +1189,21 @@ class Content {
681
1189
  undefined,
682
1190
  xHeaders
683
1191
  );
1192
+
1193
+ const { error: res_error } = ContentModel.TagsSchema().validate(response, {
1194
+ abortEarly: false,
1195
+ allowUnknown: false,
1196
+ });
1197
+
1198
+ if (res_error) {
1199
+ Logger({
1200
+ level: "WARN",
1201
+ message: "Response Validation Warnnings for getTags",
1202
+ });
1203
+ Logger({ level: "WARN", message: res_error });
1204
+ }
1205
+
1206
+ return response;
684
1207
  }
685
1208
 
686
1209
  /**
@@ -693,7 +1216,7 @@ class Content {
693
1216
  * @summary: Get a page
694
1217
  * @description: Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc.
695
1218
  */
696
- getPage({ slug, rootId } = {}) {
1219
+ async getPage({ slug, rootId } = {}) {
697
1220
  const { error } = ContentValidator.getPage().validate(
698
1221
  { slug, rootId },
699
1222
  { abortEarly: false, allowUnknown: true }
@@ -701,12 +1224,26 @@ class Content {
701
1224
  if (error) {
702
1225
  return Promise.reject(new FDKClientValidationError(error));
703
1226
  }
1227
+
1228
+ // Showing warrnings if extra unknown parameters are found
1229
+ const { error: warrning } = ContentValidator.getPage().validate(
1230
+ { slug, rootId },
1231
+ { abortEarly: false, allowUnknown: false }
1232
+ );
1233
+ if (warrning) {
1234
+ Logger({
1235
+ level: "WARN",
1236
+ message: "Parameter Validation warrnings for getPage",
1237
+ });
1238
+ Logger({ level: "WARN", message: warrning });
1239
+ }
1240
+
704
1241
  const query_params = {};
705
1242
  query_params["root_id"] = rootId;
706
1243
 
707
1244
  const xHeaders = {};
708
1245
 
709
- return APIClient.execute(
1246
+ const response = await APIClient.execute(
710
1247
  this._conf,
711
1248
  "get",
712
1249
  constructUrl({
@@ -717,6 +1254,21 @@ class Content {
717
1254
  undefined,
718
1255
  xHeaders
719
1256
  );
1257
+
1258
+ const { error: res_error } = ContentModel.PageSchema().validate(response, {
1259
+ abortEarly: false,
1260
+ allowUnknown: false,
1261
+ });
1262
+
1263
+ if (res_error) {
1264
+ Logger({
1265
+ level: "WARN",
1266
+ message: "Response Validation Warnnings for getPage",
1267
+ });
1268
+ Logger({ level: "WARN", message: res_error });
1269
+ }
1270
+
1271
+ return response;
720
1272
  }
721
1273
 
722
1274
  /**
@@ -728,7 +1280,7 @@ class Content {
728
1280
  * @summary: Get all pages
729
1281
  * @description: Use this API to get a list of pages.
730
1282
  */
731
- getPages({ pageNo, pageSize } = {}) {
1283
+ async getPages({ pageNo, pageSize } = {}) {
732
1284
  const { error } = ContentValidator.getPages().validate(
733
1285
  { pageNo, pageSize },
734
1286
  { abortEarly: false, allowUnknown: true }
@@ -736,13 +1288,27 @@ class Content {
736
1288
  if (error) {
737
1289
  return Promise.reject(new FDKClientValidationError(error));
738
1290
  }
1291
+
1292
+ // Showing warrnings if extra unknown parameters are found
1293
+ const { error: warrning } = ContentValidator.getPages().validate(
1294
+ { pageNo, pageSize },
1295
+ { abortEarly: false, allowUnknown: false }
1296
+ );
1297
+ if (warrning) {
1298
+ Logger({
1299
+ level: "WARN",
1300
+ message: "Parameter Validation warrnings for getPages",
1301
+ });
1302
+ Logger({ level: "WARN", message: warrning });
1303
+ }
1304
+
739
1305
  const query_params = {};
740
1306
  query_params["page_no"] = pageNo;
741
1307
  query_params["page_size"] = pageSize;
742
1308
 
743
1309
  const xHeaders = {};
744
1310
 
745
- return APIClient.execute(
1311
+ const response = await APIClient.execute(
746
1312
  this._conf,
747
1313
  "get",
748
1314
  constructUrl({
@@ -753,6 +1319,23 @@ class Content {
753
1319
  undefined,
754
1320
  xHeaders
755
1321
  );
1322
+
1323
+ const {
1324
+ error: res_error,
1325
+ } = ContentModel.PageGetResponse().validate(response, {
1326
+ abortEarly: false,
1327
+ allowUnknown: false,
1328
+ });
1329
+
1330
+ if (res_error) {
1331
+ Logger({
1332
+ level: "WARN",
1333
+ message: "Response Validation Warnnings for getPages",
1334
+ });
1335
+ Logger({ level: "WARN", message: res_error });
1336
+ }
1337
+
1338
+ return response;
756
1339
  }
757
1340
 
758
1341
  /**