@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 InventoryPlatformValidator = require("./InventoryPlatformValidator");
5
8
  const InventoryPlatformModel = require("./InventoryPlatformModel");
@@ -76,10 +79,14 @@ class Inventory {
76
79
  });
77
80
 
78
81
  if (res_error) {
79
- Logger({
80
- level: "WARN",
81
- message: `Response Validation Warnnings for platform > Inventory > createJob \n ${res_error}`,
82
- });
82
+ if (this.config.options.strictResponseCheck === true) {
83
+ return Promise.reject(new FDKResponseValidationError(res_error));
84
+ } else {
85
+ Logger({
86
+ level: "WARN",
87
+ message: `Response Validation Warnings for platform > Inventory > createJob \n ${res_error}`,
88
+ });
89
+ }
83
90
  }
84
91
 
85
92
  return response;
@@ -150,10 +157,14 @@ class Inventory {
150
157
  });
151
158
 
152
159
  if (res_error) {
153
- Logger({
154
- level: "WARN",
155
- message: `Response Validation Warnnings for platform > Inventory > disable \n ${res_error}`,
156
- });
160
+ if (this.config.options.strictResponseCheck === true) {
161
+ return Promise.reject(new FDKResponseValidationError(res_error));
162
+ } else {
163
+ Logger({
164
+ level: "WARN",
165
+ message: `Response Validation Warnings for platform > Inventory > disable \n ${res_error}`,
166
+ });
167
+ }
157
168
  }
158
169
 
159
170
  return response;
@@ -223,10 +234,14 @@ class Inventory {
223
234
  );
224
235
 
225
236
  if (res_error) {
226
- Logger({
227
- level: "WARN",
228
- message: `Response Validation Warnnings for platform > Inventory > getConfigByCompany \n ${res_error}`,
229
- });
237
+ if (this.config.options.strictResponseCheck === true) {
238
+ return Promise.reject(new FDKResponseValidationError(res_error));
239
+ } else {
240
+ Logger({
241
+ level: "WARN",
242
+ message: `Response Validation Warnings for platform > Inventory > getConfigByCompany \n ${res_error}`,
243
+ });
244
+ }
230
245
  }
231
246
 
232
247
  return response;
@@ -300,10 +315,14 @@ class Inventory {
300
315
  );
301
316
 
302
317
  if (res_error) {
303
- Logger({
304
- level: "WARN",
305
- message: `Response Validation Warnnings for platform > Inventory > getJobByCode \n ${res_error}`,
306
- });
318
+ if (this.config.options.strictResponseCheck === true) {
319
+ return Promise.reject(new FDKResponseValidationError(res_error));
320
+ } else {
321
+ Logger({
322
+ level: "WARN",
323
+ message: `Response Validation Warnings for platform > Inventory > getJobByCode \n ${res_error}`,
324
+ });
325
+ }
307
326
  }
308
327
 
309
328
  return response;
@@ -389,10 +408,14 @@ class Inventory {
389
408
  );
390
409
 
391
410
  if (res_error) {
392
- Logger({
393
- level: "WARN",
394
- message: `Response Validation Warnnings for platform > Inventory > getJobByCompanyAndIntegration \n ${res_error}`,
395
- });
411
+ if (this.config.options.strictResponseCheck === true) {
412
+ return Promise.reject(new FDKResponseValidationError(res_error));
413
+ } else {
414
+ Logger({
415
+ level: "WARN",
416
+ message: `Response Validation Warnings for platform > Inventory > getJobByCompanyAndIntegration \n ${res_error}`,
417
+ });
418
+ }
396
419
  }
397
420
 
398
421
  return response;
@@ -480,10 +503,14 @@ class Inventory {
480
503
  );
481
504
 
482
505
  if (res_error) {
483
- Logger({
484
- level: "WARN",
485
- message: `Response Validation Warnnings for platform > Inventory > getJobCodeMetrics \n ${res_error}`,
486
- });
506
+ if (this.config.options.strictResponseCheck === true) {
507
+ return Promise.reject(new FDKResponseValidationError(res_error));
508
+ } else {
509
+ Logger({
510
+ level: "WARN",
511
+ message: `Response Validation Warnings for platform > Inventory > getJobCodeMetrics \n ${res_error}`,
512
+ });
513
+ }
487
514
  }
