@gofynd/fdk-client-javascript 1.3.6-beta.1 → 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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationConfig.d.ts +11 -3
  4. package/sdk/application/ApplicationConfig.js +21 -3
  5. package/sdk/application/Cart/CartApplicationClient.js +228 -113
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +244 -121
  7. package/sdk/application/Common/CommonApplicationClient.js +20 -9
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +28 -13
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.js +132 -65
  10. package/sdk/application/Content/ContentApplicationClient.js +156 -77
  11. package/sdk/application/FileStorage/FileStorageApplicationClient.js +28 -13
  12. package/sdk/application/Lead/LeadApplicationClient.js +60 -29
  13. package/sdk/application/Logistic/LogisticApplicationClient.js +44 -21
  14. package/sdk/application/Order/OrderApplicationClient.js +100 -49
  15. package/sdk/application/Payment/PaymentApplicationClient.js +340 -169
  16. package/sdk/application/PosCart/PosCartApplicationClient.js +220 -109
  17. package/sdk/application/Rewards/RewardsApplicationClient.js +60 -29
  18. package/sdk/application/Share/ShareApplicationClient.js +60 -29
  19. package/sdk/application/Theme/ThemeApplicationClient.js +36 -17
  20. package/sdk/application/User/UserApplicationClient.js +324 -161
  21. package/sdk/common/AxiosHelper.js +3 -3
  22. package/sdk/common/FDKError.d.ts +4 -0
  23. package/sdk/common/FDKError.js +9 -0
  24. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +16 -40
  25. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +160 -38
  26. package/sdk/partner/PartnerConfig.d.ts +10 -0
  27. package/sdk/partner/PartnerConfig.js +10 -1
  28. package/sdk/partner/Theme/ThemePartnerClient.d.ts +96 -199
  29. package/sdk/partner/Theme/ThemePartnerClient.js +935 -170
  30. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +36 -17
  31. package/sdk/platform/Billing/BillingPlatformClient.js +140 -69
  32. package/sdk/platform/Cart/CartPlatformApplicationClient.js +456 -228
  33. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +512 -256
  34. package/sdk/platform/Catalog/CatalogPlatformClient.js +620 -309
  35. package/sdk/platform/Common/CommonPlatformClient.js +20 -9
  36. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +472 -236
  37. package/sdk/platform/Communication/CommunicationPlatformClient.js +12 -5
  38. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +14 -1
  39. package/sdk/platform/Communication/CommunicationPlatformModel.js +16 -0
  40. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +116 -57
  41. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +256 -128
  42. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +148 -73
  43. package/sdk/platform/Content/ContentPlatformApplicationClient.js +552 -276
  44. package/sdk/platform/Discount/DiscountPlatformClient.js +92 -45
  45. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +88 -44
  46. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +52 -25
  47. package/sdk/platform/Finance/FinancePlatformClient.js +196 -97
  48. package/sdk/platform/Inventory/InventoryPlatformClient.js +100 -49
  49. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +104 -52
  50. package/sdk/platform/Lead/LeadPlatformClient.js +92 -45
  51. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +26 -0
  52. package/sdk/platform/Order/OrderPlatformApplicationClient.js +239 -5
  53. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +57 -1
  54. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +55 -0
  55. package/sdk/platform/Order/OrderPlatformClient.js +356 -177
  56. package/sdk/platform/Order/OrderPlatformModel.d.ts +44 -5
  57. package/sdk/platform/Order/OrderPlatformModel.js +52 -4
  58. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +16 -8
  59. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +336 -168
  60. package/sdk/platform/Payment/PaymentPlatformClient.js +84 -41
  61. package/sdk/platform/PlatformConfig.d.ts +10 -0
  62. package/sdk/platform/PlatformConfig.js +10 -1
  63. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +96 -48
  64. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +112 -56
  65. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +148 -73
  66. package/sdk/platform/Share/SharePlatformApplicationClient.js +40 -20
  67. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +224 -112
  68. package/sdk/platform/Theme/ThemePlatformClient.js +28 -13
  69. package/sdk/platform/User/UserPlatformApplicationClient.js +144 -72
  70. package/sdk/platform/Webhook/WebhookPlatformClient.js +132 -65
  71. package/sdk/public/Configuration/ConfigurationPublicClient.js +20 -9
  72. package/sdk/public/Inventory/InventoryPublicClient.js +52 -25
  73. package/sdk/public/Partner/PartnerPublicClient.js +12 -5
  74. package/sdk/public/PublicConfig.d.ts +11 -1
  75. package/sdk/public/PublicConfig.js +10 -1
  76. package/sdk/public/Webhook/WebhookPublicClient.js +20 -9
