@gofynd/fdk-client-javascript 1.0.2 → 1.0.4

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 (346) hide show
  1. package/README.md +31 -2
  2. package/index.d.ts +4 -4
  3. package/index.js +9 -10
  4. package/package.json +14 -14
  5. package/sdk/APIClient.d.ts +11 -0
  6. package/sdk/APIClient.js +35 -0
  7. package/sdk/Client.d.ts +6 -0
  8. package/sdk/Client.js +17 -0
  9. package/sdk/Config.d.ts +9 -0
  10. package/sdk/Config.js +17 -0
  11. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  12. package/sdk/application/Cart/CartApplicationClient.js +595 -594
  13. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  14. package/sdk/application/Cart/CartApplicationModel.js +490 -885
  15. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  16. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  17. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  18. package/sdk/application/Catalog/CatalogApplicationClient.js +1079 -1078
  19. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  20. package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
  21. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  22. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  23. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  24. package/sdk/application/Common/CommonApplicationClient.js +43 -42
  25. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  26. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  27. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  28. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  29. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  30. package/sdk/application/Communication/CommunicationApplicationClient.js +32 -31
  31. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  32. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  33. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  34. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  35. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.js +350 -349
  37. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  39. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  41. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  42. package/sdk/application/Content/ContentApplicationClient.js +216 -215
  43. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  44. package/sdk/application/Content/ContentApplicationModel.js +468 -884
  45. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  46. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  47. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.js +65 -64
  49. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  51. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  53. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  54. package/sdk/application/Lead/LeadApplicationClient.js +109 -108
  55. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  56. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  57. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  58. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  59. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +31 -22
  60. package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
  61. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  62. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  63. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  64. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -9
  65. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  66. package/sdk/application/Order/OrderApplicationClient.js +247 -246
  67. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  68. package/sdk/application/Order/OrderApplicationModel.js +361 -656
  69. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  70. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  71. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  72. package/sdk/application/Payment/PaymentApplicationClient.js +781 -780
  73. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  74. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  75. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  76. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  77. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  78. package/sdk/application/PosCart/PosCartApplicationClient.js +646 -645
  79. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  80. package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
  81. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  82. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  83. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  84. package/sdk/application/Rewards/RewardsApplicationClient.js +122 -121
  85. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  86. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  87. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  88. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  89. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  90. package/sdk/application/Share/ShareApplicationClient.js +94 -93
  91. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  92. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  93. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  94. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  95. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  96. package/sdk/application/Theme/ThemeApplicationClient.js +38 -37
  97. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  98. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  99. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  100. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  101. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  102. package/sdk/application/User/UserApplicationClient.js +619 -618
  103. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  104. package/sdk/application/User/UserApplicationModel.js +440 -689
  105. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  106. package/sdk/application/User/UserApplicationValidator.js +89 -89
  107. package/sdk/common/AxiosHelper.js +18 -7
  108. package/sdk/constructUrl.d.ts +5 -0
  109. package/sdk/constructUrl.js +13 -0
  110. package/sdk/index.d.ts +3 -0
  111. package/sdk/index.js +5 -0
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  115. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
  116. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  117. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  118. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  119. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  124. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  125. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +7 -6
  126. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  127. package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
  128. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  129. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  130. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  131. package/sdk/platform/Billing/BillingPlatformValidator.js +26 -25
  132. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
  133. package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
  134. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
  135. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
  136. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  137. package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
  140. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  141. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  142. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
  143. package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
  144. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  145. package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
  146. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  147. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
  148. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  149. package/sdk/platform/Common/CommonPlatformClient.js +40 -51
  150. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  151. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  152. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  153. package/sdk/platform/Common/CommonPlatformValidator.js +7 -6
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
  156. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  157. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
  158. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  159. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  160. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +39 -38
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  183. package/sdk/platform/Content/ContentPlatformModel.js +485 -907
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +30 -29
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +12 -11
  200. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  201. package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
  202. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  203. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  204. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  205. package/sdk/platform/Inventory/InventoryPlatformValidator.js +29 -28
  206. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  207. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
  208. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  209. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
  210. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  211. package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
  212. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  213. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  214. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  215. package/sdk/platform/Lead/LeadPlatformValidator.js +25 -24
  216. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  217. package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
  218. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  219. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
  220. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  221. package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
  222. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  223. package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
  224. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  225. package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
  226. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  227. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  228. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  229. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  230. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
  231. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
  232. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  233. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
  234. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  235. package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
  236. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  237. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  238. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  239. package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
  240. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  241. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  242. package/sdk/platform/PlatformClient.d.ts +7972 -7888
  243. package/sdk/platform/PlatformClient.js +8678 -10107
  244. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
  245. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
  246. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  247. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
  248. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  249. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  250. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  251. package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
  252. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  253. package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
  254. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  255. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  256. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  257. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
  258. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  259. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
  260. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  261. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  262. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  263. package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
  264. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  265. package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
  266. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  267. package/sdk/platform/User/UserPlatformModel.js +440 -689
  268. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  269. package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
  270. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  271. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  272. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  273. package/sdk/platform/Webhook/WebhookPlatformValidator.js +15 -14
  274. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  275. package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -38
  276. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  277. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  278. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  279. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  280. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  281. package/sdk/public/Inventory/InventoryPublicClient.js +115 -113
  282. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  283. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  284. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  285. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  286. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  287. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  288. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  289. package/.github/workflows/on_create_release.yml +0 -23
  290. package/.github/workflows/on_merge_main.yml +0 -38
  291. package/.github/workflows/on_pull_request.yml +0 -35
  292. package/.prettierrc +0 -5
  293. package/documentation/application/CART.md +0 -7339
  294. package/documentation/application/CATALOG.md +0 -9597
  295. package/documentation/application/COMMON.md +0 -452
  296. package/documentation/application/COMMUNICATION.md +0 -467
  297. package/documentation/application/CONFIGURATION.md +0 -2906
  298. package/documentation/application/CONTENT.md +0 -3351
  299. package/documentation/application/FILESTORAGE.md +0 -578
  300. package/documentation/application/LEAD.md +0 -1895
  301. package/documentation/application/LOGISTIC.md +0 -765
  302. package/documentation/application/ORDER.md +0 -3432
  303. package/documentation/application/PAYMENT.md +0 -5221
  304. package/documentation/application/POSCART.md +0 -7938
  305. package/documentation/application/README.md +0 -21
  306. package/documentation/application/REWARDS.md +0 -708
  307. package/documentation/application/SHARE.md +0 -733
  308. package/documentation/application/THEME.md +0 -5800
  309. package/documentation/application/USER.md +0 -4335
  310. package/documentation/platform/ANALYTICS.md +0 -1154
  311. package/documentation/platform/AUDITTRAIL.md +0 -576
  312. package/documentation/platform/BILLING.md +0 -2400
  313. package/documentation/platform/CART.md +0 -5559
  314. package/documentation/platform/CATALOG.md +0 -23261
  315. package/documentation/platform/COMMON.md +0 -452
  316. package/documentation/platform/COMMUNICATION.md +0 -5718
  317. package/documentation/platform/COMPANYPROFILE.md +0 -2031
  318. package/documentation/platform/CONFIGURATION.md +0 -7339
  319. package/documentation/platform/CONTENT.md +0 -9098
  320. package/documentation/platform/DISCOUNT.md +0 -863
  321. package/documentation/platform/FILESTORAGE.md +0 -1081
  322. package/documentation/platform/INVENTORY.md +0 -1779
  323. package/documentation/platform/LEAD.md +0 -4740
  324. package/documentation/platform/ORDER.md +0 -8486
  325. package/documentation/platform/PARTNER.md +0 -220
  326. package/documentation/platform/PAYMENT.md +0 -3448
  327. package/documentation/platform/README.md +0 -27
  328. package/documentation/platform/REWARDS.md +0 -1083
  329. package/documentation/platform/SHARE.md +0 -606
  330. package/documentation/platform/THEME.md +0 -35729
  331. package/documentation/platform/USER.md +0 -2319
  332. package/documentation/platform/WEBHOOK.md +0 -591
  333. package/documentation/public/CONFIGURATION.md +0 -452
  334. package/documentation/public/INVENTORY.md +0 -690
  335. package/documentation/public/WEBHOOK.md +0 -352
  336. package/jest.config.d.ts +0 -4
  337. package/jest.config.js +0 -6
  338. package/tests/application/catalog.spec.js +0 -47
  339. package/tests/common/action-url.spec.js +0 -35
  340. package/tests/common/schema/action-url.json +0 -178
  341. package/tests/common/schema/url-action.json +0 -683
  342. package/tests/common/url-action.spec.js +0 -48
  343. package/tests/helpers/cookie.helper.js +0 -31
  344. package/tests/helpers/oauth.helper.js +0 -43
  345. package/tests/platform/catalog.spec.js +0 -49
  346. package/tests/public/location.spec.js +0 -39
@@ -1,15 +1,32 @@
1
- const APIClient = require("../ApplicationAPIClient");
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
2
3
  const constructUrl = require("../constructUrl");
3
4
  const Paginator = require("../../common/Paginator");
