@gofynd/fdk-client-javascript 1.0.1 → 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 (134) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +414 -414
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +290 -290
  5. package/documentation/application/PAYMENT.md +255 -255
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3088 -2702
  9. package/documentation/platform/COMPANYPROFILE.md +201 -201
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1233 -1158
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +83 -83
  14. package/package.json +1 -1
  15. package/sdk/application/ApplicationConfig.js +1 -1
  16. package/sdk/application/Cart/CartApplicationClient.js +619 -108
  17. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  18. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  19. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  20. package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
  21. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
  22. package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
  23. package/sdk/application/Common/CommonApplicationClient.js +48 -8
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
  27. package/sdk/application/Content/ContentApplicationClient.js +444 -76
  28. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  29. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  30. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
  31. package/sdk/application/Lead/LeadApplicationClient.js +164 -30
  32. package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
  33. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  34. package/sdk/application/Order/OrderApplicationClient.js +287 -54
  35. package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
  36. package/sdk/application/Order/OrderApplicationModel.js +357 -357
  37. package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
  39. package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
  40. package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  43. package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
  44. package/sdk/application/Share/ShareApplicationClient.js +157 -32
  45. package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
  46. package/sdk/application/User/UserApplicationClient.js +806 -148
  47. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  48. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
  49. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  50. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  51. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  52. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
  53. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  54. package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
  55. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  56. package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
  57. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  58. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  59. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
  63. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
  64. package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
  65. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
  66. package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
  67. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
  68. package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
  69. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  70. package/sdk/platform/Common/CommonPlatformClient.js +51 -8
  71. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  72. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
  73. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  74. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  75. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  76. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
  77. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
  78. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
  79. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  80. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
  81. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  82. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
  83. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
  85. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  87. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  88. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  89. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  90. package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
  91. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  92. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
  93. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  94. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
  95. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  96. package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  98. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
  99. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  100. package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
  101. package/sdk/platform/OAuthClient.js +8 -8
  102. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  103. package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
  104. package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
  105. package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
  106. package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
  107. package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
  108. package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
  109. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  110. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  111. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  112. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  113. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  114. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
  115. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  116. package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
  117. package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
  118. package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
  119. package/sdk/platform/PlatformApplicationClient.js +3420 -3212
  120. package/sdk/platform/PlatformClient.d.ts +2959 -2787
  121. package/sdk/platform/PlatformClient.js +3420 -3212
  122. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  123. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
  124. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  125. package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
  126. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  127. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
  128. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  129. package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
  130. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  131. package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
  132. package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
  133. package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
  134. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
@@ -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 }
@@ -104,8 +106,11 @@ class User {
104
106
  { abortEarly: false, allowUnknown: false }
105
107
  );
106
108
  if (warrning) {
107
- console.log("Parameter Validation warrnings for loginWithFacebook");
108
- console.log(warrning);
109
+ Logger({
110
+ level: "WARN",
111
+ message: "Parameter Validation warrnings for loginWithFacebook",
112
+ });
113
+ Logger({ level: "WARN", message: warrning });
109
114
  }
110
115
 
111
116
  const query_params = {};