@@ -1,5 +1,8 @@
1
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
2
+ const {
3
+ FDKClientValidationError,
4
+ FDKResponseValidationError,
5
+ } = require("../../common/FDKError");
3
6
  const Paginator = require("../../common/Paginator");
4
7
  const ConfigurationPlatformValidator = require("./ConfigurationPlatformValidator");
5
8
  const ConfigurationPlatformModel = require("./ConfigurationPlatformModel");
@@ -79,10 +82,14 @@ class Configuration {
79
82
  });
80
83
 
81
84
  if (res_error) {
82
- Logger({
83
- level: "WARN",
84
- message: `Response Validation Warnnings for platform > Configuration > createApplication \n ${res_error}`,
85
- });
85
+ if (this.config.options.strictResponseCheck === true) {
86
+ return Promise.reject(new FDKResponseValidationError(res_error));
87
+ } else {
88
+ Logger({
89
+ level: "WARN",
90
+ message: `Response Validation Warnings for platform > Configuration > createApplication \n ${res_error}`,
91
+ });
92
+ }
86
93
  }
87
94
 
88
95
  return response;
@@ -162,10 +169,14 @@ class Configuration {
162
169
  );
163
170
 
164
171
  if (res_error) {
165
- Logger({
166
- level: "WARN",
167
- message: `Response Validation Warnnings for platform > Configuration > getApplications \n ${res_error}`,
168
- });
172
+ if (this.config.options.strictResponseCheck === true) {
173
+ return Promise.reject(new FDKResponseValidationError(res_error));
174
+ } else {
175
+ Logger({
176
+ level: "WARN",
177
+ message: `Response Validation Warnings for platform > Configuration > getApplications \n ${res_error}`,
178
+ });
179
+ }
169
180
  }
170
181
 
171
182
  return response;
@@ -274,10 +285,14 @@ class Configuration {
274
285
  );
275
286
 
276
287
  if (res_error) {
277
- Logger({
278
- level: "WARN",
279
- message: `Response Validation Warnnings for platform > Configuration > getAvailableOptIns \n ${res_error}`,
280
- });
288
+ if (this.config.options.strictResponseCheck === true) {
289
+ return Promise.reject(new FDKResponseValidationError(res_error));
290
+ } else {
291
+ Logger({
292
+ level: "WARN",
293
+ message: `Response Validation Warnings for platform > Configuration > getAvailableOptIns \n ${res_error}`,
294
+ });
295
+ }
281
296
  }
282
297
 
283
298
  return response;
@@ -381,10 +396,14 @@ class Configuration {
381
396
  );
382
397
 
383
398
  if (res_error) {
384
- Logger({
385
- level: "WARN",
386
- message: `Response Validation Warnnings for platform > Configuration > getBrandsByCompany \n ${res_error}`,
387
- });
399
+ if (this.config.options.strictResponseCheck === true) {
400
+ return Promise.reject(new FDKResponseValidationError(res_error));
401
+ } else {
402
+ Logger({
403
+ level: "WARN",
404
+ message: `Response Validation Warnings for platform > Configuration > getBrandsByCompany \n ${res_error}`,
405
+ });
406
+ }
388
407
  }
389
408
 
390
409
  return response;
@@ -465,10 +484,14 @@ class Configuration {
465
484
  );
466
485
 
467
486
  if (res_error) {
468
- Logger({
469
- level: "WARN",
470
- message: `Response Validation Warnnings for platform > Configuration > getCompanyByBrands \n ${res_error}`,
471
- });
487
+ if (this.config.options.strictResponseCheck === true) {
488
+ return Promise.reject(new FDKResponseValidationError(res_error));
489
+ } else {
490
+ Logger({
491
+ level: "WARN",
492
+ message: `Response Validation Warnings for platform > Configuration > getCompanyByBrands \n ${res_error}`,
493
+ });
494
+ }
472
495
  }
473
496
 
474
497
  return response;
@@ -567,10 +590,14 @@ class Configuration {
567
590
  });
568
591
 
569
592
  if (res_error) {
570
- Logger({
571
- level: "WARN",
572
- message: `Response Validation Warnnings for platform > Configuration > getCurrencies \n ${res_error}`,
573
- });
593
+ if (this.config.options.strictResponseCheck === true) {
594
+ return Promise.reject(new FDKResponseValidationError(res_error));
595
+ } else {
596
+ Logger({
597
+ level: "WARN",
598
+ message: `Response Validation Warnings for platform > Configuration > getCurrencies \n ${res_error}`,
599
+ });
600
+ }
574
601
  }
