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