@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
|
@@ -29,6 +29,8 @@ class Order {
|
|
|
29
29
|
"/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
|
|
30
30
|
trackShipment:
|
|
31
31
|
"/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
|
|
32
|
+
updateShipmentStatus:
|
|
33
|
+
"/service/application/order/v1.0/orders/shipments/{shipment_id}/status",
|
|
32
34
|
verifyOtpShipmentCustomer:
|
|
33
35
|
"/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
|
|
34
36
|
};
|
|
@@ -717,6 +719,72 @@ class Order {
|
|
|
717
719
|
return response;
|
|
718
720
|
}
|
|
719
721
|
|
|
722
|
+
/**
|
|
723
|
+
* @param {Object} arg - Arg object.
|
|
724
|
+
* @param {string} arg.shipmentId - ID of the shipment. An order may contain
|
|
725
|
+
* multiple items and may get divided into one or more shipment, each
|
|
726
|
+
* having its own ID.
|
|
727
|
+
* @param {UpdateShipmentStatusRequest} arg.body
|
|
728
|
+
* @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
|
|
729
|
+
* @summary: Update the shipment status
|
|
730
|
+
* @description: Use this API to update the status of a shipment using its shipment ID.
|
|
731
|
+
*/
|
|
732
|
+
async updateShipmentStatus({ shipmentId, body } = {}) {
|
|
733
|
+
const { error } = OrderValidator.updateShipmentStatus().validate(
|
|
734
|
+
{ shipmentId, body },
|
|
735
|
+
{ abortEarly: false, allowUnknown: true }
|
|
736
|
+
);
|
|
737
|
+
if (error) {
|
|
738
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// Showing warrnings if extra unknown parameters are found
|
|
742
|
+
const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
|
|
743
|
+
{ shipmentId, body },
|
|
744
|
+
{ abortEarly: false, allowUnknown: false }
|
|
745
|
+
);
|
|
746
|
+
if (warrning) {
|
|
747
|
+
Logger({
|
|
748
|
+
level: "WARN",
|
|
749
|
+
message: "Parameter Validation warrnings for updateShipmentStatus",
|
|
750
|
+
});
|
|
751
|
+
Logger({ level: "WARN", message: warrning });
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const query_params = {};
|
|
755
|
+
|
|
756
|
+
const xHeaders = {};
|
|
757
|
+
|
|
758
|
+
const response = await ApplicationAPIClient.execute(
|
|
759
|
+
this._conf,
|
|
760
|
+
"put",
|
|
761
|
+
constructUrl({
|
|
762
|
+
url: this._urls["updateShipmentStatus"],
|
|
763
|
+
params: { shipmentId },
|
|
764
|
+
}),
|
|
765
|
+
query_params,
|
|
766
|
+
body,
|
|
767
|
+
xHeaders
|
|
768
|
+
);
|
|
769
|
+
|
|
770
|
+
const {
|
|
771
|
+
error: res_error,
|
|
772
|
+
} = OrderModel.ShipmentApplicationStatusResponse().validate(response, {
|
|
773
|
+
abortEarly: false,
|
|
774
|
+
allowUnknown: false,
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
if (res_error) {
|
|
778
|
+
Logger({
|
|
779
|
+
level: "WARN",
|
|
780
|
+
message: "Response Validation Warnnings for updateShipmentStatus",
|
|
781
|
+
});
|
|
782
|
+
Logger({ level: "WARN", message: res_error });
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
return response;
|
|
786
|
+
}
|
|
787
|
+
|
|
720
788
|
/**
|
|
721
789
|
* @param {Object} arg - Arg object.
|
|
722
790
|
* @param {string} arg.orderId - A unique number used for identifying and
|
|
@@ -11,7 +11,12 @@ declare class OrderModel {
|
|
|
11
11
|
static BreakupValues(): any;
|
|
12
12
|
static CurrentStatus(): any;
|
|
13
13
|
static CustomerDetailsResponse(): any;
|
|
14
|
+
static DataUpdates(): any;
|
|
14
15
|
static DeliveryAddress(): any;
|
|
16
|
+
static EntitiesDataUpdates(): any;
|
|
17
|
+
static EntitiesReasons(): any;
|
|
18
|
+
static EntityReasonData(): any;
|
|
19
|
+
static ErrorResponse(): any;
|
|
15
20
|
static FinancialBreakup(): any;
|
|
16
21
|
static FulfillingCompany(): any;
|
|
17
22
|
static FulfillingStore(): any;
|
|
@@ -27,23 +32,35 @@ declare class OrderModel {
|
|
|
27
32
|
static OrderSchema(): any;
|
|
28
33
|
static OrderStatuses(): any;
|
|
29
34
|
static Prices(): any;
|
|
35
|
+
static Products(): any;
|
|
36
|
+
static ProductsDataUpdates(): any;
|
|
37
|
+
static ProductsDataUpdatesFilters(): any;
|
|
38
|
+
static ProductsReasons(): any;
|
|
39
|
+
static ProductsReasonsData(): any;
|
|
40
|
+
static ProductsReasonsFilters(): any;
|
|
30
41
|
static Promise(): any;
|
|
31
42
|
static QuestionSet(): any;
|
|
43
|
+
static ReasonsData(): any;
|
|
32
44
|
static ResponseGetInvoiceShipment(): any;
|
|
33
45
|
static SendOtpToCustomerResponse(): any;
|
|
46
|
+
static ShipmentApplicationStatusResponse(): any;
|
|
34
47
|
static ShipmentBagReasons(): any;
|
|
35
48
|
static ShipmentById(): any;
|
|
36
49
|
static ShipmentPayment(): any;
|
|
37
50
|
static ShipmentReason(): any;
|
|
38
51
|
static ShipmentReasons(): any;
|
|
39
52
|
static Shipments(): any;
|
|
53
|
+
static ShipmentsRequest(): any;
|
|
40
54
|
static ShipmentStatus(): any;
|
|
41
55
|
static ShipmentTotalDetails(): any;
|
|
42
56
|
static ShipmentTrack(): any;
|
|
43
57
|
static ShipmentUserInfo(): any;
|
|
58
|
+
static StatuesRequest(): any;
|
|
59
|
+
static StatusesBodyResponse(): any;
|
|
44
60
|
static TimeStampData(): any;
|
|
45
61
|
static Track(): any;
|
|
46
62
|
static TrackingDetails(): any;
|
|
63
|
+
static UpdateShipmentStatusRequest(): any;
|
|
47
64
|
static UserInfo(): any;
|
|
48
65
|
static VerifyOtp(): any;
|
|
49
66
|
static VerifyOtpResponse(): any;
|
|
@@ -105,6 +105,12 @@ class OrderModel {
|
|
|
105
105
|
shipment_id: Joi.string().allow(""),
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
+
static DataUpdates() {
|
|
109
|
+
return Joi.object({
|
|
110
|
+
entities: Joi.array().items(OrderModel.EntitiesDataUpdates()),
|
|
111
|
+
products: Joi.array().items(OrderModel.ProductsDataUpdates()),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
108
114
|
static DeliveryAddress() {
|
|
109
115
|
return Joi.object({
|
|
110
116
|
address: Joi.string().allow(""),
|
|
@@ -131,6 +137,33 @@ class OrderModel {
|
|
|
131
137
|
version: Joi.string().allow(""),
|
|
132
138
|
});
|
|
133
139
|
}
|
|
140
|
+
static EntitiesDataUpdates() {
|
|
141
|
+
return Joi.object({
|
|
142
|
+
data: Joi.any(),
|
|
143
|
+
filters: Joi.array().items(Joi.any()),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
static EntitiesReasons() {
|
|
147
|
+
return Joi.object({
|
|
148
|
+
data: OrderModel.EntityReasonData(),
|
|
149
|
+
filters: Joi.array().items(Joi.any()),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
static EntityReasonData() {
|
|
153
|
+
return Joi.object({
|
|
154
|
+
reason_id: Joi.number(),
|
|
155
|
+
reason_text: Joi.string().allow(""),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
static ErrorResponse() {
|
|
159
|
+
return Joi.object({
|
|
160
|
+
code: Joi.string().allow("").allow(null),
|
|
161
|
+
exception: Joi.string().allow("").allow(null),
|
|
162
|
+
message: Joi.string().allow("").allow(null),
|
|
163
|
+
stack_trace: Joi.string().allow("").allow(null),
|
|
164
|
+
status: Joi.number(),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
134
167
|
static FinancialBreakup() {
|
|
135
168
|
return Joi.object({
|
|
136
169
|
added_to_fynd_cash: Joi.boolean(),
|
|
@@ -286,6 +319,44 @@ class OrderModel {
|
|
|
286
319
|
value_of_good: Joi.number(),
|
|
287
320
|
});
|
|
288
321
|
}
|
|
322
|
+
static Products() {
|
|
323
|
+
return Joi.object({
|
|
324
|
+
identifier: Joi.string().allow(""),
|
|
325
|
+
line_number: Joi.number(),
|
|
326
|
+
quantity: Joi.number(),
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
static ProductsDataUpdates() {
|
|
330
|
+
return Joi.object({
|
|
331
|
+
data: Joi.any(),
|
|
332
|
+
filters: Joi.array().items(OrderModel.ProductsDataUpdatesFilters()),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
static ProductsDataUpdatesFilters() {
|
|
336
|
+
return Joi.object({
|
|
337
|
+
identifier: Joi.string().allow(""),
|
|
338
|
+
line_number: Joi.number(),
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
static ProductsReasons() {
|
|
342
|
+
return Joi.object({
|
|
343
|
+
data: OrderModel.ProductsReasonsData(),
|
|
344
|
+
filters: Joi.array().items(OrderModel.ProductsReasonsFilters()),
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
static ProductsReasonsData() {
|
|
348
|
+
return Joi.object({
|
|
349
|
+
reason_id: Joi.number(),
|
|
350
|
+
reason_text: Joi.string().allow(""),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
static ProductsReasonsFilters() {
|
|
354
|
+
return Joi.object({
|
|
355
|
+
identifier: Joi.string().allow(""),
|
|
356
|
+
line_number: Joi.number(),
|
|
357
|
+
quantity: Joi.number(),
|
|
358
|
+
});
|
|
359
|
+
}
|
|
289
360
|
static Promise() {
|
|
290
361
|
return Joi.object({
|
|
291
362
|
show_promise: Joi.boolean(),
|
|
@@ -298,6 +369,12 @@ class OrderModel {
|
|
|
298
369
|
id: Joi.number(),
|
|
299
370
|
});
|
|
300
371
|
}
|
|
372
|
+
static ReasonsData() {
|
|
373
|
+
return Joi.object({
|
|
374
|
+
entities: Joi.array().items(OrderModel.EntitiesReasons()),
|
|
375
|
+
products: Joi.array().items(OrderModel.ProductsReasons()),
|
|
376
|
+
});
|
|
377
|
+
}
|
|
301
378
|
static ResponseGetInvoiceShipment() {
|
|
302
379
|
return Joi.object({
|
|
303
380
|
presigned_type: Joi.string().allow("").required(),
|
|
@@ -314,6 +391,11 @@ class OrderModel {
|
|
|
314
391
|
success: Joi.boolean(),
|
|
315
392
|
});
|
|
316
393
|
}
|
|
394
|
+
static ShipmentApplicationStatusResponse() {
|
|
395
|
+
return Joi.object({
|
|
396
|
+
statuses: Joi.array().items(OrderModel.StatusesBodyResponse()),
|
|
397
|
+
});
|
|
398
|
+
}
|
|
317
399
|
static ShipmentBagReasons() {
|
|
318
400
|
return Joi.object({
|
|
319
401
|
reasons: Joi.array().items(OrderModel.BagReasons()),
|
|
@@ -390,6 +472,14 @@ class OrderModel {
|
|
|
390
472
|
user_info: OrderModel.ShipmentUserInfo(),
|
|
391
473
|
});
|
|
392
474
|
}
|
|
475
|
+
static ShipmentsRequest() {
|
|
476
|
+
return Joi.object({
|
|
477
|
+
data_updates: OrderModel.DataUpdates(),
|
|
478
|
+
identifier: Joi.string().allow("").required(),
|
|
479
|
+
products: Joi.array().items(OrderModel.Products()),
|
|
480
|
+
reasons: OrderModel.ReasonsData(),
|
|
481
|
+
});
|
|
482
|
+
}
|
|
393
483
|
static ShipmentStatus() {
|
|
394
484
|
return Joi.object({
|
|
395
485
|
hex_code: Joi.string().allow(""),
|
|
@@ -416,6 +506,18 @@ class OrderModel {
|
|
|
416
506
|
mobile: Joi.string().allow(""),
|
|
417
507
|
});
|
|
418
508
|
}
|
|
509
|
+
static StatuesRequest() {
|
|
510
|
+
return Joi.object({
|
|
511
|
+
exclude_bags_next_state: Joi.string().allow(""),
|
|
512
|
+
shipments: Joi.array().items(OrderModel.ShipmentsRequest()),
|
|
513
|
+
status: Joi.string().allow(""),
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
static StatusesBodyResponse() {
|
|
517
|
+
return Joi.object({
|
|
518
|
+
shipments: Joi.array().items(Joi.any()),
|
|
519
|
+
});
|
|
520
|
+
}
|
|
419
521
|
static TimeStampData() {
|
|
420
522
|
return Joi.object({
|
|
421
523
|
max: Joi.string().allow(""),
|
|
@@ -443,6 +545,15 @@ class OrderModel {
|
|
|
443
545
|
tracking_details: Joi.array().items(OrderModel.NestedTrackingDetails()),
|
|
444
546
|
});
|
|
445
547
|
}
|
|
548
|
+
static UpdateShipmentStatusRequest() {
|
|
549
|
+
return Joi.object({
|
|
550
|
+
force_transition: Joi.boolean(),
|
|
551
|
+
lock_after_transition: Joi.boolean(),
|
|
552
|
+
statuses: Joi.array().items(OrderModel.StatuesRequest()),
|
|
553
|
+
task: Joi.boolean(),
|
|
554
|
+
unlock_before_transition: Joi.boolean(),
|
|
555
|
+
});
|
|
556
|
+
}
|
|
446
557
|
static UserInfo() {
|
|
447
558
|
return Joi.object({
|
|
448
559
|
email: Joi.string().allow(""),
|
|
@@ -70,6 +70,13 @@ class OrderValidator {
|
|
|
70
70
|
}).required();
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
static updateShipmentStatus() {
|
|
74
|
+
return Joi.object({
|
|
75
|
+
shipmentId: Joi.string().allow("").required(),
|
|
76
|
+
body: OrderModel.UpdateShipmentStatusRequest().required(),
|
|
77
|
+
}).required();
|
|
78
|
+
}
|
|
79
|
+
|
|
73
80
|
static verifyOtpShipmentCustomer() {
|
|
74
81
|
return Joi.object({
|
|
75
82
|
orderId: Joi.string().allow("").required(),
|
|
@@ -5,6 +5,7 @@ declare class PosCartModel {
|
|
|
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 PosCartModel {
|
|
|
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 CartCheckoutResponse(): any;
|
|
@@ -33,8 +35,10 @@ declare class PosCartModel {
|
|
|
33
35
|
static CouponBreakup(): any;
|
|
34
36
|
static CouponValidity(): any;
|
|
35
37
|
static DeleteAddressResponse(): any;
|
|
38
|
+
static DiscountRulesApp(): any;
|
|
36
39
|
static DisplayBreakup(): any;
|
|
37
40
|
static Files(): any;
|
|
41
|
+
static FreeGiftItem(): any;
|
|
38
42
|
static GeoLocation(): any;
|
|
39
43
|
static GetAddressesResponse(): any;
|
|
40
44
|
static GetCouponResponse(): any;
|
|
@@ -66,14 +66,29 @@ class PosCartModel {
|
|
|
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: PosCartModel.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(
|
|
81
|
+
PosCartModel.AppliedFreeArticles()
|
|
82
|
+
),
|
|
72
83
|
article_quantity: Joi.number(),
|
|
84
|
+
buy_rules: Joi.array().items(PosCartModel.BuyRules()),
|
|
85
|
+
discount_rules: Joi.array().items(PosCartModel.DiscountRulesApp()),
|
|
73
86
|
mrp_promotion: Joi.boolean(),
|
|
74
87
|
offer_text: Joi.string().allow(""),
|
|
75
88
|
ownership: PosCartModel.Ownership(),
|
|
76
89
|
promo_id: Joi.string().allow(""),
|
|
90
|
+
promotion_group: Joi.string().allow(""),
|
|
91
|
+
promotion_name: Joi.string().allow(""),
|
|
77
92
|
promotion_type: Joi.string().allow(""),
|
|
78
93
|
});
|
|
79
94
|
}
|
|
@@ -113,6 +128,12 @@ class PosCartModel {
|
|
|
113
128
|
data: Joi.array().items(PosCartModel.BulkPriceOffer()),
|
|
114
129
|
});
|
|
115
130
|
}
|
|
131
|
+
static BuyRules() {
|
|
132
|
+
return Joi.object({
|
|
133
|
+
cart_conditions: Joi.any(),
|
|
134
|
+
item_criteria: Joi.any(),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
116
137
|
static CartBreakup() {
|
|
117
138
|
return Joi.object({
|
|
118
139
|
coupon: PosCartModel.CouponBreakup(),
|
|
@@ -323,7 +344,9 @@ class PosCartModel {
|
|
|
323
344
|
static Coupon() {
|
|
324
345
|
return Joi.object({
|
|
325
346
|
coupon_code: Joi.string().allow(""),
|
|
347
|
+
coupon_type: Joi.string().allow("").allow(null),
|
|
326
348
|
coupon_value: Joi.number(),
|
|
349
|
+
description: Joi.string().allow("").allow(null),
|
|
327
350
|
expires_on: Joi.string().allow(""),
|
|
328
351
|
is_applicable: Joi.boolean(),
|
|
329
352
|
is_applied: Joi.boolean(),
|
|
@@ -337,8 +360,15 @@ class PosCartModel {
|
|
|
337
360
|
static CouponBreakup() {
|
|
338
361
|
return Joi.object({
|
|
339
362
|
code: Joi.string().allow(""),
|
|
363
|
+
coupon_type: Joi.string().allow("").allow(null),
|
|
364
|
+
coupon_value: Joi.number(),
|
|
365
|
+
description: Joi.string().allow("").allow(null),
|
|
340
366
|
is_applied: Joi.boolean(),
|
|
367
|
+
max_discount_value: Joi.number(),
|
|
341
368
|
message: Joi.string().allow(""),
|
|
369
|
+
minimum_cart_value: Joi.number(),
|
|
370
|
+
sub_title: Joi.string().allow("").allow(null),
|
|
371
|
+
title: Joi.string().allow("").allow(null),
|
|
342
372
|
type: Joi.string().allow(""),
|
|
343
373
|
uid: Joi.string().allow(""),
|
|
344
374
|
value: Joi.number(),
|
|
@@ -359,6 +389,14 @@ class PosCartModel {
|
|
|
359
389
|
is_deleted: Joi.boolean(),
|
|
360
390
|
});
|
|
361
391
|
}
|
|
392
|
+
static DiscountRulesApp() {
|
|
393
|
+
return Joi.object({
|
|
394
|
+
item_criteria: Joi.any(),
|
|
395
|
+
matched_buy_rules: Joi.array().items(Joi.string().allow("")),
|
|
396
|
+
offer: Joi.any(),
|
|
397
|
+
raw_offer: Joi.any(),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
362
400
|
static DisplayBreakup() {
|
|
363
401
|
return Joi.object({
|
|
364
402
|
currency_code: Joi.string().allow(""),
|
|
@@ -375,6 +413,16 @@ class PosCartModel {
|
|
|
375
413
|
values: Joi.array().items(Joi.string().allow("")).required(),
|
|
376
414
|
});
|
|
377
415
|
}
|
|
416
|
+
static FreeGiftItem() {
|
|
417
|
+
return Joi.object({
|
|
418
|
+
item_brand_name: Joi.string().allow(""),
|
|
419
|
+
item_id: Joi.number(),
|
|
420
|
+
item_images_url: Joi.array().items(Joi.string().allow("")),
|
|
421
|
+
item_name: Joi.string().allow(""),
|
|
422
|
+
item_price_details: Joi.any(),
|
|
423
|
+
item_slug: Joi.string().allow(""),
|
|
424
|
+
});
|
|
425
|
+
}
|
|
378
426
|
static GeoLocation() {
|
|
379
427
|
return Joi.object({
|
|
380
428
|
latitude: Joi.number(),
|
|
@@ -499,11 +547,13 @@ class PosCartModel {
|
|
|
499
547
|
return Joi.object({
|
|
500
548
|
_custom_json: Joi.any(),
|
|
501
549
|
extra_meta: Joi.any(),
|
|
550
|
+
identifier: Joi.any(),
|
|
502
551
|
parent_item_identifiers: Joi.any(),
|
|
503
552
|
price: PosCartModel.ArticlePriceInfo(),
|
|
504
553
|
product_group_tags: Joi.array().items(Joi.string().allow("")),
|
|
505
554
|
quantity: Joi.number(),
|
|
506
555
|
seller: PosCartModel.BaseInfo(),
|
|
556
|
+
seller_identifier: Joi.string().allow(""),
|
|
507
557
|
size: Joi.string().allow(""),
|
|
508
558
|
store: PosCartModel.BaseInfo(),
|
|
509
559
|
type: Joi.string().allow(""),
|
|
@@ -28,7 +28,7 @@ declare class Rewards {
|
|
|
28
28
|
* @param {string} arg.name - The name given to the offer.
|
|
29
29
|
* @returns {Promise<Offer>} - Success response
|
|
30
30
|
* @summary: Get offer by name
|
|
31
|
-
* @description: Use this API to get the offer details and configuration by
|
|
31
|
+
* @description: Use this API to get fetch the specific offer details and configuration by the name of the offer.
|
|
32
32
|
*/
|
|
33
33
|
getOfferByName({ name }?: {
|
|
34
34
|
name: string;
|
|
@@ -38,7 +38,7 @@ declare class Rewards {
|
|
|
38
38
|
* @param {OrderDiscountRequest} arg.body
|
|
39
39
|
* @returns {Promise<OrderDiscountResponse>} - Success response
|
|
40
40
|
* @summary: Calculates the discount on order-amount
|
|
41
|
-
* @description: Use this API to calculate the discount on order
|
|
41
|
+
* @description: Use this API to calculate the discount on the order amount, based on all the amount range configured in Order Discount offer.
|
|
42
42
|
*/
|
|
43
43
|
getOrderDiscount({ body }?: {
|
|
44
44
|
body: OrderDiscountRequest;
|
|
@@ -46,8 +46,8 @@ declare class Rewards {
|
|
|
46
46
|
/**
|
|
47
47
|
* @param {Object} arg - Arg object.
|
|
48
48
|
* @returns {Promise<PointsResponse>} - Success response
|
|
49
|
-
* @summary: Get
|
|
50
|
-
* @description: Use this API to retrieve total available points of a user for current application
|
|
49
|
+
* @summary: Get total available points of a user
|
|
50
|
+
* @description: Use this API to retrieve total available points of a user for current application.
|
|
51
51
|
*/
|
|
52
52
|
getUserPoints({}?: any): Promise<PointsResponse>;
|
|
53
53
|
/**
|
|
@@ -57,7 +57,7 @@ declare class Rewards {
|
|
|
57
57
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
58
58
|
* @returns {Promise<PointsHistoryResponse>} - Success response
|
|
59
59
|
* @summary: Get all transactions of reward points
|
|
60
|
-
* @description: Use this API to
|
|
60
|
+
* @description: Use this API to fetch a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
61
61
|
*/
|
|
62
62
|
getUserPointsHistory({ pageId, pageSize }?: {
|
|
63
63
|
pageId?: string;
|
|
@@ -67,7 +67,7 @@ declare class Rewards {
|
|
|
67
67
|
* @param {Object} arg - Arg object.
|
|
68
68
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
69
69
|
* @summary: Get all transactions of reward points
|
|
70
|
-
* @description: Use this API to
|
|
70
|
+
* @description: Use this API to fetch a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
71
71
|
*/
|
|
72
72
|
getUserPointsHistoryPaginator({ pageSize }?: {
|
|
73
73
|
pageSize?: number;
|
|
@@ -76,14 +76,14 @@ declare class Rewards {
|
|
|
76
76
|
* @param {Object} arg - Arg object.
|
|
77
77
|
* @returns {Promise<ReferralDetailsResponse>} - Success response
|
|
78
78
|
* @summary: Get referral details of a user
|
|
79
|
-
* @description: Use this API to retrieve the referral details
|
|
79
|
+
* @description: Use this API to retrieve the referral details like referral code of a user.
|
|
80
80
|
*/
|
|
81
81
|
getUserReferralDetails({}?: any): Promise<ReferralDetailsResponse>;
|
|
82
82
|
/**
|
|
83
83
|
* @param {Object} arg - Arg object.
|
|
84
84
|
* @param {RedeemReferralCodeRequest} arg.body
|
|
85
85
|
* @returns {Promise<RedeemReferralCodeResponse>} - Success response
|
|
86
|
-
* @summary: Redeems a referral code and credits reward points to
|
|
86
|
+
* @summary: Redeems a referral code and credits reward points to referee and the referrer as per the configuration
|
|
87
87
|
* @description: Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account.
|
|
88
88
|
*/
|
|
89
89
|
redeemReferralCode({ body }?: {
|
|
@@ -108,7 +108,7 @@ class Rewards {
|
|
|
108
108
|
* @param {string} arg.name - The name given to the offer.
|
|
109
109
|
* @returns {Promise<Offer>} - Success response
|
|
110
110
|
* @summary: Get offer by name
|
|
111
|
-
* @description: Use this API to get the offer details and configuration by
|
|
111
|
+
* @description: Use this API to get fetch the specific offer details and configuration by the name of the offer.
|
|
112
112
|
*/
|
|
113
113
|
async getOfferByName({ name } = {}) {
|
|
114
114
|
const { error } = RewardsValidator.getOfferByName().validate(
|
|
@@ -169,7 +169,7 @@ class Rewards {
|
|
|
169
169
|
* @param {OrderDiscountRequest} arg.body
|
|
170
170
|
* @returns {Promise<OrderDiscountResponse>} - Success response
|
|
171
171
|
* @summary: Calculates the discount on order-amount
|
|
172
|
-
* @description: Use this API to calculate the discount on order
|
|
172
|
+
* @description: Use this API to calculate the discount on the order amount, based on all the amount range configured in Order Discount offer.
|
|
173
173
|
*/
|
|
174
174
|
async getOrderDiscount({ body } = {}) {
|
|
175
175
|
const { error } = RewardsValidator.getOrderDiscount().validate(
|
|
@@ -230,8 +230,8 @@ class Rewards {
|
|
|
230
230
|
/**
|
|
231
231
|
* @param {Object} arg - Arg object.
|
|
232
232
|
* @returns {Promise<PointsResponse>} - Success response
|
|
233
|
-
* @summary: Get
|
|
234
|
-
* @description: Use this API to retrieve total available points of a user for current application
|
|
233
|
+
* @summary: Get total available points of a user
|
|
234
|
+
* @description: Use this API to retrieve total available points of a user for current application.
|
|
235
235
|
*/
|
|
236
236
|
async getUserPoints({} = {}) {
|
|
237
237
|
const { error } = RewardsValidator.getUserPoints().validate(
|
|
@@ -296,7 +296,7 @@ class Rewards {
|
|
|
296
296
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
297
297
|
* @returns {Promise<PointsHistoryResponse>} - Success response
|
|
298
298
|
* @summary: Get all transactions of reward points
|
|
299
|
-
* @description: Use this API to
|
|
299
|
+
* @description: Use this API to fetch a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
300
300
|
*/
|
|
301
301
|
async getUserPointsHistory({ pageId, pageSize } = {}) {
|
|
302
302
|
const { error } = RewardsValidator.getUserPointsHistory().validate(
|
|
@@ -362,7 +362,7 @@ class Rewards {
|
|
|
362
362
|
* @param {Object} arg - Arg object.
|
|
363
363
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
364
364
|
* @summary: Get all transactions of reward points
|
|
365
|
-
* @description: Use this API to
|
|
365
|
+
* @description: Use this API to fetch a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
366
366
|
*/
|
|
367
367
|
getUserPointsHistoryPaginator({ pageSize } = {}) {
|
|
368
368
|
const paginator = new Paginator();
|
|
@@ -388,7 +388,7 @@ class Rewards {
|
|
|
388
388
|
* @param {Object} arg - Arg object.
|
|
389
389
|
* @returns {Promise<ReferralDetailsResponse>} - Success response
|
|
390
390
|
* @summary: Get referral details of a user
|
|
391
|
-
* @description: Use this API to retrieve the referral details
|
|
391
|
+
* @description: Use this API to retrieve the referral details like referral code of a user.
|
|
392
392
|
*/
|
|
393
393
|
async getUserReferralDetails({} = {}) {
|
|
394
394
|
const { error } = RewardsValidator.getUserReferralDetails().validate(
|
|
@@ -452,7 +452,7 @@ class Rewards {
|
|
|
452
452
|
* @param {Object} arg - Arg object.
|
|
453
453
|
* @param {RedeemReferralCodeRequest} arg.body
|
|
454
454
|
* @returns {Promise<RedeemReferralCodeResponse>} - Success response
|
|
455
|
-
* @summary: Redeems a referral code and credits reward points to
|
|
455
|
+
* @summary: Redeems a referral code and credits reward points to referee and the referrer as per the configuration
|
|
456
456
|
* @description: Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account.
|
|
457
457
|
*/
|
|
458
458
|
async redeemReferralCode({ body } = {}) {
|
|
@@ -38,7 +38,7 @@ function requestInterceptorFn() {
|
|
|
38
38
|
}
|
|
39
39
|
const { host, pathname, search } = new URL(url);
|
|
40
40
|
const { data, headers, method, params } = config;
|
|
41
|
-
headers["x-fp-sdk-version"] = "1.1.
|
|
41
|
+
headers["x-fp-sdk-version"] = "1.1.2";
|
|
42
42
|
let querySearchObj = querystring.parse(search);
|
|
43
43
|
querySearchObj = { ...querySearchObj, ...params };
|
|
44
44
|
let queryParam = "";
|
|
@@ -219,6 +219,18 @@ declare class Cart {
|
|
|
219
219
|
typeSlug?: string;
|
|
220
220
|
code?: string;
|
|
221
221
|
}): Paginator;
|
|
222
|
+
/**
|
|
223
|
+
* @param {Object} arg - Arg object.
|
|
224
|
+
* @param {string} [arg.entityType] - Entity_type as coupon or promotion
|
|
225
|
+
* @param {boolean} [arg.isHidden] - Show Promo Coupon Config or not
|
|
226
|
+
* @returns {Promise<ActivePromosResponse>} - Success response
|
|
227
|
+
* @summary: Fetch all promos that are set as active
|
|
228
|
+
* @description: Use this API to get list of all the active promos/coupons.
|
|
229
|
+
*/
|
|
230
|
+
getPromosCouponConfig({ entityType, isHidden }?: {
|
|
231
|
+
entityType?: string;
|
|
232
|
+
isHidden?: boolean;
|
|
233
|
+
}): Promise<ActivePromosResponse>;
|
|
222
234
|
/**
|
|
223
235
|
* @param {Object} arg - Arg object.
|
|
224
236
|
* @param {string} arg.id -
|
|
@@ -288,6 +300,16 @@ declare class Cart {
|
|
|
288
300
|
fpPanel?: string;
|
|
289
301
|
promotionId?: string;
|
|
290
302
|
}): Paginator;
|
|
303
|
+
/**
|
|
304
|
+
* @param {Object} arg - Arg object.
|
|
305
|
+
* @param {OverrideCheckoutReq} arg.body
|
|
306
|
+
* @returns {Promise<OverrideCheckoutResponse>} - Success response
|
|
307
|
+
* @summary: Create Fynd order with overriding cart details
|
|
308
|
+
* @description: Generate Fynd order while overriding cart details sent with provided `cart_items`
|
|
309
|
+
*/
|
|
310
|
+
overrideCart({ body }?: {
|
|
311
|
+
body: OverrideCheckoutReq;
|
|
312
|
+
}): Promise<OverrideCheckoutResponse>;
|
|
291
313
|
/**
|
|
292
314
|
* @param {Object} arg - Arg object.
|
|
293
315
|
* @param {string} arg.cartId - Current Cart _id
|