575
602
 
576
603
  return response;
@@ -646,10 +673,14 @@ class Configuration {
646
673
  );
647
674
 
648
675
  if (res_error) {
649
- Logger({
650
- level: "WARN",
651
- message: `Response Validation Warnnings for platform > Configuration > getDomainAvailibility \n ${res_error}`,
652
- });
676
+ if (this.config.options.strictResponseCheck === true) {
677
+ return Promise.reject(new FDKResponseValidationError(res_error));
678
+ } else {
679
+ Logger({
680
+ level: "WARN",
681
+ message: `Response Validation Warnings for platform > Configuration > getDomainAvailibility \n ${res_error}`,
682
+ });
683
+ }
653
684
  }
654
685
 
655
686
  return response;
@@ -723,10 +754,14 @@ class Configuration {
723
754
  });
724
755
 
725
756
  if (res_error) {
726
- Logger({
727
- level: "WARN",
728
- message: `Response Validation Warnnings for platform > Configuration > getIntegrationById \n ${res_error}`,
729
- });
757
+ if (this.config.options.strictResponseCheck === true) {
758
+ return Promise.reject(new FDKResponseValidationError(res_error));
759
+ } else {
760
+ Logger({
761
+ level: "WARN",
762
+ message: `Response Validation Warnings for platform > Configuration > getIntegrationById \n ${res_error}`,
763
+ });
764
+ }
730
765
  }
731
766
 
732
767
  return response;
@@ -806,10 +841,14 @@ class Configuration {
806
841
  });
807
842
 
808
843
  if (res_error) {
809
- Logger({
810
- level: "WARN",
811
- message: `Response Validation Warnnings for platform > Configuration > getIntegrationByLevelId \n ${res_error}`,
812
- });
844
+ if (this.config.options.strictResponseCheck === true) {
845
+ return Promise.reject(new FDKResponseValidationError(res_error));
846
+ } else {
847
+ Logger({
848
+ level: "WARN",
849
+ message: `Response Validation Warnings for platform > Configuration > getIntegrationByLevelId \n ${res_error}`,
850
+ });
851
+ }
813
852
  }
814
853
 
815
854
  return response;
@@ -897,10 +936,14 @@ class Configuration {
897
936
  );
898
937
 
899
938
  if (res_error) {
900
- Logger({
901
- level: "WARN",
902
- message: `Response Validation Warnnings for platform > Configuration > getIntegrationLevelConfig \n ${res_error}`,
903
- });
939
+ if (this.config.options.strictResponseCheck === true) {
940
+ return Promise.reject(new FDKResponseValidationError(res_error));
941
+ } else {
942
+ Logger({
943
+ level: "WARN",
944
+ message: `Response Validation Warnings for platform > Configuration > getIntegrationLevelConfig \n ${res_error}`,
945
+ });
946
+ }
904
947
  }
905
948
 
906
949
  return response;
@@ -981,10 +1024,14 @@ class Configuration {
981
1024
  );
982
1025
 
983
1026
  if (res_error) {
984
- Logger({
985
- level: "WARN",
986
- message: `Response Validation Warnnings for platform > Configuration > getLevelActiveIntegrations \n ${res_error}`,
987
- });
1027
+ if (this.config.options.strictResponseCheck === true) {
1028
+ return Promise.reject(new FDKResponseValidationError(res_error));
1029
+ } else {
1030
+ Logger({
1031
+ level: "WARN",
1032
+ message: `Response Validation Warnings for platform > Configuration > getLevelActiveIntegrations \n ${res_error}`,
1033
+ });
1034
+ }
988
1035
  }
989
1036
 
990
1037
  return response;
@@ -1062,10 +1109,14 @@ class Configuration {
1062
1109
  );
1063
1110
 
1064
1111
  if (res_error) {
1065
- Logger({
1066
- level: "WARN",
1067
- message: `Response Validation Warnnings for platform > Configuration > getOtherSellerApplicationById \n ${res_error}`,
1068
- });
1112
+ if (this.config.options.strictResponseCheck === true) {
1113
+ return Promise.reject(new FDKResponseValidationError(res_error));
1114
+ } else {
1115
+ Logger({
1116
+ level: "WARN",
1117
+ message: `Response Validation Warnings for platform > Configuration > getOtherSellerApplicationById \n ${res_error}`,
1118
+ });
1119
+ }
1069
1120
  }
1070
1121
 
1071
1122
  return response;
@@ -1146,10 +1197,14 @@ class Configuration {
1146
1197
  );
