@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.
Files changed (85) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationConfig.d.ts +11 -3
  4. package/sdk/application/ApplicationConfig.js +21 -3
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
  6. package/sdk/application/Cart/CartApplicationClient.js +232 -116
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +2 -0
  8. package/sdk/application/Cart/CartApplicationValidator.js +2 -0
  9. package/sdk/application/Catalog/CatalogApplicationClient.js +244 -121
  10. package/sdk/application/Common/CommonApplicationClient.js +20 -9
  11. package/sdk/application/Communication/CommunicationApplicationClient.js +28 -13
  12. package/sdk/application/Configuration/ConfigurationApplicationClient.js +132 -65
  13. package/sdk/application/Content/ContentApplicationClient.js +156 -77
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +28 -13
  15. package/sdk/application/Lead/LeadApplicationClient.js +60 -29
  16. package/sdk/application/Logistic/LogisticApplicationClient.js +44 -21
  17. package/sdk/application/Order/OrderApplicationClient.js +100 -49
  18. package/sdk/application/Payment/PaymentApplicationClient.js +340 -169
  19. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +1 -1
  20. package/sdk/application/PosCart/PosCartApplicationClient.js +224 -112
  21. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +2 -0
  22. package/sdk/application/PosCart/PosCartApplicationValidator.js +2 -0
  23. package/sdk/application/Rewards/RewardsApplicationClient.js +60 -29
  24. package/sdk/application/Share/ShareApplicationClient.js +60 -29
  25. package/sdk/application/Theme/ThemeApplicationClient.js +36 -17
  26. package/sdk/application/User/UserApplicationClient.js +324 -161
  27. package/sdk/common/FDKError.d.ts +4 -0
  28. package/sdk/common/FDKError.js +9 -0
  29. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +16 -40
  30. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +160 -38
  31. package/sdk/partner/PartnerConfig.d.ts +10 -0
  32. package/sdk/partner/PartnerConfig.js +10 -1
  33. package/sdk/partner/Theme/ThemePartnerClient.d.ts +96 -199
  34. package/sdk/partner/Theme/ThemePartnerClient.js +935 -170
  35. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +36 -17
  36. package/sdk/platform/Billing/BillingPlatformClient.js +140 -69
  37. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  38. package/sdk/platform/Cart/CartPlatformApplicationClient.js +460 -229
  39. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +2 -0
  40. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +2 -0
  41. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +512 -256
  42. package/sdk/platform/Catalog/CatalogPlatformClient.js +620 -309
  43. package/sdk/platform/Common/CommonPlatformClient.js +20 -9
  44. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +472 -236
  45. package/sdk/platform/Communication/CommunicationPlatformClient.js +12 -5
  46. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +14 -1
  47. package/sdk/platform/Communication/CommunicationPlatformModel.js +16 -0
  48. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +116 -57
  49. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +256 -128
  50. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +148 -73
  51. package/sdk/platform/Content/ContentPlatformApplicationClient.js +552 -276
  52. package/sdk/platform/Discount/DiscountPlatformClient.js +92 -45
  53. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +88 -44
  54. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +52 -25
  55. package/sdk/platform/Finance/FinancePlatformClient.js +196 -97
  56. package/sdk/platform/Inventory/InventoryPlatformClient.js +100 -49
  57. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +104 -52
  58. package/sdk/platform/Lead/LeadPlatformClient.js +92 -45
  59. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +26 -0
  60. package/sdk/platform/Order/OrderPlatformApplicationClient.js +239 -5
  61. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +57 -1
  62. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +55 -0
  63. package/sdk/platform/Order/OrderPlatformClient.d.ts +0 -10
  64. package/sdk/platform/Order/OrderPlatformClient.js +356 -254
  65. package/sdk/platform/Order/OrderPlatformValidator.d.ts +1 -20
  66. package/sdk/platform/Order/OrderPlatformValidator.js +0 -15
  67. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +16 -8
  68. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +336 -168
  69. package/sdk/platform/Payment/PaymentPlatformClient.js +84 -41
  70. package/sdk/platform/PlatformConfig.d.ts +10 -0
  71. package/sdk/platform/PlatformConfig.js +10 -1
  72. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +96 -48
  73. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +112 -56
  74. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +148 -73
  75. package/sdk/platform/Share/SharePlatformApplicationClient.js +40 -20
  76. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +224 -112
  77. package/sdk/platform/Theme/ThemePlatformClient.js +28 -13
  78. package/sdk/platform/User/UserPlatformApplicationClient.js +144 -72
  79. package/sdk/platform/Webhook/WebhookPlatformClient.js +132 -65
  80. package/sdk/public/Configuration/ConfigurationPublicClient.js +20 -9
  81. package/sdk/public/Inventory/InventoryPublicClient.js +52 -25
  82. package/sdk/public/Partner/PartnerPublicClient.js +12 -5
  83. package/sdk/public/PublicConfig.d.ts +11 -1
  84. package/sdk/public/PublicConfig.js +10 -1
  85. package/sdk/public/Webhook/WebhookPublicClient.js +20 -9
