@gofynd/fdk-client-javascript 3.3.6 → 3.4.0
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 +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
- package/sdk/application/Catalog/CatalogApplicationClient.js +24 -5
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +44 -0
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +4 -4
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +2 -2
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +5 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
- package/sdk/platform/Cart/CartPlatformModel.js +123 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +4 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +16 -3
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +33 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.js +17 -2
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +5 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +17 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +15 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +20 -1
- package/sdk/platform/Order/OrderPlatformModel.js +22 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +124 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +800 -33
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +139 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +125 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +2 -2
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +8 -2
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +936 -62
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +591 -33
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +12 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +5 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +36 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +251 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +38 -1
- package/sdk/platform/User/UserPlatformApplicationValidator.js +42 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +430 -10
- package/sdk/platform/User/UserPlatformModel.js +276 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +10 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +4 -0
|
@@ -104,6 +104,8 @@ export = ServiceabilityPlatformValidator;
|
|
|
104
104
|
* certain capabilities.
|
|
105
105
|
* @property {string[]} [schemeIds] - List of scheme ids which need to be
|
|
106
106
|
* returned in the response.
|
|
107
|
+
* @property {string} [q] - The search string to search in the list of courier
|
|
108
|
+
* partners schemes by name.
|
|
107
109
|
*/
|
|
108
110
|
/**
|
|
109
111
|
* @typedef GetInstalledCourierPartnerExtensionsParam
|
|
@@ -147,6 +149,7 @@ export = ServiceabilityPlatformValidator;
|
|
|
147
149
|
*/
|
|
148
150
|
/**
|
|
149
151
|
* @typedef UpdateCompanyConfigurationParam
|
|
152
|
+
* @property {string} fulfillmentOptionSlug - Slug representing the fulfillment option.
|
|
150
153
|
* @property {ServiceabilityPlatformModel.CompanyConfigurationSchema} body
|
|
151
154
|
*/
|
|
152
155
|
/**
|
|
@@ -469,6 +472,11 @@ type GetCourierPartnerSchemesParam = {
|
|
|
469
472
|
* returned in the response.
|
|
470
473
|
*/
|
|
471
474
|
schemeIds?: string[];
|
|
475
|
+
/**
|
|
476
|
+
* - The search string to search in the list of courier
|
|
477
|
+
* partners schemes by name.
|
|
478
|
+
*/
|
|
479
|
+
q?: string;
|
|
472
480
|
};
|
|
473
481
|
type GetInstalledCourierPartnerExtensionsParam = {
|
|
474
482
|
/**
|
|
@@ -542,6 +550,10 @@ type SampleFileServiceabilityParam = {
|
|
|
542
550
|
body: ServiceabilityPlatformModel.BulkRegionServiceabilityTatDetails;
|
|
543
551
|
};
|
|
544
552
|
type UpdateCompanyConfigurationParam = {
|
|
553
|
+
/**
|
|
554
|
+
* - Slug representing the fulfillment option.
|
|
555
|
+
*/
|
|
556
|
+
fulfillmentOptionSlug: string;
|
|
545
557
|
body: ServiceabilityPlatformModel.CompanyConfigurationSchema;
|
|
546
558
|
};
|
|
547
559
|
type UpdateCourierPartnerAccountParam = {
|
|
@@ -120,6 +120,8 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
120
120
|
* certain capabilities.
|
|
121
121
|
* @property {string[]} [schemeIds] - List of scheme ids which need to be
|
|
122
122
|
* returned in the response.
|
|
123
|
+
* @property {string} [q] - The search string to search in the list of courier
|
|
124
|
+
* partners schemes by name.
|
|
123
125
|
*/
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -172,6 +174,7 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
172
174
|
|
|
173
175
|
/**
|
|
174
176
|
* @typedef UpdateCompanyConfigurationParam
|
|
177
|
+
* @property {string} fulfillmentOptionSlug - Slug representing the fulfillment option.
|
|
175
178
|
* @property {ServiceabilityPlatformModel.CompanyConfigurationSchema} body
|
|
176
179
|
*/
|
|
177
180
|
|
|
@@ -341,6 +344,7 @@ class ServiceabilityPlatformValidator {
|
|
|
341
344
|
paymentMode: Joi.string().allow(""),
|
|
342
345
|
capabilities: Joi.array().items(Joi.string().allow("")),
|
|
343
346
|
schemeIds: Joi.array().items(Joi.string().allow("")),
|
|
347
|
+
q: Joi.string().allow(""),
|
|
344
348
|
}).required();
|
|
345
349
|
}
|
|
346
350
|
|
|
@@ -409,6 +413,7 @@ class ServiceabilityPlatformValidator {
|
|
|
409
413
|
/** @returns {UpdateCompanyConfigurationParam} */
|
|
410
414
|
static updateCompanyConfiguration() {
|
|
411
415
|
return Joi.object({
|
|
416
|
+
fulfillmentOptionSlug: Joi.string().allow("").required(),
|
|
412
417
|
body: ServiceabilityPlatformModel.CompanyConfigurationSchema().required(),
|
|
413
418
|
}).required();
|
|
414
419
|
}
|
|
@@ -137,6 +137,30 @@ declare class User {
|
|
|
137
137
|
* @description: Delete a user attribute definition by its unique identifier. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/deleteUserAttributeDefinitionById/).
|
|
138
138
|
*/
|
|
139
139
|
deleteUserAttributeDefinitionById({ attributeDefId, requestHeaders }?: UserPlatformApplicationValidator.DeleteUserAttributeDefinitionByIdParam, { responseHeaders }?: object): Promise<UserPlatformModel.SuccessMessage>;
|
|
140
|
+
/**
|
|
141
|
+
* @param {UserPlatformApplicationValidator.DeleteUserAttributesInBulkParam} arg
|
|
142
|
+
* - Arg object
|
|
143
|
+
*
|
|
144
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
145
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
146
|
+
* @returns {Promise<UserPlatformModel.SuccessMessage>} - Success response
|
|
147
|
+
* @name deleteUserAttributesInBulk
|
|
148
|
+
* @summary: Delete User Attribute Values in Bulk
|
|
149
|
+
* @description: This request deletes attribute values for a single user based on the provided user attribute definition. Each user attribute definition represents a distinct attribute, and for each definition, a user can have one corresponding value. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/deleteUserAttributesInBulk/).
|
|
150
|
+
*/
|
|
151
|
+
deleteUserAttributesInBulk({ userId, body, requestHeaders }?: UserPlatformApplicationValidator.DeleteUserAttributesInBulkParam, { responseHeaders }?: object): Promise<UserPlatformModel.SuccessMessage>;
|
|
152
|
+
/**
|
|
153
|
+
* @param {UserPlatformApplicationValidator.FilterUsersByAttributesParam} arg
|
|
154
|
+
* - Arg object
|
|
155
|
+
*
|
|
156
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
157
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
158
|
+
* @returns {Promise<UserPlatformModel.UserAttributeFiltered>} - Success response
|
|
159
|
+
* @name filterUsersByAttributes
|
|
160
|
+
* @summary: Filter Users by Attribute Conditions
|
|
161
|
+
* @description: Returns a filtered list of users based on user attribute conditions and along with details of definition Ids. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/filterUsersByAttributes/).
|
|
162
|
+
*/
|
|
163
|
+
filterUsersByAttributes({ body, requestHeaders }?: UserPlatformApplicationValidator.FilterUsersByAttributesParam, { responseHeaders }?: object): Promise<UserPlatformModel.UserAttributeFiltered>;
|
|
140
164
|
/**
|
|
141
165
|
* @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
|
|
142
166
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -359,6 +383,18 @@ declare class User {
|
|
|
359
383
|
* @description: Update an existing user attribute definition. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/updateUserAttributeDefinition/).
|
|
360
384
|
*/
|
|
361
385
|
updateUserAttributeDefinition({ attributeDefId, body, requestHeaders }?: UserPlatformApplicationValidator.UpdateUserAttributeDefinitionParam, { responseHeaders }?: object): Promise<UserPlatformModel.UserAttributeDefinition>;
|
|
386
|
+
/**
|
|
387
|
+
* @param {UserPlatformApplicationValidator.UpdateUserAttributesParam} arg
|
|
388
|
+
* - Arg object
|
|
389
|
+
*
|
|
390
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
391
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
392
|
+
* @returns {Promise<UserPlatformModel.BulkUserAttribute>} - Success response
|
|
393
|
+
* @name updateUserAttributes
|
|
394
|
+
* @summary: Create Or Update User Attribute
|
|
395
|
+
* @description: This API is used to create or update multiple user attribute values for the specified user ID. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/updateUserAttributes/).
|
|
396
|
+
*/
|
|
397
|
+
updateUserAttributes({ userId, body, requestHeaders }?: UserPlatformApplicationValidator.UpdateUserAttributesParam, { responseHeaders }?: object): Promise<UserPlatformModel.BulkUserAttribute>;
|
|
362
398
|
/**
|
|
363
399
|
* @param {UserPlatformApplicationValidator.UpdateUserGroupParam} arg - Arg object
|
|
364
400
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -974,6 +974,172 @@ class User {
|
|
|
974
974
|
return response;
|
|
975
975
|
}
|
|
976
976
|
|
|
977
|
+
/**
|
|
978
|
+
* @param {UserPlatformApplicationValidator.DeleteUserAttributesInBulkParam} arg
|
|
979
|
+
* - Arg object
|
|
980
|
+
*
|
|
981
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
982
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
983
|
+
* @returns {Promise<UserPlatformModel.SuccessMessage>} - Success response
|
|
984
|
+
* @name deleteUserAttributesInBulk
|
|
985
|
+
* @summary: Delete User Attribute Values in Bulk
|
|
986
|
+
* @description: This request deletes attribute values for a single user based on the provided user attribute definition. Each user attribute definition represents a distinct attribute, and for each definition, a user can have one corresponding value. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/deleteUserAttributesInBulk/).
|
|
987
|
+
*/
|
|
988
|
+
async deleteUserAttributesInBulk(
|
|
989
|
+
{ userId, body, requestHeaders } = { requestHeaders: {} },
|
|
990
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
991
|
+
) {
|
|
992
|
+
const {
|
|
993
|
+
error,
|
|
994
|
+
} = UserPlatformApplicationValidator.deleteUserAttributesInBulk().validate(
|
|
995
|
+
{
|
|
996
|
+
userId,
|
|
997
|
+
|
|
998
|
+
body,
|
|
999
|
+
},
|
|
1000
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1001
|
+
);
|
|
1002
|
+
if (error) {
|
|
1003
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1007
|
+
const {
|
|
1008
|
+
error: warrning,
|
|
1009
|
+
} = UserPlatformApplicationValidator.deleteUserAttributesInBulk().validate(
|
|
1010
|
+
{
|
|
1011
|
+
userId,
|
|
1012
|
+
|
|
1013
|
+
body,
|
|
1014
|
+
},
|
|
1015
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1016
|
+
);
|
|
1017
|
+
if (warrning) {
|
|
1018
|
+
Logger({
|
|
1019
|
+
level: "WARN",
|
|
1020
|
+
message: `Parameter Validation warrnings for platform > User > deleteUserAttributesInBulk \n ${warrning}`,
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
const query_params = {};
|
|
1025
|
+
|
|
1026
|
+
const response = await PlatformAPIClient.execute(
|
|
1027
|
+
this.config,
|
|
1028
|
+
"delete",
|
|
1029
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/user/${userId}`,
|
|
1030
|
+
query_params,
|
|
1031
|
+
body,
|
|
1032
|
+
requestHeaders,
|
|
1033
|
+
{ responseHeaders }
|
|
1034
|
+
);
|
|
1035
|
+
|
|
1036
|
+
let responseData = response;
|
|
1037
|
+
if (responseHeaders) {
|
|
1038
|
+
responseData = response[0];
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
const {
|
|
1042
|
+
error: res_error,
|
|
1043
|
+
} = UserPlatformModel.SuccessMessage().validate(responseData, {
|
|
1044
|
+
abortEarly: false,
|
|
1045
|
+
allowUnknown: true,
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
if (res_error) {
|
|
1049
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1050
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1051
|
+
} else {
|
|
1052
|
+
Logger({
|
|
1053
|
+
level: "WARN",
|
|
1054
|
+
message: `Response Validation Warnings for platform > User > deleteUserAttributesInBulk \n ${res_error}`,
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
return response;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* @param {UserPlatformApplicationValidator.FilterUsersByAttributesParam} arg
|
|
1064
|
+
* - Arg object
|
|
1065
|
+
*
|
|
1066
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1067
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1068
|
+
* @returns {Promise<UserPlatformModel.UserAttributeFiltered>} - Success response
|
|
1069
|
+
* @name filterUsersByAttributes
|
|
1070
|
+
* @summary: Filter Users by Attribute Conditions
|
|
1071
|
+
* @description: Returns a filtered list of users based on user attribute conditions and along with details of definition Ids. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/filterUsersByAttributes/).
|
|
1072
|
+
*/
|
|
1073
|
+
async filterUsersByAttributes(
|
|
1074
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1075
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1076
|
+
) {
|
|
1077
|
+
const {
|
|
1078
|
+
error,
|
|
1079
|
+
} = UserPlatformApplicationValidator.filterUsersByAttributes().validate(
|
|
1080
|
+
{
|
|
1081
|
+
body,
|
|
1082
|
+
},
|
|
1083
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1084
|
+
);
|
|
1085
|
+
if (error) {
|
|
1086
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1090
|
+
const {
|
|
1091
|
+
error: warrning,
|
|
1092
|
+
} = UserPlatformApplicationValidator.filterUsersByAttributes().validate(
|
|
1093
|
+
{
|
|
1094
|
+
body,
|
|
1095
|
+
},
|
|
1096
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1097
|
+
);
|
|
1098
|
+
if (warrning) {
|
|
1099
|
+
Logger({
|
|
1100
|
+
level: "WARN",
|
|
1101
|
+
message: `Parameter Validation warrnings for platform > User > filterUsersByAttributes \n ${warrning}`,
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
const query_params = {};
|
|
1106
|
+
|
|
1107
|
+
const response = await PlatformAPIClient.execute(
|
|
1108
|
+
this.config,
|
|
1109
|
+
"post",
|
|
1110
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/users`,
|
|
1111
|
+
query_params,
|
|
1112
|
+
body,
|
|
1113
|
+
requestHeaders,
|
|
1114
|
+
{ responseHeaders }
|
|
1115
|
+
);
|
|
1116
|
+
|
|
1117
|
+
let responseData = response;
|
|
1118
|
+
if (responseHeaders) {
|
|
1119
|
+
responseData = response[0];
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const {
|
|
1123
|
+
error: res_error,
|
|
1124
|
+
} = UserPlatformModel.UserAttributeFiltered().validate(responseData, {
|
|
1125
|
+
abortEarly: false,
|
|
1126
|
+
allowUnknown: true,
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
if (res_error) {
|
|
1130
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1131
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1132
|
+
} else {
|
|
1133
|
+
Logger({
|
|
1134
|
+
level: "WARN",
|
|
1135
|
+
message: `Response Validation Warnings for platform > User > filterUsersByAttributes \n ${res_error}`,
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
return response;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
977
1143
|
/**
|
|
978
1144
|
* @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
|
|
979
1145
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2696,6 +2862,91 @@ class User {
|
|
|
2696
2862
|
return response;
|
|
2697
2863
|
}
|
|
2698
2864
|
|
|
2865
|
+
/**
|
|
2866
|
+
* @param {UserPlatformApplicationValidator.UpdateUserAttributesParam} arg
|
|
2867
|
+
* - Arg object
|
|
2868
|
+
*
|
|
2869
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2870
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2871
|
+
* @returns {Promise<UserPlatformModel.BulkUserAttribute>} - Success response
|
|
2872
|
+
* @name updateUserAttributes
|
|
2873
|
+
* @summary: Create Or Update User Attribute
|
|
2874
|
+
* @description: This API is used to create or update multiple user attribute values for the specified user ID. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/updateUserAttributes/).
|
|
2875
|
+
*/
|
|
2876
|
+
async updateUserAttributes(
|
|
2877
|
+
{ userId, body, requestHeaders } = { requestHeaders: {} },
|
|
2878
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2879
|
+
) {
|
|
2880
|
+
const {
|
|
2881
|
+
error,
|
|
2882
|
+
} = UserPlatformApplicationValidator.updateUserAttributes().validate(
|
|
2883
|
+
{
|
|
2884
|
+
userId,
|
|
2885
|
+
|
|
2886
|
+
body,
|
|
2887
|
+
},
|
|
2888
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2889
|
+
);
|
|
2890
|
+
if (error) {
|
|
2891
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2895
|
+
const {
|
|
2896
|
+
error: warrning,
|
|
2897
|
+
} = UserPlatformApplicationValidator.updateUserAttributes().validate(
|
|
2898
|
+
{
|
|
2899
|
+
userId,
|
|
2900
|
+
|
|
2901
|
+
body,
|
|
2902
|
+
},
|
|
2903
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2904
|
+
);
|
|
2905
|
+
if (warrning) {
|
|
2906
|
+
Logger({
|
|
2907
|
+
level: "WARN",
|
|
2908
|
+
message: `Parameter Validation warrnings for platform > User > updateUserAttributes \n ${warrning}`,
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
const query_params = {};
|
|
2913
|
+
|
|
2914
|
+
const response = await PlatformAPIClient.execute(
|
|
2915
|
+
this.config,
|
|
2916
|
+
"post",
|
|
2917
|
+
`/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/user/${userId}`,
|
|
2918
|
+
query_params,
|
|
2919
|
+
body,
|
|
2920
|
+
requestHeaders,
|
|
2921
|
+
{ responseHeaders }
|
|
2922
|
+
);
|
|
2923
|
+
|
|
2924
|
+
let responseData = response;
|
|
2925
|
+
if (responseHeaders) {
|
|
2926
|
+
responseData = response[0];
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2929
|
+
const {
|
|
2930
|
+
error: res_error,
|
|
2931
|
+
} = UserPlatformModel.BulkUserAttribute().validate(responseData, {
|
|
2932
|
+
abortEarly: false,
|
|
2933
|
+
allowUnknown: true,
|
|
2934
|
+
});
|
|
2935
|
+
|
|
2936
|
+
if (res_error) {
|
|
2937
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2938
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2939
|
+
} else {
|
|
2940
|
+
Logger({
|
|
2941
|
+
level: "WARN",
|
|
2942
|
+
message: `Response Validation Warnings for platform > User > updateUserAttributes \n ${res_error}`,
|
|
2943
|
+
});
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
return response;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2699
2950
|
/**
|
|
2700
2951
|
* @param {UserPlatformApplicationValidator.UpdateUserGroupParam} arg - Arg object
|
|
2701
2952
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -52,6 +52,15 @@ export = UserPlatformApplicationValidator;
|
|
|
52
52
|
* @property {string} attributeDefId - The unique identifier of the attribute
|
|
53
53
|
* definition to delete.
|
|
54
54
|
*/
|
|
55
|
+
/**
|
|
56
|
+
* @typedef DeleteUserAttributesInBulkParam
|
|
57
|
+
* @property {string} userId - The unique identifier of the user to update.
|
|
58
|
+
* @property {UserPlatformModel.DeleteBulkUserAttribute} body
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* @typedef FilterUsersByAttributesParam
|
|
62
|
+
* @property {UserPlatformModel.UserAttributeFilter} body
|
|
63
|
+
*/
|
|
55
64
|
/**
|
|
56
65
|
* @typedef GetActiveSessionsParam
|
|
57
66
|
* @property {string} id - ID of a customer.
|
|
@@ -178,6 +187,11 @@ export = UserPlatformApplicationValidator;
|
|
|
178
187
|
* definition to update.
|
|
179
188
|
* @property {UserPlatformModel.CreateUserAttributeDefinition} body
|
|
180
189
|
*/
|
|
190
|
+
/**
|
|
191
|
+
* @typedef UpdateUserAttributesParam
|
|
192
|
+
* @property {string} userId - The unique identifier of the user.
|
|
193
|
+
* @property {UserPlatformModel.CreateBulkUserAttribute} body
|
|
194
|
+
*/
|
|
181
195
|
/**
|
|
182
196
|
* @typedef UpdateUserGroupParam
|
|
183
197
|
* @property {string} groupId - Numeric ID allotted to a User Group
|
|
@@ -213,6 +227,10 @@ declare class UserPlatformApplicationValidator {
|
|
|
213
227
|
static deleteUserAttribute(): DeleteUserAttributeParam;
|
|
214
228
|
/** @returns {DeleteUserAttributeDefinitionByIdParam} */
|
|
215
229
|
static deleteUserAttributeDefinitionById(): DeleteUserAttributeDefinitionByIdParam;
|
|
230
|
+
/** @returns {DeleteUserAttributesInBulkParam} */
|
|
231
|
+
static deleteUserAttributesInBulk(): DeleteUserAttributesInBulkParam;
|
|
232
|
+
/** @returns {FilterUsersByAttributesParam} */
|
|
233
|
+
static filterUsersByAttributes(): FilterUsersByAttributesParam;
|
|
216
234
|
/** @returns {GetActiveSessionsParam} */
|
|
217
235
|
static getActiveSessions(): GetActiveSessionsParam;
|
|
218
236
|
/** @returns {GetBulkExportUsersListParam} */
|
|
@@ -253,13 +271,15 @@ declare class UserPlatformApplicationValidator {
|
|
|
253
271
|
static updateUserAttribute(): UpdateUserAttributeParam;
|
|
254
272
|
/** @returns {UpdateUserAttributeDefinitionParam} */
|
|
255
273
|
static updateUserAttributeDefinition(): UpdateUserAttributeDefinitionParam;
|
|
274
|
+
/** @returns {UpdateUserAttributesParam} */
|
|
275
|
+
static updateUserAttributes(): UpdateUserAttributesParam;
|
|
256
276
|
/** @returns {UpdateUserGroupParam} */
|
|
257
277
|
static updateUserGroup(): UpdateUserGroupParam;
|
|
258
278
|
/** @returns {UpdateUserGroupPartiallyParam} */
|
|
259
279
|
static updateUserGroupPartially(): UpdateUserGroupPartiallyParam;
|
|
260
280
|
}
|
|
261
281
|
declare namespace UserPlatformApplicationValidator {
|
|
262
|
-
export { ArchiveUserParam, BlockOrUnblockUsersParam, BulkImportStoreFrontUsersParam, CreateBulkExportUsersParam, CreateUserParam, CreateUserAttributeDefinitionParam, CreateUserGroupParam, CreateUserSessionParam, DeleteActiveSessionsParam, DeleteSessionParam, DeleteUserAttributeParam, DeleteUserAttributeDefinitionByIdParam, GetActiveSessionsParam, GetBulkExportUsersListParam, GetBulkImportUsersListParam, GetCustomersParam, GetPlatformConfigParam, GetUserAttributeParam, GetUserAttributeByIdParam, GetUserAttributeDefinitionByIdParam, GetUserAttributeDefinitionsParam, GetUserAttributesForUserParam, GetUserGroupByIdParam, GetUserGroupsParam, GetUserTimelineParam, GetUsersJobByJobIdParam, SearchUsersParam, UnDeleteUserParam, UpdatePlatformConfigParam, UpdateUserParam, UpdateUserAttributeParam, UpdateUserAttributeDefinitionParam, UpdateUserGroupParam, UpdateUserGroupPartiallyParam };
|
|
282
|
+
export { ArchiveUserParam, BlockOrUnblockUsersParam, BulkImportStoreFrontUsersParam, CreateBulkExportUsersParam, CreateUserParam, CreateUserAttributeDefinitionParam, CreateUserGroupParam, CreateUserSessionParam, DeleteActiveSessionsParam, DeleteSessionParam, DeleteUserAttributeParam, DeleteUserAttributeDefinitionByIdParam, DeleteUserAttributesInBulkParam, FilterUsersByAttributesParam, GetActiveSessionsParam, GetBulkExportUsersListParam, GetBulkImportUsersListParam, GetCustomersParam, GetPlatformConfigParam, GetUserAttributeParam, GetUserAttributeByIdParam, GetUserAttributeDefinitionByIdParam, GetUserAttributeDefinitionsParam, GetUserAttributesForUserParam, GetUserGroupByIdParam, GetUserGroupsParam, GetUserTimelineParam, GetUsersJobByJobIdParam, SearchUsersParam, UnDeleteUserParam, UpdatePlatformConfigParam, UpdateUserParam, UpdateUserAttributeParam, UpdateUserAttributeDefinitionParam, UpdateUserAttributesParam, UpdateUserGroupParam, UpdateUserGroupPartiallyParam };
|
|
263
283
|
}
|
|
264
284
|
type ArchiveUserParam = {
|
|
265
285
|
body: UserPlatformModel.ArchiveUserRequestSchema;
|
|
@@ -326,6 +346,16 @@ type DeleteUserAttributeDefinitionByIdParam = {
|
|
|
326
346
|
*/
|
|
327
347
|
attributeDefId: string;
|
|
328
348
|
};
|
|
349
|
+
type DeleteUserAttributesInBulkParam = {
|
|
350
|
+
/**
|
|
351
|
+
* - The unique identifier of the user to update.
|
|
352
|
+
*/
|
|
353
|
+
userId: string;
|
|
354
|
+
body: UserPlatformModel.DeleteBulkUserAttribute;
|
|
355
|
+
};
|
|
356
|
+
type FilterUsersByAttributesParam = {
|
|
357
|
+
body: UserPlatformModel.UserAttributeFilter;
|
|
358
|
+
};
|
|
329
359
|
type GetActiveSessionsParam = {
|
|
330
360
|
/**
|
|
331
361
|
* - ID of a customer.
|
|
@@ -585,6 +615,13 @@ type UpdateUserAttributeDefinitionParam = {
|
|
|
585
615
|
attributeDefId: string;
|
|
586
616
|
body: UserPlatformModel.CreateUserAttributeDefinition;
|
|
587
617
|
};
|
|
618
|
+
type UpdateUserAttributesParam = {
|
|
619
|
+
/**
|
|
620
|
+
* - The unique identifier of the user.
|
|
621
|
+
*/
|
|
622
|
+
userId: string;
|
|
623
|
+
body: UserPlatformModel.CreateBulkUserAttribute;
|
|
624
|
+
};
|
|
588
625
|
type UpdateUserGroupParam = {
|
|
589
626
|
/**
|
|
590
627
|
* - Numeric ID allotted to a User Group
|
|
@@ -67,6 +67,17 @@ const UserPlatformModel = require("./UserPlatformModel");
|
|
|
67
67
|
* definition to delete.
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* @typedef DeleteUserAttributesInBulkParam
|
|
72
|
+
* @property {string} userId - The unique identifier of the user to update.
|
|
73
|
+
* @property {UserPlatformModel.DeleteBulkUserAttribute} body
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef FilterUsersByAttributesParam
|
|
78
|
+
* @property {UserPlatformModel.UserAttributeFilter} body
|
|
79
|
+
*/
|
|
80
|
+
|
|
70
81
|
/**
|
|
71
82
|
* @typedef GetActiveSessionsParam
|
|
72
83
|
* @property {string} id - ID of a customer.
|
|
@@ -213,6 +224,12 @@ const UserPlatformModel = require("./UserPlatformModel");
|
|
|
213
224
|
* @property {UserPlatformModel.CreateUserAttributeDefinition} body
|
|
214
225
|
*/
|
|
215
226
|
|
|
227
|
+
/**
|
|
228
|
+
* @typedef UpdateUserAttributesParam
|
|
229
|
+
* @property {string} userId - The unique identifier of the user.
|
|
230
|
+
* @property {UserPlatformModel.CreateBulkUserAttribute} body
|
|
231
|
+
*/
|
|
232
|
+
|
|
216
233
|
/**
|
|
217
234
|
* @typedef UpdateUserGroupParam
|
|
218
235
|
* @property {string} groupId - Numeric ID allotted to a User Group
|
|
@@ -314,6 +331,22 @@ class UserPlatformApplicationValidator {
|
|
|
314
331
|
}).required();
|
|
315
332
|
}
|
|
316
333
|
|
|
334
|
+
/** @returns {DeleteUserAttributesInBulkParam} */
|
|
335
|
+
static deleteUserAttributesInBulk() {
|
|
336
|
+
return Joi.object({
|
|
337
|
+
userId: Joi.string().allow("").required(),
|
|
338
|
+
|
|
339
|
+
body: UserPlatformModel.DeleteBulkUserAttribute().required(),
|
|
340
|
+
}).required();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** @returns {FilterUsersByAttributesParam} */
|
|
344
|
+
static filterUsersByAttributes() {
|
|
345
|
+
return Joi.object({
|
|
346
|
+
body: UserPlatformModel.UserAttributeFilter().required(),
|
|
347
|
+
}).required();
|
|
348
|
+
}
|
|
349
|
+
|
|
317
350
|
/** @returns {GetActiveSessionsParam} */
|
|
318
351
|
static getActiveSessions() {
|
|
319
352
|
return Joi.object({
|
|
@@ -493,6 +526,15 @@ class UserPlatformApplicationValidator {
|
|
|
493
526
|
}).required();
|
|
494
527
|
}
|
|
495
528
|
|
|
529
|
+
/** @returns {UpdateUserAttributesParam} */
|
|
530
|
+
static updateUserAttributes() {
|
|
531
|
+
return Joi.object({
|
|
532
|
+
userId: Joi.string().allow("").required(),
|
|
533
|
+
|
|
534
|
+
body: UserPlatformModel.CreateBulkUserAttribute().required(),
|
|
535
|
+
}).required();
|
|
536
|
+
}
|
|
537
|
+
|
|
496
538
|
/** @returns {UpdateUserGroupParam} */
|
|
497
539
|
static updateUserGroup() {
|
|
498
540
|
return Joi.object({
|