@@ -113,7 +118,7 @@ class User {
113
118
 
114
119
  const xHeaders = {};
115
120
 
116
- return APIClient.execute(
121
+ const response = await APIClient.execute(
117
122
  this._conf,
118
123
  "post",
119
124
  constructUrl({
@@ -124,6 +129,21 @@ class User {
124
129
  body,
125
130
  xHeaders
126
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;
127
147
  }
128
148
 
129
149
  /**
@@ -134,7 +154,7 @@ class User {
134
154
  * @summary: Login or Register using Google
135
155
  * @description: Use this API to login or register using Google Account credentials.
136
156
  */
137
- loginWithGoogle({ body, platform } = {}) {
157
+ async loginWithGoogle({ body, platform } = {}) {
138
158
  const { error } = UserValidator.loginWithGoogle().validate(
139
159
  { body, platform },
140
160
  { abortEarly: false, allowUnknown: true }
@@ -149,8 +169,11 @@ class User {
149
169
  { abortEarly: false, allowUnknown: false }
150
170
  );
151
171
  if (warrning) {
152
- console.log("Parameter Validation warrnings for loginWithGoogle");
153
- console.log(warrning);
172
+ Logger({
173
+ level: "WARN",
174
+ message: "Parameter Validation warrnings for loginWithGoogle",
175
+ });
176
+ Logger({ level: "WARN", message: warrning });
154
177
  }
155
178
 
156
179
  const query_params = {};
@@ -158,7 +181,7 @@ class User {
158
181
 
159
182
  const xHeaders = {};
160
183
 
161
- return APIClient.execute(
184
+ const response = await APIClient.execute(
162
185
  this._conf,
163
186
  "post",
164
187
  constructUrl({
@@ -169,6 +192,21 @@ class User {
169
192
  body,
170
193
  xHeaders
171
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;
172
210
  }
173
211
 
174
212
  /**
@@ -179,7 +217,7 @@ class User {
179
217
  * @summary: Login or Register using Google on Android
180
218
  * @description: Use this API to login or register in Android app using Google Account credentials.
181
219
  */
182
- loginWithGoogleAndroid({ body, platform } = {}) {
220
+ async loginWithGoogleAndroid({ body, platform } = {}) {
183
221
  const { error } = UserValidator.loginWithGoogleAndroid().validate(
184
222
  { body, platform },
185
223
  { abortEarly: false, allowUnknown: true }
@@ -194,8 +232,11 @@ class User {
194
232
  { abortEarly: false, allowUnknown: false }
195
233
  );
196
234
  if (warrning) {
197
- console.log("Parameter Validation warrnings for loginWithGoogleAndroid");
198
- console.log(warrning);
235
+ Logger({
236
+ level: "WARN",
237
+ message: "Parameter Validation warrnings for loginWithGoogleAndroid",
238
+ });
239
+ Logger({ level: "WARN", message: warrning });
199
240
  }
200
241
 
201
242
  const query_params = {};
@@ -203,7 +244,7 @@ class User {
203
244
 
204
245
  const xHeaders = {};
205
246
 
206
- return APIClient.execute(
247
+ const response = await APIClient.execute(
207
248
  this._conf,
208
249
  "post",
209
250
  constructUrl({
@@ -214,6 +255,21 @@ class User {
214
255
  body,
215
256
  xHeaders
216
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;
217
273
  }
218
274
 
219
275
  /**
@@ -224,7 +280,7 @@ class User {
224
280
  * @summary: Login or Register using Google on iOS
225
281
  * @description: Use this API to login or register in iOS app using Google Account credentials.
226
282
  */
227
- loginWithGoogleIOS({ body, platform } = {}) {
283
+ async loginWithGoogleIOS({ body, platform } = {}) {
228
284
  const { error } = UserValidator.loginWithGoogleIOS().validate(
229
285
  { body, platform },
230
286
  { abortEarly: false, allowUnknown: true }
@@ -239,8 +295,11 @@ class User {
239
295
  { abortEarly: false, allowUnknown: false }
240
296
  );
241
297
  if (warrning) {
242
- console.log("Parameter Validation warrnings for loginWithGoogleIOS");
243
- console.log(warrning);
298
+ Logger({
299
+ level: "WARN",
300
+ message: "Parameter Validation warrnings for loginWithGoogleIOS",
301
+ });
302
+ Logger({ level: "WARN", message: warrning });
244
303
  }
245
304
 
246
305
  const query_params = {};
@@ -248,7 +307,7 @@ class User {
248
307
 
249
308
  const xHeaders = {};
250
309
 
251
- return APIClient.execute(
310
+ const response = await APIClient.execute(
252
311
  this._conf,
253
312
  "post",
254
313
  constructUrl({
@@ -259,6 +318,21 @@ class User {
259
318
  body,
260
319
  xHeaders
261
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;
262
336
  }
263
337
 
264
338
  /**
@@ -269,7 +343,7 @@ class User {
269
343
  * @summary: Login or Register using Apple on iOS
270
344
  * @description: Use this API to login or register in iOS app using Apple Account credentials.
271
345
  */
272
- loginWithAppleIOS({ body, platform } = {}) {
346
+ async loginWithAppleIOS({ body, platform } = {}) {
273
347
  const { error } = UserValidator.loginWithAppleIOS().validate(
274
348
  { body, platform },
275
349
  { abortEarly: false, allowUnknown: true }
@@ -284,8 +358,11 @@ class User {
284
358
  { abortEarly: false, allowUnknown: false }
285
359
  );
286
360
  if (warrning) {
287
- console.log("Parameter Validation warrnings for loginWithAppleIOS");
288
- console.log(warrning);
361
+ Logger({
362
+ level: "WARN",
363
+ message: "Parameter Validation warrnings for loginWithAppleIOS",
364
+ });
365
+ Logger({ level: "WARN", message: warrning });
289
366
  }
290
367
 
291
368
  const query_params = {};
@@ -293,7 +370,7 @@ class User {
293
370
 
294
371
  const xHeaders = {};
295
372
 
296
- return APIClient.execute(
373
+ const response = await APIClient.execute(
297
374
  this._conf,
298
375
  "post",
299
376
  constructUrl({
@@ -304,6 +381,21 @@ class User {
304
381
  body,
305
382
  xHeaders
306
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;
307
399
  }
308
400
 
309
401
  /**
@@ -314,7 +406,7 @@ class User {
314
406
  * @summary: Login or Register with OTP
315
407
  * @description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS.
316
408
  */
317
- loginWithOTP({ body, platform } = {}) {
409
+ async loginWithOTP({ body, platform } = {}) {
318
410
  const { error } = UserValidator.loginWithOTP().validate(
319
411
  { body, platform },
320
412
  { abortEarly: false, allowUnknown: true }
@@ -329,8 +421,11 @@ class User {
329
421
  { abortEarly: false, allowUnknown: false }
330
422
  );
331
423
  if (warrning) {
332
- console.log("Parameter Validation warrnings for loginWithOTP");
333
- console.log(warrning);
424
+ Logger({
425
+ level: "WARN",
426
+ message: "Parameter Validation warrnings for loginWithOTP",
427
+ });
428
+ Logger({ level: "WARN", message: warrning });
334
429
  }
335
430
 
336
431
  const query_params = {};
@@ -338,7 +433,7 @@ class User {
338
433
 
339
434
  const xHeaders = {};
340
435
 
341
- return APIClient.execute(
436
+ const response = await APIClient.execute(
342
437
  this._conf,
343
438
  "post",
344
439
  constructUrl({
@@ -349,6 +444,21 @@ class User {
349
444
  body,
350
445
  xHeaders
351
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;
352
462
  }
353
463
 
354
464
  /**
@@ -358,7 +468,7 @@ class User {
358
468
  * @summary: Login or Register with password
359
469
  * @description: Use this API to login or register using an email address and password.
360
470
  */
361
- loginWithEmailAndPassword({ body } = {}) {
471
+ async loginWithEmailAndPassword({ body } = {}) {
362
472
  const { error } = UserValidator.loginWithEmailAndPassword().validate(
363
473
  { body },
364
474
  { abortEarly: false, allowUnknown: true }
@@ -375,17 +485,18 @@ class User {
375
485
  { abortEarly: false, allowUnknown: false }
376
486
  );
377
487
  if (warrning) {
378
- console.log(
379
- "Parameter Validation warrnings for loginWithEmailAndPassword"
380
- );
381
- console.log(warrning);
488
+ Logger({
489
+ level: "WARN",
490
+ message: "Parameter Validation warrnings for loginWithEmailAndPassword",
491
+ });
492
+ Logger({ level: "WARN", message: warrning });
382
493
  }
383
494
 
384
495
  const query_params = {};
385
496
 
386
497
  const xHeaders = {};
387
498
 
388
- return APIClient.execute(
499
+ const response = await APIClient.execute(
389
500
  this._conf,
390
501
  "post",
391
502
  constructUrl({
@@ -396,6 +507,21 @@ class User {
396
507
  body,
397
508
  xHeaders
398
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;
399
525
  }
400
526
 
401
527
  /**
@@ -406,7 +532,7 @@ class User {
406
532
  * @summary: Reset Password
407
533
  * @description: Use this API to reset a password using the link sent on email.
408
534
  */
409
- sendResetPasswordEmail({ body, platform } = {}) {
535
+ async sendResetPasswordEmail({ body, platform } = {}) {
410
536
  const { error } = UserValidator.sendResetPasswordEmail().validate(
411
537
  { body, platform },
412
538
  { abortEarly: false, allowUnknown: true }
@@ -421,8 +547,11 @@ class User {
421
547
  { abortEarly: false, allowUnknown: false }
422
548
  );
423
549
  if (warrning) {
424
- console.log("Parameter Validation warrnings for sendResetPasswordEmail");
425
- console.log(warrning);
550
+ Logger({
551
+ level: "WARN",
552
+ message: "Parameter Validation warrnings for sendResetPasswordEmail",
553
+ });
554
+ Logger({ level: "WARN", message: warrning });
426
555
  }
427
556
 
428
557
  const query_params = {};
@@ -430,7 +559,7 @@ class User {
430
559
 
431
560
  const xHeaders = {};
432
561
 
433
- return APIClient.execute(
562
+ const response = await APIClient.execute(
434
563
  this._conf,
435
564
  "post",
436
565
  constructUrl({
@@ -441,6 +570,23 @@ class User {
441
570
  body,
442
571
  xHeaders
443
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;
444
590
  }
445
591
 
446
592
  /**
@@ -451,7 +597,7 @@ class User {
451
597
  * @summary: Reset Password
452
598
  * @description: Use this API to reset a password using the link sent on mobile.
453
599
  */
454
- sendResetPasswordMobile({ body, platform } = {}) {
600
+ async sendResetPasswordMobile({ body, platform } = {}) {
455
601
  const { error } = UserValidator.sendResetPasswordMobile().validate(
456
602
  { body, platform },
457
603
  { abortEarly: false, allowUnknown: true }
@@ -468,8 +614,11 @@ class User {
468
614
  { abortEarly: false, allowUnknown: false }
469
615
  );
470
616
  if (warrning) {
471
- console.log("Parameter Validation warrnings for sendResetPasswordMobile");
472
- console.log(warrning);
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Parameter Validation warrnings for sendResetPasswordMobile",
620
+ });
621
+ Logger({ level: "WARN", message: warrning });
473
622
  }
474
623
 
475
624
  const query_params = {};
@@ -477,7 +626,7 @@ class User {
477
626
 
478
627
  const xHeaders = {};
479
628
 
480
- return APIClient.execute(
629
+ const response = await APIClient.execute(
481
630
  this._conf,
482
631
  "post",
483
632
  constructUrl({
@@ -488,6 +637,23 @@ class User {
488
637
  body,
489
638
  xHeaders
490
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;
491
657
  }
492
658
 
493
659
  /**
@@ -497,7 +663,7 @@ class User {
497
663
  * @summary: Forgot Password
498
664
  * @description: Use this API to reset a password using the code sent on email or SMS.
499
665
  */
500
- forgotPassword({ body } = {}) {
666
+ async forgotPassword({ body } = {}) {
501
667
  const { error } = UserValidator.forgotPassword().validate(
502
668
  { body },
503
669
  { abortEarly: false, allowUnknown: true }
@@ -512,15 +678,18 @@ class User {
512
678
  { abortEarly: false, allowUnknown: false }
513
679
  );
514
680
  if (warrning) {
515
- console.log("Parameter Validation warrnings for forgotPassword");
516
- console.log(warrning);
681
+ Logger({
682
+ level: "WARN",
683
+ message: "Parameter Validation warrnings for forgotPassword",
684
+ });
685
+ Logger({ level: "WARN", message: warrning });
517
686
  }
518
687
 
519
688
  const query_params = {};
520
689
 
521
690
  const xHeaders = {};
522
691
 
523
- return APIClient.execute(
692
+ const response = await APIClient.execute(
524
693
  this._conf,
525
694
  "post",
526
695
  constructUrl({
@@ -531,6 +700,21 @@ class User {
531
700
  body,
532
701
  xHeaders
533
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;
534
718
  }
535
719
 
536
720
  /**
@@ -540,7 +724,7 @@ class User {
540
724
  * @summary: Reset Password using token
541
725
  * @description: Use this API to send code to reset password.
542
726
  */
543
- sendResetToken({ body } = {}) {
727
+ async sendResetToken({ body } = {}) {
544
728
  const { error } = UserValidator.sendResetToken().validate(
545
729
  { body },
546
730
  { abortEarly: false, allowUnknown: true }
@@ -555,15 +739,18 @@ class User {
555
739
  { abortEarly: false, allowUnknown: false }
556
740
  );
557
741
  if (warrning) {
558
- console.log("Parameter Validation warrnings for sendResetToken");
559
- console.log(warrning);
742
+ Logger({
743
+ level: "WARN",
744
+ message: "Parameter Validation warrnings for sendResetToken",
745
+ });
746
+ Logger({ level: "WARN", message: warrning });
560
747
  }
561
748
 
562
749
  const query_params = {};
563
750
 
564
751
  const xHeaders = {};
565
752
 
566
- return APIClient.execute(
753
+ const response = await APIClient.execute(
567
754
  this._conf,
568
755
  "post",
569
756
  constructUrl({
@@ -574,6 +761,23 @@ class User {
574
761
  body,
575
762
  xHeaders
576
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;
577
781
  }
578
782
 
579
783
  /**
@@ -583,7 +787,7 @@ class User {
583
787
  * @summary: Login or Register with token
584
788
  * @description: Use this API to login or register using a token for authentication.
585
789
  */
586
- loginWithToken({ body } = {}) {
790
+ async loginWithToken({ body } = {}) {
587
791
  const { error } = UserValidator.loginWithToken().validate(
588
792
  { body },
589
793
  { abortEarly: false, allowUnknown: true }
@@ -598,15 +802,18 @@ class User {
598
802
  { abortEarly: false, allowUnknown: false }
599
803
  );
600
804
  if (warrning) {
601
- console.log("Parameter Validation warrnings for loginWithToken");
602
- console.log(warrning);
805
+ Logger({
806
+ level: "WARN",
807
+ message: "Parameter Validation warrnings for loginWithToken",
808
+ });
809
+ Logger({ level: "WARN", message: warrning });
603
810
  }
604
811
 
605
812
  const query_params = {};
606
813
 
607
814
  const xHeaders = {};
608
815
 
609
- return APIClient.execute(
816
+ const response = await APIClient.execute(
610
817
  this._conf,
611
818
  "post",
612
819
  constructUrl({
@@ -617,6 +824,21 @@ class User {
617
824
  body,
618
825
  xHeaders
619
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;
620
842
  }
621
843
 
622
844
  /**
@@ -627,7 +849,7 @@ class User {
627
849
  * @summary: Registration using a form
628
850
  * @description: Use this API to perform user registration by sending form data in the request body.
629
851
  */
630
- registerWithForm({ body, platform } = {}) {
852
+ async registerWithForm({ body, platform } = {}) {
631
853
  const { error } = UserValidator.registerWithForm().validate(
632
854
  { body, platform },
633
855
  { abortEarly: false, allowUnknown: true }
@@ -642,8 +864,11 @@ class User {
642
864
  { abortEarly: false, allowUnknown: false }
643
865
  );
644
866
  if (warrning) {
645
- console.log("Parameter Validation warrnings for registerWithForm");
646
- console.log(warrning);
867
+ Logger({
868
+ level: "WARN",
869
+ message: "Parameter Validation warrnings for registerWithForm",
870
+ });
871
+ Logger({ level: "WARN", message: warrning });
647
872
  }
648
873
 
649
874
  const query_params = {};
@@ -651,7 +876,7 @@ class User {
651
876
 
652
877
  const xHeaders = {};
653
878
 
654
- return APIClient.execute(
879
+ const response = await APIClient.execute(
655
880
  this._conf,
656
881
  "post",
657
882
  constructUrl({
@@ -662,6 +887,23 @@ class User {
662
887
  body,
663
888
  xHeaders
664
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;
665
907
  }
666
908
 
667
909
  /**
@@ -671,7 +913,7 @@ class User {
671
913
  * @summary: Verify email
672
914
  * @description: Use this API to send a verification code to verify an email.
673
915
  */
674
- verifyEmail({ body } = {}) {
916
+ async verifyEmail({ body } = {}) {
675
917
  const { error } = UserValidator.verifyEmail().validate(
676
918
  { body },
677
919
  { abortEarly: false, allowUnknown: true }
@@ -686,15 +928,18 @@ class User {
686
928
  { abortEarly: false, allowUnknown: false }
687
929
  );
688
930
  if (warrning) {
689
- console.log("Parameter Validation warrnings for verifyEmail");
690
- console.log(warrning);
931
+ Logger({
932
+ level: "WARN",
933
+ message: "Parameter Validation warrnings for verifyEmail",
934
+ });
935
+ Logger({ level: "WARN", message: warrning });
691
936
  }
692
937
 
693
938
  const query_params = {};
694
939
 
695
940
  const xHeaders = {};
696
941
 
697
- return APIClient.execute(
942
+ const response = await APIClient.execute(
698
943
  this._conf,
699
944
  "post",
700
945
  constructUrl({
@@ -705,6 +950,23 @@ class User {
705
950
  body,
706
951
  xHeaders
707
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;
708
970
  }
709
971
 
710
972
  /**
@@ -714,7 +976,7 @@ class User {
714
976
  * @summary: Verify mobile
715
977
  * @description: Use this API to send a verification code to verify a mobile number.
716
978
  */
717
- verifyMobile({ body } = {}) {
979
+ async verifyMobile({ body } = {}) {
718
980
  const { error } = UserValidator.verifyMobile().validate(
719
981
  { body },
720
982
  { abortEarly: false, allowUnknown: true }
@@ -729,15 +991,18 @@ class User {
729
991
  { abortEarly: false, allowUnknown: false }
730
992
  );
731
993
  if (warrning) {
732
- console.log("Parameter Validation warrnings for verifyMobile");
733
- console.log(warrning);
994
+ Logger({
995
+ level: "WARN",
996
+ message: "Parameter Validation warrnings for verifyMobile",
997
+ });
998
+ Logger({ level: "WARN", message: warrning });
734
999
  }
735
1000
 
736
1001
  const query_params = {};
737
1002
 
738
1003
  const xHeaders = {};
739
1004
 
740
- return APIClient.execute(
1005
+ const response = await APIClient.execute(
741
1006
  this._conf,
742
1007
  "post",
743
1008
  constructUrl({
@@ -748,6 +1013,23 @@ class User {
748
1013
  body,
749
1014
  xHeaders
750
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;
751
1033
  }
752
1034
 
753
1035
  /**
@@ -756,7 +1038,7 @@ class User {
756
1038
  * @summary: Check password
757
1039
  * @description: Use this API to check if user has created a password for login.
758
1040
  */
759
- hasPassword({} = {}) {
1041
+ async hasPassword({} = {}) {
760
1042
  const { error } = UserValidator.hasPassword().validate(
761
1043
  {},
762
1044
  { abortEarly: false, allowUnknown: true }
@@ -771,15 +1053,18 @@ class User {
771
1053
  { abortEarly: false, allowUnknown: false }
772
1054
  );
773
1055
  if (warrning) {
774
- console.log("Parameter Validation warrnings for hasPassword");
775
- console.log(warrning);
1056
+ Logger({
1057
+ level: "WARN",
1058
+ message: "Parameter Validation warrnings for hasPassword",
1059
+ });
1060
+ Logger({ level: "WARN", message: warrning });
776
1061
  }
777
1062
 
778
1063
  const query_params = {};
779
1064
 
780
1065
  const xHeaders = {};
781
1066
 
782
- return APIClient.execute(
1067
+ const response = await APIClient.execute(
783
1068
  this._conf,
784
1069
  "get",
785
1070
  constructUrl({
@@ -790,6 +1075,23 @@ class User {
790
1075
  undefined,
791
1076
  xHeaders
792
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;
793
1095
  }
794
1096
 
795
1097
  /**
@@ -799,7 +1101,7 @@ class User {
799
1101
  * @summary: Update user password
800
1102
  * @description: Use this API to update the password.
801
1103
  */
802
- updatePassword({ body } = {}) {
1104
+ async updatePassword({ body } = {}) {
803
1105
  const { error } = UserValidator.updatePassword().validate(
804
1106
  { body },
805
1107
  { abortEarly: false, allowUnknown: true }
@@ -814,15 +1116,18 @@ class User {
814
1116
  { abortEarly: false, allowUnknown: false }
815
1117
  );
816
1118
  if (warrning) {
817
- console.log("Parameter Validation warrnings for updatePassword");
818
- console.log(warrning);
1119
+ Logger({
1120
+ level: "WARN",
1121
+ message: "Parameter Validation warrnings for updatePassword",
1122
+ });
1123
+ Logger({ level: "WARN", message: warrning });
819
1124
  }
820
1125
 
821
1126
  const query_params = {};
822
1127
 
823
1128
  const xHeaders = {};
824
1129
 
825
- return APIClient.execute(
1130
+ const response = await APIClient.execute(
826
1131
  this._conf,
827
1132
  "post",
828
1133
  constructUrl({
@@ -833,6 +1138,23 @@ class User {
833
1138
  body,
834
1139
  xHeaders
835
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;
836
1158
  }
837
1159
 
838
1160
  /**
@@ -842,7 +1164,7 @@ class User {
842
1164
  * @summary: verify otp and delete user
843
1165
  * @description: verify otp and delete user
844
1166
  */
845
- deleteUser({ body } = {}) {
1167
+ async deleteUser({ body } = {}) {
846
1168
  const { error } = UserValidator.deleteUser().validate(
847
1169
  { body },
848
1170
  { abortEarly: false, allowUnknown: true }
@@ -857,15 +1179,18 @@ class User {
857
1179
  { abortEarly: false, allowUnknown: false }
858
1180
  );
859
1181
  if (warrning) {
860
- console.log("Parameter Validation warrnings for deleteUser");
861
- console.log(warrning);
1182
+ Logger({
1183
+ level: "WARN",
1184
+ message: "Parameter Validation warrnings for deleteUser",
1185
+ });
1186
+ Logger({ level: "WARN", message: warrning });
862
1187
  }
863
1188
 
864
1189
  const query_params = {};
865
1190
 
866
1191
  const xHeaders = {};
867
1192
 
868
- return APIClient.execute(
1193
+ const response = await APIClient.execute(
869
1194
  this._conf,
870
1195
  "post",
871
1196
  constructUrl({
@@ -876,6 +1201,23 @@ class User {
876
1201
  body,
877
1202
  xHeaders
878
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;
879
1221
  }
880
1222
 
881
1223
  /**
@@ -884,7 +1226,7 @@ class User {
884
1226
  * @summary: Logs out currently logged in user
885
1227
  * @description: Use this API to check to logout a user from the app.
886
1228
  */
887
- logout({} = {}) {
1229
+ async logout({} = {}) {
888
1230
  const { error } = UserValidator.logout().validate(
889
1231
  {},
890
1232
  { abortEarly: false, allowUnknown: true }
@@ -899,15 +1241,18 @@ class User {
899
1241
  { abortEarly: false, allowUnknown: false }
900
1242
  );
901
1243
  if (warrning) {
902
- console.log("Parameter Validation warrnings for logout");
903
- console.log(warrning);
1244
+ Logger({
1245
+ level: "WARN",
1246
+ message: "Parameter Validation warrnings for logout",
1247
+ });
1248
+ Logger({ level: "WARN", message: warrning });
904
1249
  }
905
1250
 
906
1251
  const query_params = {};
907
1252
 
908
1253
  const xHeaders = {};
909
1254
 
910
- return APIClient.execute(
1255
+ const response = await APIClient.execute(
911
1256
  this._conf,
912
1257
  "get",
913
1258
  constructUrl({
@@ -918,6 +1263,21 @@ class User {
918
1263
  undefined,
919
1264
  xHeaders
920
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;
921
1281
  }
922
1282
 
923
1283
  /**
@@ -928,7 +1288,7 @@ class User {
928
1288
  * @summary: Send OTP on mobile
929
1289
  * @description: Use this API to send an OTP to a mobile number.
930
1290
  */
931
- sendOTPOnMobile({ body, platform } = {}) {
1291
+ async sendOTPOnMobile({ body, platform } = {}) {
932
1292
  const { error } = UserValidator.sendOTPOnMobile().validate(
933
1293
  { body, platform },
934
1294
  { abortEarly: false, allowUnknown: true }
@@ -943,8 +1303,11 @@ class User {
943
1303
  { abortEarly: false, allowUnknown: false }
944
1304
  );
945
1305
  if (warrning) {
946
- console.log("Parameter Validation warrnings for sendOTPOnMobile");
947
- console.log(warrning);
1306
+ Logger({
1307
+ level: "WARN",
1308
+ message: "Parameter Validation warrnings for sendOTPOnMobile",
1309
+ });
1310
+ Logger({ level: "WARN", message: warrning });
948
1311
  }
949
1312
 
950
1313
  const query_params = {};
@@ -952,7 +1315,7 @@ class User {
952
1315
 
953
1316
  const xHeaders = {};
954
1317
 
955
- return APIClient.execute(
1318
+ const response = await APIClient.execute(
956
1319
  this._conf,
957
1320
  "post",
958
1321
  constructUrl({
@@ -963,6 +1326,21 @@ class User {
963
1326
  body,
964
1327
  xHeaders
965
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;
966
1344
  }
967
1345
 
968
1346
  /**
@@ -973,7 +1351,7 @@ class User {
973
1351
  * @summary: Verify OTP on mobile
974
1352
  * @description: Use this API to verify the OTP received on a mobile number.
975
1353
  */
976
- verifyMobileOTP({ body, platform } = {}) {
1354
+ async verifyMobileOTP({ body, platform } = {}) {
977
1355
  const { error } = UserValidator.verifyMobileOTP().validate(
978
1356
  { body, platform },
979
1357
  { abortEarly: false, allowUnknown: true }
@@ -988,8 +1366,11 @@ class User {
988
1366
  { abortEarly: false, allowUnknown: false }
989
1367
  );
990
1368
  if (warrning) {
991
- console.log("Parameter Validation warrnings for verifyMobileOTP");
992
- console.log(warrning);
1369
+ Logger({
1370
+ level: "WARN",
1371
+ message: "Parameter Validation warrnings for verifyMobileOTP",
1372
+ });
1373
+ Logger({ level: "WARN", message: warrning });
993
1374
  }
994
1375
 
995
1376
  const query_params = {};
@@ -997,7 +1378,7 @@ class User {
997
1378
 
998
1379
  const xHeaders = {};
999
1380
 
1000
- return APIClient.execute(
1381
+ const response = await APIClient.execute(
1001
1382
  this._conf,
1002
1383
  "post",
1003
1384
  constructUrl({
@@ -1008,6 +1389,21 @@ class User {
1008
1389
  body,
1009
1390
  xHeaders
1010
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;
1011
1407
  }
1012
1408
 
1013
1409
  /**
@@ -1018,7 +1414,7 @@ class User {
1018
1414
  * @summary: Send OTP on email
1019
1415
  * @description: Use this API to send an OTP to an email ID.
1020
1416
  */
1021
- sendOTPOnEmail({ body, platform } = {}) {
1417
+ async sendOTPOnEmail({ body, platform } = {}) {
1022
1418
  const { error } = UserValidator.sendOTPOnEmail().validate(
1023
1419
  { body, platform },
1024
1420
  { abortEarly: false, allowUnknown: true }
@@ -1033,8 +1429,11 @@ class User {
1033
1429
  { abortEarly: false, allowUnknown: false }
1034
1430
  );
1035
1431
  if (warrning) {
1036
- console.log("Parameter Validation warrnings for sendOTPOnEmail");
1037
- console.log(warrning);
1432
+ Logger({
1433
+ level: "WARN",
1434
+ message: "Parameter Validation warrnings for sendOTPOnEmail",
1435
+ });
1436
+ Logger({ level: "WARN", message: warrning });
1038
1437
  }
1039
1438
 
1040
1439
  const query_params = {};
@@ -1042,7 +1441,7 @@ class User {
1042
1441
 
1043
1442
  const xHeaders = {};
1044
1443
 
1045
- return APIClient.execute(
1444
+ const response = await APIClient.execute(
1046
1445
  this._conf,
1047
1446
  "post",
1048
1447
  constructUrl({
@@ -1053,6 +1452,21 @@ class User {
1053
1452
  body,
1054
1453
  xHeaders
1055
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;
1056
1470
  }
1057
1471
 
1058
1472
  /**
@@ -1063,7 +1477,7 @@ class User {
1063
1477
  * @summary: Verify OTP on email
1064
1478
  * @description: Use this API to verify the OTP received on an email ID.
1065
1479
  */
1066
- verifyEmailOTP({ body, platform } = {}) {
1480
+ async verifyEmailOTP({ body, platform } = {}) {
1067
1481
  const { error } = UserValidator.verifyEmailOTP().validate(
1068
1482
  { body, platform },
1069
1483
  { abortEarly: false, allowUnknown: true }
@@ -1078,8 +1492,11 @@ class User {
1078
1492
  { abortEarly: false, allowUnknown: false }
1079
1493
  );
1080
1494
  if (warrning) {
1081
- console.log("Parameter Validation warrnings for verifyEmailOTP");
1082
- console.log(warrning);
1495
+ Logger({
1496
+ level: "WARN",
1497
+ message: "Parameter Validation warrnings for verifyEmailOTP",
1498
+ });
1499
+ Logger({ level: "WARN", message: warrning });
1083
1500
  }
1084
1501
 
1085
1502
  const query_params = {};
@@ -1087,7 +1504,7 @@ class User {
1087
1504
 
1088
1505
  const xHeaders = {};
1089
1506
 
1090
- return APIClient.execute(
1507
+ const response = await APIClient.execute(
1091
1508
  this._conf,
1092
1509
  "post",
1093
1510
  constructUrl({
@@ -1098,6 +1515,21 @@ class User {
1098
1515
  body,
1099
1516
  xHeaders
1100
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;
1101
1533
  }
1102
1534
 
1103
1535
  /**
@@ -1106,7 +1538,7 @@ class User {
1106
1538
  * @summary: Get logged in user
1107
1539
  * @description: Use this API to get the details of a logged in user.
1108
1540
  */
1109
- getLoggedInUser({} = {}) {
1541
+ async getLoggedInUser({} = {}) {
1110
1542
  const { error } = UserValidator.getLoggedInUser().validate(
1111
1543
  {},
1112
1544
  { abortEarly: false, allowUnknown: true }
@@ -1121,15 +1553,18 @@ class User {
1121
1553
  { abortEarly: false, allowUnknown: false }
1122
1554
  );
1123
1555
  if (warrning) {
1124
- console.log("Parameter Validation warrnings for getLoggedInUser");
1125
- console.log(warrning);
1556
+ Logger({
1557
+ level: "WARN",
1558
+ message: "Parameter Validation warrnings for getLoggedInUser",
1559
+ });
1560
+ Logger({ level: "WARN", message: warrning });
1126
1561
  }
1127
1562
 
1128
1563
  const query_params = {};
1129
1564
 
1130
1565
  const xHeaders = {};
1131
1566
 
1132
- return APIClient.execute(
1567
+ const response = await APIClient.execute(
1133
1568
  this._conf,
1134
1569
  "get",
1135
1570
  constructUrl({
@@ -1140,6 +1575,21 @@ class User {
1140
1575
  undefined,
1141
1576
  xHeaders
1142
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;
1143
1593
  }
1144
1594
 
1145
1595
  /**
@@ -1148,7 +1598,7 @@ class User {
1148
1598
  * @summary: Get list of sessions
1149
1599
  * @description: Use this API to retrieve all active sessions of a user.
1150
1600
  */
1151
- getListOfActiveSessions({} = {}) {
1601
+ async getListOfActiveSessions({} = {}) {
1152
1602
  const { error } = UserValidator.getListOfActiveSessions().validate(
1153
1603
  {},
1154
1604
  { abortEarly: false, allowUnknown: true }
@@ -1165,15 +1615,18 @@ class User {
1165
1615
  { abortEarly: false, allowUnknown: false }
1166
1616
  );
1167
1617
  if (warrning) {
1168
- console.log("Parameter Validation warrnings for getListOfActiveSessions");
1169
- console.log(warrning);
1618
+ Logger({
1619
+ level: "WARN",
1620
+ message: "Parameter Validation warrnings for getListOfActiveSessions",
1621
+ });
1622
+ Logger({ level: "WARN", message: warrning });
1170
1623
  }
1171
1624
 
1172
1625
  const query_params = {};
1173
1626
 
1174
1627
  const xHeaders = {};
1175
1628
 
1176
- return APIClient.execute(
1629
+ const response = await APIClient.execute(
1177
1630
  this._conf,
1178
1631
  "get",
1179
1632
  constructUrl({
@@ -1184,6 +1637,23 @@ class User {
1184
1637
  undefined,
1185
1638
  xHeaders
1186
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;
1187
1657
  }
1188
1658
 
1189
1659
  /**
@@ -1193,7 +1663,7 @@ class User {
1193
1663
  * @summary: Get platform configurations
1194
1664
  * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text.
1195
1665
  */
1196
- getPlatformConfig({ name } = {}) {
1666
+ async getPlatformConfig({ name } = {}) {
1197
1667
  const { error } = UserValidator.getPlatformConfig().validate(
1198
1668
  { name },
1199
1669
  { abortEarly: false, allowUnknown: true }
@@ -1208,8 +1678,11 @@ class User {
1208
1678
  { abortEarly: false, allowUnknown: false }
1209
1679
  );
1210
1680
  if (warrning) {
1211
- console.log("Parameter Validation warrnings for getPlatformConfig");
1212
- console.log(warrning);
1681
+ Logger({
1682
+ level: "WARN",
1683
+ message: "Parameter Validation warrnings for getPlatformConfig",
1684
+ });
1685
+ Logger({ level: "WARN", message: warrning });
1213
1686
  }
1214
1687
 
1215
1688
  const query_params = {};
@@ -1217,7 +1690,7 @@ class User {
1217
1690
 
1218
1691
  const xHeaders = {};
1219
1692
 
1220
- return APIClient.execute(
1693
+ const response = await APIClient.execute(
1221
1694
  this._conf,
1222
1695
  "get",
1223
1696
  constructUrl({
@@ -1228,6 +1701,21 @@ class User {
1228
1701
  undefined,
1229
1702
  xHeaders
1230
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;
1231
1719
  }
1232
1720
 
1233
1721
  /**
@@ -1238,7 +1726,7 @@ class User {
1238
1726
  * @summary: Edit Profile Details
1239
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.
1240
1728
  */
1241
- updateProfile({ body, platform } = {}) {
1729
+ async updateProfile({ body, platform } = {}) {
1242
1730
  const { error } = UserValidator.updateProfile().validate(
1243
1731
  { body, platform },
1244
1732
  { abortEarly: false, allowUnknown: true }
@@ -1253,8 +1741,11 @@ class User {
1253
1741
  { abortEarly: false, allowUnknown: false }
1254
1742
  );
1255
1743
  if (warrning) {
1256
- console.log("Parameter Validation warrnings for updateProfile");
1257
- console.log(warrning);
1744
+ Logger({
1745
+ level: "WARN",
1746
+ message: "Parameter Validation warrnings for updateProfile",
1747
+ });
1748
+ Logger({ level: "WARN", message: warrning });
1258
1749
  }
1259
1750
 
1260
1751
  const query_params = {};
@@ -1262,7 +1753,7 @@ class User {
1262
1753
 
1263
1754
  const xHeaders = {};
1264
1755
 
1265
- return APIClient.execute(
1756
+ const response = await APIClient.execute(
1266
1757
  this._conf,
1267
1758
  "post",
1268
1759
  constructUrl({
@@ -1273,6 +1764,23 @@ class User {
1273
1764
  body,
1274
1765
  xHeaders
1275
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;
1276
1784
  }
1277
1785
 
1278
1786
  /**
@@ -1283,7 +1791,7 @@ class User {
1283
1791
  * @summary: Add mobile number to profile
1284
1792
  * @description: Use this API to add a new mobile number to a profile.
1285
1793
  */
1286
- addMobileNumber({ body, platform } = {}) {
1794
+ async addMobileNumber({ body, platform } = {}) {
1287
1795
  const { error } = UserValidator.addMobileNumber().validate(
1288
1796
  { body, platform },
1289
1797
  { abortEarly: false, allowUnknown: true }
@@ -1298,8 +1806,11 @@ class User {
1298
1806
  { abortEarly: false, allowUnknown: false }
1299
1807
  );
1300
1808
  if (warrning) {
1301
- console.log("Parameter Validation warrnings for addMobileNumber");
1302
- console.log(warrning);
1809
+ Logger({
1810
+ level: "WARN",
1811
+ message: "Parameter Validation warrnings for addMobileNumber",
1812
+ });
1813
+ Logger({ level: "WARN", message: warrning });
1303
1814
  }
1304
1815
 
1305
1816
  const query_params = {};
@@ -1307,7 +1818,7 @@ class User {
1307
1818
 
1308
1819
  const xHeaders = {};
1309
1820
 
1310
- return APIClient.execute(
1821
+ const response = await APIClient.execute(
1311
1822
  this._conf,
1312
1823
  "put",
1313
1824
  constructUrl({
@@ -1318,6 +1829,23 @@ class User {
1318
1829
  body,
1319
1830
  xHeaders
1320
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;
1321
1849
  }
1322
1850
 
1323
1851
  /**
@@ -1337,7 +1865,7 @@ class User {
1337
1865
  * @summary: Delete mobile number from profile
1338
1866
  * @description: Use this API to delete a mobile number from a profile.
1339
1867
  */
1340
- deleteMobileNumber({
1868
+ async deleteMobileNumber({
1341
1869
  active,
1342
1870
  primary,
1343
1871
  verified,
@@ -1359,8 +1887,11 @@ class User {
1359
1887
  { abortEarly: false, allowUnknown: false }
1360
1888
  );
1361
1889
  if (warrning) {
1362
- console.log("Parameter Validation warrnings for deleteMobileNumber");
1363
- console.log(warrning);
1890
+ Logger({
1891
+ level: "WARN",
1892
+ message: "Parameter Validation warrnings for deleteMobileNumber",
1893
+ });
1894
+ Logger({ level: "WARN", message: warrning });
1364
1895
  }
1365
1896
 
1366
1897
  const query_params = {};
@@ -1373,7 +1904,7 @@ class User {
1373
1904
 
1374
1905
  const xHeaders = {};
1375
1906
 
1376
- return APIClient.execute(
1907
+ const response = await APIClient.execute(
1377
1908
  this._conf,
1378
1909
  "delete",
1379
1910
  constructUrl({
@@ -1384,6 +1915,21 @@ class User {
1384
1915
  undefined,
1385
1916
  xHeaders
1386
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;
1387
1933
  }
1388
1934
 
1389
1935
  /**
@@ -1393,7 +1939,7 @@ class User {
1393
1939
  * @summary: Set mobile as primary
1394
1940
  * @description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications.
1395
1941
  */
1396
- setMobileNumberAsPrimary({ body } = {}) {
1942
+ async setMobileNumberAsPrimary({ body } = {}) {
1397
1943
  const { error } = UserValidator.setMobileNumberAsPrimary().validate(
1398
1944
  { body },
1399
1945
  { abortEarly: false, allowUnknown: true }
@@ -1410,17 +1956,18 @@ class User {
1410
1956
  { abortEarly: false, allowUnknown: false }
1411
1957
  );
1412
1958
  if (warrning) {
1413
- console.log(
1414
- "Parameter Validation warrnings for setMobileNumberAsPrimary"
1415
- );
1416
- console.log(warrning);
1959
+ Logger({
1960
+ level: "WARN",
1961
+ message: "Parameter Validation warrnings for setMobileNumberAsPrimary",
1962
+ });
1963
+ Logger({ level: "WARN", message: warrning });
1417
1964
  }
1418
1965
 
1419
1966
  const query_params = {};
1420
1967
 
1421
1968
  const xHeaders = {};
1422
1969
 
1423
- return APIClient.execute(
1970
+ const response = await APIClient.execute(
1424
1971
  this._conf,
1425
1972
  "post",
1426
1973
  constructUrl({
@@ -1431,6 +1978,21 @@ class User {
1431
1978
  body,
1432
1979
  xHeaders
1433
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;
1434
1996
  }
1435
1997
 
1436
1998
  /**
@@ -1441,7 +2003,7 @@ class User {
1441
2003
  * @summary: Send verification link to mobile
1442
2004
  * @description: Use this API to send a verification link to a mobile number
1443
2005
  */
1444
- sendVerificationLinkToMobile({ body, platform } = {}) {
2006
+ async sendVerificationLinkToMobile({ body, platform } = {}) {
1445
2007
  const { error } = UserValidator.sendVerificationLinkToMobile().validate(
1446
2008
  { body, platform },
1447
2009
  { abortEarly: false, allowUnknown: true }
@@ -1458,10 +2020,12 @@ class User {
1458
2020
  { abortEarly: false, allowUnknown: false }
1459
2021
  );
1460
2022
  if (warrning) {
1461
- console.log(
1462
- "Parameter Validation warrnings for sendVerificationLinkToMobile"
1463
- );
1464
- console.log(warrning);
2023
+ Logger({
2024
+ level: "WARN",
2025
+ message:
2026
+ "Parameter Validation warrnings for sendVerificationLinkToMobile",
2027
+ });
2028
+ Logger({ level: "WARN", message: warrning });
1465
2029
  }
1466
2030
 
1467
2031
  const query_params = {};
@@ -1469,7 +2033,7 @@ class User {
1469
2033
 
1470
2034
  const xHeaders = {};
1471
2035
 
1472
- return APIClient.execute(
2036
+ const response = await APIClient.execute(
1473
2037
  this._conf,
1474
2038
  "post",
1475
2039
  constructUrl({
@@ -1480,6 +2044,24 @@ class User {
1480
2044
  body,
1481
2045
  xHeaders
1482
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;
1483
2065
  }
1484
2066
 
1485
2067
  /**
@@ -1490,7 +2072,7 @@ class User {
1490
2072
  * @summary: Add email to profile
1491
2073
  * @description: Use this API to add a new email address to a profile
1492
2074
  */
1493
- addEmail({ body, platform } = {}) {
2075
+ async addEmail({ body, platform } = {}) {
1494
2076
  const { error } = UserValidator.addEmail().validate(
1495
2077
  { body, platform },
1496
2078
  { abortEarly: false, allowUnknown: true }
@@ -1505,8 +2087,11 @@ class User {
1505
2087
  { abortEarly: false, allowUnknown: false }
1506
2088
  );
1507
2089
  if (warrning) {
1508
- console.log("Parameter Validation warrnings for addEmail");
1509
- console.log(warrning);
2090
+ Logger({
2091
+ level: "WARN",
2092
+ message: "Parameter Validation warrnings for addEmail",
2093
+ });
2094
+ Logger({ level: "WARN", message: warrning });
1510
2095
  }
1511
2096
 
1512
2097
  const query_params = {};
@@ -1514,7 +2099,7 @@ class User {
1514
2099
 
1515
2100
  const xHeaders = {};
1516
2101
 
1517
- return APIClient.execute(
2102
+ const response = await APIClient.execute(
1518
2103
  this._conf,
1519
2104
  "put",
1520
2105
  constructUrl({
@@ -1525,6 +2110,23 @@ class User {
1525
2110
  body,
1526
2111
  xHeaders
1527
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;
1528
2130
  }
1529
2131
 
1530
2132
  /**
@@ -1543,7 +2145,7 @@ class User {
1543
2145
  * @summary: Delete email from profile
1544
2146
  * @description: Use this API to delete an email address from a profile
1545
2147
  */
1546
- deleteEmail({ active, primary, verified, email, platform } = {}) {
2148
+ async deleteEmail({ active, primary, verified, email, platform } = {}) {
1547
2149
  const { error } = UserValidator.deleteEmail().validate(
1548
2150
  { active, primary, verified, email, platform },
1549
2151
  { abortEarly: false, allowUnknown: true }
@@ -1558,8 +2160,11 @@ class User {
1558
2160
  { abortEarly: false, allowUnknown: false }
1559
2161
  );
1560
2162
  if (warrning) {
1561
- console.log("Parameter Validation warrnings for deleteEmail");
1562
- console.log(warrning);
2163
+ Logger({
2164
+ level: "WARN",
2165
+ message: "Parameter Validation warrnings for deleteEmail",
2166
+ });
2167
+ Logger({ level: "WARN", message: warrning });
1563
2168
  }
1564
2169
 
1565
2170
  const query_params = {};
@@ -1571,7 +2176,7 @@ class User {
1571
2176
 
1572
2177
  const xHeaders = {};
1573
2178
 
1574
- return APIClient.execute(
2179
+ const response = await APIClient.execute(
1575
2180
  this._conf,
1576
2181
  "delete",
1577
2182
  constructUrl({
@@ -1582,6 +2187,21 @@ class User {
1582
2187
  undefined,
1583
2188
  xHeaders
1584
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;
1585
2205
  }
1586
2206
 
1587
2207
  /**
@@ -1591,7 +2211,7 @@ class User {
1591
2211
  * @summary: Set email as primary
1592
2212
  * @description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications.
1593
2213
  */
1594
- setEmailAsPrimary({ body } = {}) {
2214
+ async setEmailAsPrimary({ body } = {}) {
1595
2215
  const { error } = UserValidator.setEmailAsPrimary().validate(
1596
2216
  { body },
1597
2217
  { abortEarly: false, allowUnknown: true }
@@ -1606,15 +2226,18 @@ class User {
1606
2226
  { abortEarly: false, allowUnknown: false }
1607
2227
  );
1608
2228
  if (warrning) {
1609
- console.log("Parameter Validation warrnings for setEmailAsPrimary");
1610
- console.log(warrning);
2229
+ Logger({
2230
+ level: "WARN",
2231
+ message: "Parameter Validation warrnings for setEmailAsPrimary",
2232
+ });
2233
+ Logger({ level: "WARN", message: warrning });
1611
2234
  }
1612
2235
 
1613
2236
  const query_params = {};
1614
2237
 
1615
2238
  const xHeaders = {};
1616
2239
 
1617
- return APIClient.execute(
2240
+ const response = await APIClient.execute(
1618
2241
  this._conf,
1619
2242
  "post",
1620
2243
  constructUrl({
@@ -1625,6 +2248,21 @@ class User {
1625
2248
  body,
1626
2249
  xHeaders
1627
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;
1628
2266
  }
1629
2267
 
1630
2268
  /**
@@ -1635,7 +2273,7 @@ class User {
1635
2273
  * @summary: Send verification link to email
1636
2274
  * @description: Use this API to send verification link to an email address.
1637
2275
  */
1638
- sendVerificationLinkToEmail({ body, platform } = {}) {
2276
+ async sendVerificationLinkToEmail({ body, platform } = {}) {
1639
2277
  const { error } = UserValidator.sendVerificationLinkToEmail().validate(
1640
2278
  { body, platform },
1641
2279
  { abortEarly: false, allowUnknown: true }
@@ -1652,10 +2290,12 @@ class User {
1652
2290
  { abortEarly: false, allowUnknown: false }
1653
2291
  );
1654
2292
  if (warrning) {
1655
- console.log(
1656
- "Parameter Validation warrnings for sendVerificationLinkToEmail"
1657
- );
1658
- console.log(warrning);
2293
+ Logger({
2294
+ level: "WARN",
2295
+ message:
2296
+ "Parameter Validation warrnings for sendVerificationLinkToEmail",
2297
+ });
2298
+ Logger({ level: "WARN", message: warrning });
1659
2299
  }
1660
2300
 
1661
2301
  const query_params = {};
@@ -1663,7 +2303,7 @@ class User {
1663
2303
 
1664
2304
  const xHeaders = {};
1665
2305
 
1666
- return APIClient.execute(
2306
+ const response = await APIClient.execute(
1667
2307
  this._conf,
1668
2308
  "post",
1669
2309
  constructUrl({
@@ -1674,6 +2314,24 @@ class User {
1674
2314
  body,
1675
2315
  xHeaders
1676
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;
1677
2335
  }
1678
2336
  }
1679
2337