@@ -1,5 +1,8 @@
1
1
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
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 CommunicationApplicationValidator = require("./CommunicationApplicationValidator");
@@ -103,10 +106,14 @@ class Communication {
103
106
  );
104
107
 
105
108
  if (res_error) {
106
- Logger({
107
- level: "WARN",
108
- message: `Response Validation Warnnings for application > Communication > getCommunicationConsent \n ${res_error}`,
109
- });
109
+ if (this._conf.options.strictResponseCheck === true) {
110
+ return Promise.reject(new FDKResponseValidationError(res_error));
111
+ } else {
112
+ Logger({
113
+ level: "WARN",
114
+ message: `Response Validation Warnings for application > Communication > getCommunicationConsent \n ${res_error}`,
115
+ });
116
+ }
110
117
  }
111
118
 
112
119
  return response;
@@ -180,10 +187,14 @@ class Communication {
180
187
  });
181
188
 
182
189
  if (res_error) {
183
- Logger({
184
- level: "WARN",
185
- message: `Response Validation Warnnings for application > Communication > upsertAppPushtoken \n ${res_error}`,
186
- });
190
+ if (this._conf.options.strictResponseCheck === true) {
191
+ return Promise.reject(new FDKResponseValidationError(res_error));
192
+ } else {
193
+ Logger({
194
+ level: "WARN",
195
+ message: `Response Validation Warnings for application > Communication > upsertAppPushtoken \n ${res_error}`,
196
+ });
197
+ }
187
198
  }
188
199
 
189
200
  return response;
@@ -260,10 +271,14 @@ class Communication {
260
271
  );
261
272
 
262
273
  if (res_error) {
263
- Logger({
264
- level: "WARN",
265
- message: `Response Validation Warnnings for application > Communication > upsertCommunicationConsent \n ${res_error}`,
266
- });
274
+ if (this._conf.options.strictResponseCheck === true) {
275
+ return Promise.reject(new FDKResponseValidationError(res_error));
276
+ } else {
277
+ Logger({
278
+ level: "WARN",
279
+ message: `Response Validation Warnings for application > Communication > upsertCommunicationConsent \n ${res_error}`,
280
+ });
281
+ }
267
282
  }
268
283
 
269
284
  return response;
@@ -1,5 +1,8 @@
1
1
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
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 ConfigurationApplicationValidator = require("./ConfigurationApplicationValidator");
@@ -116,10 +119,14 @@ class Configuration {
116
119
  );
117
120
 
118
121
  if (res_error) {
119
- Logger({
120
- level: "WARN",
121
- message: `Response Validation Warnnings for application > Configuration > getAppCurrencies \n ${res_error}`,
122
- });
122
+ if (this._conf.options.strictResponseCheck === true) {
123
+ return Promise.reject(new FDKResponseValidationError(res_error));
124
+ } else {
125
+ Logger({
126
+ level: "WARN",
127
+ message: `Response Validation Warnings for application > Configuration > getAppCurrencies \n ${res_error}`,
128
+ });
129
+ }
123
130
  }
124
131
 
125
132
  return response;
@@ -207,10 +214,14 @@ class Configuration {
207
214
  );
208
215
 
209
216
  if (res_error) {
210
- Logger({
211
- level: "WARN",
212
- message: `Response Validation Warnnings for application > Configuration > getAppStaffList \n ${res_error}`,
213
- });
217
+ if (this._conf.options.strictResponseCheck === true) {
218
+ return Promise.reject(new FDKResponseValidationError(res_error));
219
+ } else {
220
+ Logger({
221
+ level: "WARN",
222
+ message: `Response Validation Warnings for application > Configuration > getAppStaffList \n ${res_error}`,
223
+ });
224
+ }
214
225
  }
215
226
 
216
227
  return response;
@@ -331,10 +342,14 @@ class Configuration {
331
342
  );
332
343
 
333
344
  if (res_error) {
334
- Logger({
335
- level: "WARN",
336
- message: `Response Validation Warnnings for application > Configuration > getAppStaffs \n ${res_error}`,
337
- });
345
+ if (this._conf.options.strictResponseCheck === true) {
346
+ return Promise.reject(new FDKResponseValidationError(res_error));
347
+ } else {
348
+ Logger({
349
+ level: "WARN",
350
+ message: `Response Validation Warnings for application > Configuration > getAppStaffs \n ${res_error}`,
351
+ });
352
+ }
338
353
  }