4
- const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const UserValidator = require("./UserApplicationValidator");
6
6
  const UserModel = require("./UserApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class User {
10
11
  constructor(_conf) {
11
12
  this._conf = _conf;
12
13
  this._relativeUrls = {
14
+ addEmail: "/service/application/user/profile/v1.0/email",
15
+ addMobileNumber: "/service/application/user/profile/v1.0/mobile",
16
+ deleteEmail: "/service/application/user/profile/v1.0/email",
17
+ deleteMobileNumber: "/service/application/user/profile/v1.0/mobile",
18
+ deleteUser: "/service/application/user/authentication/v1.0/delete",
19
+ forgotPassword:
20
+ "/service/application/user/authentication/v1.0/login/password/reset/forgot",
21
+ getListOfActiveSessions:
22
+ "/service/application/user/authentication/v1.0/sessions",
23
+ getLoggedInUser: "/service/application/user/authentication/v1.0/session",
24
+ getPlatformConfig: "/service/application/user/platform/v1.0/config",
25
+ hasPassword: "/service/application/user/authentication/v1.0/has-password",
26
+ loginWithAppleIOS:
27
+ "/service/application/user/authentication/v1.0/login/apple-ios",
28
+ loginWithEmailAndPassword:
29
+ "/service/application/user/authentication/v1.0/login/password",
13
30
  loginWithFacebook:
14
31
  "/service/application/user/authentication/v1.0/login/facebook-token",
15
32
  loginWithGoogle:
@@ -18,54 +35,38 @@ class User {
18
35
  "/service/application/user/authentication/v1.0/login/google-android",
19
36
  loginWithGoogleIOS:
20
37
  "/service/application/user/authentication/v1.0/login/google-ios",
21
- loginWithAppleIOS:
22
- "/service/application/user/authentication/v1.0/login/apple-ios",
23
38
  loginWithOTP: "/service/application/user/authentication/v1.0/login/otp",
24
- loginWithEmailAndPassword:
25
- "/service/application/user/authentication/v1.0/login/password",
39
+ loginWithToken:
40
+ "/service/application/user/authentication/v1.0/login/token",
41
+ logout: "/service/application/user/authentication/v1.0/logout",
42
+ registerWithForm:
43
+ "/service/application/user/authentication/v1.0/register/form",
44
+ sendOTPOnEmail:
45
+ "/service/application/user/authentication/v1.0/otp/email/send",
46
+ sendOTPOnMobile:
47
+ "/service/application/user/authentication/v1.0/otp/mobile/send",
26
48
  sendResetPasswordEmail:
27
49
  "/service/application/user/authentication/v1.0/login/password/reset",
28
50
  sendResetPasswordMobile:
29
51
  "/service/application/user/authentication/v1.0/login/password/mobile/reset",
30
- forgotPassword:
31
- "/service/application/user/authentication/v1.0/login/password/reset/forgot",
32
52
  sendResetToken:
33
53
  "/service/application/user/authentication/v1.0/login/password/reset/token",
34
- loginWithToken:
35
- "/service/application/user/authentication/v1.0/login/token",
36
- registerWithForm:
37
- "/service/application/user/authentication/v1.0/register/form",
54
+ sendVerificationLinkToEmail:
55
+ "/service/application/user/profile/v1.0/email/link/send",
56
+ sendVerificationLinkToMobile:
57
+ "/service/application/user/profile/v1.0/mobile/link/send",
58
+ setEmailAsPrimary: "/service/application/user/profile/v1.0/email/primary",
59
+ setMobileNumberAsPrimary:
60
+ "/service/application/user/profile/v1.0/mobile/primary",
61
+ updatePassword: "/service/application/user/authentication/v1.0/password",
62
+ updateProfile: "/service/application/user/profile/v1.0/detail",
38
63
  verifyEmail: "/service/application/user/authentication/v1.0/verify/email",
64
+ verifyEmailOTP:
65
+ "/service/application/user/authentication/v1.0/otp/email/verify",
39
66
  verifyMobile:
40
67
  "/service/application/user/authentication/v1.0/verify/mobile",
41
- hasPassword: "/service/application/user/authentication/v1.0/has-password",
42
- updatePassword: "/service/application/user/authentication/v1.0/password",
43
- deleteUser: "/service/application/user/authentication/v1.0/delete",
44
- logout: "/service/application/user/authentication/v1.0/logout",
45
- sendOTPOnMobile:
46
- "/service/application/user/authentication/v1.0/otp/mobile/send",
47
68
  verifyMobileOTP:
48
69
  "/service/application/user/authentication/v1.0/otp/mobile/verify",
49
- sendOTPOnEmail:
50
- "/service/application/user/authentication/v1.0/otp/email/send",
51
- verifyEmailOTP:
52
- "/service/application/user/authentication/v1.0/otp/email/verify",
53
- getLoggedInUser: "/service/application/user/authentication/v1.0/session",
54
- getListOfActiveSessions:
55
- "/service/application/user/authentication/v1.0/sessions",
56
- getPlatformConfig: "/service/application/user/platform/v1.0/config",
57
- updateProfile: "/service/application/user/profile/v1.0/detail",
58
- addMobileNumber: "/service/application/user/profile/v1.0/mobile",
59
- deleteMobileNumber: "/service/application/user/profile/v1.0/mobile",
60
- setMobileNumberAsPrimary:
61
- "/service/application/user/profile/v1.0/mobile/primary",
62
- sendVerificationLinkToMobile:
63
- "/service/application/user/profile/v1.0/mobile/link/send",
64
- addEmail: "/service/application/user/profile/v1.0/email",
65
- deleteEmail: "/service/application/user/profile/v1.0/email",
66
- setEmailAsPrimary: "/service/application/user/profile/v1.0/email/primary",
67
- sendVerificationLinkToEmail:
68
- "/service/application/user/profile/v1.0/email/link/send",
69
70
  };
70
71
  this._urls = Object.entries(this._relativeUrls).reduce(
71
72
  (urls, [method, relativeUrl]) => {
@@ -86,13 +87,13 @@ class User {
86
87
  /**
87
88
  * @param {Object} arg - Arg object.
88
89
  * @param {string} [arg.platform] - ID of the application
89
- * @param {OAuthRequestSchema} arg.body
90
- * @returns {Promise<AuthSuccess>} - Success response
91
- * @summary: Login or Register using Facebook
92
- * @description: Use this API to login or register using Facebook credentials.
90
+ * @param {EditEmailRequestSchema} arg.body
91
+ * @returns {Promise<VerifyEmailOTPSuccess>} - Success response
92
+ * @summary: Add email to profile
93
+ * @description: Use this API to add a new email address to a profile
93
94
  */
94
- async loginWithFacebook({ body, platform } = {}) {
95
- const { error } = UserValidator.loginWithFacebook().validate(
95
+ async addEmail({ body, platform } = {}) {
96
+ const { error } = UserValidator.addEmail().validate(
96
97
  { body, platform },
97
98
  { abortEarly: false, allowUnknown: true }
98
99
  );
@@ -101,14 +102,14 @@ class User {
101
102
  }
102
103
 
103
104
  // Showing warrnings if extra unknown parameters are found
104
- const { error: warrning } = UserValidator.loginWithFacebook().validate(
105
+ const { error: warrning } = UserValidator.addEmail().validate(
105
106
  { body, platform },
106
107
  { abortEarly: false, allowUnknown: false }
107
108
  );
108
109
  if (warrning) {
109
110
  Logger({
110
111
  level: "WARN",
111
- message: "Parameter Validation warrnings for loginWithFacebook",
112
+ message: "Parameter Validation warrnings for addEmail",
112
113
  });
113
114
  Logger({ level: "WARN", message: warrning });
114
115
  }
@@ -118,11 +119,11 @@ class User {
118
119
 
119
120
  const xHeaders = {};
120
121
 
121
- const response = await APIClient.execute(
122
+ const response = await ApplicationAPIClient.execute(
122
123
  this._conf,
123
- "post",
124
+ "put",
124
125
  constructUrl({
125
- url: this._urls["loginWithFacebook"],
126
+ url: this._urls["addEmail"],
126
127
  params: {},
127
128
  }),
128
129
  query_params,
@@ -130,7 +131,9 @@ class User {
130
131
  xHeaders
131
132
  );
132
133
 
133
- const { error: res_error } = UserModel.AuthSuccess().validate(response, {
134
+ const {
135
+ error: res_error,
136
+ } = UserModel.VerifyEmailOTPSuccess().validate(response, {
134
137
  abortEarly: false,
135
138
  allowUnknown: false,
136
139
  });
@@ -138,7 +141,7 @@ class User {
138
141
  if (res_error) {
139
142
  Logger({
140
143
  level: "WARN",
141
- message: "Response Validation Warnnings for loginWithFacebook",
144
+ message: "Response Validation Warnnings for addEmail",
142
145
  });
143
146
  Logger({ level: "WARN", message: res_error });
144
147
  }
@@ -149,13 +152,13 @@ class User {
149
152
  /**
150
153
  * @param {Object} arg - Arg object.
151
154
  * @param {string} [arg.platform] - ID of the application
152
- * @param {OAuthRequestSchema} arg.body
153
- * @returns {Promise<AuthSuccess>} - Success response
154
- * @summary: Login or Register using Google
155
- * @description: Use this API to login or register using Google Account credentials.
155
+ * @param {EditMobileRequestSchema} arg.body
156
+ * @returns {Promise<VerifyMobileOTPSuccess>} - Success response
157
+ * @summary: Add mobile number to profile
158
+ * @description: Use this API to add a new mobile number to a profile.
156
159
  */
157
- async loginWithGoogle({ body, platform } = {}) {
158
- const { error } = UserValidator.loginWithGoogle().validate(
160
+ async addMobileNumber({ body, platform } = {}) {
161
+ const { error } = UserValidator.addMobileNumber().validate(
159
162
  { body, platform },
160
163
  { abortEarly: false, allowUnknown: true }
161
164
  );
@@ -164,14 +167,14 @@ class User {
164
167
  }
165
168
 
166
169
  // Showing warrnings if extra unknown parameters are found
167
- const { error: warrning } = UserValidator.loginWithGoogle().validate(
170
+ const { error: warrning } = UserValidator.addMobileNumber().validate(
168
171
  { body, platform },
169
172
  { abortEarly: false, allowUnknown: false }
170
173
  );
171
174
  if (warrning) {
172
175
  Logger({
173
176
  level: "WARN",
174
- message: "Parameter Validation warrnings for loginWithGoogle",
177
+ message: "Parameter Validation warrnings for addMobileNumber",
175
178
  });
176
179
  Logger({ level: "WARN", message: warrning });
177
180
  }
@@ -181,11 +184,11 @@ class User {
181
184
 
182
185
  const xHeaders = {};
183
186
 
184
- const response = await APIClient.execute(
187
+ const response = await ApplicationAPIClient.execute(
185
188
  this._conf,
186
- "post",
189
+ "put",
187
190
  constructUrl({
188
- url: this._urls["loginWithGoogle"],
191
+ url: this._urls["addMobileNumber"],
189
192
  params: {},
190
193
  }),
191
194
  query_params,
@@ -193,7 +196,9 @@ class User {
193
196
  xHeaders
194
197
  );
195
198
 
196
- const { error: res_error } = UserModel.AuthSuccess().validate(response, {
199
+ const {
200
+ error: res_error,
201
+ } = UserModel.VerifyMobileOTPSuccess().validate(response, {
197
202
  abortEarly: false,
198
203
  allowUnknown: false,
199
204
  });
@@ -201,7 +206,7 @@ class User {
201
206
  if (res_error) {
202
207
  Logger({
203
208
  level: "WARN",
204
- message: "Response Validation Warnnings for loginWithGoogle",
209
+ message: "Response Validation Warnnings for addMobileNumber",
205
210
  });
206
211
  Logger({ level: "WARN", message: res_error });
207
212
  }
@@ -212,14 +217,22 @@ class User {
212
217
  /**
213
218
  * @param {Object} arg - Arg object.
214
219
  * @param {string} [arg.platform] - ID of the application
215
- * @param {OAuthRequestSchema} arg.body
216
- * @returns {Promise<AuthSuccess>} - Success response
217
- * @summary: Login or Register using Google on Android
218
- * @description: Use this API to login or register in Android app using Google Account credentials.
220
+ * @param {boolean} arg.active - This is a boolean value to check if email
221
+ * ID is active 1. True - Email ID is active 2.False - Email ID is inactive
222
+ * @param {boolean} arg.primary - This is a boolean value to check if email
223
+ * ID is primary (main email ID) 1. True - Email ID is primary 2.False -
224
+ * Email ID is not primary
225
+ * @param {boolean} arg.verified - This is a boolean value to check if email
226
+ * ID is verified 1. True - Email ID is verified 2.False - Email ID is not
227
+ * verified yet
228
+ * @param {string} arg.email - The email ID to delete
229
+ * @returns {Promise<LoginSuccess>} - Success response
230
+ * @summary: Delete email from profile
231
+ * @description: Use this API to delete an email address from a profile
219
232
  */
220
- async loginWithGoogleAndroid({ body, platform } = {}) {
221
- const { error } = UserValidator.loginWithGoogleAndroid().validate(
222
- { body, platform },
233
+ async deleteEmail({ active, primary, verified, email, platform } = {}) {
234
+ const { error } = UserValidator.deleteEmail().validate(
235
+ { active, primary, verified, email, platform },
223
236
  { abortEarly: false, allowUnknown: true }
224
237
  );
225
238
  if (error) {
@@ -227,36 +240,40 @@ class User {
227
240
  }
228
241
 
229
242
  // Showing warrnings if extra unknown parameters are found
230
- const { error: warrning } = UserValidator.loginWithGoogleAndroid().validate(
231
- { body, platform },
243
+ const { error: warrning } = UserValidator.deleteEmail().validate(
244
+ { active, primary, verified, email, platform },
232
245
  { abortEarly: false, allowUnknown: false }
233
246
  );
234
247
  if (warrning) {
235
248
  Logger({
236
249
  level: "WARN",
237
- message: "Parameter Validation warrnings for loginWithGoogleAndroid",
250
+ message: "Parameter Validation warrnings for deleteEmail",
238
251
  });
239
252
  Logger({ level: "WARN", message: warrning });
240
253
  }
241
254
 
242
255
  const query_params = {};
243
256
  query_params["platform"] = platform;
257
+ query_params["active"] = active;
258
+ query_params["primary"] = primary;
259
+ query_params["verified"] = verified;
260
+ query_params["email"] = email;
244
261
 
245
262
  const xHeaders = {};
246
263
 
247
- const response = await APIClient.execute(
264
+ const response = await ApplicationAPIClient.execute(
248
265
  this._conf,
249
- "post",
266
+ "delete",
250
267
  constructUrl({
251
- url: this._urls["loginWithGoogleAndroid"],
268
+ url: this._urls["deleteEmail"],
252
269
  params: {},
253
270
  }),
254
271
  query_params,
255
- body,
272
+ undefined,
256
273
  xHeaders
257
274
  );
258
275
 
259
- const { error: res_error } = UserModel.AuthSuccess().validate(response, {
276
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
260
277
  abortEarly: false,
261
278
  allowUnknown: false,
262
279
  });
@@ -264,7 +281,7 @@ class User {
264
281
  if (res_error) {
265
282
  Logger({
266
283
  level: "WARN",
267
- message: "Response Validation Warnnings for loginWithGoogleAndroid",
284
+ message: "Response Validation Warnnings for deleteEmail",
268
285
  });
269
286
  Logger({ level: "WARN", message: res_error });
270
287
  }
@@ -275,14 +292,30 @@ class User {
275
292
  /**
276
293
  * @param {Object} arg - Arg object.
277
294
  * @param {string} [arg.platform] - ID of the application
278
- * @param {OAuthRequestSchema} arg.body
279
- * @returns {Promise<AuthSuccess>} - Success response
280
- * @summary: Login or Register using Google on iOS
281
- * @description: Use this API to login or register in iOS app using Google Account credentials.
295
+ * @param {boolean} arg.active - This is a boolean value to check if mobile
296
+ * number is active 1.True - Number is active 2. False - Number is inactive
297
+ * @param {boolean} arg.primary - This is a boolean value to check if mobile
298
+ * number is primary number (main number) 1. True - Number is primary 2.
299
+ * False - Number is not primary
300
+ * @param {boolean} arg.verified - This is a boolean value to check if
301
+ * mobile number is verified 1. True - Number is verified 2.False - Number
302
+ * is not verified yet
303
+ * @param {string} arg.countryCode - Country code of the phone number, e.g. 91
304
+ * @param {string} arg.phone - Phone number
305
+ * @returns {Promise<LoginSuccess>} - Success response
306
+ * @summary: Delete mobile number from profile
307
+ * @description: Use this API to delete a mobile number from a profile.
282
308
  */
283
- async loginWithGoogleIOS({ body, platform } = {}) {
284
- const { error } = UserValidator.loginWithGoogleIOS().validate(
285
- { body, platform },
309
+ async deleteMobileNumber({
310
+ active,
311
+ primary,
312
+ verified,
313
+ countryCode,
314
+ phone,
315
+ platform,
316
+ } = {}) {
317
+ const { error } = UserValidator.deleteMobileNumber().validate(
318
+ { active, primary, verified, countryCode, phone, platform },
286
319
  { abortEarly: false, allowUnknown: true }
287
320
  );
288
321
  if (error) {
@@ -290,36 +323,41 @@ class User {
290
323
  }
291
324
 
292
325
  // Showing warrnings if extra unknown parameters are found
293
- const { error: warrning } = UserValidator.loginWithGoogleIOS().validate(
294
- { body, platform },
326
+ const { error: warrning } = UserValidator.deleteMobileNumber().validate(
327
+ { active, primary, verified, countryCode, phone, platform },
295
328
  { abortEarly: false, allowUnknown: false }
296
329
  );
297
330
  if (warrning) {
298
331
  Logger({
299
332
  level: "WARN",
300
- message: "Parameter Validation warrnings for loginWithGoogleIOS",
333
+ message: "Parameter Validation warrnings for deleteMobileNumber",
301
334
  });
302
335
  Logger({ level: "WARN", message: warrning });
303
336
  }
304
337
 
305
338
  const query_params = {};
306
339
  query_params["platform"] = platform;
340
+ query_params["active"] = active;
341
+ query_params["primary"] = primary;
342
+ query_params["verified"] = verified;
343
+ query_params["country_code"] = countryCode;
344
+ query_params["phone"] = phone;
307
345
 
308
346
  const xHeaders = {};
309
347
 
310
- const response = await APIClient.execute(
348
+ const response = await ApplicationAPIClient.execute(
311
349
  this._conf,
312
- "post",
350
+ "delete",
313
351
  constructUrl({
314
- url: this._urls["loginWithGoogleIOS"],
352
+ url: this._urls["deleteMobileNumber"],
315
353
  params: {},
316
354
  }),
317
355
  query_params,
318
- body,
356
+ undefined,
319
357
  xHeaders
320
358
  );
321
359
 
322
- const { error: res_error } = UserModel.AuthSuccess().validate(response, {
360
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
323
361
  abortEarly: false,
324
362
  allowUnknown: false,
325
363
  });
@@ -327,7 +365,7 @@ class User {
327
365
  if (res_error) {
328
366
  Logger({
329
367
  level: "WARN",
330
- message: "Response Validation Warnnings for loginWithGoogleIOS",
368
+ message: "Response Validation Warnnings for deleteMobileNumber",
331
369
  });
332
370
  Logger({ level: "WARN", message: res_error });
333
371
  }
@@ -337,15 +375,14 @@ class User {
337
375
 
338
376
  /**
339
377
  * @param {Object} arg - Arg object.
340
- * @param {string} [arg.platform] - ID of the application
341
- * @param {OAuthRequestAppleSchema} arg.body
342
- * @returns {Promise<AuthSuccess>} - Success response
343
- * @summary: Login or Register using Apple on iOS
344
- * @description: Use this API to login or register in iOS app using Apple Account credentials.
378
+ * @param {DeleteApplicationUserRequestSchema} arg.body
379
+ * @returns {Promise<DeleteUserSuccess>} - Success response
380
+ * @summary: verify otp and delete user
381
+ * @description: verify otp and delete user
345
382
  */
346
- async loginWithAppleIOS({ body, platform } = {}) {
347
- const { error } = UserValidator.loginWithAppleIOS().validate(
348
- { body, platform },
383
+ async deleteUser({ body } = {}) {
384
+ const { error } = UserValidator.deleteUser().validate(
385
+ { body },
349
386
  { abortEarly: false, allowUnknown: true }
350
387
  );
351
388
  if (error) {
@@ -353,28 +390,27 @@ class User {
353
390
  }
354
391
 
355
392
  // Showing warrnings if extra unknown parameters are found
356
- const { error: warrning } = UserValidator.loginWithAppleIOS().validate(
357
- { body, platform },
393
+ const { error: warrning } = UserValidator.deleteUser().validate(
394
+ { body },
358
395
  { abortEarly: false, allowUnknown: false }
359
396
  );
360
397
  if (warrning) {
361
398
  Logger({
362
399
  level: "WARN",
363
- message: "Parameter Validation warrnings for loginWithAppleIOS",
400
+ message: "Parameter Validation warrnings for deleteUser",
364
401
  });
365
402
  Logger({ level: "WARN", message: warrning });
366
403
  }
367
404
 
368
405
  const query_params = {};
369
- query_params["platform"] = platform;
370
406
 
371
407
  const xHeaders = {};
372
408
 
373
- const response = await APIClient.execute(
409
+ const response = await ApplicationAPIClient.execute(
374
410
  this._conf,
375
411
  "post",
376
412
  constructUrl({
377
- url: this._urls["loginWithAppleIOS"],
413
+ url: this._urls["deleteUser"],
378
414
  params: {},
379
415
  }),
380
416
  query_params,
@@ -382,7 +418,9 @@ class User {
382
418
  xHeaders
383
419
  );
384
420
 
385
- const { error: res_error } = UserModel.AuthSuccess().validate(response, {
421
+ const {
422
+ error: res_error,
423
+ } = UserModel.DeleteUserSuccess().validate(response, {
386
424
  abortEarly: false,
387
425
  allowUnknown: false,
388
426
  });
@@ -390,7 +428,7 @@ class User {
390
428
  if (res_error) {
391
429
  Logger({
392
430
  level: "WARN",
393
- message: "Response Validation Warnnings for loginWithAppleIOS",
431
+ message: "Response Validation Warnnings for deleteUser",
394
432
  });
395
433
  Logger({ level: "WARN", message: res_error });
396
434
  }
@@ -400,15 +438,14 @@ class User {
400
438
 
401
439
  /**
402
440
  * @param {Object} arg - Arg object.
403
- * @param {string} [arg.platform] - ID of the application
404
- * @param {SendOtpRequestSchema} arg.body
405
- * @returns {Promise<SendOtpResponse>} - Success response
406
- * @summary: Login or Register with OTP
407
- * @description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS.
441
+ * @param {ForgotPasswordRequestSchema} arg.body
442
+ * @returns {Promise<LoginSuccess>} - Success response
443
+ * @summary: Forgot Password
444
+ * @description: Use this API to reset a password using the code sent on email or SMS.
408
445
  */
409
- async loginWithOTP({ body, platform } = {}) {
410
- const { error } = UserValidator.loginWithOTP().validate(
411
- { body, platform },
446
+ async forgotPassword({ body } = {}) {
447
+ const { error } = UserValidator.forgotPassword().validate(
448
+ { body },
412
449
  { abortEarly: false, allowUnknown: true }
413
450
  );
414
451
  if (error) {
@@ -416,28 +453,27 @@ class User {
416
453
  }
417
454
 
418
455
  // Showing warrnings if extra unknown parameters are found
419
- const { error: warrning } = UserValidator.loginWithOTP().validate(
420
- { body, platform },
456
+ const { error: warrning } = UserValidator.forgotPassword().validate(
457
+ { body },
421
458
  { abortEarly: false, allowUnknown: false }
422
459
  );
423
460
  if (warrning) {
424
461
  Logger({
425
462
  level: "WARN",
426
- message: "Parameter Validation warrnings for loginWithOTP",
463
+ message: "Parameter Validation warrnings for forgotPassword",
427
464
  });
428
465
  Logger({ level: "WARN", message: warrning });
429
466
  }
430
467
 
431
468
  const query_params = {};
432
- query_params["platform"] = platform;
433
469
 
434
470
  const xHeaders = {};
435
471
 
436
- const response = await APIClient.execute(
472
+ const response = await ApplicationAPIClient.execute(
437
473
  this._conf,
438
474
  "post",
439
475
  constructUrl({
440
- url: this._urls["loginWithOTP"],
476
+ url: this._urls["forgotPassword"],
441
477
  params: {},
442
478
  }),
443
479
  query_params,
@@ -445,15 +481,15 @@ class User {
445
481
  xHeaders
446
482
  );
447
483
 
448
- const { error: res_error } = UserModel.SendOtpResponse().validate(
449
- response,
450
- { abortEarly: false, allowUnknown: false }
451
- );
484
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
485
+ abortEarly: false,
486
+ allowUnknown: false,
487
+ });
452
488
 
453
489
  if (res_error) {
454
490
  Logger({
455
491
  level: "WARN",
456
- message: "Response Validation Warnnings for loginWithOTP",
492
+ message: "Response Validation Warnnings for forgotPassword",
457
493
  });
458
494
  Logger({ level: "WARN", message: res_error });
459
495
  }
@@ -463,14 +499,13 @@ class User {
463
499
 
464
500
  /**
465
501
  * @param {Object} arg - Arg object.
466
- * @param {PasswordLoginRequestSchema} arg.body
467
- * @returns {Promise<LoginSuccess>} - Success response
468
- * @summary: Login or Register with password
469
- * @description: Use this API to login or register using an email address and password.
502
+ * @returns {Promise<SessionListSuccess>} - Success response
503
+ * @summary: Get list of sessions
504
+ * @description: Use this API to retrieve all active sessions of a user.
470
505
  */
471
- async loginWithEmailAndPassword({ body } = {}) {
472
- const { error } = UserValidator.loginWithEmailAndPassword().validate(
473
- { body },
506
+ async getListOfActiveSessions({} = {}) {
507
+ const { error } = UserValidator.getListOfActiveSessions().validate(
508
+ {},
474
509
  { abortEarly: false, allowUnknown: true }
475
510
  );
476
511
  if (error) {
@@ -480,14 +515,14 @@ class User {
480
515
  // Showing warrnings if extra unknown parameters are found
481
516
  const {
482
517
  error: warrning,
483
- } = UserValidator.loginWithEmailAndPassword().validate(
484
- { body },
518
+ } = UserValidator.getListOfActiveSessions().validate(
519
+ {},
485
520
  { abortEarly: false, allowUnknown: false }
486
521
  );
487
522
  if (warrning) {
488
523
  Logger({
489
524
  level: "WARN",
490
- message: "Parameter Validation warrnings for loginWithEmailAndPassword",
525
+ message: "Parameter Validation warrnings for getListOfActiveSessions",
491
526
  });
492
527
  Logger({ level: "WARN", message: warrning });
493
528
  }
@@ -496,19 +531,21 @@ class User {
496
531
 
497
532
  const xHeaders = {};
498
533
 
499
- const response = await APIClient.execute(
534
+ const response = await ApplicationAPIClient.execute(
500
535
  this._conf,
501
- "post",
536
+ "get",
502
537
  constructUrl({
503
- url: this._urls["loginWithEmailAndPassword"],
538
+ url: this._urls["getListOfActiveSessions"],
504
539
  params: {},
505
540
  }),
506
541
  query_params,
507
- body,
542
+ undefined,
508
543
  xHeaders
509
544
  );
510
545
 
511
- const { error: res_error } = UserModel.LoginSuccess().validate(response, {
546
+ const {
547
+ error: res_error,
548
+ } = UserModel.SessionListSuccess().validate(response, {
512
549
  abortEarly: false,
513
550
  allowUnknown: false,
514
551
  });
@@ -516,7 +553,7 @@ class User {
516
553
  if (res_error) {
517
554
  Logger({
518
555
  level: "WARN",
519
- message: "Response Validation Warnnings for loginWithEmailAndPassword",
556
+ message: "Response Validation Warnnings for getListOfActiveSessions",
520
557
  });
521
558
  Logger({ level: "WARN", message: res_error });
522
559
  }
@@ -526,15 +563,13 @@ class User {
526
563
 
527
564
  /**
528
565
  * @param {Object} arg - Arg object.
529
- * @param {string} [arg.platform] - ID of the application
530
- * @param {SendResetPasswordEmailRequestSchema} arg.body
531
- * @returns {Promise<ResetPasswordSuccess>} - Success response
532
- * @summary: Reset Password
533
- * @description: Use this API to reset a password using the link sent on email.
566
+ * @returns {Promise<UserObjectSchema>} - Success response
567
+ * @summary: Get logged in user
568
+ * @description: Use this API to get the details of a logged in user.
534
569
  */
535
- async sendResetPasswordEmail({ body, platform } = {}) {
536
- const { error } = UserValidator.sendResetPasswordEmail().validate(
537
- { body, platform },
570
+ async getLoggedInUser({} = {}) {
571
+ const { error } = UserValidator.getLoggedInUser().validate(
572
+ {},
538
573
  { abortEarly: false, allowUnknown: true }
539
574
  );
540
575
  if (error) {
@@ -542,46 +577,43 @@ class User {
542
577
  }
543
578
 
544
579
  // Showing warrnings if extra unknown parameters are found
545
- const { error: warrning } = UserValidator.sendResetPasswordEmail().validate(
546
- { body, platform },
580
+ const { error: warrning } = UserValidator.getLoggedInUser().validate(
581
+ {},
547
582
  { abortEarly: false, allowUnknown: false }
548
583
  );
549
584
  if (warrning) {
550
585
  Logger({
551
586
  level: "WARN",
552
- message: "Parameter Validation warrnings for sendResetPasswordEmail",
587
+ message: "Parameter Validation warrnings for getLoggedInUser",
553
588
  });
554
589
  Logger({ level: "WARN", message: warrning });
555
590
  }
556
591
 
557
592
  const query_params = {};
558
- query_params["platform"] = platform;
559
593
 
560
594
  const xHeaders = {};
561
595
 
562
- const response = await APIClient.execute(
596
+ const response = await ApplicationAPIClient.execute(
563
597
  this._conf,
564
- "post",
598
+ "get",
565
599
  constructUrl({
566
- url: this._urls["sendResetPasswordEmail"],
600
+ url: this._urls["getLoggedInUser"],
567
601
  params: {},
568
602
  }),
569
603
  query_params,
570
- body,
604
+ undefined,
571
605
  xHeaders
572
606
  );
573
607
 
574
- const {
575
- error: res_error,
576
- } = UserModel.ResetPasswordSuccess().validate(response, {
577
- abortEarly: false,
578
- allowUnknown: false,
579
- });
608
+ const { error: res_error } = UserModel.UserObjectSchema().validate(
609
+ response,
610
+ { abortEarly: false, allowUnknown: false }
611
+ );
580
612
 
581
613
  if (res_error) {
582
614
  Logger({
583
615
  level: "WARN",
584
- message: "Response Validation Warnnings for sendResetPasswordEmail",
616
+ message: "Response Validation Warnnings for getLoggedInUser",
585
617
  });
586
618
  Logger({ level: "WARN", message: res_error });
587
619
  }
@@ -591,15 +623,14 @@ class User {
591
623
 
592
624
  /**
593
625
  * @param {Object} arg - Arg object.
594
- * @param {string} [arg.platform] - ID of the application
595
- * @param {SendResetPasswordMobileRequestSchema} arg.body
596
- * @returns {Promise<ResetPasswordSuccess>} - Success response
597
- * @summary: Reset Password
598
- * @description: Use this API to reset a password using the link sent on mobile.
626
+ * @param {string} [arg.name] - Name of the application, e.g. Fynd
627
+ * @returns {Promise<PlatformSchema>} - Success response
628
+ * @summary: Get platform configurations
629
+ * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text.
599
630
  */
600
- async sendResetPasswordMobile({ body, platform } = {}) {
601
- const { error } = UserValidator.sendResetPasswordMobile().validate(
602
- { body, platform },
631
+ async getPlatformConfig({ name } = {}) {
632
+ const { error } = UserValidator.getPlatformConfig().validate(
633
+ { name },
603
634
  { abortEarly: false, allowUnknown: true }
604
635
  );
605
636
  if (error) {
@@ -607,40 +638,36 @@ class User {
607
638
  }
608
639
 
609
640
  // Showing warrnings if extra unknown parameters are found
610
- const {
611
- error: warrning,
612
- } = UserValidator.sendResetPasswordMobile().validate(
613
- { body, platform },
641
+ const { error: warrning } = UserValidator.getPlatformConfig().validate(
642
+ { name },
614
643
  { abortEarly: false, allowUnknown: false }
615
644
  );
616
645
  if (warrning) {
617
646
  Logger({
618
647
  level: "WARN",
619
- message: "Parameter Validation warrnings for sendResetPasswordMobile",
648
+ message: "Parameter Validation warrnings for getPlatformConfig",
620
649
  });
621
650
  Logger({ level: "WARN", message: warrning });
622
651
  }
623
652
 
624
653
  const query_params = {};
625
- query_params["platform"] = platform;
654
+ query_params["name"] = name;
626
655
 
627
656
  const xHeaders = {};
628
657
 
629
- const response = await APIClient.execute(
658
+ const response = await ApplicationAPIClient.execute(
630
659
  this._conf,
631
- "post",
660
+ "get",
632
661
  constructUrl({
633
- url: this._urls["sendResetPasswordMobile"],
662
+ url: this._urls["getPlatformConfig"],
634
663
  params: {},
635
664
  }),
636
665
  query_params,
637
- body,
666
+ undefined,
638
667
  xHeaders
639
668
  );
640
669
 
641
- const {
642
- error: res_error,
643
- } = UserModel.ResetPasswordSuccess().validate(response, {
670
+ const { error: res_error } = UserModel.PlatformSchema().validate(response, {
644
671
  abortEarly: false,
645
672
  allowUnknown: false,
646
673
  });
@@ -648,7 +675,7 @@ class User {
648
675
  if (res_error) {
649
676
  Logger({
650
677
  level: "WARN",
651
- message: "Response Validation Warnnings for sendResetPasswordMobile",
678
+ message: "Response Validation Warnnings for getPlatformConfig",
652
679
  });
653
680
  Logger({ level: "WARN", message: res_error });
654
681
  }
@@ -656,16 +683,15 @@ class User {
656
683
  return response;
657
684
  }
658
685
 
659
- /**
660
- * @param {Object} arg - Arg object.
661
- * @param {ForgotPasswordRequestSchema} arg.body
662
- * @returns {Promise<LoginSuccess>} - Success response
663
- * @summary: Forgot Password
664
- * @description: Use this API to reset a password using the code sent on email or SMS.
686
+ /**
687
+ * @param {Object} arg - Arg object.
688
+ * @returns {Promise<HasPasswordSuccess>} - Success response
689
+ * @summary: Check password
690
+ * @description: Use this API to check if user has created a password for login.
665
691
  */
666
- async forgotPassword({ body } = {}) {
667
- const { error } = UserValidator.forgotPassword().validate(
668
- { body },
692
+ async hasPassword({} = {}) {
693
+ const { error } = UserValidator.hasPassword().validate(
694
+ {},
669
695
  { abortEarly: false, allowUnknown: true }
670
696
  );
671
697
  if (error) {
@@ -673,14 +699,14 @@ class User {
673
699
  }
674
700
 
675
701
  // Showing warrnings if extra unknown parameters are found
676
- const { error: warrning } = UserValidator.forgotPassword().validate(
677
- { body },
702
+ const { error: warrning } = UserValidator.hasPassword().validate(
703
+ {},
678
704
  { abortEarly: false, allowUnknown: false }
679
705
  );
680
706
  if (warrning) {
681
707
  Logger({
682
708
  level: "WARN",
683
- message: "Parameter Validation warrnings for forgotPassword",
709
+ message: "Parameter Validation warrnings for hasPassword",
684
710
  });
685
711
  Logger({ level: "WARN", message: warrning });
686
712
  }
@@ -689,19 +715,21 @@ class User {
689
715
 
690
716
  const xHeaders = {};
691
717
 
692
- const response = await APIClient.execute(
718
+ const response = await ApplicationAPIClient.execute(
693
719
  this._conf,
694
- "post",
720
+ "get",
695
721
  constructUrl({
696
- url: this._urls["forgotPassword"],
722
+ url: this._urls["hasPassword"],
697
723
  params: {},
698
724
  }),
699
725
  query_params,
700
- body,
726
+ undefined,
701
727
  xHeaders
702
728
  );
703
729
 
704
- const { error: res_error } = UserModel.LoginSuccess().validate(response, {
730
+ const {
731
+ error: res_error,
732
+ } = UserModel.HasPasswordSuccess().validate(response, {
705
733
  abortEarly: false,
706
734
  allowUnknown: false,
707
735
  });
@@ -709,7 +737,7 @@ class User {
709
737
  if (res_error) {
710
738
  Logger({
711
739
  level: "WARN",
712
- message: "Response Validation Warnnings for forgotPassword",
740
+ message: "Response Validation Warnnings for hasPassword",
713
741
  });
714
742
  Logger({ level: "WARN", message: res_error });
715
743
  }
@@ -719,14 +747,15 @@ class User {
719
747
 
720
748
  /**
721
749
  * @param {Object} arg - Arg object.
722
- * @param {CodeRequestBodySchema} arg.body
723
- * @returns {Promise<ResetPasswordSuccess>} - Success response
724
- * @summary: Reset Password using token
725
- * @description: Use this API to send code to reset password.
750
+ * @param {string} [arg.platform] - ID of the application
751
+ * @param {OAuthRequestAppleSchema} arg.body
752
+ * @returns {Promise<AuthSuccess>} - Success response
753
+ * @summary: Login or Register using Apple on iOS
754
+ * @description: Use this API to login or register in iOS app using Apple Account credentials.
726
755
  */
727
- async sendResetToken({ body } = {}) {
728
- const { error } = UserValidator.sendResetToken().validate(
729
- { body },
756
+ async loginWithAppleIOS({ body, platform } = {}) {
757
+ const { error } = UserValidator.loginWithAppleIOS().validate(
758
+ { body, platform },
730
759
  { abortEarly: false, allowUnknown: true }
731
760
  );
732
761
  if (error) {
@@ -734,27 +763,28 @@ class User {
734
763
  }
735
764
 
736
765
  // Showing warrnings if extra unknown parameters are found
737
- const { error: warrning } = UserValidator.sendResetToken().validate(
738
- { body },
766
+ const { error: warrning } = UserValidator.loginWithAppleIOS().validate(
767
+ { body, platform },
739
768
  { abortEarly: false, allowUnknown: false }
740
769
  );
741
770
  if (warrning) {
742
771
  Logger({
743
772
  level: "WARN",
744
- message: "Parameter Validation warrnings for sendResetToken",
773
+ message: "Parameter Validation warrnings for loginWithAppleIOS",
745
774
  });
746
775
  Logger({ level: "WARN", message: warrning });
747
776
  }
748
777
 
749
778
  const query_params = {};
779
+ query_params["platform"] = platform;
750
780
 
751
781
  const xHeaders = {};
752
782
 
753
- const response = await APIClient.execute(
783
+ const response = await ApplicationAPIClient.execute(
754
784
  this._conf,
755
785
  "post",
756
786
  constructUrl({
757
- url: this._urls["sendResetToken"],
787
+ url: this._urls["loginWithAppleIOS"],
758
788
  params: {},
759
789
  }),
760
790
  query_params,
@@ -762,9 +792,7 @@ class User {
762
792
  xHeaders
763
793
  );
764
794
 
765
- const {
766
- error: res_error,
767
- } = UserModel.ResetPasswordSuccess().validate(response, {
795
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
768
796
  abortEarly: false,
769
797
  allowUnknown: false,
770
798
  });
@@ -772,7 +800,7 @@ class User {
772
800
  if (res_error) {
773
801
  Logger({
774
802
  level: "WARN",
775
- message: "Response Validation Warnnings for sendResetToken",
803
+ message: "Response Validation Warnnings for loginWithAppleIOS",
776
804
  });
777
805
  Logger({ level: "WARN", message: res_error });
778
806
  }
@@ -782,13 +810,13 @@ class User {
782
810
 
783
811
  /**
784
812
  * @param {Object} arg - Arg object.
785
- * @param {TokenRequestBodySchema} arg.body
813
+ * @param {PasswordLoginRequestSchema} arg.body
786
814
  * @returns {Promise<LoginSuccess>} - Success response
787
- * @summary: Login or Register with token
788
- * @description: Use this API to login or register using a token for authentication.
815
+ * @summary: Login or Register with password
816
+ * @description: Use this API to login or register using an email address and password.
789
817
  */
790
- async loginWithToken({ body } = {}) {
791
- const { error } = UserValidator.loginWithToken().validate(
818
+ async loginWithEmailAndPassword({ body } = {}) {
819
+ const { error } = UserValidator.loginWithEmailAndPassword().validate(
792
820
  { body },
793
821
  { abortEarly: false, allowUnknown: true }
794
822
  );
@@ -797,14 +825,16 @@ class User {
797
825
  }
798
826
 
799
827
  // Showing warrnings if extra unknown parameters are found
800
- const { error: warrning } = UserValidator.loginWithToken().validate(
828
+ const {
829
+ error: warrning,
830
+ } = UserValidator.loginWithEmailAndPassword().validate(
801
831
  { body },
802
832
  { abortEarly: false, allowUnknown: false }
803
833
  );
804
834
  if (warrning) {
805
835
  Logger({
806
836
  level: "WARN",
807
- message: "Parameter Validation warrnings for loginWithToken",
837
+ message: "Parameter Validation warrnings for loginWithEmailAndPassword",
808
838
  });
809
839
  Logger({ level: "WARN", message: warrning });
810
840
  }
@@ -813,11 +843,11 @@ class User {
813
843
 
814
844
  const xHeaders = {};
815
845
 
816
- const response = await APIClient.execute(
846
+ const response = await ApplicationAPIClient.execute(
817
847
  this._conf,
818
848
  "post",
819
849
  constructUrl({
820
- url: this._urls["loginWithToken"],
850
+ url: this._urls["loginWithEmailAndPassword"],
821
851
  params: {},
822
852
  }),
823
853
  query_params,
@@ -833,7 +863,7 @@ class User {
833
863
  if (res_error) {
834
864
  Logger({
835
865
  level: "WARN",
836
- message: "Response Validation Warnnings for loginWithToken",
866
+ message: "Response Validation Warnnings for loginWithEmailAndPassword",
837
867
  });
838
868
  Logger({ level: "WARN", message: res_error });
839
869
  }
@@ -844,13 +874,13 @@ class User {
844
874
  /**
845
875
  * @param {Object} arg - Arg object.
846
876
  * @param {string} [arg.platform] - ID of the application
847
- * @param {FormRegisterRequestSchema} arg.body
848
- * @returns {Promise<RegisterFormSuccess>} - Success response
849
- * @summary: Registration using a form
850
- * @description: Use this API to perform user registration by sending form data in the request body.
877
+ * @param {OAuthRequestSchema} arg.body
878
+ * @returns {Promise<AuthSuccess>} - Success response
879
+ * @summary: Login or Register using Facebook
880
+ * @description: Use this API to login or register using Facebook credentials.
851
881
  */
852
- async registerWithForm({ body, platform } = {}) {
853
- const { error } = UserValidator.registerWithForm().validate(
882
+ async loginWithFacebook({ body, platform } = {}) {
883
+ const { error } = UserValidator.loginWithFacebook().validate(
854
884
  { body, platform },
855
885
  { abortEarly: false, allowUnknown: true }
856
886
  );
@@ -859,14 +889,14 @@ class User {
859
889
  }
860
890
 
861
891
  // Showing warrnings if extra unknown parameters are found
862
- const { error: warrning } = UserValidator.registerWithForm().validate(
892
+ const { error: warrning } = UserValidator.loginWithFacebook().validate(
863
893
  { body, platform },
864
894
  { abortEarly: false, allowUnknown: false }
865
895
  );
866
896
  if (warrning) {
867
897
  Logger({
868
898
  level: "WARN",
869
- message: "Parameter Validation warrnings for registerWithForm",
899
+ message: "Parameter Validation warrnings for loginWithFacebook",
870
900
  });
871
901
  Logger({ level: "WARN", message: warrning });
872
902
  }
@@ -876,11 +906,11 @@ class User {
876
906
 
877
907
  const xHeaders = {};
878
908
 
879
- const response = await APIClient.execute(
909
+ const response = await ApplicationAPIClient.execute(
880
910
  this._conf,
881
911
  "post",
882
912
  constructUrl({
883
- url: this._urls["registerWithForm"],
913
+ url: this._urls["loginWithFacebook"],
884
914
  params: {},
885
915
  }),
886
916
  query_params,
@@ -888,9 +918,7 @@ class User {
888
918
  xHeaders
889
919
  );
890
920
 
891
- const {
892
- error: res_error,
893
- } = UserModel.RegisterFormSuccess().validate(response, {
921
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
894
922
  abortEarly: false,
895
923
  allowUnknown: false,
896
924
  });
@@ -898,7 +926,7 @@ class User {
898
926
  if (res_error) {
899
927
  Logger({
900
928
  level: "WARN",
901
- message: "Response Validation Warnnings for registerWithForm",
929
+ message: "Response Validation Warnnings for loginWithFacebook",
902
930
  });
903
931
  Logger({ level: "WARN", message: res_error });
904
932
  }
@@ -908,14 +936,15 @@ class User {
908
936
 
909
937
  /**
910
938
  * @param {Object} arg - Arg object.
911
- * @param {CodeRequestBodySchema} arg.body
912
- * @returns {Promise<VerifyEmailSuccess>} - Success response
913
- * @summary: Verify email
914
- * @description: Use this API to send a verification code to verify an email.
939
+ * @param {string} [arg.platform] - ID of the application
940
+ * @param {OAuthRequestSchema} arg.body
941
+ * @returns {Promise<AuthSuccess>} - Success response
942
+ * @summary: Login or Register using Google
943
+ * @description: Use this API to login or register using Google Account credentials.
915
944
  */
916
- async verifyEmail({ body } = {}) {
917
- const { error } = UserValidator.verifyEmail().validate(
918
- { body },
945
+ async loginWithGoogle({ body, platform } = {}) {
946
+ const { error } = UserValidator.loginWithGoogle().validate(
947
+ { body, platform },
919
948
  { abortEarly: false, allowUnknown: true }
920
949
  );
921
950
  if (error) {
@@ -923,27 +952,28 @@ class User {
923
952
  }
924
953
 
925
954
  // Showing warrnings if extra unknown parameters are found
926
- const { error: warrning } = UserValidator.verifyEmail().validate(
927
- { body },
955
+ const { error: warrning } = UserValidator.loginWithGoogle().validate(
956
+ { body, platform },
928
957
  { abortEarly: false, allowUnknown: false }
929
958
  );
930
959
  if (warrning) {
931
960
  Logger({
932
961
  level: "WARN",
933
- message: "Parameter Validation warrnings for verifyEmail",
962
+ message: "Parameter Validation warrnings for loginWithGoogle",
934
963
  });
935
964
  Logger({ level: "WARN", message: warrning });
936
965
  }
937
966
 
938
967
  const query_params = {};
968
+ query_params["platform"] = platform;
939
969
 
940
970
  const xHeaders = {};
941
971
 
942
- const response = await APIClient.execute(
972
+ const response = await ApplicationAPIClient.execute(
943
973
  this._conf,
944
974
  "post",
945
975
  constructUrl({
946
- url: this._urls["verifyEmail"],
976
+ url: this._urls["loginWithGoogle"],
947
977
  params: {},
948
978
  }),
949
979
  query_params,
@@ -951,9 +981,7 @@ class User {
951
981
  xHeaders
952
982
  );
953
983
 
954
- const {
955
- error: res_error,
956
- } = UserModel.VerifyEmailSuccess().validate(response, {
984
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
957
985
  abortEarly: false,
958
986
  allowUnknown: false,
959
987
  });
@@ -961,7 +989,7 @@ class User {
961
989
  if (res_error) {
962
990
  Logger({
963
991
  level: "WARN",
964
- message: "Response Validation Warnnings for verifyEmail",
992
+ message: "Response Validation Warnnings for loginWithGoogle",
965
993
  });
966
994
  Logger({ level: "WARN", message: res_error });
967
995
  }
@@ -971,14 +999,15 @@ class User {
971
999
 
972
1000
  /**
973
1001
  * @param {Object} arg - Arg object.
974
- * @param {CodeRequestBodySchema} arg.body
975
- * @returns {Promise<VerifyEmailSuccess>} - Success response
976
- * @summary: Verify mobile
977
- * @description: Use this API to send a verification code to verify a mobile number.
1002
+ * @param {string} [arg.platform] - ID of the application
1003
+ * @param {OAuthRequestSchema} arg.body
1004
+ * @returns {Promise<AuthSuccess>} - Success response
1005
+ * @summary: Login or Register using Google on Android
1006
+ * @description: Use this API to login or register in Android app using Google Account credentials.
978
1007
  */
979
- async verifyMobile({ body } = {}) {
980
- const { error } = UserValidator.verifyMobile().validate(
981
- { body },
1008
+ async loginWithGoogleAndroid({ body, platform } = {}) {
1009
+ const { error } = UserValidator.loginWithGoogleAndroid().validate(
1010
+ { body, platform },
982
1011
  { abortEarly: false, allowUnknown: true }
983
1012
  );
984
1013
  if (error) {
@@ -986,27 +1015,28 @@ class User {
986
1015
  }
987
1016
 
988
1017
  // Showing warrnings if extra unknown parameters are found
989
- const { error: warrning } = UserValidator.verifyMobile().validate(
990
- { body },
1018
+ const { error: warrning } = UserValidator.loginWithGoogleAndroid().validate(
1019
+ { body, platform },
991
1020
  { abortEarly: false, allowUnknown: false }
992
1021
  );
993
1022
  if (warrning) {
994
1023
  Logger({
995
1024
  level: "WARN",
996
- message: "Parameter Validation warrnings for verifyMobile",
1025
+ message: "Parameter Validation warrnings for loginWithGoogleAndroid",
997
1026
  });
998
1027
  Logger({ level: "WARN", message: warrning });
999
1028
  }
1000
1029
 
1001
1030
  const query_params = {};
1031
+ query_params["platform"] = platform;
1002
1032
 
1003
1033
  const xHeaders = {};
1004
1034
 
1005
- const response = await APIClient.execute(
1035
+ const response = await ApplicationAPIClient.execute(
1006
1036
  this._conf,
1007
1037
  "post",
1008
1038
  constructUrl({
1009
- url: this._urls["verifyMobile"],
1039
+ url: this._urls["loginWithGoogleAndroid"],
1010
1040
  params: {},
1011
1041
  }),
1012
1042
  query_params,
@@ -1014,9 +1044,7 @@ class User {
1014
1044
  xHeaders
1015
1045
  );
1016
1046
 
1017
- const {
1018
- error: res_error,
1019
- } = UserModel.VerifyEmailSuccess().validate(response, {
1047
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
1020
1048
  abortEarly: false,
1021
1049
  allowUnknown: false,
1022
1050
  });
@@ -1024,7 +1052,7 @@ class User {
1024
1052
  if (res_error) {
1025
1053
  Logger({
1026
1054
  level: "WARN",
1027
- message: "Response Validation Warnnings for verifyMobile",
1055
+ message: "Response Validation Warnnings for loginWithGoogleAndroid",
1028
1056
  });
1029
1057
  Logger({ level: "WARN", message: res_error });
1030
1058
  }
@@ -1034,13 +1062,15 @@ class User {
1034
1062
 
1035
1063
  /**
1036
1064
  * @param {Object} arg - Arg object.
1037
- * @returns {Promise<HasPasswordSuccess>} - Success response
1038
- * @summary: Check password
1039
- * @description: Use this API to check if user has created a password for login.
1065
+ * @param {string} [arg.platform] - ID of the application
1066
+ * @param {OAuthRequestSchema} arg.body
1067
+ * @returns {Promise<AuthSuccess>} - Success response
1068
+ * @summary: Login or Register using Google on iOS
1069
+ * @description: Use this API to login or register in iOS app using Google Account credentials.
1040
1070
  */
1041
- async hasPassword({} = {}) {
1042
- const { error } = UserValidator.hasPassword().validate(
1043
- {},
1071
+ async loginWithGoogleIOS({ body, platform } = {}) {
1072
+ const { error } = UserValidator.loginWithGoogleIOS().validate(
1073
+ { body, platform },
1044
1074
  { abortEarly: false, allowUnknown: true }
1045
1075
  );
1046
1076
  if (error) {
@@ -1048,37 +1078,36 @@ class User {
1048
1078
  }
1049
1079
 
1050
1080
  // Showing warrnings if extra unknown parameters are found
1051
- const { error: warrning } = UserValidator.hasPassword().validate(
1052
- {},
1081
+ const { error: warrning } = UserValidator.loginWithGoogleIOS().validate(
1082
+ { body, platform },
1053
1083
  { abortEarly: false, allowUnknown: false }
1054
1084
  );
1055
1085
  if (warrning) {
1056
1086
  Logger({
1057
1087
  level: "WARN",
1058
- message: "Parameter Validation warrnings for hasPassword",
1088
+ message: "Parameter Validation warrnings for loginWithGoogleIOS",
1059
1089
  });
1060
1090
  Logger({ level: "WARN", message: warrning });
1061
1091
  }
1062
1092
 
1063
1093
  const query_params = {};
1094
+ query_params["platform"] = platform;
1064
1095
 
1065
1096
  const xHeaders = {};
1066
1097
 
1067
- const response = await APIClient.execute(
1098
+ const response = await ApplicationAPIClient.execute(
1068
1099
  this._conf,
1069
- "get",
1100
+ "post",
1070
1101
  constructUrl({
1071
- url: this._urls["hasPassword"],
1102
+ url: this._urls["loginWithGoogleIOS"],
1072
1103
  params: {},
1073
1104
  }),
1074
1105
  query_params,
1075
- undefined,
1106
+ body,
1076
1107
  xHeaders
1077
1108
  );
1078
1109
 
1079
- const {
1080
- error: res_error,
1081
- } = UserModel.HasPasswordSuccess().validate(response, {
1110
+ const { error: res_error } = UserModel.AuthSuccess().validate(response, {
1082
1111
  abortEarly: false,
1083
1112
  allowUnknown: false,
1084
1113
  });
@@ -1086,7 +1115,7 @@ class User {
1086
1115
  if (res_error) {
1087
1116
  Logger({
1088
1117
  level: "WARN",
1089
- message: "Response Validation Warnnings for hasPassword",
1118
+ message: "Response Validation Warnnings for loginWithGoogleIOS",
1090
1119
  });
1091
1120
  Logger({ level: "WARN", message: res_error });
1092
1121
  }
@@ -1096,14 +1125,15 @@ class User {
1096
1125
 
1097
1126
  /**
1098
1127
  * @param {Object} arg - Arg object.
1099
- * @param {UpdatePasswordRequestSchema} arg.body
1100
- * @returns {Promise<VerifyEmailSuccess>} - Success response
1101
- * @summary: Update user password
1102
- * @description: Use this API to update the password.
1128
+ * @param {string} [arg.platform] - ID of the application
1129
+ * @param {SendOtpRequestSchema} arg.body
1130
+ * @returns {Promise<SendOtpResponse>} - Success response
1131
+ * @summary: Login or Register with OTP
1132
+ * @description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS.
1103
1133
  */
1104
- async updatePassword({ body } = {}) {
1105
- const { error } = UserValidator.updatePassword().validate(
1106
- { body },
1134
+ async loginWithOTP({ body, platform } = {}) {
1135
+ const { error } = UserValidator.loginWithOTP().validate(
1136
+ { body, platform },
1107
1137
  { abortEarly: false, allowUnknown: true }
1108
1138
  );
1109
1139
  if (error) {
@@ -1111,27 +1141,28 @@ class User {
1111
1141
  }
1112
1142
 
1113
1143
  // Showing warrnings if extra unknown parameters are found
1114
- const { error: warrning } = UserValidator.updatePassword().validate(
1115
- { body },
1144
+ const { error: warrning } = UserValidator.loginWithOTP().validate(
1145
+ { body, platform },
1116
1146
  { abortEarly: false, allowUnknown: false }
1117
1147
  );
1118
1148
  if (warrning) {
1119
1149
  Logger({
1120
1150
  level: "WARN",
1121
- message: "Parameter Validation warrnings for updatePassword",
1151
+ message: "Parameter Validation warrnings for loginWithOTP",
1122
1152
  });
1123
1153
  Logger({ level: "WARN", message: warrning });
1124
1154
  }
1125
1155
 
1126
1156
  const query_params = {};
1157
+ query_params["platform"] = platform;
1127
1158
 
1128
1159
  const xHeaders = {};
1129
1160
 
1130
- const response = await APIClient.execute(
1161
+ const response = await ApplicationAPIClient.execute(
1131
1162
  this._conf,
1132
1163
  "post",
1133
1164
  constructUrl({
1134
- url: this._urls["updatePassword"],
1165
+ url: this._urls["loginWithOTP"],
1135
1166
  params: {},
1136
1167
  }),
1137
1168
  query_params,
@@ -1139,17 +1170,15 @@ class User {
1139
1170
  xHeaders
1140
1171
  );
1141
1172
 
1142
- const {
1143
- error: res_error,
1144
- } = UserModel.VerifyEmailSuccess().validate(response, {
1145
- abortEarly: false,
1146
- allowUnknown: false,
1147
- });
1173
+ const { error: res_error } = UserModel.SendOtpResponse().validate(
1174
+ response,
1175
+ { abortEarly: false, allowUnknown: false }
1176
+ );
1148
1177
 
1149
1178
  if (res_error) {
1150
1179
  Logger({
1151
1180
  level: "WARN",
1152
- message: "Response Validation Warnnings for updatePassword",
1181
+ message: "Response Validation Warnnings for loginWithOTP",
1153
1182
  });
1154
1183
  Logger({ level: "WARN", message: res_error });
1155
1184
  }
@@ -1159,13 +1188,13 @@ class User {
1159
1188
 
1160
1189
  /**
1161
1190
  * @param {Object} arg - Arg object.
1162
- * @param {DeleteApplicationUserRequestSchema} arg.body
1163
- * @returns {Promise<DeleteUserSuccess>} - Success response
1164
- * @summary: verify otp and delete user
1165
- * @description: verify otp and delete user
1191
+ * @param {TokenRequestBodySchema} arg.body
1192
+ * @returns {Promise<LoginSuccess>} - Success response
1193
+ * @summary: Login or Register with token
1194
+ * @description: Use this API to login or register using a token for authentication.
1166
1195
  */
1167
- async deleteUser({ body } = {}) {
1168
- const { error } = UserValidator.deleteUser().validate(
1196
+ async loginWithToken({ body } = {}) {
1197
+ const { error } = UserValidator.loginWithToken().validate(
1169
1198
  { body },
1170
1199
  { abortEarly: false, allowUnknown: true }
1171
1200
  );
@@ -1174,14 +1203,14 @@ class User {
1174
1203
  }
1175
1204
 
1176
1205
  // Showing warrnings if extra unknown parameters are found
1177
- const { error: warrning } = UserValidator.deleteUser().validate(
1206
+ const { error: warrning } = UserValidator.loginWithToken().validate(
1178
1207
  { body },
1179
1208
  { abortEarly: false, allowUnknown: false }
1180
1209
  );
1181
1210
  if (warrning) {
1182
1211
  Logger({
1183
1212
  level: "WARN",
1184
- message: "Parameter Validation warrnings for deleteUser",
1213
+ message: "Parameter Validation warrnings for loginWithToken",
1185
1214
  });
1186
1215
  Logger({ level: "WARN", message: warrning });
1187
1216
  }
@@ -1190,11 +1219,11 @@ class User {
1190
1219
 
1191
1220
  const xHeaders = {};
1192
1221
 
1193
- const response = await APIClient.execute(
1222
+ const response = await ApplicationAPIClient.execute(
1194
1223
  this._conf,
1195
1224
  "post",
1196
1225
  constructUrl({
1197
- url: this._urls["deleteUser"],
1226
+ url: this._urls["loginWithToken"],
1198
1227
  params: {},
1199
1228
  }),
1200
1229
  query_params,
@@ -1202,9 +1231,7 @@ class User {
1202
1231
  xHeaders
1203
1232
  );
1204
1233
 
1205
- const {
1206
- error: res_error,
1207
- } = UserModel.DeleteUserSuccess().validate(response, {
1234
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
1208
1235
  abortEarly: false,
1209
1236
  allowUnknown: false,
1210
1237
  });
@@ -1212,7 +1239,7 @@ class User {
1212
1239
  if (res_error) {
1213
1240
  Logger({
1214
1241
  level: "WARN",
1215
- message: "Response Validation Warnnings for deleteUser",
1242
+ message: "Response Validation Warnnings for loginWithToken",
1216
1243
  });
1217
1244
  Logger({ level: "WARN", message: res_error });
1218
1245
  }
@@ -1252,7 +1279,7 @@ class User {
1252
1279
 
1253
1280
  const xHeaders = {};
1254
1281
 
1255
- const response = await APIClient.execute(
1282
+ const response = await ApplicationAPIClient.execute(
1256
1283
  this._conf,
1257
1284
  "get",
1258
1285
  constructUrl({
@@ -1283,13 +1310,13 @@ class User {
1283
1310
  /**
1284
1311
  * @param {Object} arg - Arg object.
1285
1312
  * @param {string} [arg.platform] - ID of the application
1286
- * @param {SendMobileOtpRequestSchema} arg.body
1287
- * @returns {Promise<OtpSuccess>} - Success response
1288
- * @summary: Send OTP on mobile
1289
- * @description: Use this API to send an OTP to a mobile number.
1313
+ * @param {FormRegisterRequestSchema} arg.body
1314
+ * @returns {Promise<RegisterFormSuccess>} - Success response
1315
+ * @summary: Registration using a form
1316
+ * @description: Use this API to perform user registration by sending form data in the request body.
1290
1317
  */
1291
- async sendOTPOnMobile({ body, platform } = {}) {
1292
- const { error } = UserValidator.sendOTPOnMobile().validate(
1318
+ async registerWithForm({ body, platform } = {}) {
1319
+ const { error } = UserValidator.registerWithForm().validate(
1293
1320
  { body, platform },
1294
1321
  { abortEarly: false, allowUnknown: true }
1295
1322
  );
@@ -1298,14 +1325,14 @@ class User {
1298
1325
  }
1299
1326
 
1300
1327
  // Showing warrnings if extra unknown parameters are found
1301
- const { error: warrning } = UserValidator.sendOTPOnMobile().validate(
1328
+ const { error: warrning } = UserValidator.registerWithForm().validate(
1302
1329
  { body, platform },
1303
1330
  { abortEarly: false, allowUnknown: false }
1304
1331
  );
1305
1332
  if (warrning) {
1306
1333
  Logger({
1307
1334
  level: "WARN",
1308
- message: "Parameter Validation warrnings for sendOTPOnMobile",
1335
+ message: "Parameter Validation warrnings for registerWithForm",
1309
1336
  });
1310
1337
  Logger({ level: "WARN", message: warrning });
1311
1338
  }
@@ -1315,11 +1342,11 @@ class User {
1315
1342
 
1316
1343
  const xHeaders = {};
1317
1344
 
1318
- const response = await APIClient.execute(
1345
+ const response = await ApplicationAPIClient.execute(
1319
1346
  this._conf,
1320
1347
  "post",
1321
1348
  constructUrl({
1322
- url: this._urls["sendOTPOnMobile"],
1349
+ url: this._urls["registerWithForm"],
1323
1350
  params: {},
1324
1351
  }),
1325
1352
  query_params,
@@ -1327,7 +1354,9 @@ class User {
1327
1354
  xHeaders
1328
1355
  );
1329
1356
 
1330
- const { error: res_error } = UserModel.OtpSuccess().validate(response, {
1357
+ const {
1358
+ error: res_error,
1359
+ } = UserModel.RegisterFormSuccess().validate(response, {
1331
1360
  abortEarly: false,
1332
1361
  allowUnknown: false,
1333
1362
  });
@@ -1335,7 +1364,7 @@ class User {
1335
1364
  if (res_error) {
1336
1365
  Logger({
1337
1366
  level: "WARN",
1338
- message: "Response Validation Warnnings for sendOTPOnMobile",
1367
+ message: "Response Validation Warnnings for registerWithForm",
1339
1368
  });
1340
1369
  Logger({ level: "WARN", message: res_error });
1341
1370
  }
@@ -1346,13 +1375,13 @@ class User {
1346
1375
  /**
1347
1376
  * @param {Object} arg - Arg object.
1348
1377
  * @param {string} [arg.platform] - ID of the application
1349
- * @param {VerifyOtpRequestSchema} arg.body
1350
- * @returns {Promise<VerifyOtpSuccess>} - Success response
1351
- * @summary: Verify OTP on mobile
1352
- * @description: Use this API to verify the OTP received on a mobile number.
1378
+ * @param {SendEmailOtpRequestSchema} arg.body
1379
+ * @returns {Promise<EmailOtpSuccess>} - Success response
1380
+ * @summary: Send OTP on email
1381
+ * @description: Use this API to send an OTP to an email ID.
1353
1382
  */
1354
- async verifyMobileOTP({ body, platform } = {}) {
1355
- const { error } = UserValidator.verifyMobileOTP().validate(
1383
+ async sendOTPOnEmail({ body, platform } = {}) {
1384
+ const { error } = UserValidator.sendOTPOnEmail().validate(
1356
1385
  { body, platform },
1357
1386
  { abortEarly: false, allowUnknown: true }
1358
1387
  );
@@ -1361,14 +1390,14 @@ class User {
1361
1390
  }
1362
1391
 
1363
1392
  // Showing warrnings if extra unknown parameters are found
1364
- const { error: warrning } = UserValidator.verifyMobileOTP().validate(
1393
+ const { error: warrning } = UserValidator.sendOTPOnEmail().validate(
1365
1394
  { body, platform },
1366
1395
  { abortEarly: false, allowUnknown: false }
1367
1396
  );
1368
1397
  if (warrning) {
1369
1398
  Logger({
1370
1399
  level: "WARN",
1371
- message: "Parameter Validation warrnings for verifyMobileOTP",
1400
+ message: "Parameter Validation warrnings for sendOTPOnEmail",
1372
1401
  });
1373
1402
  Logger({ level: "WARN", message: warrning });
1374
1403
  }
@@ -1378,11 +1407,11 @@ class User {
1378
1407
 
1379
1408
  const xHeaders = {};
1380
1409
 
1381
- const response = await APIClient.execute(
1410
+ const response = await ApplicationAPIClient.execute(
1382
1411
  this._conf,
1383
1412
  "post",
1384
1413
  constructUrl({
1385
- url: this._urls["verifyMobileOTP"],
1414
+ url: this._urls["sendOTPOnEmail"],
1386
1415
  params: {},
1387
1416
  }),
1388
1417
  query_params,
@@ -1390,7 +1419,7 @@ class User {
1390
1419
  xHeaders
1391
1420
  );
1392
1421
 
1393
- const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
1422
+ const { error: res_error } = UserModel.EmailOtpSuccess().validate(
1394
1423
  response,
1395
1424
  { abortEarly: false, allowUnknown: false }
1396
1425
  );
@@ -1398,7 +1427,7 @@ class User {
1398
1427
  if (res_error) {
1399
1428
  Logger({
1400
1429
  level: "WARN",
1401
- message: "Response Validation Warnnings for verifyMobileOTP",
1430
+ message: "Response Validation Warnnings for sendOTPOnEmail",
1402
1431
  });
1403
1432
  Logger({ level: "WARN", message: res_error });
1404
1433
  }
@@ -1409,13 +1438,13 @@ class User {
1409
1438
  /**
1410
1439
  * @param {Object} arg - Arg object.
1411
1440
  * @param {string} [arg.platform] - ID of the application
1412
- * @param {SendEmailOtpRequestSchema} arg.body
1413
- * @returns {Promise<EmailOtpSuccess>} - Success response
1414
- * @summary: Send OTP on email
1415
- * @description: Use this API to send an OTP to an email ID.
1441
+ * @param {SendMobileOtpRequestSchema} arg.body
1442
+ * @returns {Promise<OtpSuccess>} - Success response
1443
+ * @summary: Send OTP on mobile
1444
+ * @description: Use this API to send an OTP to a mobile number.
1416
1445
  */
1417
- async sendOTPOnEmail({ body, platform } = {}) {
1418
- const { error } = UserValidator.sendOTPOnEmail().validate(
1446
+ async sendOTPOnMobile({ body, platform } = {}) {
1447
+ const { error } = UserValidator.sendOTPOnMobile().validate(
1419
1448
  { body, platform },
1420
1449
  { abortEarly: false, allowUnknown: true }
1421
1450
  );
@@ -1424,14 +1453,14 @@ class User {
1424
1453
  }
1425
1454
 
1426
1455
  // Showing warrnings if extra unknown parameters are found
1427
- const { error: warrning } = UserValidator.sendOTPOnEmail().validate(
1456
+ const { error: warrning } = UserValidator.sendOTPOnMobile().validate(
1428
1457
  { body, platform },
1429
1458
  { abortEarly: false, allowUnknown: false }
1430
1459
  );
1431
1460
  if (warrning) {
1432
1461
  Logger({
1433
1462
  level: "WARN",
1434
- message: "Parameter Validation warrnings for sendOTPOnEmail",
1463
+ message: "Parameter Validation warrnings for sendOTPOnMobile",
1435
1464
  });
1436
1465
  Logger({ level: "WARN", message: warrning });
1437
1466
  }
@@ -1441,11 +1470,11 @@ class User {
1441
1470
 
1442
1471
  const xHeaders = {};
1443
1472
 
1444
- const response = await APIClient.execute(
1473
+ const response = await ApplicationAPIClient.execute(
1445
1474
  this._conf,
1446
1475
  "post",
1447
1476
  constructUrl({
1448
- url: this._urls["sendOTPOnEmail"],
1477
+ url: this._urls["sendOTPOnMobile"],
1449
1478
  params: {},
1450
1479
  }),
1451
1480
  query_params,
@@ -1453,15 +1482,15 @@ class User {
1453
1482
  xHeaders
1454
1483
  );
1455
1484
 
1456
- const { error: res_error } = UserModel.EmailOtpSuccess().validate(
1457
- response,
1458
- { abortEarly: false, allowUnknown: false }
1459
- );
1485
+ const { error: res_error } = UserModel.OtpSuccess().validate(response, {
1486
+ abortEarly: false,
1487
+ allowUnknown: false,
1488
+ });
1460
1489
 
1461
1490
  if (res_error) {
1462
1491
  Logger({
1463
1492
  level: "WARN",
1464
- message: "Response Validation Warnnings for sendOTPOnEmail",
1493
+ message: "Response Validation Warnnings for sendOTPOnMobile",
1465
1494
  });
1466
1495
  Logger({ level: "WARN", message: res_error });
1467
1496
  }
@@ -1472,13 +1501,13 @@ class User {
1472
1501
  /**
1473
1502
  * @param {Object} arg - Arg object.
1474
1503
  * @param {string} [arg.platform] - ID of the application
1475
- * @param {VerifyEmailOtpRequestSchema} arg.body
1476
- * @returns {Promise<VerifyOtpSuccess>} - Success response
1477
- * @summary: Verify OTP on email
1478
- * @description: Use this API to verify the OTP received on an email ID.
1504
+ * @param {SendResetPasswordEmailRequestSchema} arg.body
1505
+ * @returns {Promise<ResetPasswordSuccess>} - Success response
1506
+ * @summary: Reset Password
1507
+ * @description: Use this API to reset a password using the link sent on email.
1479
1508
  */
1480
- async verifyEmailOTP({ body, platform } = {}) {
1481
- const { error } = UserValidator.verifyEmailOTP().validate(
1509
+ async sendResetPasswordEmail({ body, platform } = {}) {
1510
+ const { error } = UserValidator.sendResetPasswordEmail().validate(
1482
1511
  { body, platform },
1483
1512
  { abortEarly: false, allowUnknown: true }
1484
1513
  );
@@ -1487,14 +1516,14 @@ class User {
1487
1516
  }
1488
1517
 
1489
1518
  // Showing warrnings if extra unknown parameters are found
1490
- const { error: warrning } = UserValidator.verifyEmailOTP().validate(
1519
+ const { error: warrning } = UserValidator.sendResetPasswordEmail().validate(
1491
1520
  { body, platform },
1492
1521
  { abortEarly: false, allowUnknown: false }
1493
1522
  );
1494
1523
  if (warrning) {
1495
1524
  Logger({
1496
1525
  level: "WARN",
1497
- message: "Parameter Validation warrnings for verifyEmailOTP",
1526
+ message: "Parameter Validation warrnings for sendResetPasswordEmail",
1498
1527
  });
1499
1528
  Logger({ level: "WARN", message: warrning });
1500
1529
  }
@@ -1504,11 +1533,11 @@ class User {
1504
1533
 
1505
1534
  const xHeaders = {};
1506
1535
 
1507
- const response = await APIClient.execute(
1536
+ const response = await ApplicationAPIClient.execute(
1508
1537
  this._conf,
1509
1538
  "post",
1510
1539
  constructUrl({
1511
- url: this._urls["verifyEmailOTP"],
1540
+ url: this._urls["sendResetPasswordEmail"],
1512
1541
  params: {},
1513
1542
  }),
1514
1543
  query_params,
@@ -1516,15 +1545,17 @@ class User {
1516
1545
  xHeaders
1517
1546
  );
1518
1547
 
1519
- const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
1520
- response,
1521
- { abortEarly: false, allowUnknown: false }
1522
- );
1548
+ const {
1549
+ error: res_error,
1550
+ } = UserModel.ResetPasswordSuccess().validate(response, {
1551
+ abortEarly: false,
1552
+ allowUnknown: false,
1553
+ });
1523
1554
 
1524
1555
  if (res_error) {
1525
1556
  Logger({
1526
1557
  level: "WARN",
1527
- message: "Response Validation Warnnings for verifyEmailOTP",
1558
+ message: "Response Validation Warnnings for sendResetPasswordEmail",
1528
1559
  });
1529
1560
  Logger({ level: "WARN", message: res_error });
1530
1561
  }
@@ -1534,13 +1565,15 @@ class User {
1534
1565
 
1535
1566
  /**
1536
1567
  * @param {Object} arg - Arg object.
1537
- * @returns {Promise<UserObjectSchema>} - Success response
1538
- * @summary: Get logged in user
1539
- * @description: Use this API to get the details of a logged in user.
1568
+ * @param {string} [arg.platform] - ID of the application
1569
+ * @param {SendResetPasswordMobileRequestSchema} arg.body
1570
+ * @returns {Promise<ResetPasswordSuccess>} - Success response
1571
+ * @summary: Reset Password
1572
+ * @description: Use this API to reset a password using the link sent on mobile.
1540
1573
  */
1541
- async getLoggedInUser({} = {}) {
1542
- const { error } = UserValidator.getLoggedInUser().validate(
1543
- {},
1574
+ async sendResetPasswordMobile({ body, platform } = {}) {
1575
+ const { error } = UserValidator.sendResetPasswordMobile().validate(
1576
+ { body, platform },
1544
1577
  { abortEarly: false, allowUnknown: true }
1545
1578
  );
1546
1579
  if (error) {
@@ -1548,43 +1581,48 @@ class User {
1548
1581
  }
1549
1582
 
1550
1583
  // Showing warrnings if extra unknown parameters are found
1551
- const { error: warrning } = UserValidator.getLoggedInUser().validate(
1552
- {},
1584
+ const {
1585
+ error: warrning,
1586
+ } = UserValidator.sendResetPasswordMobile().validate(
1587
+ { body, platform },
1553
1588
  { abortEarly: false, allowUnknown: false }
1554
1589
  );
1555
1590
  if (warrning) {
1556
1591
  Logger({
1557
1592
  level: "WARN",
1558
- message: "Parameter Validation warrnings for getLoggedInUser",
1593
+ message: "Parameter Validation warrnings for sendResetPasswordMobile",
1559
1594
  });
1560
1595
  Logger({ level: "WARN", message: warrning });
1561
1596
  }
1562
1597
 
1563
1598
  const query_params = {};
1599
+ query_params["platform"] = platform;
1564
1600
 
1565
1601
  const xHeaders = {};
1566
1602
 
1567
- const response = await APIClient.execute(
1603
+ const response = await ApplicationAPIClient.execute(
1568
1604
  this._conf,
1569
- "get",
1605
+ "post",
1570
1606
  constructUrl({
1571
- url: this._urls["getLoggedInUser"],
1607
+ url: this._urls["sendResetPasswordMobile"],
1572
1608
  params: {},
1573
1609
  }),
1574
1610
  query_params,
1575
- undefined,
1611
+ body,
1576
1612
  xHeaders
1577
1613
  );
1578
1614
 
1579
- const { error: res_error } = UserModel.UserObjectSchema().validate(
1580
- response,
1581
- { abortEarly: false, allowUnknown: false }
1582
- );
1615
+ const {
1616
+ error: res_error,
1617
+ } = UserModel.ResetPasswordSuccess().validate(response, {
1618
+ abortEarly: false,
1619
+ allowUnknown: false,
1620
+ });
1583
1621
 
1584
1622
  if (res_error) {
1585
1623
  Logger({
1586
1624
  level: "WARN",
1587
- message: "Response Validation Warnnings for getLoggedInUser",
1625
+ message: "Response Validation Warnnings for sendResetPasswordMobile",
1588
1626
  });
1589
1627
  Logger({ level: "WARN", message: res_error });
1590
1628
  }
@@ -1594,13 +1632,14 @@ class User {
1594
1632
 
1595
1633
  /**
1596
1634
  * @param {Object} arg - Arg object.
1597
- * @returns {Promise<SessionListSuccess>} - Success response
1598
- * @summary: Get list of sessions
1599
- * @description: Use this API to retrieve all active sessions of a user.
1635
+ * @param {CodeRequestBodySchema} arg.body
1636
+ * @returns {Promise<ResetPasswordSuccess>} - Success response
1637
+ * @summary: Reset Password using token
1638
+ * @description: Use this API to send code to reset password.
1600
1639
  */
1601
- async getListOfActiveSessions({} = {}) {
1602
- const { error } = UserValidator.getListOfActiveSessions().validate(
1603
- {},
1640
+ async sendResetToken({ body } = {}) {
1641
+ const { error } = UserValidator.sendResetToken().validate(
1642
+ { body },
1604
1643
  { abortEarly: false, allowUnknown: true }
1605
1644
  );
1606
1645
  if (error) {
@@ -1608,16 +1647,14 @@ class User {
1608
1647
  }
1609
1648
 
1610
1649
  // Showing warrnings if extra unknown parameters are found
1611
- const {
1612
- error: warrning,
1613
- } = UserValidator.getListOfActiveSessions().validate(
1614
- {},
1650
+ const { error: warrning } = UserValidator.sendResetToken().validate(
1651
+ { body },
1615
1652
  { abortEarly: false, allowUnknown: false }
1616
1653
  );
1617
1654
  if (warrning) {
1618
1655
  Logger({
1619
1656
  level: "WARN",
1620
- message: "Parameter Validation warrnings for getListOfActiveSessions",
1657
+ message: "Parameter Validation warrnings for sendResetToken",
1621
1658
  });
1622
1659
  Logger({ level: "WARN", message: warrning });
1623
1660
  }
@@ -1626,21 +1663,21 @@ class User {
1626
1663
 
1627
1664
  const xHeaders = {};
1628
1665
 
1629
- const response = await APIClient.execute(
1666
+ const response = await ApplicationAPIClient.execute(
1630
1667
  this._conf,
1631
- "get",
1668
+ "post",
1632
1669
  constructUrl({
1633
- url: this._urls["getListOfActiveSessions"],
1670
+ url: this._urls["sendResetToken"],
1634
1671
  params: {},
1635
1672
  }),
1636
1673
  query_params,
1637
- undefined,
1674
+ body,
1638
1675
  xHeaders
1639
1676
  );
1640
1677
 
1641
1678
  const {
1642
1679
  error: res_error,
1643
- } = UserModel.SessionListSuccess().validate(response, {
1680
+ } = UserModel.ResetPasswordSuccess().validate(response, {
1644
1681
  abortEarly: false,
1645
1682
  allowUnknown: false,
1646
1683
  });
@@ -1648,7 +1685,7 @@ class User {
1648
1685
  if (res_error) {
1649
1686
  Logger({
1650
1687
  level: "WARN",
1651
- message: "Response Validation Warnnings for getListOfActiveSessions",
1688
+ message: "Response Validation Warnnings for sendResetToken",
1652
1689
  });
1653
1690
  Logger({ level: "WARN", message: res_error });
1654
1691
  }
@@ -1658,14 +1695,15 @@ class User {
1658
1695
 
1659
1696
  /**
1660
1697
  * @param {Object} arg - Arg object.
1661
- * @param {string} [arg.name] - Name of the application, e.g. Fynd
1662
- * @returns {Promise<PlatformSchema>} - Success response
1663
- * @summary: Get platform configurations
1664
- * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text.
1698
+ * @param {string} [arg.platform] - ID of the application
1699
+ * @param {EditEmailRequestSchema} arg.body
1700
+ * @returns {Promise<SendEmailVerifyLinkSuccess>} - Success response
1701
+ * @summary: Send verification link to email
1702
+ * @description: Use this API to send verification link to an email address.
1665
1703
  */
1666
- async getPlatformConfig({ name } = {}) {
1667
- const { error } = UserValidator.getPlatformConfig().validate(
1668
- { name },
1704
+ async sendVerificationLinkToEmail({ body, platform } = {}) {
1705
+ const { error } = UserValidator.sendVerificationLinkToEmail().validate(
1706
+ { body, platform },
1669
1707
  { abortEarly: false, allowUnknown: true }
1670
1708
  );
1671
1709
  if (error) {
@@ -1673,36 +1711,41 @@ class User {
1673
1711
  }
1674
1712
 
1675
1713
  // Showing warrnings if extra unknown parameters are found
1676
- const { error: warrning } = UserValidator.getPlatformConfig().validate(
1677
- { name },
1714
+ const {
1715
+ error: warrning,
1716
+ } = UserValidator.sendVerificationLinkToEmail().validate(
1717
+ { body, platform },
1678
1718
  { abortEarly: false, allowUnknown: false }
1679
1719
  );
1680
1720
  if (warrning) {
1681
1721
  Logger({
1682
1722
  level: "WARN",
1683
- message: "Parameter Validation warrnings for getPlatformConfig",
1723
+ message:
1724
+ "Parameter Validation warrnings for sendVerificationLinkToEmail",
1684
1725
  });
1685
1726
  Logger({ level: "WARN", message: warrning });
1686
1727
  }
1687
1728
 
1688
1729
  const query_params = {};
1689
- query_params["name"] = name;
1730
+ query_params["platform"] = platform;
1690
1731
 
1691
1732
  const xHeaders = {};
1692
1733
 
1693
- const response = await APIClient.execute(
1734
+ const response = await ApplicationAPIClient.execute(
1694
1735
  this._conf,
1695
- "get",
1736
+ "post",
1696
1737
  constructUrl({
1697
- url: this._urls["getPlatformConfig"],
1738
+ url: this._urls["sendVerificationLinkToEmail"],
1698
1739
  params: {},
1699
1740
  }),
1700
1741
  query_params,
1701
- undefined,
1742
+ body,
1702
1743
  xHeaders
1703
1744
  );
1704
1745
 
1705
- const { error: res_error } = UserModel.PlatformSchema().validate(response, {
1746
+ const {
1747
+ error: res_error,
1748
+ } = UserModel.SendEmailVerifyLinkSuccess().validate(response, {
1706
1749
  abortEarly: false,
1707
1750
  allowUnknown: false,
1708
1751
  });
@@ -1710,7 +1753,8 @@ class User {
1710
1753
  if (res_error) {
1711
1754
  Logger({
1712
1755
  level: "WARN",
1713
- message: "Response Validation Warnnings for getPlatformConfig",
1756
+ message:
1757
+ "Response Validation Warnnings for sendVerificationLinkToEmail",
1714
1758
  });
1715
1759
  Logger({ level: "WARN", message: res_error });
1716
1760
  }
@@ -1721,13 +1765,13 @@ class User {
1721
1765
  /**
1722
1766
  * @param {Object} arg - Arg object.
1723
1767
  * @param {string} [arg.platform] - ID of the application
1724
- * @param {EditProfileRequestSchema} arg.body
1725
- * @returns {Promise<ProfileEditSuccess>} - Success response
1726
- * @summary: Edit Profile Details
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.
1768
+ * @param {SendVerificationLinkMobileRequestSchema} arg.body
1769
+ * @returns {Promise<SendMobileVerifyLinkSuccess>} - Success response
1770
+ * @summary: Send verification link to mobile
1771
+ * @description: Use this API to send a verification link to a mobile number
1728
1772
  */
1729
- async updateProfile({ body, platform } = {}) {
1730
- const { error } = UserValidator.updateProfile().validate(
1773
+ async sendVerificationLinkToMobile({ body, platform } = {}) {
1774
+ const { error } = UserValidator.sendVerificationLinkToMobile().validate(
1731
1775
  { body, platform },
1732
1776
  { abortEarly: false, allowUnknown: true }
1733
1777
  );
@@ -1736,14 +1780,17 @@ class User {
1736
1780
  }
1737
1781
 
1738
1782
  // Showing warrnings if extra unknown parameters are found
1739
- const { error: warrning } = UserValidator.updateProfile().validate(
1783
+ const {
1784
+ error: warrning,
1785
+ } = UserValidator.sendVerificationLinkToMobile().validate(
1740
1786
  { body, platform },
1741
1787
  { abortEarly: false, allowUnknown: false }
1742
1788
  );
1743
1789
  if (warrning) {
1744
1790
  Logger({
1745
1791
  level: "WARN",
1746
- message: "Parameter Validation warrnings for updateProfile",
1792
+ message:
1793
+ "Parameter Validation warrnings for sendVerificationLinkToMobile",
1747
1794
  });
1748
1795
  Logger({ level: "WARN", message: warrning });
1749
1796
  }
@@ -1753,11 +1800,11 @@ class User {
1753
1800
 
1754
1801
  const xHeaders = {};
1755
1802
 
1756
- const response = await APIClient.execute(
1803
+ const response = await ApplicationAPIClient.execute(
1757
1804
  this._conf,
1758
1805
  "post",
1759
1806
  constructUrl({
1760
- url: this._urls["updateProfile"],
1807
+ url: this._urls["sendVerificationLinkToMobile"],
1761
1808
  params: {},
1762
1809
  }),
1763
1810
  query_params,
@@ -1767,7 +1814,7 @@ class User {
1767
1814
 
1768
1815
  const {
1769
1816
  error: res_error,
1770
- } = UserModel.ProfileEditSuccess().validate(response, {
1817
+ } = UserModel.SendMobileVerifyLinkSuccess().validate(response, {
1771
1818
  abortEarly: false,
1772
1819
  allowUnknown: false,
1773
1820
  });
@@ -1775,7 +1822,8 @@ class User {
1775
1822
  if (res_error) {
1776
1823
  Logger({
1777
1824
  level: "WARN",
1778
- message: "Response Validation Warnnings for updateProfile",
1825
+ message:
1826
+ "Response Validation Warnnings for sendVerificationLinkToMobile",
1779
1827
  });
1780
1828
  Logger({ level: "WARN", message: res_error });
1781
1829
  }
@@ -1785,15 +1833,14 @@ class User {
1785
1833
 
1786
1834
  /**
1787
1835
  * @param {Object} arg - Arg object.
1788
- * @param {string} [arg.platform] - ID of the application
1789
- * @param {EditMobileRequestSchema} arg.body
1790
- * @returns {Promise<VerifyMobileOTPSuccess>} - Success response
1791
- * @summary: Add mobile number to profile
1792
- * @description: Use this API to add a new mobile number to a profile.
1836
+ * @param {EditEmailRequestSchema} arg.body
1837
+ * @returns {Promise<LoginSuccess>} - Success response
1838
+ * @summary: Set email as primary
1839
+ * @description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications.
1793
1840
  */
1794
- async addMobileNumber({ body, platform } = {}) {
1795
- const { error } = UserValidator.addMobileNumber().validate(
1796
- { body, platform },
1841
+ async setEmailAsPrimary({ body } = {}) {
1842
+ const { error } = UserValidator.setEmailAsPrimary().validate(
1843
+ { body },
1797
1844
  { abortEarly: false, allowUnknown: true }
1798
1845
  );
1799
1846
  if (error) {
@@ -1801,28 +1848,27 @@ class User {
1801
1848
  }
1802
1849
 
1803
1850
  // Showing warrnings if extra unknown parameters are found
1804
- const { error: warrning } = UserValidator.addMobileNumber().validate(
1805
- { body, platform },
1851
+ const { error: warrning } = UserValidator.setEmailAsPrimary().validate(
1852
+ { body },
1806
1853
  { abortEarly: false, allowUnknown: false }
1807
1854
  );
1808
1855
  if (warrning) {
1809
1856
  Logger({
1810
1857
  level: "WARN",
1811
- message: "Parameter Validation warrnings for addMobileNumber",
1858
+ message: "Parameter Validation warrnings for setEmailAsPrimary",
1812
1859
  });
1813
1860
  Logger({ level: "WARN", message: warrning });
1814
1861
  }
1815
1862
 
1816
1863
  const query_params = {};
1817
- query_params["platform"] = platform;
1818
1864
 
1819
1865
  const xHeaders = {};
1820
1866
 
1821
- const response = await APIClient.execute(
1867
+ const response = await ApplicationAPIClient.execute(
1822
1868
  this._conf,
1823
- "put",
1869
+ "post",
1824
1870
  constructUrl({
1825
- url: this._urls["addMobileNumber"],
1871
+ url: this._urls["setEmailAsPrimary"],
1826
1872
  params: {},
1827
1873
  }),
1828
1874
  query_params,
@@ -1830,9 +1876,7 @@ class User {
1830
1876
  xHeaders
1831
1877
  );
1832
1878
 
1833
- const {
1834
- error: res_error,
1835
- } = UserModel.VerifyMobileOTPSuccess().validate(response, {
1879
+ const { error: res_error } = UserModel.LoginSuccess().validate(response, {
1836
1880
  abortEarly: false,
1837
1881
  allowUnknown: false,
1838
1882
  });
@@ -1840,7 +1884,7 @@ class User {
1840
1884
  if (res_error) {
1841
1885
  Logger({
1842
1886
  level: "WARN",
1843
- message: "Response Validation Warnnings for addMobileNumber",
1887
+ message: "Response Validation Warnnings for setEmailAsPrimary",
1844
1888
  });
1845
1889
  Logger({ level: "WARN", message: res_error });
1846
1890
  }
@@ -1850,31 +1894,14 @@ class User {
1850
1894
 
1851
1895
  /**
1852
1896
  * @param {Object} arg - Arg object.
1853
- * @param {string} [arg.platform] - ID of the application
1854
- * @param {boolean} arg.active - This is a boolean value to check if mobile
1855
- * number is active 1.True - Number is active 2. False - Number is inactive
1856
- * @param {boolean} arg.primary - This is a boolean value to check if mobile
1857
- * number is primary number (main number) 1. True - Number is primary 2.
1858
- * False - Number is not primary
1859
- * @param {boolean} arg.verified - This is a boolean value to check if
1860
- * mobile number is verified 1. True - Number is verified 2.False - Number
1861
- * is not verified yet
1862
- * @param {string} arg.countryCode - Country code of the phone number, e.g. 91
1863
- * @param {string} arg.phone - Phone number
1897
+ * @param {SendVerificationLinkMobileRequestSchema} arg.body
1864
1898
  * @returns {Promise<LoginSuccess>} - Success response
1865
- * @summary: Delete mobile number from profile
1866
- * @description: Use this API to delete a mobile number from a profile.
1899
+ * @summary: Set mobile as primary
1900
+ * @description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications.
1867
1901
  */
1868
- async deleteMobileNumber({
1869
- active,
1870
- primary,
1871
- verified,
1872
- countryCode,
1873
- phone,
1874
- platform,
1875
- } = {}) {
1876
- const { error } = UserValidator.deleteMobileNumber().validate(
1877
- { active, primary, verified, countryCode, phone, platform },
1902
+ async setMobileNumberAsPrimary({ body } = {}) {
1903
+ const { error } = UserValidator.setMobileNumberAsPrimary().validate(
1904
+ { body },
1878
1905
  { abortEarly: false, allowUnknown: true }
1879
1906
  );
1880
1907
  if (error) {
@@ -1882,37 +1909,33 @@ class User {
1882
1909
  }
1883
1910
 
1884
1911
  // Showing warrnings if extra unknown parameters are found
1885
- const { error: warrning } = UserValidator.deleteMobileNumber().validate(
1886
- { active, primary, verified, countryCode, phone, platform },
1912
+ const {
1913
+ error: warrning,
1914
+ } = UserValidator.setMobileNumberAsPrimary().validate(
1915
+ { body },
1887
1916
  { abortEarly: false, allowUnknown: false }
1888
1917
  );
1889
1918
  if (warrning) {
1890
1919
  Logger({
1891
1920
  level: "WARN",
1892
- message: "Parameter Validation warrnings for deleteMobileNumber",
1921
+ message: "Parameter Validation warrnings for setMobileNumberAsPrimary",
1893
1922
  });
1894
1923
  Logger({ level: "WARN", message: warrning });
1895
1924
  }
1896
1925
 
1897
1926
  const query_params = {};
1898
- query_params["platform"] = platform;
1899
- query_params["active"] = active;
1900
- query_params["primary"] = primary;
1901
- query_params["verified"] = verified;
1902
- query_params["country_code"] = countryCode;
1903
- query_params["phone"] = phone;
1904
1927
 
1905
1928
  const xHeaders = {};
1906
1929
 
1907
- const response = await APIClient.execute(
1930
+ const response = await ApplicationAPIClient.execute(
1908
1931
  this._conf,
1909
- "delete",
1932
+ "post",
1910
1933
  constructUrl({
1911
- url: this._urls["deleteMobileNumber"],
1934
+ url: this._urls["setMobileNumberAsPrimary"],
1912
1935
  params: {},
1913
1936
  }),
1914
1937
  query_params,
1915
- undefined,
1938
+ body,
1916
1939
  xHeaders
1917
1940
  );
1918
1941
 
@@ -1924,7 +1947,7 @@ class User {
1924
1947
  if (res_error) {
1925
1948
  Logger({
1926
1949
  level: "WARN",
1927
- message: "Response Validation Warnnings for deleteMobileNumber",
1950
+ message: "Response Validation Warnnings for setMobileNumberAsPrimary",
1928
1951
  });
1929
1952
  Logger({ level: "WARN", message: res_error });
1930
1953
  }
@@ -1934,13 +1957,13 @@ class User {
1934
1957
 
1935
1958
  /**
1936
1959
  * @param {Object} arg - Arg object.
1937
- * @param {SendVerificationLinkMobileRequestSchema} arg.body
1938
- * @returns {Promise<LoginSuccess>} - Success response
1939
- * @summary: Set mobile as primary
1940
- * @description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications.
1960
+ * @param {UpdatePasswordRequestSchema} arg.body
1961
+ * @returns {Promise<VerifyEmailSuccess>} - Success response
1962
+ * @summary: Update user password
1963
+ * @description: Use this API to update the password.
1941
1964
  */
1942
- async setMobileNumberAsPrimary({ body } = {}) {
1943
- const { error } = UserValidator.setMobileNumberAsPrimary().validate(
1965
+ async updatePassword({ body } = {}) {
1966
+ const { error } = UserValidator.updatePassword().validate(
1944
1967
  { body },
1945
1968
  { abortEarly: false, allowUnknown: true }
1946
1969
  );
@@ -1949,16 +1972,14 @@ class User {
1949
1972
  }
1950
1973
 
1951
1974
  // Showing warrnings if extra unknown parameters are found
1952
- const {
1953
- error: warrning,
1954
- } = UserValidator.setMobileNumberAsPrimary().validate(
1975
+ const { error: warrning } = UserValidator.updatePassword().validate(
1955
1976
  { body },
1956
1977
  { abortEarly: false, allowUnknown: false }
1957
1978
  );
1958
1979
  if (warrning) {
1959
1980
  Logger({
1960
1981
  level: "WARN",
1961
- message: "Parameter Validation warrnings for setMobileNumberAsPrimary",
1982
+ message: "Parameter Validation warrnings for updatePassword",
1962
1983
  });
1963
1984
  Logger({ level: "WARN", message: warrning });
1964
1985
  }
@@ -1967,11 +1988,11 @@ class User {
1967
1988
 
1968
1989
  const xHeaders = {};
1969
1990
 
1970
- const response = await APIClient.execute(
1991
+ const response = await ApplicationAPIClient.execute(
1971
1992
  this._conf,
1972
1993
  "post",
1973
1994
  constructUrl({
1974
- url: this._urls["setMobileNumberAsPrimary"],
1995
+ url: this._urls["updatePassword"],
1975
1996
  params: {},
1976
1997
  }),
1977
1998
  query_params,
@@ -1979,7 +2000,9 @@ class User {
1979
2000
  xHeaders
1980
2001
  );
1981
2002
 
1982
- const { error: res_error } = UserModel.LoginSuccess().validate(response, {
2003
+ const {
2004
+ error: res_error,
2005
+ } = UserModel.VerifyEmailSuccess().validate(response, {
1983
2006
  abortEarly: false,
1984
2007
  allowUnknown: false,
1985
2008
  });
@@ -1987,7 +2010,7 @@ class User {
1987
2010
  if (res_error) {
1988
2011
  Logger({
1989
2012
  level: "WARN",
1990
- message: "Response Validation Warnnings for setMobileNumberAsPrimary",
2013
+ message: "Response Validation Warnnings for updatePassword",
1991
2014
  });
1992
2015
  Logger({ level: "WARN", message: res_error });
1993
2016
  }
@@ -1998,13 +2021,13 @@ class User {
1998
2021
  /**
1999
2022
  * @param {Object} arg - Arg object.
2000
2023
  * @param {string} [arg.platform] - ID of the application
2001
- * @param {SendVerificationLinkMobileRequestSchema} arg.body
2002
- * @returns {Promise<SendMobileVerifyLinkSuccess>} - Success response
2003
- * @summary: Send verification link to mobile
2004
- * @description: Use this API to send a verification link to a mobile number
2024
+ * @param {EditProfileRequestSchema} arg.body
2025
+ * @returns {Promise<ProfileEditSuccess>} - Success response
2026
+ * @summary: Edit Profile Details
2027
+ * @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.
2005
2028
  */
2006
- async sendVerificationLinkToMobile({ body, platform } = {}) {
2007
- const { error } = UserValidator.sendVerificationLinkToMobile().validate(
2029
+ async updateProfile({ body, platform } = {}) {
2030
+ const { error } = UserValidator.updateProfile().validate(
2008
2031
  { body, platform },
2009
2032
  { abortEarly: false, allowUnknown: true }
2010
2033
  );
@@ -2013,17 +2036,14 @@ class User {
2013
2036
  }
2014
2037
 
2015
2038
  // Showing warrnings if extra unknown parameters are found
2016
- const {
2017
- error: warrning,
2018
- } = UserValidator.sendVerificationLinkToMobile().validate(
2039
+ const { error: warrning } = UserValidator.updateProfile().validate(
2019
2040
  { body, platform },
2020
2041
  { abortEarly: false, allowUnknown: false }
2021
2042
  );
2022
2043
  if (warrning) {
2023
2044
  Logger({
2024
2045
  level: "WARN",
2025
- message:
2026
- "Parameter Validation warrnings for sendVerificationLinkToMobile",
2046
+ message: "Parameter Validation warrnings for updateProfile",
2027
2047
  });
2028
2048
  Logger({ level: "WARN", message: warrning });
2029
2049
  }
@@ -2033,11 +2053,11 @@ class User {
2033
2053
 
2034
2054
  const xHeaders = {};
2035
2055
 
2036
- const response = await APIClient.execute(
2056
+ const response = await ApplicationAPIClient.execute(
2037
2057
  this._conf,
2038
2058
  "post",
2039
2059
  constructUrl({
2040
- url: this._urls["sendVerificationLinkToMobile"],
2060
+ url: this._urls["updateProfile"],
2041
2061
  params: {},
2042
2062
  }),
2043
2063
  query_params,
@@ -2047,7 +2067,7 @@ class User {
2047
2067
 
2048
2068
  const {
2049
2069
  error: res_error,
2050
- } = UserModel.SendMobileVerifyLinkSuccess().validate(response, {
2070
+ } = UserModel.ProfileEditSuccess().validate(response, {
2051
2071
  abortEarly: false,
2052
2072
  allowUnknown: false,
2053
2073
  });
@@ -2055,8 +2075,7 @@ class User {
2055
2075
  if (res_error) {
2056
2076
  Logger({
2057
2077
  level: "WARN",
2058
- message:
2059
- "Response Validation Warnnings for sendVerificationLinkToMobile",
2078
+ message: "Response Validation Warnnings for updateProfile",
2060
2079
  });
2061
2080
  Logger({ level: "WARN", message: res_error });
2062
2081
  }
@@ -2066,15 +2085,14 @@ class User {
2066
2085
 
2067
2086
  /**
2068
2087
  * @param {Object} arg - Arg object.
2069
- * @param {string} [arg.platform] - ID of the application
2070
- * @param {EditEmailRequestSchema} arg.body
2071
- * @returns {Promise<VerifyEmailOTPSuccess>} - Success response
2072
- * @summary: Add email to profile
2073
- * @description: Use this API to add a new email address to a profile
2088
+ * @param {CodeRequestBodySchema} arg.body
2089
+ * @returns {Promise<VerifyEmailSuccess>} - Success response
2090
+ * @summary: Verify email
2091
+ * @description: Use this API to send a verification code to verify an email.
2074
2092
  */
2075
- async addEmail({ body, platform } = {}) {
2076
- const { error } = UserValidator.addEmail().validate(
2077
- { body, platform },
2093
+ async verifyEmail({ body } = {}) {
2094
+ const { error } = UserValidator.verifyEmail().validate(
2095
+ { body },
2078
2096
  { abortEarly: false, allowUnknown: true }
2079
2097
  );
2080
2098
  if (error) {
@@ -2082,28 +2100,27 @@ class User {
2082
2100
  }
2083
2101
 
2084
2102
  // Showing warrnings if extra unknown parameters are found
2085
- const { error: warrning } = UserValidator.addEmail().validate(
2086
- { body, platform },
2103
+ const { error: warrning } = UserValidator.verifyEmail().validate(
2104
+ { body },
2087
2105
  { abortEarly: false, allowUnknown: false }
2088
2106
  );
2089
2107
  if (warrning) {
2090
2108
  Logger({
2091
2109
  level: "WARN",
2092
- message: "Parameter Validation warrnings for addEmail",
2110
+ message: "Parameter Validation warrnings for verifyEmail",
2093
2111
  });
2094
2112
  Logger({ level: "WARN", message: warrning });
2095
2113
  }
2096
2114
 
2097
2115
  const query_params = {};
2098
- query_params["platform"] = platform;
2099
2116
 
2100
2117
  const xHeaders = {};
2101
2118
 
2102
- const response = await APIClient.execute(
2119
+ const response = await ApplicationAPIClient.execute(
2103
2120
  this._conf,
2104
- "put",
2121
+ "post",
2105
2122
  constructUrl({
2106
- url: this._urls["addEmail"],
2123
+ url: this._urls["verifyEmail"],
2107
2124
  params: {},
2108
2125
  }),
2109
2126
  query_params,
@@ -2113,7 +2130,7 @@ class User {
2113
2130
 
2114
2131
  const {
2115
2132
  error: res_error,
2116
- } = UserModel.VerifyEmailOTPSuccess().validate(response, {
2133
+ } = UserModel.VerifyEmailSuccess().validate(response, {
2117
2134
  abortEarly: false,
2118
2135
  allowUnknown: false,
2119
2136
  });
@@ -2121,7 +2138,7 @@ class User {
2121
2138
  if (res_error) {
2122
2139
  Logger({
2123
2140
  level: "WARN",
2124
- message: "Response Validation Warnnings for addEmail",
2141
+ message: "Response Validation Warnnings for verifyEmail",
2125
2142
  });
2126
2143
  Logger({ level: "WARN", message: res_error });
2127
2144
  }
@@ -2132,22 +2149,14 @@ class User {
2132
2149
  /**
2133
2150
  * @param {Object} arg - Arg object.
2134
2151
  * @param {string} [arg.platform] - ID of the application
2135
- * @param {boolean} arg.active - This is a boolean value to check if email
2136
- * ID is active 1. True - Email ID is active 2.False - Email ID is inactive
2137
- * @param {boolean} arg.primary - This is a boolean value to check if email
2138
- * ID is primary (main email ID) 1. True - Email ID is primary 2.False -
2139
- * Email ID is not primary
2140
- * @param {boolean} arg.verified - This is a boolean value to check if email
2141
- * ID is verified 1. True - Email ID is verified 2.False - Email ID is not
2142
- * verified yet
2143
- * @param {string} arg.email - The email ID to delete
2144
- * @returns {Promise<LoginSuccess>} - Success response
2145
- * @summary: Delete email from profile
2146
- * @description: Use this API to delete an email address from a profile
2152
+ * @param {VerifyEmailOtpRequestSchema} arg.body
2153
+ * @returns {Promise<VerifyOtpSuccess>} - Success response
2154
+ * @summary: Verify OTP on email
2155
+ * @description: Use this API to verify the OTP received on an email ID.
2147
2156
  */
2148
- async deleteEmail({ active, primary, verified, email, platform } = {}) {
2149
- const { error } = UserValidator.deleteEmail().validate(
2150
- { active, primary, verified, email, platform },
2157
+ async verifyEmailOTP({ body, platform } = {}) {
2158
+ const { error } = UserValidator.verifyEmailOTP().validate(
2159
+ { body, platform },
2151
2160
  { abortEarly: false, allowUnknown: true }
2152
2161
  );
2153
2162
  if (error) {
@@ -2155,48 +2164,44 @@ class User {
2155
2164
  }
2156
2165
 
2157
2166
  // Showing warrnings if extra unknown parameters are found
2158
- const { error: warrning } = UserValidator.deleteEmail().validate(
2159
- { active, primary, verified, email, platform },
2167
+ const { error: warrning } = UserValidator.verifyEmailOTP().validate(
2168
+ { body, platform },
2160
2169
  { abortEarly: false, allowUnknown: false }
2161
2170
  );
2162
2171
  if (warrning) {
2163
2172
  Logger({
2164
2173
  level: "WARN",
2165
- message: "Parameter Validation warrnings for deleteEmail",
2174
+ message: "Parameter Validation warrnings for verifyEmailOTP",
2166
2175
  });
2167
2176
  Logger({ level: "WARN", message: warrning });
2168
2177
  }
2169
2178
 
2170
2179
  const query_params = {};
2171
2180
  query_params["platform"] = platform;
2172
- query_params["active"] = active;
2173
- query_params["primary"] = primary;
2174
- query_params["verified"] = verified;
2175
- query_params["email"] = email;
2176
2181
 
2177
2182
  const xHeaders = {};
2178
2183
 
2179
- const response = await APIClient.execute(
2184
+ const response = await ApplicationAPIClient.execute(
2180
2185
  this._conf,
2181
- "delete",
2186
+ "post",
2182
2187
  constructUrl({
2183
- url: this._urls["deleteEmail"],
2188
+ url: this._urls["verifyEmailOTP"],
2184
2189
  params: {},
2185
2190
  }),
2186
2191
  query_params,
2187
- undefined,
2192
+ body,
2188
2193
  xHeaders
2189
2194
  );
2190
2195
 
2191
- const { error: res_error } = UserModel.LoginSuccess().validate(response, {
2192
- abortEarly: false,
2193
- allowUnknown: false,
2194
- });
2196
+ const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
2197
+ response,
2198
+ { abortEarly: false, allowUnknown: false }
2199
+ );
2195
2200
 
2196
2201
  if (res_error) {
2197
2202
  Logger({
2198
2203
  level: "WARN",
2199
- message: "Response Validation Warnnings for deleteEmail",
2204
+ message: "Response Validation Warnnings for verifyEmailOTP",
2200
2205
  });
2201
2206
  Logger({ level: "WARN", message: res_error });
2202
2207
  }
@@ -2206,13 +2211,13 @@ class User {
2206
2211
 
2207
2212
  /**
2208
2213
  * @param {Object} arg - Arg object.
2209
- * @param {EditEmailRequestSchema} arg.body
2210
- * @returns {Promise<LoginSuccess>} - Success response
2211
- * @summary: Set email as primary
2212
- * @description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications.
2214
+ * @param {CodeRequestBodySchema} arg.body
2215
+ * @returns {Promise<VerifyEmailSuccess>} - Success response
2216
+ * @summary: Verify mobile
2217
+ * @description: Use this API to send a verification code to verify a mobile number.
2213
2218
  */
2214
- async setEmailAsPrimary({ body } = {}) {
2215
- const { error } = UserValidator.setEmailAsPrimary().validate(
2219
+ async verifyMobile({ body } = {}) {
2220
+ const { error } = UserValidator.verifyMobile().validate(
2216
2221
  { body },
2217
2222
  { abortEarly: false, allowUnknown: true }
2218
2223
  );
@@ -2221,14 +2226,14 @@ class User {
2221
2226
  }
2222
2227
 
2223
2228
  // Showing warrnings if extra unknown parameters are found
2224
- const { error: warrning } = UserValidator.setEmailAsPrimary().validate(
2229
+ const { error: warrning } = UserValidator.verifyMobile().validate(
2225
2230
  { body },
2226
2231
  { abortEarly: false, allowUnknown: false }
2227
2232
  );
2228
2233
  if (warrning) {
2229
2234
  Logger({
2230
2235
  level: "WARN",
2231
- message: "Parameter Validation warrnings for setEmailAsPrimary",
2236
+ message: "Parameter Validation warrnings for verifyMobile",
2232
2237
  });
2233
2238
  Logger({ level: "WARN", message: warrning });
2234
2239
  }
@@ -2237,11 +2242,11 @@ class User {
2237
2242
 
2238
2243
  const xHeaders = {};
2239
2244
 
2240
- const response = await APIClient.execute(
2245
+ const response = await ApplicationAPIClient.execute(
2241
2246
  this._conf,
2242
2247
  "post",
2243
2248
  constructUrl({
2244
- url: this._urls["setEmailAsPrimary"],
2249
+ url: this._urls["verifyMobile"],
2245
2250
  params: {},
2246
2251
  }),
2247
2252
  query_params,
@@ -2249,7 +2254,9 @@ class User {
2249
2254
  xHeaders
2250
2255
  );
2251
2256
 
2252
- const { error: res_error } = UserModel.LoginSuccess().validate(response, {
2257
+ const {
2258
+ error: res_error,
2259
+ } = UserModel.VerifyEmailSuccess().validate(response, {
2253
2260
  abortEarly: false,
2254
2261
  allowUnknown: false,
2255
2262
  });
@@ -2257,7 +2264,7 @@ class User {
2257
2264
  if (res_error) {
2258
2265
  Logger({
2259
2266
  level: "WARN",
2260
- message: "Response Validation Warnnings for setEmailAsPrimary",
2267
+ message: "Response Validation Warnnings for verifyMobile",
2261
2268
  });
2262
2269
  Logger({ level: "WARN", message: res_error });
2263
2270
  }
@@ -2268,13 +2275,13 @@ class User {
2268
2275
  /**
2269
2276
  * @param {Object} arg - Arg object.
2270
2277
  * @param {string} [arg.platform] - ID of the application
2271
- * @param {EditEmailRequestSchema} arg.body
2272
- * @returns {Promise<SendEmailVerifyLinkSuccess>} - Success response
2273
- * @summary: Send verification link to email
2274
- * @description: Use this API to send verification link to an email address.
2278
+ * @param {VerifyOtpRequestSchema} arg.body
2279
+ * @returns {Promise<VerifyOtpSuccess>} - Success response
2280
+ * @summary: Verify OTP on mobile
2281
+ * @description: Use this API to verify the OTP received on a mobile number.
2275
2282
  */
2276
- async sendVerificationLinkToEmail({ body, platform } = {}) {
2277
- const { error } = UserValidator.sendVerificationLinkToEmail().validate(
2283
+ async verifyMobileOTP({ body, platform } = {}) {
2284
+ const { error } = UserValidator.verifyMobileOTP().validate(
2278
2285
  { body, platform },
2279
2286
  { abortEarly: false, allowUnknown: true }
2280
2287
  );
@@ -2283,17 +2290,14 @@ class User {
2283
2290
  }
2284
2291
 
2285
2292
  // Showing warrnings if extra unknown parameters are found
2286
- const {
2287
- error: warrning,
2288
- } = UserValidator.sendVerificationLinkToEmail().validate(
2293
+ const { error: warrning } = UserValidator.verifyMobileOTP().validate(
2289
2294
  { body, platform },
2290
2295
  { abortEarly: false, allowUnknown: false }
2291
2296
  );
2292
2297
  if (warrning) {
2293
2298
  Logger({
2294
2299
  level: "WARN",
2295
- message:
2296
- "Parameter Validation warrnings for sendVerificationLinkToEmail",
2300
+ message: "Parameter Validation warrnings for verifyMobileOTP",
2297
2301
  });
2298
2302
  Logger({ level: "WARN", message: warrning });
2299
2303
  }
@@ -2303,11 +2307,11 @@ class User {
2303
2307
 
2304
2308
  const xHeaders = {};
2305
2309
 
2306
- const response = await APIClient.execute(
2310
+ const response = await ApplicationAPIClient.execute(
2307
2311
  this._conf,
2308
2312
  "post",
2309
2313
  constructUrl({
2310
- url: this._urls["sendVerificationLinkToEmail"],
2314
+ url: this._urls["verifyMobileOTP"],
2311
2315
  params: {},
2312
2316
  }),
2313
2317
  query_params,
@@ -2315,18 +2319,15 @@ class User {
2315
2319
  xHeaders
2316
2320
  );
2317
2321
 
2318
- const {
2319
- error: res_error,
2320
- } = UserModel.SendEmailVerifyLinkSuccess().validate(response, {
2321
- abortEarly: false,
2322
- allowUnknown: false,
2323
- });
2322
+ const { error: res_error } = UserModel.VerifyOtpSuccess().validate(
2323
+ response,
2324
+ { abortEarly: false, allowUnknown: false }
2325
+ );
2324
2326
 
2325
2327
  if (res_error) {
2326
2328
  Logger({
2327
2329
  level: "WARN",
2328
- message:
2329
- "Response Validation Warnnings for sendVerificationLinkToEmail",
2330
+ message: "Response Validation Warnnings for verifyMobileOTP",
2330
2331
  });
2331
2332
  Logger({ level: "WARN", message: res_error });
2332
2333
  }