@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
package/README.md
CHANGED
|
@@ -186,6 +186,5 @@ import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";
|
|
|
186
186
|
- [Public Front](documentation/public/README.md)
|
|
187
187
|
- [Application Front](documentation/application/README.md)
|
|
188
188
|
- [Platform Front](documentation/platform/README.md)
|
|
189
|
-
- [Admin Front](documentation/admin/README.md)
|
|
190
189
|
- [Partner Front](documentation/partner/README.md)
|
|
191
190
|
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ declare class Cart {
|
|
|
8
8
|
applyCoupon: string;
|
|
9
9
|
applyRewardPoints: string;
|
|
10
10
|
checkoutCart: string;
|
|
11
|
+
deleteCart: string;
|
|
11
12
|
getAddressById: string;
|
|
12
13
|
getAddresses: string;
|
|
13
14
|
getBulkDiscountOffers: string;
|
|
@@ -110,6 +111,16 @@ declare class Cart {
|
|
|
110
111
|
buyNow?: boolean;
|
|
111
112
|
body: CartCheckoutDetailRequest;
|
|
112
113
|
}): Promise<CartCheckoutResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* @param {Object} arg - Arg object.
|
|
116
|
+
* @param {number} [arg.id] - The unique identifier of the cart.
|
|
117
|
+
* @returns {Promise<DeleteCartDetailResponse>} - Success response
|
|
118
|
+
* @summary: Delete cart once user made successful checkout
|
|
119
|
+
* @description: Use this API to delete the cart.
|
|
120
|
+
*/
|
|
121
|
+
deleteCart({ id }?: {
|
|
122
|
+
id?: number;
|
|
123
|
+
}): Promise<DeleteCartDetailResponse>;
|
|
113
124
|
/**
|
|
114
125
|
* @param {Object} arg - Arg object.
|
|
115
126
|
* @param {string} arg.id -
|
|
@@ -16,6 +16,7 @@ class Cart {
|
|
|
16
16
|
applyCoupon: "/service/application/cart/v1.0/coupon",
|
|
17
17
|
applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
|
|
18
18
|
checkoutCart: "/service/application/cart/v1.0/checkout",
|
|
19
|
+
deleteCart: "/service/application/cart/v1.0/cart_archive",
|
|
19
20
|
getAddressById: "/service/application/cart/v1.0/address/{id}",
|
|
20
21
|
getAddresses: "/service/application/cart/v1.0/address",
|
|
21
22
|
getBulkDiscountOffers: "/service/application/cart/v1.0/bulk-price",
|
|
@@ -399,6 +400,70 @@ class Cart {
|
|
|
399
400
|
return response;
|
|
400
401
|
}
|
|
401
402
|
|
|
403
|
+
/**
|
|
404
|
+
* @param {Object} arg - Arg object.
|
|
405
|
+
* @param {number} [arg.id] - The unique identifier of the cart.
|
|
406
|
+
* @returns {Promise<DeleteCartDetailResponse>} - Success response
|
|
407
|
+
* @summary: Delete cart once user made successful checkout
|
|
408
|
+
* @description: Use this API to delete the cart.
|
|
409
|
+
*/
|
|
410
|
+
async deleteCart({ id } = {}) {
|
|
411
|
+
const { error } = CartValidator.deleteCart().validate(
|
|
412
|
+
{ id },
|
|
413
|
+
{ abortEarly: false, allowUnknown: true }
|
|
414
|
+
);
|
|
415
|
+
if (error) {
|
|
416
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Showing warrnings if extra unknown parameters are found
|
|
420
|
+
const { error: warrning } = CartValidator.deleteCart().validate(
|
|
421
|
+
{ id },
|
|
422
|
+
{ abortEarly: false, allowUnknown: false }
|
|
423
|
+
);
|
|
424
|
+
if (warrning) {
|
|
425
|
+
Logger({
|
|
426
|
+
level: "WARN",
|
|
427
|
+
message: "Parameter Validation warrnings for deleteCart",
|
|
428
|
+
});
|
|
429
|
+
Logger({ level: "WARN", message: warrning });
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const query_params = {};
|
|
433
|
+
query_params["id"] = id;
|
|
434
|
+
|
|
435
|
+
const xHeaders = {};
|
|
436
|
+
|
|
437
|
+
const response = await ApplicationAPIClient.execute(
|
|
438
|
+
this._conf,
|
|
439
|
+
"put",
|
|
440
|
+
constructUrl({
|
|
441
|
+
url: this._urls["deleteCart"],
|
|
442
|
+
params: {},
|
|
443
|
+
}),
|
|
444
|
+
query_params,
|
|
445
|
+
undefined,
|
|
446
|
+
xHeaders
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
const {
|
|
450
|
+
error: res_error,
|
|
451
|
+
} = CartModel.DeleteCartDetailResponse().validate(response, {
|
|
452
|
+
abortEarly: false,
|
|
453
|
+
allowUnknown: false,
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
if (res_error) {
|
|
457
|
+
Logger({
|
|
458
|
+
level: "WARN",
|
|
459
|
+
message: "Response Validation Warnnings for deleteCart",
|
|
460
|
+
});
|
|
461
|
+
Logger({ level: "WARN", message: res_error });
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return response;
|
|
465
|
+
}
|
|
466
|
+
|
|
402
467
|
/**
|
|
403
468
|
* @param {Object} arg - Arg object.
|
|
404
469
|
* @param {string} arg.id -
|
|
@@ -5,6 +5,7 @@ declare class CartModel {
|
|
|
5
5
|
static AddCartRequest(): any;
|
|
6
6
|
static AddProductCart(): any;
|
|
7
7
|
static Address(): any;
|
|
8
|
+
static AppliedFreeArticles(): any;
|
|
8
9
|
static AppliedPromotion(): any;
|
|
9
10
|
static ApplyCouponRequest(): any;
|
|
10
11
|
static ArticlePriceInfo(): any;
|
|
@@ -12,6 +13,7 @@ declare class CartModel {
|
|
|
12
13
|
static BasePrice(): any;
|
|
13
14
|
static BulkPriceOffer(): any;
|
|
14
15
|
static BulkPriceResponse(): any;
|
|
16
|
+
static BuyRules(): any;
|
|
15
17
|
static CartBreakup(): any;
|
|
16
18
|
static CartCheckoutCustomMeta(): any;
|
|
17
19
|
static CartCheckoutDetailRequest(): any;
|
|
@@ -33,7 +35,11 @@ declare class CartModel {
|
|
|
33
35
|
static CouponValidity(): any;
|
|
34
36
|
static CurrencyInfo(): any;
|
|
35
37
|
static DeleteAddressResponse(): any;
|
|
38
|
+
static DeleteCartDetailResponse(): any;
|
|
39
|
+
static DiscountRulesApp(): any;
|
|
36
40
|
static DisplayBreakup(): any;
|
|
41
|
+
static FreeGiftItem(): any;
|
|
42
|
+
static FreeGiftItems(): any;
|
|
37
43
|
static GeoLocation(): any;
|
|
38
44
|
static GetAddressesResponse(): any;
|
|
39
45
|
static GetCouponResponse(): any;
|
|
@@ -66,14 +66,27 @@ class CartModel {
|
|
|
66
66
|
user_id: Joi.string().allow(""),
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
static AppliedFreeArticles() {
|
|
70
|
+
return Joi.object({
|
|
71
|
+
article_id: Joi.string().allow(""),
|
|
72
|
+
free_gift_item_details: CartModel.FreeGiftItem(),
|
|
73
|
+
parent_item_identifier: Joi.string().allow(""),
|
|
74
|
+
quantity: Joi.number(),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
69
77
|
static AppliedPromotion() {
|
|
70
78
|
return Joi.object({
|
|
71
79
|
amount: Joi.number(),
|
|
80
|
+
applied_free_articles: Joi.array().items(CartModel.AppliedFreeArticles()),
|
|
72
81
|
article_quantity: Joi.number(),
|
|
82
|
+
buy_rules: Joi.array().items(CartModel.BuyRules()),
|
|
83
|
+
discount_rules: Joi.array().items(CartModel.DiscountRulesApp()),
|
|
73
84
|
mrp_promotion: Joi.boolean(),
|
|
74
85
|
offer_text: Joi.string().allow(""),
|
|
75
86
|
ownership: CartModel.Ownership(),
|
|
76
87
|
promo_id: Joi.string().allow(""),
|
|
88
|
+
promotion_group: Joi.string().allow(""),
|
|
89
|
+
promotion_name: Joi.string().allow(""),
|
|
77
90
|
promotion_type: Joi.string().allow(""),
|
|
78
91
|
});
|
|
79
92
|
}
|
|
@@ -113,6 +126,12 @@ class CartModel {
|
|
|
113
126
|
data: Joi.array().items(CartModel.BulkPriceOffer()),
|
|
114
127
|
});
|
|
115
128
|
}
|
|
129
|
+
static BuyRules() {
|
|
130
|
+
return Joi.object({
|
|
131
|
+
cart_conditions: Joi.any(),
|
|
132
|
+
item_criteria: Joi.any(),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
116
135
|
static CartBreakup() {
|
|
117
136
|
return Joi.object({
|
|
118
137
|
coupon: CartModel.CouponBreakup(),
|
|
@@ -139,6 +158,7 @@ class CartModel {
|
|
|
139
158
|
extra_meta: Joi.any(),
|
|
140
159
|
merchant_code: Joi.string().allow(""),
|
|
141
160
|
meta: Joi.any(),
|
|
161
|
+
order_type: Joi.string().allow(""),
|
|
142
162
|
ordering_store: Joi.number().allow(null),
|
|
143
163
|
payment_auto_confirm: Joi.boolean(),
|
|
144
164
|
payment_identifier: Joi.string().allow("").allow(null),
|
|
@@ -313,7 +333,9 @@ class CartModel {
|
|
|
313
333
|
static Coupon() {
|
|
314
334
|
return Joi.object({
|
|
315
335
|
coupon_code: Joi.string().allow(""),
|
|
336
|
+
coupon_type: Joi.string().allow("").allow(null),
|
|
316
337
|
coupon_value: Joi.number(),
|
|
338
|
+
description: Joi.string().allow("").allow(null),
|
|
317
339
|
expires_on: Joi.string().allow(""),
|
|
318
340
|
is_applicable: Joi.boolean(),
|
|
319
341
|
is_applied: Joi.boolean(),
|
|
@@ -327,8 +349,15 @@ class CartModel {
|
|
|
327
349
|
static CouponBreakup() {
|
|
328
350
|
return Joi.object({
|
|
329
351
|
code: Joi.string().allow(""),
|
|
352
|
+
coupon_type: Joi.string().allow("").allow(null),
|
|
353
|
+
coupon_value: Joi.number(),
|
|
354
|
+
description: Joi.string().allow("").allow(null),
|
|
330
355
|
is_applied: Joi.boolean(),
|
|
356
|
+
max_discount_value: Joi.number(),
|
|
331
357
|
message: Joi.string().allow(""),
|
|
358
|
+
minimum_cart_value: Joi.number(),
|
|
359
|
+
sub_title: Joi.string().allow("").allow(null),
|
|
360
|
+
title: Joi.string().allow("").allow(null),
|
|
332
361
|
type: Joi.string().allow(""),
|
|
333
362
|
uid: Joi.string().allow(""),
|
|
334
363
|
value: Joi.number(),
|
|
@@ -355,6 +384,20 @@ class CartModel {
|
|
|
355
384
|
is_deleted: Joi.boolean(),
|
|
356
385
|
});
|
|
357
386
|
}
|
|
387
|
+
static DeleteCartDetailResponse() {
|
|
388
|
+
return Joi.object({
|
|
389
|
+
message: Joi.string().allow(""),
|
|
390
|
+
success: Joi.boolean(),
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
static DiscountRulesApp() {
|
|
394
|
+
return Joi.object({
|
|
395
|
+
item_criteria: Joi.any(),
|
|
396
|
+
matched_buy_rules: Joi.array().items(Joi.string().allow("")),
|
|
397
|
+
offer: Joi.any(),
|
|
398
|
+
raw_offer: Joi.any(),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
358
401
|
static DisplayBreakup() {
|
|
359
402
|
return Joi.object({
|
|
360
403
|
currency_code: Joi.string().allow(""),
|
|
@@ -365,6 +408,26 @@ class CartModel {
|
|
|
365
408
|
value: Joi.number(),
|
|
366
409
|
});
|
|
367
410
|
}
|
|
411
|
+
static FreeGiftItem() {
|
|
412
|
+
return Joi.object({
|
|
413
|
+
item_brand_name: Joi.string().allow(""),
|
|
414
|
+
item_id: Joi.number(),
|
|
415
|
+
item_images_url: Joi.array().items(Joi.string().allow("")),
|
|
416
|
+
item_name: Joi.string().allow(""),
|
|
417
|
+
item_price_details: Joi.any(),
|
|
418
|
+
item_slug: Joi.string().allow(""),
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
static FreeGiftItems() {
|
|
422
|
+
return Joi.object({
|
|
423
|
+
item_brand_name: Joi.string().allow(""),
|
|
424
|
+
item_id: Joi.number(),
|
|
425
|
+
item_images_url: Joi.array().items(Joi.string().allow("")),
|
|
426
|
+
item_name: Joi.string().allow(""),
|
|
427
|
+
item_price_details: Joi.any(),
|
|
428
|
+
item_slug: Joi.string().allow(""),
|
|
429
|
+
});
|
|
430
|
+
}
|
|
368
431
|
static GeoLocation() {
|
|
369
432
|
return Joi.object({
|
|
370
433
|
latitude: Joi.number(),
|
|
@@ -415,7 +478,11 @@ class CartModel {
|
|
|
415
478
|
}
|
|
416
479
|
static LadderPriceOffer() {
|
|
417
480
|
return Joi.object({
|
|
481
|
+
buy_rules: Joi.any(),
|
|
482
|
+
calculate_on: Joi.string().allow(""),
|
|
418
483
|
description: Joi.string().allow(""),
|
|
484
|
+
discount_rules: Joi.array().items(Joi.any()),
|
|
485
|
+
free_gift_items: Joi.array().items(CartModel.FreeGiftItems()),
|
|
419
486
|
id: Joi.string().allow(""),
|
|
420
487
|
offer_prices: Joi.array().items(CartModel.LadderOfferItem()),
|
|
421
488
|
offer_text: Joi.string().allow(""),
|
|
@@ -509,11 +576,13 @@ class CartModel {
|
|
|
509
576
|
return Joi.object({
|
|
510
577
|
_custom_json: Joi.any(),
|
|
511
578
|
extra_meta: Joi.any(),
|
|
579
|
+
identifier: Joi.any(),
|
|
512
580
|
parent_item_identifiers: Joi.any(),
|
|
513
581
|
price: CartModel.ArticlePriceInfo(),
|
|
514
582
|
product_group_tags: Joi.array().items(Joi.string().allow("")),
|
|
515
583
|
quantity: Joi.number(),
|
|
516
584
|
seller: CartModel.BaseInfo(),
|
|
585
|
+
seller_identifier: Joi.string().allow(""),
|
|
517
586
|
size: Joi.string().allow(""),
|
|
518
587
|
store: CartModel.BaseInfo(),
|
|
519
588
|
type: Joi.string().allow(""),
|
|
@@ -579,7 +648,10 @@ class CartModel {
|
|
|
579
648
|
}
|
|
580
649
|
static PromotionOffer() {
|
|
581
650
|
return Joi.object({
|
|
651
|
+
buy_rules: Joi.any(),
|
|
582
652
|
description: Joi.string().allow(""),
|
|
653
|
+
discount_rules: Joi.array().items(Joi.any()),
|
|
654
|
+
free_gift_items: Joi.array().items(CartModel.FreeGiftItems()),
|
|
583
655
|
id: Joi.string().allow(""),
|
|
584
656
|
offer_text: Joi.string().allow(""),
|
|
585
657
|
promotion_group: Joi.string().allow(""),
|
|
@@ -139,6 +139,8 @@ declare class Catalog {
|
|
|
139
139
|
* will be passed in f parameter as shown in the example below. Double
|
|
140
140
|
* Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
|
|
141
141
|
* indicates a new filter paramater applied as an AND condition.
|
|
142
|
+
* @param {string} [arg.q] - The search query for entering partial or full
|
|
143
|
+
* name of product, brand, category, or collection.
|
|
142
144
|
* @param {boolean} [arg.filters] - This is a boolean value, True for
|
|
143
145
|
* fetching all filter parameters and False for disabling the filter parameters.
|
|
144
146
|
* @param {string} [arg.sortOn] - The order in which the list of products
|
|
@@ -146,17 +148,23 @@ declare class Catalog {
|
|
|
146
148
|
* either ascending or descending order. See the supported values below.
|
|
147
149
|
* @param {string} [arg.pageId] - Page ID to retrieve next set of results.
|
|
148
150
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
151
|
+
* @param {number} [arg.pageNo] - Page Number to retrieve next set of results.
|
|
152
|
+
* @param {string} [arg.pageType] - Page Type to retrieve set of results can
|
|
153
|
+
* be cursor or number.
|
|
149
154
|
* @returns {Promise<ProductListingResponse>} - Success response
|
|
150
155
|
* @summary: Get the items in a collection
|
|
151
156
|
* @description: Get items in a collection specified by its `slug`.
|
|
152
157
|
*/
|
|
153
|
-
getCollectionItemsBySlug({ slug, f, filters, sortOn, pageId, pageSize, }?: {
|
|
158
|
+
getCollectionItemsBySlug({ slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType, }?: {
|
|
154
159
|
slug: string;
|
|
155
160
|
f?: string;
|
|
161
|
+
q?: string;
|
|
156
162
|
filters?: boolean;
|
|
157
163
|
sortOn?: string;
|
|
158
164
|
pageId?: string;
|
|
159
165
|
pageSize?: number;
|
|
166
|
+
pageNo?: number;
|
|
167
|
+
pageType?: string;
|
|
160
168
|
}): Promise<ProductListingResponse>;
|
|
161
169
|
/**
|
|
162
170
|
* @param {Object} arg - Arg object.
|
|
@@ -167,6 +175,8 @@ declare class Catalog {
|
|
|
167
175
|
* will be passed in f parameter as shown in the example below. Double
|
|
168
176
|
* Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
|
|
169
177
|
* indicates a new filter paramater applied as an AND condition.
|
|
178
|
+
* @param {string} [arg.q] - The search query for entering partial or full
|
|
179
|
+
* name of product, brand, category, or collection.
|
|
170
180
|
* @param {boolean} [arg.filters] - This is a boolean value, True for
|
|
171
181
|
* fetching all filter parameters and False for disabling the filter parameters.
|
|
172
182
|
* @param {string} [arg.sortOn] - The order in which the list of products
|
|
@@ -176,9 +186,10 @@ declare class Catalog {
|
|
|
176
186
|
* @summary: Get the items in a collection
|
|
177
187
|
* @description: Get items in a collection specified by its `slug`.
|
|
178
188
|
*/
|
|
179
|
-
getCollectionItemsBySlugPaginator({ slug, f, filters, sortOn, pageSize, }?: {
|
|
189
|
+
getCollectionItemsBySlugPaginator({ slug, f, q, filters, sortOn, pageSize, }?: {
|
|
180
190
|
slug: string;
|
|
181
191
|
f?: string;
|
|
192
|
+
q?: string;
|
|
182
193
|
filters?: boolean;
|
|
183
194
|
sortOn?: string;
|
|
184
195
|
pageSize?: number;
|
|
@@ -189,25 +200,29 @@ declare class Catalog {
|
|
|
189
200
|
* given set of results.
|
|
190
201
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
191
202
|
* @param {string[]} [arg.tag] - List of tags to filter collections
|
|
203
|
+
* @param {string} [arg.q] - Name of the collection to filter collection
|
|
192
204
|
* @returns {Promise<GetCollectionListingResponse>} - Success response
|
|
193
205
|
* @summary: List all the collections
|
|
194
206
|
* @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
|
|
195
207
|
*/
|
|
196
|
-
getCollections({ pageNo, pageSize, tag }?: {
|
|
208
|
+
getCollections({ pageNo, pageSize, tag, q }?: {
|
|
197
209
|
pageNo?: number;
|
|
198
210
|
pageSize?: number;
|
|
199
211
|
tag?: string[];
|
|
212
|
+
q?: string;
|
|
200
213
|
}): Promise<GetCollectionListingResponse>;
|
|
201
214
|
/**
|
|
202
215
|
* @param {Object} arg - Arg object.
|
|
203
216
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
204
217
|
* @param {string[]} [arg.tag] - List of tags to filter collections
|
|
218
|
+
* @param {string} [arg.q] - Name of the collection to filter collection
|
|
205
219
|
* @summary: List all the collections
|
|
206
220
|
* @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
|
|
207
221
|
*/
|
|
208
|
-
getCollectionsPaginator({ pageSize, tag }?: {
|
|
222
|
+
getCollectionsPaginator({ pageSize, tag, q }?: {
|
|
209
223
|
pageSize?: number;
|
|
210
224
|
tag?: string[];
|
|
225
|
+
q?: string;
|
|
211
226
|
}): Paginator;
|
|
212
227
|
/**
|
|
213
228
|
* @param {Object} arg - Arg object.
|
|
@@ -523,6 +523,8 @@ class Catalog {
|
|
|
523
523
|
* will be passed in f parameter as shown in the example below. Double
|
|
524
524
|
* Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
|
|
525
525
|
* indicates a new filter paramater applied as an AND condition.
|
|
526
|
+
* @param {string} [arg.q] - The search query for entering partial or full
|
|
527
|
+
* name of product, brand, category, or collection.
|
|
526
528
|
* @param {boolean} [arg.filters] - This is a boolean value, True for
|
|
527
529
|
* fetching all filter parameters and False for disabling the filter parameters.
|
|
528
530
|
* @param {string} [arg.sortOn] - The order in which the list of products
|
|
@@ -530,6 +532,9 @@ class Catalog {
|
|
|
530
532
|
* either ascending or descending order. See the supported values below.
|
|
531
533
|
* @param {string} [arg.pageId] - Page ID to retrieve next set of results.
|
|
532
534
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
535
|
+
* @param {number} [arg.pageNo] - Page Number to retrieve next set of results.
|
|
536
|
+
* @param {string} [arg.pageType] - Page Type to retrieve set of results can
|
|
537
|
+
* be cursor or number.
|
|
533
538
|
* @returns {Promise<ProductListingResponse>} - Success response
|
|
534
539
|
* @summary: Get the items in a collection
|
|
535
540
|
* @description: Get items in a collection specified by its `slug`.
|
|
@@ -537,13 +542,16 @@ class Catalog {
|
|
|
537
542
|
async getCollectionItemsBySlug({
|
|
538
543
|
slug,
|
|
539
544
|
f,
|
|
545
|
+
q,
|
|
540
546
|
filters,
|
|
541
547
|
sortOn,
|
|
542
548
|
pageId,
|
|
543
549
|
pageSize,
|
|
550
|
+
pageNo,
|
|
551
|
+
pageType,
|
|
544
552
|
} = {}) {
|
|
545
553
|
const { error } = CatalogValidator.getCollectionItemsBySlug().validate(
|
|
546
|
-
{ slug, f, filters, sortOn, pageId, pageSize },
|
|
554
|
+
{ slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType },
|
|
547
555
|
{ abortEarly: false, allowUnknown: true }
|
|
548
556
|
);
|
|
549
557
|
if (error) {
|
|
@@ -554,7 +562,7 @@ class Catalog {
|
|
|
554
562
|
const {
|
|
555
563
|
error: warrning,
|
|
556
564
|
} = CatalogValidator.getCollectionItemsBySlug().validate(
|
|
557
|
-
{ slug, f, filters, sortOn, pageId, pageSize },
|
|
565
|
+
{ slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType },
|
|
558
566
|
{ abortEarly: false, allowUnknown: false }
|
|
559
567
|
);
|
|
560
568
|
if (warrning) {
|
|
@@ -567,10 +575,13 @@ class Catalog {
|
|
|
567
575
|
|
|
568
576
|
const query_params = {};
|
|
569
577
|
query_params["f"] = f;
|
|
578
|
+
query_params["q"] = q;
|
|
570
579
|
query_params["filters"] = filters;
|
|
571
580
|
query_params["sort_on"] = sortOn;
|
|
572
581
|
query_params["page_id"] = pageId;
|
|
573
582
|
query_params["page_size"] = pageSize;
|
|
583
|
+
query_params["page_no"] = pageNo;
|
|
584
|
+
query_params["page_type"] = pageType;
|
|
574
585
|
|
|
575
586
|
const xHeaders = {};
|
|
576
587
|
|
|
@@ -613,6 +624,8 @@ class Catalog {
|
|
|
613
624
|
* will be passed in f parameter as shown in the example below. Double
|
|
614
625
|
* Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
|
|
615
626
|
* indicates a new filter paramater applied as an AND condition.
|
|
627
|
+
* @param {string} [arg.q] - The search query for entering partial or full
|
|
628
|
+
* name of product, brand, category, or collection.
|
|
616
629
|
* @param {boolean} [arg.filters] - This is a boolean value, True for
|
|
617
630
|
* fetching all filter parameters and False for disabling the filter parameters.
|
|
618
631
|
* @param {string} [arg.sortOn] - The order in which the list of products
|
|
@@ -625,6 +638,7 @@ class Catalog {
|
|
|
625
638
|
getCollectionItemsBySlugPaginator({
|
|
626
639
|
slug,
|
|
627
640
|
f,
|
|
641
|
+
q,
|
|
628
642
|
filters,
|
|
629
643
|
sortOn,
|
|
630
644
|
pageSize,
|
|
@@ -637,10 +651,13 @@ class Catalog {
|
|
|
637
651
|
const data = await this.getCollectionItemsBySlug({
|
|
638
652
|
slug: slug,
|
|
639
653
|
f: f,
|
|
654
|
+
q: q,
|
|
640
655
|
filters: filters,
|
|
641
656
|
sortOn: sortOn,
|
|
642
657
|
pageId: pageId,
|
|
643
658
|
pageSize: pageSize,
|
|
659
|
+
pageNo: pageNo,
|
|
660
|
+
pageType: pageType,
|
|
644
661
|
});
|
|
645
662
|
paginator.setPaginator({
|
|
646
663
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -658,13 +675,14 @@ class Catalog {
|
|
|
658
675
|
* given set of results.
|
|
659
676
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
660
677
|
* @param {string[]} [arg.tag] - List of tags to filter collections
|
|
678
|
+
* @param {string} [arg.q] - Name of the collection to filter collection
|
|
661
679
|
* @returns {Promise<GetCollectionListingResponse>} - Success response
|
|
662
680
|
* @summary: List all the collections
|
|
663
681
|
* @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
|
|
664
682
|
*/
|
|
665
|
-
async getCollections({ pageNo, pageSize, tag } = {}) {
|
|
683
|
+
async getCollections({ pageNo, pageSize, tag, q } = {}) {
|
|
666
684
|
const { error } = CatalogValidator.getCollections().validate(
|
|
667
|
-
{ pageNo, pageSize, tag },
|
|
685
|
+
{ pageNo, pageSize, tag, q },
|
|
668
686
|
{ abortEarly: false, allowUnknown: true }
|
|
669
687
|
);
|
|
670
688
|
if (error) {
|
|
@@ -673,7 +691,7 @@ class Catalog {
|
|
|
673
691
|
|
|
674
692
|
// Showing warrnings if extra unknown parameters are found
|
|
675
693
|
const { error: warrning } = CatalogValidator.getCollections().validate(
|
|
676
|
-
{ pageNo, pageSize, tag },
|
|
694
|
+
{ pageNo, pageSize, tag, q },
|
|
677
695
|
{ abortEarly: false, allowUnknown: false }
|
|
678
696
|
);
|
|
679
697
|
if (warrning) {
|
|
@@ -688,6 +706,7 @@ class Catalog {
|
|
|
688
706
|
query_params["page_no"] = pageNo;
|
|
689
707
|
query_params["page_size"] = pageSize;
|
|
690
708
|
query_params["tag"] = tag;
|
|
709
|
+
query_params["q"] = q;
|
|
691
710
|
|
|
692
711
|
const xHeaders = {};
|
|
693
712
|
|
|
@@ -725,10 +744,11 @@ class Catalog {
|
|
|
725
744
|
* @param {Object} arg - Arg object.
|
|
726
745
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
727
746
|
* @param {string[]} [arg.tag] - List of tags to filter collections
|
|
747
|
+
* @param {string} [arg.q] - Name of the collection to filter collection
|
|
728
748
|
* @summary: List all the collections
|
|
729
749
|
* @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
|
|
730
750
|
*/
|
|
731
|
-
getCollectionsPaginator({ pageSize, tag } = {}) {
|
|
751
|
+
getCollectionsPaginator({ pageSize, tag, q } = {}) {
|
|
732
752
|
const paginator = new Paginator();
|
|
733
753
|
const callback = async () => {
|
|
734
754
|
const pageId = paginator.nextId;
|
|
@@ -738,6 +758,7 @@ class Catalog {
|
|
|
738
758
|
pageNo: pageNo,
|
|
739
759
|
pageSize: pageSize,
|
|
740
760
|
tag: tag,
|
|
761
|
+
q: q,
|
|
741
762
|
});
|
|
742
763
|
paginator.setPaginator({
|
|
743
764
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -45,10 +45,13 @@ class CatalogValidator {
|
|
|
45
45
|
return Joi.object({
|
|
46
46
|
slug: Joi.string().allow("").required(),
|
|
47
47
|
f: Joi.string().allow(""),
|
|
48
|
+
q: Joi.string().allow(""),
|
|
48
49
|
filters: Joi.boolean(),
|
|
49
50
|
sortOn: Joi.string().allow(""),
|
|
50
51
|
pageId: Joi.string().allow(""),
|
|
51
52
|
pageSize: Joi.number(),
|
|
53
|
+
pageNo: Joi.number(),
|
|
54
|
+
pageType: Joi.string().allow(""),
|
|
52
55
|
}).required();
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -57,6 +60,7 @@ class CatalogValidator {
|
|
|
57
60
|
pageNo: Joi.number(),
|
|
58
61
|
pageSize: Joi.number(),
|
|
59
62
|
tag: Joi.array().items(Joi.string().allow("")),
|
|
63
|
+
q: Joi.string().allow(""),
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
66
|
|
|
@@ -347,6 +347,7 @@ class ContentModel {
|
|
|
347
347
|
static Detail() {
|
|
348
348
|
return Joi.object({
|
|
349
349
|
description: Joi.string().allow(""),
|
|
350
|
+
image_url: Joi.string().allow(""),
|
|
350
351
|
title: Joi.string().allow(""),
|
|
351
352
|
});
|
|
352
353
|
}
|
|
@@ -885,10 +886,6 @@ class ContentModel {
|
|
|
885
886
|
|
|
886
887
|
"product",
|
|
887
888
|
|
|
888
|
-
"product-reviews",
|
|
889
|
-
|
|
890
|
-
"add-product-review",
|
|
891
|
-
|
|
892
889
|
"product-request",
|
|
893
890
|
|
|
894
891
|
"products",
|
|
@@ -11,7 +11,10 @@ declare class FileStorage {
|
|
|
11
11
|
updateUrls(urls: any): void;
|
|
12
12
|
/**
|
|
13
13
|
* @param {Object} arg - Arg object.
|
|
14
|
-
* @param {string} arg.namespace -
|
|
14
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
15
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
16
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
17
|
+
* stored inside the storage bucket.
|
|
15
18
|
* @param {StartResponse} arg.body
|
|
16
19
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
17
20
|
* @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
|
|
@@ -50,7 +53,10 @@ declare class FileStorage {
|
|
|
50
53
|
}): Promise<SignUrlResponse>;
|
|
51
54
|
/**
|
|
52
55
|
* @param {Object} arg - Arg object.
|
|
53
|
-
* @param {string} arg.namespace -
|
|
56
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
57
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
58
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
59
|
+
* stored inside the storage bucket.
|
|
54
60
|
* @param {StartRequest} arg.body
|
|
55
61
|
* @returns {Promise<StartResponse>} - Success response
|
|
56
62
|
* @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob.
|
|
@@ -36,7 +36,10 @@ class FileStorage {
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @param {Object} arg - Arg object.
|
|
39
|
-
* @param {string} arg.namespace -
|
|
39
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
40
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
41
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
42
|
+
* stored inside the storage bucket.
|
|
40
43
|
* @param {StartResponse} arg.body
|
|
41
44
|
* @returns {Promise<CompleteResponse>} - Success response
|
|
42
45
|
* @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
|
|
@@ -180,7 +183,10 @@ class FileStorage {
|
|
|
180
183
|
|
|
181
184
|
/**
|
|
182
185
|
* @param {Object} arg - Arg object.
|
|
183
|
-
* @param {string} arg.namespace -
|
|
186
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
187
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
188
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
189
|
+
* stored inside the storage bucket.
|
|
184
190
|
* @param {StartRequest} arg.body
|
|
185
191
|
* @returns {Promise<StartResponse>} - Success response
|
|
186
192
|
* @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the 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
|
}
|