@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
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
2
2
  const PlatformAPIClient = require("../PlatformAPIClient");
3
3
  const { FDKClientValidationError } = require("../../common/FDKError");
4
4
  const ConfigurationValidator = require("./ConfigurationPlatformApplicationValidator");
5
+ const ConfigurationModel = require("./ConfigurationPlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
5
7
 
6
8
  class Configuration {
7
9
  constructor(config, applicationId) {
@@ -12,10 +14,11 @@ class Configuration {
12
14
  /**
13
15
  * @param {Object} arg - Arg object.
14
16
  * @param {string} arg.platformType - Current platform name
17
+ * @returns {Promise<MobileAppConfiguration>} - Success response
15
18
  * @summary: Get latest build config
16
19
  * @description: Get latest build config
17
20
  */
18
- getBuildConfig({ platformType } = {}) {
21
+ async getBuildConfig({ platformType } = {}) {
19
22
  const { error } = ConfigurationValidator.getBuildConfig().validate(
20
23
  {
21
24
  platformType,
@@ -26,25 +29,60 @@ class Configuration {
26
29
  return Promise.reject(new FDKClientValidationError(error));
27
30
  }
28
31
 
32
+ // Showing warrnings if extra unknown parameters are found
33
+ const {
34
+ error: warrning,
35
+ } = ConfigurationValidator.getBuildConfig().validate(
36
+ {
37
+ platformType,
38
+ },
39
+ { abortEarly: false, allowUnknown: false }
40
+ );
41
+ if (warrning) {
42
+ Logger({
43
+ level: "WARN",
44
+ message: "Parameter Validation warrnings for getBuildConfig",
45
+ });
46
+ Logger({ level: "WARN", message: warrning });
47
+ }
48
+
29
49
  const query_params = {};
30
50
 
31
- return PlatformAPIClient.execute(
51
+ const response = await PlatformAPIClient.execute(
32
52
  this.config,
33
53
  "get",
34
54
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/configuration`,
35
55
  query_params,
36
56
  undefined
37
57
  );
58
+
59
+ const {
60
+ error: res_error,
61
+ } = ConfigurationModel.MobileAppConfiguration().validate(response, {
62
+ abortEarly: false,
63
+ allowUnknown: false,
64
+ });
65
+
66
+ if (res_error) {
67
+ Logger({
68
+ level: "WARN",
69
+ message: "Response Validation Warnnings for getBuildConfig",
70
+ });
71
+ Logger({ level: "WARN", message: res_error });
72
+ }
73
+
74
+ return response;
38
75
  }
39
76
 
40
77
  /**
41
78
  * @param {Object} arg - Arg object.
42
79
  * @param {string} arg.platformType - Current platform name
43
80
  * @param {MobileAppConfigRequest} arg.body
81
+ * @returns {Promise<MobileAppConfiguration>} - Success response
44
82
  * @summary: Update build config for next build
45
83
  * @description: Update build config for next build
46
84
  */
47
- updateBuildConfig({ platformType, body } = {}) {
85
+ async updateBuildConfig({ platformType, body } = {}) {
48
86
  const { error } = ConfigurationValidator.updateBuildConfig().validate(
49
87
  {
50
88
  platformType,
@@ -56,24 +94,60 @@ class Configuration {
56
94
  return Promise.reject(new FDKClientValidationError(error));
57
95
  }
58
96
 
97
+ // Showing warrnings if extra unknown parameters are found
98
+ const {
99
+ error: warrning,
100
+ } = ConfigurationValidator.updateBuildConfig().validate(
101
+ {
102
+ platformType,
103
+ body,
104
+ },
105
+ { abortEarly: false, allowUnknown: false }
106
+ );
107
+ if (warrning) {
108
+ Logger({
109
+ level: "WARN",
110
+ message: "Parameter Validation warrnings for updateBuildConfig",
111
+ });
112
+ Logger({ level: "WARN", message: warrning });
113
+ }
114
+
59
115
  const query_params = {};
60
116
 
61
- return PlatformAPIClient.execute(
117
+ const response = await PlatformAPIClient.execute(
62
118
  this.config,
63
119
  "put",
64
120
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/configuration`,
65
121
  query_params,
66
122
  body
67
123
  );
124
+
125
+ const {
126
+ error: res_error,
127
+ } = ConfigurationModel.MobileAppConfiguration().validate(response, {
128
+ abortEarly: false,
129
+ allowUnknown: false,
130
+ });
131
+
132
+ if (res_error) {
133
+ Logger({
134
+ level: "WARN",
135
+ message: "Response Validation Warnnings for updateBuildConfig",
136
+ });
137
+ Logger({ level: "WARN", message: res_error });
138
+ }
139
+
140
+ return response;
68
141
  }
69
142
 
70
143
  /**
71
144
  * @param {Object} arg - Arg object.
72
145
  * @param {string} arg.platformType - Current platform name
146
+ * @returns {Promise<BuildVersionHistory>} - Success response
73
147
  * @summary: Get previous build versions
74
148
  * @description: Get previous build versions
75
149
  */
76
- getPreviousVersions({ platformType } = {}) {
150
+ async getPreviousVersions({ platformType } = {}) {
77
151
  const { error } = ConfigurationValidator.getPreviousVersions().validate(
78
152
  {
79
153
  platformType,
@@ -84,23 +158,58 @@ class Configuration {
84
158
  return Promise.reject(new FDKClientValidationError(error));
85
159
  }
86
160
 
161
+ // Showing warrnings if extra unknown parameters are found
162
+ const {
163
+ error: warrning,
164
+ } = ConfigurationValidator.getPreviousVersions().validate(
165
+ {
166
+ platformType,
167
+ },
168
+ { abortEarly: false, allowUnknown: false }
169
+ );
170
+ if (warrning) {
171
+ Logger({
172
+ level: "WARN",
173
+ message: "Parameter Validation warrnings for getPreviousVersions",
174
+ });
175
+ Logger({ level: "WARN", message: warrning });
176
+ }
177
+
87
178
  const query_params = {};
88
179
 
89
- return PlatformAPIClient.execute(
180
+ const response = await PlatformAPIClient.execute(
90
181
  this.config,
91
182
  "get",
92
183
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/versions`,
93
184
  query_params,
94
185
  undefined
95
186
  );
187
+
188
+ const {
189
+ error: res_error,
190
+ } = ConfigurationModel.BuildVersionHistory().validate(response, {
191
+ abortEarly: false,
192
+ allowUnknown: false,
193
+ });
194
+
195
+ if (res_error) {
196
+ Logger({
197
+ level: "WARN",
198
+ message: "Response Validation Warnnings for getPreviousVersions",
199
+ });
200
+ Logger({ level: "WARN", message: res_error });
201
+ }
202
+
203
+ return response;
96
204
  }
97
205
 
98
206
  /**
99
207
  * @param {Object} arg - Arg object.
208
+ * @returns {Promise<AppFeatureResponse>} - Success response
100
209
  * @summary: Get features of application
101
210
  * @description: Get features of application
102
211
  */
103
- getAppFeatures({} = {}) {
212
+ async getAppFeatures({} = {}) {
104
213
  const { error } = ConfigurationValidator.getAppFeatures().validate(
105
214
  {},
106
215
  { abortEarly: false, allowUnknown: true }
@@ -109,24 +218,57 @@ class Configuration {
109
218
  return Promise.reject(new FDKClientValidationError(error));
110
219
  }
111
220
 
221
+ // Showing warrnings if extra unknown parameters are found
222
+ const {
223
+ error: warrning,
224
+ } = ConfigurationValidator.getAppFeatures().validate(
225
+ {},
226
+ { abortEarly: false, allowUnknown: false }
227
+ );
228
+ if (warrning) {
229
+ Logger({
230
+ level: "WARN",
231
+ message: "Parameter Validation warrnings for getAppFeatures",
232
+ });
233
+ Logger({ level: "WARN", message: warrning });
234
+ }
235
+
112
236
  const query_params = {};
113
237
 
114
- return PlatformAPIClient.execute(
238
+ const response = await PlatformAPIClient.execute(
115
239
  this.config,
116
240
  "get",
117
241
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/feature`,
118
242
  query_params,
119
243
  undefined
120
244
  );
245
+
246
+ const {
247
+ error: res_error,
248
+ } = ConfigurationModel.AppFeatureResponse().validate(response, {
249
+ abortEarly: false,
250
+ allowUnknown: false,
251
+ });
252
+
253
+ if (res_error) {
254
+ Logger({
255
+ level: "WARN",
256
+ message: "Response Validation Warnnings for getAppFeatures",
257
+ });
258
+ Logger({ level: "WARN", message: res_error });
259
+ }
260
+
261
+ return response;
121
262
  }
122
263
 
123
264
  /**
124
265
  * @param {Object} arg - Arg object.
125
266
  * @param {AppFeatureRequest} arg.body
267
+ * @returns {Promise<AppFeature>} - Success response
126
268
  * @summary: Update features of application
127
269
  * @description: Update features of application
128
270
  */
129
- updateAppFeatures({ body } = {}) {
271
+ async updateAppFeatures({ body } = {}) {
130
272
  const { error } = ConfigurationValidator.updateAppFeatures().validate(
131
273
  {
132
274
  body,
@@ -137,23 +279,58 @@ class Configuration {
137
279
  return Promise.reject(new FDKClientValidationError(error));
138
280
  }
139
281
 
282
+ // Showing warrnings if extra unknown parameters are found
283
+ const {
284
+ error: warrning,
285
+ } = ConfigurationValidator.updateAppFeatures().validate(
286
+ {
287
+ body,
288
+ },
289
+ { abortEarly: false, allowUnknown: false }
290
+ );
291
+ if (warrning) {
292
+ Logger({
293
+ level: "WARN",
294
+ message: "Parameter Validation warrnings for updateAppFeatures",
295
+ });
296
+ Logger({ level: "WARN", message: warrning });
297
+ }
298
+
140
299
  const query_params = {};
141
300
 
142
- return PlatformAPIClient.execute(
301
+ const response = await PlatformAPIClient.execute(
143
302
  this.config,
144
303
  "post",
145
304
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/feature`,
146
305
  query_params,
147
306
  body
148
307
  );
308
+
309
+ const {
310
+ error: res_error,
311
+ } = ConfigurationModel.AppFeature().validate(response, {
312
+ abortEarly: false,
313
+ allowUnknown: false,
314
+ });
315
+
316
+ if (res_error) {
317
+ Logger({
318
+ level: "WARN",
319
+ message: "Response Validation Warnnings for updateAppFeatures",
320
+ });
321
+ Logger({ level: "WARN", message: res_error });
322
+ }
323
+
324
+ return response;
149
325
  }
150
326
 
151
327
  /**
152
328
  * @param {Object} arg - Arg object.
329
+ * @returns {Promise<ApplicationDetail>} - Success response
153
330
  * @summary: Get basic application details
154
331
  * @description: Get basic application details like name
155
332
  */
156
- getAppBasicDetails({} = {}) {
333
+ async getAppBasicDetails({} = {}) {
157
334
  const { error } = ConfigurationValidator.getAppBasicDetails().validate(
158
335
  {},
159
336
  { abortEarly: false, allowUnknown: true }
@@ -162,24 +339,57 @@ class Configuration {
162
339
  return Promise.reject(new FDKClientValidationError(error));
163
340
  }
164
341
 
342
+ // Showing warrnings if extra unknown parameters are found
343
+ const {
344
+ error: warrning,
345
+ } = ConfigurationValidator.getAppBasicDetails().validate(
346
+ {},
347
+ { abortEarly: false, allowUnknown: false }
348
+ );
349
+ if (warrning) {
350
+ Logger({
351
+ level: "WARN",
352
+ message: "Parameter Validation warrnings for getAppBasicDetails",
353
+ });
354
+ Logger({ level: "WARN", message: warrning });
355
+ }
356
+
165
357
  const query_params = {};
166
358
 
167
- return PlatformAPIClient.execute(
359
+ const response = await PlatformAPIClient.execute(
168
360
  this.config,
169
361
  "get",
170
362
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
171
363
  query_params,
172
364
  undefined
173
365
  );
366
+
367
+ const {
368
+ error: res_error,
369
+ } = ConfigurationModel.ApplicationDetail().validate(response, {
370
+ abortEarly: false,
371
+ allowUnknown: false,
372
+ });
373
+
374
+ if (res_error) {
375
+ Logger({
376
+ level: "WARN",
377
+ message: "Response Validation Warnnings for getAppBasicDetails",
378
+ });
379
+ Logger({ level: "WARN", message: res_error });
380
+ }
381
+
382
+ return response;
174
383
  }
175
384
 
176
385
  /**
177
386
  * @param {Object} arg - Arg object.
178
387
  * @param {ApplicationDetail} arg.body
388
+ * @returns {Promise<ApplicationDetail>} - Success response
179
389
  * @summary: Add or update application's basic details
180
390
  * @description: Add or update application's basic details
181
391
  */
182
- updateAppBasicDetails({ body } = {}) {
392
+ async updateAppBasicDetails({ body } = {}) {
183
393
  const { error } = ConfigurationValidator.updateAppBasicDetails().validate(
184
394
  {
185
395
  body,
@@ -190,23 +400,58 @@ class Configuration {
190
400
  return Promise.reject(new FDKClientValidationError(error));
191
401
  }
192
402
 
403
+ // Showing warrnings if extra unknown parameters are found
404
+ const {
405
+ error: warrning,
406
+ } = ConfigurationValidator.updateAppBasicDetails().validate(
407
+ {
408
+ body,
409
+ },
410
+ { abortEarly: false, allowUnknown: false }
411
+ );
412
+ if (warrning) {
413
+ Logger({
414
+ level: "WARN",
415
+ message: "Parameter Validation warrnings for updateAppBasicDetails",
416
+ });
417
+ Logger({ level: "WARN", message: warrning });
418
+ }
419
+
193
420
  const query_params = {};
194
421
 
195
- return PlatformAPIClient.execute(
422
+ const response = await PlatformAPIClient.execute(
196
423
  this.config,
197
424
  "put",
198
425
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
199
426
  query_params,
200
427
  body
201
428
  );
429
+
430
+ const {
431
+ error: res_error,
432
+ } = ConfigurationModel.ApplicationDetail().validate(response, {
433
+ abortEarly: false,
434
+ allowUnknown: false,
435
+ });
436
+
437
+ if (res_error) {
438
+ Logger({
439
+ level: "WARN",
440
+ message: "Response Validation Warnnings for updateAppBasicDetails",
441
+ });
442
+ Logger({ level: "WARN", message: res_error });
443
+ }
444
+
445
+ return response;
202
446
  }
203
447
 
204
448
  /**
205
449
  * @param {Object} arg - Arg object.
450
+ * @returns {Promise<ApplicationInformation>} - Success response
206
451
  * @summary: Get application information
207
452
  * @description: Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application.
208
453
  */
209
- getAppContactInfo({} = {}) {
454
+ async getAppContactInfo({} = {}) {
210
455
  const { error } = ConfigurationValidator.getAppContactInfo().validate(
211
456
  {},
212
457
  { abortEarly: false, allowUnknown: true }
@@ -215,24 +460,57 @@ class Configuration {
215
460
  return Promise.reject(new FDKClientValidationError(error));
216
461
  }
217
462
 
463
+ // Showing warrnings if extra unknown parameters are found
464
+ const {
465
+ error: warrning,
466
+ } = ConfigurationValidator.getAppContactInfo().validate(
467
+ {},
468
+ { abortEarly: false, allowUnknown: false }
469
+ );
470
+ if (warrning) {
471
+ Logger({
472
+ level: "WARN",
473
+ message: "Parameter Validation warrnings for getAppContactInfo",
474
+ });
475
+ Logger({ level: "WARN", message: warrning });
476
+ }
477
+
218
478
  const query_params = {};
219
479
 
220
- return PlatformAPIClient.execute(
480
+ const response = await PlatformAPIClient.execute(
221
481
  this.config,
222
482
  "get",
223
483
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/information`,
224
484
  query_params,
225
485
  undefined
226
486
  );
487
+
488
+ const {
489
+ error: res_error,
490
+ } = ConfigurationModel.ApplicationInformation().validate(response, {
491
+ abortEarly: false,
492
+ allowUnknown: false,
493
+ });
494
+
495
+ if (res_error) {
496
+ Logger({
497
+ level: "WARN",
498
+ message: "Response Validation Warnnings for getAppContactInfo",
499
+ });
500
+ Logger({ level: "WARN", message: res_error });
501
+ }
502
+
503
+ return response;
227
504
  }
228
505
 
229
506
  /**
230
507
  * @param {Object} arg - Arg object.
231
508
  * @param {ApplicationInformation} arg.body
509
+ * @returns {Promise<ApplicationInformation>} - Success response
232
510
  * @summary: Get application information
233
511
  * @description: Save Application Current Information. This includes information about social links, address and contact information of an application.
234
512
  */
235
- updateAppContactInfo({ body } = {}) {
513
+ async updateAppContactInfo({ body } = {}) {
236
514
  const { error } = ConfigurationValidator.updateAppContactInfo().validate(
237
515
  {
238
516
  body,
@@ -243,23 +521,58 @@ class Configuration {
243
521
  return Promise.reject(new FDKClientValidationError(error));
244
522
  }
245
523
 
524
+ // Showing warrnings if extra unknown parameters are found
525
+ const {
526
+ error: warrning,
527
+ } = ConfigurationValidator.updateAppContactInfo().validate(
528
+ {
529
+ body,
530
+ },
531
+ { abortEarly: false, allowUnknown: false }
532
+ );
533
+ if (warrning) {
534
+ Logger({
535
+ level: "WARN",
536
+ message: "Parameter Validation warrnings for updateAppContactInfo",
537
+ });
538
+ Logger({ level: "WARN", message: warrning });
539
+ }
540
+
246
541
  const query_params = {};
247
542
 
248
- return PlatformAPIClient.execute(
543
+ const response = await PlatformAPIClient.execute(
249
544
  this.config,
250
545
  "put",
251
546
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/information`,
252
547
  query_params,
253
548
  body
254
549
  );
550
+
551
+ const {
552
+ error: res_error,
553
+ } = ConfigurationModel.ApplicationInformation().validate(response, {
554
+ abortEarly: false,
555
+ allowUnknown: false,
556
+ });
557
+
558
+ if (res_error) {
559
+ Logger({
560
+ level: "WARN",
561
+ message: "Response Validation Warnnings for updateAppContactInfo",
562
+ });
563
+ Logger({ level: "WARN", message: res_error });
564
+ }
565
+
566
+ return response;
255
567
  }
256
568
 
257
569
  /**
258
570
  * @param {Object} arg - Arg object.
571
+ * @returns {Promise<TokenResponse>} - Success response
259
572
  * @summary: Get social tokens
260
573
  * @description: Get social tokens.
261
574
  */
262
- getAppApiTokens({} = {}) {
575
+ async getAppApiTokens({} = {}) {
263
576
  const { error } = ConfigurationValidator.getAppApiTokens().validate(
264
577
  {},
265
578
  { abortEarly: false, allowUnknown: true }
@@ -268,24 +581,57 @@ class Configuration {
268
581
  return Promise.reject(new FDKClientValidationError(error));
269
582
  }
270
583
 
584
+ // Showing warrnings if extra unknown parameters are found
585
+ const {
586
+ error: warrning,
587
+ } = ConfigurationValidator.getAppApiTokens().validate(
588
+ {},
589
+ { abortEarly: false, allowUnknown: false }
590
+ );
591
+ if (warrning) {
592
+ Logger({
593
+ level: "WARN",
594
+ message: "Parameter Validation warrnings for getAppApiTokens",
595
+ });
596
+ Logger({ level: "WARN", message: warrning });
597
+ }
598
+
271
599
  const query_params = {};
272
600
 
273
- return PlatformAPIClient.execute(
601
+ const response = await PlatformAPIClient.execute(
274
602
  this.config,
275
603
  "get",
276
604
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/token`,
277
605
  query_params,
278
606
  undefined
279
607
  );
608
+
609
+ const {
610
+ error: res_error,
611
+ } = ConfigurationModel.TokenResponse().validate(response, {
612
+ abortEarly: false,
613
+ allowUnknown: false,
614
+ });
615
+
616
+ if (res_error) {
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Response Validation Warnnings for getAppApiTokens",
620
+ });
621
+ Logger({ level: "WARN", message: res_error });
622
+ }
623
+
624
+ return response;
280
625
  }
281
626
 
282
627
  /**
283
628
  * @param {Object} arg - Arg object.
284
629
  * @param {TokenResponse} arg.body
630
+ * @returns {Promise<TokenResponse>} - Success response
285
631
  * @summary: Add social tokens
286
632
  * @description: Add social tokens.
287
633
  */
288
- updateAppApiTokens({ body } = {}) {
634
+ async updateAppApiTokens({ body } = {}) {
289
635
  const { error } = ConfigurationValidator.updateAppApiTokens().validate(
290
636
  {
291
637
  body,
@@ -296,15 +642,49 @@ class Configuration {
296
642
  return Promise.reject(new FDKClientValidationError(error));
297
643
  }
298
644
 
645
+ // Showing warrnings if extra unknown parameters are found
646
+ const {
647
+ error: warrning,
648
+ } = ConfigurationValidator.updateAppApiTokens().validate(
649
+ {
650
+ body,
651
+ },
652
+ { abortEarly: false, allowUnknown: false }
653
+ );
654
+ if (warrning) {
655
+ Logger({
656
+ level: "WARN",
657
+ message: "Parameter Validation warrnings for updateAppApiTokens",
658
+ });
659
+ Logger({ level: "WARN", message: warrning });
660
+ }
661
+
299
662
  const query_params = {};
300
663
 
301
- return PlatformAPIClient.execute(
664
+ const response = await PlatformAPIClient.execute(
302
665
  this.config,
303
666
  "post",
304
667
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/token`,
305
668
  query_params,
306
669
  body
307
670
  );
671
+
672
+ const {
673
+ error: res_error,
674
+ } = ConfigurationModel.TokenResponse().validate(response, {
675
+ abortEarly: false,
676
+ allowUnknown: false,
677
+ });
678
+
679
+ if (res_error) {
680
+ Logger({
681
+ level: "WARN",
682
+ message: "Response Validation Warnnings for updateAppApiTokens",
683
+ });
684
+ Logger({ level: "WARN", message: res_error });
685
+ }
686
+
687
+ return response;
308
688
  }
309
689
 
310
690
  /**
@@ -312,10 +692,11 @@ class Configuration {
312
692
  * @param {number} [arg.uid] - Uid of companies to be fetched
313
693
  * @param {number} [arg.pageNo] - Current page no
314
694
  * @param {number} [arg.pageSize] - Current request items count
695
+ * @returns {Promise<CompaniesResponse>} - Success response
315
696
  * @summary: Application inventory enabled companies
316
697
  * @description: Application inventory enabled companies.
317
698
  */
318
- getAppCompanies({ uid, pageNo, pageSize } = {}) {
699
+ async getAppCompanies({ uid, pageNo, pageSize } = {}) {
319
700
  const { error } = ConfigurationValidator.getAppCompanies().validate(
320
701
  {
321
702
  uid,
@@ -328,18 +709,54 @@ class Configuration {
328
709
  return Promise.reject(new FDKClientValidationError(error));
329
710
  }
330
711
 
712
+ // Showing warrnings if extra unknown parameters are found
713
+ const {
714
+ error: warrning,
715
+ } = ConfigurationValidator.getAppCompanies().validate(
716
+ {
717
+ uid,
718
+ pageNo,
719
+ pageSize,
720
+ },
721
+ { abortEarly: false, allowUnknown: false }
722
+ );
723
+ if (warrning) {
724
+ Logger({
725
+ level: "WARN",
726
+ message: "Parameter Validation warrnings for getAppCompanies",
727
+ });
728
+ Logger({ level: "WARN", message: warrning });
729
+ }
730
+
331
731
  const query_params = {};
332
732
  query_params["uid"] = uid;
333
733
  query_params["page_no"] = pageNo;
334
734
  query_params["page_size"] = pageSize;
335
735
 
336
- return PlatformAPIClient.execute(
736
+ const response = await PlatformAPIClient.execute(
337
737
  this.config,
338
738
  "get",
339
739
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/companies`,
340
740
  query_params,
341
741
  undefined
342
742
  );
743
+
744
+ const {
745
+ error: res_error,
746
+ } = ConfigurationModel.CompaniesResponse().validate(response, {
747
+ abortEarly: false,
748
+ allowUnknown: false,
749
+ });
750
+
751
+ if (res_error) {
752
+ Logger({
753
+ level: "WARN",
754
+ message: "Response Validation Warnnings for getAppCompanies",
755
+ });
756
+ Logger({ level: "WARN", message: res_error });
757
+ }
758
+
759
+ return response;
343
760
  }
344
761
 
345
762
  /**
@@ -378,10 +795,11 @@ class Configuration {
378
795
  * @param {Object} arg - Arg object.
379
796
  * @param {number} [arg.pageNo] - Current page no
380
797
  * @param {number} [arg.pageSize] - Current request items count
798
+ * @returns {Promise<StoresResponse>} - Success response
381
799
  * @summary: Application inventory enabled stores
382
800
  * @description: Application inventory enabled stores.
383
801
  */
384
- getAppStores({ pageNo, pageSize } = {}) {
802
+ async getAppStores({ pageNo, pageSize } = {}) {
385
803
  const { error } = ConfigurationValidator.getAppStores().validate(
386
804
  {
387
805
  pageNo,
@@ -393,17 +811,50 @@ class Configuration {
393
811
  return Promise.reject(new FDKClientValidationError(error));
394
812
  }
395
813
 
814
+ // Showing warrnings if extra unknown parameters are found
815
+ const { error: warrning } = ConfigurationValidator.getAppStores().validate(
816
+ {
817
+ pageNo,
818
+ pageSize,
819
+ },
820
+ { abortEarly: false, allowUnknown: false }
821
+ );
822
+ if (warrning) {
823
+ Logger({
824
+ level: "WARN",
825
+ message: "Parameter Validation warrnings for getAppStores",
826
+ });
827
+ Logger({ level: "WARN", message: warrning });
828
+ }
829
+
396
830
  const query_params = {};
397
831
  query_params["page_no"] = pageNo;
398
832
  query_params["page_size"] = pageSize;
399
833
 
400
- return PlatformAPIClient.execute(
834
+ const response = await PlatformAPIClient.execute(
401
835
  this.config,
402
836
  "get",
403
837
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/stores`,
404
838
  query_params,
405
839
  undefined
406
840
  );
841
+
842
+ const {
843
+ error: res_error,
844
+ } = ConfigurationModel.StoresResponse().validate(response, {
845
+ abortEarly: false,
846
+ allowUnknown: false,
847
+ });
848
+
849
+ if (res_error) {
850
+ Logger({
851
+ level: "WARN",
852
+ message: "Response Validation Warnnings for getAppStores",
853
+ });
854
+ Logger({ level: "WARN", message: res_error });
855
+ }
856
+
857
+ return response;
407
858
  }
408
859
 
409
860
  /**
@@ -438,10 +889,11 @@ class Configuration {
438
889
 
439
890
  /**
440
891
  * @param {Object} arg - Arg object.
892
+ * @returns {Promise<ApplicationInventory>} - Success response
441
893
  * @summary: Get application configuration
442
894
  * @description: Get application configuration for various features and data
443
895
  */
444
- getInventoryConfig({} = {}) {
896
+ async getInventoryConfig({} = {}) {
445
897
  const { error } = ConfigurationValidator.getInventoryConfig().validate(
446
898
  {},
447
899
  { abortEarly: false, allowUnknown: true }
@@ -450,24 +902,57 @@ class Configuration {
450
902
  return Promise.reject(new FDKClientValidationError(error));
451
903
  }
452
904
 
905
+ // Showing warrnings if extra unknown parameters are found
906
+ const {
907
+ error: warrning,
908
+ } = ConfigurationValidator.getInventoryConfig().validate(
909
+ {},
910
+ { abortEarly: false, allowUnknown: false }
911
+ );
912
+ if (warrning) {
913
+ Logger({
914
+ level: "WARN",
915
+ message: "Parameter Validation warrnings for getInventoryConfig",
916
+ });
917
+ Logger({ level: "WARN", message: warrning });
918
+ }
919
+
453
920
  const query_params = {};
454
921
 
455
- return PlatformAPIClient.execute(
922
+ const response = await PlatformAPIClient.execute(
456
923
  this.config,
457
924
  "get",
458
925
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
459
926
  query_params,
460
927
  undefined
461
928
  );
929
+
930
+ const {
931
+ error: res_error,
932
+ } = ConfigurationModel.ApplicationInventory().validate(response, {
933
+ abortEarly: false,
934
+ allowUnknown: false,
935
+ });
936
+
937
+ if (res_error) {
938
+ Logger({
939
+ level: "WARN",
940
+ message: "Response Validation Warnnings for getInventoryConfig",
941
+ });
942
+ Logger({ level: "WARN", message: res_error });
943
+ }
944
+
945
+ return response;
462
946
  }
463
947
 
464
948
  /**
465
949
  * @param {Object} arg - Arg object.
466
950
  * @param {ApplicationInventory} arg.body
951
+ * @returns {Promise<ApplicationInventory>} - Success response
467
952
  * @summary: Update application configuration
468
953
  * @description: Update application configuration for various features and data
469
954
  */
470
- updateInventoryConfig({ body } = {}) {
955
+ async updateInventoryConfig({ body } = {}) {
471
956
  const { error } = ConfigurationValidator.updateInventoryConfig().validate(
472
957
  {
473
958
  body,
@@ -478,24 +963,59 @@ class Configuration {
478
963
  return Promise.reject(new FDKClientValidationError(error));
479
964
  }
480
965
 
966
+ // Showing warrnings if extra unknown parameters are found
967
+ const {
968
+ error: warrning,
969
+ } = ConfigurationValidator.updateInventoryConfig().validate(
970
+ {
971
+ body,
972
+ },
973
+ { abortEarly: false, allowUnknown: false }
974
+ );
975
+ if (warrning) {
976
+ Logger({
977
+ level: "WARN",
978
+ message: "Parameter Validation warrnings for updateInventoryConfig",
979
+ });
980
+ Logger({ level: "WARN", message: warrning });
981
+ }
982
+
481
983
  const query_params = {};
482
984
 
483
- return PlatformAPIClient.execute(
985
+ const response = await PlatformAPIClient.execute(
484
986
  this.config,
485
987
  "put",
486
988
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
487
989
  query_params,
488
990
  body
489
991
  );
992
+
993
+ const {
994
+ error: res_error,
995
+ } = ConfigurationModel.ApplicationInventory().validate(response, {
996
+ abortEarly: false,
997
+ allowUnknown: false,
998
+ });
999
+
1000
+ if (res_error) {
1001
+ Logger({
1002
+ level: "WARN",
1003
+ message: "Response Validation Warnnings for updateInventoryConfig",
1004
+ });
1005
+ Logger({ level: "WARN", message: res_error });
1006
+ }
1007
+
1008
+ return response;
490
1009
  }
491
1010
 
492
1011
  /**
493
1012
  * @param {Object} arg - Arg object.
494
1013
  * @param {AppInventoryPartialUpdate} arg.body
1014
+ * @returns {Promise<ApplicationInventory>} - Success response
495
1015
  * @summary: Partially update application configuration
496
1016
  * @description: Partially update application configuration for various features and data
497
1017
  */
498
- partiallyUpdateInventoryConfig({ body } = {}) {
1018
+ async partiallyUpdateInventoryConfig({ body } = {}) {
499
1019
  const {
500
1020
  error,
501
1021
  } = ConfigurationValidator.partiallyUpdateInventoryConfig().validate(
@@ -508,23 +1028,60 @@ class Configuration {
508
1028
  return Promise.reject(new FDKClientValidationError(error));
509
1029
  }
510
1030
 
1031
+ // Showing warrnings if extra unknown parameters are found
1032
+ const {
1033
+ error: warrning,
1034
+ } = ConfigurationValidator.partiallyUpdateInventoryConfig().validate(
1035
+ {
1036
+ body,
1037
+ },
1038
+ { abortEarly: false, allowUnknown: false }
1039
+ );
1040
+ if (warrning) {
1041
+ Logger({
1042
+ level: "WARN",
1043
+ message:
1044
+ "Parameter Validation warrnings for partiallyUpdateInventoryConfig",
1045
+ });
1046
+ Logger({ level: "WARN", message: warrning });
1047
+ }
1048
+
511
1049
  const query_params = {};
512
1050
 
513
- return PlatformAPIClient.execute(
1051
+ const response = await PlatformAPIClient.execute(
514
1052
  this.config,
515
1053
  "patch",
516
1054
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
517
1055
  query_params,
518
1056
  body
519
1057
  );
1058
+
1059
+ const {
1060
+ error: res_error,
1061
+ } = ConfigurationModel.ApplicationInventory().validate(response, {
1062
+ abortEarly: false,
1063
+ allowUnknown: false,
1064
+ });
1065
+
1066
+ if (res_error) {
1067
+ Logger({
1068
+ level: "WARN",
1069
+ message:
1070
+ "Response Validation Warnnings for partiallyUpdateInventoryConfig",
1071
+ });
1072
+ Logger({ level: "WARN", message: res_error });
1073
+ }
1074
+
1075
+ return response;
520
1076
  }
521
1077
 
522
1078
  /**
523
1079
  * @param {Object} arg - Arg object.
1080
+ * @returns {Promise<AppSupportedCurrency>} - Success response
524
1081
  * @summary: Get application enabled currency list
525
1082
  * @description: Get application enabled currency list
526
1083
  */
527
- getAppCurrencyConfig({} = {}) {
1084
+ async getAppCurrencyConfig({} = {}) {
528
1085
  const { error } = ConfigurationValidator.getAppCurrencyConfig().validate(
529
1086
  {},
530
1087
  { abortEarly: false, allowUnknown: true }
@@ -533,24 +1090,57 @@ class Configuration {
533
1090
  return Promise.reject(new FDKClientValidationError(error));
534
1091
  }
535
1092
 
1093
+ // Showing warrnings if extra unknown parameters are found
1094
+ const {
1095
+ error: warrning,
1096
+ } = ConfigurationValidator.getAppCurrencyConfig().validate(
1097
+ {},
1098
+ { abortEarly: false, allowUnknown: false }
1099
+ );
1100
+ if (warrning) {
1101
+ Logger({
1102
+ level: "WARN",
1103
+ message: "Parameter Validation warrnings for getAppCurrencyConfig",
1104
+ });
1105
+ Logger({ level: "WARN", message: warrning });
1106
+ }
1107
+
536
1108
  const query_params = {};
537
1109
 
538
- return PlatformAPIClient.execute(
1110
+ const response = await PlatformAPIClient.execute(
539
1111
  this.config,
540
1112
  "get",
541
1113
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency`,
542
1114
  query_params,
543
1115
  undefined
544
1116
  );
1117
+
1118
+ const {
1119
+ error: res_error,
1120
+ } = ConfigurationModel.AppSupportedCurrency().validate(response, {
1121
+ abortEarly: false,
1122
+ allowUnknown: false,
1123
+ });
1124
+
1125
+ if (res_error) {
1126
+ Logger({
1127
+ level: "WARN",
1128
+ message: "Response Validation Warnnings for getAppCurrencyConfig",
1129
+ });
1130
+ Logger({ level: "WARN", message: res_error });
1131
+ }
1132
+
1133
+ return response;
545
1134
  }
546
1135
 
547
1136
  /**
548
1137
  * @param {Object} arg - Arg object.
549
1138
  * @param {AppSupportedCurrency} arg.body
1139
+ * @returns {Promise<AppSupportedCurrency>} - Success response
550
1140
  * @summary: Add initial application supported currency
551
1141
  * @description: Add initial application supported currency for various features and data. Default INR will be enabled.
552
1142
  */
553
- updateAppCurrencyConfig({ body } = {}) {
1143
+ async updateAppCurrencyConfig({ body } = {}) {
554
1144
  const { error } = ConfigurationValidator.updateAppCurrencyConfig().validate(
555
1145
  {
556
1146
  body,
@@ -561,23 +1151,58 @@ class Configuration {
561
1151
  return Promise.reject(new FDKClientValidationError(error));
562
1152
  }
563
1153
 
1154
+ // Showing warrnings if extra unknown parameters are found
1155
+ const {
1156
+ error: warrning,
1157
+ } = ConfigurationValidator.updateAppCurrencyConfig().validate(
1158
+ {
1159
+ body,
1160
+ },
1161
+ { abortEarly: false, allowUnknown: false }
1162
+ );
1163
+ if (warrning) {
1164
+ Logger({
1165
+ level: "WARN",
1166
+ message: "Parameter Validation warrnings for updateAppCurrencyConfig",
1167
+ });
1168
+ Logger({ level: "WARN", message: warrning });
1169
+ }
1170
+
564
1171
  const query_params = {};
565
1172
 
566
- return PlatformAPIClient.execute(
1173
+ const response = await PlatformAPIClient.execute(
567
1174
  this.config,
568
1175
  "post",
569
1176
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency`,
570
1177
  query_params,
571
1178
  body
572
1179
  );
1180
+
1181
+ const {
1182
+ error: res_error,
1183
+ } = ConfigurationModel.AppSupportedCurrency().validate(response, {
1184
+ abortEarly: false,
1185
+ allowUnknown: false,
1186
+ });
1187
+
1188
+ if (res_error) {
1189
+ Logger({
1190
+ level: "WARN",
1191
+ message: "Response Validation Warnnings for updateAppCurrencyConfig",
1192
+ });
1193
+ Logger({ level: "WARN", message: res_error });
1194
+ }
1195
+
1196
+ return response;
573
1197
  }
574
1198
 
575
1199
  /**
576
1200
  * @param {Object} arg - Arg object.
1201
+ * @returns {Promise<AppCurrencyResponse>} - Success response
577
1202
  * @summary: Get currencies enabled in the application
578
1203
  * @description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
579
1204
  */
580
- getAppSupportedCurrency({} = {}) {
1205
+ async getAppSupportedCurrency({} = {}) {
581
1206
  const { error } = ConfigurationValidator.getAppSupportedCurrency().validate(
582
1207
  {},
583
1208
  { abortEarly: false, allowUnknown: true }
@@ -586,15 +1211,47 @@ class Configuration {
586
1211
  return Promise.reject(new FDKClientValidationError(error));
587
1212
  }
588
1213
 
1214
+ // Showing warrnings if extra unknown parameters are found
1215
+ const {
1216
+ error: warrning,
1217
+ } = ConfigurationValidator.getAppSupportedCurrency().validate(
1218
+ {},
1219
+ { abortEarly: false, allowUnknown: false }
1220
+ );
1221
+ if (warrning) {
1222
+ Logger({
1223
+ level: "WARN",
1224
+ message: "Parameter Validation warrnings for getAppSupportedCurrency",
1225
+ });
1226
+ Logger({ level: "WARN", message: warrning });
1227
+ }
1228
+
589
1229
  const query_params = {};
590
1230
 
591
- return PlatformAPIClient.execute(
1231
+ const response = await PlatformAPIClient.execute(
592
1232
  this.config,
593
1233
  "get",
594
1234
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency/supported`,
595
1235
  query_params,
596
1236
  undefined
597
1237
  );
1238
+
1239
+ const {
1240
+ error: res_error,
1241
+ } = ConfigurationModel.AppCurrencyResponse().validate(response, {
1242
+ abortEarly: false,
1243
+ allowUnknown: false,
1244
+ });
1245
+
1246
+ if (res_error) {
1247
+ Logger({
1248
+ level: "WARN",
1249
+ message: "Response Validation Warnnings for getAppSupportedCurrency",
1250
+ });
1251
+ Logger({ level: "WARN", message: res_error });
1252
+ }
1253
+
1254
+ return response;
598
1255
  }
599
1256
 
600
1257
  /**
@@ -602,10 +1259,11 @@ class Configuration {
602
1259
  * @param {number} [arg.pageNo] - Current page no
603
1260
  * @param {number} [arg.pageSize] - Current request items count
604
1261
  * @param {FilterOrderingStoreRequest} arg.body
1262
+ * @returns {Promise<OrderingStores>} - Success response
605
1263
  * @summary: Get ordering store by filter
606
1264
  * @description: Get ordering store by filter
607
1265
  */
608
- getOrderingStoresByFilter({ body, pageNo, pageSize } = {}) {
1266
+ async getOrderingStoresByFilter({ body, pageNo, pageSize } = {}) {
609
1267
  const {
610
1268
  error,
611
1269
  } = ConfigurationValidator.getOrderingStoresByFilter().validate(
@@ -620,17 +1278,53 @@ class Configuration {
620
1278
  return Promise.reject(new FDKClientValidationError(error));
621
1279
  }
622
1280
 
1281
+ // Showing warrnings if extra unknown parameters are found
1282
+ const {
1283
+ error: warrning,
1284
+ } = ConfigurationValidator.getOrderingStoresByFilter().validate(
1285
+ {
1286
+ body,
1287
+ pageNo,
1288
+ pageSize,
1289
+ },
1290
+ { abortEarly: false, allowUnknown: false }
1291
+ );
1292
+ if (warrning) {
1293
+ Logger({
1294
+ level: "WARN",
1295
+ message: "Parameter Validation warrnings for getOrderingStoresByFilter",
1296
+ });
1297
+ Logger({ level: "WARN", message: warrning });
1298
+ }
1299
+
623
1300
  const query_params = {};
624
1301
  query_params["page_no"] = pageNo;
625
1302
  query_params["page_size"] = pageSize;
626
1303
 
627
- return PlatformAPIClient.execute(
1304
+ const response = await PlatformAPIClient.execute(
628
1305
  this.config,
629
1306
  "post",
630
1307
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store/stores/filter`,
631
1308
  query_params,
632
1309
  body
633
1310
  );
1311
+
1312
+ const {
1313
+ error: res_error,
1314
+ } = ConfigurationModel.OrderingStores().validate(response, {
1315
+ abortEarly: false,
1316
+ allowUnknown: false,
1317
+ });
1318
+
1319
+ if (res_error) {
1320
+ Logger({
1321
+ level: "WARN",
1322
+ message: "Response Validation Warnnings for getOrderingStoresByFilter",
1323
+ });
1324
+ Logger({ level: "WARN", message: res_error });
1325
+ }
1326
+
1327
+ return response;
634
1328
  }
635
1329
 
636
1330
  /**
@@ -673,10 +1367,11 @@ class Configuration {
673
1367
  /**
674
1368
  * @param {Object} arg - Arg object.
675
1369
  * @param {OrderingStoreConfig} arg.body
1370
+ * @returns {Promise<DeploymentMeta>} - Success response
676
1371
  * @summary: Add/Update ordering store config
677
1372
  * @description: Add/Update ordering store config.
678
1373
  */
679
- updateOrderingStoreConfig({ body } = {}) {
1374
+ async updateOrderingStoreConfig({ body } = {}) {
680
1375
  const {
681
1376
  error,
682
1377
  } = ConfigurationValidator.updateOrderingStoreConfig().validate(
@@ -689,15 +1384,49 @@ class Configuration {
689
1384
  return Promise.reject(new FDKClientValidationError(error));
690
1385
  }
691
1386
 
1387
+ // Showing warrnings if extra unknown parameters are found
1388
+ const {
1389
+ error: warrning,
1390
+ } = ConfigurationValidator.updateOrderingStoreConfig().validate(
1391
+ {
1392
+ body,
1393
+ },
1394
+ { abortEarly: false, allowUnknown: false }
1395
+ );
1396
+ if (warrning) {
1397
+ Logger({
1398
+ level: "WARN",
1399
+ message: "Parameter Validation warrnings for updateOrderingStoreConfig",
1400
+ });
1401
+ Logger({ level: "WARN", message: warrning });
1402
+ }
1403
+
692
1404
  const query_params = {};
693
1405
 
694
- return PlatformAPIClient.execute(
1406
+ const response = await PlatformAPIClient.execute(
695
1407
  this.config,
696
1408
  "post",
697
1409
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store`,
698
1410
  query_params,
699
1411
  body
700
1412
  );
1413
+
1414
+ const {
1415
+ error: res_error,
1416
+ } = ConfigurationModel.DeploymentMeta().validate(response, {
1417
+ abortEarly: false,
1418
+ allowUnknown: false,
1419
+ });
1420
+
1421
+ if (res_error) {
1422
+ Logger({
1423
+ level: "WARN",
1424
+ message: "Response Validation Warnnings for updateOrderingStoreConfig",
1425
+ });
1426
+ Logger({ level: "WARN", message: res_error });
1427
+ }
1428
+
1429
+ return response;
701
1430
  }
702
1431
 
703
1432
  /**
@@ -707,10 +1436,11 @@ class Configuration {
707
1436
  * @param {number} [arg.pageSize] - The number of items to retrieve in each
708
1437
  * page. Default value is 10.
709
1438
  * @param {string} [arg.q] - Store code or name of the ordering store.
1439
+ * @returns {Promise<OrderingStoresResponse>} - Success response
710
1440
  * @summary: Get deployment stores
711
1441
  * @description: Use this API to retrieve the details of all stores access given to the staff member (the selling locations where the application will be utilized for placing orders).
712
1442
  */
713
- getStaffOrderingStores({ pageNo, pageSize, q } = {}) {
1443
+ async getStaffOrderingStores({ pageNo, pageSize, q } = {}) {
714
1444
  const { error } = ConfigurationValidator.getStaffOrderingStores().validate(
715
1445
  {
716
1446
  pageNo,
@@ -723,18 +1453,54 @@ class Configuration {
723
1453
  return Promise.reject(new FDKClientValidationError(error));
724
1454
  }
725
1455
 
1456
+ // Showing warrnings if extra unknown parameters are found
1457
+ const {
1458
+ error: warrning,
1459
+ } = ConfigurationValidator.getStaffOrderingStores().validate(
1460
+ {
1461
+ pageNo,
1462
+ pageSize,
1463
+ q,
1464
+ },
1465
+ { abortEarly: false, allowUnknown: false }
1466
+ );
1467
+ if (warrning) {
1468
+ Logger({
1469
+ level: "WARN",
1470
+ message: "Parameter Validation warrnings for getStaffOrderingStores",
1471
+ });
1472
+ Logger({ level: "WARN", message: warrning });
1473
+ }
1474
+
726
1475
  const query_params = {};
727
1476
  query_params["page_no"] = pageNo;
728
1477
  query_params["page_size"] = pageSize;
729
1478
  query_params["q"] = q;
730
1479
 
731
- return PlatformAPIClient.execute(
1480
+ const response = await PlatformAPIClient.execute(
732
1481
  this.config,
733
1482
  "get",
734
1483
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store/staff-stores`,
735
1484
  query_params,
736
1485
  undefined
737
1486
  );
1487
+
1488
+ const {
1489
+ error: res_error,
1490
+ } = ConfigurationModel.OrderingStoresResponse().validate(response, {
1491
+ abortEarly: false,
1492
+ allowUnknown: false,
1493
+ });
1494
+
1495
+ if (res_error) {
1496
+ Logger({
1497
+ level: "WARN",
1498
+ message: "Response Validation Warnnings for getStaffOrderingStores",
1499
+ });
1500
+ Logger({ level: "WARN", message: res_error });
1501
+ }
1502
+
1503
+ return response;
738
1504
  }
739
1505
 
740
1506
  /**
@@ -777,10 +1543,11 @@ class Configuration {
777
1543
 
778
1544
  /**
779
1545
  * @param {Object} arg - Arg object.
1546
+ * @returns {Promise<DomainsResponse>} - Success response
780
1547
  * @summary: Get attached domain list
781
1548
  * @description: Get attached domain list.
782
1549
  */
783
- getDomains({} = {}) {
1550
+ async getDomains({} = {}) {
784
1551
  const { error } = ConfigurationValidator.getDomains().validate(
785
1552
  {},
786
1553
  { abortEarly: false, allowUnknown: true }
@@ -789,24 +1556,55 @@ class Configuration {
789
1556
  return Promise.reject(new FDKClientValidationError(error));
790
1557
  }
791
1558
 
1559
+ // Showing warrnings if extra unknown parameters are found
1560
+ const { error: warrning } = ConfigurationValidator.getDomains().validate(
1561
+ {},
1562
+ { abortEarly: false, allowUnknown: false }
1563
+ );
1564
+ if (warrning) {
1565
+ Logger({
1566
+ level: "WARN",
1567
+ message: "Parameter Validation warrnings for getDomains",
1568
+ });
1569
+ Logger({ level: "WARN", message: warrning });
1570
+ }
1571
+
792
1572
  const query_params = {};
793
1573
 
794
- return PlatformAPIClient.execute(
1574
+ const response = await PlatformAPIClient.execute(
795
1575
  this.config,
796
1576
  "get",
797
1577
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain`,
798
1578
  query_params,
799
1579
  undefined
800
1580
  );
1581
+
1582
+ const {
1583
+ error: res_error,
1584
+ } = ConfigurationModel.DomainsResponse().validate(response, {
1585
+ abortEarly: false,
1586
+ allowUnknown: false,
1587
+ });
1588
+
1589
+ if (res_error) {
1590
+ Logger({
1591
+ level: "WARN",
1592
+ message: "Response Validation Warnnings for getDomains",
1593
+ });
1594
+ Logger({ level: "WARN", message: res_error });
1595
+ }
1596
+
1597
+ return response;
801
1598
  }
802
1599
 
803
1600
  /**
804
1601
  * @param {Object} arg - Arg object.
805
1602
  * @param {DomainAddRequest} arg.body
1603
+ * @returns {Promise<Domain>} - Success response
806
1604
  * @summary: Add new domain to application
807
1605
  * @description: Add new domain to application.
808
1606
  */
809
- addDomain({ body } = {}) {
1607
+ async addDomain({ body } = {}) {
810
1608
  const { error } = ConfigurationValidator.addDomain().validate(
811
1609
  {
812
1610
  body,
@@ -817,24 +1615,55 @@ class Configuration {
817
1615
  return Promise.reject(new FDKClientValidationError(error));
818
1616
  }
819
1617
 
1618
+ // Showing warrnings if extra unknown parameters are found
1619
+ const { error: warrning } = ConfigurationValidator.addDomain().validate(
1620
+ {
1621
+ body,
1622
+ },
1623
+ { abortEarly: false, allowUnknown: false }
1624
+ );
1625
+ if (warrning) {
1626
+ Logger({
1627
+ level: "WARN",
1628
+ message: "Parameter Validation warrnings for addDomain",
1629
+ });
1630
+ Logger({ level: "WARN", message: warrning });
1631
+ }
1632
+
820
1633
  const query_params = {};
821
1634
 
822
- return PlatformAPIClient.execute(
1635
+ const response = await PlatformAPIClient.execute(
823
1636
  this.config,
824
1637
  "post",
825
1638
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain`,
826
1639
  query_params,
827
1640
  body
828
1641
  );
1642
+
1643
+ const { error: res_error } = ConfigurationModel.Domain().validate(
1644
+ response,
1645
+ { abortEarly: false, allowUnknown: false }
1646
+ );
1647
+
1648
+ if (res_error) {
1649
+ Logger({
1650
+ level: "WARN",
1651
+ message: "Response Validation Warnnings for addDomain",
1652
+ });
1653
+ Logger({ level: "WARN", message: res_error });
1654
+ }
1655
+
1656
+ return response;
829
1657
  }
830
1658
 
831
1659
  /**
832
1660
  * @param {Object} arg - Arg object.
833
1661
  * @param {string} arg.id - Domain _id
1662
+ * @returns {Promise<SuccessMessageResponse>} - Success response
834
1663
  * @summary: Remove attached domain
835
1664
  * @description: Remove attached domain.
836
1665
  */
837
- removeDomainById({ id } = {}) {
1666
+ async removeDomainById({ id } = {}) {
838
1667
  const { error } = ConfigurationValidator.removeDomainById().validate(
839
1668
  {
840
1669
  id,
@@ -845,24 +1674,59 @@ class Configuration {
845
1674
  return Promise.reject(new FDKClientValidationError(error));
846
1675
  }
847
1676
 
1677
+ // Showing warrnings if extra unknown parameters are found
1678
+ const {
1679
+ error: warrning,
1680
+ } = ConfigurationValidator.removeDomainById().validate(
1681
+ {
1682
+ id,
1683
+ },
1684
+ { abortEarly: false, allowUnknown: false }
1685
+ );
1686
+ if (warrning) {
1687
+ Logger({
1688
+ level: "WARN",
1689
+ message: "Parameter Validation warrnings for removeDomainById",
1690
+ });
1691
+ Logger({ level: "WARN", message: warrning });
1692
+ }
1693
+
848
1694
  const query_params = {};
849
1695
 
850
- return PlatformAPIClient.execute(
1696
+ const response = await PlatformAPIClient.execute(
851
1697
  this.config,
852
1698
  "delete",
853
1699
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/${id}`,
854
1700
  query_params,
855
1701
  undefined
856
1702
  );
1703
+
1704
+ const {
1705
+ error: res_error,
1706
+ } = ConfigurationModel.SuccessMessageResponse().validate(response, {
1707
+ abortEarly: false,
1708
+ allowUnknown: false,
1709
+ });
1710
+
1711
+ if (res_error) {
1712
+ Logger({
1713
+ level: "WARN",
1714
+ message: "Response Validation Warnnings for removeDomainById",
1715
+ });
1716
+ Logger({ level: "WARN", message: res_error });
1717
+ }
1718
+
1719
+ return response;
857
1720
  }
858
1721
 
859
1722
  /**
860
1723
  * @param {Object} arg - Arg object.
861
1724
  * @param {UpdateDomainTypeRequest} arg.body
1725
+ * @returns {Promise<DomainsResponse>} - Success response
862
1726
  * @summary: Change domain type
863
1727
  * @description: Change a domain to Primary or Shortlink domain
864
1728
  */
865
- changeDomainType({ body } = {}) {
1729
+ async changeDomainType({ body } = {}) {
866
1730
  const { error } = ConfigurationValidator.changeDomainType().validate(
867
1731
  {
868
1732
  body,
@@ -873,24 +1737,59 @@ class Configuration {
873
1737
  return Promise.reject(new FDKClientValidationError(error));
874
1738
  }
875
1739
 
1740
+ // Showing warrnings if extra unknown parameters are found
1741
+ const {
1742
+ error: warrning,
1743
+ } = ConfigurationValidator.changeDomainType().validate(
1744
+ {
1745
+ body,
1746
+ },
1747
+ { abortEarly: false, allowUnknown: false }
1748
+ );
1749
+ if (warrning) {
1750
+ Logger({
1751
+ level: "WARN",
1752
+ message: "Parameter Validation warrnings for changeDomainType",
1753
+ });
1754
+ Logger({ level: "WARN", message: warrning });
1755
+ }
1756
+
876
1757
  const query_params = {};
877
1758
 
878
- return PlatformAPIClient.execute(
1759
+ const response = await PlatformAPIClient.execute(
879
1760
  this.config,
880
1761
  "post",
881
1762
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/set-domain`,
882
1763
  query_params,
883
1764
  body
884
1765
  );
1766
+
1767
+ const {
1768
+ error: res_error,
1769
+ } = ConfigurationModel.DomainsResponse().validate(response, {
1770
+ abortEarly: false,
1771
+ allowUnknown: false,
1772
+ });
1773
+
1774
+ if (res_error) {
1775
+ Logger({
1776
+ level: "WARN",
1777
+ message: "Response Validation Warnnings for changeDomainType",
1778
+ });
1779
+ Logger({ level: "WARN", message: res_error });
1780
+ }
1781
+
1782
+ return response;
885
1783
  }
886
1784
 
887
1785
  /**
888
1786
  * @param {Object} arg - Arg object.
889
1787
  * @param {DomainStatusRequest} arg.body
1788
+ * @returns {Promise<DomainStatusResponse>} - Success response
890
1789
  * @summary: Get domain connected status.
891
1790
  * @description: Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers.
892
1791
  */
893
- getDomainStatus({ body } = {}) {
1792
+ async getDomainStatus({ body } = {}) {
894
1793
  const { error } = ConfigurationValidator.getDomainStatus().validate(
895
1794
  {
896
1795
  body,
@@ -901,23 +1800,58 @@ class Configuration {
901
1800
  return Promise.reject(new FDKClientValidationError(error));
902
1801
  }
903
1802
 
1803
+ // Showing warrnings if extra unknown parameters are found
1804
+ const {
1805
+ error: warrning,
1806
+ } = ConfigurationValidator.getDomainStatus().validate(
1807
+ {
1808
+ body,
1809
+ },
1810
+ { abortEarly: false, allowUnknown: false }
1811
+ );
1812
+ if (warrning) {
1813
+ Logger({
1814
+ level: "WARN",
1815
+ message: "Parameter Validation warrnings for getDomainStatus",
1816
+ });
1817
+ Logger({ level: "WARN", message: warrning });
1818
+ }
1819
+
904
1820
  const query_params = {};
905
1821
 
906
- return PlatformAPIClient.execute(
1822
+ const response = await PlatformAPIClient.execute(
907
1823
  this.config,
908
1824
  "post",
909
1825
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/domain-status`,
910
1826
  query_params,
911
1827
  body
912
1828
  );
1829
+
1830
+ const {
1831
+ error: res_error,
1832
+ } = ConfigurationModel.DomainStatusResponse().validate(response, {
1833
+ abortEarly: false,
1834
+ allowUnknown: false,
1835
+ });
1836
+
1837
+ if (res_error) {
1838
+ Logger({
1839
+ level: "WARN",
1840
+ message: "Response Validation Warnnings for getDomainStatus",
1841
+ });
1842
+ Logger({ level: "WARN", message: res_error });
1843
+ }
1844
+
1845
+ return response;
913
1846
  }
914
1847
 
915
1848
  /**
916
1849
  * @param {Object} arg - Arg object.
1850
+ * @returns {Promise<Application>} - Success response
917
1851
  * @summary: Get application data from id
918
1852
  * @description: Get application data from id
919
1853
  */
920
- getApplicationById({} = {}) {
1854
+ async getApplicationById({} = {}) {
921
1855
  const { error } = ConfigurationValidator.getApplicationById().validate(
922
1856
  {},
923
1857
  { abortEarly: false, allowUnknown: true }
@@ -926,15 +1860,47 @@ class Configuration {
926
1860
  return Promise.reject(new FDKClientValidationError(error));
927
1861
  }
928
1862
 
1863
+ // Showing warrnings if extra unknown parameters are found
1864
+ const {
1865
+ error: warrning,
1866
+ } = ConfigurationValidator.getApplicationById().validate(
1867
+ {},
1868
+ { abortEarly: false, allowUnknown: false }
1869
+ );
1870
+ if (warrning) {
1871
+ Logger({
1872
+ level: "WARN",
1873
+ message: "Parameter Validation warrnings for getApplicationById",
1874
+ });
1875
+ Logger({ level: "WARN", message: warrning });
1876
+ }
1877
+
929
1878
  const query_params = {};
930
1879
 
931
- return PlatformAPIClient.execute(
1880
+ const response = await PlatformAPIClient.execute(
932
1881
  this.config,
933
1882
  "get",
934
1883
  `/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}`,
935
1884
  query_params,
936
1885
  undefined
937
1886
  );
1887
+
1888
+ const {
1889
+ error: res_error,
1890
+ } = ConfigurationModel.Application().validate(response, {
1891
+ abortEarly: false,
1892
+ allowUnknown: false,
1893
+ });
1894
+
1895
+ if (res_error) {
1896
+ Logger({
1897
+ level: "WARN",
1898
+ message: "Response Validation Warnnings for getApplicationById",
1899
+ });
1900
+ Logger({ level: "WARN", message: res_error });
1901
+ }
1902
+
1903
+ return response;
938
1904
  }
939
1905
  }
940
1906
  module.exports = Configuration;