@gofynd/fdk-client-javascript 1.4.15-beta.3 → 1.5.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/Cart/CartApplicationClient.d.ts +11 -11
- package/sdk/application/Cart/CartApplicationClient.js +48 -50
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -20
- package/sdk/application/Content/ContentApplicationClient.js +0 -78
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.js +2 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +10 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +39 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +33 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +209 -38
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +399 -19
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +212 -11
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +3 -1
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +22 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +3 -12
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +0 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +0 -3
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -14
- package/sdk/platform/Cart/CartPlatformModel.js +12 -6
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +24 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.js +176 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +80 -29
- package/sdk/platform/Catalog/CatalogPlatformModel.js +72 -32
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +45 -1
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +35 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -52
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -411
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -85
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -73
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1 -90
- package/sdk/platform/Content/ContentPlatformModel.js +0 -104
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +8 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +73 -1
- package/sdk/platform/Order/OrderPlatformModel.js +39 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +22 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +94 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +699 -76
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +598 -23
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +382 -20
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +134 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +108 -0
|
@@ -270,6 +270,91 @@ class Serviceability {
|
|
|
270
270
|
return response;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* @param {ServiceabilityPlatformValidator.CreateCourierPartnerSchemeParam} arg
|
|
275
|
+
* - Arg object
|
|
276
|
+
*
|
|
277
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
278
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
279
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerV2SchemeModel>}
|
|
280
|
+
* - Success response
|
|
281
|
+
*
|
|
282
|
+
* @name createCourierPartnerScheme
|
|
283
|
+
* @summary: Create Scheme for courier partner extension
|
|
284
|
+
* @description: Create Scheme for courier partner extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createCourierPartnerScheme/).
|
|
285
|
+
*/
|
|
286
|
+
async createCourierPartnerScheme(
|
|
287
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
288
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
289
|
+
) {
|
|
290
|
+
const {
|
|
291
|
+
error,
|
|
292
|
+
} = ServiceabilityPlatformValidator.createCourierPartnerScheme().validate(
|
|
293
|
+
{
|
|
294
|
+
body,
|
|
295
|
+
},
|
|
296
|
+
{ abortEarly: false, allowUnknown: true }
|
|
297
|
+
);
|
|
298
|
+
if (error) {
|
|
299
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Showing warrnings if extra unknown parameters are found
|
|
303
|
+
const {
|
|
304
|
+
error: warrning,
|
|
305
|
+
} = ServiceabilityPlatformValidator.createCourierPartnerScheme().validate(
|
|
306
|
+
{
|
|
307
|
+
body,
|
|
308
|
+
},
|
|
309
|
+
{ abortEarly: false, allowUnknown: false }
|
|
310
|
+
);
|
|
311
|
+
if (warrning) {
|
|
312
|
+
Logger({
|
|
313
|
+
level: "WARN",
|
|
314
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createCourierPartnerScheme \n ${warrning}`,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const query_params = {};
|
|
319
|
+
|
|
320
|
+
const xHeaders = {};
|
|
321
|
+
|
|
322
|
+
const response = await PlatformAPIClient.execute(
|
|
323
|
+
this.config,
|
|
324
|
+
"post",
|
|
325
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/scheme`,
|
|
326
|
+
query_params,
|
|
327
|
+
body,
|
|
328
|
+
{ ...xHeaders, ...requestHeaders },
|
|
329
|
+
{ responseHeaders }
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
let responseData = response;
|
|
333
|
+
if (responseHeaders) {
|
|
334
|
+
responseData = response[0];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const {
|
|
338
|
+
error: res_error,
|
|
339
|
+
} = ServiceabilityPlatformModel.CourierPartnerV2SchemeModel().validate(
|
|
340
|
+
responseData,
|
|
341
|
+
{ abortEarly: false, allowUnknown: true }
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
if (res_error) {
|
|
345
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
346
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
347
|
+
} else {
|
|
348
|
+
Logger({
|
|
349
|
+
level: "WARN",
|
|
350
|
+
message: `Response Validation Warnings for platform > Serviceability > createCourierPartnerScheme \n ${res_error}`,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return response;
|
|
356
|
+
}
|
|
357
|
+
|
|
273
358
|
/**
|
|
274
359
|
* @param {ServiceabilityPlatformValidator.CreatePackageMaterialParam} arg
|
|
275
360
|
* - Arg object
|
|
@@ -918,6 +1003,100 @@ class Serviceability {
|
|
|
918
1003
|
return response;
|
|
919
1004
|
}
|
|
920
1005
|
|
|
1006
|
+
/**
|
|
1007
|
+
* @param {ServiceabilityPlatformValidator.GetCountriesParam} arg - Arg object
|
|
1008
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1009
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1010
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetCountries>} - Success response
|
|
1011
|
+
* @name getCountries
|
|
1012
|
+
* @summary: Get countries
|
|
1013
|
+
* @description: Retrieve a list of countries for logistical purposes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCountries/).
|
|
1014
|
+
*/
|
|
1015
|
+
async getCountries(
|
|
1016
|
+
{ onboarding, pageNo, pageSize, q, hierarchy, requestHeaders } = {
|
|
1017
|
+
requestHeaders: {},
|
|
1018
|
+
},
|
|
1019
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1020
|
+
) {
|
|
1021
|
+
const { error } = ServiceabilityPlatformValidator.getCountries().validate(
|
|
1022
|
+
{
|
|
1023
|
+
onboarding,
|
|
1024
|
+
pageNo,
|
|
1025
|
+
pageSize,
|
|
1026
|
+
q,
|
|
1027
|
+
hierarchy,
|
|
1028
|
+
},
|
|
1029
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1030
|
+
);
|
|
1031
|
+
if (error) {
|
|
1032
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1036
|
+
const {
|
|
1037
|
+
error: warrning,
|
|
1038
|
+
} = ServiceabilityPlatformValidator.getCountries().validate(
|
|
1039
|
+
{
|
|
1040
|
+
onboarding,
|
|
1041
|
+
pageNo,
|
|
1042
|
+
pageSize,
|
|
1043
|
+
q,
|
|
1044
|
+
hierarchy,
|
|
1045
|
+
},
|
|
1046
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1047
|
+
);
|
|
1048
|
+
if (warrning) {
|
|
1049
|
+
Logger({
|
|
1050
|
+
level: "WARN",
|
|
1051
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCountries \n ${warrning}`,
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
const query_params = {};
|
|
1056
|
+
query_params["onboarding"] = onboarding;
|
|
1057
|
+
query_params["page_no"] = pageNo;
|
|
1058
|
+
query_params["page_size"] = pageSize;
|
|
1059
|
+
query_params["q"] = q;
|
|
1060
|
+
query_params["hierarchy"] = hierarchy;
|
|
1061
|
+
|
|
1062
|
+
const xHeaders = {};
|
|
1063
|
+
|
|
1064
|
+
const response = await PlatformAPIClient.execute(
|
|
1065
|
+
this.config,
|
|
1066
|
+
"get",
|
|
1067
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/countries`,
|
|
1068
|
+
query_params,
|
|
1069
|
+
undefined,
|
|
1070
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1071
|
+
{ responseHeaders }
|
|
1072
|
+
);
|
|
1073
|
+
|
|
1074
|
+
let responseData = response;
|
|
1075
|
+
if (responseHeaders) {
|
|
1076
|
+
responseData = response[0];
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
const {
|
|
1080
|
+
error: res_error,
|
|
1081
|
+
} = ServiceabilityPlatformModel.GetCountries().validate(responseData, {
|
|
1082
|
+
abortEarly: false,
|
|
1083
|
+
allowUnknown: true,
|
|
1084
|
+
});
|
|
1085
|
+
|
|
1086
|
+
if (res_error) {
|
|
1087
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1088
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1089
|
+
} else {
|
|
1090
|
+
Logger({
|
|
1091
|
+
level: "WARN",
|
|
1092
|
+
message: `Response Validation Warnings for platform > Serviceability > getCountries \n ${res_error}`,
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
return response;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
921
1100
|
/**
|
|
922
1101
|
* @param {ServiceabilityPlatformValidator.GetCourierPartnerAccountParam} arg
|
|
923
1102
|
* - Arg object
|
|
@@ -1103,25 +1282,26 @@ class Serviceability {
|
|
|
1103
1282
|
}
|
|
1104
1283
|
|
|
1105
1284
|
/**
|
|
1106
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1285
|
+
* @param {ServiceabilityPlatformValidator.GetCourierPartnerSchemeParam} arg
|
|
1286
|
+
* - Arg object
|
|
1287
|
+
*
|
|
1107
1288
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1108
1289
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1109
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1110
|
-
* Success response
|
|
1111
|
-
*
|
|
1112
|
-
* @
|
|
1113
|
-
* @
|
|
1290
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerV2SchemeModel>}
|
|
1291
|
+
* - Success response
|
|
1292
|
+
*
|
|
1293
|
+
* @name getCourierPartnerScheme
|
|
1294
|
+
* @summary: Get Scheme for courier partner extension by Id
|
|
1295
|
+
* @description: Update Scheme for courier partner extension by Id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerScheme/).
|
|
1114
1296
|
*/
|
|
1115
|
-
async
|
|
1116
|
-
{
|
|
1297
|
+
async getCourierPartnerScheme(
|
|
1298
|
+
{ schemeId, requestHeaders } = { requestHeaders: {} },
|
|
1117
1299
|
{ responseHeaders } = { responseHeaders: false }
|
|
1118
1300
|
) {
|
|
1119
1301
|
const {
|
|
1120
1302
|
error,
|
|
1121
|
-
} = ServiceabilityPlatformValidator.
|
|
1122
|
-
{
|
|
1123
|
-
body,
|
|
1124
|
-
},
|
|
1303
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerScheme().validate(
|
|
1304
|
+
{ schemeId },
|
|
1125
1305
|
{ abortEarly: false, allowUnknown: true }
|
|
1126
1306
|
);
|
|
1127
1307
|
if (error) {
|
|
@@ -1131,16 +1311,14 @@ class Serviceability {
|
|
|
1131
1311
|
// Showing warrnings if extra unknown parameters are found
|
|
1132
1312
|
const {
|
|
1133
1313
|
error: warrning,
|
|
1134
|
-
} = ServiceabilityPlatformValidator.
|
|
1135
|
-
{
|
|
1136
|
-
body,
|
|
1137
|
-
},
|
|
1314
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerScheme().validate(
|
|
1315
|
+
{ schemeId },
|
|
1138
1316
|
{ abortEarly: false, allowUnknown: false }
|
|
1139
1317
|
);
|
|
1140
1318
|
if (warrning) {
|
|
1141
1319
|
Logger({
|
|
1142
1320
|
level: "WARN",
|
|
1143
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1321
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerScheme \n ${warrning}`,
|
|
1144
1322
|
});
|
|
1145
1323
|
}
|
|
1146
1324
|
|
|
@@ -1150,10 +1328,10 @@ class Serviceability {
|
|
|
1150
1328
|
|
|
1151
1329
|
const response = await PlatformAPIClient.execute(
|
|
1152
1330
|
this.config,
|
|
1153
|
-
"
|
|
1154
|
-
`/service/platform/logistics/
|
|
1331
|
+
"get",
|
|
1332
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/scheme/${schemeId}`,
|
|
1155
1333
|
query_params,
|
|
1156
|
-
|
|
1334
|
+
undefined,
|
|
1157
1335
|
{ ...xHeaders, ...requestHeaders },
|
|
1158
1336
|
{ responseHeaders }
|
|
1159
1337
|
);
|
|
@@ -1165,7 +1343,7 @@ class Serviceability {
|
|
|
1165
1343
|
|
|
1166
1344
|
const {
|
|
1167
1345
|
error: res_error,
|
|
1168
|
-
} = ServiceabilityPlatformModel.
|
|
1346
|
+
} = ServiceabilityPlatformModel.CourierPartnerV2SchemeModel().validate(
|
|
1169
1347
|
responseData,
|
|
1170
1348
|
{ abortEarly: false, allowUnknown: true }
|
|
1171
1349
|
);
|
|
@@ -1176,7 +1354,7 @@ class Serviceability {
|
|
|
1176
1354
|
} else {
|
|
1177
1355
|
Logger({
|
|
1178
1356
|
level: "WARN",
|
|
1179
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1357
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerScheme \n ${res_error}`,
|
|
1180
1358
|
});
|
|
1181
1359
|
}
|
|
1182
1360
|
}
|
|
@@ -1185,32 +1363,32 @@ class Serviceability {
|
|
|
1185
1363
|
}
|
|
1186
1364
|
|
|
1187
1365
|
/**
|
|
1188
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1366
|
+
* @param {ServiceabilityPlatformValidator.GetCourierPartnerSchemesParam} arg
|
|
1189
1367
|
* - Arg object
|
|
1190
1368
|
*
|
|
1191
1369
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1192
1370
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1193
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1194
|
-
* Success response
|
|
1195
|
-
*
|
|
1196
|
-
* @
|
|
1197
|
-
* @
|
|
1371
|
+
* @returns {Promise<ServiceabilityPlatformModel.courierPartnerSchemeV2List>}
|
|
1372
|
+
* - Success response
|
|
1373
|
+
*
|
|
1374
|
+
* @name getCourierPartnerSchemes
|
|
1375
|
+
* @summary: Get created Schemes for courier partner
|
|
1376
|
+
* @description: Get created Schemes for courier partner - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerSchemes/).
|
|
1198
1377
|
*/
|
|
1199
|
-
async
|
|
1200
|
-
{
|
|
1378
|
+
async getCourierPartnerSchemes(
|
|
1379
|
+
{ schemeType, paymentMode, capabilities, schemeIds, requestHeaders } = {
|
|
1201
1380
|
requestHeaders: {},
|
|
1202
1381
|
},
|
|
1203
1382
|
{ responseHeaders } = { responseHeaders: false }
|
|
1204
1383
|
) {
|
|
1205
1384
|
const {
|
|
1206
1385
|
error,
|
|
1207
|
-
} = ServiceabilityPlatformValidator.
|
|
1386
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerSchemes().validate(
|
|
1208
1387
|
{
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
packageType,
|
|
1388
|
+
schemeType,
|
|
1389
|
+
paymentMode,
|
|
1390
|
+
capabilities,
|
|
1391
|
+
schemeIds,
|
|
1214
1392
|
},
|
|
1215
1393
|
{ abortEarly: false, allowUnknown: true }
|
|
1216
1394
|
);
|
|
@@ -1221,36 +1399,34 @@ class Serviceability {
|
|
|
1221
1399
|
// Showing warrnings if extra unknown parameters are found
|
|
1222
1400
|
const {
|
|
1223
1401
|
error: warrning,
|
|
1224
|
-
} = ServiceabilityPlatformValidator.
|
|
1402
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerSchemes().validate(
|
|
1225
1403
|
{
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
packageType,
|
|
1404
|
+
schemeType,
|
|
1405
|
+
paymentMode,
|
|
1406
|
+
capabilities,
|
|
1407
|
+
schemeIds,
|
|
1231
1408
|
},
|
|
1232
1409
|
{ abortEarly: false, allowUnknown: false }
|
|
1233
1410
|
);
|
|
1234
1411
|
if (warrning) {
|
|
1235
1412
|
Logger({
|
|
1236
1413
|
level: "WARN",
|
|
1237
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1414
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerSchemes \n ${warrning}`,
|
|
1238
1415
|
});
|
|
1239
1416
|
}
|
|
1240
1417
|
|
|
1241
1418
|
const query_params = {};
|
|
1242
|
-
query_params["
|
|
1243
|
-
query_params["
|
|
1244
|
-
query_params["
|
|
1245
|
-
query_params["
|
|
1246
|
-
query_params["package_type"] = packageType;
|
|
1419
|
+
query_params["scheme_type"] = schemeType;
|
|
1420
|
+
query_params["payment_mode"] = paymentMode;
|
|
1421
|
+
query_params["capabilities"] = capabilities;
|
|
1422
|
+
query_params["scheme_ids"] = schemeIds;
|
|
1247
1423
|
|
|
1248
1424
|
const xHeaders = {};
|
|
1249
1425
|
|
|
1250
1426
|
const response = await PlatformAPIClient.execute(
|
|
1251
1427
|
this.config,
|
|
1252
1428
|
"get",
|
|
1253
|
-
`/service/platform/logistics/
|
|
1429
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/scheme`,
|
|
1254
1430
|
query_params,
|
|
1255
1431
|
undefined,
|
|
1256
1432
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1264,7 +1440,7 @@ class Serviceability {
|
|
|
1264
1440
|
|
|
1265
1441
|
const {
|
|
1266
1442
|
error: res_error,
|
|
1267
|
-
} = ServiceabilityPlatformModel.
|
|
1443
|
+
} = ServiceabilityPlatformModel.courierPartnerSchemeV2List().validate(
|
|
1268
1444
|
responseData,
|
|
1269
1445
|
{ abortEarly: false, allowUnknown: true }
|
|
1270
1446
|
);
|
|
@@ -1275,7 +1451,7 @@ class Serviceability {
|
|
|
1275
1451
|
} else {
|
|
1276
1452
|
Logger({
|
|
1277
1453
|
level: "WARN",
|
|
1278
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1454
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerSchemes \n ${res_error}`,
|
|
1279
1455
|
});
|
|
1280
1456
|
}
|
|
1281
1457
|
}
|
|
@@ -1284,26 +1460,24 @@ class Serviceability {
|
|
|
1284
1460
|
}
|
|
1285
1461
|
|
|
1286
1462
|
/**
|
|
1287
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1288
|
-
* - Arg object
|
|
1289
|
-
*
|
|
1463
|
+
* @param {ServiceabilityPlatformValidator.GetOptimalLocationsParam} arg - Arg object
|
|
1290
1464
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1291
1465
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1292
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1466
|
+
* @returns {Promise<ServiceabilityPlatformModel.OptimalLocationsResult>} -
|
|
1293
1467
|
* Success response
|
|
1294
|
-
* @name
|
|
1295
|
-
* @summary: Get
|
|
1296
|
-
* @description:
|
|
1468
|
+
* @name getOptimalLocations
|
|
1469
|
+
* @summary: Get selling locations
|
|
1470
|
+
* @description: Retrieves a list selling locations which are best suited to fullfil an order for a customer. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getOptimalLocations/).
|
|
1297
1471
|
*/
|
|
1298
|
-
async
|
|
1299
|
-
{
|
|
1472
|
+
async getOptimalLocations(
|
|
1473
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1300
1474
|
{ responseHeaders } = { responseHeaders: false }
|
|
1301
1475
|
) {
|
|
1302
1476
|
const {
|
|
1303
1477
|
error,
|
|
1304
|
-
} = ServiceabilityPlatformValidator.
|
|
1478
|
+
} = ServiceabilityPlatformValidator.getOptimalLocations().validate(
|
|
1305
1479
|
{
|
|
1306
|
-
|
|
1480
|
+
body,
|
|
1307
1481
|
},
|
|
1308
1482
|
{ abortEarly: false, allowUnknown: true }
|
|
1309
1483
|
);
|
|
@@ -1314,16 +1488,16 @@ class Serviceability {
|
|
|
1314
1488
|
// Showing warrnings if extra unknown parameters are found
|
|
1315
1489
|
const {
|
|
1316
1490
|
error: warrning,
|
|
1317
|
-
} = ServiceabilityPlatformValidator.
|
|
1491
|
+
} = ServiceabilityPlatformValidator.getOptimalLocations().validate(
|
|
1318
1492
|
{
|
|
1319
|
-
|
|
1493
|
+
body,
|
|
1320
1494
|
},
|
|
1321
1495
|
{ abortEarly: false, allowUnknown: false }
|
|
1322
1496
|
);
|
|
1323
1497
|
if (warrning) {
|
|
1324
1498
|
Logger({
|
|
1325
1499
|
level: "WARN",
|
|
1326
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1500
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getOptimalLocations \n ${warrning}`,
|
|
1327
1501
|
});
|
|
1328
1502
|
}
|
|
1329
1503
|
|
|
@@ -1333,10 +1507,10 @@ class Serviceability {
|
|
|
1333
1507
|
|
|
1334
1508
|
const response = await PlatformAPIClient.execute(
|
|
1335
1509
|
this.config,
|
|
1336
|
-
"
|
|
1337
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1510
|
+
"post",
|
|
1511
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/optimal-locations`,
|
|
1338
1512
|
query_params,
|
|
1339
|
-
|
|
1513
|
+
body,
|
|
1340
1514
|
{ ...xHeaders, ...requestHeaders },
|
|
1341
1515
|
{ responseHeaders }
|
|
1342
1516
|
);
|
|
@@ -1348,10 +1522,10 @@ class Serviceability {
|
|
|
1348
1522
|
|
|
1349
1523
|
const {
|
|
1350
1524
|
error: res_error,
|
|
1351
|
-
} = ServiceabilityPlatformModel.
|
|
1352
|
-
|
|
1353
|
-
allowUnknown: true
|
|
1354
|
-
|
|
1525
|
+
} = ServiceabilityPlatformModel.OptimalLocationsResult().validate(
|
|
1526
|
+
responseData,
|
|
1527
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1528
|
+
);
|
|
1355
1529
|
|
|
1356
1530
|
if (res_error) {
|
|
1357
1531
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1359,7 +1533,7 @@ class Serviceability {
|
|
|
1359
1533
|
} else {
|
|
1360
1534
|
Logger({
|
|
1361
1535
|
level: "WARN",
|
|
1362
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1536
|
+
message: `Response Validation Warnings for platform > Serviceability > getOptimalLocations \n ${res_error}`,
|
|
1363
1537
|
});
|
|
1364
1538
|
}
|
|
1365
1539
|
}
|
|
@@ -1368,13 +1542,196 @@ class Serviceability {
|
|
|
1368
1542
|
}
|
|
1369
1543
|
|
|
1370
1544
|
/**
|
|
1371
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1545
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialListParam} arg
|
|
1372
1546
|
* - Arg object
|
|
1373
1547
|
*
|
|
1374
1548
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1375
1549
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1376
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1377
|
-
*
|
|
1550
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialList>} -
|
|
1551
|
+
* Success response
|
|
1552
|
+
* @name getPackageMaterialList
|
|
1553
|
+
* @summary: Get packaging materials
|
|
1554
|
+
* @description: Retrieves a list of packaging materials - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterialList/).
|
|
1555
|
+
*/
|
|
1556
|
+
async getPackageMaterialList(
|
|
1557
|
+
{ pageNo, pageSize, q, size, packageType, requestHeaders } = {
|
|
1558
|
+
requestHeaders: {},
|
|
1559
|
+
},
|
|
1560
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1561
|
+
) {
|
|
1562
|
+
const {
|
|
1563
|
+
error,
|
|
1564
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialList().validate(
|
|
1565
|
+
{
|
|
1566
|
+
pageNo,
|
|
1567
|
+
pageSize,
|
|
1568
|
+
q,
|
|
1569
|
+
size,
|
|
1570
|
+
packageType,
|
|
1571
|
+
},
|
|
1572
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1573
|
+
);
|
|
1574
|
+
if (error) {
|
|
1575
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1579
|
+
const {
|
|
1580
|
+
error: warrning,
|
|
1581
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialList().validate(
|
|
1582
|
+
{
|
|
1583
|
+
pageNo,
|
|
1584
|
+
pageSize,
|
|
1585
|
+
q,
|
|
1586
|
+
size,
|
|
1587
|
+
packageType,
|
|
1588
|
+
},
|
|
1589
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1590
|
+
);
|
|
1591
|
+
if (warrning) {
|
|
1592
|
+
Logger({
|
|
1593
|
+
level: "WARN",
|
|
1594
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterialList \n ${warrning}`,
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
const query_params = {};
|
|
1599
|
+
query_params["page_no"] = pageNo;
|
|
1600
|
+
query_params["page_size"] = pageSize;
|
|
1601
|
+
query_params["q"] = q;
|
|
1602
|
+
query_params["size"] = size;
|
|
1603
|
+
query_params["package_type"] = packageType;
|
|
1604
|
+
|
|
1605
|
+
const xHeaders = {};
|
|
1606
|
+
|
|
1607
|
+
const response = await PlatformAPIClient.execute(
|
|
1608
|
+
this.config,
|
|
1609
|
+
"get",
|
|
1610
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-materials`,
|
|
1611
|
+
query_params,
|
|
1612
|
+
undefined,
|
|
1613
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1614
|
+
{ responseHeaders }
|
|
1615
|
+
);
|
|
1616
|
+
|
|
1617
|
+
let responseData = response;
|
|
1618
|
+
if (responseHeaders) {
|
|
1619
|
+
responseData = response[0];
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
const {
|
|
1623
|
+
error: res_error,
|
|
1624
|
+
} = ServiceabilityPlatformModel.PackageMaterialList().validate(
|
|
1625
|
+
responseData,
|
|
1626
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1627
|
+
);
|
|
1628
|
+
|
|
1629
|
+
if (res_error) {
|
|
1630
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1631
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1632
|
+
} else {
|
|
1633
|
+
Logger({
|
|
1634
|
+
level: "WARN",
|
|
1635
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialList \n ${res_error}`,
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
return response;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
/**
|
|
1644
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialRuleParam} arg
|
|
1645
|
+
* - Arg object
|
|
1646
|
+
*
|
|
1647
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1648
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1649
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageRuleResult>} -
|
|
1650
|
+
* Success response
|
|
1651
|
+
* @name getPackageMaterialRule
|
|
1652
|
+
* @summary: Get packaging material rule
|
|
1653
|
+
* @description: Retrieve packaging rule details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterialRule/).
|
|
1654
|
+
*/
|
|
1655
|
+
async getPackageMaterialRule(
|
|
1656
|
+
{ ruleId, requestHeaders } = { requestHeaders: {} },
|
|
1657
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1658
|
+
) {
|
|
1659
|
+
const {
|
|
1660
|
+
error,
|
|
1661
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRule().validate(
|
|
1662
|
+
{
|
|
1663
|
+
ruleId,
|
|
1664
|
+
},
|
|
1665
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1666
|
+
);
|
|
1667
|
+
if (error) {
|
|
1668
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1672
|
+
const {
|
|
1673
|
+
error: warrning,
|
|
1674
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRule().validate(
|
|
1675
|
+
{
|
|
1676
|
+
ruleId,
|
|
1677
|
+
},
|
|
1678
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1679
|
+
);
|
|
1680
|
+
if (warrning) {
|
|
1681
|
+
Logger({
|
|
1682
|
+
level: "WARN",
|
|
1683
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterialRule \n ${warrning}`,
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
const query_params = {};
|
|
1688
|
+
|
|
1689
|
+
const xHeaders = {};
|
|
1690
|
+
|
|
1691
|
+
const response = await PlatformAPIClient.execute(
|
|
1692
|
+
this.config,
|
|
1693
|
+
"get",
|
|
1694
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/rules/${ruleId}`,
|
|
1695
|
+
query_params,
|
|
1696
|
+
undefined,
|
|
1697
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1698
|
+
{ responseHeaders }
|
|
1699
|
+
);
|
|
1700
|
+
|
|
1701
|
+
let responseData = response;
|
|
1702
|
+
if (responseHeaders) {
|
|
1703
|
+
responseData = response[0];
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
const {
|
|
1707
|
+
error: res_error,
|
|
1708
|
+
} = ServiceabilityPlatformModel.PackageRuleResult().validate(responseData, {
|
|
1709
|
+
abortEarly: false,
|
|
1710
|
+
allowUnknown: true,
|
|
1711
|
+
});
|
|
1712
|
+
|
|
1713
|
+
if (res_error) {
|
|
1714
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1715
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1716
|
+
} else {
|
|
1717
|
+
Logger({
|
|
1718
|
+
level: "WARN",
|
|
1719
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialRule \n ${res_error}`,
|
|
1720
|
+
});
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
return response;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialRulesParam} arg
|
|
1729
|
+
* - Arg object
|
|
1730
|
+
*
|
|
1731
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1732
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1733
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialRuleList>}
|
|
1734
|
+
* - Success response
|
|
1378
1735
|
*
|
|
1379
1736
|
* @name getPackageMaterialRules
|
|
1380
1737
|
* @summary: Get packaging rules
|
|
@@ -1541,6 +1898,98 @@ class Serviceability {
|
|
|
1541
1898
|
return response;
|
|
1542
1899
|
}
|
|
1543
1900
|
|
|
1901
|
+
/**
|
|
1902
|
+
* @param {ServiceabilityPlatformValidator.GetSampleFileServiceabilityStatusParam} arg
|
|
1903
|
+
* - Arg object
|
|
1904
|
+
*
|
|
1905
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1906
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1907
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionServiceabilityTatResult>}
|
|
1908
|
+
* - Success response
|
|
1909
|
+
*
|
|
1910
|
+
* @name getSampleFileServiceabilityStatus
|
|
1911
|
+
* @summary: Get Serviceability TAT sample files generator status
|
|
1912
|
+
* @description: Get Serviceability TAT sample file generator status - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getSampleFileServiceabilityStatus/).
|
|
1913
|
+
*/
|
|
1914
|
+
async getSampleFileServiceabilityStatus(
|
|
1915
|
+
{ pageNo, pageSize, batchId, requestHeaders } = { requestHeaders: {} },
|
|
1916
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1917
|
+
) {
|
|
1918
|
+
const {
|
|
1919
|
+
error,
|
|
1920
|
+
} = ServiceabilityPlatformValidator.getSampleFileServiceabilityStatus().validate(
|
|
1921
|
+
{
|
|
1922
|
+
pageNo,
|
|
1923
|
+
pageSize,
|
|
1924
|
+
batchId,
|
|
1925
|
+
},
|
|
1926
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1927
|
+
);
|
|
1928
|
+
if (error) {
|
|
1929
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1933
|
+
const {
|
|
1934
|
+
error: warrning,
|
|
1935
|
+
} = ServiceabilityPlatformValidator.getSampleFileServiceabilityStatus().validate(
|
|
1936
|
+
{
|
|
1937
|
+
pageNo,
|
|
1938
|
+
pageSize,
|
|
1939
|
+
batchId,
|
|
1940
|
+
},
|
|
1941
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1942
|
+
);
|
|
1943
|
+
if (warrning) {
|
|
1944
|
+
Logger({
|
|
1945
|
+
level: "WARN",
|
|
1946
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getSampleFileServiceabilityStatus \n ${warrning}`,
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
const query_params = {};
|
|
1951
|
+
query_params["page_no"] = pageNo;
|
|
1952
|
+
query_params["page_size"] = pageSize;
|
|
1953
|
+
query_params["batch_id"] = batchId;
|
|
1954
|
+
|
|
1955
|
+
const xHeaders = {};
|
|
1956
|
+
|
|
1957
|
+
const response = await PlatformAPIClient.execute(
|
|
1958
|
+
this.config,
|
|
1959
|
+
"get",
|
|
1960
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/localities/bulk-sample`,
|
|
1961
|
+
query_params,
|
|
1962
|
+
undefined,
|
|
1963
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1964
|
+
{ responseHeaders }
|
|
1965
|
+
);
|
|
1966
|
+
|
|
1967
|
+
let responseData = response;
|
|
1968
|
+
if (responseHeaders) {
|
|
1969
|
+
responseData = response[0];
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
const {
|
|
1973
|
+
error: res_error,
|
|
1974
|
+
} = ServiceabilityPlatformModel.BulkRegionServiceabilityTatResult().validate(
|
|
1975
|
+
responseData,
|
|
1976
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1977
|
+
);
|
|
1978
|
+
|
|
1979
|
+
if (res_error) {
|
|
1980
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1981
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1982
|
+
} else {
|
|
1983
|
+
Logger({
|
|
1984
|
+
level: "WARN",
|
|
1985
|
+
message: `Response Validation Warnings for platform > Serviceability > getSampleFileServiceabilityStatus \n ${res_error}`,
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
return response;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1544
1993
|
/**
|
|
1545
1994
|
* @param {ServiceabilityPlatformValidator.GetServiceabilityParam} arg - Arg object
|
|
1546
1995
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1828,6 +2277,91 @@ class Serviceability {
|
|
|
1828
2277
|
return response;
|
|
1829
2278
|
}
|
|
1830
2279
|
|
|
2280
|
+
/**
|
|
2281
|
+
* @param {ServiceabilityPlatformValidator.SampleFileServiceabilityParam} arg
|
|
2282
|
+
* - Arg object
|
|
2283
|
+
*
|
|
2284
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2285
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2286
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionServiceabilityTatResultItemData>}
|
|
2287
|
+
* - Success response
|
|
2288
|
+
*
|
|
2289
|
+
* @name sampleFileServiceability
|
|
2290
|
+
* @summary: Sample File Download
|
|
2291
|
+
* @description: Sample File Download - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/sampleFileServiceability/).
|
|
2292
|
+
*/
|
|
2293
|
+
async sampleFileServiceability(
|
|
2294
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2295
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2296
|
+
) {
|
|
2297
|
+
const {
|
|
2298
|
+
error,
|
|
2299
|
+
} = ServiceabilityPlatformValidator.sampleFileServiceability().validate(
|
|
2300
|
+
{
|
|
2301
|
+
body,
|
|
2302
|
+
},
|
|
2303
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2304
|
+
);
|
|
2305
|
+
if (error) {
|
|
2306
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2310
|
+
const {
|
|
2311
|
+
error: warrning,
|
|
2312
|
+
} = ServiceabilityPlatformValidator.sampleFileServiceability().validate(
|
|
2313
|
+
{
|
|
2314
|
+
body,
|
|
2315
|
+
},
|
|
2316
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2317
|
+
);
|
|
2318
|
+
if (warrning) {
|
|
2319
|
+
Logger({
|
|
2320
|
+
level: "WARN",
|
|
2321
|
+
message: `Parameter Validation warrnings for platform > Serviceability > sampleFileServiceability \n ${warrning}`,
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
const query_params = {};
|
|
2326
|
+
|
|
2327
|
+
const xHeaders = {};
|
|
2328
|
+
|
|
2329
|
+
const response = await PlatformAPIClient.execute(
|
|
2330
|
+
this.config,
|
|
2331
|
+
"post",
|
|
2332
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/localities/bulk-sample`,
|
|
2333
|
+
query_params,
|
|
2334
|
+
body,
|
|
2335
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2336
|
+
{ responseHeaders }
|
|
2337
|
+
);
|
|
2338
|
+
|
|
2339
|
+
let responseData = response;
|
|
2340
|
+
if (responseHeaders) {
|
|
2341
|
+
responseData = response[0];
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
const {
|
|
2345
|
+
error: res_error,
|
|
2346
|
+
} = ServiceabilityPlatformModel.BulkRegionServiceabilityTatResultItemData().validate(
|
|
2347
|
+
responseData,
|
|
2348
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2349
|
+
);
|
|
2350
|
+
|
|
2351
|
+
if (res_error) {
|
|
2352
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2353
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2354
|
+
} else {
|
|
2355
|
+
Logger({
|
|
2356
|
+
level: "WARN",
|
|
2357
|
+
message: `Response Validation Warnings for platform > Serviceability > sampleFileServiceability \n ${res_error}`,
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
return response;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
1831
2365
|
/**
|
|
1832
2366
|
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
1833
2367
|
* - Arg object
|
|
@@ -1997,6 +2531,95 @@ class Serviceability {
|
|
|
1997
2531
|
return response;
|
|
1998
2532
|
}
|
|
1999
2533
|
|
|
2534
|
+
/**
|
|
2535
|
+
* @param {ServiceabilityPlatformValidator.UpdateCourierPartnerSchemeParam} arg
|
|
2536
|
+
* - Arg object
|
|
2537
|
+
*
|
|
2538
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2539
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2540
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerV2SchemeModel>}
|
|
2541
|
+
* - Success response
|
|
2542
|
+
*
|
|
2543
|
+
* @name updateCourierPartnerScheme
|
|
2544
|
+
* @summary: Update Scheme for courier partner extension
|
|
2545
|
+
* @description: Update Scheme for courier partner extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierPartnerScheme/).
|
|
2546
|
+
*/
|
|
2547
|
+
async updateCourierPartnerScheme(
|
|
2548
|
+
{ schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
2549
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2550
|
+
) {
|
|
2551
|
+
const {
|
|
2552
|
+
error,
|
|
2553
|
+
} = ServiceabilityPlatformValidator.updateCourierPartnerScheme().validate(
|
|
2554
|
+
{
|
|
2555
|
+
schemeId,
|
|
2556
|
+
|
|
2557
|
+
body,
|
|
2558
|
+
},
|
|
2559
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2560
|
+
);
|
|
2561
|
+
if (error) {
|
|
2562
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2566
|
+
const {
|
|
2567
|
+
error: warrning,
|
|
2568
|
+
} = ServiceabilityPlatformValidator.updateCourierPartnerScheme().validate(
|
|
2569
|
+
{
|
|
2570
|
+
schemeId,
|
|
2571
|
+
|
|
2572
|
+
body,
|
|
2573
|
+
},
|
|
2574
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2575
|
+
);
|
|
2576
|
+
if (warrning) {
|
|
2577
|
+
Logger({
|
|
2578
|
+
level: "WARN",
|
|
2579
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateCourierPartnerScheme \n ${warrning}`,
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
const query_params = {};
|
|
2584
|
+
|
|
2585
|
+
const xHeaders = {};
|
|
2586
|
+
|
|
2587
|
+
const response = await PlatformAPIClient.execute(
|
|
2588
|
+
this.config,
|
|
2589
|
+
"put",
|
|
2590
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/scheme/${schemeId}`,
|
|
2591
|
+
query_params,
|
|
2592
|
+
body,
|
|
2593
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2594
|
+
{ responseHeaders }
|
|
2595
|
+
);
|
|
2596
|
+
|
|
2597
|
+
let responseData = response;
|
|
2598
|
+
if (responseHeaders) {
|
|
2599
|
+
responseData = response[0];
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
const {
|
|
2603
|
+
error: res_error,
|
|
2604
|
+
} = ServiceabilityPlatformModel.CourierPartnerV2SchemeModel().validate(
|
|
2605
|
+
responseData,
|
|
2606
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2607
|
+
);
|
|
2608
|
+
|
|
2609
|
+
if (res_error) {
|
|
2610
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2611
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2612
|
+
} else {
|
|
2613
|
+
Logger({
|
|
2614
|
+
level: "WARN",
|
|
2615
|
+
message: `Response Validation Warnings for platform > Serviceability > updateCourierPartnerScheme \n ${res_error}`,
|
|
2616
|
+
});
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
return response;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2000
2623
|
/**
|
|
2001
2624
|
* @param {ServiceabilityPlatformValidator.UpdatePackageMaterialRuleParam} arg
|
|
2002
2625
|
* - Arg object
|