488
515
 
489
516
  return response;
@@ -569,10 +596,14 @@ class Inventory {
569
596
  );
570
597
 
571
598
  if (res_error) {
572
- Logger({
573
- level: "WARN",
574
- message: `Response Validation Warnnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${res_error}`,
575
- });
599
+ if (this.config.options.strictResponseCheck === true) {
600
+ return Promise.reject(new FDKResponseValidationError(res_error));
601
+ } else {
602
+ Logger({
603
+ level: "WARN",
604
+ message: `Response Validation Warnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${res_error}`,
605
+ });
606
+ }
576
607
  }
577
608
 
578
609
  return response;
@@ -644,10 +675,14 @@ class Inventory {
644
675
  );
645
676
 
646
677
  if (res_error) {
647
- Logger({
648
- level: "WARN",
649
- message: `Response Validation Warnnings for platform > Inventory > getJobConfigDefaults \n ${res_error}`,
650
- });
678
+ if (this.config.options.strictResponseCheck === true) {
679
+ return Promise.reject(new FDKResponseValidationError(res_error));
680
+ } else {
681
+ Logger({
682
+ level: "WARN",
683
+ message: `Response Validation Warnings for platform > Inventory > getJobConfigDefaults \n ${res_error}`,
684
+ });
685
+ }
651
686
  }
652
687
 
653
688
  return response;
@@ -721,10 +756,14 @@ class Inventory {
721
756
  );
722
757
 
723
758
  if (res_error) {
724
- Logger({
725
- level: "WARN",
726
- message: `Response Validation Warnnings for platform > Inventory > getJobSteps \n ${res_error}`,
727
- });
759
+ if (this.config.options.strictResponseCheck === true) {
760
+ return Promise.reject(new FDKResponseValidationError(res_error));
761
+ } else {
762
+ Logger({
763
+ level: "WARN",
764
+ message: `Response Validation Warnings for platform > Inventory > getJobSteps \n ${res_error}`,
765
+ });
766
+ }
728
767
  }
729
768
 
730
769
  return response;
@@ -802,10 +841,14 @@ class Inventory {
802
841
  );
803
842
 
