@gofynd/fdk-client-javascript 1.3.6-beta.2 → 1.3.6
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.js +228 -113
- 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.js +220 -109
- 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.js +456 -228
- 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
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const Paginator = require("../../common/Paginator");
|
|
4
7
|
const OrderPlatformValidator = require("./OrderPlatformValidator");
|
|
5
8
|
const OrderPlatformModel = require("./OrderPlatformModel");
|
|
@@ -77,10 +80,14 @@ class Order {
|
|
|
77
80
|
});
|
|
78
81
|
|
|
79
82
|
if (res_error) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
84
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
85
|
+
} else {
|
|
86
|
+
Logger({
|
|
87
|
+
level: "WARN",
|
|
88
|
+
message: `Response Validation Warnings for platform > Order > attachOrderUser \n ${res_error}`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
return response;
|
|
@@ -152,10 +159,14 @@ class Order {
|
|
|
152
159
|
});
|
|
153
160
|
|
|
154
161
|
if (res_error) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
163
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
164
|
+
} else {
|
|
165
|
+
Logger({
|
|
166
|
+
level: "WARN",
|
|
167
|
+
message: `Response Validation Warnings for platform > Order > checkOrderStatus \n ${res_error}`,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
159
170
|
}
|
|
160
171
|
|
|
161
172
|
return response;
|
|
@@ -242,10 +253,14 @@ class Order {
|
|
|
242
253
|
});
|
|
243
254
|
|
|
244
255
|
if (res_error) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
256
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
257
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
258
|
+
} else {
|
|
259
|
+
Logger({
|
|
260
|
+
level: "WARN",
|
|
261
|
+
message: `Response Validation Warnings for platform > Order > click2Call \n ${res_error}`,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
249
264
|
}
|
|
250
265
|
|
|
251
266
|
return response;
|
|
@@ -318,10 +333,14 @@ class Order {
|
|
|
318
333
|
);
|
|
319
334
|
|
|
320
335
|
if (res_error) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
336
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
337
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
338
|
+
} else {
|
|
339
|
+
Logger({
|
|
340
|
+
level: "WARN",
|
|
341
|
+
message: `Response Validation Warnings for platform > Order > createChannelConfig \n ${res_error}`,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
325
344
|
}
|
|
326
345
|
|
|
327
346
|
return response;
|
|
@@ -391,10 +410,14 @@ class Order {
|
|
|
391
410
|
});
|
|
392
411
|
|
|
393
412
|
if (res_error) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
413
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
414
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
415
|
+
} else {
|
|
416
|
+
Logger({
|
|
417
|
+
level: "WARN",
|
|
418
|
+
message: `Response Validation Warnings for platform > Order > createOrder \n ${res_error}`,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
398
421
|
}
|
|
399
422
|
|
|
400
423
|
return response;
|
|
@@ -466,10 +489,14 @@ class Order {
|
|
|
466
489
|
});
|
|
467
490
|
|
|
468
491
|
if (res_error) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
492
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
493
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
494
|
+
} else {
|
|
495
|
+
Logger({
|
|
496
|
+
level: "WARN",
|
|
497
|
+
message: `Response Validation Warnings for platform > Order > dispatchManifest \n ${res_error}`,
|
|
498
|
+
});
|
|
499
|
+
}
|
|
473
500
|
}
|
|
474
501
|
|
|
475
502
|
return response;
|
|
@@ -544,10 +571,14 @@ class Order {
|
|
|
544
571
|
});
|
|
545
572
|
|
|
546
573
|
if (res_error) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
574
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
575
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
576
|
+
} else {
|
|
577
|
+
Logger({
|
|
578
|
+
level: "WARN",
|
|
579
|
+
message: `Response Validation Warnings for platform > Order > downloadBulkActionTemplate \n ${res_error}`,
|
|
580
|
+
});
|
|
581
|
+
}
|
|
551
582
|
}
|
|
552
583
|
|
|
553
584
|
return response;
|
|
@@ -620,10 +651,14 @@ class Order {
|
|
|
620
651
|
);
|
|
621
652
|
|
|
622
653
|
if (res_error) {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
654
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
655
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
656
|
+
} else {
|
|
657
|
+
Logger({
|
|
658
|
+
level: "WARN",
|
|
659
|
+
message: `Response Validation Warnings for platform > Order > downloadLanesReport \n ${res_error}`,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
627
662
|
}
|
|
628
663
|
|
|
629
664
|
return response;
|
|
@@ -693,10 +728,14 @@ class Order {
|
|
|
693
728
|
});
|
|
694
729
|
|
|
695
730
|
if (res_error) {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
731
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
732
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
733
|
+
} else {
|
|
734
|
+
Logger({
|
|
735
|
+
level: "WARN",
|
|
736
|
+
message: `Response Validation Warnings for platform > Order > eInvoiceRetry \n ${res_error}`,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
700
739
|
}
|
|
701
740
|
|
|
702
741
|
return response;
|
|
@@ -772,10 +811,14 @@ class Order {
|
|
|
772
811
|
);
|
|
773
812
|
|
|
774
813
|
if (res_error) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
814
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
815
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
816
|
+
} else {
|
|
817
|
+
Logger({
|
|
818
|
+
level: "WARN",
|
|
819
|
+
message: `Response Validation Warnings for platform > Order > fetchCreditBalanceDetail \n ${res_error}`,
|
|
820
|
+
});
|
|
821
|
+
}
|
|
779
822
|
}
|
|
780
823
|
|
|
781
824
|
return response;
|
|
@@ -848,10 +891,14 @@ class Order {
|
|
|
848
891
|
);
|
|
849
892
|
|
|
850
893
|
if (res_error) {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
894
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
895
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
896
|
+
} else {
|
|
897
|
+
Logger({
|
|
898
|
+
level: "WARN",
|
|
899
|
+
message: `Response Validation Warnings for platform > Order > fetchRefundModeConfig \n ${res_error}`,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
855
902
|
}
|
|
856
903
|
|
|
857
904
|
return response;
|
|
@@ -934,10 +981,14 @@ class Order {
|
|
|
934
981
|
);
|
|
935
982
|
|
|
936
983
|
if (res_error) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
984
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
985
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
986
|
+
} else {
|
|
987
|
+
Logger({
|
|
988
|
+
level: "WARN",
|
|
989
|
+
message: `Response Validation Warnings for platform > Order > generatePOSReceiptByOrderId \n ${res_error}`,
|
|
990
|
+
});
|
|
991
|
+
}
|
|
941
992
|
}
|
|
942
993
|
|
|
943
994
|
return response;
|
|
@@ -1017,10 +1068,14 @@ class Order {
|
|
|
1017
1068
|
);
|
|
1018
1069
|
|
|
1019
1070
|
if (res_error) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1071
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1072
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1073
|
+
} else {
|
|
1074
|
+
Logger({
|
|
1075
|
+
level: "WARN",
|
|
1076
|
+
message: `Response Validation Warnings for platform > Order > getAllowedStateTransition \n ${res_error}`,
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1024
1079
|
}
|
|
1025
1080
|
|
|
1026
1081
|
return response;
|
|
@@ -1093,10 +1148,14 @@ class Order {
|
|
|
1093
1148
|
});
|
|
1094
1149
|
|
|
1095
1150
|
if (res_error) {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1151
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1152
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1153
|
+
} else {
|
|
1154
|
+
Logger({
|
|
1155
|
+
level: "WARN",
|
|
1156
|
+
message: `Response Validation Warnings for platform > Order > getAnnouncements \n ${res_error}`,
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1100
1159
|
}
|
|
1101
1160
|
|
|
1102
1161
|
return response;
|
|
@@ -1174,10 +1233,14 @@ class Order {
|
|
|
1174
1233
|
});
|
|
1175
1234
|
|
|
1176
1235
|
if (res_error) {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1236
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1237
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1238
|
+
} else {
|
|
1239
|
+
Logger({
|
|
1240
|
+
level: "WARN",
|
|
1241
|
+
message: `Response Validation Warnings for platform > Order > getBagById \n ${res_error}`,
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1181
1244
|
}
|
|
1182
1245
|
|
|
1183
1246
|
return response;
|
|
@@ -1283,10 +1346,14 @@ class Order {
|
|
|
1283
1346
|
});
|
|
1284
1347
|
|
|
1285
1348
|
if (res_error) {
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1349
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1350
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1351
|
+
} else {
|
|
1352
|
+
Logger({
|
|
1353
|
+
level: "WARN",
|
|
1354
|
+
message: `Response Validation Warnings for platform > Order > getBags \n ${res_error}`,
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1290
1357
|
}
|
|
1291
1358
|
|
|
1292
1359
|
return response;
|
|
@@ -1355,10 +1422,14 @@ class Order {
|
|
|
1355
1422
|
});
|
|
1356
1423
|
|
|
1357
1424
|
if (res_error) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1425
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1426
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1427
|
+
} else {
|
|
1428
|
+
Logger({
|
|
1429
|
+
level: "WARN",
|
|
1430
|
+
message: `Response Validation Warnings for platform > Order > getBulkActionTemplate \n ${res_error}`,
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1362
1433
|
}
|
|
1363
1434
|
|
|
1364
1435
|
return response;
|
|
@@ -1480,10 +1551,14 @@ class Order {
|
|
|
1480
1551
|
});
|
|
1481
1552
|
|
|
1482
1553
|
if (res_error) {
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1554
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1555
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1556
|
+
} else {
|
|
1557
|
+
Logger({
|
|
1558
|
+
level: "WARN",
|
|
1559
|
+
message: `Response Validation Warnings for platform > Order > getBulkShipmentExcelFile \n ${res_error}`,
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1487
1562
|
}
|
|
1488
1563
|
|
|
1489
1564
|
return response;
|
|
@@ -1551,10 +1626,14 @@ class Order {
|
|
|
1551
1626
|
});
|
|
1552
1627
|
|
|
1553
1628
|
if (res_error) {
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1629
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1630
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1631
|
+
} else {
|
|
1632
|
+
Logger({
|
|
1633
|
+
level: "WARN",
|
|
1634
|
+
message: `Response Validation Warnings for platform > Order > getChannelConfig \n ${res_error}`,
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1558
1637
|
}
|
|
1559
1638
|
|
|
1560
1639
|
return response;
|
|
@@ -1692,10 +1771,14 @@ class Order {
|
|
|
1692
1771
|
});
|
|
1693
1772
|
|
|
1694
1773
|
if (res_error) {
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1774
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1775
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1776
|
+
} else {
|
|
1777
|
+
Logger({
|
|
1778
|
+
level: "WARN",
|
|
1779
|
+
message: `Response Validation Warnings for platform > Order > getLaneConfig \n ${res_error}`,
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1699
1782
|
}
|
|
1700
1783
|
|
|
1701
1784
|
return response;
|
|
@@ -1769,10 +1852,14 @@ class Order {
|
|
|
1769
1852
|
});
|
|
1770
1853
|
|
|
1771
1854
|
if (res_error) {
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1855
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1856
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1857
|
+
} else {
|
|
1858
|
+
Logger({
|
|
1859
|
+
level: "WARN",
|
|
1860
|
+
message: `Response Validation Warnings for platform > Order > getOrderById \n ${res_error}`,
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1776
1863
|
}
|
|
1777
1864
|
|
|
1778
1865
|
return response;
|
|
@@ -1922,10 +2009,14 @@ class Order {
|
|
|
1922
2009
|
});
|
|
1923
2010
|
|
|
1924
2011
|
if (res_error) {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2012
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2013
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2014
|
+
} else {
|
|
2015
|
+
Logger({
|
|
2016
|
+
level: "WARN",
|
|
2017
|
+
message: `Response Validation Warnings for platform > Order > getOrders \n ${res_error}`,
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
1929
2020
|
}
|
|
1930
2021
|
|
|
1931
2022
|
return response;
|
|
@@ -2083,87 +2174,14 @@ class Order {
|
|
|
2083
2174
|
});
|
|
2084
2175
|
|
|
2085
2176
|
if (res_error) {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
/**
|
|
2096
|
-
* @param {OrderPlatformValidator.GetShipmentBagReasonsParam} arg - Arg object
|
|
2097
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2098
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2099
|
-
* @returns {Promise<OrderPlatformModel.ShipmentBagReasons>} - Success response
|
|
2100
|
-
* @name getShipmentBagReasons
|
|
2101
|
-
* @summary: Get reasons behind full or partial cancellation of a shipment
|
|
2102
|
-
* @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentBagReasons/).
|
|
2103
|
-
*/
|
|
2104
|
-
async getShipmentBagReasons(
|
|
2105
|
-
{ shipmentId, lineNumber, requestHeaders } = { requestHeaders: {} },
|
|
2106
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2107
|
-
) {
|
|
2108
|
-
const { error } = OrderPlatformValidator.getShipmentBagReasons().validate(
|
|
2109
|
-
{
|
|
2110
|
-
shipmentId,
|
|
2111
|
-
lineNumber,
|
|
2112
|
-
},
|
|
2113
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2114
|
-
);
|
|
2115
|
-
if (error) {
|
|
2116
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2120
|
-
const {
|
|
2121
|
-
error: warrning,
|
|
2122
|
-
} = OrderPlatformValidator.getShipmentBagReasons().validate(
|
|
2123
|
-
{
|
|
2124
|
-
shipmentId,
|
|
2125
|
-
lineNumber,
|
|
2126
|
-
},
|
|
2127
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2128
|
-
);
|
|
2129
|
-
if (warrning) {
|
|
2130
|
-
Logger({
|
|
2131
|
-
level: "WARN",
|
|
2132
|
-
message: `Parameter Validation warrnings for platform > Order > getShipmentBagReasons \n ${warrning}`,
|
|
2133
|
-
});
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
const query_params = {};
|
|
2137
|
-
|
|
2138
|
-
const xHeaders = {};
|
|
2139
|
-
|
|
2140
|
-
const response = await PlatformAPIClient.execute(
|
|
2141
|
-
this.config,
|
|
2142
|
-
"get",
|
|
2143
|
-
`/service/platform/order/v1.0/company/${this.config.companyId}/application/<application_id>/orders/shipments/<shipment_id>/line_number/<line_number>/reasons`,
|
|
2144
|
-
query_params,
|
|
2145
|
-
undefined,
|
|
2146
|
-
{ ...xHeaders, ...requestHeaders },
|
|
2147
|
-
{ responseHeaders }
|
|
2148
|
-
);
|
|
2149
|
-
|
|
2150
|
-
let responseData = response;
|
|
2151
|
-
if (responseHeaders) {
|
|
2152
|
-
responseData = response[0];
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
const {
|
|
2156
|
-
error: res_error,
|
|
2157
|
-
} = OrderPlatformModel.ShipmentBagReasons().validate(responseData, {
|
|
2158
|
-
abortEarly: false,
|
|
2159
|
-
allowUnknown: false,
|
|
2160
|
-
});
|
|
2161
|
-
|
|
2162
|
-
if (res_error) {
|
|
2163
|
-
Logger({
|
|
2164
|
-
level: "WARN",
|
|
2165
|
-
message: `Response Validation Warnnings for platform > Order > getShipmentBagReasons \n ${res_error}`,
|
|
2166
|
-
});
|
|
2177
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2178
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2179
|
+
} else {
|
|
2180
|
+
Logger({
|
|
2181
|
+
level: "WARN",
|
|
2182
|
+
message: `Response Validation Warnings for platform > Order > getRoleBasedActions \n ${res_error}`,
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2167
2185
|
}
|
|
2168
2186
|
|
|
2169
2187
|
return response;
|
|
@@ -2239,10 +2257,14 @@ class Order {
|
|
|
2239
2257
|
});
|
|
2240
2258
|
|
|
2241
2259
|
if (res_error) {
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2260
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2261
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2262
|
+
} else {
|
|
2263
|
+
Logger({
|
|
2264
|
+
level: "WARN",
|
|
2265
|
+
message: `Response Validation Warnings for platform > Order > getShipmentById \n ${res_error}`,
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2246
2268
|
}
|
|
2247
2269
|
|
|
2248
2270
|
return response;
|
|
@@ -2318,10 +2340,14 @@ class Order {
|
|
|
2318
2340
|
});
|
|
2319
2341
|
|
|
2320
2342
|
if (res_error) {
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2343
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2344
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2345
|
+
} else {
|
|
2346
|
+
Logger({
|
|
2347
|
+
level: "WARN",
|
|
2348
|
+
message: `Response Validation Warnings for platform > Order > getShipmentHistory \n ${res_error}`,
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2325
2351
|
}
|
|
2326
2352
|
|
|
2327
2353
|
return response;
|
|
@@ -2398,10 +2424,14 @@ class Order {
|
|
|
2398
2424
|
);
|
|
2399
2425
|
|
|
2400
2426
|
if (res_error) {
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2427
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2428
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2429
|
+
} else {
|
|
2430
|
+
Logger({
|
|
2431
|
+
level: "WARN",
|
|
2432
|
+
message: `Response Validation Warnings for platform > Order > getShipmentReasons \n ${res_error}`,
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2405
2435
|
}
|
|
2406
2436
|
|
|
2407
2437
|
return response;
|
|
@@ -2585,10 +2615,14 @@ class Order {
|
|
|
2585
2615
|
);
|
|
2586
2616
|
|
|
2587
2617
|
if (res_error) {
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2618
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2619
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2620
|
+
} else {
|
|
2621
|
+
Logger({
|
|
2622
|
+
level: "WARN",
|
|
2623
|
+
message: `Response Validation Warnings for platform > Order > getShipments \n ${res_error}`,
|
|
2624
|
+
});
|
|
2625
|
+
}
|
|
2592
2626
|
}
|
|
2593
2627
|
|
|
2594
2628
|
return response;
|
|
@@ -2765,10 +2799,14 @@ class Order {
|
|
|
2765
2799
|
});
|
|
2766
2800
|
|
|
2767
2801
|
if (res_error) {
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2802
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2803
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2804
|
+
} else {
|
|
2805
|
+
Logger({
|
|
2806
|
+
level: "WARN",
|
|
2807
|
+
message: `Response Validation Warnings for platform > Order > getStateTransitionMap \n ${res_error}`,
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2772
2810
|
}
|
|
2773
2811
|
|
|
2774
2812
|
return response;
|
|
@@ -2842,10 +2880,14 @@ class Order {
|
|
|
2842
2880
|
});
|
|
2843
2881
|
|
|
2844
2882
|
if (res_error) {
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2883
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2884
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2885
|
+
} else {
|
|
2886
|
+
Logger({
|
|
2887
|
+
level: "WARN",
|
|
2888
|
+
message: `Response Validation Warnings for platform > Order > getfilters \n ${res_error}`,
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2849
2891
|
}
|
|
2850
2892
|
|
|
2851
2893
|
return response;
|
|
@@ -2918,10 +2960,14 @@ class Order {
|
|
|
2918
2960
|
);
|
|
2919
2961
|
|
|
2920
2962
|
if (res_error) {
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2963
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2964
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2965
|
+
} else {
|
|
2966
|
+
Logger({
|
|
2967
|
+
level: "WARN",
|
|
2968
|
+
message: `Response Validation Warnings for platform > Order > invalidateShipmentCache \n ${res_error}`,
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2925
2971
|
}
|
|
2926
2972
|
|
|
2927
2973
|
return response;
|
|
@@ -2991,10 +3037,14 @@ class Order {
|
|
|
2991
3037
|
});
|
|
2992
3038
|
|
|
2993
3039
|
if (res_error) {
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3040
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3041
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3042
|
+
} else {
|
|
3043
|
+
Logger({
|
|
3044
|
+
level: "WARN",
|
|
3045
|
+
message: `Response Validation Warnings for platform > Order > orderUpdate \n ${res_error}`,
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
2998
3048
|
}
|
|
2999
3049
|
|
|
3000
3050
|
return response;
|
|
@@ -3066,10 +3116,14 @@ class Order {
|
|
|
3066
3116
|
});
|
|
3067
3117
|
|
|
3068
3118
|
if (res_error) {
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3119
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3120
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3121
|
+
} else {
|
|
3122
|
+
Logger({
|
|
3123
|
+
level: "WARN",
|
|
3124
|
+
message: `Response Validation Warnings for platform > Order > postShipmentHistory \n ${res_error}`,
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3073
3127
|
}
|
|
3074
3128
|
|
|
3075
3129
|
return response;
|
|
@@ -3141,10 +3195,14 @@ class Order {
|
|
|
3141
3195
|
});
|
|
3142
3196
|
|
|
3143
3197
|
if (res_error) {
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3198
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3199
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3200
|
+
} else {
|
|
3201
|
+
Logger({
|
|
3202
|
+
level: "WARN",
|
|
3203
|
+
message: `Response Validation Warnings for platform > Order > processManifest \n ${res_error}`,
|
|
3204
|
+
});
|
|
3205
|
+
}
|
|
3148
3206
|
}
|
|
3149
3207
|
|
|
3150
3208
|
return response;
|
|
@@ -3216,10 +3274,14 @@ class Order {
|
|
|
3216
3274
|
});
|
|
3217
3275
|
|
|
3218
3276
|
if (res_error) {
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3277
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3278
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3279
|
+
} else {
|
|
3280
|
+
Logger({
|
|
3281
|
+
level: "WARN",
|
|
3282
|
+
message: `Response Validation Warnings for platform > Order > reassignLocation \n ${res_error}`,
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3223
3285
|
}
|
|
3224
3286
|
|
|
3225
3287
|
return response;
|
|
@@ -3289,10 +3351,14 @@ class Order {
|
|
|
3289
3351
|
});
|
|
3290
3352
|
|
|
3291
3353
|
if (res_error) {
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3354
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3355
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3356
|
+
} else {
|
|
3357
|
+
Logger({
|
|
3358
|
+
level: "WARN",
|
|
3359
|
+
message: `Response Validation Warnings for platform > Order > sendSmsNinja \n ${res_error}`,
|
|
3360
|
+
});
|
|
3361
|
+
}
|
|
3296
3362
|
}
|
|
3297
3363
|
|
|
3298
3364
|
return response;
|
|
@@ -3364,10 +3430,14 @@ class Order {
|
|
|
3364
3430
|
});
|
|
3365
3431
|
|
|
3366
3432
|
if (res_error) {
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3433
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3434
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3435
|
+
} else {
|
|
3436
|
+
Logger({
|
|
3437
|
+
level: "WARN",
|
|
3438
|
+
message: `Response Validation Warnings for platform > Order > sendUserMobileOTP \n ${res_error}`,
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3371
3441
|
}
|
|
3372
3442
|
|
|
3373
3443
|
return response;
|
|
@@ -3450,10 +3520,14 @@ class Order {
|
|
|
3450
3520
|
);
|
|
3451
3521
|
|
|
3452
3522
|
if (res_error) {
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3523
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3524
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3525
|
+
} else {
|
|
3526
|
+
Logger({
|
|
3527
|
+
level: "WARN",
|
|
3528
|
+
message: `Response Validation Warnings for platform > Order > trackShipment \n ${res_error}`,
|
|
3529
|
+
});
|
|
3530
|
+
}
|
|
3457
3531
|
}
|
|
3458
3532
|
|
|
3459
3533
|
return response;
|
|
@@ -3573,10 +3647,14 @@ class Order {
|
|
|
3573
3647
|
});
|
|
3574
3648
|
|
|
3575
3649
|
if (res_error) {
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3650
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3651
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3652
|
+
} else {
|
|
3653
|
+
Logger({
|
|
3654
|
+
level: "WARN",
|
|
3655
|
+
message: `Response Validation Warnings for platform > Order > updateAddress \n ${res_error}`,
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3580
3658
|
}
|
|
3581
3659
|
|
|
3582
3660
|
return response;
|
|
@@ -3652,10 +3730,14 @@ class Order {
|
|
|
3652
3730
|
);
|
|
3653
3731
|
|
|
3654
3732
|
if (res_error) {
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3733
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3734
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3735
|
+
} else {
|
|
3736
|
+
Logger({
|
|
3737
|
+
level: "WARN",
|
|
3738
|
+
message: `Response Validation Warnings for platform > Order > updatePackagingDimensions \n ${res_error}`,
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3659
3741
|
}
|
|
3660
3742
|
|
|
3661
3743
|
return response;
|
|
@@ -3728,10 +3810,14 @@ class Order {
|
|
|
3728
3810
|
});
|
|
3729
3811
|
|
|
3730
3812
|
if (res_error) {
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3813
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3814
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3815
|
+
} else {
|
|
3816
|
+
Logger({
|
|
3817
|
+
level: "WARN",
|
|
3818
|
+
message: `Response Validation Warnings for platform > Order > updateShipmentLock \n ${res_error}`,
|
|
3819
|
+
});
|
|
3820
|
+
}
|
|
3735
3821
|
}
|
|
3736
3822
|
|
|
3737
3823
|
return response;
|
|
@@ -3805,10 +3891,14 @@ class Order {
|
|
|
3805
3891
|
);
|
|
3806
3892
|
|
|
3807
3893
|
if (res_error) {
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3894
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3895
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3896
|
+
} else {
|
|
3897
|
+
Logger({
|
|
3898
|
+
level: "WARN",
|
|
3899
|
+
message: `Response Validation Warnings for platform > Order > updateShipmentStatus \n ${res_error}`,
|
|
3900
|
+
});
|
|
3901
|
+
}
|
|
3812
3902
|
}
|
|
3813
3903
|
|
|
3814
3904
|
return response;
|
|
@@ -3881,10 +3971,14 @@ class Order {
|
|
|
3881
3971
|
);
|
|
3882
3972
|
|
|
3883
3973
|
if (res_error) {
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3974
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3975
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3976
|
+
} else {
|
|
3977
|
+
Logger({
|
|
3978
|
+
level: "WARN",
|
|
3979
|
+
message: `Response Validation Warnings for platform > Order > updateShipmentTracking \n ${res_error}`,
|
|
3980
|
+
});
|
|
3981
|
+
}
|
|
3888
3982
|
}
|
|
3889
3983
|
|
|
3890
3984
|
return response;
|
|
@@ -3954,10 +4048,14 @@ class Order {
|
|
|
3954
4048
|
});
|
|
3955
4049
|
|
|
3956
4050
|
if (res_error) {
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
4051
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
4052
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
4053
|
+
} else {
|
|
4054
|
+
Logger({
|
|
4055
|
+
level: "WARN",
|
|
4056
|
+
message: `Response Validation Warnings for platform > Order > uploadConsent \n ${res_error}`,
|
|
4057
|
+
});
|
|
4058
|
+
}
|
|
3961
4059
|
}
|
|
3962
4060
|
|
|
3963
4061
|
return response;
|
|
@@ -4029,10 +4127,14 @@ class Order {
|
|
|
4029
4127
|
});
|
|
4030
4128
|
|
|
4031
4129
|
if (res_error) {
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4130
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
4131
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
4132
|
+
} else {
|
|
4133
|
+
Logger({
|
|
4134
|
+
level: "WARN",
|
|
4135
|
+
message: `Response Validation Warnings for platform > Order > verifyMobileOTP \n ${res_error}`,
|
|
4136
|
+
});
|
|
4137
|
+
}
|
|
4036
4138
|
}
|
|
4037
4139
|
|
|
4038
4140
|
return response;
|