@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 UserValidator = require("./UserApplicationValidator");
6
+ const UserModel = require("./UserApplicationModel");
7
+ const { Logger } = require("./../../common/Logger");
6
8
 
7
9
  class User {
8
10
  constructor(_conf) {
@@ -89,7 +91,7 @@ class User {
89
91
  * @summary: Login or Register using Facebook
90
92
  * @description: Use this API to login or register using Facebook credentials.
91
93
  */
92
- loginWithFacebook({ body, platform } = {}) {
94
+ async loginWithFacebook({ body, platform } = {}) {
93
95
  const { error } = UserValidator.loginWithFacebook().validate(
94
96
  { body, platform },
95
97
  { abortEarly: false, allowUnknown: true }
@@ -97,12 +99,26 @@ class User {
97
99
  if (error) {
98
100
  return Promise.reject(new FDKClientValidationError(error));
99
101
  }
102
+
103
+ // Showing warrnings if extra unknown parameters are found
104
+ const { error: warrning } = UserValidator.loginWithFacebook().validate(
105
+ { body, platform },
106
+ { abortEarly: false, allowUnknown: false }
107
+ );
108
+ if (warrning) {
109
+ Logger({
110
+ level: "WARN",
111
+ message: "Parameter Validation warrnings for loginWithFacebook",
112
+ });
113
+ Logger({ level: "WARN", message: warrning });
114
+ }
115
+
100
116
  const query_params = {};
101
117
  query_params["platform"] = platform;
102
118
 
103
119
  const xHeaders = {};
104
120
 
105
- return APIClient.execute(
121
+ const response = await APIClient.execute(
106
122
  this._conf,
107
123
  "post",
108
124
  constructUrl({
@@ -113,6 +129,21 @@ class User {
113
129
  body,
114
130
  xHeaders
115
131
  );
132
+
133
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
134
+ abortEarly: false,
135
+ allowUnknown: false,
136
+ });
137
+
138
+ if (res_error) {
139
+ Logger({
140
+ level: "WARN",
141
+ message: "Response Validation Warnnings for loginWithFacebook",
142
+ });
143
+ Logger({ level: "WARN", message: res_error });
144
+ }
145
+
146
+ return response;
116
147
  }
117
148
 
118
149
  /**
@@ -123,7 +154,7 @@ class User {
123
154
  * @summary: Login or Register using Google
124
155
  * @description: Use this API to login or register using Google Account credentials.
125
156
  */
126
- loginWithGoogle({ body, platform } = {}) {
157
+ async loginWithGoogle({ body, platform } = {}) {
127
158
  const { error } = UserValidator.loginWithGoogle().validate(
128
159
  { body, platform },
129
160
  { abortEarly: false, allowUnknown: true }
@@ -131,12 +162,26 @@ class User {
131
162
  if (error) {
132
163
  return Promise.reject(new FDKClientValidationError(error));
133
164
  }
165
+
166
+ // Showing warrnings if extra unknown parameters are found
167
+ const { error: warrning } = UserValidator.loginWithGoogle().validate(
168
+ { body, platform },
169
+ { abortEarly: false, allowUnknown: false }
170
+ );
171
+ if (warrning) {
172
+ Logger({
173
+ level: "WARN",
174
+ message: "Parameter Validation warrnings for loginWithGoogle",
175
+ });
176
+ Logger({ level: "WARN", message: warrning });
177
+ }
178
+
134
179
  const query_params = {};
135
180
  query_params["platform"] = platform;
136
181
 
137
182
  const xHeaders = {};
138
183
 
139
- return APIClient.execute(
184
+ const response = await APIClient.execute(
140
185
  this._conf,
141
186
  "post",
142
187
  constructUrl({
@@ -147,6 +192,21 @@ class User {
147
192
  body,
148
193
  xHeaders
149
194
  );
195
+
196
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
197
+ abortEarly: false,
198
+ allowUnknown: false,
199
+ });
200
+
201
+ if (res_error) {
202
+ Logger({
203
+ level: "WARN",
204
+ message: "Response Validation Warnnings for loginWithGoogle",
205
+ });
206
+ Logger({ level: "WARN", message: res_error });
207
+ }
208
+
209
+ return response;
150
210
  }
151
211
 
152
212
  /**
@@ -157,7 +217,7 @@ class User {
157
217
  * @summary: Login or Register using Google on Android
158
218
  * @description: Use this API to login or register in Android app using Google Account credentials.
159
219
  */
160
- loginWithGoogleAndroid({ body, platform } = {}) {
220
+ async loginWithGoogleAndroid({ body, platform } = {}) {
161
221
  const { error } = UserValidator.loginWithGoogleAndroid().validate(
162
222
  { body, platform },
163
223
  { abortEarly: false, allowUnknown: true }
@@ -165,12 +225,26 @@ class User {
165
225
  if (error) {
166
226
  return Promise.reject(new FDKClientValidationError(error));
167
227
  }
228
+
229
+ // Showing warrnings if extra unknown parameters are found
230
+ const { error: warrning } = UserValidator.loginWithGoogleAndroid().validate(
231
+ { body, platform },
232
+ { abortEarly: false, allowUnknown: false }
233
+ );
234
+ if (warrning) {
235
+ Logger({
236
+ level: "WARN",
237
+ message: "Parameter Validation warrnings for loginWithGoogleAndroid",
238
+ });
239
+ Logger({ level: "WARN", message: warrning });
240
+ }
241
+
168
242
  const query_params = {};
169
243
  query_params["platform"] = platform;
170
244
 
171
245
  const xHeaders = {};
172
246
 
173
- return APIClient.execute(
247
+ const response = await APIClient.execute(
174
248
  this._conf,
175
249
  "post",
176
250
  constructUrl({
@@ -181,6 +255,21 @@ class User {
181
255
  body,
182
256
  xHeaders
183
257
  );
258
+
259
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
260
+ abortEarly: false,
261
+ allowUnknown: false,
262
+ });
263
+
264
+ if (res_error) {
265
+ Logger({
266
+ level: "WARN",
267
+ message: "Response Validation Warnnings for loginWithGoogleAndroid",
268
+ });
269
+ Logger({ level: "WARN", message: res_error });
270
+ }
271
+
272
+ return response;
184
273
  }
185
274
 
186
275
  /**
@@ -191,7 +280,7 @@ class User {
191
280
  * @summary: Login or Register using Google on iOS
192
281
  * @description: Use this API to login or register in iOS app using Google Account credentials.
193
282
  */
194
- loginWithGoogleIOS({ body, platform } = {}) {
283
+ async loginWithGoogleIOS({ body, platform } = {}) {
195
284
  const { error } = UserValidator.loginWithGoogleIOS().validate(
196
285
  { body, platform },
197
286
  { abortEarly: false, allowUnknown: true }
@@ -199,12 +288,26 @@ class User {
199
288
  if (error) {
200
289
  return Promise.reject(new FDKClientValidationError(error));
201
290
  }
291
+
292
+ // Showing warrnings if extra unknown parameters are found
293
+ const { error: warrning } = UserValidator.loginWithGoogleIOS().validate(
294
+ { body, platform },
295
+ { abortEarly: false, allowUnknown: false }
296
+ );
297
+ if (warrning) {
298
+ Logger({
299
+ level: "WARN",
300
+ message: "Parameter Validation warrnings for loginWithGoogleIOS",
301
+ });
302
+ Logger({ level: "WARN", message: warrning });
303
+ }
304
+
202
305
  const query_params = {};
203
306
  query_params["platform"] = platform;
204
307
 
205
308
  const xHeaders = {};
206
309
 
207
- return APIClient.execute(
310
+ const response = await APIClient.execute(
208
311
  this._conf,
209
312
  "post",
210
313
  constructUrl({
@@ -215,6 +318,21 @@ class User {
215
318
  body,
216
319
  xHeaders
217
320
  );
321
+
322
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
323
+ abortEarly: false,
324
+ allowUnknown: false,
325
+ });
326
+
327
+ if (res_error) {
328
+ Logger({
329
+ level: "WARN",
330
+ message: "Response Validation Warnnings for loginWithGoogleIOS",
331
+ });
332
+ Logger({ level: "WARN", message: res_error });
333
+ }
334
+
335
+ return response;
218
336
  }
219
337
 
220
338
  /**
@@ -225,7 +343,7 @@ class User {
225
343
  * @summary: Login or Register using Apple on iOS
226
344
  * @description: Use this API to login or register in iOS app using Apple Account credentials.
227
345
  */
228
- loginWithAppleIOS({ body, platform } = {}) {
346
+ async loginWithAppleIOS({ body, platform } = {}) {
229
347
  const { error } = UserValidator.loginWithAppleIOS().validate(
230
348
  { body, platform },
231
349
  { abortEarly: false, allowUnknown: true }
@@ -233,12 +351,26 @@ class User {
233
351
  if (error) {
234
352
  return Promise.reject(new FDKClientValidationError(error));
235
353
  }
354
+
355
+ // Showing warrnings if extra unknown parameters are found
356
+ const { error: warrning } = UserValidator.loginWithAppleIOS().validate(
357
+ { body, platform },
358
+ { abortEarly: false, allowUnknown: false }
359
+ );
360
+ if (warrning) {
361
+ Logger({
362
+ level: "WARN",
363
+ message: "Parameter Validation warrnings for loginWithAppleIOS",
364
+ });
365
+ Logger({ level: "WARN", message: warrning });
366
+ }
367
+
236
368
  const query_params = {};
237
369
  query_params["platform"] = platform;
238
370
 
239
371
  const xHeaders = {};
240
372
 
241
- return APIClient.execute(
373
+ const response = await APIClient.execute(
242
374
  this._conf,
243
375
  "post",
244
376
  constructUrl({
@@ -249,6 +381,21 @@ class User {
249
381
  body,
250
382
  xHeaders
251
383
  );
384
+
385
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
386
+ abortEarly: false,
387
+ allowUnknown: false,
388
+ });
389
+
390
+ if (res_error) {
391
+ Logger({
392
+ level: "WARN",
393
+ message: "Response Validation Warnnings for loginWithAppleIOS",
394
+ });
395
+ Logger({ level: "WARN", message: res_error });
396
+ }
397
+
398
+ return response;
252
399
  }
253
400
 
254
401
  /**
@@ -259,7 +406,7 @@ class User {
259
406
  * @summary: Login or Register with OTP
260
407
  * @description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS.
261
408
  */
262
- loginWithOTP({ body, platform } = {}) {
409
+ async loginWithOTP({ body, platform } = {}) {
263
410
  const { error } = UserValidator.loginWithOTP().validate(
264
411
  { body, platform },
265
412
  { abortEarly: false, allowUnknown: true }
@@ -267,12 +414,26 @@ class User {
267
414
  if (error) {
268
415
  return Promise.reject(new FDKClientValidationError(error));
269
416
  }
417
+
418
+ // Showing warrnings if extra unknown parameters are found
419
+ const { error: warrning } = UserValidator.loginWithOTP().validate(
420
+ { body, platform },
421
+ { abortEarly: false, allowUnknown: false }
422
+ );
423
+ if (warrning) {
424
+ Logger({
425
+ level: "WARN",
426
+ message: "Parameter Validation warrnings for loginWithOTP",
427
+ });
428
+ Logger({ level: "WARN", message: warrning });
429
+ }
430
+
270
431
  const query_params = {};
271
432
  query_params["platform"] = platform;
272
433
 
273
434
  const xHeaders = {};
274
435
 
275
- return APIClient.execute(
436
+ const response = await APIClient.execute(
276
437
  this._conf,
277
438
  "post",
278
439
  constructUrl({
@@ -283,6 +444,21 @@ class User {
283
444
  body,
284
445
  xHeaders
285
446
  );
447
+
448
+ const { error: res_error } = UserModel.SendOtpResponse().validate(
449
+ response,
450
+ { abortEarly: false, allowUnknown: false }
451
+ );
452
+
453
+ if (res_error) {
454
+ Logger({
455
+ level: "WARN",
456
+ message: "Response Validation Warnnings for loginWithOTP",
457
+ });
458
+ Logger({ level: "WARN", message: res_error });
459
+ }
460
+
461
+ return response;
286
462
  }
287
463
 
288
464
  /**
@@ -292,7 +468,7 @@ class User {
292
468
  * @summary: Login or Register with password
293
469
  * @description: Use this API to login or register using an email address and password.
294
470
  */
295
- loginWithEmailAndPassword({ body } = {}) {
471
+ async loginWithEmailAndPassword({ body } = {}) {
296
472
  const { error } = UserValidator.loginWithEmailAndPassword().validate(
297
473
  { body },
298
474
  { abortEarly: false, allowUnknown: true }
@@ -300,11 +476,27 @@ class User {
300
476
  if (error) {
301
477
  return Promise.reject(new FDKClientValidationError(error));
302
478
  }
479
+
480
+ // Showing warrnings if extra unknown parameters are found
481
+ const {
482
+ error: warrning,
483
+ } = UserValidator.loginWithEmailAndPassword().validate(
484
+ { body },
485
+ { abortEarly: false, allowUnknown: false }
486
+ );
487
+ if (warrning) {
488
+ Logger({
489
+ level: "WARN",
490
+ message: "Parameter Validation warrnings for loginWithEmailAndPassword",
491
+ });
492
+ Logger({ level: "WARN", message: warrning });
493
+ }
494
+
303
495
  const query_params = {};
304
496
 
305
497
  const xHeaders = {};
306
498
 
307
- return APIClient.execute(
499
+ const response = await APIClient.execute(
308
500
  this._conf,
309
501
  "post",
310
502
  constructUrl({
@@ -315,6 +507,21 @@ class User {
315
507
  body,
316
508
  xHeaders
317
509
  );
510
+
511
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
512
+ abortEarly: false,
513
+ allowUnknown: false,
514
+ });
515
+
516
+ if (res_error) {
517
+ Logger({
518
+ level: "WARN",
519
+ message: "Response Validation Warnnings for loginWithEmailAndPassword",
520
+ });
521
+ Logger({ level: "WARN", message: res_error });
522
+ }
523
+
524
+ return response;
318
525
  }
319
526
 
320
527
  /**
@@ -325,7 +532,7 @@ class User {
325
532
  * @summary: Reset Password
326
533
  * @description: Use this API to reset a password using the link sent on email.
327
534
  */
328
- sendResetPasswordEmail({ body, platform } = {}) {
535
+ async sendResetPasswordEmail({ body, platform } = {}) {
329
536
  const { error } = UserValidator.sendResetPasswordEmail().validate(
330
537
  { body, platform },
331
538
  { abortEarly: false, allowUnknown: true }
@@ -333,12 +540,26 @@ class User {
333
540
  if (error) {
334
541
  return Promise.reject(new FDKClientValidationError(error));
335
542
  }
543
+
544
+ // Showing warrnings if extra unknown parameters are found
545
+ const { error: warrning } = UserValidator.sendResetPasswordEmail().validate(
546
+ { body, platform },
547
+ { abortEarly: false, allowUnknown: false }
548
+ );
549
+ if (warrning) {
550
+ Logger({
551
+ level: "WARN",
552
+ message: "Parameter Validation warrnings for sendResetPasswordEmail",
553
+ });
554
+ Logger({ level: "WARN", message: warrning });
555
+ }
556
+
336
557
  const query_params = {};
337
558
  query_params["platform"] = platform;
338
559
 
339
560
  const xHeaders = {};
340
561
 
341
- return APIClient.execute(
562
+ const response = await APIClient.execute(
342
563
  this._conf,
343
564
  "post",
344
565
  constructUrl({
@@ -349,6 +570,23 @@ class User {
349
570
  body,
350
571
  xHeaders
351
572
  );
573
+
574
+ const {
575
+ error: res_error,
576
+ } = UserModel.ResetPasswordSuccess().validate(response, {
577
+ abortEarly: false,
578
+ allowUnknown: false,
579
+ });
580
+
581
+ if (res_error) {
582
+ Logger({
583
+ level: "WARN",
584
+ message: "Response Validation Warnnings for sendResetPasswordEmail",
585
+ });
586
+ Logger({ level: "WARN", message: res_error });
587
+ }
588
+
589
+ return response;
352
590
  }
353
591
 
354
592
  /**
@@ -359,7 +597,7 @@ class User {
359
597
  * @summary: Reset Password
360
598
  * @description: Use this API to reset a password using the link sent on mobile.
361
599
  */
362
- sendResetPasswordMobile({ body, platform } = {}) {
600
+ async sendResetPasswordMobile({ body, platform } = {}) {
363
601
  const { error } = UserValidator.sendResetPasswordMobile().validate(
364
602
  { body, platform },
365
603
  { abortEarly: false, allowUnknown: true }
@@ -367,12 +605,28 @@ class User {
367
605
  if (error) {
368
606
  return Promise.reject(new FDKClientValidationError(error));
369
607
  }
608
+
609
+ // Showing warrnings if extra unknown parameters are found
610
+ const {
611
+ error: warrning,
612
+ } = UserValidator.sendResetPasswordMobile().validate(
613
+ { body, platform },
614
+ { abortEarly: false, allowUnknown: false }
615
+ );
616
+ if (warrning) {
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Parameter Validation warrnings for sendResetPasswordMobile",
620
+ });
621
+ Logger({ level: "WARN", message: warrning });
622
+ }
623
+
370
624
  const query_params = {};
371
625
  query_params["platform"] = platform;
372
626
 
373
627
  const xHeaders = {};
374
628
 
375
- return APIClient.execute(
629
+ const response = await APIClient.execute(
376
630
  this._conf,
377
631
  "post",
378
632
  constructUrl({
@@ -383,6 +637,23 @@ class User {
383
637
  body,
384
638
  xHeaders
385
639
  );
640
+
641
+ const {
642
+ error: res_error,
643
+ } = UserModel.ResetPasswordSuccess().validate(response, {
644
+ abortEarly: false,
645
+ allowUnknown: false,
646
+ });
647
+
648
+ if (res_error) {
649
+ Logger({
650
+ level: "WARN",
651
+ message: "Response Validation Warnnings for sendResetPasswordMobile",
652
+ });
653
+ Logger({ level: "WARN", message: res_error });
654
+ }
655
+
656
+ return response;
386
657
  }
387
658
 
388
659
  /**
@@ -392,7 +663,7 @@ class User {
392
663
  * @summary: Forgot Password
393
664
  * @description: Use this API to reset a password using the code sent on email or SMS.
394
665
  */
395
- forgotPassword({ body } = {}) {
666
+ async forgotPassword({ body } = {}) {
396
667
  const { error } = UserValidator.forgotPassword().validate(
397
668
  { body },
398
669
  { abortEarly: false, allowUnknown: true }
@@ -400,11 +671,25 @@ class User {
400
671
  if (error) {
401
672
  return Promise.reject(new FDKClientValidationError(error));
402
673
  }
674
+
675
+ // Showing warrnings if extra unknown parameters are found
676
+ const { error: warrning } = UserValidator.forgotPassword().validate(
677
+ { body },
678
+ { abortEarly: false, allowUnknown: false }
679
+ );
680
+ if (warrning) {
681
+ Logger({
682
+ level: "WARN",
683
+ message: "Parameter Validation warrnings for forgotPassword",
684
+ });
685
+ Logger({ level: "WARN", message: warrning });
686
+ }
687
+
403
688
  const query_params = {};
404
689
 
405
690
  const xHeaders = {};
406
691
 
407
- return APIClient.execute(
692
+ const response = await APIClient.execute(
408
693
  this._conf,
409
694
  "post",
410
695
  constructUrl({
@@ -415,6 +700,21 @@ class User {
415
700
  body,
416
701
  xHeaders
417
702
  );
703
+
704
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
705
+ abortEarly: false,
706
+ allowUnknown: false,
707
+ });
708
+
709
+ if (res_error) {
710
+ Logger({
711
+ level: "WARN",
712
+ message: "Response Validation Warnnings for forgotPassword",
713
+ });
714
+ Logger({ level: "WARN", message: res_error });
715
+ }
716
+
717
+ return response;
418
718
  }
419
719
 
420
720
  /**
@@ -424,7 +724,7 @@ class User {
424
724
  * @summary: Reset Password using token
425
725
  * @description: Use this API to send code to reset password.
426
726
  */
427
- sendResetToken({ body } = {}) {
727
+ async sendResetToken({ body } = {}) {
428
728
  const { error } = UserValidator.sendResetToken().validate(
429
729
  { body },
430
730
  { abortEarly: false, allowUnknown: true }
@@ -432,11 +732,25 @@ class User {
432
732
  if (error) {
433
733
  return Promise.reject(new FDKClientValidationError(error));
434
734
  }
735
+
736
+ // Showing warrnings if extra unknown parameters are found
737
+ const { error: warrning } = UserValidator.sendResetToken().validate(
738
+ { body },
739
+ { abortEarly: false, allowUnknown: false }
740
+ );
741
+ if (warrning) {
742
+ Logger({
743
+ level: "WARN",
744
+ message: "Parameter Validation warrnings for sendResetToken",
745
+ });
746
+ Logger({ level: "WARN", message: warrning });
747
+ }
748
+
435
749
  const query_params = {};
436
750
 
437
751
  const xHeaders = {};
438
752
 
439
- return APIClient.execute(
753
+ const response = await APIClient.execute(
440
754
  this._conf,
441
755
  "post",
442
756
  constructUrl({
@@ -447,6 +761,23 @@ class User {
447
761
  body,
448
762
  xHeaders
449
763
  );
764
+
765
+ const {
766
+ error: res_error,
767
+ } = UserModel.ResetPasswordSuccess().validate(response, {
768
+ abortEarly: false,
769
+ allowUnknown: false,
770
+ });
771
+
772
+ if (res_error) {
773
+ Logger({
774
+ level: "WARN",
775
+ message: "Response Validation Warnnings for sendResetToken",
776
+ });
777
+ Logger({ level: "WARN", message: res_error });
778
+ }
779
+
780
+ return response;
450
781
  }
451
782
 
452
783
  /**
@@ -456,7 +787,7 @@ class User {
456
787
  * @summary: Login or Register with token
457
788
  * @description: Use this API to login or register using a token for authentication.
458
789
  */
459
- loginWithToken({ body } = {}) {
790
+ async loginWithToken({ body } = {}) {
460
791
  const { error } = UserValidator.loginWithToken().validate(
461
792
  { body },
462
793
  { abortEarly: false, allowUnknown: true }
@@ -464,11 +795,25 @@ class User {
464
795
  if (error) {
465
796
  return Promise.reject(new FDKClientValidationError(error));
466
797
  }
798
+
799
+ // Showing warrnings if extra unknown parameters are found
800
+ const { error: warrning } = UserValidator.loginWithToken().validate(
801
+ { body },
802
+ { abortEarly: false, allowUnknown: false }
803
+ );
804
+ if (warrning) {
805
+ Logger({
806
+ level: "WARN",
807
+ message: "Parameter Validation warrnings for loginWithToken",
808
+ });
809
+ Logger({ level: "WARN", message: warrning });
810
+ }
811
+
467
812
  const query_params = {};
468
813
 
469
814
  const xHeaders = {};
470
815
 
471
- return APIClient.execute(
816
+ const response = await APIClient.execute(
472
817
  this._conf,
473
818
  "post",
474
819
  constructUrl({
@@ -479,6 +824,21 @@ class User {
479
824
  body,
480
825
  xHeaders
481
826
  );
827
+
828
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
829
+ abortEarly: false,
830
+ allowUnknown: false,
831
+ });
832
+
833
+ if (res_error) {
834
+ Logger({
835
+ level: "WARN",
836
+ message: "Response Validation Warnnings for loginWithToken",
837
+ });
838
+ Logger({ level: "WARN", message: res_error });
839
+ }
840
+
841
+ return response;
482
842
  }
483
843
 
484
844
  /**
@@ -489,7 +849,7 @@ class User {
489
849
  * @summary: Registration using a form
490
850
  * @description: Use this API to perform user registration by sending form data in the request body.
491
851
  */
492
- registerWithForm({ body, platform } = {}) {
852
+ async registerWithForm({ body, platform } = {}) {
493
853
  const { error } = UserValidator.registerWithForm().validate(
494
854
  { body, platform },
495
855
  { abortEarly: false, allowUnknown: true }
@@ -497,12 +857,26 @@ class User {
497
857
  if (error) {
498
858
  return Promise.reject(new FDKClientValidationError(error));
499
859
  }
860
+
861
+ // Showing warrnings if extra unknown parameters are found
862
+ const { error: warrning } = UserValidator.registerWithForm().validate(
863
+ { body, platform },
864
+ { abortEarly: false, allowUnknown: false }
865
+ );
866
+ if (warrning) {
867
+ Logger({
868
+ level: "WARN",
869
+ message: "Parameter Validation warrnings for registerWithForm",
870
+ });
871
+ Logger({ level: "WARN", message: warrning });
872
+ }
873
+
500
874
  const query_params = {};
501
875
  query_params["platform"] = platform;
502
876
 
503
877
  const xHeaders = {};
504
878
 
505
- return APIClient.execute(
879
+ const response = await APIClient.execute(
506
880
  this._conf,
507
881
  "post",
508
882
  constructUrl({
@@ -513,6 +887,23 @@ class User {
513
887
  body,
514
888
  xHeaders
515
889
  );
890
+
891
+ const {
892
+ error: res_error,
893
+ } = UserModel.RegisterFormSuccess().validate(response, {
894
+ abortEarly: false,
895
+ allowUnknown: false,
896
+ });
897
+
898
+ if (res_error) {
899
+ Logger({
900
+ level: "WARN",
901
+ message: "Response Validation Warnnings for registerWithForm",
902
+ });
903
+ Logger({ level: "WARN", message: res_error });
904
+ }
905
+
906
+ return response;
516
907
  }
517
908
 
518
909
  /**
@@ -522,7 +913,7 @@ class User {
522
913
  * @summary: Verify email
523
914
  * @description: Use this API to send a verification code to verify an email.
524
915
  */
525
- verifyEmail({ body } = {}) {
916
+ async verifyEmail({ body } = {}) {
526
917
  const { error } = UserValidator.verifyEmail().validate(
527
918
  { body },
528
919
  { abortEarly: false, allowUnknown: true }
@@ -530,11 +921,25 @@ class User {
530
921
  if (error) {
531
922
  return Promise.reject(new FDKClientValidationError(error));
532
923
  }
924
+
925
+ // Showing warrnings if extra unknown parameters are found
926
+ const { error: warrning } = UserValidator.verifyEmail().validate(
927
+ { body },
928
+ { abortEarly: false, allowUnknown: false }
929
+ );
930
+ if (warrning) {
931
+ Logger({
932
+ level: "WARN",
933
+ message: "Parameter Validation warrnings for verifyEmail",
934
+ });
935
+ Logger({ level: "WARN", message: warrning });
936
+ }
937
+
533
938
  const query_params = {};
534
939
 
535
940
  const xHeaders = {};
536
941
 
537
- return APIClient.execute(
942
+ const response = await APIClient.execute(
538
943
  this._conf,
539
944
  "post",
540
945
  constructUrl({
@@ -545,6 +950,23 @@ class User {
545
950
  body,
546
951
  xHeaders
547
952
  );
953
+
954
+ const {
955
+ error: res_error,
956
+ } = UserModel.VerifyEmailSuccess().validate(response, {
957
+ abortEarly: false,
958
+ allowUnknown: false,
959
+ });
960
+
961
+ if (res_error) {
962
+ Logger({
963
+ level: "WARN",
964
+ message: "Response Validation Warnnings for verifyEmail",
965
+ });
966
+ Logger({ level: "WARN", message: res_error });
967
+ }
968
+
969
+ return response;
548
970
  }
549
971
 
550
972
  /**
@@ -554,7 +976,7 @@ class User {
554
976
  * @summary: Verify mobile
555
977
  * @description: Use this API to send a verification code to verify a mobile number.
556
978
  */
557
- verifyMobile({ body } = {}) {
979
+ async verifyMobile({ body } = {}) {
558
980
  const { error } = UserValidator.verifyMobile().validate(
559
981
  { body },
560
982
  { abortEarly: false, allowUnknown: true }
@@ -562,11 +984,25 @@ class User {
562
984
  if (error) {
563
985
  return Promise.reject(new FDKClientValidationError(error));
564
986
  }
987
+
988
+ // Showing warrnings if extra unknown parameters are found
989
+ const { error: warrning } = UserValidator.verifyMobile().validate(
990
+ { body },
991
+ { abortEarly: false, allowUnknown: false }
992
+ );
993
+ if (warrning) {
994
+ Logger({
995
+ level: "WARN",
996
+ message: "Parameter Validation warrnings for verifyMobile",
997
+ });
998
+ Logger({ level: "WARN", message: warrning });
999
+ }
1000
+
565
1001
  const query_params = {};
566
1002
 
567
1003
  const xHeaders = {};
568
1004
 
569
- return APIClient.execute(
1005
+ const response = await APIClient.execute(
570
1006
  this._conf,
571
1007
  "post",
572
1008
  constructUrl({
@@ -577,6 +1013,23 @@ class User {
577
1013
  body,
578
1014
  xHeaders
579
1015
  );
1016
+
1017
+ const {
1018
+ error: res_error,
1019
+ } = UserModel.VerifyEmailSuccess().validate(response, {
1020
+ abortEarly: false,
1021
+ allowUnknown: false,
1022
+ });
1023
+
1024
+ if (res_error) {
1025
+ Logger({
1026
+ level: "WARN",
1027
+ message: "Response Validation Warnnings for verifyMobile",
1028
+ });
1029
+ Logger({ level: "WARN", message: res_error });
1030
+ }
1031
+
1032
+ return response;
580
1033
  }
581
1034
 
582
1035
  /**
@@ -585,7 +1038,7 @@ class User {
585
1038
  * @summary: Check password
586
1039
  * @description: Use this API to check if user has created a password for login.
587
1040
  */
588
- hasPassword({} = {}) {
1041
+ async hasPassword({} = {}) {
589
1042
  const { error } = UserValidator.hasPassword().validate(
590
1043
  {},
591
1044
  { abortEarly: false, allowUnknown: true }
@@ -593,11 +1046,25 @@ class User {
593
1046
  if (error) {
594
1047
  return Promise.reject(new FDKClientValidationError(error));
595
1048
  }
1049
+
1050
+ // Showing warrnings if extra unknown parameters are found
1051
+ const { error: warrning } = UserValidator.hasPassword().validate(
1052
+ {},
1053
+ { abortEarly: false, allowUnknown: false }
1054
+ );
1055
+ if (warrning) {
1056
+ Logger({
1057
+ level: "WARN",
1058
+ message: "Parameter Validation warrnings for hasPassword",
1059
+ });
1060
+ Logger({ level: "WARN", message: warrning });
1061
+ }
1062
+
596
1063
  const query_params = {};
597
1064
 
598
1065
  const xHeaders = {};
599
1066
 
600
- return APIClient.execute(
1067
+ const response = await APIClient.execute(
601
1068
  this._conf,
602
1069
  "get",
603
1070
  constructUrl({
@@ -608,6 +1075,23 @@ class User {
608
1075
  undefined,
609
1076
  xHeaders
610
1077
  );
1078
+
1079
+ const {
1080
+ error: res_error,
1081
+ } = UserModel.HasPasswordSuccess().validate(response, {
1082
+ abortEarly: false,
1083
+ allowUnknown: false,
1084
+ });
1085
+
1086
+ if (res_error) {
1087
+ Logger({
1088
+ level: "WARN",
1089
+ message: "Response Validation Warnnings for hasPassword",
1090
+ });
1091
+ Logger({ level: "WARN", message: res_error });
1092
+ }
1093
+
1094
+ return response;
611
1095
  }
612
1096
 
613
1097
  /**
@@ -617,7 +1101,7 @@ class User {
617
1101
  * @summary: Update user password
618
1102
  * @description: Use this API to update the password.
619
1103
  */
620
- updatePassword({ body } = {}) {
1104
+ async updatePassword({ body } = {}) {
621
1105
  const { error } = UserValidator.updatePassword().validate(
622
1106
  { body },
623
1107
  { abortEarly: false, allowUnknown: true }
@@ -625,11 +1109,25 @@ class User {
625
1109
  if (error) {
626
1110
  return Promise.reject(new FDKClientValidationError(error));
627
1111
  }
1112
+
1113
+ // Showing warrnings if extra unknown parameters are found
1114
+ const { error: warrning } = UserValidator.updatePassword().validate(
1115
+ { body },
1116
+ { abortEarly: false, allowUnknown: false }
1117
+ );
1118
+ if (warrning) {
1119
+ Logger({
1120
+ level: "WARN",
1121
+ message: "Parameter Validation warrnings for updatePassword",
1122
+ });
1123
+ Logger({ level: "WARN", message: warrning });
1124
+ }
1125
+
628
1126
  const query_params = {};
629
1127
 
630
1128
  const xHeaders = {};
631
1129
 
632
- return APIClient.execute(
1130
+ const response = await APIClient.execute(
633
1131
  this._conf,
634
1132
  "post",
635
1133
  constructUrl({
@@ -640,6 +1138,23 @@ class User {
640
1138
  body,
641
1139
  xHeaders
642
1140
  );
1141
+
1142
+ const {
1143
+ error: res_error,
1144
+ } = UserModel.VerifyEmailSuccess().validate(response, {
1145
+ abortEarly: false,
1146
+ allowUnknown: false,
1147
+ });
1148
+
1149
+ if (res_error) {
1150
+ Logger({
1151
+ level: "WARN",
1152
+ message: "Response Validation Warnnings for updatePassword",
1153
+ });
1154
+ Logger({ level: "WARN", message: res_error });
1155
+ }
1156
+
1157
+ return response;
643
1158
  }
644
1159
 
645
1160
  /**
@@ -649,7 +1164,7 @@ class User {
649
1164
  * @summary: verify otp and delete user
650
1165
  * @description: verify otp and delete user
651
1166
  */
652
- deleteUser({ body } = {}) {
1167
+ async deleteUser({ body } = {}) {
653
1168
  const { error } = UserValidator.deleteUser().validate(
654
1169
  { body },
655
1170
  { abortEarly: false, allowUnknown: true }
@@ -657,11 +1172,25 @@ class User {
657
1172
  if (error) {
658
1173
  return Promise.reject(new FDKClientValidationError(error));
659
1174
  }
1175
+
1176
+ // Showing warrnings if extra unknown parameters are found
1177
+ const { error: warrning } = UserValidator.deleteUser().validate(
1178
+ { body },
1179
+ { abortEarly: false, allowUnknown: false }
1180
+ );
1181
+ if (warrning) {
1182
+ Logger({
1183
+ level: "WARN",
1184
+ message: "Parameter Validation warrnings for deleteUser",
1185
+ });
1186
+ Logger({ level: "WARN", message: warrning });
1187
+ }
1188
+
660
1189
  const query_params = {};
661
1190
 
662
1191
  const xHeaders = {};
663
1192
 
664
- return APIClient.execute(
1193
+ const response = await APIClient.execute(
665
1194
  this._conf,
666
1195
  "post",
667
1196
  constructUrl({
@@ -672,6 +1201,23 @@ class User {
672
1201
  body,
673
1202
  xHeaders
674
1203
  );
1204
+
1205
+ const {
1206
+ error: res_error,
1207
+ } = UserModel.DeleteUserSuccess().validate(response, {
1208
+ abortEarly: false,
1209
+ allowUnknown: false,
1210
+ });
1211
+
1212
+ if (res_error) {
1213
+ Logger({
1214
+ level: "WARN",
1215
+ message: "Response Validation Warnnings for deleteUser",
1216
+ });
1217
+ Logger({ level: "WARN", message: res_error });
1218
+ }
1219
+
1220
+ return response;
675
1221
  }
676
1222
 
677
1223
  /**
@@ -680,7 +1226,7 @@ class User {
680
1226
  * @summary: Logs out currently logged in user
681
1227
  * @description: Use this API to check to logout a user from the app.
682
1228
  */
683
- logout({} = {}) {
1229
+ async logout({} = {}) {
684
1230
  const { error } = UserValidator.logout().validate(
685
1231
  {},
686
1232
  { abortEarly: false, allowUnknown: true }
@@ -688,11 +1234,25 @@ class User {
688
1234
  if (error) {
689
1235
  return Promise.reject(new FDKClientValidationError(error));
690
1236
  }
1237
+
1238
+ // Showing warrnings if extra unknown parameters are found
1239
+ const { error: warrning } = UserValidator.logout().validate(
1240
+ {},
1241
+ { abortEarly: false, allowUnknown: false }
1242
+ );
1243
+ if (warrning) {
1244
+ Logger({
1245
+ level: "WARN",
1246
+ message: "Parameter Validation warrnings for logout",
1247
+ });
1248
+ Logger({ level: "WARN", message: warrning });
1249
+ }
1250
+
691
1251
  const query_params = {};
692
1252
 
693
1253
  const xHeaders = {};
694
1254
 
695
- return APIClient.execute(
1255
+ const response = await APIClient.execute(
696
1256
  this._conf,
697
1257
  "get",
698
1258
  constructUrl({
@@ -703,6 +1263,21 @@ class User {
703
1263
  undefined,
704
1264
  xHeaders
705
1265
  );
1266
+
1267
+ const { error: res_error } = UserModel.LogoutSuccess().validate(response, {
1268
+ abortEarly: false,
1269
+ allowUnknown: false,
1270
+ });
1271
+
1272
+ if (res_error) {
1273
+ Logger({
1274
+ level: "WARN",
1275
+ message: "Response Validation Warnnings for logout",
1276
+ });
1277
+ Logger({ level: "WARN", message: res_error });
1278
+ }
1279
+
1280
+ return response;
706
1281
  }
707
1282
 
708
1283
  /**
@@ -713,7 +1288,7 @@ class User {
713
1288
  * @summary: Send OTP on mobile
714
1289
  * @description: Use this API to send an OTP to a mobile number.
715
1290
  */
716
- sendOTPOnMobile({ body, platform } = {}) {
1291
+ async sendOTPOnMobile({ body, platform } = {}) {
717
1292
  const { error } = UserValidator.sendOTPOnMobile().validate(
718
1293
  { body, platform },
719
1294
  { abortEarly: false, allowUnknown: true }
@@ -721,12 +1296,26 @@ class User {
721
1296
  if (error) {
722
1297
  return Promise.reject(new FDKClientValidationError(error));
723
1298
  }
1299
+
1300
+ // Showing warrnings if extra unknown parameters are found
1301
+ const { error: warrning } = UserValidator.sendOTPOnMobile().validate(
1302
+ { body, platform },
1303
+ { abortEarly: false, allowUnknown: false }
1304
+ );
1305
+ if (warrning) {
1306
+ Logger({
1307
+ level: "WARN",
1308
+ message: "Parameter Validation warrnings for sendOTPOnMobile",
1309
+ });
1310
+ Logger({ level: "WARN", message: warrning });
1311
+ }
1312
+
724
1313
  const query_params = {};
725
1314
  query_params["platform"] = platform;
726
1315
 
727
1316
  const xHeaders = {};
728
1317
 
729
- return APIClient.execute(
1318
+ const response = await APIClient.execute(
730
1319
  this._conf,
731
1320
  "post",
732
1321
  constructUrl({
@@ -737,6 +1326,21 @@ class User {
737
1326
  body,
738
1327
  xHeaders
739
1328
  );
1329
+
1330
+ const { error: res_error } = UserModel.OtpSuccess().validate(response, {
1331
+ abortEarly: false,
1332
+ allowUnknown: false,
1333
+ });
1334
+
1335
+ if (res_error) {
1336
+ Logger({
1337
+ level: "WARN",
1338
+ message: "Response Validation Warnnings for sendOTPOnMobile",
1339
+ });
1340
+ Logger({ level: "WARN", message: res_error });
1341
+ }
1342
+
1343
+ return response;
740
1344
  }
741
1345
 
742
1346
  /**
@@ -747,7 +1351,7 @@ class User {
747
1351
  * @summary: Verify OTP on mobile
748
1352
  * @description: Use this API to verify the OTP received on a mobile number.
749
1353
  */
750
- verifyMobileOTP({ body, platform } = {}) {
1354
+ async verifyMobileOTP({ body, platform } = {}) {
751
1355
  const { error } = UserValidator.verifyMobileOTP().validate(
752
1356
  { body, platform },
753
1357
  { abortEarly: false, allowUnknown: true }
@@ -755,12 +1359,26 @@ class User {
755
1359
  if (error) {
756
1360
  return Promise.reject(new FDKClientValidationError(error));
757
1361
  }
1362
+
1363
+ // Showing warrnings if extra unknown parameters are found
1364
+ const { error: warrning } = UserValidator.verifyMobileOTP().validate(
1365
+ { body, platform },
1366
+ { abortEarly: false, allowUnknown: false }
1367
+ );
1368
+ if (warrning) {
1369
+ Logger({
1370
+ level: "WARN",
1371
+ message: "Parameter Validation warrnings for verifyMobileOTP",
1372
+ });
1373
+ Logger({ level: "WARN", message: warrning });
1374
+ }
1375
+
758
1376
  const query_params = {};
759
1377
  query_params["platform"] = platform;
760
1378
 
761
1379
  const xHeaders = {};
762
1380
 
763
- return APIClient.execute(
1381
+ const response = await APIClient.execute(
764
1382
  this._conf,
765
1383
  "post",
766
1384
  constructUrl({
@@ -771,6 +1389,21 @@ class User {
771
1389
  body,
772
1390
  xHeaders
773
1391
  );
1392
+
1393
+ const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
1394
+ response,
1395
+ { abortEarly: false, allowUnknown: false }
1396
+ );
1397
+
1398
+ if (res_error) {
1399
+ Logger({
1400
+ level: "WARN",
1401
+ message: "Response Validation Warnnings for verifyMobileOTP",
1402
+ });
1403
+ Logger({ level: "WARN", message: res_error });
1404
+ }
1405
+
1406
+ return response;
774
1407
  }
775
1408
 
776
1409
  /**
@@ -781,7 +1414,7 @@ class User {
781
1414
  * @summary: Send OTP on email
782
1415
  * @description: Use this API to send an OTP to an email ID.
783
1416
  */
784
- sendOTPOnEmail({ body, platform } = {}) {
1417
+ async sendOTPOnEmail({ body, platform } = {}) {
785
1418
  const { error } = UserValidator.sendOTPOnEmail().validate(
786
1419
  { body, platform },
787
1420
  { abortEarly: false, allowUnknown: true }
@@ -789,12 +1422,26 @@ class User {
789
1422
  if (error) {
790
1423
  return Promise.reject(new FDKClientValidationError(error));
791
1424
  }
1425
+
1426
+ // Showing warrnings if extra unknown parameters are found
1427
+ const { error: warrning } = UserValidator.sendOTPOnEmail().validate(
1428
+ { body, platform },
1429
+ { abortEarly: false, allowUnknown: false }
1430
+ );
1431
+ if (warrning) {
1432
+ Logger({
1433
+ level: "WARN",
1434
+ message: "Parameter Validation warrnings for sendOTPOnEmail",
1435
+ });
1436
+ Logger({ level: "WARN", message: warrning });
1437
+ }
1438
+
792
1439
  const query_params = {};
793
1440
  query_params["platform"] = platform;
794
1441
 
795
1442
  const xHeaders = {};
796
1443
 
797
- return APIClient.execute(
1444
+ const response = await APIClient.execute(
798
1445
  this._conf,
799
1446
  "post",
800
1447
  constructUrl({
@@ -805,6 +1452,21 @@ class User {
805
1452
  body,
806
1453
  xHeaders
807
1454
  );
1455
+
1456
+ const { error: res_error } = UserModel.EmailOtpSuccess().validate(
1457
+ response,
1458
+ { abortEarly: false, allowUnknown: false }
1459
+ );
1460
+
1461
+ if (res_error) {
1462
+ Logger({
1463
+ level: "WARN",
1464
+ message: "Response Validation Warnnings for sendOTPOnEmail",
1465
+ });
1466
+ Logger({ level: "WARN", message: res_error });
1467
+ }
1468
+
1469
+ return response;
808
1470
  }
809
1471
 
810
1472
  /**
@@ -815,7 +1477,7 @@ class User {
815
1477
  * @summary: Verify OTP on email
816
1478
  * @description: Use this API to verify the OTP received on an email ID.
817
1479
  */
818
- verifyEmailOTP({ body, platform } = {}) {
1480
+ async verifyEmailOTP({ body, platform } = {}) {
819
1481
  const { error } = UserValidator.verifyEmailOTP().validate(
820
1482
  { body, platform },
821
1483
  { abortEarly: false, allowUnknown: true }
@@ -823,12 +1485,26 @@ class User {
823
1485
  if (error) {
824
1486
  return Promise.reject(new FDKClientValidationError(error));
825
1487
  }
1488
+
1489
+ // Showing warrnings if extra unknown parameters are found
1490
+ const { error: warrning } = UserValidator.verifyEmailOTP().validate(
1491
+ { body, platform },
1492
+ { abortEarly: false, allowUnknown: false }
1493
+ );
1494
+ if (warrning) {
1495
+ Logger({
1496
+ level: "WARN",
1497
+ message: "Parameter Validation warrnings for verifyEmailOTP",
1498
+ });
1499
+ Logger({ level: "WARN", message: warrning });
1500
+ }
1501
+
826
1502
  const query_params = {};
827
1503
  query_params["platform"] = platform;
828
1504
 
829
1505
  const xHeaders = {};
830
1506
 
831
- return APIClient.execute(
1507
+ const response = await APIClient.execute(
832
1508
  this._conf,
833
1509
  "post",
834
1510
  constructUrl({
@@ -839,6 +1515,21 @@ class User {
839
1515
  body,
840
1516
  xHeaders
841
1517
  );
1518
+
1519
+ const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
1520
+ response,
1521
+ { abortEarly: false, allowUnknown: false }
1522
+ );
1523
+
1524
+ if (res_error) {
1525
+ Logger({
1526
+ level: "WARN",
1527
+ message: "Response Validation Warnnings for verifyEmailOTP",
1528
+ });
1529
+ Logger({ level: "WARN", message: res_error });
1530
+ }
1531
+
1532
+ return response;
842
1533
  }
843
1534
 
844
1535
  /**
@@ -847,7 +1538,7 @@ class User {
847
1538
  * @summary: Get logged in user
848
1539
  * @description: Use this API to get the details of a logged in user.
849
1540
  */
850
- getLoggedInUser({} = {}) {
1541
+ async getLoggedInUser({} = {}) {
851
1542
  const { error } = UserValidator.getLoggedInUser().validate(
852
1543
  {},
853
1544
  { abortEarly: false, allowUnknown: true }
@@ -855,11 +1546,25 @@ class User {
855
1546
  if (error) {
856
1547
  return Promise.reject(new FDKClientValidationError(error));
857
1548
  }
1549
+
1550
+ // Showing warrnings if extra unknown parameters are found
1551
+ const { error: warrning } = UserValidator.getLoggedInUser().validate(
1552
+ {},
1553
+ { abortEarly: false, allowUnknown: false }
1554
+ );
1555
+ if (warrning) {
1556
+ Logger({
1557
+ level: "WARN",
1558
+ message: "Parameter Validation warrnings for getLoggedInUser",
1559
+ });
1560
+ Logger({ level: "WARN", message: warrning });
1561
+ }
1562
+
858
1563
  const query_params = {};
859
1564
 
860
1565
  const xHeaders = {};
861
1566
 
862
- return APIClient.execute(
1567
+ const response = await APIClient.execute(
863
1568
  this._conf,
864
1569
  "get",
865
1570
  constructUrl({
@@ -870,6 +1575,21 @@ class User {
870
1575
  undefined,
871
1576
  xHeaders
872
1577
  );
1578
+
1579
+ const { error: res_error } = UserModel.UserObjectSchema().validate(
1580
+ response,
1581
+ { abortEarly: false, allowUnknown: false }
1582
+ );
1583
+
1584
+ if (res_error) {
1585
+ Logger({
1586
+ level: "WARN",
1587
+ message: "Response Validation Warnnings for getLoggedInUser",
1588
+ });
1589
+ Logger({ level: "WARN", message: res_error });
1590
+ }
1591
+
1592
+ return response;
873
1593
  }
874
1594
 
875
1595
  /**
@@ -878,7 +1598,7 @@ class User {
878
1598
  * @summary: Get list of sessions
879
1599
  * @description: Use this API to retrieve all active sessions of a user.
880
1600
  */
881
- getListOfActiveSessions({} = {}) {
1601
+ async getListOfActiveSessions({} = {}) {
882
1602
  const { error } = UserValidator.getListOfActiveSessions().validate(
883
1603
  {},
884
1604
  { abortEarly: false, allowUnknown: true }
@@ -886,11 +1606,27 @@ class User {
886
1606
  if (error) {
887
1607
  return Promise.reject(new FDKClientValidationError(error));
888
1608
  }
1609
+
1610
+ // Showing warrnings if extra unknown parameters are found
1611
+ const {
1612
+ error: warrning,
1613
+ } = UserValidator.getListOfActiveSessions().validate(
1614
+ {},
1615
+ { abortEarly: false, allowUnknown: false }
1616
+ );
1617
+ if (warrning) {
1618
+ Logger({
1619
+ level: "WARN",
1620
+ message: "Parameter Validation warrnings for getListOfActiveSessions",
1621
+ });
1622
+ Logger({ level: "WARN", message: warrning });
1623
+ }
1624
+
889
1625
  const query_params = {};
890
1626
 
891
1627
  const xHeaders = {};
892
1628
 
893
- return APIClient.execute(
1629
+ const response = await APIClient.execute(
894
1630
  this._conf,
895
1631
  "get",
896
1632
  constructUrl({
@@ -901,6 +1637,23 @@ class User {
901
1637
  undefined,
902
1638
  xHeaders
903
1639
  );
1640
+
1641
+ const {
1642
+ error: res_error,
1643
+ } = UserModel.SessionListSuccess().validate(response, {
1644
+ abortEarly: false,
1645
+ allowUnknown: false,
1646
+ });
1647
+
1648
+ if (res_error) {
1649
+ Logger({
1650
+ level: "WARN",
1651
+ message: "Response Validation Warnnings for getListOfActiveSessions",
1652
+ });
1653
+ Logger({ level: "WARN", message: res_error });
1654
+ }
1655
+
1656
+ return response;
904
1657
  }
905
1658
 
906
1659
  /**
@@ -910,7 +1663,7 @@ class User {
910
1663
  * @summary: Get platform configurations
911
1664
  * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text.
912
1665
  */
913
- getPlatformConfig({ name } = {}) {
1666
+ async getPlatformConfig({ name } = {}) {
914
1667
  const { error } = UserValidator.getPlatformConfig().validate(
915
1668
  { name },
916
1669
  { abortEarly: false, allowUnknown: true }
@@ -918,12 +1671,26 @@ class User {
918
1671
  if (error) {
919
1672
  return Promise.reject(new FDKClientValidationError(error));
920
1673
  }
1674
+
1675
+ // Showing warrnings if extra unknown parameters are found
1676
+ const { error: warrning } = UserValidator.getPlatformConfig().validate(
1677
+ { name },
1678
+ { abortEarly: false, allowUnknown: false }
1679
+ );
1680
+ if (warrning) {
1681
+ Logger({
1682
+ level: "WARN",
1683
+ message: "Parameter Validation warrnings for getPlatformConfig",
1684
+ });
1685
+ Logger({ level: "WARN", message: warrning });
1686
+ }
1687
+
921
1688
  const query_params = {};
922
1689
  query_params["name"] = name;
923
1690
 
924
1691
  const xHeaders = {};
925
1692
 
926
- return APIClient.execute(
1693
+ const response = await APIClient.execute(
927
1694
  this._conf,
928
1695
  "get",
929
1696
  constructUrl({
@@ -934,6 +1701,21 @@ class User {
934
1701
  undefined,
935
1702
  xHeaders
936
1703
  );
1704
+
1705
+ const { error: res_error } = UserModel.PlatformSchema().validate(response, {
1706
+ abortEarly: false,
1707
+ allowUnknown: false,
1708
+ });
1709
+
1710
+ if (res_error) {
1711
+ Logger({
1712
+ level: "WARN",
1713
+ message: "Response Validation Warnnings for getPlatformConfig",
1714
+ });
1715
+ Logger({ level: "WARN", message: res_error });
1716
+ }
1717
+
1718
+ return response;
937
1719
  }
938
1720
 
939
1721
  /**
@@ -944,7 +1726,7 @@ class User {
944
1726
  * @summary: Edit Profile Details
945
1727
  * @description: Use this API to update details in the user profile. Details can be first name, last name, gender, email, phone number, or profile picture.
946
1728
  */
947
- updateProfile({ body, platform } = {}) {
1729
+ async updateProfile({ body, platform } = {}) {
948
1730
  const { error } = UserValidator.updateProfile().validate(
949
1731
  { body, platform },
950
1732
  { abortEarly: false, allowUnknown: true }
@@ -952,12 +1734,26 @@ class User {
952
1734
  if (error) {
953
1735
  return Promise.reject(new FDKClientValidationError(error));
954
1736
  }
1737
+
1738
+ // Showing warrnings if extra unknown parameters are found
1739
+ const { error: warrning } = UserValidator.updateProfile().validate(
1740
+ { body, platform },
1741
+ { abortEarly: false, allowUnknown: false }
1742
+ );
1743
+ if (warrning) {
1744
+ Logger({
1745
+ level: "WARN",
1746
+ message: "Parameter Validation warrnings for updateProfile",
1747
+ });
1748
+ Logger({ level: "WARN", message: warrning });
1749
+ }
1750
+
955
1751
  const query_params = {};
956
1752
  query_params["platform"] = platform;
957
1753
 
958
1754
  const xHeaders = {};
959
1755
 
960
- return APIClient.execute(
1756
+ const response = await APIClient.execute(
961
1757
  this._conf,
962
1758
  "post",
963
1759
  constructUrl({
@@ -968,6 +1764,23 @@ class User {
968
1764
  body,
969
1765
  xHeaders
970
1766
  );
1767
+
1768
+ const {
1769
+ error: res_error,
1770
+ } = UserModel.ProfileEditSuccess().validate(response, {
1771
+ abortEarly: false,
1772
+ allowUnknown: false,
1773
+ });
1774
+
1775
+ if (res_error) {
1776
+ Logger({
1777
+ level: "WARN",
1778
+ message: "Response Validation Warnnings for updateProfile",
1779
+ });
1780
+ Logger({ level: "WARN", message: res_error });
1781
+ }
1782
+
1783
+ return response;
971
1784
  }
972
1785
 
973
1786
  /**
@@ -978,7 +1791,7 @@ class User {
978
1791
  * @summary: Add mobile number to profile
979
1792
  * @description: Use this API to add a new mobile number to a profile.
980
1793
  */
981
- addMobileNumber({ body, platform } = {}) {
1794
+ async addMobileNumber({ body, platform } = {}) {
982
1795
  const { error } = UserValidator.addMobileNumber().validate(
983
1796
  { body, platform },
984
1797
  { abortEarly: false, allowUnknown: true }
@@ -986,12 +1799,26 @@ class User {
986
1799
  if (error) {
987
1800
  return Promise.reject(new FDKClientValidationError(error));
988
1801
  }
1802
+
1803
+ // Showing warrnings if extra unknown parameters are found
1804
+ const { error: warrning } = UserValidator.addMobileNumber().validate(
1805
+ { body, platform },
1806
+ { abortEarly: false, allowUnknown: false }
1807
+ );
1808
+ if (warrning) {
1809
+ Logger({
1810
+ level: "WARN",
1811
+ message: "Parameter Validation warrnings for addMobileNumber",
1812
+ });
1813
+ Logger({ level: "WARN", message: warrning });
1814
+ }
1815
+
989
1816
  const query_params = {};
990
1817
  query_params["platform"] = platform;
991
1818
 
992
1819
  const xHeaders = {};
993
1820
 
994
- return APIClient.execute(
1821
+ const response = await APIClient.execute(
995
1822
  this._conf,
996
1823
  "put",
997
1824
  constructUrl({
@@ -1002,6 +1829,23 @@ class User {
1002
1829
  body,
1003
1830
  xHeaders
1004
1831
  );
1832
+
1833
+ const {
1834
+ error: res_error,
1835
+ } = UserModel.VerifyMobileOTPSuccess().validate(response, {
1836
+ abortEarly: false,
1837
+ allowUnknown: false,
1838
+ });
1839
+
1840
+ if (res_error) {
1841
+ Logger({
1842
+ level: "WARN",
1843
+ message: "Response Validation Warnnings for addMobileNumber",
1844
+ });
1845
+ Logger({ level: "WARN", message: res_error });
1846
+ }
1847
+
1848
+ return response;
1005
1849
  }
1006
1850
 
1007
1851
  /**
@@ -1021,7 +1865,7 @@ class User {
1021
1865
  * @summary: Delete mobile number from profile
1022
1866
  * @description: Use this API to delete a mobile number from a profile.
1023
1867
  */
1024
- deleteMobileNumber({
1868
+ async deleteMobileNumber({
1025
1869
  active,
1026
1870
  primary,
1027
1871
  verified,
@@ -1036,6 +1880,20 @@ class User {
1036
1880
  if (error) {
1037
1881
  return Promise.reject(new FDKClientValidationError(error));
1038
1882
  }
1883
+
1884
+ // Showing warrnings if extra unknown parameters are found
1885
+ const { error: warrning } = UserValidator.deleteMobileNumber().validate(
1886
+ { active, primary, verified, countryCode, phone, platform },
1887
+ { abortEarly: false, allowUnknown: false }
1888
+ );
1889
+ if (warrning) {
1890
+ Logger({
1891
+ level: "WARN",
1892
+ message: "Parameter Validation warrnings for deleteMobileNumber",
1893
+ });
1894
+ Logger({ level: "WARN", message: warrning });
1895
+ }
1896
+
1039
1897
  const query_params = {};
1040
1898
  query_params["platform"] = platform;
1041
1899
  query_params["active"] = active;
@@ -1046,7 +1904,7 @@ class User {
1046
1904
 
1047
1905
  const xHeaders = {};
1048
1906
 
1049
- return APIClient.execute(
1907
+ const response = await APIClient.execute(
1050
1908
  this._conf,
1051
1909
  "delete",
1052
1910
  constructUrl({
@@ -1057,6 +1915,21 @@ class User {
1057
1915
  undefined,
1058
1916
  xHeaders
1059
1917
  );
1918
+
1919
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
1920
+ abortEarly: false,
1921
+ allowUnknown: false,
1922
+ });
1923
+
1924
+ if (res_error) {
1925
+ Logger({
1926
+ level: "WARN",
1927
+ message: "Response Validation Warnnings for deleteMobileNumber",
1928
+ });
1929
+ Logger({ level: "WARN", message: res_error });
1930
+ }
1931
+
1932
+ return response;
1060
1933
  }
1061
1934
 
1062
1935
  /**
@@ -1066,7 +1939,7 @@ class User {
1066
1939
  * @summary: Set mobile as primary
1067
1940
  * @description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications.
1068
1941
  */
1069
- setMobileNumberAsPrimary({ body } = {}) {
1942
+ async setMobileNumberAsPrimary({ body } = {}) {
1070
1943
  const { error } = UserValidator.setMobileNumberAsPrimary().validate(
1071
1944
  { body },
1072
1945
  { abortEarly: false, allowUnknown: true }
@@ -1074,11 +1947,27 @@ class User {
1074
1947
  if (error) {
1075
1948
  return Promise.reject(new FDKClientValidationError(error));
1076
1949
  }
1950
+
1951
+ // Showing warrnings if extra unknown parameters are found
1952
+ const {
1953
+ error: warrning,
1954
+ } = UserValidator.setMobileNumberAsPrimary().validate(
1955
+ { body },
1956
+ { abortEarly: false, allowUnknown: false }
1957
+ );
1958
+ if (warrning) {
1959
+ Logger({
1960
+ level: "WARN",
1961
+ message: "Parameter Validation warrnings for setMobileNumberAsPrimary",
1962
+ });
1963
+ Logger({ level: "WARN", message: warrning });
1964
+ }
1965
+
1077
1966
  const query_params = {};
1078
1967
 
1079
1968
  const xHeaders = {};
1080
1969
 
1081
- return APIClient.execute(
1970
+ const response = await APIClient.execute(
1082
1971
  this._conf,
1083
1972
  "post",
1084
1973
  constructUrl({
@@ -1089,6 +1978,21 @@ class User {
1089
1978
  body,
1090
1979
  xHeaders
1091
1980
  );
1981
+
1982
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
1983
+ abortEarly: false,
1984
+ allowUnknown: false,
1985
+ });
1986
+
1987
+ if (res_error) {
1988
+ Logger({
1989
+ level: "WARN",
1990
+ message: "Response Validation Warnnings for setMobileNumberAsPrimary",
1991
+ });
1992
+ Logger({ level: "WARN", message: res_error });
1993
+ }
1994
+
1995
+ return response;
1092
1996
  }
1093
1997
 
1094
1998
  /**
@@ -1099,7 +2003,7 @@ class User {
1099
2003
  * @summary: Send verification link to mobile
1100
2004
  * @description: Use this API to send a verification link to a mobile number
1101
2005
  */
1102
- sendVerificationLinkToMobile({ body, platform } = {}) {
2006
+ async sendVerificationLinkToMobile({ body, platform } = {}) {
1103
2007
  const { error } = UserValidator.sendVerificationLinkToMobile().validate(
1104
2008
  { body, platform },
1105
2009
  { abortEarly: false, allowUnknown: true }
@@ -1107,12 +2011,29 @@ class User {
1107
2011
  if (error) {
1108
2012
  return Promise.reject(new FDKClientValidationError(error));
1109
2013
  }
2014
+
2015
+ // Showing warrnings if extra unknown parameters are found
2016
+ const {
2017
+ error: warrning,
2018
+ } = UserValidator.sendVerificationLinkToMobile().validate(
2019
+ { body, platform },
2020
+ { abortEarly: false, allowUnknown: false }
2021
+ );
2022
+ if (warrning) {
2023
+ Logger({
2024
+ level: "WARN",
2025
+ message:
2026
+ "Parameter Validation warrnings for sendVerificationLinkToMobile",
2027
+ });
2028
+ Logger({ level: "WARN", message: warrning });
2029
+ }
2030
+
1110
2031
  const query_params = {};
1111
2032
  query_params["platform"] = platform;
1112
2033
 
1113
2034
  const xHeaders = {};
1114
2035
 
1115
- return APIClient.execute(
2036
+ const response = await APIClient.execute(
1116
2037
  this._conf,
1117
2038
  "post",
1118
2039
  constructUrl({
@@ -1123,6 +2044,24 @@ class User {
1123
2044
  body,
1124
2045
  xHeaders
1125
2046
  );
2047
+
2048
+ const {
2049
+ error: res_error,
2050
+ } = UserModel.SendMobileVerifyLinkSuccess().validate(response, {
2051
+ abortEarly: false,
2052
+ allowUnknown: false,
2053
+ });
2054
+
2055
+ if (res_error) {
2056
+ Logger({
2057
+ level: "WARN",
2058
+ message:
2059
+ "Response Validation Warnnings for sendVerificationLinkToMobile",
2060
+ });
2061
+ Logger({ level: "WARN", message: res_error });
2062
+ }
2063
+
2064
+ return response;
1126
2065
  }
1127
2066
 
1128
2067
  /**
@@ -1133,7 +2072,7 @@ class User {
1133
2072
  * @summary: Add email to profile
1134
2073
  * @description: Use this API to add a new email address to a profile
1135
2074
  */
1136
- addEmail({ body, platform } = {}) {
2075
+ async addEmail({ body, platform } = {}) {
1137
2076
  const { error } = UserValidator.addEmail().validate(
1138
2077
  { body, platform },
1139
2078
  { abortEarly: false, allowUnknown: true }
@@ -1141,12 +2080,26 @@ class User {
1141
2080
  if (error) {
1142
2081
  return Promise.reject(new FDKClientValidationError(error));
1143
2082
  }
2083
+
2084
+ // Showing warrnings if extra unknown parameters are found
2085
+ const { error: warrning } = UserValidator.addEmail().validate(
2086
+ { body, platform },
2087
+ { abortEarly: false, allowUnknown: false }
2088
+ );
2089
+ if (warrning) {
2090
+ Logger({
2091
+ level: "WARN",
2092
+ message: "Parameter Validation warrnings for addEmail",
2093
+ });
2094
+ Logger({ level: "WARN", message: warrning });
2095
+ }
2096
+
1144
2097
  const query_params = {};
1145
2098
  query_params["platform"] = platform;
1146
2099
 
1147
2100
  const xHeaders = {};
1148
2101
 
1149
- return APIClient.execute(
2102
+ const response = await APIClient.execute(
1150
2103
  this._conf,
1151
2104
  "put",
1152
2105
  constructUrl({
@@ -1157,6 +2110,23 @@ class User {
1157
2110
  body,
1158
2111
  xHeaders
1159
2112
  );
2113
+
2114
+ const {
2115
+ error: res_error,
2116
+ } = UserModel.VerifyEmailOTPSuccess().validate(response, {
2117
+ abortEarly: false,
2118
+ allowUnknown: false,
2119
+ });
2120
+
2121
+ if (res_error) {
2122
+ Logger({
2123
+ level: "WARN",
2124
+ message: "Response Validation Warnnings for addEmail",
2125
+ });
2126
+ Logger({ level: "WARN", message: res_error });
2127
+ }
2128
+
2129
+ return response;
1160
2130
  }
1161
2131
 
1162
2132
  /**
@@ -1175,7 +2145,7 @@ class User {
1175
2145
  * @summary: Delete email from profile
1176
2146
  * @description: Use this API to delete an email address from a profile
1177
2147
  */
1178
- deleteEmail({ active, primary, verified, email, platform } = {}) {
2148
+ async deleteEmail({ active, primary, verified, email, platform } = {}) {
1179
2149
  const { error } = UserValidator.deleteEmail().validate(
1180
2150
  { active, primary, verified, email, platform },
1181
2151
  { abortEarly: false, allowUnknown: true }
@@ -1183,6 +2153,20 @@ class User {
1183
2153
  if (error) {
1184
2154
  return Promise.reject(new FDKClientValidationError(error));
1185
2155
  }
2156
+
2157
+ // Showing warrnings if extra unknown parameters are found
2158
+ const { error: warrning } = UserValidator.deleteEmail().validate(
2159
+ { active, primary, verified, email, platform },
2160
+ { abortEarly: false, allowUnknown: false }
2161
+ );
2162
+ if (warrning) {
2163
+ Logger({
2164
+ level: "WARN",
2165
+ message: "Parameter Validation warrnings for deleteEmail",
2166
+ });
2167
+ Logger({ level: "WARN", message: warrning });
2168
+ }
2169
+
1186
2170
  const query_params = {};
1187
2171
  query_params["platform"] = platform;
1188
2172
  query_params["active"] = active;
@@ -1192,7 +2176,7 @@ class User {
1192
2176
 
1193
2177
  const xHeaders = {};
1194
2178
 
1195
- return APIClient.execute(
2179
+ const response = await APIClient.execute(
1196
2180
  this._conf,
1197
2181
  "delete",
1198
2182
  constructUrl({
@@ -1203,6 +2187,21 @@ class User {
1203
2187
  undefined,
1204
2188
  xHeaders
1205
2189
  );
2190
+
2191
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
2192
+ abortEarly: false,
2193
+ allowUnknown: false,
2194
+ });
2195
+
2196
+ if (res_error) {
2197
+ Logger({
2198
+ level: "WARN",
2199
+ message: "Response Validation Warnnings for deleteEmail",
2200
+ });
2201
+ Logger({ level: "WARN", message: res_error });
2202
+ }
2203
+
2204
+ return response;
1206
2205
  }
1207
2206
 
1208
2207
  /**
@@ -1212,7 +2211,7 @@ class User {
1212
2211
  * @summary: Set email as primary
1213
2212
  * @description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications.
1214
2213
  */
1215
- setEmailAsPrimary({ body } = {}) {
2214
+ async setEmailAsPrimary({ body } = {}) {
1216
2215
  const { error } = UserValidator.setEmailAsPrimary().validate(
1217
2216
  { body },
1218
2217
  { abortEarly: false, allowUnknown: true }
@@ -1220,11 +2219,25 @@ class User {
1220
2219
  if (error) {
1221
2220
  return Promise.reject(new FDKClientValidationError(error));
1222
2221
  }
2222
+
2223
+ // Showing warrnings if extra unknown parameters are found
2224
+ const { error: warrning } = UserValidator.setEmailAsPrimary().validate(
2225
+ { body },
2226
+ { abortEarly: false, allowUnknown: false }
2227
+ );
2228
+ if (warrning) {
2229
+ Logger({
2230
+ level: "WARN",
2231
+ message: "Parameter Validation warrnings for setEmailAsPrimary",
2232
+ });
2233
+ Logger({ level: "WARN", message: warrning });
2234
+ }
2235
+
1223
2236
  const query_params = {};
1224
2237
 
1225
2238
  const xHeaders = {};
1226
2239
 
1227
- return APIClient.execute(
2240
+ const response = await APIClient.execute(
1228
2241
  this._conf,
1229
2242
  "post",
1230
2243
  constructUrl({
@@ -1235,6 +2248,21 @@ class User {
1235
2248
  body,
1236
2249
  xHeaders
1237
2250
  );
2251
+
2252
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
2253
+ abortEarly: false,
2254
+ allowUnknown: false,
2255
+ });
2256
+
2257
+ if (res_error) {
2258
+ Logger({
2259
+ level: "WARN",
2260
+ message: "Response Validation Warnnings for setEmailAsPrimary",
2261
+ });
2262
+ Logger({ level: "WARN", message: res_error });
2263
+ }
2264
+
2265
+ return response;
1238
2266
  }
1239
2267
 
1240
2268
  /**
@@ -1245,7 +2273,7 @@ class User {
1245
2273
  * @summary: Send verification link to email
1246
2274
  * @description: Use this API to send verification link to an email address.
1247
2275
  */
1248
- sendVerificationLinkToEmail({ body, platform } = {}) {
2276
+ async sendVerificationLinkToEmail({ body, platform } = {}) {
1249
2277
  const { error } = UserValidator.sendVerificationLinkToEmail().validate(
1250
2278
  { body, platform },
1251
2279
  { abortEarly: false, allowUnknown: true }
@@ -1253,12 +2281,29 @@ class User {
1253
2281
  if (error) {
1254
2282
  return Promise.reject(new FDKClientValidationError(error));
1255
2283
  }
2284
+
2285
+ // Showing warrnings if extra unknown parameters are found
2286
+ const {
2287
+ error: warrning,
2288
+ } = UserValidator.sendVerificationLinkToEmail().validate(
2289
+ { body, platform },
2290
+ { abortEarly: false, allowUnknown: false }
2291
+ );
2292
+ if (warrning) {
2293
+ Logger({
2294
+ level: "WARN",
2295
+ message:
2296
+ "Parameter Validation warrnings for sendVerificationLinkToEmail",
2297
+ });
2298
+ Logger({ level: "WARN", message: warrning });
2299
+ }
2300
+
1256
2301
  const query_params = {};
1257
2302
  query_params["platform"] = platform;
1258
2303
 
1259
2304
  const xHeaders = {};
1260
2305
 
1261
- return APIClient.execute(
2306
+ const response = await APIClient.execute(
1262
2307
  this._conf,
1263
2308
  "post",
1264
2309
  constructUrl({
@@ -1269,6 +2314,24 @@ class User {
1269
2314
  body,
1270
2315
  xHeaders
1271
2316
  );
2317
+
2318
+ const {
2319
+ error: res_error,
2320
+ } = UserModel.SendEmailVerifyLinkSuccess().validate(response, {
2321
+ abortEarly: false,
2322
+ allowUnknown: false,
2323
+ });
2324
+
2325
+ if (res_error) {
2326
+ Logger({
2327
+ level: "WARN",
2328
+ message:
2329
+ "Response Validation Warnnings for sendVerificationLinkToEmail",
2330
+ });
2331
+ Logger({ level: "WARN", message: res_error });
2332
+ }
2333
+
2334
+ return response;
1272
2335
  }
1273
2336
  }
1274
2337