804
843
  if (res_error) {
805
- Logger({
806
- level: "WARN",
807
- message: `Response Validation Warnnings for platform > Inventory > getJobsByCompany \n ${res_error}`,
808
- });
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 > Inventory > getJobsByCompany \n ${res_error}`,
850
+ });
851
+ }
809
852
  }
810
853
 
811
854
  return response;
@@ -879,10 +922,14 @@ class Inventory {
879
922
  );
880
923
 
881
924
  if (res_error) {
882
- Logger({
883
- level: "WARN",
884
- message: `Response Validation Warnnings for platform > Inventory > suppressStores \n ${res_error}`,
885
- });
925
+ if (this.config.options.strictResponseCheck === true) {
926
+ return Promise.reject(new FDKResponseValidationError(res_error));
927
+ } else {
928
+ Logger({
929
+ level: "WARN",
930
+ message: `Response Validation Warnings for platform > Inventory > suppressStores \n ${res_error}`,
931
+ });
932
+ }
886
933
  }
887
934
 
888
935
  return response;
@@ -953,10 +1000,14 @@ class Inventory {
953
1000
  });
954
1001
 
955
1002
  if (res_error) {
956
- Logger({
957
- level: "WARN",
958
- message: `Response Validation Warnnings for platform > Inventory > updateJob \n ${res_error}`,
959
- });
1003
+ if (this.config.options.strictResponseCheck === true) {
1004
+ return Promise.reject(new FDKResponseValidationError(res_error));
1005
+ } else {
1006
+ Logger({
1007
+ level: "WARN",
1008
+ message: `Response Validation Warnings for platform > Inventory > updateJob \n ${res_error}`,
1009
+ });
1010
+ }
960
1011
  }
961
1012
 
962
1013
  return response;
@@ -78,10 +78,14 @@ class Lead {
78
78
  });
79
79
 
80
80
  if (res_error) {
81
- Logger({
82
- level: "WARN",
83
- message: `Response Validation Warnnings for platform > Lead > closeVideoRoom \n ${res_error}`,
84
- });
81
+ if (this.config.options.strictResponseCheck === true) {
82
+ return Promise.reject(new FDKResponseValidationError(res_error));
83
+ } else {
84
+ Logger({
85
+ level: "WARN",
86
+ message: `Response Validation Warnings for platform > Lead > closeVideoRoom \n ${res_error}`,
87
+ });
88
+ }
85
89
  }
86
90
 
87
91
  return response;
@@ -153,10 +157,14 @@ class Lead {
153
157
  });
154
158
 
155
159
  if (res_error) {
156
- Logger({
157
- level: "WARN",
158
- message: `Response Validation Warnnings for platform > Lead > createCustomForm \n ${res_error}`,
159
- });
160
+ if (this.config.options.strictResponseCheck === true) {
161
+ return Promise.reject(new FDKResponseValidationError(res_error));
162
+ } else {
163
+ Logger({
164
+ level: "WARN",
165
+ message: `Response Validation Warnings for platform > Lead > createCustomForm \n ${res_error}`,
166
+ });
167
+ }
160
168
  }
161
169
 
162
170
  return response;
@@ -228,10 +236,14 @@ class Lead {
228
236
  });
229
237
 
230
238
  if (res_error) {
231
- Logger({
232
- level: "WARN",
233
- message: `Response Validation Warnnings for platform > Lead > createHistory \n ${res_error}`,
234
- });
239
+ if (this.config.options.strictResponseCheck === true) {
240
+ return Promise.reject(new FDKResponseValidationError(res_error));
241
+ } else {
242
+ Logger({
243
+ level: "WARN",
244
+ message: `Response Validation Warnings for platform > Lead > createHistory \n ${res_error}`,
245
+ });
246
+ }
235
247
  }
236
248
 
237
249
  return response;
@@ -305,10 +317,14 @@ class Lead {
305
317
  });
306
318
 
307
319
  if (res_error) {
308
- Logger({
309
- level: "WARN",
310
- message: `Response Validation Warnnings for platform > Lead > editCustomForm \n ${res_error}`,
311
- });
320
+ if (this.config.options.strictResponseCheck === true) {
321
+ return Promise.reject(new FDKResponseValidationError(res_error));
322
+ } else {
323
+ Logger({
324
+ level: "WARN",
325
+ message: `Response Validation Warnings for platform > Lead > editCustomForm \n ${res_error}`,
326
+ });
327
+ }
312
328
  }
313
329
 
314
330
  return response;
@@ -380,10 +396,14 @@ class Lead {
380
396
  });
381
397
 
382
398
  if (res_error) {
383
- Logger({
384
- level: "WARN",
385
- message: `Response Validation Warnnings for platform > Lead > editTicket \n ${res_error}`,
386
- });
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 > Lead > editTicket \n ${res_error}`,
405
+ });
406
+ }
387
407
  }
388
408
 
389
409
  return response;
@@ -453,10 +473,14 @@ class Lead {
453
473
  });
454
474
 
455
475
  if (res_error) {
456
- Logger({
457
- level: "WARN",
458
- message: `Response Validation Warnnings for platform > Lead > getCustomForm \n ${res_error}`,
459
- });
476
+ if (this.config.options.strictResponseCheck === true) {
477
+ return Promise.reject(new FDKResponseValidationError(res_error));
478
+ } else {
479
+ Logger({
480
+ level: "WARN",
481
+ message: `Response Validation Warnings for platform > Lead > getCustomForm \n ${res_error}`,
482
+ });
483
+ }
460
484
  }
461
485
 
462
486
  return response;
@@ -524,10 +548,14 @@ class Lead {
524
548
  });
525
549
 
526
550
  if (res_error) {
527
- Logger({
528
- level: "WARN",
529
- message: `Response Validation Warnnings for platform > Lead > getCustomForms \n ${res_error}`,
530
- });
551
+ if (this.config.options.strictResponseCheck === true) {
552
+ return Promise.reject(new FDKResponseValidationError(res_error));
553
+ } else {
554
+ Logger({
555
+ level: "WARN",
556
+ message: `Response Validation Warnings for platform > Lead > getCustomForms \n ${res_error}`,
557
+ });
558
+ }
531
559
  }
