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