@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
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const UserValidator = require("./UserPlatformApplicationValidator");
|
|
5
|
+
const UserModel = require("./UserPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class User {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -11,21 +13,15 @@ class User {
|
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @param {Object} arg - Arg object.
|
|
14
|
-
* @param {
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
-
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
19
|
-
* given set of results. Default value is 1.
|
|
20
|
-
* @summary: Get a list of customers
|
|
21
|
-
* @description: Use this API to retrieve a list of customers who have registered in the application.
|
|
16
|
+
* @param {ArchiveUserRequestSchema} arg.body
|
|
17
|
+
* @returns {Promise<ArchiveUserSuccess>} - Success response
|
|
18
|
+
* @summary: archive user
|
|
19
|
+
* @description: archive user
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
const { error } = UserValidator.
|
|
21
|
+
async archiveUser({ body } = {}) {
|
|
22
|
+
const { error } = UserValidator.archiveUser().validate(
|
|
25
23
|
{
|
|
26
|
-
|
|
27
|
-
pageSize,
|
|
28
|
-
pageNo,
|
|
24
|
+
body,
|
|
29
25
|
},
|
|
30
26
|
{ abortEarly: false, allowUnknown: true }
|
|
31
27
|
);
|
|
@@ -34,44 +30,59 @@ class User {
|
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
// Showing warrnings if extra unknown parameters are found
|
|
37
|
-
const { error: warrning } = UserValidator.
|
|
33
|
+
const { error: warrning } = UserValidator.archiveUser().validate(
|
|
38
34
|
{
|
|
39
|
-
|
|
40
|
-
pageSize,
|
|
41
|
-
pageNo,
|
|
35
|
+
body,
|
|
42
36
|
},
|
|
43
37
|
{ abortEarly: false, allowUnknown: false }
|
|
44
38
|
);
|
|
45
39
|
if (warrning) {
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
Logger({
|
|
41
|
+
level: "WARN",
|
|
42
|
+
message: "Parameter Validation warrnings for archiveUser",
|
|
43
|
+
});
|
|
44
|
+
Logger({ level: "WARN", message: warrning });
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
const query_params = {};
|
|
51
|
-
query_params["q"] = q;
|
|
52
|
-
query_params["page_size"] = pageSize;
|
|
53
|
-
query_params["page_no"] = pageNo;
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
const response = await PlatformAPIClient.execute(
|
|
56
50
|
this.config,
|
|
57
|
-
"
|
|
58
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
51
|
+
"put",
|
|
52
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/archive`,
|
|
59
53
|
query_params,
|
|
60
|
-
|
|
54
|
+
body
|
|
61
55
|
);
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
error: res_error,
|
|
59
|
+
} = UserModel.ArchiveUserSuccess().validate(response, {
|
|
60
|
+
abortEarly: false,
|
|
61
|
+
allowUnknown: false,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (res_error) {
|
|
65
|
+
Logger({
|
|
66
|
+
level: "WARN",
|
|
67
|
+
message: "Response Validation Warnnings for archiveUser",
|
|
68
|
+
});
|
|
69
|
+
Logger({ level: "WARN", message: res_error });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return response;
|
|
62
73
|
}
|
|
63
74
|
|
|
64
75
|
/**
|
|
65
76
|
* @param {Object} arg - Arg object.
|
|
66
|
-
* @param {
|
|
67
|
-
*
|
|
68
|
-
* @summary:
|
|
69
|
-
* @description:
|
|
77
|
+
* @param {BlockUserRequestSchema} arg.body
|
|
78
|
+
* @returns {Promise<BlockUserSuccess>} - Success response
|
|
79
|
+
* @summary: Block/Unblock user
|
|
80
|
+
* @description: Block/Unblock user
|
|
70
81
|
*/
|
|
71
|
-
|
|
72
|
-
const { error } = UserValidator.
|
|
82
|
+
async blockOrUnblockUsers({ body } = {}) {
|
|
83
|
+
const { error } = UserValidator.blockOrUnblockUsers().validate(
|
|
73
84
|
{
|
|
74
|
-
|
|
85
|
+
body,
|
|
75
86
|
},
|
|
76
87
|
{ abortEarly: false, allowUnknown: true }
|
|
77
88
|
);
|
|
@@ -80,36 +91,54 @@ class User {
|
|
|
80
91
|
}
|
|
81
92
|
|
|
82
93
|
// Showing warrnings if extra unknown parameters are found
|
|
83
|
-
const { error: warrning } = UserValidator.
|
|
94
|
+
const { error: warrning } = UserValidator.blockOrUnblockUsers().validate(
|
|
84
95
|
{
|
|
85
|
-
|
|
96
|
+
body,
|
|
86
97
|
},
|
|
87
98
|
{ abortEarly: false, allowUnknown: false }
|
|
88
99
|
);
|
|
89
100
|
if (warrning) {
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
Logger({
|
|
102
|
+
level: "WARN",
|
|
103
|
+
message: "Parameter Validation warrnings for blockOrUnblockUsers",
|
|
104
|
+
});
|
|
105
|
+
Logger({ level: "WARN", message: warrning });
|
|
92
106
|
}
|
|
93
107
|
|
|
94
108
|
const query_params = {};
|
|
95
|
-
query_params["q"] = q;
|
|
96
109
|
|
|
97
|
-
|
|
110
|
+
const response = await PlatformAPIClient.execute(
|
|
98
111
|
this.config,
|
|
99
|
-
"
|
|
100
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
112
|
+
"put",
|
|
113
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/activation`,
|
|
101
114
|
query_params,
|
|
102
|
-
|
|
115
|
+
body
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const { error: res_error } = UserModel.BlockUserSuccess().validate(
|
|
119
|
+
response,
|
|
120
|
+
{ abortEarly: false, allowUnknown: false }
|
|
103
121
|
);
|
|
122
|
+
|
|
123
|
+
if (res_error) {
|
|
124
|
+
Logger({
|
|
125
|
+
level: "WARN",
|
|
126
|
+
message: "Response Validation Warnnings for blockOrUnblockUsers",
|
|
127
|
+
});
|
|
128
|
+
Logger({ level: "WARN", message: res_error });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return response;
|
|
104
132
|
}
|
|
105
133
|
|
|
106
134
|
/**
|
|
107
135
|
* @param {Object} arg - Arg object.
|
|
108
136
|
* @param {CreateUserRequestSchema} arg.body
|
|
137
|
+
* @returns {Promise<CreateUserResponseSchema>} - Success response
|
|
109
138
|
* @summary: Create user
|
|
110
139
|
* @description: Create user
|
|
111
140
|
*/
|
|
112
|
-
createUser({ body } = {}) {
|
|
141
|
+
async createUser({ body } = {}) {
|
|
113
142
|
const { error } = UserValidator.createUser().validate(
|
|
114
143
|
{
|
|
115
144
|
body,
|
|
@@ -128,29 +157,50 @@ class User {
|
|
|
128
157
|
{ abortEarly: false, allowUnknown: false }
|
|
129
158
|
);
|
|
130
159
|
if (warrning) {
|
|
131
|
-
|
|
132
|
-
|
|
160
|
+
Logger({
|
|
161
|
+
level: "WARN",
|
|
162
|
+
message: "Parameter Validation warrnings for createUser",
|
|
163
|
+
});
|
|
164
|
+
Logger({ level: "WARN", message: warrning });
|
|
133
165
|
}
|
|
134
166
|
|
|
135
167
|
const query_params = {};
|
|
136
168
|
|
|
137
|
-
|
|
169
|
+
const response = await PlatformAPIClient.execute(
|
|
138
170
|
this.config,
|
|
139
171
|
"post",
|
|
140
172
|
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers`,
|
|
141
173
|
query_params,
|
|
142
174
|
body
|
|
143
175
|
);
|
|
176
|
+
|
|
177
|
+
const {
|
|
178
|
+
error: res_error,
|
|
179
|
+
} = UserModel.CreateUserResponseSchema().validate(response, {
|
|
180
|
+
abortEarly: false,
|
|
181
|
+
allowUnknown: false,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
if (res_error) {
|
|
185
|
+
Logger({
|
|
186
|
+
level: "WARN",
|
|
187
|
+
message: "Response Validation Warnnings for createUser",
|
|
188
|
+
});
|
|
189
|
+
Logger({ level: "WARN", message: res_error });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return response;
|
|
144
193
|
}
|
|
145
194
|
|
|
146
195
|
/**
|
|
147
196
|
* @param {Object} arg - Arg object.
|
|
148
|
-
* @param {
|
|
149
|
-
* @
|
|
150
|
-
* @
|
|
197
|
+
* @param {CreateUserGroupSchema} arg.body
|
|
198
|
+
* @returns {Promise<UserGroupResponseSchema>} - Success response
|
|
199
|
+
* @summary: Create an User Group
|
|
200
|
+
* @description: Use this API to create new user Group
|
|
151
201
|
*/
|
|
152
|
-
|
|
153
|
-
const { error } = UserValidator.
|
|
202
|
+
async createUserGroup({ body } = {}) {
|
|
203
|
+
const { error } = UserValidator.createUserGroup().validate(
|
|
154
204
|
{
|
|
155
205
|
body,
|
|
156
206
|
},
|
|
@@ -161,36 +211,57 @@ class User {
|
|
|
161
211
|
}
|
|
162
212
|
|
|
163
213
|
// Showing warrnings if extra unknown parameters are found
|
|
164
|
-
const { error: warrning } = UserValidator.
|
|
214
|
+
const { error: warrning } = UserValidator.createUserGroup().validate(
|
|
165
215
|
{
|
|
166
216
|
body,
|
|
167
217
|
},
|
|
168
218
|
{ abortEarly: false, allowUnknown: false }
|
|
169
219
|
);
|
|
170
220
|
if (warrning) {
|
|
171
|
-
|
|
172
|
-
|
|
221
|
+
Logger({
|
|
222
|
+
level: "WARN",
|
|
223
|
+
message: "Parameter Validation warrnings for createUserGroup",
|
|
224
|
+
});
|
|
225
|
+
Logger({ level: "WARN", message: warrning });
|
|
173
226
|
}
|
|
174
227
|
|
|
175
228
|
const query_params = {};
|
|
176
229
|
|
|
177
|
-
|
|
230
|
+
const response = await PlatformAPIClient.execute(
|
|
178
231
|
this.config,
|
|
179
|
-
"
|
|
180
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
232
|
+
"post",
|
|
233
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_group`,
|
|
181
234
|
query_params,
|
|
182
235
|
body
|
|
183
236
|
);
|
|
237
|
+
|
|
238
|
+
const {
|
|
239
|
+
error: res_error,
|
|
240
|
+
} = UserModel.UserGroupResponseSchema().validate(response, {
|
|
241
|
+
abortEarly: false,
|
|
242
|
+
allowUnknown: false,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
if (res_error) {
|
|
246
|
+
Logger({
|
|
247
|
+
level: "WARN",
|
|
248
|
+
message: "Response Validation Warnnings for createUserGroup",
|
|
249
|
+
});
|
|
250
|
+
Logger({ level: "WARN", message: res_error });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return response;
|
|
184
254
|
}
|
|
185
255
|
|
|
186
256
|
/**
|
|
187
257
|
* @param {Object} arg - Arg object.
|
|
188
|
-
* @param {
|
|
189
|
-
* @
|
|
190
|
-
* @
|
|
258
|
+
* @param {CreateUserSessionRequestSchema} arg.body
|
|
259
|
+
* @returns {Promise<CreateUserSessionResponseSchema>} - Success response
|
|
260
|
+
* @summary: Create user session
|
|
261
|
+
* @description: Create user session
|
|
191
262
|
*/
|
|
192
|
-
|
|
193
|
-
const { error } = UserValidator.
|
|
263
|
+
async createUserSession({ body } = {}) {
|
|
264
|
+
const { error } = UserValidator.createUserSession().validate(
|
|
194
265
|
{
|
|
195
266
|
body,
|
|
196
267
|
},
|
|
@@ -201,38 +272,61 @@ class User {
|
|
|
201
272
|
}
|
|
202
273
|
|
|
203
274
|
// Showing warrnings if extra unknown parameters are found
|
|
204
|
-
const { error: warrning } = UserValidator.
|
|
275
|
+
const { error: warrning } = UserValidator.createUserSession().validate(
|
|
205
276
|
{
|
|
206
277
|
body,
|
|
207
278
|
},
|
|
208
279
|
{ abortEarly: false, allowUnknown: false }
|
|
209
280
|
);
|
|
210
281
|
if (warrning) {
|
|
211
|
-
|
|
212
|
-
|
|
282
|
+
Logger({
|
|
283
|
+
level: "WARN",
|
|
284
|
+
message: "Parameter Validation warrnings for createUserSession",
|
|
285
|
+
});
|
|
286
|
+
Logger({ level: "WARN", message: warrning });
|
|
213
287
|
}
|
|
214
288
|
|
|
215
289
|
const query_params = {};
|
|
216
290
|
|
|
217
|
-
|
|
291
|
+
const response = await PlatformAPIClient.execute(
|
|
218
292
|
this.config,
|
|
219
|
-
"
|
|
220
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
293
|
+
"post",
|
|
294
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
|
|
221
295
|
query_params,
|
|
222
296
|
body
|
|
223
297
|
);
|
|
298
|
+
|
|
299
|
+
const {
|
|
300
|
+
error: res_error,
|
|
301
|
+
} = UserModel.CreateUserSessionResponseSchema().validate(response, {
|
|
302
|
+
abortEarly: false,
|
|
303
|
+
allowUnknown: false,
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
if (res_error) {
|
|
307
|
+
Logger({
|
|
308
|
+
level: "WARN",
|
|
309
|
+
message: "Response Validation Warnnings for createUserSession",
|
|
310
|
+
});
|
|
311
|
+
Logger({ level: "WARN", message: res_error });
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return response;
|
|
224
315
|
}
|
|
225
316
|
|
|
226
317
|
/**
|
|
227
318
|
* @param {Object} arg - Arg object.
|
|
228
|
-
* @param {
|
|
229
|
-
* @
|
|
230
|
-
* @
|
|
319
|
+
* @param {string} arg.id - ID of a customer.
|
|
320
|
+
* @param {string} arg.reason - Reason to delete sessions.
|
|
321
|
+
* @returns {Promise<SessionDeleteResponseSchema>} - Success response
|
|
322
|
+
* @summary: Delete a list of all session for a user
|
|
323
|
+
* @description: Use this API to Delete a list of session of customers who have registered in the application.
|
|
231
324
|
*/
|
|
232
|
-
|
|
233
|
-
const { error } = UserValidator.
|
|
325
|
+
async deleteActiveSessions({ id, reason } = {}) {
|
|
326
|
+
const { error } = UserValidator.deleteActiveSessions().validate(
|
|
234
327
|
{
|
|
235
|
-
|
|
328
|
+
id,
|
|
329
|
+
reason,
|
|
236
330
|
},
|
|
237
331
|
{ abortEarly: false, allowUnknown: true }
|
|
238
332
|
);
|
|
@@ -241,40 +335,66 @@ class User {
|
|
|
241
335
|
}
|
|
242
336
|
|
|
243
337
|
// Showing warrnings if extra unknown parameters are found
|
|
244
|
-
const { error: warrning } = UserValidator.
|
|
338
|
+
const { error: warrning } = UserValidator.deleteActiveSessions().validate(
|
|
245
339
|
{
|
|
246
|
-
|
|
340
|
+
id,
|
|
341
|
+
reason,
|
|
247
342
|
},
|
|
248
343
|
{ abortEarly: false, allowUnknown: false }
|
|
249
344
|
);
|
|
250
345
|
if (warrning) {
|
|
251
|
-
|
|
252
|
-
|
|
346
|
+
Logger({
|
|
347
|
+
level: "WARN",
|
|
348
|
+
message: "Parameter Validation warrnings for deleteActiveSessions",
|
|
349
|
+
});
|
|
350
|
+
Logger({ level: "WARN", message: warrning });
|
|
253
351
|
}
|
|
254
352
|
|
|
255
353
|
const query_params = {};
|
|
354
|
+
query_params["id"] = id;
|
|
355
|
+
query_params["reason"] = reason;
|
|
256
356
|
|
|
257
|
-
|
|
357
|
+
const response = await PlatformAPIClient.execute(
|
|
258
358
|
this.config,
|
|
259
|
-
"
|
|
260
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
359
|
+
"delete",
|
|
360
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
|
|
261
361
|
query_params,
|
|
262
|
-
|
|
362
|
+
undefined
|
|
263
363
|
);
|
|
364
|
+
|
|
365
|
+
const {
|
|
366
|
+
error: res_error,
|
|
367
|
+
} = UserModel.SessionDeleteResponseSchema().validate(response, {
|
|
368
|
+
abortEarly: false,
|
|
369
|
+
allowUnknown: false,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
if (res_error) {
|
|
373
|
+
Logger({
|
|
374
|
+
level: "WARN",
|
|
375
|
+
message: "Response Validation Warnnings for deleteActiveSessions",
|
|
376
|
+
});
|
|
377
|
+
Logger({ level: "WARN", message: res_error });
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return response;
|
|
264
381
|
}
|
|
265
382
|
|
|
266
383
|
/**
|
|
267
384
|
* @param {Object} arg - Arg object.
|
|
268
|
-
* @param {string} arg.
|
|
269
|
-
* @param {
|
|
270
|
-
* @
|
|
271
|
-
* @
|
|
385
|
+
* @param {string} arg.id - ID of a customer.
|
|
386
|
+
* @param {string} arg.sessionId - Session ID of a customer.
|
|
387
|
+
* @param {string} arg.reason - Reason for deleting session.
|
|
388
|
+
* @returns {Promise<SessionDeleteResponseSchema>} - Success response
|
|
389
|
+
* @summary: Delete a session for a user
|
|
390
|
+
* @description: Use this API to Delete a session of customers who have registered in the application.
|
|
272
391
|
*/
|
|
273
|
-
|
|
274
|
-
const { error } = UserValidator.
|
|
392
|
+
async deleteSession({ id, sessionId, reason } = {}) {
|
|
393
|
+
const { error } = UserValidator.deleteSession().validate(
|
|
275
394
|
{
|
|
276
|
-
|
|
277
|
-
|
|
395
|
+
id,
|
|
396
|
+
sessionId,
|
|
397
|
+
reason,
|
|
278
398
|
},
|
|
279
399
|
{ abortEarly: false, allowUnknown: true }
|
|
280
400
|
);
|
|
@@ -283,39 +403,64 @@ class User {
|
|
|
283
403
|
}
|
|
284
404
|
|
|
285
405
|
// Showing warrnings if extra unknown parameters are found
|
|
286
|
-
const { error: warrning } = UserValidator.
|
|
406
|
+
const { error: warrning } = UserValidator.deleteSession().validate(
|
|
287
407
|
{
|
|
288
|
-
|
|
289
|
-
|
|
408
|
+
id,
|
|
409
|
+
sessionId,
|
|
410
|
+
reason,
|
|
290
411
|
},
|
|
291
412
|
{ abortEarly: false, allowUnknown: false }
|
|
292
413
|
);
|
|
293
414
|
if (warrning) {
|
|
294
|
-
|
|
295
|
-
|
|
415
|
+
Logger({
|
|
416
|
+
level: "WARN",
|
|
417
|
+
message: "Parameter Validation warrnings for deleteSession",
|
|
418
|
+
});
|
|
419
|
+
Logger({ level: "WARN", message: warrning });
|
|
296
420
|
}
|
|
297
421
|
|
|
298
422
|
const query_params = {};
|
|
423
|
+
query_params["id"] = id;
|
|
424
|
+
query_params["session_id"] = sessionId;
|
|
425
|
+
query_params["reason"] = reason;
|
|
299
426
|
|
|
300
|
-
|
|
427
|
+
const response = await PlatformAPIClient.execute(
|
|
301
428
|
this.config,
|
|
302
|
-
"
|
|
303
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers
|
|
429
|
+
"delete",
|
|
430
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
|
|
304
431
|
query_params,
|
|
305
|
-
|
|
432
|
+
undefined
|
|
306
433
|
);
|
|
434
|
+
|
|
435
|
+
const {
|
|
436
|
+
error: res_error,
|
|
437
|
+
} = UserModel.SessionDeleteResponseSchema().validate(response, {
|
|
438
|
+
abortEarly: false,
|
|
439
|
+
allowUnknown: false,
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
if (res_error) {
|
|
443
|
+
Logger({
|
|
444
|
+
level: "WARN",
|
|
445
|
+
message: "Response Validation Warnnings for deleteSession",
|
|
446
|
+
});
|
|
447
|
+
Logger({ level: "WARN", message: res_error });
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
return response;
|
|
307
451
|
}
|
|
308
452
|
|
|
309
453
|
/**
|
|
310
454
|
* @param {Object} arg - Arg object.
|
|
311
|
-
* @param {
|
|
312
|
-
* @
|
|
313
|
-
* @
|
|
455
|
+
* @param {string} arg.id - ID of a customer.
|
|
456
|
+
* @returns {Promise<SessionListResponseSchema>} - Success response
|
|
457
|
+
* @summary: Get a list of all session with info for a user
|
|
458
|
+
* @description: Use this API to retrieve a list of session with info of customers who have registered in the application.
|
|
314
459
|
*/
|
|
315
|
-
|
|
316
|
-
const { error } = UserValidator.
|
|
460
|
+
async getActiveSessions({ id } = {}) {
|
|
461
|
+
const { error } = UserValidator.getActiveSessions().validate(
|
|
317
462
|
{
|
|
318
|
-
|
|
463
|
+
id,
|
|
319
464
|
},
|
|
320
465
|
{ abortEarly: false, allowUnknown: true }
|
|
321
466
|
);
|
|
@@ -324,38 +469,67 @@ class User {
|
|
|
324
469
|
}
|
|
325
470
|
|
|
326
471
|
// Showing warrnings if extra unknown parameters are found
|
|
327
|
-
const { error: warrning } = UserValidator.
|
|
472
|
+
const { error: warrning } = UserValidator.getActiveSessions().validate(
|
|
328
473
|
{
|
|
329
|
-
|
|
474
|
+
id,
|
|
330
475
|
},
|
|
331
476
|
{ abortEarly: false, allowUnknown: false }
|
|
332
477
|
);
|
|
333
478
|
if (warrning) {
|
|
334
|
-
|
|
335
|
-
|
|
479
|
+
Logger({
|
|
480
|
+
level: "WARN",
|
|
481
|
+
message: "Parameter Validation warrnings for getActiveSessions",
|
|
482
|
+
});
|
|
483
|
+
Logger({ level: "WARN", message: warrning });
|
|
336
484
|
}
|
|
337
485
|
|
|
338
486
|
const query_params = {};
|
|
487
|
+
query_params["id"] = id;
|
|
339
488
|
|
|
340
|
-
|
|
489
|
+
const response = await PlatformAPIClient.execute(
|
|
341
490
|
this.config,
|
|
342
|
-
"
|
|
343
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
491
|
+
"get",
|
|
492
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
|
|
344
493
|
query_params,
|
|
345
|
-
|
|
494
|
+
undefined
|
|
346
495
|
);
|
|
496
|
+
|
|
497
|
+
const {
|
|
498
|
+
error: res_error,
|
|
499
|
+
} = UserModel.SessionListResponseSchema().validate(response, {
|
|
500
|
+
abortEarly: false,
|
|
501
|
+
allowUnknown: false,
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
if (res_error) {
|
|
505
|
+
Logger({
|
|
506
|
+
level: "WARN",
|
|
507
|
+
message: "Response Validation Warnnings for getActiveSessions",
|
|
508
|
+
});
|
|
509
|
+
Logger({ level: "WARN", message: res_error });
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return response;
|
|
347
513
|
}
|
|
348
514
|
|
|
349
515
|
/**
|
|
350
516
|
* @param {Object} arg - Arg object.
|
|
351
|
-
* @param {
|
|
352
|
-
*
|
|
353
|
-
* @
|
|
517
|
+
* @param {Object} [arg.q] - The search query. Mobile number or email ID of
|
|
518
|
+
* a customer.
|
|
519
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
520
|
+
* page. Default value is 10.
|
|
521
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
522
|
+
* given set of results. Default value is 1.
|
|
523
|
+
* @returns {Promise<CustomerListResponseSchema>} - Success response
|
|
524
|
+
* @summary: Get a list of customers
|
|
525
|
+
* @description: Use this API to retrieve a list of customers who have registered in the application.
|
|
354
526
|
*/
|
|
355
|
-
|
|
356
|
-
const { error } = UserValidator.
|
|
527
|
+
async getCustomers({ q, pageSize, pageNo } = {}) {
|
|
528
|
+
const { error } = UserValidator.getCustomers().validate(
|
|
357
529
|
{
|
|
358
|
-
|
|
530
|
+
q,
|
|
531
|
+
pageSize,
|
|
532
|
+
pageNo,
|
|
359
533
|
},
|
|
360
534
|
{ abortEarly: false, allowUnknown: true }
|
|
361
535
|
);
|
|
@@ -364,39 +538,118 @@ class User {
|
|
|
364
538
|
}
|
|
365
539
|
|
|
366
540
|
// Showing warrnings if extra unknown parameters are found
|
|
367
|
-
const { error: warrning } = UserValidator.
|
|
541
|
+
const { error: warrning } = UserValidator.getCustomers().validate(
|
|
368
542
|
{
|
|
369
|
-
|
|
543
|
+
q,
|
|
544
|
+
pageSize,
|
|
545
|
+
pageNo,
|
|
370
546
|
},
|
|
371
547
|
{ abortEarly: false, allowUnknown: false }
|
|
372
548
|
);
|
|
373
549
|
if (warrning) {
|
|
374
|
-
|
|
375
|
-
|
|
550
|
+
Logger({
|
|
551
|
+
level: "WARN",
|
|
552
|
+
message: "Parameter Validation warrnings for getCustomers",
|
|
553
|
+
});
|
|
554
|
+
Logger({ level: "WARN", message: warrning });
|
|
376
555
|
}
|
|
377
556
|
|
|
378
557
|
const query_params = {};
|
|
379
|
-
query_params["
|
|
558
|
+
query_params["q"] = q;
|
|
559
|
+
query_params["page_size"] = pageSize;
|
|
560
|
+
query_params["page_no"] = pageNo;
|
|
380
561
|
|
|
381
|
-
|
|
562
|
+
const response = await PlatformAPIClient.execute(
|
|
382
563
|
this.config,
|
|
383
564
|
"get",
|
|
384
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/
|
|
565
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/list`,
|
|
385
566
|
query_params,
|
|
386
567
|
undefined
|
|
387
568
|
);
|
|
569
|
+
|
|
570
|
+
const {
|
|
571
|
+
error: res_error,
|
|
572
|
+
} = UserModel.CustomerListResponseSchema().validate(response, {
|
|
573
|
+
abortEarly: false,
|
|
574
|
+
allowUnknown: false,
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
if (res_error) {
|
|
578
|
+
Logger({
|
|
579
|
+
level: "WARN",
|
|
580
|
+
message: "Response Validation Warnnings for getCustomers",
|
|
581
|
+
});
|
|
582
|
+
Logger({ level: "WARN", message: res_error });
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return response;
|
|
388
586
|
}
|
|
389
587
|
|
|
390
588
|
/**
|
|
391
589
|
* @param {Object} arg - Arg object.
|
|
392
|
-
* @
|
|
393
|
-
* @summary:
|
|
394
|
-
* @description: Use this API to
|
|
590
|
+
* @returns {Promise<PlatformSchema>} - Success response
|
|
591
|
+
* @summary: Get platform configurations
|
|
592
|
+
* @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text.
|
|
395
593
|
*/
|
|
396
|
-
|
|
397
|
-
const { error } = UserValidator.
|
|
594
|
+
async getPlatformConfig({} = {}) {
|
|
595
|
+
const { error } = UserValidator.getPlatformConfig().validate(
|
|
596
|
+
{},
|
|
597
|
+
{ abortEarly: false, allowUnknown: true }
|
|
598
|
+
);
|
|
599
|
+
if (error) {
|
|
600
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// Showing warrnings if extra unknown parameters are found
|
|
604
|
+
const { error: warrning } = UserValidator.getPlatformConfig().validate(
|
|
605
|
+
{},
|
|
606
|
+
{ abortEarly: false, allowUnknown: false }
|
|
607
|
+
);
|
|
608
|
+
if (warrning) {
|
|
609
|
+
Logger({
|
|
610
|
+
level: "WARN",
|
|
611
|
+
message: "Parameter Validation warrnings for getPlatformConfig",
|
|
612
|
+
});
|
|
613
|
+
Logger({ level: "WARN", message: warrning });
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const query_params = {};
|
|
617
|
+
|
|
618
|
+
const response = await PlatformAPIClient.execute(
|
|
619
|
+
this.config,
|
|
620
|
+
"get",
|
|
621
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
|
|
622
|
+
query_params,
|
|
623
|
+
undefined
|
|
624
|
+
);
|
|
625
|
+
|
|
626
|
+
const { error: res_error } = UserModel.PlatformSchema().validate(response, {
|
|
627
|
+
abortEarly: false,
|
|
628
|
+
allowUnknown: false,
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
if (res_error) {
|
|
632
|
+
Logger({
|
|
633
|
+
level: "WARN",
|
|
634
|
+
message: "Response Validation Warnnings for getPlatformConfig",
|
|
635
|
+
});
|
|
636
|
+
Logger({ level: "WARN", message: res_error });
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return response;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* @param {Object} arg - Arg object.
|
|
644
|
+
* @param {string} arg.groupId - Numeric ID allotted to a User Group
|
|
645
|
+
* @returns {Promise<UserGroupResponseSchema>} - Success response
|
|
646
|
+
* @summary: Get an User Group by Id
|
|
647
|
+
* @description: Use this API to get details of an existing user Group
|
|
648
|
+
*/
|
|
649
|
+
async getUserGroupById({ groupId } = {}) {
|
|
650
|
+
const { error } = UserValidator.getUserGroupById().validate(
|
|
398
651
|
{
|
|
399
|
-
|
|
652
|
+
groupId,
|
|
400
653
|
},
|
|
401
654
|
{ abortEarly: false, allowUnknown: true }
|
|
402
655
|
);
|
|
@@ -405,37 +658,69 @@ class User {
|
|
|
405
658
|
}
|
|
406
659
|
|
|
407
660
|
// Showing warrnings if extra unknown parameters are found
|
|
408
|
-
const { error: warrning } = UserValidator.
|
|
661
|
+
const { error: warrning } = UserValidator.getUserGroupById().validate(
|
|
409
662
|
{
|
|
410
|
-
|
|
663
|
+
groupId,
|
|
411
664
|
},
|
|
412
665
|
{ abortEarly: false, allowUnknown: false }
|
|
413
666
|
);
|
|
414
667
|
if (warrning) {
|
|
415
|
-
|
|
416
|
-
|
|
668
|
+
Logger({
|
|
669
|
+
level: "WARN",
|
|
670
|
+
message: "Parameter Validation warrnings for getUserGroupById",
|
|
671
|
+
});
|
|
672
|
+
Logger({ level: "WARN", message: warrning });
|
|
417
673
|
}
|
|
418
674
|
|
|
419
675
|
const query_params = {};
|
|
420
|
-
query_params["id"] = id;
|
|
421
676
|
|
|
422
|
-
|
|
677
|
+
const response = await PlatformAPIClient.execute(
|
|
423
678
|
this.config,
|
|
424
|
-
"
|
|
425
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
679
|
+
"get",
|
|
680
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_group/${groupId}`,
|
|
426
681
|
query_params,
|
|
427
682
|
undefined
|
|
428
683
|
);
|
|
684
|
+
|
|
685
|
+
const {
|
|
686
|
+
error: res_error,
|
|
687
|
+
} = UserModel.UserGroupResponseSchema().validate(response, {
|
|
688
|
+
abortEarly: false,
|
|
689
|
+
allowUnknown: false,
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
if (res_error) {
|
|
693
|
+
Logger({
|
|
694
|
+
level: "WARN",
|
|
695
|
+
message: "Response Validation Warnnings for getUserGroupById",
|
|
696
|
+
});
|
|
697
|
+
Logger({ level: "WARN", message: res_error });
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
return response;
|
|
429
701
|
}
|
|
430
702
|
|
|
431
703
|
/**
|
|
432
704
|
* @param {Object} arg - Arg object.
|
|
433
|
-
* @
|
|
434
|
-
* @
|
|
705
|
+
* @param {string} [arg.pageNo] - Page number for pagination result
|
|
706
|
+
* @param {string} [arg.pageSize] - Page size for pagination result
|
|
707
|
+
* @param {string} [arg.name] - To seartch for User Groups which contains
|
|
708
|
+
* given string in their name
|
|
709
|
+
* @param {string} [arg.status] - To get User Groups with given status
|
|
710
|
+
* @param {number} [arg.groupUid] - To get User Groups with given uid
|
|
711
|
+
* @returns {Promise<UserGroupListResponseSchema>} - Success response
|
|
712
|
+
* @summary: Get User Groups mathcing criteria
|
|
713
|
+
* @description: Use this API to get User Groups mathing criteria passed in query
|
|
435
714
|
*/
|
|
436
|
-
|
|
437
|
-
const { error } = UserValidator.
|
|
438
|
-
{
|
|
715
|
+
async getUserGroups({ pageNo, pageSize, name, status, groupUid } = {}) {
|
|
716
|
+
const { error } = UserValidator.getUserGroups().validate(
|
|
717
|
+
{
|
|
718
|
+
pageNo,
|
|
719
|
+
pageSize,
|
|
720
|
+
name,
|
|
721
|
+
status,
|
|
722
|
+
groupUid,
|
|
723
|
+
},
|
|
439
724
|
{ abortEarly: false, allowUnknown: true }
|
|
440
725
|
);
|
|
441
726
|
if (error) {
|
|
@@ -443,33 +728,189 @@ class User {
|
|
|
443
728
|
}
|
|
444
729
|
|
|
445
730
|
// Showing warrnings if extra unknown parameters are found
|
|
446
|
-
const { error: warrning } = UserValidator.
|
|
447
|
-
{
|
|
731
|
+
const { error: warrning } = UserValidator.getUserGroups().validate(
|
|
732
|
+
{
|
|
733
|
+
pageNo,
|
|
734
|
+
pageSize,
|
|
735
|
+
name,
|
|
736
|
+
status,
|
|
737
|
+
groupUid,
|
|
738
|
+
},
|
|
448
739
|
{ abortEarly: false, allowUnknown: false }
|
|
449
740
|
);
|
|
450
741
|
if (warrning) {
|
|
451
|
-
|
|
452
|
-
|
|
742
|
+
Logger({
|
|
743
|
+
level: "WARN",
|
|
744
|
+
message: "Parameter Validation warrnings for getUserGroups",
|
|
745
|
+
});
|
|
746
|
+
Logger({ level: "WARN", message: warrning });
|
|
453
747
|
}
|
|
454
748
|
|
|
455
749
|
const query_params = {};
|
|
750
|
+
query_params["page_no"] = pageNo;
|
|
751
|
+
query_params["page_size"] = pageSize;
|
|
752
|
+
query_params["name"] = name;
|
|
753
|
+
query_params["status"] = status;
|
|
754
|
+
query_params["group_uid"] = groupUid;
|
|
456
755
|
|
|
457
|
-
|
|
756
|
+
const response = await PlatformAPIClient.execute(
|
|
458
757
|
this.config,
|
|
459
758
|
"get",
|
|
460
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
759
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_group`,
|
|
461
760
|
query_params,
|
|
462
761
|
undefined
|
|
463
762
|
);
|
|
763
|
+
|
|
764
|
+
const {
|
|
765
|
+
error: res_error,
|
|
766
|
+
} = UserModel.UserGroupListResponseSchema().validate(response, {
|
|
767
|
+
abortEarly: false,
|
|
768
|
+
allowUnknown: false,
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
if (res_error) {
|
|
772
|
+
Logger({
|
|
773
|
+
level: "WARN",
|
|
774
|
+
message: "Response Validation Warnnings for getUserGroups",
|
|
775
|
+
});
|
|
776
|
+
Logger({ level: "WARN", message: res_error });
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return response;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* @param {Object} arg - Arg object.
|
|
784
|
+
* @param {string} [arg.q] - The search query. Mobile number or email ID of
|
|
785
|
+
* a customer.
|
|
786
|
+
* @returns {Promise<UserSearchResponseSchema>} - Success response
|
|
787
|
+
* @summary: Search an existing user.
|
|
788
|
+
* @description: Use this API to retrieve an existing user from a list.
|
|
789
|
+
*/
|
|
790
|
+
async searchUsers({ q } = {}) {
|
|
791
|
+
const { error } = UserValidator.searchUsers().validate(
|
|
792
|
+
{
|
|
793
|
+
q,
|
|
794
|
+
},
|
|
795
|
+
{ abortEarly: false, allowUnknown: true }
|
|
796
|
+
);
|
|
797
|
+
if (error) {
|
|
798
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// Showing warrnings if extra unknown parameters are found
|
|
802
|
+
const { error: warrning } = UserValidator.searchUsers().validate(
|
|
803
|
+
{
|
|
804
|
+
q,
|
|
805
|
+
},
|
|
806
|
+
{ abortEarly: false, allowUnknown: false }
|
|
807
|
+
);
|
|
808
|
+
if (warrning) {
|
|
809
|
+
Logger({
|
|
810
|
+
level: "WARN",
|
|
811
|
+
message: "Parameter Validation warrnings for searchUsers",
|
|
812
|
+
});
|
|
813
|
+
Logger({ level: "WARN", message: warrning });
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const query_params = {};
|
|
817
|
+
query_params["q"] = q;
|
|
818
|
+
|
|
819
|
+
const response = await PlatformAPIClient.execute(
|
|
820
|
+
this.config,
|
|
821
|
+
"get",
|
|
822
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/search`,
|
|
823
|
+
query_params,
|
|
824
|
+
undefined
|
|
825
|
+
);
|
|
826
|
+
|
|
827
|
+
const {
|
|
828
|
+
error: res_error,
|
|
829
|
+
} = UserModel.UserSearchResponseSchema().validate(response, {
|
|
830
|
+
abortEarly: false,
|
|
831
|
+
allowUnknown: false,
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
if (res_error) {
|
|
835
|
+
Logger({
|
|
836
|
+
level: "WARN",
|
|
837
|
+
message: "Response Validation Warnnings for searchUsers",
|
|
838
|
+
});
|
|
839
|
+
Logger({ level: "WARN", message: res_error });
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
return response;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @param {Object} arg - Arg object.
|
|
847
|
+
* @param {UnDeleteUserRequestSchema} arg.body
|
|
848
|
+
* @returns {Promise<UnDeleteUserSuccess>} - Success response
|
|
849
|
+
* @summary: undelete user who deleted from application and have not elapsed the platform configured delete days
|
|
850
|
+
* @description: undelete user who deleted from application and have not elapsed the platform configured delete days
|
|
851
|
+
*/
|
|
852
|
+
async unDeleteUser({ body } = {}) {
|
|
853
|
+
const { error } = UserValidator.unDeleteUser().validate(
|
|
854
|
+
{
|
|
855
|
+
body,
|
|
856
|
+
},
|
|
857
|
+
{ abortEarly: false, allowUnknown: true }
|
|
858
|
+
);
|
|
859
|
+
if (error) {
|
|
860
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// Showing warrnings if extra unknown parameters are found
|
|
864
|
+
const { error: warrning } = UserValidator.unDeleteUser().validate(
|
|
865
|
+
{
|
|
866
|
+
body,
|
|
867
|
+
},
|
|
868
|
+
{ abortEarly: false, allowUnknown: false }
|
|
869
|
+
);
|
|
870
|
+
if (warrning) {
|
|
871
|
+
Logger({
|
|
872
|
+
level: "WARN",
|
|
873
|
+
message: "Parameter Validation warrnings for unDeleteUser",
|
|
874
|
+
});
|
|
875
|
+
Logger({ level: "WARN", message: warrning });
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
const query_params = {};
|
|
879
|
+
|
|
880
|
+
const response = await PlatformAPIClient.execute(
|
|
881
|
+
this.config,
|
|
882
|
+
"put",
|
|
883
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/undelete`,
|
|
884
|
+
query_params,
|
|
885
|
+
body
|
|
886
|
+
);
|
|
887
|
+
|
|
888
|
+
const {
|
|
889
|
+
error: res_error,
|
|
890
|
+
} = UserModel.UnDeleteUserSuccess().validate(response, {
|
|
891
|
+
abortEarly: false,
|
|
892
|
+
allowUnknown: false,
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
if (res_error) {
|
|
896
|
+
Logger({
|
|
897
|
+
level: "WARN",
|
|
898
|
+
message: "Response Validation Warnnings for unDeleteUser",
|
|
899
|
+
});
|
|
900
|
+
Logger({ level: "WARN", message: res_error });
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return response;
|
|
464
904
|
}
|
|
465
905
|
|
|
466
906
|
/**
|
|
467
907
|
* @param {Object} arg - Arg object.
|
|
468
908
|
* @param {PlatformSchema} arg.body
|
|
909
|
+
* @returns {Promise<PlatformSchema>} - Success response
|
|
469
910
|
* @summary: Update platform configurations
|
|
470
911
|
* @description: Use this API to edit the existing platform configurations such as mobile image, desktop image, social logins, and all other text.
|
|
471
912
|
*/
|
|
472
|
-
updatePlatformConfig({ body } = {}) {
|
|
913
|
+
async updatePlatformConfig({ body } = {}) {
|
|
473
914
|
const { error } = UserValidator.updatePlatformConfig().validate(
|
|
474
915
|
{
|
|
475
916
|
body,
|
|
@@ -488,19 +929,165 @@ class User {
|
|
|
488
929
|
{ abortEarly: false, allowUnknown: false }
|
|
489
930
|
);
|
|
490
931
|
if (warrning) {
|
|
491
|
-
|
|
492
|
-
|
|
932
|
+
Logger({
|
|
933
|
+
level: "WARN",
|
|
934
|
+
message: "Parameter Validation warrnings for updatePlatformConfig",
|
|
935
|
+
});
|
|
936
|
+
Logger({ level: "WARN", message: warrning });
|
|
493
937
|
}
|
|
494
938
|
|
|
495
939
|
const query_params = {};
|
|
496
940
|
|
|
497
|
-
|
|
941
|
+
const response = await PlatformAPIClient.execute(
|
|
498
942
|
this.config,
|
|
499
943
|
"post",
|
|
500
944
|
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
|
|
501
945
|
query_params,
|
|
502
946
|
body
|
|
503
947
|
);
|
|
948
|
+
|
|
949
|
+
const { error: res_error } = UserModel.PlatformSchema().validate(response, {
|
|
950
|
+
abortEarly: false,
|
|
951
|
+
allowUnknown: false,
|
|
952
|
+
});
|
|
953
|
+
|
|
954
|
+
if (res_error) {
|
|
955
|
+
Logger({
|
|
956
|
+
level: "WARN",
|
|
957
|
+
message: "Response Validation Warnnings for updatePlatformConfig",
|
|
958
|
+
});
|
|
959
|
+
Logger({ level: "WARN", message: res_error });
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
return response;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* @param {Object} arg - Arg object.
|
|
967
|
+
* @param {string} arg.userId - User ID
|
|
968
|
+
* @param {UpdateUserRequestSchema} arg.body
|
|
969
|
+
* @returns {Promise<CreateUserResponseSchema>} - Success response
|
|
970
|
+
* @summary: Update user
|
|
971
|
+
* @description: Use this API to update user details, Note: Existing emails and phone numbers of user will be replaced directly if phone_numbers or emails field sent in request data.
|
|
972
|
+
*/
|
|
973
|
+
async updateUser({ userId, body } = {}) {
|
|
974
|
+
const { error } = UserValidator.updateUser().validate(
|
|
975
|
+
{
|
|
976
|
+
userId,
|
|
977
|
+
body,
|
|
978
|
+
},
|
|
979
|
+
{ abortEarly: false, allowUnknown: true }
|
|
980
|
+
);
|
|
981
|
+
if (error) {
|
|
982
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
// Showing warrnings if extra unknown parameters are found
|
|
986
|
+
const { error: warrning } = UserValidator.updateUser().validate(
|
|
987
|
+
{
|
|
988
|
+
userId,
|
|
989
|
+
body,
|
|
990
|
+
},
|
|
991
|
+
{ abortEarly: false, allowUnknown: false }
|
|
992
|
+
);
|
|
993
|
+
if (warrning) {
|
|
994
|
+
Logger({
|
|
995
|
+
level: "WARN",
|
|
996
|
+
message: "Parameter Validation warrnings for updateUser",
|
|
997
|
+
});
|
|
998
|
+
Logger({ level: "WARN", message: warrning });
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
const query_params = {};
|
|
1002
|
+
|
|
1003
|
+
const response = await PlatformAPIClient.execute(
|
|
1004
|
+
this.config,
|
|
1005
|
+
"put",
|
|
1006
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/${userId}`,
|
|
1007
|
+
query_params,
|
|
1008
|
+
body
|
|
1009
|
+
);
|
|
1010
|
+
|
|
1011
|
+
const {
|
|
1012
|
+
error: res_error,
|
|
1013
|
+
} = UserModel.CreateUserResponseSchema().validate(response, {
|
|
1014
|
+
abortEarly: false,
|
|
1015
|
+
allowUnknown: false,
|
|
1016
|
+
});
|
|
1017
|
+
|
|
1018
|
+
if (res_error) {
|
|
1019
|
+
Logger({
|
|
1020
|
+
level: "WARN",
|
|
1021
|
+
message: "Response Validation Warnnings for updateUser",
|
|
1022
|
+
});
|
|
1023
|
+
Logger({ level: "WARN", message: res_error });
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
return response;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* @param {Object} arg - Arg object.
|
|
1031
|
+
* @param {string} arg.groupId - Numeric ID allotted to a User Group
|
|
1032
|
+
* @param {UpdateUserGroupSchema} arg.body
|
|
1033
|
+
* @returns {Promise<UserGroupResponseSchema>} - Success response
|
|
1034
|
+
* @summary: Update an User Group
|
|
1035
|
+
* @description: Use this API to update an existing user Group
|
|
1036
|
+
*/
|
|
1037
|
+
async updateUserGroup({ groupId, body } = {}) {
|
|
1038
|
+
const { error } = UserValidator.updateUserGroup().validate(
|
|
1039
|
+
{
|
|
1040
|
+
groupId,
|
|
1041
|
+
body,
|
|
1042
|
+
},
|
|
1043
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1044
|
+
);
|
|
1045
|
+
if (error) {
|
|
1046
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1050
|
+
const { error: warrning } = UserValidator.updateUserGroup().validate(
|
|
1051
|
+
{
|
|
1052
|
+
groupId,
|
|
1053
|
+
body,
|
|
1054
|
+
},
|
|
1055
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1056
|
+
);
|
|
1057
|
+
if (warrning) {
|
|
1058
|
+
Logger({
|
|
1059
|
+
level: "WARN",
|
|
1060
|
+
message: "Parameter Validation warrnings for updateUserGroup",
|
|
1061
|
+
});
|
|
1062
|
+
Logger({ level: "WARN", message: warrning });
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
const query_params = {};
|
|
1066
|
+
|
|
1067
|
+
const response = await PlatformAPIClient.execute(
|
|
1068
|
+
this.config,
|
|
1069
|
+
"put",
|
|
1070
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_group/${groupId}`,
|
|
1071
|
+
query_params,
|
|
1072
|
+
body
|
|
1073
|
+
);
|
|
1074
|
+
|
|
1075
|
+
const {
|
|
1076
|
+
error: res_error,
|
|
1077
|
+
} = UserModel.UserGroupResponseSchema().validate(response, {
|
|
1078
|
+
abortEarly: false,
|
|
1079
|
+
allowUnknown: false,
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
if (res_error) {
|
|
1083
|
+
Logger({
|
|
1084
|
+
level: "WARN",
|
|
1085
|
+
message: "Response Validation Warnnings for updateUserGroup",
|
|
1086
|
+
});
|
|
1087
|
+
Logger({ level: "WARN", message: res_error });
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
return response;
|
|
504
1091
|
}
|
|
505
1092
|
}
|
|
506
1093
|
module.exports = User;
|