@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.10
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/README.md +1 -1
- package/package.json +3 -2
- package/sdk/application/ApplicationClient.js +20 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +3 -5
- package/sdk/application/Cart/CartApplicationModel.d.ts +1634 -1742
- package/sdk/application/Cart/CartApplicationModel.js +1388 -1464
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -4
- package/sdk/application/Cart/CartApplicationValidator.js +0 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
- package/sdk/application/Catalog/CatalogApplicationClient.js +20 -7
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1613 -1613
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +14 -0
- package/sdk/application/Catalog/CatalogApplicationValidator.js +6 -0
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1492 -1626
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1038 -1180
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -36
- package/sdk/application/Content/ContentApplicationClient.js +0 -246
- package/sdk/application/Content/ContentApplicationModel.d.ts +546 -753
- package/sdk/application/Content/ContentApplicationModel.js +565 -817
- package/sdk/application/Content/ContentApplicationValidator.d.ts +1 -40
- package/sdk/application/Content/ContentApplicationValidator.js +0 -41
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +0 -67
- package/sdk/application/Logistic/LogisticApplicationClient.js +0 -547
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +257 -712
- package/sdk/application/Logistic/LogisticApplicationModel.js +267 -755
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -211
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -131
- package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
- package/sdk/application/Order/OrderApplicationClient.js +8 -32
- package/sdk/application/Order/OrderApplicationModel.d.ts +845 -853
- package/sdk/application/Order/OrderApplicationModel.js +816 -824
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -20
- package/sdk/application/Order/OrderApplicationValidator.js +0 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -46
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -341
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1892 -2199
- package/sdk/application/Payment/PaymentApplicationModel.js +1235 -1506
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +14 -59
- package/sdk/application/Payment/PaymentApplicationValidator.js +10 -64
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1396 -1429
- package/sdk/application/PosCart/PosCartApplicationModel.js +1233 -1257
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationClient.js +3 -7
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +783 -969
- package/sdk/application/Theme/ThemeApplicationModel.js +571 -867
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -10
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -4
- package/sdk/application/User/UserApplicationClient.d.ts +0 -33
- package/sdk/application/User/UserApplicationClient.js +0 -239
- package/sdk/application/User/UserApplicationModel.d.ts +753 -768
- package/sdk/application/User/UserApplicationModel.js +731 -755
- package/sdk/application/User/UserApplicationValidator.d.ts +1 -34
- package/sdk/application/User/UserApplicationValidator.js +0 -36
- package/sdk/common/Clickstream.d.ts +1 -0
- package/sdk/common/Clickstream.js +254 -0
- package/sdk/common/Utility.js +1 -4
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +72 -60
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +70 -58
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -9
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +0 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +0 -80
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1178 -1153
- package/sdk/partner/Theme/ThemePartnerModel.js +830 -974
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +0 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +0 -9
- package/sdk/partner/index.d.ts +0 -3
- package/sdk/partner/index.js +0 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +1 -11
- package/sdk/platform/Billing/BillingPlatformClient.js +3 -110
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +734 -800
- package/sdk/platform/Billing/BillingPlatformModel.js +732 -810
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +4 -43
- package/sdk/platform/Billing/BillingPlatformValidator.js +2 -29
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +81 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -4
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3223 -3328
- package/sdk/platform/Cart/CartPlatformModel.js +2875 -2946
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +11 -15
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +21 -52
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -27
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -11
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +15 -27
- package/sdk/platform/Catalog/CatalogPlatformClient.js +93 -189
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +617 -920
- package/sdk/platform/Catalog/CatalogPlatformModel.js +584 -919
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +27 -41
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -31
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +37 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +52 -737
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +3 -133
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -113
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1079 -1228
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1090 -1262
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -8
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +4 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +629 -658
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +641 -675
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +0 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +0 -6
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2992 -3231
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2092 -2303
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -391
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1074 -3656
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -351
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -410
- package/sdk/platform/Content/ContentPlatformModel.d.ts +972 -2071
- package/sdk/platform/Content/ContentPlatformModel.js +1039 -2355
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +174 -259
- package/sdk/platform/Discount/DiscountPlatformModel.js +163 -257
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +6 -16
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +8 -117
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -55
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -39
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +821 -892
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +833 -901
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -33
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -240
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +910 -1056
- package/sdk/platform/Finance/FinancePlatformModel.js +884 -1070
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -38
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -38
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +28 -38
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +56 -137
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +29 -41
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +21 -33
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +601 -610
- package/sdk/platform/Lead/LeadPlatformModel.js +457 -471
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +1 -93
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -143
- package/sdk/platform/Order/OrderPlatformClient.js +160 -1190
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4451 -5275
- package/sdk/platform/Order/OrderPlatformModel.js +4039 -4994
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +21 -257
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -216
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -119
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +40 -750
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +7 -143
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +6 -133
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2067 -2929
- package/sdk/platform/Payment/PaymentPlatformModel.js +1427 -2090
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/PlatformApplicationClient.js +4 -4
- package/sdk/platform/PlatformClient.d.ts +2 -4
- package/sdk/platform/PlatformClient.js +4 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +66 -142
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +147 -645
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +63 -131
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +47 -126
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +105 -217
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +349 -1138
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +989 -1588
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +977 -1695
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +133 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +102 -266
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +1 -11
- package/sdk/platform/Theme/ThemePlatformClient.js +3 -87
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +765 -1133
- package/sdk/platform/Theme/ThemePlatformModel.js +561 -1009
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +4 -28
- package/sdk/platform/Theme/ThemePlatformValidator.js +2 -21
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +1 -116
- package/sdk/platform/User/UserPlatformApplicationClient.js +86 -932
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -224
- package/sdk/platform/User/UserPlatformApplicationValidator.js +5 -173
- package/sdk/platform/User/UserPlatformModel.d.ts +428 -765
- package/sdk/platform/User/UserPlatformModel.js +428 -679
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +37 -45
- package/sdk/platform/Webhook/WebhookPlatformClient.js +57 -61
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +403 -448
- package/sdk/platform/Webhook/WebhookPlatformModel.js +309 -369
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
- package/sdk/platform/index.d.ts +1 -1
- package/sdk/platform/index.js +2 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/PublicClient.d.ts +0 -4
- package/sdk/public/PublicClient.js +0 -8
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +0 -33
- package/sdk/public/Webhook/WebhookPublicClient.js +0 -242
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +15 -161
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -189
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -23
- package/sdk/public/Webhook/WebhookPublicValidator.js +0 -31
- package/sdk/public/index.d.ts +0 -2
- package/sdk/public/index.js +0 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -125
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -785
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +0 -1127
- package/sdk/partner/Lead/LeadPartnerModel.js +0 -896
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -12
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -67
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +0 -155
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +0 -1195
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +0 -372
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +0 -442
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -16
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +0 -123
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +0 -99
- package/sdk/partner/Webhook/WebhookPartnerClient.js +0 -753
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +0 -566
- package/sdk/partner/Webhook/WebhookPartnerModel.js +0 -583
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -12
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +0 -74
- package/sdk/platform/Content/ContentPlatformClient.d.ts +0 -277
- package/sdk/platform/Content/ContentPlatformClient.js +0 -2011
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +0 -247
- package/sdk/platform/Content/ContentPlatformValidator.js +0 -319
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -23
- package/sdk/public/Billing/BillingPublicClient.js +0 -116
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -92
- package/sdk/public/Billing/BillingPublicModel.js +0 -96
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -18
- package/sdk/public/Billing/BillingPublicValidator.js +0 -19
- package/sdk/public/Content/ContentPublicClient.d.ts +0 -22
- package/sdk/public/Content/ContentPublicClient.js +0 -114
- package/sdk/public/Content/ContentPublicModel.d.ts +0 -53
- package/sdk/public/Content/ContentPublicModel.js +0 -60
- package/sdk/public/Content/ContentPublicValidator.d.ts +0 -18
- package/sdk/public/Content/ContentPublicValidator.js +0 -19
|
@@ -248,88 +248,6 @@ class User {
|
|
|
248
248
|
return response;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
/**
|
|
252
|
-
* @param {UserPlatformApplicationValidator.CreateUserAttributeDefinitionParam} arg
|
|
253
|
-
* - Arg object
|
|
254
|
-
*
|
|
255
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
256
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
257
|
-
* @returns {Promise<UserPlatformModel.UserAttributeDefinitionResponse>} -
|
|
258
|
-
* Success response
|
|
259
|
-
* @name createUserAttributeDefinition
|
|
260
|
-
* @summary: Create a User Attribute Definition
|
|
261
|
-
* @description: Use this API to areate a new User Attribute Definition - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/createUserAttributeDefinition/).
|
|
262
|
-
*/
|
|
263
|
-
async createUserAttributeDefinition(
|
|
264
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
265
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
266
|
-
) {
|
|
267
|
-
const {
|
|
268
|
-
error,
|
|
269
|
-
} = UserPlatformApplicationValidator.createUserAttributeDefinition().validate(
|
|
270
|
-
{
|
|
271
|
-
body,
|
|
272
|
-
},
|
|
273
|
-
{ abortEarly: false, allowUnknown: true }
|
|
274
|
-
);
|
|
275
|
-
if (error) {
|
|
276
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Showing warrnings if extra unknown parameters are found
|
|
280
|
-
const {
|
|
281
|
-
error: warrning,
|
|
282
|
-
} = UserPlatformApplicationValidator.createUserAttributeDefinition().validate(
|
|
283
|
-
{
|
|
284
|
-
body,
|
|
285
|
-
},
|
|
286
|
-
{ abortEarly: false, allowUnknown: false }
|
|
287
|
-
);
|
|
288
|
-
if (warrning) {
|
|
289
|
-
Logger({
|
|
290
|
-
level: "WARN",
|
|
291
|
-
message: `Parameter Validation warrnings for platform > User > createUserAttributeDefinition \n ${warrning}`,
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const query_params = {};
|
|
296
|
-
|
|
297
|
-
const response = await PlatformAPIClient.execute(
|
|
298
|
-
this.config,
|
|
299
|
-
"post",
|
|
300
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition`,
|
|
301
|
-
query_params,
|
|
302
|
-
body,
|
|
303
|
-
requestHeaders,
|
|
304
|
-
{ responseHeaders }
|
|
305
|
-
);
|
|
306
|
-
|
|
307
|
-
let responseData = response;
|
|
308
|
-
if (responseHeaders) {
|
|
309
|
-
responseData = response[0];
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
const {
|
|
313
|
-
error: res_error,
|
|
314
|
-
} = UserPlatformModel.UserAttributeDefinitionResponse().validate(
|
|
315
|
-
responseData,
|
|
316
|
-
{ abortEarly: false, allowUnknown: true }
|
|
317
|
-
);
|
|
318
|
-
|
|
319
|
-
if (res_error) {
|
|
320
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
321
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
322
|
-
} else {
|
|
323
|
-
Logger({
|
|
324
|
-
level: "WARN",
|
|
325
|
-
message: `Response Validation Warnings for platform > User > createUserAttributeDefinition \n ${res_error}`,
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
return response;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
251
|
/**
|
|
334
252
|
* @param {UserPlatformApplicationValidator.CreateUserGroupParam} arg - Arg object
|
|
335
253
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -559,558 +477,7 @@ class User {
|
|
|
559
477
|
} = UserPlatformModel.SessionsDeleteResponseSchema().validate(
|
|
560
478
|
responseData,
|
|
561
479
|
{ abortEarly: false, allowUnknown: true }
|
|
562
|
-
);
|
|
563
|
-
|
|
564
|
-
if (res_error) {
|
|
565
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
566
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
567
|
-
} else {
|
|
568
|
-
Logger({
|
|
569
|
-
level: "WARN",
|
|
570
|
-
message: `Response Validation Warnings for platform > User > deleteActiveSessions \n ${res_error}`,
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
return response;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* @param {UserPlatformApplicationValidator.DeleteSessionParam} arg - Arg object
|
|
580
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
581
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
582
|
-
* @returns {Promise<UserPlatformModel.SessionDeleteResponseSchema>} -
|
|
583
|
-
* Success response
|
|
584
|
-
* @name deleteSession
|
|
585
|
-
* @summary: Delete a session for a user
|
|
586
|
-
* @description: Use this API to Delete a session of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteSession/).
|
|
587
|
-
*/
|
|
588
|
-
async deleteSession(
|
|
589
|
-
{ id, sessionId, reason, requestHeaders } = { requestHeaders: {} },
|
|
590
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
591
|
-
) {
|
|
592
|
-
const { error } = UserPlatformApplicationValidator.deleteSession().validate(
|
|
593
|
-
{
|
|
594
|
-
id,
|
|
595
|
-
sessionId,
|
|
596
|
-
reason,
|
|
597
|
-
},
|
|
598
|
-
{ abortEarly: false, allowUnknown: true }
|
|
599
|
-
);
|
|
600
|
-
if (error) {
|
|
601
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
// Showing warrnings if extra unknown parameters are found
|
|
605
|
-
const {
|
|
606
|
-
error: warrning,
|
|
607
|
-
} = UserPlatformApplicationValidator.deleteSession().validate(
|
|
608
|
-
{
|
|
609
|
-
id,
|
|
610
|
-
sessionId,
|
|
611
|
-
reason,
|
|
612
|
-
},
|
|
613
|
-
{ abortEarly: false, allowUnknown: false }
|
|
614
|
-
);
|
|
615
|
-
if (warrning) {
|
|
616
|
-
Logger({
|
|
617
|
-
level: "WARN",
|
|
618
|
-
message: `Parameter Validation warrnings for platform > User > deleteSession \n ${warrning}`,
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
const query_params = {};
|
|
623
|
-
query_params["id"] = id;
|
|
624
|
-
query_params["session_id"] = sessionId;
|
|
625
|
-
query_params["reason"] = reason;
|
|
626
|
-
|
|
627
|
-
const response = await PlatformAPIClient.execute(
|
|
628
|
-
this.config,
|
|
629
|
-
"delete",
|
|
630
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
|
|
631
|
-
query_params,
|
|
632
|
-
undefined,
|
|
633
|
-
requestHeaders,
|
|
634
|
-
{ responseHeaders }
|
|
635
|
-
);
|
|
636
|
-
|
|
637
|
-
let responseData = response;
|
|
638
|
-
if (responseHeaders) {
|
|
639
|
-
responseData = response[0];
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
const {
|
|
643
|
-
error: res_error,
|
|
644
|
-
} = UserPlatformModel.SessionDeleteResponseSchema().validate(responseData, {
|
|
645
|
-
abortEarly: false,
|
|
646
|
-
allowUnknown: true,
|
|
647
|
-
});
|
|
648
|
-
|
|
649
|
-
if (res_error) {
|
|
650
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
651
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
652
|
-
} else {
|
|
653
|
-
Logger({
|
|
654
|
-
level: "WARN",
|
|
655
|
-
message: `Response Validation Warnings for platform > User > deleteSession \n ${res_error}`,
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
return response;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* @param {UserPlatformApplicationValidator.DeleteUserAttributeParam} arg - Arg object
|
|
665
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
666
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
667
|
-
* @returns {Promise<UserPlatformModel.SuccessMessageResponse>} - Success response
|
|
668
|
-
* @name deleteUserAttribute
|
|
669
|
-
* @summary: delete User Attribute
|
|
670
|
-
* @description: delete User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteUserAttribute/).
|
|
671
|
-
*/
|
|
672
|
-
async deleteUserAttribute(
|
|
673
|
-
{ attributeDefId, userId, requestHeaders } = { requestHeaders: {} },
|
|
674
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
675
|
-
) {
|
|
676
|
-
const {
|
|
677
|
-
error,
|
|
678
|
-
} = UserPlatformApplicationValidator.deleteUserAttribute().validate(
|
|
679
|
-
{ attributeDefId, userId },
|
|
680
|
-
{ abortEarly: false, allowUnknown: true }
|
|
681
|
-
);
|
|
682
|
-
if (error) {
|
|
683
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// Showing warrnings if extra unknown parameters are found
|
|
687
|
-
const {
|
|
688
|
-
error: warrning,
|
|
689
|
-
} = UserPlatformApplicationValidator.deleteUserAttribute().validate(
|
|
690
|
-
{ attributeDefId, userId },
|
|
691
|
-
{ abortEarly: false, allowUnknown: false }
|
|
692
|
-
);
|
|
693
|
-
if (warrning) {
|
|
694
|
-
Logger({
|
|
695
|
-
level: "WARN",
|
|
696
|
-
message: `Parameter Validation warrnings for platform > User > deleteUserAttribute \n ${warrning}`,
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
const query_params = {};
|
|
701
|
-
|
|
702
|
-
const response = await PlatformAPIClient.execute(
|
|
703
|
-
this.config,
|
|
704
|
-
"delete",
|
|
705
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
|
|
706
|
-
query_params,
|
|
707
|
-
undefined,
|
|
708
|
-
requestHeaders,
|
|
709
|
-
{ responseHeaders }
|
|
710
|
-
);
|
|
711
|
-
|
|
712
|
-
let responseData = response;
|
|
713
|
-
if (responseHeaders) {
|
|
714
|
-
responseData = response[0];
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
const {
|
|
718
|
-
error: res_error,
|
|
719
|
-
} = UserPlatformModel.SuccessMessageResponse().validate(responseData, {
|
|
720
|
-
abortEarly: false,
|
|
721
|
-
allowUnknown: true,
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
if (res_error) {
|
|
725
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
726
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
727
|
-
} else {
|
|
728
|
-
Logger({
|
|
729
|
-
level: "WARN",
|
|
730
|
-
message: `Response Validation Warnings for platform > User > deleteUserAttribute \n ${res_error}`,
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
return response;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* @param {UserPlatformApplicationValidator.DeleteUserAttributeDefinitionByIdParam} arg
|
|
740
|
-
* - Arg object
|
|
741
|
-
*
|
|
742
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
743
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
744
|
-
* @returns {Promise<UserPlatformModel.SuccessMessageResponse>} - Success response
|
|
745
|
-
* @name deleteUserAttributeDefinitionById
|
|
746
|
-
* @summary: Delete User Attribute Definition
|
|
747
|
-
* @description: Delete a user attribute definition by its unique identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteUserAttributeDefinitionById/).
|
|
748
|
-
*/
|
|
749
|
-
async deleteUserAttributeDefinitionById(
|
|
750
|
-
{ attributeDefId, requestHeaders } = { requestHeaders: {} },
|
|
751
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
752
|
-
) {
|
|
753
|
-
const {
|
|
754
|
-
error,
|
|
755
|
-
} = UserPlatformApplicationValidator.deleteUserAttributeDefinitionById().validate(
|
|
756
|
-
{ attributeDefId },
|
|
757
|
-
{ abortEarly: false, allowUnknown: true }
|
|
758
|
-
);
|
|
759
|
-
if (error) {
|
|
760
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
// Showing warrnings if extra unknown parameters are found
|
|
764
|
-
const {
|
|
765
|
-
error: warrning,
|
|
766
|
-
} = UserPlatformApplicationValidator.deleteUserAttributeDefinitionById().validate(
|
|
767
|
-
{ attributeDefId },
|
|
768
|
-
{ abortEarly: false, allowUnknown: false }
|
|
769
|
-
);
|
|
770
|
-
if (warrning) {
|
|
771
|
-
Logger({
|
|
772
|
-
level: "WARN",
|
|
773
|
-
message: `Parameter Validation warrnings for platform > User > deleteUserAttributeDefinitionById \n ${warrning}`,
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
const query_params = {};
|
|
778
|
-
|
|
779
|
-
const response = await PlatformAPIClient.execute(
|
|
780
|
-
this.config,
|
|
781
|
-
"delete",
|
|
782
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}`,
|
|
783
|
-
query_params,
|
|
784
|
-
undefined,
|
|
785
|
-
requestHeaders,
|
|
786
|
-
{ responseHeaders }
|
|
787
|
-
);
|
|
788
|
-
|
|
789
|
-
let responseData = response;
|
|
790
|
-
if (responseHeaders) {
|
|
791
|
-
responseData = response[0];
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
const {
|
|
795
|
-
error: res_error,
|
|
796
|
-
} = UserPlatformModel.SuccessMessageResponse().validate(responseData, {
|
|
797
|
-
abortEarly: false,
|
|
798
|
-
allowUnknown: true,
|
|
799
|
-
});
|
|
800
|
-
|
|
801
|
-
if (res_error) {
|
|
802
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
803
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
804
|
-
} else {
|
|
805
|
-
Logger({
|
|
806
|
-
level: "WARN",
|
|
807
|
-
message: `Response Validation Warnings for platform > User > deleteUserAttributeDefinitionById \n ${res_error}`,
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
return response;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
/**
|
|
816
|
-
* @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
|
|
817
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
818
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
819
|
-
* @returns {Promise<UserPlatformModel.SessionListResponseSchema>} - Success response
|
|
820
|
-
* @name getActiveSessions
|
|
821
|
-
* @summary: Get a list of all session with info for a user
|
|
822
|
-
* @description: Use this API to retrieve a list of session with info of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getActiveSessions/).
|
|
823
|
-
*/
|
|
824
|
-
async getActiveSessions(
|
|
825
|
-
{ id, requestHeaders } = { requestHeaders: {} },
|
|
826
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
827
|
-
) {
|
|
828
|
-
const {
|
|
829
|
-
error,
|
|
830
|
-
} = UserPlatformApplicationValidator.getActiveSessions().validate(
|
|
831
|
-
{
|
|
832
|
-
id,
|
|
833
|
-
},
|
|
834
|
-
{ abortEarly: false, allowUnknown: true }
|
|
835
|
-
);
|
|
836
|
-
if (error) {
|
|
837
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
// Showing warrnings if extra unknown parameters are found
|
|
841
|
-
const {
|
|
842
|
-
error: warrning,
|
|
843
|
-
} = UserPlatformApplicationValidator.getActiveSessions().validate(
|
|
844
|
-
{
|
|
845
|
-
id,
|
|
846
|
-
},
|
|
847
|
-
{ abortEarly: false, allowUnknown: false }
|
|
848
|
-
);
|
|
849
|
-
if (warrning) {
|
|
850
|
-
Logger({
|
|
851
|
-
level: "WARN",
|
|
852
|
-
message: `Parameter Validation warrnings for platform > User > getActiveSessions \n ${warrning}`,
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
const query_params = {};
|
|
857
|
-
query_params["id"] = id;
|
|
858
|
-
|
|
859
|
-
const response = await PlatformAPIClient.execute(
|
|
860
|
-
this.config,
|
|
861
|
-
"get",
|
|
862
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
|
|
863
|
-
query_params,
|
|
864
|
-
undefined,
|
|
865
|
-
requestHeaders,
|
|
866
|
-
{ responseHeaders }
|
|
867
|
-
);
|
|
868
|
-
|
|
869
|
-
let responseData = response;
|
|
870
|
-
if (responseHeaders) {
|
|
871
|
-
responseData = response[0];
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
const {
|
|
875
|
-
error: res_error,
|
|
876
|
-
} = UserPlatformModel.SessionListResponseSchema().validate(responseData, {
|
|
877
|
-
abortEarly: false,
|
|
878
|
-
allowUnknown: true,
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
if (res_error) {
|
|
882
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
883
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
884
|
-
} else {
|
|
885
|
-
Logger({
|
|
886
|
-
level: "WARN",
|
|
887
|
-
message: `Response Validation Warnings for platform > User > getActiveSessions \n ${res_error}`,
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
return response;
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* @param {UserPlatformApplicationValidator.GetCustomersParam} arg - Arg object
|
|
897
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
898
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
899
|
-
* @returns {Promise<UserPlatformModel.CustomerListResponseSchema>} - Success response
|
|
900
|
-
* @name getCustomers
|
|
901
|
-
* @summary: Get a list of customers
|
|
902
|
-
* @description: Use this API to retrieve a list of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getCustomers/).
|
|
903
|
-
*/
|
|
904
|
-
async getCustomers(
|
|
905
|
-
{ q, pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
|
|
906
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
907
|
-
) {
|
|
908
|
-
const { error } = UserPlatformApplicationValidator.getCustomers().validate(
|
|
909
|
-
{
|
|
910
|
-
q,
|
|
911
|
-
pageSize,
|
|
912
|
-
pageNo,
|
|
913
|
-
},
|
|
914
|
-
{ abortEarly: false, allowUnknown: true }
|
|
915
|
-
);
|
|
916
|
-
if (error) {
|
|
917
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
// Showing warrnings if extra unknown parameters are found
|
|
921
|
-
const {
|
|
922
|
-
error: warrning,
|
|
923
|
-
} = UserPlatformApplicationValidator.getCustomers().validate(
|
|
924
|
-
{
|
|
925
|
-
q,
|
|
926
|
-
pageSize,
|
|
927
|
-
pageNo,
|
|
928
|
-
},
|
|
929
|
-
{ abortEarly: false, allowUnknown: false }
|
|
930
|
-
);
|
|
931
|
-
if (warrning) {
|
|
932
|
-
Logger({
|
|
933
|
-
level: "WARN",
|
|
934
|
-
message: `Parameter Validation warrnings for platform > User > getCustomers \n ${warrning}`,
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
const query_params = {};
|
|
939
|
-
query_params["q"] = q;
|
|
940
|
-
query_params["page_size"] = pageSize;
|
|
941
|
-
query_params["page_no"] = pageNo;
|
|
942
|
-
|
|
943
|
-
const response = await PlatformAPIClient.execute(
|
|
944
|
-
this.config,
|
|
945
|
-
"get",
|
|
946
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/list`,
|
|
947
|
-
query_params,
|
|
948
|
-
undefined,
|
|
949
|
-
requestHeaders,
|
|
950
|
-
{ responseHeaders }
|
|
951
|
-
);
|
|
952
|
-
|
|
953
|
-
let responseData = response;
|
|
954
|
-
if (responseHeaders) {
|
|
955
|
-
responseData = response[0];
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
const {
|
|
959
|
-
error: res_error,
|
|
960
|
-
} = UserPlatformModel.CustomerListResponseSchema().validate(responseData, {
|
|
961
|
-
abortEarly: false,
|
|
962
|
-
allowUnknown: true,
|
|
963
|
-
});
|
|
964
|
-
|
|
965
|
-
if (res_error) {
|
|
966
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
967
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
968
|
-
} else {
|
|
969
|
-
Logger({
|
|
970
|
-
level: "WARN",
|
|
971
|
-
message: `Response Validation Warnings for platform > User > getCustomers \n ${res_error}`,
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
return response;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* @param {UserPlatformApplicationValidator.GetPlatformConfigParam} arg - Arg object
|
|
981
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
982
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
983
|
-
* @returns {Promise<UserPlatformModel.PlatformSchema>} - Success response
|
|
984
|
-
* @name getPlatformConfig
|
|
985
|
-
* @summary: Get platform configurations
|
|
986
|
-
* @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getPlatformConfig/).
|
|
987
|
-
*/
|
|
988
|
-
async getPlatformConfig(
|
|
989
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
990
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
991
|
-
) {
|
|
992
|
-
const {
|
|
993
|
-
error,
|
|
994
|
-
} = UserPlatformApplicationValidator.getPlatformConfig().validate(
|
|
995
|
-
{},
|
|
996
|
-
{ abortEarly: false, allowUnknown: true }
|
|
997
|
-
);
|
|
998
|
-
if (error) {
|
|
999
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1003
|
-
const {
|
|
1004
|
-
error: warrning,
|
|
1005
|
-
} = UserPlatformApplicationValidator.getPlatformConfig().validate(
|
|
1006
|
-
{},
|
|
1007
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1008
|
-
);
|
|
1009
|
-
if (warrning) {
|
|
1010
|
-
Logger({
|
|
1011
|
-
level: "WARN",
|
|
1012
|
-
message: `Parameter Validation warrnings for platform > User > getPlatformConfig \n ${warrning}`,
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
const query_params = {};
|
|
1017
|
-
|
|
1018
|
-
const response = await PlatformAPIClient.execute(
|
|
1019
|
-
this.config,
|
|
1020
|
-
"get",
|
|
1021
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
|
|
1022
|
-
query_params,
|
|
1023
|
-
undefined,
|
|
1024
|
-
requestHeaders,
|
|
1025
|
-
{ responseHeaders }
|
|
1026
|
-
);
|
|
1027
|
-
|
|
1028
|
-
let responseData = response;
|
|
1029
|
-
if (responseHeaders) {
|
|
1030
|
-
responseData = response[0];
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
const {
|
|
1034
|
-
error: res_error,
|
|
1035
|
-
} = UserPlatformModel.PlatformSchema().validate(responseData, {
|
|
1036
|
-
abortEarly: false,
|
|
1037
|
-
allowUnknown: true,
|
|
1038
|
-
});
|
|
1039
|
-
|
|
1040
|
-
if (res_error) {
|
|
1041
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1042
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1043
|
-
} else {
|
|
1044
|
-
Logger({
|
|
1045
|
-
level: "WARN",
|
|
1046
|
-
message: `Response Validation Warnings for platform > User > getPlatformConfig \n ${res_error}`,
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
return response;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* @param {UserPlatformApplicationValidator.GetUserAttributeParam} arg - Arg object
|
|
1056
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1057
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1058
|
-
* @returns {Promise<UserPlatformModel.UserAttributeResponse>} - Success response
|
|
1059
|
-
* @name getUserAttribute
|
|
1060
|
-
* @summary: get User Attribute
|
|
1061
|
-
* @description: get User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttribute/).
|
|
1062
|
-
*/
|
|
1063
|
-
async getUserAttribute(
|
|
1064
|
-
{ attributeDefId, userId, requestHeaders } = { requestHeaders: {} },
|
|
1065
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1066
|
-
) {
|
|
1067
|
-
const {
|
|
1068
|
-
error,
|
|
1069
|
-
} = UserPlatformApplicationValidator.getUserAttribute().validate(
|
|
1070
|
-
{ attributeDefId, userId },
|
|
1071
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1072
|
-
);
|
|
1073
|
-
if (error) {
|
|
1074
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1078
|
-
const {
|
|
1079
|
-
error: warrning,
|
|
1080
|
-
} = UserPlatformApplicationValidator.getUserAttribute().validate(
|
|
1081
|
-
{ attributeDefId, userId },
|
|
1082
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1083
|
-
);
|
|
1084
|
-
if (warrning) {
|
|
1085
|
-
Logger({
|
|
1086
|
-
level: "WARN",
|
|
1087
|
-
message: `Parameter Validation warrnings for platform > User > getUserAttribute \n ${warrning}`,
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
const query_params = {};
|
|
1092
|
-
|
|
1093
|
-
const response = await PlatformAPIClient.execute(
|
|
1094
|
-
this.config,
|
|
1095
|
-
"get",
|
|
1096
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
|
|
1097
|
-
query_params,
|
|
1098
|
-
undefined,
|
|
1099
|
-
requestHeaders,
|
|
1100
|
-
{ responseHeaders }
|
|
1101
|
-
);
|
|
1102
|
-
|
|
1103
|
-
let responseData = response;
|
|
1104
|
-
if (responseHeaders) {
|
|
1105
|
-
responseData = response[0];
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
const {
|
|
1109
|
-
error: res_error,
|
|
1110
|
-
} = UserPlatformModel.UserAttributeResponse().validate(responseData, {
|
|
1111
|
-
abortEarly: false,
|
|
1112
|
-
allowUnknown: true,
|
|
1113
|
-
});
|
|
480
|
+
);
|
|
1114
481
|
|
|
1115
482
|
if (res_error) {
|
|
1116
483
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1118,7 +485,7 @@ class User {
|
|
|
1118
485
|
} else {
|
|
1119
486
|
Logger({
|
|
1120
487
|
level: "WARN",
|
|
1121
|
-
message: `Response Validation Warnings for platform > User >
|
|
488
|
+
message: `Response Validation Warnings for platform > User > deleteActiveSessions \n ${res_error}`,
|
|
1122
489
|
});
|
|
1123
490
|
}
|
|
1124
491
|
}
|
|
@@ -1127,24 +494,25 @@ class User {
|
|
|
1127
494
|
}
|
|
1128
495
|
|
|
1129
496
|
/**
|
|
1130
|
-
* @param {UserPlatformApplicationValidator.
|
|
1131
|
-
* - Arg object
|
|
1132
|
-
*
|
|
497
|
+
* @param {UserPlatformApplicationValidator.DeleteSessionParam} arg - Arg object
|
|
1133
498
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1134
499
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1135
|
-
* @returns {Promise<UserPlatformModel.
|
|
1136
|
-
*
|
|
1137
|
-
* @
|
|
1138
|
-
* @
|
|
500
|
+
* @returns {Promise<UserPlatformModel.SessionDeleteResponseSchema>} -
|
|
501
|
+
* Success response
|
|
502
|
+
* @name deleteSession
|
|
503
|
+
* @summary: Delete a session for a user
|
|
504
|
+
* @description: Use this API to Delete a session of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteSession/).
|
|
1139
505
|
*/
|
|
1140
|
-
async
|
|
1141
|
-
{
|
|
506
|
+
async deleteSession(
|
|
507
|
+
{ id, sessionId, reason, requestHeaders } = { requestHeaders: {} },
|
|
1142
508
|
{ responseHeaders } = { responseHeaders: false }
|
|
1143
509
|
) {
|
|
1144
|
-
const {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
510
|
+
const { error } = UserPlatformApplicationValidator.deleteSession().validate(
|
|
511
|
+
{
|
|
512
|
+
id,
|
|
513
|
+
sessionId,
|
|
514
|
+
reason,
|
|
515
|
+
},
|
|
1148
516
|
{ abortEarly: false, allowUnknown: true }
|
|
1149
517
|
);
|
|
1150
518
|
if (error) {
|
|
@@ -1154,23 +522,30 @@ class User {
|
|
|
1154
522
|
// Showing warrnings if extra unknown parameters are found
|
|
1155
523
|
const {
|
|
1156
524
|
error: warrning,
|
|
1157
|
-
} = UserPlatformApplicationValidator.
|
|
1158
|
-
{
|
|
525
|
+
} = UserPlatformApplicationValidator.deleteSession().validate(
|
|
526
|
+
{
|
|
527
|
+
id,
|
|
528
|
+
sessionId,
|
|
529
|
+
reason,
|
|
530
|
+
},
|
|
1159
531
|
{ abortEarly: false, allowUnknown: false }
|
|
1160
532
|
);
|
|
1161
533
|
if (warrning) {
|
|
1162
534
|
Logger({
|
|
1163
535
|
level: "WARN",
|
|
1164
|
-
message: `Parameter Validation warrnings for platform > User >
|
|
536
|
+
message: `Parameter Validation warrnings for platform > User > deleteSession \n ${warrning}`,
|
|
1165
537
|
});
|
|
1166
538
|
}
|
|
1167
539
|
|
|
1168
540
|
const query_params = {};
|
|
541
|
+
query_params["id"] = id;
|
|
542
|
+
query_params["session_id"] = sessionId;
|
|
543
|
+
query_params["reason"] = reason;
|
|
1169
544
|
|
|
1170
545
|
const response = await PlatformAPIClient.execute(
|
|
1171
546
|
this.config,
|
|
1172
|
-
"
|
|
1173
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
547
|
+
"delete",
|
|
548
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
|
|
1174
549
|
query_params,
|
|
1175
550
|
undefined,
|
|
1176
551
|
requestHeaders,
|
|
@@ -1184,7 +559,7 @@ class User {
|
|
|
1184
559
|
|
|
1185
560
|
const {
|
|
1186
561
|
error: res_error,
|
|
1187
|
-
} = UserPlatformModel.
|
|
562
|
+
} = UserPlatformModel.SessionDeleteResponseSchema().validate(responseData, {
|
|
1188
563
|
abortEarly: false,
|
|
1189
564
|
allowUnknown: true,
|
|
1190
565
|
});
|
|
@@ -1195,7 +570,7 @@ class User {
|
|
|
1195
570
|
} else {
|
|
1196
571
|
Logger({
|
|
1197
572
|
level: "WARN",
|
|
1198
|
-
message: `Response Validation Warnings for platform > User >
|
|
573
|
+
message: `Response Validation Warnings for platform > User > deleteSession \n ${res_error}`,
|
|
1199
574
|
});
|
|
1200
575
|
}
|
|
1201
576
|
}
|
|
@@ -1204,24 +579,24 @@ class User {
|
|
|
1204
579
|
}
|
|
1205
580
|
|
|
1206
581
|
/**
|
|
1207
|
-
* @param {UserPlatformApplicationValidator.
|
|
1208
|
-
* - Arg object
|
|
1209
|
-
*
|
|
582
|
+
* @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
|
|
1210
583
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1211
584
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1212
|
-
* @returns {Promise<UserPlatformModel.
|
|
1213
|
-
* @name
|
|
1214
|
-
* @summary: Get
|
|
1215
|
-
* @description:
|
|
585
|
+
* @returns {Promise<UserPlatformModel.SessionListResponseSchema>} - Success response
|
|
586
|
+
* @name getActiveSessions
|
|
587
|
+
* @summary: Get a list of all session with info for a user
|
|
588
|
+
* @description: Use this API to retrieve a list of session with info of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getActiveSessions/).
|
|
1216
589
|
*/
|
|
1217
|
-
async
|
|
1218
|
-
{
|
|
590
|
+
async getActiveSessions(
|
|
591
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1219
592
|
{ responseHeaders } = { responseHeaders: false }
|
|
1220
593
|
) {
|
|
1221
594
|
const {
|
|
1222
595
|
error,
|
|
1223
|
-
} = UserPlatformApplicationValidator.
|
|
1224
|
-
{
|
|
596
|
+
} = UserPlatformApplicationValidator.getActiveSessions().validate(
|
|
597
|
+
{
|
|
598
|
+
id,
|
|
599
|
+
},
|
|
1225
600
|
{ abortEarly: false, allowUnknown: true }
|
|
1226
601
|
);
|
|
1227
602
|
if (error) {
|
|
@@ -1231,23 +606,26 @@ class User {
|
|
|
1231
606
|
// Showing warrnings if extra unknown parameters are found
|
|
1232
607
|
const {
|
|
1233
608
|
error: warrning,
|
|
1234
|
-
} = UserPlatformApplicationValidator.
|
|
1235
|
-
{
|
|
609
|
+
} = UserPlatformApplicationValidator.getActiveSessions().validate(
|
|
610
|
+
{
|
|
611
|
+
id,
|
|
612
|
+
},
|
|
1236
613
|
{ abortEarly: false, allowUnknown: false }
|
|
1237
614
|
);
|
|
1238
615
|
if (warrning) {
|
|
1239
616
|
Logger({
|
|
1240
617
|
level: "WARN",
|
|
1241
|
-
message: `Parameter Validation warrnings for platform > User >
|
|
618
|
+
message: `Parameter Validation warrnings for platform > User > getActiveSessions \n ${warrning}`,
|
|
1242
619
|
});
|
|
1243
620
|
}
|
|
1244
621
|
|
|
1245
622
|
const query_params = {};
|
|
623
|
+
query_params["id"] = id;
|
|
1246
624
|
|
|
1247
625
|
const response = await PlatformAPIClient.execute(
|
|
1248
626
|
this.config,
|
|
1249
627
|
"get",
|
|
1250
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
628
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
|
|
1251
629
|
query_params,
|
|
1252
630
|
undefined,
|
|
1253
631
|
requestHeaders,
|
|
@@ -1261,7 +639,7 @@ class User {
|
|
|
1261
639
|
|
|
1262
640
|
const {
|
|
1263
641
|
error: res_error,
|
|
1264
|
-
} = UserPlatformModel.
|
|
642
|
+
} = UserPlatformModel.SessionListResponseSchema().validate(responseData, {
|
|
1265
643
|
abortEarly: false,
|
|
1266
644
|
allowUnknown: true,
|
|
1267
645
|
});
|
|
@@ -1272,7 +650,7 @@ class User {
|
|
|
1272
650
|
} else {
|
|
1273
651
|
Logger({
|
|
1274
652
|
level: "WARN",
|
|
1275
|
-
message: `Response Validation Warnings for platform > User >
|
|
653
|
+
message: `Response Validation Warnings for platform > User > getActiveSessions \n ${res_error}`,
|
|
1276
654
|
});
|
|
1277
655
|
}
|
|
1278
656
|
}
|
|
@@ -1281,46 +659,21 @@ class User {
|
|
|
1281
659
|
}
|
|
1282
660
|
|
|
1283
661
|
/**
|
|
1284
|
-
* @param {UserPlatformApplicationValidator.
|
|
1285
|
-
* - Arg object
|
|
1286
|
-
*
|
|
662
|
+
* @param {UserPlatformApplicationValidator.GetCustomersParam} arg - Arg object
|
|
1287
663
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1288
664
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1289
|
-
* @returns {Promise<
|
|
1290
|
-
* @name
|
|
1291
|
-
* @summary: Get
|
|
1292
|
-
* @description:
|
|
665
|
+
* @returns {Promise<UserPlatformModel.CustomerListResponseSchema>} - Success response
|
|
666
|
+
* @name getCustomers
|
|
667
|
+
* @summary: Get a list of customers
|
|
668
|
+
* @description: Use this API to retrieve a list of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getCustomers/).
|
|
1293
669
|
*/
|
|
1294
|
-
async
|
|
1295
|
-
{
|
|
1296
|
-
excludingIds,
|
|
1297
|
-
slug,
|
|
1298
|
-
type,
|
|
1299
|
-
customerEditable,
|
|
1300
|
-
encrypted,
|
|
1301
|
-
pinned,
|
|
1302
|
-
pinOrder,
|
|
1303
|
-
isLocked,
|
|
1304
|
-
name,
|
|
1305
|
-
pageSize,
|
|
1306
|
-
pageNo,
|
|
1307
|
-
requestHeaders,
|
|
1308
|
-
} = { requestHeaders: {} },
|
|
670
|
+
async getCustomers(
|
|
671
|
+
{ q, pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
|
|
1309
672
|
{ responseHeaders } = { responseHeaders: false }
|
|
1310
673
|
) {
|
|
1311
|
-
const {
|
|
1312
|
-
error,
|
|
1313
|
-
} = UserPlatformApplicationValidator.getUserAttributeDefinitions().validate(
|
|
674
|
+
const { error } = UserPlatformApplicationValidator.getCustomers().validate(
|
|
1314
675
|
{
|
|
1315
|
-
|
|
1316
|
-
slug,
|
|
1317
|
-
type,
|
|
1318
|
-
customerEditable,
|
|
1319
|
-
encrypted,
|
|
1320
|
-
pinned,
|
|
1321
|
-
pinOrder,
|
|
1322
|
-
isLocked,
|
|
1323
|
-
name,
|
|
676
|
+
q,
|
|
1324
677
|
pageSize,
|
|
1325
678
|
pageNo,
|
|
1326
679
|
},
|
|
@@ -1333,17 +686,9 @@ class User {
|
|
|
1333
686
|
// Showing warrnings if extra unknown parameters are found
|
|
1334
687
|
const {
|
|
1335
688
|
error: warrning,
|
|
1336
|
-
} = UserPlatformApplicationValidator.
|
|
689
|
+
} = UserPlatformApplicationValidator.getCustomers().validate(
|
|
1337
690
|
{
|
|
1338
|
-
|
|
1339
|
-
slug,
|
|
1340
|
-
type,
|
|
1341
|
-
customerEditable,
|
|
1342
|
-
encrypted,
|
|
1343
|
-
pinned,
|
|
1344
|
-
pinOrder,
|
|
1345
|
-
isLocked,
|
|
1346
|
-
name,
|
|
691
|
+
q,
|
|
1347
692
|
pageSize,
|
|
1348
693
|
pageNo,
|
|
1349
694
|
},
|
|
@@ -1352,27 +697,19 @@ class User {
|
|
|
1352
697
|
if (warrning) {
|
|
1353
698
|
Logger({
|
|
1354
699
|
level: "WARN",
|
|
1355
|
-
message: `Parameter Validation warrnings for platform > User >
|
|
700
|
+
message: `Parameter Validation warrnings for platform > User > getCustomers \n ${warrning}`,
|
|
1356
701
|
});
|
|
1357
702
|
}
|
|
1358
703
|
|
|
1359
704
|
const query_params = {};
|
|
1360
|
-
query_params["
|
|
1361
|
-
query_params["slug"] = slug;
|
|
1362
|
-
query_params["type"] = type;
|
|
1363
|
-
query_params["customer_editable"] = customerEditable;
|
|
1364
|
-
query_params["encrypted"] = encrypted;
|
|
1365
|
-
query_params["pinned"] = pinned;
|
|
1366
|
-
query_params["pin_order"] = pinOrder;
|
|
1367
|
-
query_params["is_locked"] = isLocked;
|
|
1368
|
-
query_params["name"] = name;
|
|
705
|
+
query_params["q"] = q;
|
|
1369
706
|
query_params["page_size"] = pageSize;
|
|
1370
707
|
query_params["page_no"] = pageNo;
|
|
1371
708
|
|
|
1372
709
|
const response = await PlatformAPIClient.execute(
|
|
1373
710
|
this.config,
|
|
1374
711
|
"get",
|
|
1375
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
712
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/list`,
|
|
1376
713
|
query_params,
|
|
1377
714
|
undefined,
|
|
1378
715
|
requestHeaders,
|
|
@@ -1384,7 +721,9 @@ class User {
|
|
|
1384
721
|
responseData = response[0];
|
|
1385
722
|
}
|
|
1386
723
|
|
|
1387
|
-
const {
|
|
724
|
+
const {
|
|
725
|
+
error: res_error,
|
|
726
|
+
} = UserPlatformModel.CustomerListResponseSchema().validate(responseData, {
|
|
1388
727
|
abortEarly: false,
|
|
1389
728
|
allowUnknown: true,
|
|
1390
729
|
});
|
|
@@ -1395,7 +734,7 @@ class User {
|
|
|
1395
734
|
} else {
|
|
1396
735
|
Logger({
|
|
1397
736
|
level: "WARN",
|
|
1398
|
-
message: `Response Validation Warnings for platform > User >
|
|
737
|
+
message: `Response Validation Warnings for platform > User > getCustomers \n ${res_error}`,
|
|
1399
738
|
});
|
|
1400
739
|
}
|
|
1401
740
|
}
|
|
@@ -1404,29 +743,22 @@ class User {
|
|
|
1404
743
|
}
|
|
1405
744
|
|
|
1406
745
|
/**
|
|
1407
|
-
* @param {UserPlatformApplicationValidator.
|
|
1408
|
-
* - Arg object
|
|
1409
|
-
*
|
|
746
|
+
* @param {UserPlatformApplicationValidator.GetPlatformConfigParam} arg - Arg object
|
|
1410
747
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1411
748
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1412
|
-
* @returns {Promise<
|
|
1413
|
-
* @name
|
|
1414
|
-
* @summary: Get
|
|
1415
|
-
* @description:
|
|
749
|
+
* @returns {Promise<UserPlatformModel.PlatformSchema>} - Success response
|
|
750
|
+
* @name getPlatformConfig
|
|
751
|
+
* @summary: Get platform configurations
|
|
752
|
+
* @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getPlatformConfig/).
|
|
1416
753
|
*/
|
|
1417
|
-
async
|
|
1418
|
-
{
|
|
754
|
+
async getPlatformConfig(
|
|
755
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
1419
756
|
{ responseHeaders } = { responseHeaders: false }
|
|
1420
757
|
) {
|
|
1421
758
|
const {
|
|
1422
759
|
error,
|
|
1423
|
-
} = UserPlatformApplicationValidator.
|
|
1424
|
-
{
|
|
1425
|
-
userId,
|
|
1426
|
-
|
|
1427
|
-
pageSize,
|
|
1428
|
-
pageNo,
|
|
1429
|
-
},
|
|
760
|
+
} = UserPlatformApplicationValidator.getPlatformConfig().validate(
|
|
761
|
+
{},
|
|
1430
762
|
{ abortEarly: false, allowUnknown: true }
|
|
1431
763
|
);
|
|
1432
764
|
if (error) {
|
|
@@ -1436,30 +768,23 @@ class User {
|
|
|
1436
768
|
// Showing warrnings if extra unknown parameters are found
|
|
1437
769
|
const {
|
|
1438
770
|
error: warrning,
|
|
1439
|
-
} = UserPlatformApplicationValidator.
|
|
1440
|
-
{
|
|
1441
|
-
userId,
|
|
1442
|
-
|
|
1443
|
-
pageSize,
|
|
1444
|
-
pageNo,
|
|
1445
|
-
},
|
|
771
|
+
} = UserPlatformApplicationValidator.getPlatformConfig().validate(
|
|
772
|
+
{},
|
|
1446
773
|
{ abortEarly: false, allowUnknown: false }
|
|
1447
774
|
);
|
|
1448
775
|
if (warrning) {
|
|
1449
776
|
Logger({
|
|
1450
777
|
level: "WARN",
|
|
1451
|
-
message: `Parameter Validation warrnings for platform > User >
|
|
778
|
+
message: `Parameter Validation warrnings for platform > User > getPlatformConfig \n ${warrning}`,
|
|
1452
779
|
});
|
|
1453
780
|
}
|
|
1454
781
|
|
|
1455
782
|
const query_params = {};
|
|
1456
|
-
query_params["page_size"] = pageSize;
|
|
1457
|
-
query_params["page_no"] = pageNo;
|
|
1458
783
|
|
|
1459
784
|
const response = await PlatformAPIClient.execute(
|
|
1460
785
|
this.config,
|
|
1461
786
|
"get",
|
|
1462
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
787
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
|
|
1463
788
|
query_params,
|
|
1464
789
|
undefined,
|
|
1465
790
|
requestHeaders,
|
|
@@ -1471,7 +796,9 @@ class User {
|
|
|
1471
796
|
responseData = response[0];
|
|
1472
797
|
}
|
|
1473
798
|
|
|
1474
|
-
const {
|
|
799
|
+
const {
|
|
800
|
+
error: res_error,
|
|
801
|
+
} = UserPlatformModel.PlatformSchema().validate(responseData, {
|
|
1475
802
|
abortEarly: false,
|
|
1476
803
|
allowUnknown: true,
|
|
1477
804
|
});
|
|
@@ -1482,7 +809,7 @@ class User {
|
|
|
1482
809
|
} else {
|
|
1483
810
|
Logger({
|
|
1484
811
|
level: "WARN",
|
|
1485
|
-
message: `Response Validation Warnings for platform > User >
|
|
812
|
+
message: `Response Validation Warnings for platform > User > getPlatformConfig \n ${res_error}`,
|
|
1486
813
|
});
|
|
1487
814
|
}
|
|
1488
815
|
}
|
|
@@ -1580,7 +907,7 @@ class User {
|
|
|
1580
907
|
* @description: Use this API to get User Groups mathing criteria passed in query - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserGroups/).
|
|
1581
908
|
*/
|
|
1582
909
|
async getUserGroups(
|
|
1583
|
-
{ pageNo, pageSize, name,
|
|
910
|
+
{ pageNo, pageSize, name, status, groupUid, requestHeaders } = {
|
|
1584
911
|
requestHeaders: {},
|
|
1585
912
|
},
|
|
1586
913
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -1590,7 +917,6 @@ class User {
|
|
|
1590
917
|
pageNo,
|
|
1591
918
|
pageSize,
|
|
1592
919
|
name,
|
|
1593
|
-
type,
|
|
1594
920
|
status,
|
|
1595
921
|
groupUid,
|
|
1596
922
|
},
|
|
@@ -1608,7 +934,6 @@ class User {
|
|
|
1608
934
|
pageNo,
|
|
1609
935
|
pageSize,
|
|
1610
936
|
name,
|
|
1611
|
-
type,
|
|
1612
937
|
status,
|
|
1613
938
|
groupUid,
|
|
1614
939
|
},
|
|
@@ -1625,7 +950,6 @@ class User {
|
|
|
1625
950
|
query_params["page_no"] = pageNo;
|
|
1626
951
|
query_params["page_size"] = pageSize;
|
|
1627
952
|
query_params["name"] = name;
|
|
1628
|
-
query_params["type"] = type;
|
|
1629
953
|
query_params["status"] = status;
|
|
1630
954
|
query_params["group_uid"] = groupUid;
|
|
1631
955
|
|
|
@@ -1983,176 +1307,6 @@ class User {
|
|
|
1983
1307
|
return response;
|
|
1984
1308
|
}
|
|
1985
1309
|
|
|
1986
|
-
/**
|
|
1987
|
-
* @param {UserPlatformApplicationValidator.UpdateUserAttributeParam} arg - Arg object
|
|
1988
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1989
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1990
|
-
* @returns {Promise<UserPlatformModel.UserAttributeResponse>} - Success response
|
|
1991
|
-
* @name updateUserAttribute
|
|
1992
|
-
* @summary: Update Or Create User Attribute
|
|
1993
|
-
* @description: Update Or Create User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/updateUserAttribute/).
|
|
1994
|
-
*/
|
|
1995
|
-
async updateUserAttribute(
|
|
1996
|
-
{ attributeDefId, userId, body, requestHeaders } = { requestHeaders: {} },
|
|
1997
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1998
|
-
) {
|
|
1999
|
-
const {
|
|
2000
|
-
error,
|
|
2001
|
-
} = UserPlatformApplicationValidator.updateUserAttribute().validate(
|
|
2002
|
-
{
|
|
2003
|
-
attributeDefId,
|
|
2004
|
-
userId,
|
|
2005
|
-
|
|
2006
|
-
body,
|
|
2007
|
-
},
|
|
2008
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2009
|
-
);
|
|
2010
|
-
if (error) {
|
|
2011
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2015
|
-
const {
|
|
2016
|
-
error: warrning,
|
|
2017
|
-
} = UserPlatformApplicationValidator.updateUserAttribute().validate(
|
|
2018
|
-
{
|
|
2019
|
-
attributeDefId,
|
|
2020
|
-
userId,
|
|
2021
|
-
|
|
2022
|
-
body,
|
|
2023
|
-
},
|
|
2024
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2025
|
-
);
|
|
2026
|
-
if (warrning) {
|
|
2027
|
-
Logger({
|
|
2028
|
-
level: "WARN",
|
|
2029
|
-
message: `Parameter Validation warrnings for platform > User > updateUserAttribute \n ${warrning}`,
|
|
2030
|
-
});
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
const query_params = {};
|
|
2034
|
-
|
|
2035
|
-
const response = await PlatformAPIClient.execute(
|
|
2036
|
-
this.config,
|
|
2037
|
-
"put",
|
|
2038
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
|
|
2039
|
-
query_params,
|
|
2040
|
-
body,
|
|
2041
|
-
requestHeaders,
|
|
2042
|
-
{ responseHeaders }
|
|
2043
|
-
);
|
|
2044
|
-
|
|
2045
|
-
let responseData = response;
|
|
2046
|
-
if (responseHeaders) {
|
|
2047
|
-
responseData = response[0];
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
const {
|
|
2051
|
-
error: res_error,
|
|
2052
|
-
} = UserPlatformModel.UserAttributeResponse().validate(responseData, {
|
|
2053
|
-
abortEarly: false,
|
|
2054
|
-
allowUnknown: true,
|
|
2055
|
-
});
|
|
2056
|
-
|
|
2057
|
-
if (res_error) {
|
|
2058
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2059
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2060
|
-
} else {
|
|
2061
|
-
Logger({
|
|
2062
|
-
level: "WARN",
|
|
2063
|
-
message: `Response Validation Warnings for platform > User > updateUserAttribute \n ${res_error}`,
|
|
2064
|
-
});
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
return response;
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* @param {UserPlatformApplicationValidator.UpdateUserAttributeDefinitionParam} arg
|
|
2073
|
-
* - Arg object
|
|
2074
|
-
*
|
|
2075
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2076
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2077
|
-
* @returns {Promise<UserPlatformModel.UserAttributeDefinition>} - Success response
|
|
2078
|
-
* @name updateUserAttributeDefinition
|
|
2079
|
-
* @summary: Update User Attribute Definition
|
|
2080
|
-
* @description: Update an existing user attribute definition. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/updateUserAttributeDefinition/).
|
|
2081
|
-
*/
|
|
2082
|
-
async updateUserAttributeDefinition(
|
|
2083
|
-
{ attributeDefId, body, requestHeaders } = { requestHeaders: {} },
|
|
2084
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2085
|
-
) {
|
|
2086
|
-
const {
|
|
2087
|
-
error,
|
|
2088
|
-
} = UserPlatformApplicationValidator.updateUserAttributeDefinition().validate(
|
|
2089
|
-
{
|
|
2090
|
-
attributeDefId,
|
|
2091
|
-
|
|
2092
|
-
body,
|
|
2093
|
-
},
|
|
2094
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2095
|
-
);
|
|
2096
|
-
if (error) {
|
|
2097
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2101
|
-
const {
|
|
2102
|
-
error: warrning,
|
|
2103
|
-
} = UserPlatformApplicationValidator.updateUserAttributeDefinition().validate(
|
|
2104
|
-
{
|
|
2105
|
-
attributeDefId,
|
|
2106
|
-
|
|
2107
|
-
body,
|
|
2108
|
-
},
|
|
2109
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2110
|
-
);
|
|
2111
|
-
if (warrning) {
|
|
2112
|
-
Logger({
|
|
2113
|
-
level: "WARN",
|
|
2114
|
-
message: `Parameter Validation warrnings for platform > User > updateUserAttributeDefinition \n ${warrning}`,
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
const query_params = {};
|
|
2119
|
-
|
|
2120
|
-
const response = await PlatformAPIClient.execute(
|
|
2121
|
-
this.config,
|
|
2122
|
-
"put",
|
|
2123
|
-
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}`,
|
|
2124
|
-
query_params,
|
|
2125
|
-
body,
|
|
2126
|
-
requestHeaders,
|
|
2127
|
-
{ responseHeaders }
|
|
2128
|
-
);
|
|
2129
|
-
|
|
2130
|
-
let responseData = response;
|
|
2131
|
-
if (responseHeaders) {
|
|
2132
|
-
responseData = response[0];
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
const {
|
|
2136
|
-
error: res_error,
|
|
2137
|
-
} = UserPlatformModel.UserAttributeDefinition().validate(responseData, {
|
|
2138
|
-
abortEarly: false,
|
|
2139
|
-
allowUnknown: true,
|
|
2140
|
-
});
|
|
2141
|
-
|
|
2142
|
-
if (res_error) {
|
|
2143
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2144
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2145
|
-
} else {
|
|
2146
|
-
Logger({
|
|
2147
|
-
level: "WARN",
|
|
2148
|
-
message: `Response Validation Warnings for platform > User > updateUserAttributeDefinition \n ${res_error}`,
|
|
2149
|
-
});
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
return response;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
1310
|
/**
|
|
2157
1311
|
* @param {UserPlatformApplicationValidator.UpdateUserGroupParam} arg - Arg object
|
|
2158
1312
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|