339
354
 
340
355
  return response;
@@ -407,10 +422,14 @@ class Configuration {
407
422
  });
408
423
 
409
424
  if (res_error) {
410
- Logger({
411
- level: "WARN",
412
- message: `Response Validation Warnnings for application > Configuration > getApplication \n ${res_error}`,
413
- });
425
+ if (this._conf.options.strictResponseCheck === true) {
426
+ return Promise.reject(new FDKResponseValidationError(res_error));
427
+ } else {
428
+ Logger({
429
+ level: "WARN",
430
+ message: `Response Validation Warnings for application > Configuration > getApplication \n ${res_error}`,
431
+ });
432
+ }
414
433
  }
415
434
 
416
435
  return response;
@@ -484,10 +503,14 @@ class Configuration {
484
503
  );
485
504
 
486
505
  if (res_error) {
487
- Logger({
488
- level: "WARN",
489
- message: `Response Validation Warnnings for application > Configuration > getBasicDetails \n ${res_error}`,
490
- });
506
+ if (this._conf.options.strictResponseCheck === true) {
507
+ return Promise.reject(new FDKResponseValidationError(res_error));
508
+ } else {
509
+ Logger({
510
+ level: "WARN",
511
+ message: `Response Validation Warnings for application > Configuration > getBasicDetails \n ${res_error}`,
512
+ });
513
+ }
491
514
  }
492
515
 
493
516
  return response;
@@ -562,10 +585,14 @@ class Configuration {
562
585
  );
563
586
 
564
587
  if (res_error) {
565
- Logger({
566
- level: "WARN",
567
- message: `Response Validation Warnnings for application > Configuration > getContactInfo \n ${res_error}`,
568
- });
588
+ if (this._conf.options.strictResponseCheck === true) {
589
+ return Promise.reject(new FDKResponseValidationError(res_error));
590
+ } else {
591
+ Logger({
592
+ level: "WARN",
593
+ message: `Response Validation Warnings for application > Configuration > getContactInfo \n ${res_error}`,
594
+ });
595
+ }
569
596
  }
570
597
 
571
598
  return response;
@@ -639,10 +666,14 @@ class Configuration {
639
666
  );
640
667
 
641
668
  if (res_error) {
642
- Logger({
643
- level: "WARN",
644
- message: `Response Validation Warnnings for application > Configuration > getCurrencies \n ${res_error}`,
645
- });
669
+ if (this._conf.options.strictResponseCheck === true) {
670
+ return Promise.reject(new FDKResponseValidationError(res_error));
671
+ } else {
672
+ Logger({
673
+ level: "WARN",
674
+ message: `Response Validation Warnings for application > Configuration > getCurrencies \n ${res_error}`,
675
+ });
676
+ }
646
677
  }
647
678
 
648
679
  return response;
@@ -715,10 +746,14 @@ class Configuration {
715
746
  });
716
747
 
717
748
  if (res_error) {
718
- Logger({
719
- level: "WARN",
720
- message: `Response Validation Warnnings for application > Configuration > getCurrencyById \n ${res_error}`,
721
- });
749
+ if (this._conf.options.strictResponseCheck === true) {
750
+ return Promise.reject(new FDKResponseValidationError(res_error));
751
+ } else {
752
+ Logger({
753
+ level: "WARN",
754
+ message: `Response Validation Warnings for application > Configuration > getCurrencyById \n ${res_error}`,
755
+ });
756
+ }
722
757
  }
723
758
 
724
759
  return response;
@@ -790,10 +825,14 @@ class Configuration {
790
825
  );
791
826
 
792
827
  if (res_error) {
793
- Logger({
794
- level: "WARN",
795
- message: `Response Validation Warnnings for application > Configuration > getFeatures \n ${res_error}`,
796
- });
828
+ if (this._conf.options.strictResponseCheck === true) {
829
+ return Promise.reject(new FDKResponseValidationError(res_error));
830
+ } else {
831
+ Logger({
832
+ level: "WARN",
833
+ message: `Response Validation Warnings for application > Configuration > getFeatures \n ${res_error}`,
834
+ });
835
+ }
797
836
  }
798
837
 
799
838
  return response;
@@ -869,10 +908,14 @@ class Configuration {
869
908
  );
870
909
 
871
910
  if (res_error) {
872
- Logger({
873
- level: "WARN",
874
- message: `Response Validation Warnnings for application > Configuration > getIntegrationTokens \n ${res_error}`,
875
- });
911
+ if (this._conf.options.strictResponseCheck === true) {
912
+ return Promise.reject(new FDKResponseValidationError(res_error));
913
+ } else {
914
+ Logger({
915
+ level: "WARN",
916
+ message: `Response Validation Warnings for application > Configuration > getIntegrationTokens \n ${res_error}`,
917
+ });
918
+ }
876
919
  }
