@gofynd/fdk-client-javascript 1.4.15 → 1.4.16-beta.1

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 (75) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +11 -11
  4. package/sdk/application/Cart/CartApplicationClient.js +343 -48
  5. package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
  6. package/sdk/application/Common/CommonApplicationClient.js +21 -0
  7. package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
  8. package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
  9. package/sdk/application/Content/ContentApplicationClient.d.ts +20 -0
  10. package/sdk/application/Content/ContentApplicationClient.js +327 -0
  11. package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
  12. package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
  13. package/sdk/application/Lead/LeadApplicationClient.js +73 -0
  14. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
  15. package/sdk/application/Logistic/LogisticApplicationClient.js +182 -2
  16. package/sdk/application/Order/OrderApplicationClient.js +202 -0
  17. package/sdk/application/Payment/PaymentApplicationClient.d.ts +0 -10
  18. package/sdk/application/Payment/PaymentApplicationClient.js +445 -38
  19. package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
  20. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  21. package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
  22. package/sdk/application/User/UserApplicationClient.js +412 -0
  23. package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
  24. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +12 -33
  25. package/sdk/partner/Logistics/LogisticsPartnerClient.js +38 -209
  26. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +19 -399
  27. package/sdk/partner/Logistics/LogisticsPartnerModel.js +11 -212
  28. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -3
  29. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -22
  30. package/sdk/partner/OAuthClient.js +1 -0
  31. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  32. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  33. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +1 -1
  34. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  35. package/sdk/platform/Cart/CartPlatformApplicationClient.js +12 -3
  36. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -1
  37. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -1
  38. package/sdk/platform/Cart/CartPlatformModel.d.ts +14 -28
  39. package/sdk/platform/Cart/CartPlatformModel.js +7 -13
  40. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +0 -24
  41. package/sdk/platform/Catalog/CatalogPlatformClient.js +0 -176
  42. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +29 -80
  43. package/sdk/platform/Catalog/CatalogPlatformModel.js +32 -72
  44. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1 -45
  45. package/sdk/platform/Catalog/CatalogPlatformValidator.js +0 -35
  46. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  47. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  48. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +52 -0
  49. package/sdk/platform/Content/ContentPlatformApplicationClient.js +411 -0
  50. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +85 -1
  51. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +73 -0
  52. package/sdk/platform/Content/ContentPlatformModel.d.ts +90 -1
  53. package/sdk/platform/Content/ContentPlatformModel.js +104 -0
  54. package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
  55. package/sdk/platform/Order/OrderPlatformClient.js +0 -8
  56. package/sdk/platform/Order/OrderPlatformModel.d.ts +3 -75
  57. package/sdk/platform/Order/OrderPlatformModel.js +2 -43
  58. package/sdk/platform/Order/OrderPlatformValidator.d.ts +0 -22
  59. package/sdk/platform/Order/OrderPlatformValidator.js +0 -10
  60. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +10 -0
  61. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +118 -0
  62. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +53 -1
  63. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +29 -0
  64. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +0 -104
  65. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +74 -816
  66. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +23 -598
  67. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +20 -382
  68. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +1 -191
  69. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +0 -138
  70. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  71. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  72. package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
  73. package/sdk/public/Content/ContentPublicClient.js +116 -0
  74. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  75. package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