532
560
 
533
561
  return response;
@@ -597,10 +625,14 @@ class Lead {
597
625
  });
598
626
 
599
627
  if (res_error) {
600
- Logger({
601
- level: "WARN",
602
- message: `Response Validation Warnnings for platform > Lead > getTicket \n ${res_error}`,
603
- });
628
+ if (this.config.options.strictResponseCheck === true) {
629
+ return Promise.reject(new FDKResponseValidationError(res_error));
630
+ } else {
631
+ Logger({
632
+ level: "WARN",
633
+ message: `Response Validation Warnings for platform > Lead > getTicket \n ${res_error}`,
634
+ });
635
+ }
604
636
  }
605
637
 
606
638
  return response;
@@ -672,10 +704,14 @@ class Lead {
672
704
  });
673
705
 
674
706
  if (res_error) {
675
- Logger({
676
- level: "WARN",
677
- message: `Response Validation Warnnings for platform > Lead > getTicketHistory \n ${res_error}`,
678
- });
707
+ if (this.config.options.strictResponseCheck === true) {
708
+ return Promise.reject(new FDKResponseValidationError(res_error));
709
+ } else {
710
+ Logger({
711
+ level: "WARN",
712
+ message: `Response Validation Warnings for platform > Lead > getTicketHistory \n ${res_error}`,
713
+ });
714
+ }
679
715
  }
680
716
 
681
717
  return response;
@@ -763,10 +799,14 @@ class Lead {
763
799
  });
764
800
 
765
801
  if (res_error) {
766
- Logger({
767
- level: "WARN",
768
- message: `Response Validation Warnnings for platform > Lead > getTickets \n ${res_error}`,
769
- });
802
+ if (this.config.options.strictResponseCheck === true) {
803
+ return Promise.reject(new FDKResponseValidationError(res_error));
804
+ } else {
805
+ Logger({
806
+ level: "WARN",
807
+ message: `Response Validation Warnings for platform > Lead > getTickets \n ${res_error}`,
808
+ });
809
+ }
770
810
  }
771
811
 
772
812
  return response;
@@ -841,10 +881,14 @@ class Lead {
841
881
  );
842
882
 
843
883
  if (res_error) {
844
- Logger({
845
- level: "WARN",
846
- message: `Response Validation Warnnings for platform > Lead > getTokenForVideoRoom \n ${res_error}`,
847
- });
884
+ if (this.config.options.strictResponseCheck === true) {
885
+ return Promise.reject(new FDKResponseValidationError(res_error));
886
+ } else {
887
+ Logger({
888
+ level: "WARN",
889
+ message: `Response Validation Warnings for platform > Lead > getTokenForVideoRoom \n ${res_error}`,
890
+ });
891
+ }
848
892
  }
849
893
 
850
894
  return response;
@@ -920,10 +964,14 @@ class Lead {
920
964
  );
921
965
 
922
966
  if (res_error) {
923
- Logger({
924
- level: "WARN",
925
- message: `Response Validation Warnnings for platform > Lead > getVideoParticipants \n ${res_error}`,
926
- });
967
+ if (this.config.options.strictResponseCheck === true) {
968
+ return Promise.reject(new FDKResponseValidationError(res_error));
969
+ } else {
970
+ Logger({
971
+ level: "WARN",
972
+ message: `Response Validation Warnings for platform > Lead > getVideoParticipants \n ${res_error}`,
973
+ });
974
+ }
927
975
  }
928
976
 
929
977
  return response;
@@ -993,10 +1041,14 @@ class Lead {
993
1041
  });
994
1042
 
995
1043
  if (res_error) {
996
- Logger({
997
- level: "WARN",
998
- message: `Response Validation Warnnings for platform > Lead > openVideoRoom \n ${res_error}`,
999
- });
1044
+ if (this.config.options.strictResponseCheck === true) {
1045
+ return Promise.reject(new FDKResponseValidationError(res_error));
1046
+ } else {
1047
+ Logger({
1048
+ level: "WARN",
1049
+ message: `Response Validation Warnings for platform > Lead > openVideoRoom \n ${res_error}`,
1050
+ });
1051
+ }
1000
1052
  }
1001
1053
 
1002
1054
  return response;