@gofynd/fdk-client-javascript 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +557 -1279
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +14453 -17192
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3438 -4172
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3400 -5361
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +567 -567
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +38 -38
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +191 -191
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +467 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +100 -100
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +232 -232
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +352 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +84 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +581 -581
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +41 -41
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +484 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7965 -7885
- package/sdk/platform/PlatformClient.js +8672 -10105
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -13,22 +13,15 @@ class User {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {Object} arg - Arg object.
|
|
16
|
-
* @param {
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
21
|
-
* given set of results. Default value is 1.
|
|
22
|
-
* @returns {Promise<CustomerListResponseSchema>} - Success response
|
|
23
|
-
* @summary: Get a list of customers
|
|
24
|
-
* @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
|
|
25
20
|
*/
|
|
26
|
-
async
|
|
27
|
-
const { error } = UserValidator.
|
|
21
|
+
async archiveUser({ body } = {}) {
|
|
22
|
+
const { error } = UserValidator.archiveUser().validate(
|
|
28
23
|
{
|
|
29
|
-
|
|
30
|
-
pageSize,
|
|
31
|
-
pageNo,
|
|
24
|
+
body,
|
|
32
25
|
},
|
|
33
26
|
{ abortEarly: false, allowUnknown: true }
|
|
34
27
|
);
|
|
@@ -37,38 +30,33 @@ class User {
|
|
|
37
30
|
}
|
|
38
31
|
|
|
39
32
|
// Showing warrnings if extra unknown parameters are found
|
|
40
|
-
const { error: warrning } = UserValidator.
|
|
33
|
+
const { error: warrning } = UserValidator.archiveUser().validate(
|
|
41
34
|
{
|
|
42
|
-
|
|
43
|
-
pageSize,
|
|
44
|
-
pageNo,
|
|
35
|
+
body,
|
|
45
36
|
},
|
|
46
37
|
{ abortEarly: false, allowUnknown: false }
|
|
47
38
|
);
|
|
48
39
|
if (warrning) {
|
|
49
40
|
Logger({
|
|
50
41
|
level: "WARN",
|
|
51
|
-
message: "Parameter Validation warrnings for
|
|
42
|
+
message: "Parameter Validation warrnings for archiveUser",
|
|
52
43
|
});
|
|
53
44
|
Logger({ level: "WARN", message: warrning });
|
|
54
45
|
}
|
|
55
46
|
|
|
56
47
|
const query_params = {};
|
|
57
|
-
query_params["q"] = q;
|
|
58
|
-
query_params["page_size"] = pageSize;
|
|
59
|
-
query_params["page_no"] = pageNo;
|
|
60
48
|
|
|
61
49
|
const response = await PlatformAPIClient.execute(
|
|
62
50
|
this.config,
|
|
63
|
-
"
|
|
64
|
-
`/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`,
|
|
65
53
|
query_params,
|
|
66
|
-
|
|
54
|
+
body
|
|
67
55
|
);
|
|
68
56
|
|
|
69
57
|
const {
|
|
70
58
|
error: res_error,
|
|
71
|
-
} = UserModel.
|
|
59
|
+
} = UserModel.ArchiveUserSuccess().validate(response, {
|
|
72
60
|
abortEarly: false,
|
|
73
61
|
allowUnknown: false,
|
|
74
62
|
});
|
|
@@ -76,7 +64,7 @@ class User {
|
|
|
76
64
|
if (res_error) {
|
|
77
65
|
Logger({
|
|
78
66
|
level: "WARN",
|
|
79
|
-
message: "Response Validation Warnnings for
|
|
67
|
+
message: "Response Validation Warnnings for archiveUser",
|
|
80
68
|
});
|
|
81
69
|
Logger({ level: "WARN", message: res_error });
|
|
82
70
|
}
|
|
@@ -86,16 +74,15 @@ class User {
|
|
|
86
74
|
|
|
87
75
|
/**
|
|
88
76
|
* @param {Object} arg - Arg object.
|
|
89
|
-
* @param {
|
|
90
|
-
*
|
|
91
|
-
* @
|
|
92
|
-
* @
|
|
93
|
-
* @description: Use this API to retrieve an existing user from a list.
|
|
77
|
+
* @param {BlockUserRequestSchema} arg.body
|
|
78
|
+
* @returns {Promise<BlockUserSuccess>} - Success response
|
|
79
|
+
* @summary: Block/Unblock user
|
|
80
|
+
* @description: Block/Unblock user
|
|
94
81
|
*/
|
|
95
|
-
async
|
|
96
|
-
const { error } = UserValidator.
|
|
82
|
+
async blockOrUnblockUsers({ body } = {}) {
|
|
83
|
+
const { error } = UserValidator.blockOrUnblockUsers().validate(
|
|
97
84
|
{
|
|
98
|
-
|
|
85
|
+
body,
|
|
99
86
|
},
|
|
100
87
|
{ abortEarly: false, allowUnknown: true }
|
|
101
88
|
);
|
|
@@ -104,42 +91,39 @@ class User {
|
|
|
104
91
|
}
|
|
105
92
|
|
|
106
93
|
// Showing warrnings if extra unknown parameters are found
|
|
107
|
-
const { error: warrning } = UserValidator.
|
|
94
|
+
const { error: warrning } = UserValidator.blockOrUnblockUsers().validate(
|
|
108
95
|
{
|
|
109
|
-
|
|
96
|
+
body,
|
|
110
97
|
},
|
|
111
98
|
{ abortEarly: false, allowUnknown: false }
|
|
112
99
|
);
|
|
113
100
|
if (warrning) {
|
|
114
101
|
Logger({
|
|
115
102
|
level: "WARN",
|
|
116
|
-
message: "Parameter Validation warrnings for
|
|
103
|
+
message: "Parameter Validation warrnings for blockOrUnblockUsers",
|
|
117
104
|
});
|
|
118
105
|
Logger({ level: "WARN", message: warrning });
|
|
119
106
|
}
|
|
120
107
|
|
|
121
108
|
const query_params = {};
|
|
122
|
-
query_params["q"] = q;
|
|
123
109
|
|
|
124
110
|
const response = await PlatformAPIClient.execute(
|
|
125
111
|
this.config,
|
|
126
|
-
"
|
|
127
|
-
`/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`,
|
|
128
114
|
query_params,
|
|
129
|
-
|
|
115
|
+
body
|
|
130
116
|
);
|
|
131
117
|
|
|
132
|
-
const {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
allowUnknown: false,
|
|
137
|
-
});
|
|
118
|
+
const { error: res_error } = UserModel.BlockUserSuccess().validate(
|
|
119
|
+
response,
|
|
120
|
+
{ abortEarly: false, allowUnknown: false }
|
|
121
|
+
);
|
|
138
122
|
|
|
139
123
|
if (res_error) {
|
|
140
124
|
Logger({
|
|
141
125
|
level: "WARN",
|
|
142
|
-
message: "Response Validation Warnnings for
|
|
126
|
+
message: "Response Validation Warnnings for blockOrUnblockUsers",
|
|
143
127
|
});
|
|
144
128
|
Logger({ level: "WARN", message: res_error });
|
|
145
129
|
}
|
|
@@ -210,13 +194,13 @@ class User {
|
|
|
210
194
|
|
|
211
195
|
/**
|
|
212
196
|
* @param {Object} arg - Arg object.
|
|
213
|
-
* @param {
|
|
214
|
-
* @returns {Promise<
|
|
215
|
-
* @summary:
|
|
216
|
-
* @description:
|
|
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
|
|
217
201
|
*/
|
|
218
|
-
async
|
|
219
|
-
const { error } = UserValidator.
|
|
202
|
+
async createUserGroup({ body } = {}) {
|
|
203
|
+
const { error } = UserValidator.createUserGroup().validate(
|
|
220
204
|
{
|
|
221
205
|
body,
|
|
222
206
|
},
|
|
@@ -227,7 +211,7 @@ class User {
|
|
|
227
211
|
}
|
|
228
212
|
|
|
229
213
|
// Showing warrnings if extra unknown parameters are found
|
|
230
|
-
const { error: warrning } = UserValidator.
|
|
214
|
+
const { error: warrning } = UserValidator.createUserGroup().validate(
|
|
231
215
|
{
|
|
232
216
|
body,
|
|
233
217
|
},
|
|
@@ -236,7 +220,7 @@ class User {
|
|
|
236
220
|
if (warrning) {
|
|
237
221
|
Logger({
|
|
238
222
|
level: "WARN",
|
|
239
|
-
message: "Parameter Validation warrnings for
|
|
223
|
+
message: "Parameter Validation warrnings for createUserGroup",
|
|
240
224
|
});
|
|
241
225
|
Logger({ level: "WARN", message: warrning });
|
|
242
226
|
}
|
|
@@ -245,21 +229,23 @@ class User {
|
|
|
245
229
|
|
|
246
230
|
const response = await PlatformAPIClient.execute(
|
|
247
231
|
this.config,
|
|
248
|
-
"
|
|
249
|
-
`/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`,
|
|
250
234
|
query_params,
|
|
251
235
|
body
|
|
252
236
|
);
|
|
253
237
|
|
|
254
|
-
const {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
238
|
+
const {
|
|
239
|
+
error: res_error,
|
|
240
|
+
} = UserModel.UserGroupResponseSchema().validate(response, {
|
|
241
|
+
abortEarly: false,
|
|
242
|
+
allowUnknown: false,
|
|
243
|
+
});
|
|
258
244
|
|
|
259
245
|
if (res_error) {
|
|
260
246
|
Logger({
|
|
261
247
|
level: "WARN",
|
|
262
|
-
message: "Response Validation Warnnings for
|
|
248
|
+
message: "Response Validation Warnnings for createUserGroup",
|
|
263
249
|
});
|
|
264
250
|
Logger({ level: "WARN", message: res_error });
|
|
265
251
|
}
|
|
@@ -269,13 +255,13 @@ class User {
|
|
|
269
255
|
|
|
270
256
|
/**
|
|
271
257
|
* @param {Object} arg - Arg object.
|
|
272
|
-
* @param {
|
|
273
|
-
* @returns {Promise<
|
|
274
|
-
* @summary:
|
|
275
|
-
* @description:
|
|
258
|
+
* @param {CreateUserSessionRequestSchema} arg.body
|
|
259
|
+
* @returns {Promise<CreateUserSessionResponseSchema>} - Success response
|
|
260
|
+
* @summary: Create user session
|
|
261
|
+
* @description: Create user session
|
|
276
262
|
*/
|
|
277
|
-
async
|
|
278
|
-
const { error } = UserValidator.
|
|
263
|
+
async createUserSession({ body } = {}) {
|
|
264
|
+
const { error } = UserValidator.createUserSession().validate(
|
|
279
265
|
{
|
|
280
266
|
body,
|
|
281
267
|
},
|
|
@@ -286,7 +272,7 @@ class User {
|
|
|
286
272
|
}
|
|
287
273
|
|
|
288
274
|
// Showing warrnings if extra unknown parameters are found
|
|
289
|
-
const { error: warrning } = UserValidator.
|
|
275
|
+
const { error: warrning } = UserValidator.createUserSession().validate(
|
|
290
276
|
{
|
|
291
277
|
body,
|
|
292
278
|
},
|
|
@@ -295,7 +281,7 @@ class User {
|
|
|
295
281
|
if (warrning) {
|
|
296
282
|
Logger({
|
|
297
283
|
level: "WARN",
|
|
298
|
-
message: "Parameter Validation warrnings for
|
|
284
|
+
message: "Parameter Validation warrnings for createUserSession",
|
|
299
285
|
});
|
|
300
286
|
Logger({ level: "WARN", message: warrning });
|
|
301
287
|
}
|
|
@@ -304,15 +290,15 @@ class User {
|
|
|
304
290
|
|
|
305
291
|
const response = await PlatformAPIClient.execute(
|
|
306
292
|
this.config,
|
|
307
|
-
"
|
|
308
|
-
`/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`,
|
|
309
295
|
query_params,
|
|
310
296
|
body
|
|
311
297
|
);
|
|
312
298
|
|
|
313
299
|
const {
|
|
314
300
|
error: res_error,
|
|
315
|
-
} = UserModel.
|
|
301
|
+
} = UserModel.CreateUserSessionResponseSchema().validate(response, {
|
|
316
302
|
abortEarly: false,
|
|
317
303
|
allowUnknown: false,
|
|
318
304
|
});
|
|
@@ -320,7 +306,7 @@ class User {
|
|
|
320
306
|
if (res_error) {
|
|
321
307
|
Logger({
|
|
322
308
|
level: "WARN",
|
|
323
|
-
message: "Response Validation Warnnings for
|
|
309
|
+
message: "Response Validation Warnnings for createUserSession",
|
|
324
310
|
});
|
|
325
311
|
Logger({ level: "WARN", message: res_error });
|
|
326
312
|
}
|
|
@@ -330,15 +316,17 @@ class User {
|
|
|
330
316
|
|
|
331
317
|
/**
|
|
332
318
|
* @param {Object} arg - Arg object.
|
|
333
|
-
* @param {
|
|
334
|
-
* @
|
|
335
|
-
* @
|
|
336
|
-
* @
|
|
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.
|
|
337
324
|
*/
|
|
338
|
-
async
|
|
339
|
-
const { error } = UserValidator.
|
|
325
|
+
async deleteActiveSessions({ id, reason } = {}) {
|
|
326
|
+
const { error } = UserValidator.deleteActiveSessions().validate(
|
|
340
327
|
{
|
|
341
|
-
|
|
328
|
+
id,
|
|
329
|
+
reason,
|
|
342
330
|
},
|
|
343
331
|
{ abortEarly: false, allowUnknown: true }
|
|
344
332
|
);
|
|
@@ -347,33 +335,36 @@ class User {
|
|
|
347
335
|
}
|
|
348
336
|
|
|
349
337
|
// Showing warrnings if extra unknown parameters are found
|
|
350
|
-
const { error: warrning } = UserValidator.
|
|
338
|
+
const { error: warrning } = UserValidator.deleteActiveSessions().validate(
|
|
351
339
|
{
|
|
352
|
-
|
|
340
|
+
id,
|
|
341
|
+
reason,
|
|
353
342
|
},
|
|
354
343
|
{ abortEarly: false, allowUnknown: false }
|
|
355
344
|
);
|
|
356
345
|
if (warrning) {
|
|
357
346
|
Logger({
|
|
358
347
|
level: "WARN",
|
|
359
|
-
message: "Parameter Validation warrnings for
|
|
348
|
+
message: "Parameter Validation warrnings for deleteActiveSessions",
|
|
360
349
|
});
|
|
361
350
|
Logger({ level: "WARN", message: warrning });
|
|
362
351
|
}
|
|
363
352
|
|
|
364
353
|
const query_params = {};
|
|
354
|
+
query_params["id"] = id;
|
|
355
|
+
query_params["reason"] = reason;
|
|
365
356
|
|
|
366
357
|
const response = await PlatformAPIClient.execute(
|
|
367
358
|
this.config,
|
|
368
|
-
"
|
|
369
|
-
`/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`,
|
|
370
361
|
query_params,
|
|
371
|
-
|
|
362
|
+
undefined
|
|
372
363
|
);
|
|
373
364
|
|
|
374
365
|
const {
|
|
375
366
|
error: res_error,
|
|
376
|
-
} = UserModel.
|
|
367
|
+
} = UserModel.SessionDeleteResponseSchema().validate(response, {
|
|
377
368
|
abortEarly: false,
|
|
378
369
|
allowUnknown: false,
|
|
379
370
|
});
|
|
@@ -381,7 +372,7 @@ class User {
|
|
|
381
372
|
if (res_error) {
|
|
382
373
|
Logger({
|
|
383
374
|
level: "WARN",
|
|
384
|
-
message: "Response Validation Warnnings for
|
|
375
|
+
message: "Response Validation Warnnings for deleteActiveSessions",
|
|
385
376
|
});
|
|
386
377
|
Logger({ level: "WARN", message: res_error });
|
|
387
378
|
}
|
|
@@ -391,17 +382,19 @@ class User {
|
|
|
391
382
|
|
|
392
383
|
/**
|
|
393
384
|
* @param {Object} arg - Arg object.
|
|
394
|
-
* @param {string} arg.
|
|
395
|
-
* @param {
|
|
396
|
-
* @
|
|
397
|
-
* @
|
|
398
|
-
* @
|
|
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.
|
|
399
391
|
*/
|
|
400
|
-
async
|
|
401
|
-
const { error } = UserValidator.
|
|
392
|
+
async deleteSession({ id, sessionId, reason } = {}) {
|
|
393
|
+
const { error } = UserValidator.deleteSession().validate(
|
|
402
394
|
{
|
|
403
|
-
|
|
404
|
-
|
|
395
|
+
id,
|
|
396
|
+
sessionId,
|
|
397
|
+
reason,
|
|
405
398
|
},
|
|
406
399
|
{ abortEarly: false, allowUnknown: true }
|
|
407
400
|
);
|
|
@@ -410,34 +403,38 @@ class User {
|
|
|
410
403
|
}
|
|
411
404
|
|
|
412
405
|
// Showing warrnings if extra unknown parameters are found
|
|
413
|
-
const { error: warrning } = UserValidator.
|
|
406
|
+
const { error: warrning } = UserValidator.deleteSession().validate(
|
|
414
407
|
{
|
|
415
|
-
|
|
416
|
-
|
|
408
|
+
id,
|
|
409
|
+
sessionId,
|
|
410
|
+
reason,
|
|
417
411
|
},
|
|
418
412
|
{ abortEarly: false, allowUnknown: false }
|
|
419
413
|
);
|
|
420
414
|
if (warrning) {
|
|
421
415
|
Logger({
|
|
422
416
|
level: "WARN",
|
|
423
|
-
message: "Parameter Validation warrnings for
|
|
417
|
+
message: "Parameter Validation warrnings for deleteSession",
|
|
424
418
|
});
|
|
425
419
|
Logger({ level: "WARN", message: warrning });
|
|
426
420
|
}
|
|
427
421
|
|
|
428
422
|
const query_params = {};
|
|
423
|
+
query_params["id"] = id;
|
|
424
|
+
query_params["session_id"] = sessionId;
|
|
425
|
+
query_params["reason"] = reason;
|
|
429
426
|
|
|
430
427
|
const response = await PlatformAPIClient.execute(
|
|
431
428
|
this.config,
|
|
432
|
-
"
|
|
433
|
-
`/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`,
|
|
434
431
|
query_params,
|
|
435
|
-
|
|
432
|
+
undefined
|
|
436
433
|
);
|
|
437
434
|
|
|
438
435
|
const {
|
|
439
436
|
error: res_error,
|
|
440
|
-
} = UserModel.
|
|
437
|
+
} = UserModel.SessionDeleteResponseSchema().validate(response, {
|
|
441
438
|
abortEarly: false,
|
|
442
439
|
allowUnknown: false,
|
|
443
440
|
});
|
|
@@ -445,7 +442,7 @@ class User {
|
|
|
445
442
|
if (res_error) {
|
|
446
443
|
Logger({
|
|
447
444
|
level: "WARN",
|
|
448
|
-
message: "Response Validation Warnnings for
|
|
445
|
+
message: "Response Validation Warnnings for deleteSession",
|
|
449
446
|
});
|
|
450
447
|
Logger({ level: "WARN", message: res_error });
|
|
451
448
|
}
|
|
@@ -455,15 +452,15 @@ class User {
|
|
|
455
452
|
|
|
456
453
|
/**
|
|
457
454
|
* @param {Object} arg - Arg object.
|
|
458
|
-
* @param {
|
|
459
|
-
* @returns {Promise<
|
|
460
|
-
* @summary:
|
|
461
|
-
* @description:
|
|
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.
|
|
462
459
|
*/
|
|
463
|
-
async
|
|
464
|
-
const { error } = UserValidator.
|
|
460
|
+
async getActiveSessions({ id } = {}) {
|
|
461
|
+
const { error } = UserValidator.getActiveSessions().validate(
|
|
465
462
|
{
|
|
466
|
-
|
|
463
|
+
id,
|
|
467
464
|
},
|
|
468
465
|
{ abortEarly: false, allowUnknown: true }
|
|
469
466
|
);
|
|
@@ -472,33 +469,34 @@ class User {
|
|
|
472
469
|
}
|
|
473
470
|
|
|
474
471
|
// Showing warrnings if extra unknown parameters are found
|
|
475
|
-
const { error: warrning } = UserValidator.
|
|
472
|
+
const { error: warrning } = UserValidator.getActiveSessions().validate(
|
|
476
473
|
{
|
|
477
|
-
|
|
474
|
+
id,
|
|
478
475
|
},
|
|
479
476
|
{ abortEarly: false, allowUnknown: false }
|
|
480
477
|
);
|
|
481
478
|
if (warrning) {
|
|
482
479
|
Logger({
|
|
483
480
|
level: "WARN",
|
|
484
|
-
message: "Parameter Validation warrnings for
|
|
481
|
+
message: "Parameter Validation warrnings for getActiveSessions",
|
|
485
482
|
});
|
|
486
483
|
Logger({ level: "WARN", message: warrning });
|
|
487
484
|
}
|
|
488
485
|
|
|
489
486
|
const query_params = {};
|
|
487
|
+
query_params["id"] = id;
|
|
490
488
|
|
|
491
489
|
const response = await PlatformAPIClient.execute(
|
|
492
490
|
this.config,
|
|
493
|
-
"
|
|
494
|
-
`/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`,
|
|
495
493
|
query_params,
|
|
496
|
-
|
|
494
|
+
undefined
|
|
497
495
|
);
|
|
498
496
|
|
|
499
497
|
const {
|
|
500
498
|
error: res_error,
|
|
501
|
-
} = UserModel.
|
|
499
|
+
} = UserModel.SessionListResponseSchema().validate(response, {
|
|
502
500
|
abortEarly: false,
|
|
503
501
|
allowUnknown: false,
|
|
504
502
|
});
|
|
@@ -506,7 +504,7 @@ class User {
|
|
|
506
504
|
if (res_error) {
|
|
507
505
|
Logger({
|
|
508
506
|
level: "WARN",
|
|
509
|
-
message: "Response Validation Warnnings for
|
|
507
|
+
message: "Response Validation Warnnings for getActiveSessions",
|
|
510
508
|
});
|
|
511
509
|
Logger({ level: "WARN", message: res_error });
|
|
512
510
|
}
|
|
@@ -516,15 +514,22 @@ class User {
|
|
|
516
514
|
|
|
517
515
|
/**
|
|
518
516
|
* @param {Object} arg - Arg object.
|
|
519
|
-
* @param {
|
|
520
|
-
*
|
|
521
|
-
* @
|
|
522
|
-
*
|
|
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.
|
|
523
526
|
*/
|
|
524
|
-
async
|
|
525
|
-
const { error } = UserValidator.
|
|
527
|
+
async getCustomers({ q, pageSize, pageNo } = {}) {
|
|
528
|
+
const { error } = UserValidator.getCustomers().validate(
|
|
526
529
|
{
|
|
527
|
-
|
|
530
|
+
q,
|
|
531
|
+
pageSize,
|
|
532
|
+
pageNo,
|
|
528
533
|
},
|
|
529
534
|
{ abortEarly: false, allowUnknown: true }
|
|
530
535
|
);
|
|
@@ -533,34 +538,38 @@ class User {
|
|
|
533
538
|
}
|
|
534
539
|
|
|
535
540
|
// Showing warrnings if extra unknown parameters are found
|
|
536
|
-
const { error: warrning } = UserValidator.
|
|
541
|
+
const { error: warrning } = UserValidator.getCustomers().validate(
|
|
537
542
|
{
|
|
538
|
-
|
|
543
|
+
q,
|
|
544
|
+
pageSize,
|
|
545
|
+
pageNo,
|
|
539
546
|
},
|
|
540
547
|
{ abortEarly: false, allowUnknown: false }
|
|
541
548
|
);
|
|
542
549
|
if (warrning) {
|
|
543
550
|
Logger({
|
|
544
551
|
level: "WARN",
|
|
545
|
-
message: "Parameter Validation warrnings for
|
|
552
|
+
message: "Parameter Validation warrnings for getCustomers",
|
|
546
553
|
});
|
|
547
554
|
Logger({ level: "WARN", message: warrning });
|
|
548
555
|
}
|
|
549
556
|
|
|
550
557
|
const query_params = {};
|
|
551
|
-
query_params["
|
|
558
|
+
query_params["q"] = q;
|
|
559
|
+
query_params["page_size"] = pageSize;
|
|
560
|
+
query_params["page_no"] = pageNo;
|
|
552
561
|
|
|
553
562
|
const response = await PlatformAPIClient.execute(
|
|
554
563
|
this.config,
|
|
555
564
|
"get",
|
|
556
|
-
`/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`,
|
|
557
566
|
query_params,
|
|
558
567
|
undefined
|
|
559
568
|
);
|
|
560
569
|
|
|
561
570
|
const {
|
|
562
571
|
error: res_error,
|
|
563
|
-
} = UserModel.
|
|
572
|
+
} = UserModel.CustomerListResponseSchema().validate(response, {
|
|
564
573
|
abortEarly: false,
|
|
565
574
|
allowUnknown: false,
|
|
566
575
|
});
|
|
@@ -568,7 +577,7 @@ class User {
|
|
|
568
577
|
if (res_error) {
|
|
569
578
|
Logger({
|
|
570
579
|
level: "WARN",
|
|
571
|
-
message: "Response Validation Warnnings for
|
|
580
|
+
message: "Response Validation Warnnings for getCustomers",
|
|
572
581
|
});
|
|
573
582
|
Logger({ level: "WARN", message: res_error });
|
|
574
583
|
}
|
|
@@ -578,15 +587,69 @@ class User {
|
|
|
578
587
|
|
|
579
588
|
/**
|
|
580
589
|
* @param {Object} arg - Arg object.
|
|
581
|
-
* @
|
|
582
|
-
* @
|
|
583
|
-
* @
|
|
584
|
-
* @description: Use this API to Delete a list of session of customers who have registered in the application.
|
|
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.
|
|
585
593
|
*/
|
|
586
|
-
async
|
|
587
|
-
const { error } = UserValidator.
|
|
588
|
-
{
|
|
589
|
-
|
|
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(
|
|
651
|
+
{
|
|
652
|
+
groupId,
|
|
590
653
|
},
|
|
591
654
|
{ abortEarly: false, allowUnknown: true }
|
|
592
655
|
);
|
|
@@ -595,34 +658,33 @@ class User {
|
|
|
595
658
|
}
|
|
596
659
|
|
|
597
660
|
// Showing warrnings if extra unknown parameters are found
|
|
598
|
-
const { error: warrning } = UserValidator.
|
|
661
|
+
const { error: warrning } = UserValidator.getUserGroupById().validate(
|
|
599
662
|
{
|
|
600
|
-
|
|
663
|
+
groupId,
|
|
601
664
|
},
|
|
602
665
|
{ abortEarly: false, allowUnknown: false }
|
|
603
666
|
);
|
|
604
667
|
if (warrning) {
|
|
605
668
|
Logger({
|
|
606
669
|
level: "WARN",
|
|
607
|
-
message: "Parameter Validation warrnings for
|
|
670
|
+
message: "Parameter Validation warrnings for getUserGroupById",
|
|
608
671
|
});
|
|
609
672
|
Logger({ level: "WARN", message: warrning });
|
|
610
673
|
}
|
|
611
674
|
|
|
612
675
|
const query_params = {};
|
|
613
|
-
query_params["id"] = id;
|
|
614
676
|
|
|
615
677
|
const response = await PlatformAPIClient.execute(
|
|
616
678
|
this.config,
|
|
617
|
-
"
|
|
618
|
-
`/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}`,
|
|
619
681
|
query_params,
|
|
620
682
|
undefined
|
|
621
683
|
);
|
|
622
684
|
|
|
623
685
|
const {
|
|
624
686
|
error: res_error,
|
|
625
|
-
} = UserModel.
|
|
687
|
+
} = UserModel.UserGroupResponseSchema().validate(response, {
|
|
626
688
|
abortEarly: false,
|
|
627
689
|
allowUnknown: false,
|
|
628
690
|
});
|
|
@@ -630,7 +692,7 @@ class User {
|
|
|
630
692
|
if (res_error) {
|
|
631
693
|
Logger({
|
|
632
694
|
level: "WARN",
|
|
633
|
-
message: "Response Validation Warnnings for
|
|
695
|
+
message: "Response Validation Warnnings for getUserGroupById",
|
|
634
696
|
});
|
|
635
697
|
Logger({ level: "WARN", message: res_error });
|
|
636
698
|
}
|
|
@@ -640,13 +702,25 @@ class User {
|
|
|
640
702
|
|
|
641
703
|
/**
|
|
642
704
|
* @param {Object} arg - Arg object.
|
|
643
|
-
* @
|
|
644
|
-
* @
|
|
645
|
-
* @
|
|
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
|
|
646
714
|
*/
|
|
647
|
-
async
|
|
648
|
-
const { error } = UserValidator.
|
|
649
|
-
{
|
|
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
|
+
},
|
|
650
724
|
{ abortEarly: false, allowUnknown: true }
|
|
651
725
|
);
|
|
652
726
|
if (error) {
|
|
@@ -654,29 +728,42 @@ class User {
|
|
|
654
728
|
}
|
|
655
729
|
|
|
656
730
|
// Showing warrnings if extra unknown parameters are found
|
|
657
|
-
const { error: warrning } = UserValidator.
|
|
658
|
-
{
|
|
731
|
+
const { error: warrning } = UserValidator.getUserGroups().validate(
|
|
732
|
+
{
|
|
733
|
+
pageNo,
|
|
734
|
+
pageSize,
|
|
735
|
+
name,
|
|
736
|
+
status,
|
|
737
|
+
groupUid,
|
|
738
|
+
},
|
|
659
739
|
{ abortEarly: false, allowUnknown: false }
|
|
660
740
|
);
|
|
661
741
|
if (warrning) {
|
|
662
742
|
Logger({
|
|
663
743
|
level: "WARN",
|
|
664
|
-
message: "Parameter Validation warrnings for
|
|
744
|
+
message: "Parameter Validation warrnings for getUserGroups",
|
|
665
745
|
});
|
|
666
746
|
Logger({ level: "WARN", message: warrning });
|
|
667
747
|
}
|
|
668
748
|
|
|
669
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;
|
|
670
755
|
|
|
671
756
|
const response = await PlatformAPIClient.execute(
|
|
672
757
|
this.config,
|
|
673
758
|
"get",
|
|
674
|
-
`/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`,
|
|
675
760
|
query_params,
|
|
676
761
|
undefined
|
|
677
762
|
);
|
|
678
763
|
|
|
679
|
-
const {
|
|
764
|
+
const {
|
|
765
|
+
error: res_error,
|
|
766
|
+
} = UserModel.UserGroupListResponseSchema().validate(response, {
|
|
680
767
|
abortEarly: false,
|
|
681
768
|
allowUnknown: false,
|
|
682
769
|
});
|
|
@@ -684,7 +771,131 @@ class User {
|
|
|
684
771
|
if (res_error) {
|
|
685
772
|
Logger({
|
|
686
773
|
level: "WARN",
|
|
687
|
-
message: "Response Validation Warnnings for
|
|
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",
|
|
688
899
|
});
|
|
689
900
|
Logger({ level: "WARN", message: res_error });
|
|
690
901
|
}
|
|
@@ -750,5 +961,133 @@ class User {
|
|
|
750
961
|
|
|
751
962
|
return response;
|
|
752
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;
|
|
1091
|
+
}
|
|
753
1092
|
}
|
|
754
1093
|
module.exports = User;
|