@@ -58,6 +58,14 @@ class Content {
58
58
  { requestHeaders } = { requestHeaders: {} },
59
59
  { responseHeaders } = { responseHeaders: false }
60
60
  ) {
61
+ let invalidInput = [];
62
+ if (invalidInput.length) {
63
+ const error = new Error();
64
+ error.message = "Missing required field";
65
+ error.details = invalidInput;
66
+ return Promise.reject(new FDKClientValidationError(error));
67
+ }
68
+
61
69
  const { error } = ContentPublicValidator.getAllTags().validate(
62
70
  {},
63
71
  { abortEarly: false, allowUnknown: true }
@@ -134,6 +142,14 @@ class Content {
134
142
  { requestHeaders } = { requestHeaders: {} },
135
143
  { responseHeaders } = { responseHeaders: false }
136
144
  ) {
145
+ let invalidInput = [];
146
+ if (invalidInput.length) {
147
+ const error = new Error();
148
+ error.message = "Missing required field";
149
+ error.details = invalidInput;
150
+ return Promise.reject(new FDKClientValidationError(error));
151
+ }
152
+
137
153
  const { error } = ContentPublicValidator.getAnalyticsTags().validate(
138
154
  {},
139
155
  { abortEarly: false, allowUnknown: true }
@@ -212,6 +228,14 @@ class Content {
212
228
  { requestHeaders } = { requestHeaders: {} },
213
229
  { responseHeaders } = { responseHeaders: false }
214
230
  ) {
231
+ let invalidInput = [];
232
+ if (invalidInput.length) {
233
+ const error = new Error();
234
+ error.message = "Missing required field";
235
+ error.details = invalidInput;
236
+ return Promise.reject(new FDKClientValidationError(error));
237
+ }
238
+
215
239
  const { error } = ContentPublicValidator.getBasicDetails().validate(
216
240
  {},
217
241
  { abortEarly: false, allowUnknown: true }
@@ -290,6 +314,21 @@ class Content {
290
314
  { entityType, requestHeaders } = { requestHeaders: {} },
291
315
  { responseHeaders } = { responseHeaders: false }
292
316
  ) {
317
+ let invalidInput = [];
318
+
319
+ if (!entityType) {
320
+ invalidInput.push({
321
+ message: `The 'entityType' field is required.`,
322
+ path: ["entityType"],
323
+ });
324
+ }
325
+ if (invalidInput.length) {
326
+ const error = new Error();
327
+ error.message = "Missing required field";
328
+ error.details = invalidInput;
329
+ return Promise.reject(new FDKClientValidationError(error));
330
+ }
331
+
293
332
  const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
294
333
  { entityType },
295
334
  { abortEarly: false, allowUnknown: true }
@@ -368,6 +407,21 @@ class Content {
368
407
  { slug, requestHeaders } = { requestHeaders: {} },
369
408
  { responseHeaders } = { responseHeaders: false }
370
409
  ) {
410
+ let invalidInput = [];
411
+
412
+ if (!slug) {
413
+ invalidInput.push({
414
+ message: `The 'slug' field is required.`,
415
+ path: ["slug"],
416
+ });
417
+ }
418
+ if (invalidInput.length) {
419
+ const error = new Error();
420
+ error.message = "Missing required field";
421
+ error.details = invalidInput;
422
+ return Promise.reject(new FDKClientValidationError(error));
423
+ }
424
+
371
425
  const { error } = ContentPublicValidator.getCustomPage().validate(
372
426
  { slug },
373
427
  { abortEarly: false, allowUnknown: true }
@@ -444,6 +498,14 @@ class Content {
444
498
  { requestHeaders } = { requestHeaders: {} },
445
499
  { responseHeaders } = { responseHeaders: false }
446
500
  ) {
501
+ let invalidInput = [];
502
+ if (invalidInput.length) {
503
+ const error = new Error();
504
+ error.message = "Missing required field";
505
+ error.details = invalidInput;
506
+ return Promise.reject(new FDKClientValidationError(error));
507
+ }
508
+
447
509
  const { error } = ContentPublicValidator.getFooterContent().validate(
448
510
  {},
449
511
  { abortEarly: false, allowUnknown: true }
@@ -522,6 +584,21 @@ class Content {
522
584
  { pageType, requestHeaders } = { requestHeaders: {} },
523
585
  { responseHeaders } = { responseHeaders: false }
524
586
  ) {
587
+ let invalidInput = [];
588
+
589
+ if (!pageType) {
590
+ invalidInput.push({
591
+ message: `The 'pageType' field is required.`,
592
+ path: ["pageType"],
593
+ });
594
+ }
595
+ if (invalidInput.length) {
596
+ const error = new Error();
597
+ error.message = "Missing required field";
598
+ error.details = invalidInput;
599
+ return Promise.reject(new FDKClientValidationError(error));
600
+ }
601
+
525
602
  const { error } = ContentPublicValidator.getHomePageContent().validate(
526
603
  { pageType },
527
604
  { abortEarly: false, allowUnknown: true }
@@ -601,6 +678,14 @@ class Content {
601
678
  { requestHeaders } = { requestHeaders: {} },
602
679
  { responseHeaders } = { responseHeaders: false }
603
680
  ) {
681
+ let invalidInput = [];
682
+ if (invalidInput.length) {
683
+ const error = new Error();
684
+ error.message = "Missing required field";
685
+ error.details = invalidInput;
686
+ return Promise.reject(new FDKClientValidationError(error));
687
+ }
688
+
604
689
  const { error } = ContentPublicValidator.getMenuContent().validate(
605
690
  {},
606
691
  { abortEarly: false, allowUnknown: true }
@@ -679,6 +764,21 @@ class Content {
679
764
  { type, requestHeaders } = { requestHeaders: {} },
680
765
  { responseHeaders } = { responseHeaders: false }
681
766
  ) {
767
+ let invalidInput = [];
768
+
769
+ if (!type) {
770
+ invalidInput.push({
771
+ message: `The 'type' field is required.`,
772
+ path: ["type"],
773
+ });
774
+ }
775
+ if (invalidInput.length) {
776
+ const error = new Error();
777
+ error.message = "Missing required field";
778
+ error.details = invalidInput;
779
+ return Promise.reject(new FDKClientValidationError(error));
780
+ }
781
+
682
782
  const { error } = ContentPublicValidator.getMenuContentByType().validate(
683
783
  { type },
684
784
  { abortEarly: false, allowUnknown: true }
@@ -757,6 +857,14 @@ class Content {
757
857
  { requestHeaders } = { requestHeaders: {} },
758
858
  { responseHeaders } = { responseHeaders: false }
759
859
  ) {
860
+ let invalidInput = [];
861
+ if (invalidInput.length) {
862
+ const error = new Error();
863
+ error.message = "Missing required field";
864
+ error.details = invalidInput;
865
+ return Promise.reject(new FDKClientValidationError(error));
866
+ }
867
+
760
868
  const { error } = ContentPublicValidator.getNavbar().validate(
761
869
  {},
762
870
  { abortEarly: false, allowUnknown: true }
@@ -833,6 +941,14 @@ class Content {
833
941
  { requestHeaders } = { requestHeaders: {} },
834
942
  { responseHeaders } = { responseHeaders: false }
835
943
  ) {
944
+ let invalidInput = [];
945
+ if (invalidInput.length) {
946
+ const error = new Error();
947
+ error.message = "Missing required field";
948
+ error.details = invalidInput;
949
+ return Promise.reject(new FDKClientValidationError(error));
950
+ }
951
+
836
952
  const { error } = ContentPublicValidator.getPricingBanner().validate(
837
953
  {},
838
954
  { abortEarly: false, allowUnknown: true }
@@ -48,6 +48,21 @@ class Partner {
48
48
  { slug, requestHeaders } = { requestHeaders: {} },
49
49
  { responseHeaders } = { responseHeaders: false }
50
50
  ) {
51
+ let invalidInput = [];
52
+
53
+ if (!slug) {
54
+ invalidInput.push({
55
+ message: `The 'slug' field is required.`,
56
+ path: ["slug"],
57
+ });
58
+ }
59
+ if (invalidInput.length) {
60
+ const error = new Error();
61
+ error.message = "Missing required field";
62
+ error.details = invalidInput;
63
+ return Promise.reject(new FDKClientValidationError(error));
64
+ }
65
+
51
66
  const {
52
67
  error,
53
68
  } = PartnerPublicValidator.getPanelExtensionDetails().validate(
@@ -55,6 +55,14 @@ class Webhook {
55
55
  { requestHeaders } = { requestHeaders: {} },
56
56
  { responseHeaders } = { responseHeaders: false }
57
57
  ) {
58
+ let invalidInput = [];
59
+ if (invalidInput.length) {
60
+ const error = new Error();
61
+ error.message = "Missing required field";
62
+ error.details = invalidInput;
63
+ return Promise.reject(new FDKClientValidationError(error));
64
+ }
65
+
58
66
  const { error } = WebhookPublicValidator.fetchAllWebhookEvents().validate(
59
67
  {},
60
68
  { abortEarly: false, allowUnknown: true }
@@ -133,6 +141,14 @@ class Webhook {
133
141
  { requestHeaders } = { requestHeaders: {} },
134
142
  { responseHeaders } = { responseHeaders: false }
135
143
  ) {
144
+ let invalidInput = [];
145
+ if (invalidInput.length) {
146
+ const error = new Error();
147
+ error.message = "Missing required field";
148
+ error.details = invalidInput;
149
+ return Promise.reject(new FDKClientValidationError(error));
150
+ }
151
+
136
152
  const { error } = WebhookPublicValidator.notifyDepricatedEvent().validate(
137
153
  {},
138
154
  { abortEarly: false, allowUnknown: true }
@@ -211,6 +227,14 @@ class Webhook {
211
227
  { body, requestHeaders } = { requestHeaders: {} },
212
228
  { responseHeaders } = { responseHeaders: false }
213
229
  ) {
230
+ let invalidInput = [];
231
+ if (invalidInput.length) {
232
+ const error = new Error();
233
+ error.message = "Missing required field";
234
+ error.details = invalidInput;
235
+ return Promise.reject(new FDKClientValidationError(error));
236
+ }
237
+
214
238
  const {
215
239
  error,
216
240
  } = WebhookPublicValidator.queryWebhookEventDetails().validate(
@@ -291,6 +315,14 @@ class Webhook {
291
315
  { body, requestHeaders } = { requestHeaders: {} },
292
316
  { responseHeaders } = { responseHeaders: false }
293
317
  ) {
318
+ let invalidInput = [];
319
+ if (invalidInput.length) {
320
+ const error = new Error();
321
+ error.message = "Missing required field";
322
+ error.details = invalidInput;
323
+ return Promise.reject(new FDKClientValidationError(error));
324
+ }
325
+
294
326
  const {
295
327
  error,
296
328
  } = WebhookPublicValidator.testHandlerTransformation().validate(
@@ -371,6 +403,14 @@ class Webhook {
371
403
  { body, requestHeaders } = { requestHeaders: {} },
372
404
  { responseHeaders } = { responseHeaders: false }
373
405
  ) {
406
+ let invalidInput = [];
407
+ if (invalidInput.length) {
408
+ const error = new Error();
409
+ error.message = "Missing required field";
410
+ error.details = invalidInput;
411
+ return Promise.reject(new FDKClientValidationError(error));
412
+ }
413
+
374
414
  const { error } = WebhookPublicValidator.validateSchema().validate(
375
415
  { body },
376
416
  { abortEarly: false, allowUnknown: true }