@gofynd/fdk-client-javascript 1.3.6-beta.2 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.d.ts +11 -3
- package/sdk/application/ApplicationConfig.js +21 -3
- package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +232 -116
- package/sdk/application/Cart/CartApplicationValidator.d.ts +2 -0
- package/sdk/application/Cart/CartApplicationValidator.js +2 -0
- package/sdk/application/Catalog/CatalogApplicationClient.js +244 -121
- package/sdk/application/Common/CommonApplicationClient.js +20 -9
- package/sdk/application/Communication/CommunicationApplicationClient.js +28 -13
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +132 -65
- package/sdk/application/Content/ContentApplicationClient.js +156 -77
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +28 -13
- package/sdk/application/Lead/LeadApplicationClient.js +60 -29
- package/sdk/application/Logistic/LogisticApplicationClient.js +44 -21
- package/sdk/application/Order/OrderApplicationClient.js +100 -49
- package/sdk/application/Payment/PaymentApplicationClient.js +340 -169
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +1 -1
- package/sdk/application/PosCart/PosCartApplicationClient.js +224 -112
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +2 -0
- package/sdk/application/PosCart/PosCartApplicationValidator.js +2 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +60 -29
- package/sdk/application/Share/ShareApplicationClient.js +60 -29
- package/sdk/application/Theme/ThemeApplicationClient.js +36 -17
- package/sdk/application/User/UserApplicationClient.js +324 -161
- package/sdk/common/FDKError.d.ts +4 -0
- package/sdk/common/FDKError.js +9 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +16 -40
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +160 -38
- package/sdk/partner/PartnerConfig.d.ts +10 -0
- package/sdk/partner/PartnerConfig.js +10 -1
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +96 -199
- package/sdk/partner/Theme/ThemePartnerClient.js +935 -170
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +36 -17
- package/sdk/platform/Billing/BillingPlatformClient.js +140 -69
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +460 -229
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +2 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +2 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +512 -256
- package/sdk/platform/Catalog/CatalogPlatformClient.js +620 -309
- package/sdk/platform/Common/CommonPlatformClient.js +20 -9
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +472 -236
- package/sdk/platform/Communication/CommunicationPlatformClient.js +12 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +14 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.js +16 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +116 -57
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +256 -128
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +148 -73
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +552 -276
- package/sdk/platform/Discount/DiscountPlatformClient.js +92 -45
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +88 -44
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +52 -25
- package/sdk/platform/Finance/FinancePlatformClient.js +196 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +100 -49
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +104 -52
- package/sdk/platform/Lead/LeadPlatformClient.js +92 -45
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +26 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +239 -5
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +57 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +55 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformClient.js +356 -254
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +1 -20
- package/sdk/platform/Order/OrderPlatformValidator.js +0 -15
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +16 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +336 -168
- package/sdk/platform/Payment/PaymentPlatformClient.js +84 -41
- package/sdk/platform/PlatformConfig.d.ts +10 -0
- package/sdk/platform/PlatformConfig.js +10 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +96 -48
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +112 -56
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +148 -73
- package/sdk/platform/Share/SharePlatformApplicationClient.js +40 -20
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +224 -112
- package/sdk/platform/Theme/ThemePlatformClient.js +28 -13
- package/sdk/platform/User/UserPlatformApplicationClient.js +144 -72
- package/sdk/platform/Webhook/WebhookPlatformClient.js +132 -65
- package/sdk/public/Configuration/ConfigurationPublicClient.js +20 -9
- package/sdk/public/Inventory/InventoryPublicClient.js +52 -25
- package/sdk/public/Partner/PartnerPublicClient.js +12 -5
- package/sdk/public/PublicConfig.d.ts +11 -1
- package/sdk/public/PublicConfig.js +10 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +20 -9
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
214
214
|
The above code will log the curl command in the console
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.3.
|
|
217
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.3.7' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
218
218
|
Active Theme: Emerge
|
|
219
219
|
```
|
|
220
220
|
|
package/package.json
CHANGED
|
@@ -28,7 +28,11 @@ declare class ApplicationConfig {
|
|
|
28
28
|
* options: TRACE, DEBUG, INFO, WARN, ERROR. Default is `'ERROR'`
|
|
29
29
|
* @param {LocationObject} [_conf.locationDetails] - The location details.
|
|
30
30
|
* @param {string} [_conf.currencyCode='INR'] - The currency code. Default is `'INR'`
|
|
31
|
-
* @param {object} [
|
|
31
|
+
* @param {object} [options] - Additional options.
|
|
32
|
+
* @param {boolean} [options.strictResponseCheck=false] - Strict check for
|
|
33
|
+
* response schema validation. Passing this `true` will check response
|
|
34
|
+
* against response schema and throw FDKResponseValidationError if it
|
|
35
|
+
* doesn't match. Default is `false`
|
|
32
36
|
*/
|
|
33
37
|
constructor(_conf: {
|
|
34
38
|
applicationID: string;
|
|
@@ -37,10 +41,14 @@ declare class ApplicationConfig {
|
|
|
37
41
|
logLevel?: "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
|
|
38
42
|
locationDetails?: LocationObject;
|
|
39
43
|
currencyCode?: string;
|
|
40
|
-
},
|
|
44
|
+
}, options?: {
|
|
45
|
+
strictResponseCheck?: boolean;
|
|
46
|
+
});
|
|
41
47
|
applicationID: string;
|
|
42
48
|
applicationToken: string;
|
|
43
|
-
|
|
49
|
+
options: {
|
|
50
|
+
strictResponseCheck: boolean;
|
|
51
|
+
};
|
|
44
52
|
domain: string;
|
|
45
53
|
logLevel: "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
|
|
46
54
|
extraHeaders: any[];
|
|
@@ -32,12 +32,19 @@ class ApplicationConfig {
|
|
|
32
32
|
* options: TRACE, DEBUG, INFO, WARN, ERROR. Default is `'ERROR'`
|
|
33
33
|
* @param {LocationObject} [_conf.locationDetails] - The location details.
|
|
34
34
|
* @param {string} [_conf.currencyCode='INR'] - The currency code. Default is `'INR'`
|
|
35
|
-
* @param {object} [
|
|
35
|
+
* @param {object} [options] - Additional options.
|
|
36
|
+
* @param {boolean} [options.strictResponseCheck=false] - Strict check for
|
|
37
|
+
* response schema validation. Passing this `true` will check response
|
|
38
|
+
* against response schema and throw FDKResponseValidationError if it
|
|
39
|
+
* doesn't match. Default is `false`
|
|
36
40
|
*/
|
|
37
|
-
constructor(_conf,
|
|
41
|
+
constructor(_conf, options) {
|
|
38
42
|
this.applicationID = _conf.applicationID || "";
|
|
39
43
|
this.applicationToken = _conf.applicationToken || "";
|
|
40
|
-
this.
|
|
44
|
+
this.options = {
|
|
45
|
+
...{ strictResponseCheck: false },
|
|
46
|
+
...options,
|
|
47
|
+
};
|
|
41
48
|
this.domain = _conf.domain || "https://api.fynd.com";
|
|
42
49
|
this.logLevel = _conf.logLevel || "ERROR";
|
|
43
50
|
this.setLogLevel(this.logLevel);
|
|
@@ -85,6 +92,17 @@ class ApplicationConfig {
|
|
|
85
92
|
Logger({ level: "ERROR", message: "Invalid Application Token" });
|
|
86
93
|
throw new FDKInvalidCredentialError("Invalid Application Token");
|
|
87
94
|
}
|
|
95
|
+
if (typeof this.options.strictResponseCheck !== "boolean") {
|
|
96
|
+
Logger({ level: "ERROR", message: "Invalid Application Token" });
|
|
97
|
+
Logger({
|
|
98
|
+
level: "ERROR",
|
|
99
|
+
message:
|
|
100
|
+
"Invalid Value for options.strictResponseCheck, provide boolean value",
|
|
101
|
+
});
|
|
102
|
+
throw new FDKInvalidCredentialError(
|
|
103
|
+
"Invalid Value for options.strictResponseCheck, provide boolean value"
|
|
104
|
+
);
|
|
105
|
+
}
|
|
88
106
|
}
|
|
89
107
|
}
|
|
90
108
|
|
|
@@ -144,7 +144,7 @@ declare class Cart {
|
|
|
144
144
|
* @summary: Fetch all items added to the cart
|
|
145
145
|
* @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
|
|
146
146
|
*/
|
|
147
|
-
getCart({ id, i, b, assignCardId, areaCode, buyNow, requestHeaders }?: CartApplicationValidator.GetCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.CartDetailResponse>;
|
|
147
|
+
getCart({ id, i, b, c, assignCardId, areaCode, buyNow, requestHeaders }?: CartApplicationValidator.GetCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.CartDetailResponse>;
|
|
148
148
|
/**
|
|
149
149
|
* @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
|
|
150
150
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const constructUrl = require("../constructUrl");
|
|
4
7
|
const Paginator = require("../../common/Paginator");
|
|
5
8
|
const CartApplicationValidator = require("./CartApplicationValidator");
|
|
@@ -121,10 +124,14 @@ class Cart {
|
|
|
121
124
|
});
|
|
122
125
|
|
|
123
126
|
if (res_error) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
128
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
129
|
+
} else {
|
|
130
|
+
Logger({
|
|
131
|
+
level: "WARN",
|
|
132
|
+
message: `Response Validation Warnings for application > Cart > addAddress \n ${res_error}`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
return response;
|
|
@@ -200,10 +207,14 @@ class Cart {
|
|
|
200
207
|
});
|
|
201
208
|
|
|
202
209
|
if (res_error) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
211
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
212
|
+
} else {
|
|
213
|
+
Logger({
|
|
214
|
+
level: "WARN",
|
|
215
|
+
message: `Response Validation Warnings for application > Cart > addItems \n ${res_error}`,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
207
218
|
}
|
|
208
219
|
|
|
209
220
|
return response;
|
|
@@ -277,10 +288,14 @@ class Cart {
|
|
|
277
288
|
});
|
|
278
289
|
|
|
279
290
|
if (res_error) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
291
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
292
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
293
|
+
} else {
|
|
294
|
+
Logger({
|
|
295
|
+
level: "WARN",
|
|
296
|
+
message: `Response Validation Warnings for application > Cart > applyCoupon \n ${res_error}`,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
284
299
|
}
|
|
285
300
|
|
|
286
301
|
return response;
|
|
@@ -355,10 +370,14 @@ class Cart {
|
|
|
355
370
|
});
|
|
356
371
|
|
|
357
372
|
if (res_error) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
373
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
374
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
375
|
+
} else {
|
|
376
|
+
Logger({
|
|
377
|
+
level: "WARN",
|
|
378
|
+
message: `Response Validation Warnings for application > Cart > applyRewardPoints \n ${res_error}`,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
362
381
|
}
|
|
363
382
|
|
|
364
383
|
return response;
|
|
@@ -430,10 +449,14 @@ class Cart {
|
|
|
430
449
|
});
|
|
431
450
|
|
|
432
451
|
if (res_error) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
452
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
453
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
454
|
+
} else {
|
|
455
|
+
Logger({
|
|
456
|
+
level: "WARN",
|
|
457
|
+
message: `Response Validation Warnings for application > Cart > checkoutCart \n ${res_error}`,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
437
460
|
}
|
|
438
461
|
|
|
439
462
|
return response;
|
|
@@ -505,10 +528,14 @@ class Cart {
|
|
|
505
528
|
});
|
|
506
529
|
|
|
507
530
|
if (res_error) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
531
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
532
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
533
|
+
} else {
|
|
534
|
+
Logger({
|
|
535
|
+
level: "WARN",
|
|
536
|
+
message: `Response Validation Warnings for application > Cart > checkoutCartV2 \n ${res_error}`,
|
|
537
|
+
});
|
|
538
|
+
}
|
|
512
539
|
}
|
|
513
540
|
|
|
514
541
|
return response;
|
|
@@ -579,10 +606,14 @@ class Cart {
|
|
|
579
606
|
});
|
|
580
607
|
|
|
581
608
|
if (res_error) {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
609
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
610
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
611
|
+
} else {
|
|
612
|
+
Logger({
|
|
613
|
+
level: "WARN",
|
|
614
|
+
message: `Response Validation Warnings for application > Cart > deleteCart \n ${res_error}`,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
586
617
|
}
|
|
587
618
|
|
|
588
619
|
return response;
|
|
@@ -668,10 +699,14 @@ class Cart {
|
|
|
668
699
|
});
|
|
669
700
|
|
|
670
701
|
if (res_error) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
702
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
703
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
704
|
+
} else {
|
|
705
|
+
Logger({
|
|
706
|
+
level: "WARN",
|
|
707
|
+
message: `Response Validation Warnings for application > Cart > getAddressById \n ${res_error}`,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
675
710
|
}
|
|
676
711
|
|
|
677
712
|
return response;
|
|
@@ -756,10 +791,14 @@ class Cart {
|
|
|
756
791
|
});
|
|
757
792
|
|
|
758
793
|
if (res_error) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
794
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
795
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
796
|
+
} else {
|
|
797
|
+
Logger({
|
|
798
|
+
level: "WARN",
|
|
799
|
+
message: `Response Validation Warnings for application > Cart > getAddresses \n ${res_error}`,
|
|
800
|
+
});
|
|
801
|
+
}
|
|
763
802
|
}
|
|
764
803
|
|
|
765
804
|
return response;
|
|
@@ -834,10 +873,14 @@ class Cart {
|
|
|
834
873
|
});
|
|
835
874
|
|
|
836
875
|
if (res_error) {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
876
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
877
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
878
|
+
} else {
|
|
879
|
+
Logger({
|
|
880
|
+
level: "WARN",
|
|
881
|
+
message: `Response Validation Warnings for application > Cart > getBulkDiscountOffers \n ${res_error}`,
|
|
882
|
+
});
|
|
883
|
+
}
|
|
841
884
|
}
|
|
842
885
|
|
|
843
886
|
return response;
|
|
@@ -853,13 +896,13 @@ class Cart {
|
|
|
853
896
|
* @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
|
|
854
897
|
*/
|
|
855
898
|
async getCart(
|
|
856
|
-
{ id, i, b, assignCardId, areaCode, buyNow, requestHeaders } = {
|
|
899
|
+
{ id, i, b, c, assignCardId, areaCode, buyNow, requestHeaders } = {
|
|
857
900
|
requestHeaders: {},
|
|
858
901
|
},
|
|
859
902
|
{ responseHeaders } = { responseHeaders: false }
|
|
860
903
|
) {
|
|
861
904
|
const { error } = CartApplicationValidator.getCart().validate(
|
|
862
|
-
{ id, i, b, assignCardId, areaCode, buyNow },
|
|
905
|
+
{ id, i, b, c, assignCardId, areaCode, buyNow },
|
|
863
906
|
{ abortEarly: false, allowUnknown: true }
|
|
864
907
|
);
|
|
865
908
|
if (error) {
|
|
@@ -868,7 +911,7 @@ class Cart {
|
|
|
868
911
|
|
|
869
912
|
// Showing warrnings if extra unknown parameters are found
|
|
870
913
|
const { error: warrning } = CartApplicationValidator.getCart().validate(
|
|
871
|
-
{ id, i, b, assignCardId, areaCode, buyNow },
|
|
914
|
+
{ id, i, b, c, assignCardId, areaCode, buyNow },
|
|
872
915
|
{ abortEarly: false, allowUnknown: false }
|
|
873
916
|
);
|
|
874
917
|
if (warrning) {
|
|
@@ -882,6 +925,7 @@ class Cart {
|
|
|
882
925
|
query_params["id"] = id;
|
|
883
926
|
query_params["i"] = i;
|
|
884
927
|
query_params["b"] = b;
|
|
928
|
+
query_params["c"] = c;
|
|
885
929
|
query_params["assign_card_id"] = assignCardId;
|
|
886
930
|
query_params["area_code"] = areaCode;
|
|
887
931
|
query_params["buy_now"] = buyNow;
|
|
@@ -914,10 +958,14 @@ class Cart {
|
|
|
914
958
|
});
|
|
915
959
|
|
|
916
960
|
if (res_error) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
961
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
962
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
963
|
+
} else {
|
|
964
|
+
Logger({
|
|
965
|
+
level: "WARN",
|
|
966
|
+
message: `Response Validation Warnings for application > Cart > getCart \n ${res_error}`,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
921
969
|
}
|
|
922
970
|
|
|
923
971
|
return response;
|
|
@@ -986,10 +1034,14 @@ class Cart {
|
|
|
986
1034
|
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
987
1035
|
|
|
988
1036
|
if (res_error) {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1037
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1038
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1039
|
+
} else {
|
|
1040
|
+
Logger({
|
|
1041
|
+
level: "WARN",
|
|
1042
|
+
message: `Response Validation Warnings for application > Cart > getCartLastModified \n ${res_error}`,
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
993
1045
|
}
|
|
994
1046
|
|
|
995
1047
|
return response;
|
|
@@ -1061,10 +1113,14 @@ class Cart {
|
|
|
1061
1113
|
});
|
|
1062
1114
|
|
|
1063
1115
|
if (res_error) {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1116
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1117
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1118
|
+
} else {
|
|
1119
|
+
Logger({
|
|
1120
|
+
level: "WARN",
|
|
1121
|
+
message: `Response Validation Warnings for application > Cart > getCartShareLink \n ${res_error}`,
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1068
1124
|
}
|
|
1069
1125
|
|
|
1070
1126
|
return response;
|
|
@@ -1135,10 +1191,14 @@ class Cart {
|
|
|
1135
1191
|
});
|
|
1136
1192
|
|
|
1137
1193
|
if (res_error) {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1194
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1195
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1196
|
+
} else {
|
|
1197
|
+
Logger({
|
|
1198
|
+
level: "WARN",
|
|
1199
|
+
message: `Response Validation Warnings for application > Cart > getCartSharedItems \n ${res_error}`,
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1142
1202
|
}
|
|
1143
1203
|
|
|
1144
1204
|
return response;
|
|
@@ -1209,10 +1269,14 @@ class Cart {
|
|
|
1209
1269
|
});
|
|
1210
1270
|
|
|
1211
1271
|
if (res_error) {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1272
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1273
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1274
|
+
} else {
|
|
1275
|
+
Logger({
|
|
1276
|
+
level: "WARN",
|
|
1277
|
+
message: `Response Validation Warnings for application > Cart > getCoupons \n ${res_error}`,
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1216
1280
|
}
|
|
1217
1281
|
|
|
1218
1282
|
return response;
|
|
@@ -1285,10 +1349,14 @@ class Cart {
|
|
|
1285
1349
|
});
|
|
1286
1350
|
|
|
1287
1351
|
if (res_error) {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1352
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1353
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1354
|
+
} else {
|
|
1355
|
+
Logger({
|
|
1356
|
+
level: "WARN",
|
|
1357
|
+
message: `Response Validation Warnings for application > Cart > getItemCount \n ${res_error}`,
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1292
1360
|
}
|
|
1293
1361
|
|
|
1294
1362
|
return response;
|
|
@@ -1365,10 +1433,14 @@ class Cart {
|
|
|
1365
1433
|
});
|
|
1366
1434
|
|
|
1367
1435
|
if (res_error) {
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1436
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1437
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1438
|
+
} else {
|
|
1439
|
+
Logger({
|
|
1440
|
+
level: "WARN",
|
|
1441
|
+
message: `Response Validation Warnings for application > Cart > getLadderOffers \n ${res_error}`,
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1372
1444
|
}
|
|
1373
1445
|
|
|
1374
1446
|
return response;
|
|
@@ -1445,10 +1517,14 @@ class Cart {
|
|
|
1445
1517
|
});
|
|
1446
1518
|
|
|
1447
1519
|
if (res_error) {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1520
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1521
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1522
|
+
} else {
|
|
1523
|
+
Logger({
|
|
1524
|
+
level: "WARN",
|
|
1525
|
+
message: `Response Validation Warnings for application > Cart > getPromotionOffers \n ${res_error}`,
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1452
1528
|
}
|
|
1453
1529
|
|
|
1454
1530
|
return response;
|
|
@@ -1527,10 +1603,14 @@ class Cart {
|
|
|
1527
1603
|
});
|
|
1528
1604
|
|
|
1529
1605
|
if (res_error) {
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1606
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1607
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1608
|
+
} else {
|
|
1609
|
+
Logger({
|
|
1610
|
+
level: "WARN",
|
|
1611
|
+
message: `Response Validation Warnings for application > Cart > getShipments \n ${res_error}`,
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1534
1614
|
}
|
|
1535
1615
|
|
|
1536
1616
|
return response;
|
|
@@ -1601,10 +1681,14 @@ class Cart {
|
|
|
1601
1681
|
});
|
|
1602
1682
|
|
|
1603
1683
|
if (res_error) {
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1684
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1685
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1686
|
+
} else {
|
|
1687
|
+
Logger({
|
|
1688
|
+
level: "WARN",
|
|
1689
|
+
message: `Response Validation Warnings for application > Cart > removeAddress \n ${res_error}`,
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1608
1692
|
}
|
|
1609
1693
|
|
|
1610
1694
|
return response;
|
|
@@ -1677,10 +1761,14 @@ class Cart {
|
|
|
1677
1761
|
});
|
|
1678
1762
|
|
|
1679
1763
|
if (res_error) {
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1764
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1765
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1766
|
+
} else {
|
|
1767
|
+
Logger({
|
|
1768
|
+
level: "WARN",
|
|
1769
|
+
message: `Response Validation Warnings for application > Cart > removeCoupon \n ${res_error}`,
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1684
1772
|
}
|
|
1685
1773
|
|
|
1686
1774
|
return response;
|
|
@@ -1755,10 +1843,14 @@ class Cart {
|
|
|
1755
1843
|
});
|
|
1756
1844
|
|
|
1757
1845
|
if (res_error) {
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1846
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1847
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1848
|
+
} else {
|
|
1849
|
+
Logger({
|
|
1850
|
+
level: "WARN",
|
|
1851
|
+
message: `Response Validation Warnings for application > Cart > selectAddress \n ${res_error}`,
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1762
1854
|
}
|
|
1763
1855
|
|
|
1764
1856
|
return response;
|
|
@@ -1831,10 +1923,14 @@ class Cart {
|
|
|
1831
1923
|
});
|
|
1832
1924
|
|
|
1833
1925
|
if (res_error) {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1926
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1927
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1928
|
+
} else {
|
|
1929
|
+
Logger({
|
|
1930
|
+
level: "WARN",
|
|
1931
|
+
message: `Response Validation Warnings for application > Cart > selectPaymentMode \n ${res_error}`,
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1838
1934
|
}
|
|
1839
1935
|
|
|
1840
1936
|
return response;
|
|
@@ -1905,10 +2001,14 @@ class Cart {
|
|
|
1905
2001
|
});
|
|
1906
2002
|
|
|
1907
2003
|
if (res_error) {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
2004
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
2005
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2006
|
+
} else {
|
|
2007
|
+
Logger({
|
|
2008
|
+
level: "WARN",
|
|
2009
|
+
message: `Response Validation Warnings for application > Cart > updateAddress \n ${res_error}`,
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
1912
2012
|
}
|
|
1913
2013
|
|
|
1914
2014
|
return response;
|
|
@@ -1985,10 +2085,14 @@ class Cart {
|
|
|
1985
2085
|
});
|
|
1986
2086
|
|
|
1987
2087
|
if (res_error) {
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2088
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
2089
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2090
|
+
} else {
|
|
2091
|
+
Logger({
|
|
2092
|
+
level: "WARN",
|
|
2093
|
+
message: `Response Validation Warnings for application > Cart > updateCart \n ${res_error}`,
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
1992
2096
|
}
|
|
1993
2097
|
|
|
1994
2098
|
return response;
|
|
@@ -2061,10 +2165,14 @@ class Cart {
|
|
|
2061
2165
|
});
|
|
2062
2166
|
|
|
2063
2167
|
if (res_error) {
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2168
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
2169
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2170
|
+
} else {
|
|
2171
|
+
Logger({
|
|
2172
|
+
level: "WARN",
|
|
2173
|
+
message: `Response Validation Warnings for application > Cart > updateCartMeta \n ${res_error}`,
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2068
2176
|
}
|
|
2069
2177
|
|
|
2070
2178
|
return response;
|
|
@@ -2137,10 +2245,14 @@ class Cart {
|
|
|
2137
2245
|
});
|
|
2138
2246
|
|
|
2139
2247
|
if (res_error) {
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2248
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
2249
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2250
|
+
} else {
|
|
2251
|
+
Logger({
|
|
2252
|
+
level: "WARN",
|
|
2253
|
+
message: `Response Validation Warnings for application > Cart > updateCartWithSharedItems \n ${res_error}`,
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2144
2256
|
}
|
|
2145
2257
|
|
|
2146
2258
|
return response;
|
|
@@ -2261,10 +2373,14 @@ class Cart {
|
|
|
2261
2373
|
});
|
|
2262
2374
|
|
|
2263
2375
|
if (res_error) {
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2376
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
2377
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2378
|
+
} else {
|
|
2379
|
+
Logger({
|
|
2380
|
+
level: "WARN",
|
|
2381
|
+
message: `Response Validation Warnings for application > Cart > validateCouponForPayment \n ${res_error}`,
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2268
2384
|
}
|
|
2269
2385
|
|
|
2270
2386
|
return response;
|