@gofynd/fdk-client-javascript 1.4.6 → 1.4.8-beta.2

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 (140) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +2 -0
  4. package/sdk/application/ApplicationClient.js +2 -0
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
  6. package/sdk/application/Cart/CartApplicationClient.js +118 -13
  7. package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
  8. package/sdk/application/Cart/CartApplicationModel.js +98 -26
  9. package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
  10. package/sdk/application/Cart/CartApplicationValidator.js +26 -0
  11. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +10 -2
  12. package/sdk/application/Catalog/CatalogApplicationModel.js +10 -2
  13. package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
  14. package/sdk/application/Content/ContentApplicationClient.js +5 -3
  15. package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
  16. package/sdk/application/Content/ContentApplicationModel.js +6 -20
  17. package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
  18. package/sdk/application/Content/ContentApplicationValidator.js +4 -0
  19. package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
  20. package/sdk/application/Lead/LeadApplicationClient.js +0 -167
  21. package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
  22. package/sdk/application/Lead/LeadApplicationModel.js +0 -126
  23. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
  24. package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
  26. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
  27. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
  28. package/sdk/application/Order/OrderApplicationModel.d.ts +72 -9
  29. package/sdk/application/Order/OrderApplicationModel.js +45 -7
  30. package/sdk/application/Payment/PaymentApplicationModel.d.ts +27 -20
  31. package/sdk/application/Payment/PaymentApplicationModel.js +23 -20
  32. package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
  33. package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
  34. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
  35. package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
  36. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
  37. package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
  38. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
  39. package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
  40. package/sdk/application/index.d.ts +1 -0
  41. package/sdk/application/index.js +2 -0
  42. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
  43. package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
  44. package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
  45. package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
  46. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
  47. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
  48. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
  49. package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
  50. package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
  51. package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
  52. package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
  53. package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
  54. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  55. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  56. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
  57. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  58. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
  59. package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
  60. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
  61. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
  62. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
  63. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
  64. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
  65. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
  66. package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
  67. package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
  68. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
  69. package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
  70. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
  71. package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
  72. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +36 -3
  73. package/sdk/platform/Cart/CartPlatformApplicationClient.js +276 -3
  74. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +93 -1
  75. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +60 -0
  76. package/sdk/platform/Cart/CartPlatformModel.d.ts +216 -40
  77. package/sdk/platform/Cart/CartPlatformModel.js +166 -24
  78. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +11 -7
  79. package/sdk/platform/Catalog/CatalogPlatformClient.js +37 -14
  80. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +122 -17
  81. package/sdk/platform/Catalog/CatalogPlatformModel.js +141 -15
  82. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -7
  83. package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -5
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  85. package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
  87. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
  88. package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
  89. package/sdk/platform/Content/ContentPlatformModel.js +8 -4
  90. package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
  91. package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
  92. package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
  93. package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
  94. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
  95. package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
  96. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
  98. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
  99. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
  100. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
  101. package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
  102. package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
  103. package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
  104. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
  105. package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
  106. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
  107. package/sdk/platform/Order/OrderPlatformClient.js +82 -5
  108. package/sdk/platform/Order/OrderPlatformModel.d.ts +270 -29
  109. package/sdk/platform/Order/OrderPlatformModel.js +139 -28
  110. package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
  111. package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
  112. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +14 -2
  113. package/sdk/platform/Payment/PaymentPlatformModel.js +7 -2
  114. package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
  115. package/sdk/platform/PlatformApplicationClient.js +4 -0
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
  117. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
  118. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
  119. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
  120. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
  121. package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
  122. package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
  123. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -40
  124. package/sdk/platform/Webhook/WebhookPlatformClient.js +78 -221
  125. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +168 -167
  126. package/sdk/platform/Webhook/WebhookPlatformModel.js +180 -178
  127. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +23 -31
  128. package/sdk/platform/Webhook/WebhookPlatformValidator.js +28 -42
  129. package/sdk/platform/index.d.ts +1 -0
  130. package/sdk/platform/index.js +2 -0
  131. package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
  132. package/sdk/public/Billing/BillingPublicClient.js +156 -3
  133. package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
  134. package/sdk/public/Billing/BillingPublicModel.js +317 -18
  135. package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
  136. package/sdk/public/Billing/BillingPublicValidator.js +22 -3
  137. package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
  138. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  139. package/sdk/public/Webhook/WebhookPublicModel.d.ts +24 -22
  140. package/sdk/public/Webhook/WebhookPublicModel.js +24 -22
