@gofynd/fdk-client-javascript 1.1.1 → 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/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 +14 -4
- package/sdk/application/Catalog/CatalogApplicationClient.js +18 -6
- package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
- package/sdk/application/Content/ContentApplicationModel.js +1 -0
- 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/Order/OrderApplicationClient.d.ts +15 -0
- package/sdk/application/Order/OrderApplicationClient.js +68 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +17 -0
- package/sdk/application/Order/OrderApplicationModel.js +111 -0
- package/sdk/application/Order/OrderApplicationValidator.d.ts +1 -0
- package/sdk/application/Order/OrderApplicationValidator.js +7 -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/platform/Cart/CartPlatformApplicationClient.d.ts +22 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +127 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +2 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +13 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +9 -0
- package/sdk/platform/Cart/CartPlatformModel.js +117 -0
- package/sdk/platform/Content/ContentPlatformModel.js +1 -0
- 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 +8 -2
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +2 -2
- package/sdk/platform/Order/OrderPlatformClient.d.ts +3 -3
- package/sdk/platform/Order/OrderPlatformClient.js +5 -5
- package/sdk/platform/Order/OrderPlatformModel.js +2 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +1 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +9 -1
- package/sdk/platform/PlatformApplicationClient.js +9 -0
- package/sdk/platform/PlatformClient.d.ts +101 -3
- package/sdk/platform/PlatformClient.js +113 -2
- 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
|
@@ -1039,6 +1039,72 @@ class Cart {
|
|
|
1039
1039
|
return paginator;
|
|
1040
1040
|
}
|
|
1041
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
|
+
|
|
1042
1108
|
/**
|
|
1043
1109
|
* @param {Object} arg - Arg object.
|
|
1044
1110
|
* @param {string} arg.id -
|
|
@@ -1309,6 +1375,67 @@ class Cart {
|
|
|
1309
1375
|
return paginator;
|
|
1310
1376
|
}
|
|
1311
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
|
+
|
|
1312
1439
|
/**
|
|
1313
1440
|
* @param {Object} arg - Arg object.
|
|
1314
1441
|
* @param {string} arg.cartId - Current Cart _id
|
|
@@ -14,9 +14,11 @@ declare class CartValidator {
|
|
|
14
14
|
static getCouponCodeExists(): any;
|
|
15
15
|
static getCouponOptionValues(): any;
|
|
16
16
|
static getCoupons(): any;
|
|
17
|
+
static getPromosCouponConfig(): any;
|
|
17
18
|
static getPromotionById(): any;
|
|
18
19
|
static getPromotionCodeExists(): any;
|
|
19
20
|
static getPromotions(): any;
|
|
21
|
+
static overrideCart(): any;
|
|
20
22
|
static updateCart(): any;
|
|
21
23
|
static updateCartMetaConfig(): any;
|
|
22
24
|
static updateCoupon(): any;
|
|
@@ -99,6 +99,13 @@ class CartValidator {
|
|
|
99
99
|
}).required();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
static getPromosCouponConfig() {
|
|
103
|
+
return Joi.object({
|
|
104
|
+
entityType: Joi.string().allow(""),
|
|
105
|
+
isHidden: Joi.boolean(),
|
|
106
|
+
}).required();
|
|
107
|
+
}
|
|
108
|
+
|
|
102
109
|
static getPromotionById() {
|
|
103
110
|
return Joi.object({
|
|
104
111
|
id: Joi.string().allow("").required(),
|
|
@@ -124,6 +131,12 @@ class CartValidator {
|
|
|
124
131
|
}).required();
|
|
125
132
|
}
|
|
126
133
|
|
|
134
|
+
static overrideCart() {
|
|
135
|
+
return Joi.object({
|
|
136
|
+
body: CartModel.OverrideCheckoutReq().required(),
|
|
137
|
+
}).required();
|
|
138
|
+
}
|
|
139
|
+
|
|
127
140
|
static updateCart() {
|
|
128
141
|
return Joi.object({
|
|
129
142
|
cartId: Joi.string().allow("").required(),
|
|
@@ -3,14 +3,17 @@ 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;
|
|
@@ -36,10 +39,12 @@ declare class CartModel {
|
|
|
36
39
|
static DeliveryCharges(): any;
|
|
37
40
|
static DiscountOffer(): any;
|
|
38
41
|
static DiscountRule(): any;
|
|
42
|
+
static DiscountRulesApp(): any;
|
|
39
43
|
static DisplayBreakup(): any;
|
|
40
44
|
static DisplayMeta(): any;
|
|
41
45
|
static DisplayMeta1(): any;
|
|
42
46
|
static DisplayMetaDict(): any;
|
|
47
|
+
static FreeGiftItem(): any;
|
|
43
48
|
static Identifier(): any;
|
|
44
49
|
static ItemCriteria(): any;
|
|
45
50
|
static LoyaltyPoints(): any;
|
|
@@ -55,6 +60,10 @@ declare class CartModel {
|
|
|
55
60
|
static OpenApiOrderItem(): any;
|
|
56
61
|
static OpenApiPlatformCheckoutReq(): any;
|
|
57
62
|
static OperationErrorResponse(): any;
|
|
63
|
+
static OverrideCartItem(): any;
|
|
64
|
+
static OverrideCartItemPromo(): any;
|
|
65
|
+
static OverrideCheckoutReq(): any;
|
|
66
|
+
static OverrideCheckoutResponse(): any;
|
|
58
67
|
static Ownership(): any;
|
|
59
68
|
static Ownership1(): any;
|
|
60
69
|
static Ownership2(): any;
|
|
@@ -52,6 +52,20 @@ class CartModel {
|
|
|
52
52
|
product_slug: Joi.array().items(Joi.string().allow("")),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
static ActivePromosResponse() {
|
|
56
|
+
return Joi.object({
|
|
57
|
+
created_on: Joi.string().allow(""),
|
|
58
|
+
description: Joi.string().allow(""),
|
|
59
|
+
entity_slug: Joi.string().allow(""),
|
|
60
|
+
entity_type: Joi.string().allow(""),
|
|
61
|
+
example: Joi.string().allow(""),
|
|
62
|
+
is_hidden: Joi.boolean(),
|
|
63
|
+
modified_on: Joi.string().allow(""),
|
|
64
|
+
subtitle: Joi.string().allow(""),
|
|
65
|
+
title: Joi.string().allow(""),
|
|
66
|
+
type: Joi.string().allow(""),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
55
69
|
static AddCartDetailResponse() {
|
|
56
70
|
return Joi.object({
|
|
57
71
|
cart: CartModel.CartDetailResponse(),
|
|
@@ -84,14 +98,27 @@ class CartModel {
|
|
|
84
98
|
store_id: Joi.number(),
|
|
85
99
|
});
|
|
86
100
|
}
|
|
101
|
+
static AppliedFreeArticles() {
|
|
102
|
+
return Joi.object({
|
|
103
|
+
article_id: Joi.string().allow(""),
|
|
104
|
+
free_gift_item_details: CartModel.FreeGiftItem(),
|
|
105
|
+
parent_item_identifier: Joi.string().allow(""),
|
|
106
|
+
quantity: Joi.number(),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
87
109
|
static AppliedPromotion() {
|
|
88
110
|
return Joi.object({
|
|
89
111
|
amount: Joi.number(),
|
|
112
|
+
applied_free_articles: Joi.array().items(CartModel.AppliedFreeArticles()),
|
|
90
113
|
article_quantity: Joi.number(),
|
|
114
|
+
buy_rules: Joi.array().items(CartModel.BuyRules()),
|
|
115
|
+
discount_rules: Joi.array().items(CartModel.DiscountRulesApp()),
|
|
91
116
|
mrp_promotion: Joi.boolean(),
|
|
92
117
|
offer_text: Joi.string().allow(""),
|
|
93
118
|
ownership: CartModel.Ownership2(),
|
|
94
119
|
promo_id: Joi.string().allow(""),
|
|
120
|
+
promotion_group: Joi.string().allow(""),
|
|
121
|
+
promotion_name: Joi.string().allow(""),
|
|
95
122
|
promotion_type: Joi.string().allow(""),
|
|
96
123
|
});
|
|
97
124
|
}
|
|
@@ -120,6 +147,12 @@ class CartModel {
|
|
|
120
147
|
multi_store_allowed: Joi.boolean().required(),
|
|
121
148
|
});
|
|
122
149
|
}
|
|
150
|
+
static BuyRules() {
|
|
151
|
+
return Joi.object({
|
|
152
|
+
cart_conditions: Joi.any(),
|
|
153
|
+
item_criteria: Joi.any(),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
123
156
|
static CartBreakup() {
|
|
124
157
|
return Joi.object({
|
|
125
158
|
coupon: CartModel.CouponBreakup(),
|
|
@@ -287,8 +320,15 @@ class CartModel {
|
|
|
287
320
|
static CouponBreakup() {
|
|
288
321
|
return Joi.object({
|
|
289
322
|
code: Joi.string().allow(""),
|
|
323
|
+
coupon_type: Joi.string().allow("").allow(null),
|
|
324
|
+
coupon_value: Joi.number(),
|
|
325
|
+
description: Joi.string().allow("").allow(null),
|
|
290
326
|
is_applied: Joi.boolean(),
|
|
327
|
+
max_discount_value: Joi.number(),
|
|
291
328
|
message: Joi.string().allow(""),
|
|
329
|
+
minimum_cart_value: Joi.number(),
|
|
330
|
+
sub_title: Joi.string().allow("").allow(null),
|
|
331
|
+
title: Joi.string().allow("").allow(null),
|
|
292
332
|
type: Joi.string().allow(""),
|
|
293
333
|
uid: Joi.string().allow(""),
|
|
294
334
|
value: Joi.number(),
|
|
@@ -349,13 +389,16 @@ class CartModel {
|
|
|
349
389
|
}
|
|
350
390
|
static DiscountOffer() {
|
|
351
391
|
return Joi.object({
|
|
392
|
+
apportion_discount: Joi.boolean(),
|
|
352
393
|
code: Joi.string().allow(""),
|
|
353
394
|
discount_amount: Joi.number(),
|
|
354
395
|
discount_percentage: Joi.number(),
|
|
355
396
|
discount_price: Joi.number(),
|
|
356
397
|
max_discount_amount: Joi.number(),
|
|
357
398
|
max_offer_quantity: Joi.number(),
|
|
399
|
+
max_usage_per_transaction: Joi.number(),
|
|
358
400
|
min_offer_quantity: Joi.number(),
|
|
401
|
+
partial_can_ret: Joi.boolean(),
|
|
359
402
|
});
|
|
360
403
|
}
|
|
361
404
|
static DiscountRule() {
|
|
@@ -366,6 +409,14 @@ class CartModel {
|
|
|
366
409
|
offer: CartModel.DiscountOffer().required(),
|
|
367
410
|
});
|
|
368
411
|
}
|
|
412
|
+
static DiscountRulesApp() {
|
|
413
|
+
return Joi.object({
|
|
414
|
+
item_criteria: Joi.any(),
|
|
415
|
+
matched_buy_rules: Joi.array().items(Joi.string().allow("")),
|
|
416
|
+
offer: Joi.any(),
|
|
417
|
+
raw_offer: Joi.any(),
|
|
418
|
+
});
|
|
419
|
+
}
|
|
369
420
|
static DisplayBreakup() {
|
|
370
421
|
return Joi.object({
|
|
371
422
|
currency_code: Joi.string().allow(""),
|
|
@@ -399,6 +450,16 @@ class CartModel {
|
|
|
399
450
|
title: Joi.string().allow(""),
|
|
400
451
|
});
|
|
401
452
|
}
|
|
453
|
+
static FreeGiftItem() {
|
|
454
|
+
return Joi.object({
|
|
455
|
+
item_brand_name: Joi.string().allow(""),
|
|
456
|
+
item_id: Joi.number(),
|
|
457
|
+
item_images_url: Joi.array().items(Joi.string().allow("")),
|
|
458
|
+
item_name: Joi.string().allow(""),
|
|
459
|
+
item_price_details: Joi.any(),
|
|
460
|
+
item_slug: Joi.string().allow(""),
|
|
461
|
+
});
|
|
462
|
+
}
|
|
402
463
|
static Identifier() {
|
|
403
464
|
return Joi.object({
|
|
404
465
|
article_id: Joi.array().items(Joi.string().allow("")),
|
|
@@ -415,15 +476,19 @@ class CartModel {
|
|
|
415
476
|
static ItemCriteria() {
|
|
416
477
|
return Joi.object({
|
|
417
478
|
all_items: Joi.boolean(),
|
|
479
|
+
available_zones: Joi.array().items(Joi.string().allow("")),
|
|
418
480
|
buy_rules: Joi.array().items(Joi.string().allow("")),
|
|
419
481
|
cart_quantity: CartModel.CompareObject(),
|
|
420
482
|
cart_total: CartModel.CompareObject(),
|
|
483
|
+
cart_unique_item_amount: CartModel.CompareObject(),
|
|
484
|
+
cart_unique_item_quantity: CartModel.CompareObject(),
|
|
421
485
|
item_brand: Joi.array().items(Joi.number()),
|
|
422
486
|
item_category: Joi.array().items(Joi.number()),
|
|
423
487
|
item_company: Joi.array().items(Joi.number()),
|
|
424
488
|
item_exclude_brand: Joi.array().items(Joi.number()),
|
|
425
489
|
item_exclude_category: Joi.array().items(Joi.number()),
|
|
426
490
|
item_exclude_company: Joi.array().items(Joi.number()),
|
|
491
|
+
item_exclude_id: Joi.array().items(Joi.number()),
|
|
427
492
|
item_exclude_sku: Joi.array().items(Joi.string().allow("")),
|
|
428
493
|
item_exclude_store: Joi.array().items(Joi.number()),
|
|
429
494
|
item_id: Joi.array().items(Joi.number()),
|
|
@@ -561,6 +626,53 @@ class CartModel {
|
|
|
561
626
|
success: Joi.boolean(),
|
|
562
627
|
});
|
|
563
628
|
}
|
|
629
|
+
static OverrideCartItem() {
|
|
630
|
+
return Joi.object({
|
|
631
|
+
amount_paid: Joi.number().required(),
|
|
632
|
+
discount: Joi.number().required(),
|
|
633
|
+
extra_meta: Joi.any(),
|
|
634
|
+
item_id: Joi.number().required(),
|
|
635
|
+
price_effective: Joi.number().required(),
|
|
636
|
+
price_marked: Joi.number().required(),
|
|
637
|
+
promo_list: Joi.array().items(CartModel.OverrideCartItemPromo()),
|
|
638
|
+
quantity: Joi.number(),
|
|
639
|
+
seller_identifier: Joi.string().allow(""),
|
|
640
|
+
size: Joi.string().allow("").required(),
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
static OverrideCartItemPromo() {
|
|
644
|
+
return Joi.object({
|
|
645
|
+
item_list: Joi.array().items(Joi.any().allow(null)),
|
|
646
|
+
promo_amount: Joi.string().allow("").required(),
|
|
647
|
+
promo_desc: Joi.string().allow(""),
|
|
648
|
+
promo_id: Joi.string().allow("").required(),
|
|
649
|
+
rwrd_tndr: Joi.string().allow(""),
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
static OverrideCheckoutReq() {
|
|
653
|
+
return Joi.object({
|
|
654
|
+
aggregator: Joi.string().allow("").required(),
|
|
655
|
+
billing_address: Joi.any(),
|
|
656
|
+
cart_id: Joi.string().allow("").required(),
|
|
657
|
+
cart_items: Joi.array().items(CartModel.OverrideCartItem()).required(),
|
|
658
|
+
currency_code: Joi.string().allow("").required(),
|
|
659
|
+
merchant_code: Joi.string().allow("").required(),
|
|
660
|
+
order_type: Joi.string().allow("").required(),
|
|
661
|
+
ordering_store: Joi.number().allow(null),
|
|
662
|
+
payment_identifier: Joi.string().allow("").allow(null).required(),
|
|
663
|
+
payment_mode: Joi.string().allow("").required(),
|
|
664
|
+
shipping_address: Joi.any(),
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
static OverrideCheckoutResponse() {
|
|
668
|
+
return Joi.object({
|
|
669
|
+
cart: Joi.any().required(),
|
|
670
|
+
data: Joi.any().required(),
|
|
671
|
+
message: Joi.string().allow("").required(),
|
|
672
|
+
order_id: Joi.string().allow("").required(),
|
|
673
|
+
success: Joi.string().allow("").required(),
|
|
674
|
+
});
|
|
675
|
+
}
|
|
564
676
|
static Ownership() {
|
|
565
677
|
return Joi.object({
|
|
566
678
|
payable_by: Joi.string().allow("").required(),
|
|
@@ -644,11 +756,13 @@ class CartModel {
|
|
|
644
756
|
return Joi.object({
|
|
645
757
|
_custom_json: Joi.any(),
|
|
646
758
|
extra_meta: Joi.any(),
|
|
759
|
+
identifier: Joi.any(),
|
|
647
760
|
parent_item_identifiers: Joi.any(),
|
|
648
761
|
price: CartModel.ArticlePriceInfo(),
|
|
649
762
|
product_group_tags: Joi.array().items(Joi.string().allow("")),
|
|
650
763
|
quantity: Joi.number(),
|
|
651
764
|
seller: CartModel.BaseInfo(),
|
|
765
|
+
seller_identifier: Joi.string().allow(""),
|
|
652
766
|
size: Joi.string().allow(""),
|
|
653
767
|
store: CartModel.BaseInfo(),
|
|
654
768
|
type: Joi.string().allow(""),
|
|
@@ -730,6 +844,7 @@ class CartModel {
|
|
|
730
844
|
buy_rules: Joi.object()
|
|
731
845
|
.pattern(/\S/, CartModel.ItemCriteria())
|
|
732
846
|
.required(),
|
|
847
|
+
calculate_on: Joi.string().allow(""),
|
|
733
848
|
code: Joi.string().allow(""),
|
|
734
849
|
currency: Joi.string().allow(""),
|
|
735
850
|
date_meta: CartModel.PromotionDateMeta(),
|
|
@@ -769,6 +884,7 @@ class CartModel {
|
|
|
769
884
|
buy_rules: Joi.object()
|
|
770
885
|
.pattern(/\S/, CartModel.ItemCriteria())
|
|
771
886
|
.required(),
|
|
887
|
+
calculate_on: Joi.string().allow(""),
|
|
772
888
|
code: Joi.string().allow(""),
|
|
773
889
|
currency: Joi.string().allow(""),
|
|
774
890
|
date_meta: CartModel.PromotionDateMeta(),
|
|
@@ -825,6 +941,7 @@ class CartModel {
|
|
|
825
941
|
buy_rules: Joi.object()
|
|
826
942
|
.pattern(/\S/, CartModel.ItemCriteria())
|
|
827
943
|
.required(),
|
|
944
|
+
calculate_on: Joi.string().allow(""),
|
|
828
945
|
code: Joi.string().allow(""),
|
|
829
946
|
currency: Joi.string().allow(""),
|
|
830
947
|
date_meta: CartModel.PromotionDateMeta(),
|
|
@@ -5,7 +5,10 @@ declare class FileStorage {
|
|
|
5
5
|
applicationId: any;
|
|
6
6
|
/**
|
|
7
7
|
* @param {Object} arg - Arg object.
|
|
8
|
-
* @param {string} arg.namespace -
|
|
8
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
9
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
10
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
11
|
+
* stored inside the storage bucket.
|
|
9
12
|
* @param {StartResponse} arg.body
|
|
10
13
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
11
14
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
@@ -46,7 +49,10 @@ declare class FileStorage {
|
|
|
46
49
|
}): Promise<BulkUploadResponse>;
|
|
47
50
|
/**
|
|
48
51
|
* @param {Object} arg - Arg object.
|
|
49
|
-
* @param {string} arg.namespace -
|
|
52
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
53
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
54
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
55
|
+
* stored inside the storage bucket.
|
|
50
56
|
* @param {StartRequest} arg.body
|
|
51
57
|
* @returns {Promise<StartResponse>} - Success response
|
|
52
58
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
@@ -81,7 +87,7 @@ declare class FileStorage {
|
|
|
81
87
|
* @summary: Browse Files
|
|
82
88
|
* @description: Browse Files
|
|
83
89
|
*/
|
|
84
|
-
|
|
90
|
+
appbrowse({ namespace, pageNo, }?: {
|
|
85
91
|
namespace: string;
|
|
86
92
|
pageNo?: number;
|
|
87
93
|
}): Promise<BrowseResponse>;
|
|
@@ -93,7 +99,7 @@ declare class FileStorage {
|
|
|
93
99
|
* @summary: Browse Files
|
|
94
100
|
* @description: Browse Files
|
|
95
101
|
*/
|
|
96
|
-
|
|
102
|
+
appbrowsePaginator({ namespace, companyId, applicationId }?: {
|
|
97
103
|
namespace: string;
|
|
98
104
|
companyId: number;
|
|
99
105
|
applicationId: number;
|
|
@@ -16,7 +16,10 @@ class FileStorage {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @param {Object} arg - Arg object.
|
|
19
|
-
* @param {string} arg.namespace -
|
|
19
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
20
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
21
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
22
|
+
* stored inside the storage bucket.
|
|
20
23
|
* @param {StartResponse} arg.body
|
|
21
24
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
22
25
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
@@ -170,7 +173,10 @@ class FileStorage {
|
|
|
170
173
|
|
|
171
174
|
/**
|
|
172
175
|
* @param {Object} arg - Arg object.
|
|
173
|
-
* @param {string} arg.namespace -
|
|
176
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
177
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
178
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
179
|
+
* stored inside the storage bucket.
|
|
174
180
|
* @param {StartRequest} arg.body
|
|
175
181
|
* @returns {Promise<StartResponse>} - Success response
|
|
176
182
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
@@ -263,12 +269,12 @@ class FileStorage {
|
|
|
263
269
|
* @summary: Browse Files
|
|
264
270
|
* @description: Browse Files
|
|
265
271
|
*/
|
|
266
|
-
async
|
|
272
|
+
async appbrowse({
|
|
267
273
|
namespace,
|
|
268
274
|
|
|
269
275
|
pageNo,
|
|
270
276
|
} = {}) {
|
|
271
|
-
const { error } = FileStorageValidator.
|
|
277
|
+
const { error } = FileStorageValidator.appbrowse().validate(
|
|
272
278
|
{
|
|
273
279
|
namespace,
|
|
274
280
|
|
|
@@ -281,7 +287,7 @@ class FileStorage {
|
|
|
281
287
|
}
|
|
282
288
|
|
|
283
289
|
// Showing warrnings if extra unknown parameters are found
|
|
284
|
-
const { error: warrning } = FileStorageValidator.
|
|
290
|
+
const { error: warrning } = FileStorageValidator.appbrowse().validate(
|
|
285
291
|
{
|
|
286
292
|
namespace,
|
|
287
293
|
|
|
@@ -292,7 +298,7 @@ class FileStorage {
|
|
|
292
298
|
if (warrning) {
|
|
293
299
|
Logger({
|
|
294
300
|
level: "WARN",
|
|
295
|
-
message: "Parameter Validation warrnings for
|
|
301
|
+
message: "Parameter Validation warrnings for appbrowse",
|
|
296
302
|
});
|
|
297
303
|
Logger({ level: "WARN", message: warrning });
|
|
298
304
|
}
|
|
@@ -318,7 +324,7 @@ class FileStorage {
|
|
|
318
324
|
if (res_error) {
|
|
319
325
|
Logger({
|
|
320
326
|
level: "WARN",
|
|
321
|
-
message: "Response Validation Warnnings for
|
|
327
|
+
message: "Response Validation Warnnings for appbrowse",
|
|
322
328
|
});
|
|
323
329
|
Logger({ level: "WARN", message: res_error });
|
|
324
330
|
}
|
|
@@ -334,13 +340,13 @@ class FileStorage {
|
|
|
334
340
|
* @summary: Browse Files
|
|
335
341
|
* @description: Browse Files
|
|
336
342
|
*/
|
|
337
|
-
|
|
343
|
+
appbrowsePaginator({ namespace, companyId, applicationId } = {}) {
|
|
338
344
|
const paginator = new Paginator();
|
|
339
345
|
const callback = async () => {
|
|
340
346
|
const pageId = paginator.nextId;
|
|
341
347
|
const pageNo = paginator.pageNo;
|
|
342
348
|
const pageType = "number";
|
|
343
|
-
const data = await this.
|
|
349
|
+
const data = await this.appbrowse({
|
|
344
350
|
namespace: namespace,
|
|
345
351
|
companyId: companyId,
|
|
346
352
|
applicationId: applicationId,
|
|
@@ -25,7 +25,10 @@ declare class FileStorage {
|
|
|
25
25
|
}): Paginator;
|
|
26
26
|
/**
|
|
27
27
|
* @param {Object} arg - Arg object.
|
|
28
|
-
* @param {string} arg.namespace -
|
|
28
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
29
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
30
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
31
|
+
* stored inside the storage bucket.
|
|
29
32
|
* @param {StartResponse} arg.body
|
|
30
33
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
31
34
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
@@ -86,7 +89,10 @@ declare class FileStorage {
|
|
|
86
89
|
}): Promise<string>;
|
|
87
90
|
/**
|
|
88
91
|
* @param {Object} arg - Arg object.
|
|
89
|
-
* @param {string} arg.namespace -
|
|
92
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
93
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
94
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
95
|
+
* stored inside the storage bucket.
|
|
90
96
|
* @param {StartRequest} arg.body
|
|
91
97
|
* @returns {Promise<StartResponse>} - Success response
|
|
92
98
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
@@ -116,7 +116,10 @@ class FileStorage {
|
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* @param {Object} arg - Arg object.
|
|
119
|
-
* @param {string} arg.namespace -
|
|
119
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
120
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
121
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
122
|
+
* stored inside the storage bucket.
|
|
120
123
|
* @param {StartResponse} arg.body
|
|
121
124
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
122
125
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
@@ -400,7 +403,10 @@ class FileStorage {
|
|
|
400
403
|
|
|
401
404
|
/**
|
|
402
405
|
* @param {Object} arg - Arg object.
|
|
403
|
-
* @param {string} arg.namespace -
|
|
406
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
407
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
408
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
409
|
+
* stored inside the storage bucket.
|
|
404
410
|
* @param {StartRequest} arg.body
|
|
405
411
|
* @returns {Promise<StartResponse>} - Success response
|
|
406
412
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
@@ -22,8 +22,8 @@ class FileStorageModel {
|
|
|
22
22
|
}
|
|
23
23
|
static CDN() {
|
|
24
24
|
return Joi.object({
|
|
25
|
-
absolute_url: Joi.string().allow(""),
|
|
26
|
-
relative_url: Joi.string().allow(""),
|
|
25
|
+
absolute_url: Joi.string().allow("").required(),
|
|
26
|
+
relative_url: Joi.string().allow("").required(),
|
|
27
27
|
url: Joi.string().allow("").required(),
|
|
28
28
|
});
|
|
29
29
|
}
|