@gofynd/fdk-client-javascript 1.1.0 → 1.1.2
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 +0 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +11 -0
- package/sdk/application/Cart/CartApplicationClient.js +65 -0
- package/sdk/application/Cart/CartApplicationModel.d.ts +6 -0
- package/sdk/application/Cart/CartApplicationModel.js +72 -0
- package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
- package/sdk/application/Cart/CartApplicationValidator.js +6 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +19 -4
- package/sdk/application/Catalog/CatalogApplicationClient.js +27 -6
- package/sdk/application/Catalog/CatalogApplicationValidator.js +4 -0
- package/sdk/application/Content/ContentApplicationModel.js +1 -4
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -2
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +8 -2
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +2 -2
- package/sdk/application/Lead/LeadApplicationModel.js +1 -0
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +4 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +50 -0
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +8 -8
- package/sdk/application/Rewards/RewardsApplicationClient.js +8 -8
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/common/Constant.d.ts +0 -18
- package/sdk/common/Constant.js +0 -22
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +51 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +308 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +30 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +13 -0
- package/sdk/platform/Cart/CartPlatformModel.js +154 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +5 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.js +3 -7
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +0 -183
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +0 -417
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +0 -10
- package/sdk/platform/Communication/CommunicationPlatformClient.js +0 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +4 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -22
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +0 -56
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +12 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +62 -2
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Content/ContentPlatformModel.js +1 -4
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +1 -1
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +1 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +15 -0
- package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +10 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +15 -9
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -2
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +9 -3
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +2 -2
- package/sdk/platform/Lead/LeadPlatformModel.js +1 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -47
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +5 -201
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -3
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -26
- package/sdk/platform/Order/OrderPlatformClient.d.ts +54 -186
- package/sdk/platform/Order/OrderPlatformClient.js +246 -934
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4 -20
- package/sdk/platform/Order/OrderPlatformModel.js +40 -182
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +3 -12
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -96
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +24 -10
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +111 -44
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +2 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +13 -5
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +12 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +20 -41
- package/sdk/platform/PlatformApplicationClient.js +22 -45
- package/sdk/platform/PlatformClient.d.ts +190 -266
- package/sdk/platform/PlatformClient.js +223 -318
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -26
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +14 -74
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -7
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +11 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.js +61 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
- package/sdk/platform/Share/SharePlatformModel.js +11 -0
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +0 -109
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +0 -558
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +0 -11
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +0 -56
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +0 -88
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +0 -361
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +0 -23
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +0 -169
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.d.ts +0 -7
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +0 -38
|
@@ -204,6 +204,67 @@ class Cart {
|
|
|
204
204
|
return response;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* @param {Object} arg - Arg object.
|
|
209
|
+
* @param {CartMetaConfigAdd} arg.body
|
|
210
|
+
* @returns {Promise<CartMetaConfigAdd>} - Success response
|
|
211
|
+
* @summary: Create new cart meta configuration
|
|
212
|
+
* @description: Create new cart meta configuration
|
|
213
|
+
*/
|
|
214
|
+
async createCartMetaConfig({ body } = {}) {
|
|
215
|
+
const { error } = CartValidator.createCartMetaConfig().validate(
|
|
216
|
+
{
|
|
217
|
+
body,
|
|
218
|
+
},
|
|
219
|
+
{ abortEarly: false, allowUnknown: true }
|
|
220
|
+
);
|
|
221
|
+
if (error) {
|
|
222
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Showing warrnings if extra unknown parameters are found
|
|
226
|
+
const { error: warrning } = CartValidator.createCartMetaConfig().validate(
|
|
227
|
+
{
|
|
228
|
+
body,
|
|
229
|
+
},
|
|
230
|
+
{ abortEarly: false, allowUnknown: false }
|
|
231
|
+
);
|
|
232
|
+
if (warrning) {
|
|
233
|
+
Logger({
|
|
234
|
+
level: "WARN",
|
|
235
|
+
message: "Parameter Validation warrnings for createCartMetaConfig",
|
|
236
|
+
});
|
|
237
|
+
Logger({ level: "WARN", message: warrning });
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const query_params = {};
|
|
241
|
+
|
|
242
|
+
const response = await PlatformAPIClient.execute(
|
|
243
|
+
this.config,
|
|
244
|
+
"post",
|
|
245
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration`,
|
|
246
|
+
query_params,
|
|
247
|
+
body
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
const {
|
|
251
|
+
error: res_error,
|
|
252
|
+
} = CartModel.CartMetaConfigAdd().validate(response, {
|
|
253
|
+
abortEarly: false,
|
|
254
|
+
allowUnknown: false,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
if (res_error) {
|
|
258
|
+
Logger({
|
|
259
|
+
level: "WARN",
|
|
260
|
+
message: "Response Validation Warnnings for createCartMetaConfig",
|
|
261
|
+
});
|
|
262
|
+
Logger({ level: "WARN", message: res_error });
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return response;
|
|
266
|
+
}
|
|
267
|
+
|
|
207
268
|
/**
|
|
208
269
|
* @param {Object} arg - Arg object.
|
|
209
270
|
* @param {CouponAdd} arg.body
|
|
@@ -385,6 +446,62 @@ class Cart {
|
|
|
385
446
|
return response;
|
|
386
447
|
}
|
|
387
448
|
|
|
449
|
+
/**
|
|
450
|
+
* @param {Object} arg - Arg object.
|
|
451
|
+
* @returns {Promise<CartMetaConfigAdd>} - Success response
|
|
452
|
+
* @summary: Fetch cart meta configuration
|
|
453
|
+
* @description: Fetch cart meta configuration
|
|
454
|
+
*/
|
|
455
|
+
async fetchCartMetaConfig({} = {}) {
|
|
456
|
+
const { error } = CartValidator.fetchCartMetaConfig().validate(
|
|
457
|
+
{},
|
|
458
|
+
{ abortEarly: false, allowUnknown: true }
|
|
459
|
+
);
|
|
460
|
+
if (error) {
|
|
461
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Showing warrnings if extra unknown parameters are found
|
|
465
|
+
const { error: warrning } = CartValidator.fetchCartMetaConfig().validate(
|
|
466
|
+
{},
|
|
467
|
+
{ abortEarly: false, allowUnknown: false }
|
|
468
|
+
);
|
|
469
|
+
if (warrning) {
|
|
470
|
+
Logger({
|
|
471
|
+
level: "WARN",
|
|
472
|
+
message: "Parameter Validation warrnings for fetchCartMetaConfig",
|
|
473
|
+
});
|
|
474
|
+
Logger({ level: "WARN", message: warrning });
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const query_params = {};
|
|
478
|
+
|
|
479
|
+
const response = await PlatformAPIClient.execute(
|
|
480
|
+
this.config,
|
|
481
|
+
"get",
|
|
482
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration`,
|
|
483
|
+
query_params,
|
|
484
|
+
undefined
|
|
485
|
+
);
|
|
486
|
+
|
|
487
|
+
const {
|
|
488
|
+
error: res_error,
|
|
489
|
+
} = CartModel.CartMetaConfigAdd().validate(response, {
|
|
490
|
+
abortEarly: false,
|
|
491
|
+
allowUnknown: false,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
if (res_error) {
|
|
495
|
+
Logger({
|
|
496
|
+
level: "WARN",
|
|
497
|
+
message: "Response Validation Warnnings for fetchCartMetaConfig",
|
|
498
|
+
});
|
|
499
|
+
Logger({ level: "WARN", message: res_error });
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return response;
|
|
503
|
+
}
|
|
504
|
+
|
|
388
505
|
/**
|
|
389
506
|
* @param {Object} arg - Arg object.
|
|
390
507
|
* @param {number} [arg.pageNo] -
|
|
@@ -922,6 +1039,72 @@ class Cart {
|
|
|
922
1039
|
return paginator;
|
|
923
1040
|
}
|
|
924
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* @param {Object} arg - Arg object.
|
|
1044
|
+
* @param {string} [arg.entityType] - Entity_type as coupon or promotion
|
|
1045
|
+
* @param {boolean} [arg.isHidden] - Show Promo Coupon Config or not
|
|
1046
|
+
* @returns {Promise<ActivePromosResponse>} - Success response
|
|
1047
|
+
* @summary: Fetch all promos that are set as active
|
|
1048
|
+
* @description: Use this API to get list of all the active promos/coupons.
|
|
1049
|
+
*/
|
|
1050
|
+
async getPromosCouponConfig({ entityType, isHidden } = {}) {
|
|
1051
|
+
const { error } = CartValidator.getPromosCouponConfig().validate(
|
|
1052
|
+
{
|
|
1053
|
+
entityType,
|
|
1054
|
+
isHidden,
|
|
1055
|
+
},
|
|
1056
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1057
|
+
);
|
|
1058
|
+
if (error) {
|
|
1059
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1063
|
+
const { error: warrning } = CartValidator.getPromosCouponConfig().validate(
|
|
1064
|
+
{
|
|
1065
|
+
entityType,
|
|
1066
|
+
isHidden,
|
|
1067
|
+
},
|
|
1068
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1069
|
+
);
|
|
1070
|
+
if (warrning) {
|
|
1071
|
+
Logger({
|
|
1072
|
+
level: "WARN",
|
|
1073
|
+
message: "Parameter Validation warrnings for getPromosCouponConfig",
|
|
1074
|
+
});
|
|
1075
|
+
Logger({ level: "WARN", message: warrning });
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
const query_params = {};
|
|
1079
|
+
query_params["entity_type"] = entityType;
|
|
1080
|
+
query_params["is_hidden"] = isHidden;
|
|
1081
|
+
|
|
1082
|
+
const response = await PlatformAPIClient.execute(
|
|
1083
|
+
this.config,
|
|
1084
|
+
"get",
|
|
1085
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promo-coupons`,
|
|
1086
|
+
query_params,
|
|
1087
|
+
undefined
|
|
1088
|
+
);
|
|
1089
|
+
|
|
1090
|
+
const {
|
|
1091
|
+
error: res_error,
|
|
1092
|
+
} = CartModel.ActivePromosResponse().validate(response, {
|
|
1093
|
+
abortEarly: false,
|
|
1094
|
+
allowUnknown: false,
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
if (res_error) {
|
|
1098
|
+
Logger({
|
|
1099
|
+
level: "WARN",
|
|
1100
|
+
message: "Response Validation Warnnings for getPromosCouponConfig",
|
|
1101
|
+
});
|
|
1102
|
+
Logger({ level: "WARN", message: res_error });
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
return response;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
925
1108
|
/**
|
|
926
1109
|
* @param {Object} arg - Arg object.
|
|
927
1110
|
* @param {string} arg.id -
|
|
@@ -1192,6 +1375,67 @@ class Cart {
|
|
|
1192
1375
|
return paginator;
|
|
1193
1376
|
}
|
|
1194
1377
|
|
|
1378
|
+
/**
|
|
1379
|
+
* @param {Object} arg - Arg object.
|
|
1380
|
+
* @param {OverrideCheckoutReq} arg.body
|
|
1381
|
+
* @returns {Promise<OverrideCheckoutResponse>} - Success response
|
|
1382
|
+
* @summary: Create Fynd order with overriding cart details
|
|
1383
|
+
* @description: Generate Fynd order while overriding cart details sent with provided `cart_items`
|
|
1384
|
+
*/
|
|
1385
|
+
async overrideCart({ body } = {}) {
|
|
1386
|
+
const { error } = CartValidator.overrideCart().validate(
|
|
1387
|
+
{
|
|
1388
|
+
body,
|
|
1389
|
+
},
|
|
1390
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1391
|
+
);
|
|
1392
|
+
if (error) {
|
|
1393
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1397
|
+
const { error: warrning } = CartValidator.overrideCart().validate(
|
|
1398
|
+
{
|
|
1399
|
+
body,
|
|
1400
|
+
},
|
|
1401
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1402
|
+
);
|
|
1403
|
+
if (warrning) {
|
|
1404
|
+
Logger({
|
|
1405
|
+
level: "WARN",
|
|
1406
|
+
message: "Parameter Validation warrnings for overrideCart",
|
|
1407
|
+
});
|
|
1408
|
+
Logger({ level: "WARN", message: warrning });
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
const query_params = {};
|
|
1412
|
+
|
|
1413
|
+
const response = await PlatformAPIClient.execute(
|
|
1414
|
+
this.config,
|
|
1415
|
+
"post",
|
|
1416
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/checkout/over-ride`,
|
|
1417
|
+
query_params,
|
|
1418
|
+
body
|
|
1419
|
+
);
|
|
1420
|
+
|
|
1421
|
+
const {
|
|
1422
|
+
error: res_error,
|
|
1423
|
+
} = CartModel.OverrideCheckoutResponse().validate(response, {
|
|
1424
|
+
abortEarly: false,
|
|
1425
|
+
allowUnknown: false,
|
|
1426
|
+
});
|
|
1427
|
+
|
|
1428
|
+
if (res_error) {
|
|
1429
|
+
Logger({
|
|
1430
|
+
level: "WARN",
|
|
1431
|
+
message: "Response Validation Warnnings for overrideCart",
|
|
1432
|
+
});
|
|
1433
|
+
Logger({ level: "WARN", message: res_error });
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
return response;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1195
1439
|
/**
|
|
1196
1440
|
* @param {Object} arg - Arg object.
|
|
1197
1441
|
* @param {string} arg.cartId - Current Cart _id
|
|
@@ -1260,6 +1504,70 @@ class Cart {
|
|
|
1260
1504
|
return response;
|
|
1261
1505
|
}
|
|
1262
1506
|
|
|
1507
|
+
/**
|
|
1508
|
+
* @param {Object} arg - Arg object.
|
|
1509
|
+
* @param {string} arg.cartMetaId -
|
|
1510
|
+
* @param {CartMetaConfigUpdate} arg.body
|
|
1511
|
+
* @returns {Promise<CartMetaConfigUpdate>} - Success response
|
|
1512
|
+
* @summary: Update cart meta configuration
|
|
1513
|
+
* @description: Update cart meta configuration
|
|
1514
|
+
*/
|
|
1515
|
+
async updateCartMetaConfig({ cartMetaId, body } = {}) {
|
|
1516
|
+
const { error } = CartValidator.updateCartMetaConfig().validate(
|
|
1517
|
+
{
|
|
1518
|
+
cartMetaId,
|
|
1519
|
+
body,
|
|
1520
|
+
},
|
|
1521
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1522
|
+
);
|
|
1523
|
+
if (error) {
|
|
1524
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1528
|
+
const { error: warrning } = CartValidator.updateCartMetaConfig().validate(
|
|
1529
|
+
{
|
|
1530
|
+
cartMetaId,
|
|
1531
|
+
body,
|
|
1532
|
+
},
|
|
1533
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1534
|
+
);
|
|
1535
|
+
if (warrning) {
|
|
1536
|
+
Logger({
|
|
1537
|
+
level: "WARN",
|
|
1538
|
+
message: "Parameter Validation warrnings for updateCartMetaConfig",
|
|
1539
|
+
});
|
|
1540
|
+
Logger({ level: "WARN", message: warrning });
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
const query_params = {};
|
|
1544
|
+
|
|
1545
|
+
const response = await PlatformAPIClient.execute(
|
|
1546
|
+
this.config,
|
|
1547
|
+
"put",
|
|
1548
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration/${cartMetaId}`,
|
|
1549
|
+
query_params,
|
|
1550
|
+
body
|
|
1551
|
+
);
|
|
1552
|
+
|
|
1553
|
+
const {
|
|
1554
|
+
error: res_error,
|
|
1555
|
+
} = CartModel.CartMetaConfigUpdate().validate(response, {
|
|
1556
|
+
abortEarly: false,
|
|
1557
|
+
allowUnknown: false,
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
if (res_error) {
|
|
1561
|
+
Logger({
|
|
1562
|
+
level: "WARN",
|
|
1563
|
+
message: "Response Validation Warnnings for updateCartMetaConfig",
|
|
1564
|
+
});
|
|
1565
|
+
Logger({ level: "WARN", message: res_error });
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
return response;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1263
1571
|
/**
|
|
1264
1572
|
* @param {Object} arg - Arg object.
|
|
1265
1573
|
* @param {string} arg.id -
|
|
@@ -3,19 +3,24 @@ declare class CartValidator {
|
|
|
3
3
|
static addItems(): any;
|
|
4
4
|
static checkCartServiceability(): any;
|
|
5
5
|
static checkoutCart(): any;
|
|
6
|
+
static createCartMetaConfig(): any;
|
|
6
7
|
static createCoupon(): any;
|
|
7
8
|
static createPromotion(): any;
|
|
8
9
|
static fetchAndvalidateCartItems(): any;
|
|
10
|
+
static fetchCartMetaConfig(): any;
|
|
9
11
|
static getAbandonedCart(): any;
|
|
10
12
|
static getAbandonedCartDetails(): any;
|
|
11
13
|
static getCouponById(): any;
|
|
12
14
|
static getCouponCodeExists(): any;
|
|
13
15
|
static getCouponOptionValues(): any;
|
|
14
16
|
static getCoupons(): any;
|
|
17
|
+
static getPromosCouponConfig(): any;
|
|
15
18
|
static getPromotionById(): any;
|
|
16
19
|
static getPromotionCodeExists(): any;
|
|
17
20
|
static getPromotions(): any;
|
|
21
|
+
static overrideCart(): any;
|
|
18
22
|
static updateCart(): any;
|
|
23
|
+
static updateCartMetaConfig(): any;
|
|
19
24
|
static updateCoupon(): any;
|
|
20
25
|
static updateCouponPartially(): any;
|
|
21
26
|
static updatePromotion(): any;
|
|
@@ -22,6 +22,12 @@ class CartValidator {
|
|
|
22
22
|
}).required();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
static createCartMetaConfig() {
|
|
26
|
+
return Joi.object({
|
|
27
|
+
body: CartModel.CartMetaConfigAdd().required(),
|
|
28
|
+
}).required();
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
static createCoupon() {
|
|
26
32
|
return Joi.object({
|
|
27
33
|
body: CartModel.CouponAdd().required(),
|
|
@@ -40,6 +46,10 @@ class CartValidator {
|
|
|
40
46
|
}).required();
|
|
41
47
|
}
|
|
42
48
|
|
|
49
|
+
static fetchCartMetaConfig() {
|
|
50
|
+
return Joi.object({}).required();
|
|
51
|
+
}
|
|
52
|
+
|
|
43
53
|
static getAbandonedCart() {
|
|
44
54
|
return Joi.object({
|
|
45
55
|
pageNo: Joi.number(),
|
|
@@ -89,6 +99,13 @@ class CartValidator {
|
|
|
89
99
|
}).required();
|
|
90
100
|
}
|
|
91
101
|
|
|
102
|
+
static getPromosCouponConfig() {
|
|
103
|
+
return Joi.object({
|
|
104
|
+
entityType: Joi.string().allow(""),
|
|
105
|
+
isHidden: Joi.boolean(),
|
|
106
|
+
}).required();
|
|
107
|
+
}
|
|
108
|
+
|
|
92
109
|
static getPromotionById() {
|
|
93
110
|
return Joi.object({
|
|
94
111
|
id: Joi.string().allow("").required(),
|
|
@@ -114,6 +131,12 @@ class CartValidator {
|
|
|
114
131
|
}).required();
|
|
115
132
|
}
|
|
116
133
|
|
|
134
|
+
static overrideCart() {
|
|
135
|
+
return Joi.object({
|
|
136
|
+
body: CartModel.OverrideCheckoutReq().required(),
|
|
137
|
+
}).required();
|
|
138
|
+
}
|
|
139
|
+
|
|
117
140
|
static updateCart() {
|
|
118
141
|
return Joi.object({
|
|
119
142
|
cartId: Joi.string().allow("").required(),
|
|
@@ -122,6 +145,13 @@ class CartValidator {
|
|
|
122
145
|
}).required();
|
|
123
146
|
}
|
|
124
147
|
|
|
148
|
+
static updateCartMetaConfig() {
|
|
149
|
+
return Joi.object({
|
|
150
|
+
cartMetaId: Joi.string().allow("").required(),
|
|
151
|
+
body: CartModel.CartMetaConfigUpdate().required(),
|
|
152
|
+
}).required();
|
|
153
|
+
}
|
|
154
|
+
|
|
125
155
|
static updateCoupon() {
|
|
126
156
|
return Joi.object({
|
|
127
157
|
id: Joi.string().allow("").required(),
|
|
@@ -3,23 +3,29 @@ declare class CartModel {
|
|
|
3
3
|
static AbandonedCart(): any;
|
|
4
4
|
static AbandonedCartResponse(): any;
|
|
5
5
|
static ActionQuery(): any;
|
|
6
|
+
static ActivePromosResponse(): any;
|
|
6
7
|
static AddCartDetailResponse(): any;
|
|
7
8
|
static AddCartRequest(): any;
|
|
8
9
|
static AddProductCart(): any;
|
|
10
|
+
static AppliedFreeArticles(): any;
|
|
9
11
|
static AppliedPromotion(): any;
|
|
10
12
|
static ArticlePriceInfo(): any;
|
|
11
13
|
static BaseInfo(): any;
|
|
12
14
|
static BasePrice(): any;
|
|
13
15
|
static BulkBundleRestriction(): any;
|
|
16
|
+
static BuyRules(): any;
|
|
14
17
|
static CartBreakup(): any;
|
|
15
18
|
static CartCurrency(): any;
|
|
16
19
|
static CartDetailResponse(): any;
|
|
17
20
|
static CartItem(): any;
|
|
18
21
|
static CartItemMeta(): any;
|
|
22
|
+
static CartMetaConfigAdd(): any;
|
|
23
|
+
static CartMetaConfigUpdate(): any;
|
|
19
24
|
static CartProduct(): any;
|
|
20
25
|
static CartProductIdentifer(): any;
|
|
21
26
|
static CartProductInfo(): any;
|
|
22
27
|
static CategoryInfo(): any;
|
|
28
|
+
static Charges(): any;
|
|
23
29
|
static CompareObject(): any;
|
|
24
30
|
static CouponAction(): any;
|
|
25
31
|
static CouponAdd(): any;
|
|
@@ -30,12 +36,15 @@ declare class CartModel {
|
|
|
30
36
|
static CouponSchedule(): any;
|
|
31
37
|
static CouponsResponse(): any;
|
|
32
38
|
static CouponUpdate(): any;
|
|
39
|
+
static DeliveryCharges(): any;
|
|
33
40
|
static DiscountOffer(): any;
|
|
34
41
|
static DiscountRule(): any;
|
|
42
|
+
static DiscountRulesApp(): any;
|
|
35
43
|
static DisplayBreakup(): any;
|
|
36
44
|
static DisplayMeta(): any;
|
|
37
45
|
static DisplayMeta1(): any;
|
|
38
46
|
static DisplayMetaDict(): any;
|
|
47
|
+
static FreeGiftItem(): any;
|
|
39
48
|
static Identifier(): any;
|
|
40
49
|
static ItemCriteria(): any;
|
|
41
50
|
static LoyaltyPoints(): any;
|
|
@@ -51,6 +60,10 @@ declare class CartModel {
|
|
|
51
60
|
static OpenApiOrderItem(): any;
|
|
52
61
|
static OpenApiPlatformCheckoutReq(): any;
|
|
53
62
|
static OperationErrorResponse(): any;
|
|
63
|
+
static OverrideCartItem(): any;
|
|
64
|
+
static OverrideCartItemPromo(): any;
|
|
65
|
+
static OverrideCheckoutReq(): any;
|
|
66
|
+
static OverrideCheckoutResponse(): any;
|
|
54
67
|
static Ownership(): any;
|
|
55
68
|
static Ownership1(): any;
|
|
56
69
|
static Ownership2(): any;
|