877
920
 
878
921
  return response;
@@ -944,10 +987,14 @@ class Configuration {
944
987
  );
945
988
 
946
989
  if (res_error) {
947
- Logger({
948
- level: "WARN",
949
- message: `Response Validation Warnnings for application > Configuration > getLanguages \n ${res_error}`,
950
- });
990
+ if (this._conf.options.strictResponseCheck === true) {
991
+ return Promise.reject(new FDKResponseValidationError(res_error));
992
+ } else {
993
+ Logger({
994
+ level: "WARN",
995
+ message: `Response Validation Warnings for application > Configuration > getLanguages \n ${res_error}`,
996
+ });
997
+ }
951
998
  }
952
999
 
953
1000
  return response;
@@ -1024,10 +1071,14 @@ class Configuration {
1024
1071
  );
1025
1072
 
1026
1073
  if (res_error) {
1027
- Logger({
1028
- level: "WARN",
1029
- message: `Response Validation Warnnings for application > Configuration > getOrderingStoreCookie \n ${res_error}`,
1030
- });
1074
+ if (this._conf.options.strictResponseCheck === true) {
1075
+ return Promise.reject(new FDKResponseValidationError(res_error));
1076
+ } else {
1077
+ Logger({
1078
+ level: "WARN",
1079
+ message: `Response Validation Warnings for application > Configuration > getOrderingStoreCookie \n ${res_error}`,
1080
+ });
1081
+ }
1031
1082
  }
1032
1083
 
1033
1084
  return response;
@@ -1103,10 +1154,14 @@ class Configuration {
1103
1154
  });
1104
1155
 
1105
1156
  if (res_error) {
1106
- Logger({
1107
- level: "WARN",
1108
- message: `Response Validation Warnnings for application > Configuration > getOrderingStores \n ${res_error}`,
1109
- });
1157
+ if (this._conf.options.strictResponseCheck === true) {
1158
+ return Promise.reject(new FDKResponseValidationError(res_error));
1159
+ } else {
1160
+ Logger({
1161
+ level: "WARN",
1162
+ message: `Response Validation Warnings for application > Configuration > getOrderingStores \n ${res_error}`,
1163
+ });
1164
+ }
1110
1165
  }
1111
1166
 
1112
1167
  return response;
@@ -1209,10 +1264,14 @@ class Configuration {
1209
1264
  );
1210
1265
 
1211
1266
  if (res_error) {
1212
- Logger({
1213
- level: "WARN",
1214
- message: `Response Validation Warnnings for application > Configuration > getOwnerInfo \n ${res_error}`,
1215
- });
1267
+ if (this._conf.options.strictResponseCheck === true) {
1268
+ return Promise.reject(new FDKResponseValidationError(res_error));
1269
+ } else {
1270
+ Logger({
1271
+ level: "WARN",
1272
+ message: `Response Validation Warnings for application > Configuration > getOwnerInfo \n ${res_error}`,
1273
+ });
1274
+ }
1216
1275
  }
1217
1276
 
1218
1277
  return response;
@@ -1286,10 +1345,14 @@ class Configuration {
1286
1345
  });
1287
1346
 
1288
1347
  if (res_error) {
1289
- Logger({
1290
- level: "WARN",
1291
- message: `Response Validation Warnnings for application > Configuration > getStoreDetailById \n ${res_error}`,
1292
- });
1348
+ if (this._conf.options.strictResponseCheck === true) {
1349
+ return Promise.reject(new FDKResponseValidationError(res_error));
1350
+ } else {
1351
+ Logger({
1352
+ level: "WARN",
1353
+ message: `Response Validation Warnings for application > Configuration > getStoreDetailById \n ${res_error}`,
1354
+ });
1355
+ }
1293
1356
  }
1294
1357
 
1295
1358
  return response;
@@ -1366,10 +1429,14 @@ class Configuration {
1366
1429
  );
1367
1430
 
1368
1431
  if (res_error) {
1369
- Logger({
1370
- level: "WARN",
1371
- message: `Response Validation Warnnings for application > Configuration > removeOrderingStoreCookie \n ${res_error}`,
1372
- });
1432
+ if (this._conf.options.strictResponseCheck === true) {
1433
+ return Promise.reject(new FDKResponseValidationError(res_error));
1434
+ } else {
1435
+ Logger({
1436
+ level: "WARN",
1437
+ message: `Response Validation Warnings for application > Configuration > removeOrderingStoreCookie \n ${res_error}`,
1438
+ });
1439
+ }
1373
1440
  }
1374
1441
 
1375
1442
  return response;