@@ -331,85 +331,6 @@ class Webhook {
331
331
  return response;
332
332
  }
333
333
 
334
- /**
335
- * @param {WebhookPlatformValidator.GetEventCountsParam} arg - Arg object
336
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
337
- * @param {import("../PlatformAPIClient").Options} - Options
338
- * @returns {Promise<WebhookPlatformModel.RetryCountResponse>} - Success response
339
- * @name getEventCounts
340
- * @summary: Get event counts
341
- * @description: Retrieve the counts of events based on their status. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getEventCounts/).
342
- */
343
- async getEventCounts(
344
- { body, requestHeaders } = { requestHeaders: {} },
345
- { responseHeaders } = { responseHeaders: false }
346
- ) {
347
- const { error } = WebhookPlatformValidator.getEventCounts().validate(
348
- {
349
- body,
350
- },
351
- { abortEarly: false, allowUnknown: true }
352
- );
353
- if (error) {
354
- return Promise.reject(new FDKClientValidationError(error));
355
- }
356
-
357
- // Showing warrnings if extra unknown parameters are found
358
- const {
359
- error: warrning,
360
- } = WebhookPlatformValidator.getEventCounts().validate(
361
- {
362
- body,
363
- },
364
- { abortEarly: false, allowUnknown: false }
365
- );
366
- if (warrning) {
367
- Logger({
368
- level: "WARN",
369
- message: `Parameter Validation warrnings for platform > Webhook > getEventCounts \n ${warrning}`,
370
- });
371
- }
372
-
373
- const query_params = {};
374
-
375
- const xHeaders = {};
376
-
377
- const response = await PlatformAPIClient.execute(
378
- this.config,
379
- "post",
380
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/events/counts`,
381
- query_params,
382
- body,
383
- { ...xHeaders, ...requestHeaders },
384
- { responseHeaders }
385
- );
386
-
387
- let responseData = response;
388
- if (responseHeaders) {
389
- responseData = response[0];
390
- }
391
-
392
- const {
393
- error: res_error,
394
- } = WebhookPlatformModel.RetryCountResponse().validate(responseData, {
395
- abortEarly: false,
396
- allowUnknown: true,
397
- });
398
-
399
- if (res_error) {
400
- if (this.config.options.strictResponseCheck === true) {
401
- return Promise.reject(new FDKResponseValidationError(res_error));
402
- } else {
403
- Logger({
404
- level: "WARN",
405
- message: `Response Validation Warnings for platform > Webhook > getEventCounts \n ${res_error}`,
406
- });
407
- }
408
- }
409
-
410
- return response;
411
- }
412
-
413
334
  /**
414
335
  * @param {WebhookPlatformValidator.GetHistoricalReportsParam} arg - Arg object
415
336
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -489,81 +410,6 @@ class Webhook {
489
410
  return response;
490
411
  }
491
412
 
492
- /**
493
- * @param {WebhookPlatformValidator.GetManualRetryStatusParam} arg - Arg object
494
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
495
- * @param {import("../PlatformAPIClient").Options} - Options
496
- * @returns {Promise<WebhookPlatformModel.RetryStatusResponse>} - Success response
497
- * @name getManualRetryStatus
498
- * @summary: Get manual retry status
499
- * @description: Check the status of a manual retry operation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getManualRetryStatus/).
500
- */
501
- async getManualRetryStatus(
502
- { requestHeaders } = { requestHeaders: {} },
503
- { responseHeaders } = { responseHeaders: false }
504
- ) {
505
- const { error } = WebhookPlatformValidator.getManualRetryStatus().validate(
506
- {},
507
- { abortEarly: false, allowUnknown: true }
508
- );
509
- if (error) {
510
- return Promise.reject(new FDKClientValidationError(error));
511
- }
512
-
513
- // Showing warrnings if extra unknown parameters are found
514
- const {
515
- error: warrning,
516
- } = WebhookPlatformValidator.getManualRetryStatus().validate(
517
- {},
518
- { abortEarly: false, allowUnknown: false }
519
- );
520
- if (warrning) {
521
- Logger({
522
- level: "WARN",
523
- message: `Parameter Validation warrnings for platform > Webhook > getManualRetryStatus \n ${warrning}`,
524
- });
525
- }
526
-
527
- const query_params = {};
528
-
529
- const xHeaders = {};
530
-
531
- const response = await PlatformAPIClient.execute(
532
- this.config,
533
- "get",
534
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/status`,
535
- query_params,
536
- undefined,
537
- { ...xHeaders, ...requestHeaders },
538
- { responseHeaders }
539
- );
540
-
541
- let responseData = response;
542
- if (responseHeaders) {
543
- responseData = response[0];
544
- }
545
-
546
- const {
547
- error: res_error,
548
- } = WebhookPlatformModel.RetryStatusResponse().validate(responseData, {
549
- abortEarly: false,
550
- allowUnknown: true,
551
- });
552
-
553
- if (res_error) {
554
- if (this.config.options.strictResponseCheck === true) {
555
- return Promise.reject(new FDKResponseValidationError(res_error));
556
- } else {
557
- Logger({
558
- level: "WARN",
559
- message: `Response Validation Warnings for platform > Webhook > getManualRetryStatus \n ${res_error}`,
560
- });
561
- }
562
- }
563
-
564
- return response;
565
- }
566
-
567
413
  /**
568
414
  * @param {WebhookPlatformValidator.GetReportFiltersParam} arg - Arg object
569
415
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -895,20 +741,22 @@ class Webhook {
895
741
  }
896
742
 
897
743
  /**
898
- * @param {WebhookPlatformValidator.ManualRetryCancelParam} arg - Arg object
744
+ * @param {WebhookPlatformValidator.PingWebhookParam} arg - Arg object
899
745
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
900
746
  * @param {import("../PlatformAPIClient").Options} - Options
901
- * @returns {Promise<string>} - Success response
902
- * @name manualRetryCancel
903
- * @summary: Manual retry cancellation
904
- * @description: Cancel a manual retry operation for a failed event. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryCancel/).
747
+ * @returns {Promise<WebhookPlatformModel.PingWebhookResponse>} - Success response
748
+ * @name pingWebhook
749
+ * @summary: Ping webhook
750
+ * @description: Send a test ping to a webhook for verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/pingWebhook/).
905
751
  */