1147
1198
 
1148
1199
  if (res_error) {
1149
- Logger({
1150
- level: "WARN",
1151
- message: `Response Validation Warnnings for platform > Configuration > getOtherSellerApplications \n ${res_error}`,
1152
- });
1200
+ if (this.config.options.strictResponseCheck === true) {
1201
+ return Promise.reject(new FDKResponseValidationError(res_error));
1202
+ } else {
1203
+ Logger({
1204
+ level: "WARN",
1205
+ message: `Response Validation Warnings for platform > Configuration > getOtherSellerApplications \n ${res_error}`,
1206
+ });
1207
+ }
1153
1208
  }
1154
1209
 
1155
1210
  return response;
@@ -1261,10 +1316,14 @@ class Configuration {
1261
1316
  );
1262
1317
 
1263
1318
  if (res_error) {
1264
- Logger({
1265
- level: "WARN",
1266
- message: `Response Validation Warnnings for platform > Configuration > getSelectedOptIns \n ${res_error}`,
1267
- });
1319
+ if (this.config.options.strictResponseCheck === true) {
1320
+ return Promise.reject(new FDKResponseValidationError(res_error));
1321
+ } else {
1322
+ Logger({
1323
+ level: "WARN",
1324
+ message: `Response Validation Warnings for platform > Configuration > getSelectedOptIns \n ${res_error}`,
1325
+ });
1326
+ }
1268
1327
  }
1269
1328
 
1270
1329
  return response;
@@ -1377,10 +1436,14 @@ class Configuration {
1377
1436
  );
1378
1437
 
1379
1438
  if (res_error) {
1380
- Logger({
1381
- level: "WARN",
1382
- message: `Response Validation Warnnings for platform > Configuration > getStoreByBrands \n ${res_error}`,
1383
- });
1439
+ if (this.config.options.strictResponseCheck === true) {
1440
+ return Promise.reject(new FDKResponseValidationError(res_error));
1441
+ } else {
1442
+ Logger({
1443
+ level: "WARN",
1444
+ message: `Response Validation Warnings for platform > Configuration > getStoreByBrands \n ${res_error}`,
1445
+ });
1446
+ }
1384
1447
  }
1385
1448
 
1386
1449
  return response;
@@ -1487,10 +1550,14 @@ class Configuration {
1487
1550
  );
1488
1551
 
1489
1552
  if (res_error) {
1490
- Logger({
1491
- level: "WARN",
1492
- message: `Response Validation Warnnings for platform > Configuration > optOutFromApplication \n ${res_error}`,
1493
- });
1553
+ if (this.config.options.strictResponseCheck === true) {
1554
+ return Promise.reject(new FDKResponseValidationError(res_error));
1555
+ } else {
1556
+ Logger({
1557
+ level: "WARN",
1558
+ message: `Response Validation Warnings for platform > Configuration > optOutFromApplication \n ${res_error}`,
1559
+ });
1560
+ }
1494
1561
  }
1495
1562
 
1496
1563
  return response;
@@ -1570,10 +1637,14 @@ class Configuration {
1570
1637
  });
1571
1638
 
1572
1639
  if (res_error) {
1573
- Logger({
1574
- level: "WARN",
1575
- message: `Response Validation Warnnings for platform > Configuration > updateLevelIntegration \n ${res_error}`,
1576
- });
1640
+ if (this.config.options.strictResponseCheck === true) {
1641
+ return Promise.reject(new FDKResponseValidationError(res_error));
1642
+ } else {
1643
+ Logger({
1644
+ level: "WARN",
1645
+ message: `Response Validation Warnings for platform > Configuration > updateLevelIntegration \n ${res_error}`,
1646
+ });
1647
+ }
1577
1648
  }
1578
1649
 
1579
1650
  return response;
@@ -1655,10 +1726,14 @@ class Configuration {
1655
1726
  });
1656
1727
 
1657
1728
  if (res_error) {
1658
- Logger({
1659
- level: "WARN",
1660
- message: `Response Validation Warnnings for platform > Configuration > updateLevelUidIntegration \n ${res_error}`,
1661
- });
1729
+ if (this.config.options.strictResponseCheck === true) {
1730
+ return Promise.reject(new FDKResponseValidationError(res_error));
1731
+ } else {
1732
+ Logger({
1733
+ level: "WARN",
1734
+ message: `Response Validation Warnings for platform > Configuration > updateLevelUidIntegration \n ${res_error}`,
1735
+ });
1736
+ }
1662
1737
  }
1663
1738
 
1664
1739
  return response;