906
- async manualRetryCancel(
907
- { requestHeaders } = { requestHeaders: {} },
752
+ async pingWebhook(
753
+ { body, requestHeaders } = { requestHeaders: {} },
908
754
  { responseHeaders } = { responseHeaders: false }
909
755
  ) {
910
- const { error } = WebhookPlatformValidator.manualRetryCancel().validate(
911
- {},
756
+ const { error } = WebhookPlatformValidator.pingWebhook().validate(
757
+ {
758
+ body,
759
+ },
912
760
  { abortEarly: false, allowUnknown: true }
913
761
  );
914
762
  if (error) {
@@ -916,16 +764,16 @@ class Webhook {
916
764
  }
917
765
 
918
766
  // Showing warrnings if extra unknown parameters are found
919
- const {
920
- error: warrning,
921
- } = WebhookPlatformValidator.manualRetryCancel().validate(
922
- {},
767
+ const { error: warrning } = WebhookPlatformValidator.pingWebhook().validate(
768
+ {
769
+ body,
770
+ },
923
771
  { abortEarly: false, allowUnknown: false }
924
772
  );
925
773
  if (warrning) {
926
774
  Logger({
927
775
  level: "WARN",
928
- message: `Parameter Validation warrnings for platform > Webhook > manualRetryCancel \n ${warrning}`,
776
+ message: `Parameter Validation warrnings for platform > Webhook > pingWebhook \n ${warrning}`,
929
777
  });
930
778
  }
931
779
 
@@ -935,10 +783,10 @@ class Webhook {
935
783
 
936
784
  const response = await PlatformAPIClient.execute(
937
785
  this.config,
938
- "delete",
939
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/cancel`,
786
+ "post",
787
+ `/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/ping`,
940
788
  query_params,
941
- undefined,
789
+ body,
942
790
  { ...xHeaders, ...requestHeaders },
943
791
  { responseHeaders }
944
792
  );
@@ -948,9 +796,12 @@ class Webhook {
948
796
  responseData = response[0];
949
797
  }
950
798
 
951
- const { error: res_error } = Joi.string()
952
- .allow("")
953
- .validate(responseData, { abortEarly: false, allowUnknown: true });
799
+ const {
800
+ error: res_error,
801
+ } = WebhookPlatformModel.PingWebhookResponse().validate(responseData, {
802
+ abortEarly: false,
803
+ allowUnknown: true,
804
+ });
954
805
 
955
806
  if (res_error) {
956
807
  if (this.config.options.strictResponseCheck === true) {
@@ -958,7 +809,7 @@ class Webhook {
958
809
  } else {
959
810
  Logger({
960
811
  level: "WARN",
961
- message: `Response Validation Warnings for platform > Webhook > manualRetryCancel \n ${res_error}`,
812
+ message: `Response Validation Warnings for platform > Webhook > pingWebhook \n ${res_error}`,
962
813
  });
963
814
  }
964
815
  }
@@ -967,21 +818,22 @@ class Webhook {
967
818
  }
968
819
 
969
820
  /**
970
- * @param {WebhookPlatformValidator.ManualRetryOfFailedEventParam} arg - Arg object
821
+ * @param {WebhookPlatformValidator.RegisterSubscriberToEventParam} arg - Arg object
971
822
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
972
823
  * @param {import("../PlatformAPIClient").Options} - Options
973
- * @returns {Promise<WebhookPlatformModel.RetrySuccessResponse>} - Success response
974
- * @name manualRetryOfFailedEvent
975
- * @summary: Manual retry of failed event
976
- * @description: Trigger a manual retry for an event that failed to deliver. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryOfFailedEvent/).
824
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
825
+ * Success response
826
+ * @name registerSubscriberToEvent
827
+ * @summary: Register subscriber to event
828
+ * @description: Add a subscriber to receive events of a specific type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEvent/).
977
829
  */
978
- async manualRetryOfFailedEvent(
830
+ async registerSubscriberToEvent(
979
831
  { body, requestHeaders } = { requestHeaders: {} },
980
832
  { responseHeaders } = { responseHeaders: false }
981
833
  ) {
982
834
  const {
983
835
  error,
984
- } = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
836
+ } = WebhookPlatformValidator.registerSubscriberToEvent().validate(
985
837
  {
986
838
  body,
987
839
  },
@@ -994,7 +846,7 @@ class Webhook {
994
846
  // Showing warrnings if extra unknown parameters are found
995
847
  const {
996
848
  error: warrning,
997
- } = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
849
+ } = WebhookPlatformValidator.registerSubscriberToEvent().validate(
998
850
  {
999
851
  body,
1000
852
  },
@@ -1003,7 +855,7 @@ class Webhook {
1003
855
  if (warrning) {
1004
856
  Logger({
1005
857
  level: "WARN",
1006
- message: `Parameter Validation warrnings for platform > Webhook > manualRetryOfFailedEvent \n ${warrning}`,
858
+ message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEvent \n ${warrning}`,
1007
859
  });
1008
860
  }
1009
861
 
@@ -1014,7 +866,7 @@ class Webhook {
1014
866
  const response = await PlatformAPIClient.execute(
1015
867
  this.config,
1016
868
  "post",
1017
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/retry`,
869
+ `/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/`,
1018
870
  query_params,
1019
871
  body,
1020
872
  { ...xHeaders, ...requestHeaders },
@@ -1028,7 +880,7 @@ class Webhook {
1028
880
 
1029
881
  const {
1030
882
  error: res_error,
1031
- } = WebhookPlatformModel.RetrySuccessResponse().validate(responseData, {
883
+ } = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
1032
884
  abortEarly: false,
1033
885
  allowUnknown: true,
1034
886
  });
@@ -1039,7 +891,7 @@ class Webhook {
1039
891
  } else {
1040
892
  Logger({
1041
893
  level: "WARN",
1042
- message: `Response Validation Warnings for platform > Webhook > manualRetryOfFailedEvent \n ${res_error}`,
894
+ message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEvent \n ${res_error}`,
1043
895
  });
1044
896
  }
1045
897
  }
@@ -1048,19 +900,23 @@ class Webhook {
1048
900
  }
1049
901
 
1050
902
  /**
1051
- * @param {WebhookPlatformValidator.PingWebhookParam} arg - Arg object
903
+ * @param {WebhookPlatformValidator.RegisterSubscriberToEventV2Param} arg - Arg object
1052
904
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1053
905
  * @param {import("../PlatformAPIClient").Options} - Options
1054
- * @returns {Promise<WebhookPlatformModel.PingWebhookResponse>} - Success response
1055
- * @name pingWebhook
1056
- * @summary: Ping webhook
1057
- * @description: Send a test ping to a webhook for verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/pingWebhook/).
906
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
907
+ * Success response
908
+ * @name registerSubscriberToEventV2
909
+ * @summary: Register Subscriber.
910
+ * @description: Register Subscriber.
911
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEventV2/).
1058
912
  */
1059
- async pingWebhook(
913
+ async registerSubscriberToEventV2(
1060
914
  { body, requestHeaders } = { requestHeaders: {} },
1061
915
  { responseHeaders } = { responseHeaders: false }
1062
916
  ) {
1063
- const { error } = WebhookPlatformValidator.pingWebhook().validate(
917
+ const {
918
+ error,
919
+ } = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
1064
920
  {
1065
921
  body,
1066
922
  },
@@ -1071,7 +927,9 @@ class Webhook {
1071
927
  }
1072
928
 
1073
929
  // Showing warrnings if extra unknown parameters are found
1074
- const { error: warrning } = WebhookPlatformValidator.pingWebhook().validate(
930
+ const {
931
+ error: warrning,
932
+ } = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
1075
933
  {
1076
934
  body,
1077
935
  },
@@ -1080,7 +938,7 @@ class Webhook {
1080
938
  if (warrning) {
1081
939
  Logger({
1082
940
  level: "WARN",
1083
- message: `Parameter Validation warrnings for platform > Webhook > pingWebhook \n ${warrning}`,
941
+ message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEventV2 \n ${warrning}`,
1084
942
  });
1085
943
  }
1086
944
 
@@ -1091,7 +949,7 @@ class Webhook {
1091
949
  const response = await PlatformAPIClient.execute(
1092
950
  this.config,
1093
951
  "post",
1094
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/ping`,
952
+ `/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
1095
953
  query_params,
1096
954
  body,
1097
955
  { ...xHeaders, ...requestHeaders },
@@ -1105,7 +963,7 @@ class Webhook {
1105
963
 
1106
964
  const {
1107
965
  error: res_error,
1108
- } = WebhookPlatformModel.PingWebhookResponse().validate(responseData, {
966
+ } = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
1109
967
  abortEarly: false,
1110
968
  allowUnknown: true,
1111
969
  });
@@ -1116,7 +974,7 @@ class Webhook {
1116
974
  } else {
1117
975
  Logger({
1118
976
  level: "WARN",
1119
- message: `Response Validation Warnings for platform > Webhook > pingWebhook \n ${res_error}`,
977
+ message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEventV2 \n ${res_error}`,
1120
978
  });
1121
979
  }
1122
980
  }
@@ -1125,22 +983,22 @@ class Webhook {
1125
983
  }
1126
984
 
1127
985
  /**
1128
- * @param {WebhookPlatformValidator.RegisterSubscriberToEventParam} arg - Arg object
986
+ * @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
1129
987
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1130
988
  * @param {import("../PlatformAPIClient").Options} - Options
1131
989
  * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
1132
990
  * Success response
1133
- * @name registerSubscriberToEvent
1134
- * @summary: Register subscriber to event
1135
- * @description: Add a subscriber to receive events of a specific type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEvent/).
991
+ * @name updateSubscriberConfig
992
+ * @summary: Update a subscriber config
993
+ * @description: Modify and update subscriber configuration settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
1136
994
  */
1137
- async registerSubscriberToEvent(
995
+ async updateSubscriberConfig(
1138
996
  { body, requestHeaders } = { requestHeaders: {} },
1139
997
  { responseHeaders } = { responseHeaders: false }
1140
998
  ) {
1141
999
  const {
1142
1000
  error,
1143
- } = WebhookPlatformValidator.registerSubscriberToEvent().validate(
1001
+ } = WebhookPlatformValidator.updateSubscriberConfig().validate(
1144
1002
  {
1145
1003
  body,
1146
1004
  },
@@ -1153,7 +1011,7 @@ class Webhook {
1153
1011
  // Showing warrnings if extra unknown parameters are found
1154
1012
  const {
1155
1013
  error: warrning,
1156
- } = WebhookPlatformValidator.registerSubscriberToEvent().validate(
1014
+ } = WebhookPlatformValidator.updateSubscriberConfig().validate(
1157
1015
  {
1158
1016
  body,
1159
1017
  },
@@ -1162,7 +1020,7 @@ class Webhook {
1162
1020
  if (warrning) {
1163
1021
  Logger({
1164
1022
  level: "WARN",
1165
- message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEvent \n ${warrning}`,
1023
+ message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberConfig \n ${warrning}`,
1166
1024
  });
1167
1025
  }
1168
1026
 
@@ -1172,7 +1030,7 @@ class Webhook {
1172
1030
 
1173
1031
  const response = await PlatformAPIClient.execute(
1174
1032
  this.config,
1175
- "post",
1033
+ "put",
1176
1034
  `/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/`,
1177
1035
  query_params,
1178
1036
  body,
@@ -1198,7 +1056,7 @@ class Webhook {
1198
1056
  } else {
1199
1057
  Logger({
1200
1058
  level: "WARN",
1201
- message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEvent \n ${res_error}`,
1059
+ message: `Response Validation Warnings for platform > Webhook > updateSubscriberConfig \n ${res_error}`,
1202
1060
  });
1203
1061
  }
1204
1062
  }
@@ -1207,22 +1065,21 @@ class Webhook {
1207
1065
  }
1208
1066
 
1209
1067
  /**
1210
- * @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
1068
+ * @param {WebhookPlatformValidator.UpdateSubscriberV2Param} arg - Arg object
1211
1069
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1212
1070
  * @param {import("../PlatformAPIClient").Options} - Options
1213
1071
  * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
1214
1072
  * Success response
1215
- * @name updateSubscriberConfig
1216
- * @summary: Update a subscriber config
1217
- * @description: Modify and update subscriber configuration settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
1073
+ * @name updateSubscriberV2
1074
+ * @summary: Update Subscriber.
1075
+ * @description: Update Subscriber.
1076
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberV2/).
1218
1077
  */
1219
- async updateSubscriberConfig(
1078
+ async updateSubscriberV2(
1220
1079
  { body, requestHeaders } = { requestHeaders: {} },
1221
1080
  { responseHeaders } = { responseHeaders: false }
1222
1081
  ) {
1223
- const {
1224
- error,
1225
- } = WebhookPlatformValidator.updateSubscriberConfig().validate(
1082
+ const { error } = WebhookPlatformValidator.updateSubscriberV2().validate(
1226
1083
  {
1227
1084
  body,
1228
1085
  },
@@ -1235,7 +1092,7 @@ class Webhook {
1235
1092
  // Showing warrnings if extra unknown parameters are found
1236
1093
  const {
1237
1094
  error: warrning,
1238
- } = WebhookPlatformValidator.updateSubscriberConfig().validate(
1095
+ } = WebhookPlatformValidator.updateSubscriberV2().validate(
1239
1096
  {
1240
1097
  body,
1241
1098
  },
@@ -1244,7 +1101,7 @@ class Webhook {
1244
1101
  if (warrning) {
1245
1102
  Logger({
1246
1103
  level: "WARN",
1247
- message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberConfig \n ${warrning}`,
1104
+ message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberV2 \n ${warrning}`,
1248
1105
  });
1249
1106
  }
1250
1107
 
@@ -1255,7 +1112,7 @@ class Webhook {
1255
1112
  const response = await PlatformAPIClient.execute(
1256
1113
  this.config,
1257
1114
  "put",
1258
- `/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/`,
1115
+ `/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
1259
1116
  query_params,
1260
1117
  body,
1261
1118
  { ...xHeaders, ...requestHeaders },
@@ -1280,7 +1137,7 @@ class Webhook {
1280
1137
  } else {
1281
1138
  Logger({
1282
1139
  level: "WARN",
1283
- message: `Response Validation Warnings for platform > Webhook > updateSubscriberConfig \n ${res_error}`,
1140
+ message: `Response Validation Warnings for platform > Webhook > updateSubscriberV2 \n ${res_error}`,
1284
1141
  });
1285
1142
  }
1286
1143
  }