@gofynd/fdk-client-javascript 1.4.6 → 1.4.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 (66) 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/Catalog/CatalogApplicationModel.d.ts +6 -0
  6. package/sdk/application/Catalog/CatalogApplicationModel.js +6 -0
  7. package/sdk/application/Content/ContentApplicationModel.d.ts +2 -0
  8. package/sdk/application/Content/ContentApplicationModel.js +2 -0
  9. package/sdk/application/Order/OrderApplicationModel.d.ts +70 -9
  10. package/sdk/application/Order/OrderApplicationModel.js +43 -7
  11. package/sdk/application/Payment/PaymentApplicationModel.d.ts +18 -18
  12. package/sdk/application/Payment/PaymentApplicationModel.js +18 -18
  13. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
  14. package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
  15. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
  16. package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
  17. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
  18. package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
  19. package/sdk/application/index.d.ts +1 -0
  20. package/sdk/application/index.js +2 -0
  21. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
  22. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  23. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
  24. package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
  25. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
  26. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
  27. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
  28. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
  29. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
  30. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
  31. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +10 -0
  32. package/sdk/platform/Cart/CartPlatformApplicationClient.js +80 -0
  33. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -1
  34. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -0
  35. package/sdk/platform/Cart/CartPlatformModel.d.ts +2 -0
  36. package/sdk/platform/Cart/CartPlatformModel.js +2 -0
  37. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +9 -5
  38. package/sdk/platform/Catalog/CatalogPlatformClient.js +19 -12
  39. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +118 -17
  40. package/sdk/platform/Catalog/CatalogPlatformModel.js +137 -15
  41. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +12 -7
  42. package/sdk/platform/Catalog/CatalogPlatformValidator.js +7 -5
  43. package/sdk/platform/Content/ContentPlatformModel.d.ts +2 -0
  44. package/sdk/platform/Content/ContentPlatformModel.js +2 -0
  45. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
  46. package/sdk/platform/Order/OrderPlatformClient.js +82 -5
  47. package/sdk/platform/Order/OrderPlatformModel.d.ts +163 -15
  48. package/sdk/platform/Order/OrderPlatformModel.js +92 -14
  49. package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
  50. package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
  51. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -2
  52. package/sdk/platform/Payment/PaymentPlatformModel.js +2 -2
  53. package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
  54. package/sdk/platform/PlatformApplicationClient.js +4 -0
  55. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -0
  56. package/sdk/platform/Webhook/WebhookPlatformClient.js +164 -0
  57. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +71 -18
  58. package/sdk/platform/Webhook/WebhookPlatformModel.js +75 -22
  59. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +19 -1
  60. package/sdk/platform/Webhook/WebhookPlatformValidator.js +24 -0
  61. package/sdk/platform/index.d.ts +1 -0
  62. package/sdk/platform/index.js +2 -0
  63. package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
  64. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  65. package/sdk/public/Webhook/WebhookPublicModel.d.ts +2 -0
  66. package/sdk/public/Webhook/WebhookPublicModel.js +2 -0
@@ -31,7 +31,6 @@ export = OrderPlatformValidator;
31
31
  */
32
32
  /**
33
33
  * @typedef DispatchManifestsParam
34
- * @property {string} manifestId
35
34
  * @property {OrderPlatformModel.DispatchManifest} body
36
35
  */
37
36
  /**
@@ -69,6 +68,10 @@ export = OrderPlatformValidator;
69
68
  * @property {string} [shipmentId]
70
69
  * @property {string} [documentType]
71
70
  */
71
+ /**
72
+ * @typedef GenerateProcessManifestParam
73
+ * @property {OrderPlatformModel.ProcessManifestRequest} body
74
+ */
72
75
  /**
73
76
  * @typedef GetAllowedStateTransitionParam
74
77
  * @property {string} orderingChannel - Ordering channel
@@ -151,16 +154,18 @@ export = OrderPlatformValidator;
151
154
  */
152
155
  /**
153
156
  * @typedef GetManifestShipmentsParam
154
- * @property {number} dpIds
155
- * @property {string} stores
156
- * @property {string} toDate
157
- * @property {string} fromDate
158
- * @property {string} [dpName]
159
- * @property {string} [salesChannels]
160
- * @property {string} [searchType]
161
- * @property {string} [searchValue]
162
- * @property {string} [pageNo]
163
- * @property {string} [pageSize]
157
+ * @property {string} dpIds - Filter shipments with the specific Courier partner
158
+ * Ids which is a combination of courier partner extension and scheme Ids.
159
+ * @property {number} stores - Filter with the specific store.
160
+ * @property {string} toDate - End date for the shipment search range.
161
+ * @property {string} fromDate - Start date for the shipment search range.
162
+ * @property {string} [dpName] - Filter with the specific courier partner name.
163
+ * @property {string} [salesChannels] - Comma-separated list of sales channels.
164
+ * @property {string} [searchType] - Type of search (e.g., by shipment ID, order
165
+ * ID, AWB number).
166
+ * @property {string} [searchValue] - Value to search for based on the search type.
167
+ * @property {number} [pageNo] - Page number for pagination.
168
+ * @property {number} [pageSize] - Number of records per page for pagination.
164
169
  */
165
170
  /**
166
171
  * @typedef GetManifestfiltersParam
@@ -398,6 +403,8 @@ declare class OrderPlatformValidator {
398
403
  static generateInvoiceID(): GenerateInvoiceIDParam;
399
404
  /** @returns {GeneratePOSReceiptByOrderIdParam} */
400
405
  static generatePOSReceiptByOrderId(): GeneratePOSReceiptByOrderIdParam;
406
+ /** @returns {GenerateProcessManifestParam} */
407
+ static generateProcessManifest(): GenerateProcessManifestParam;
401
408
  /** @returns {GetAllowedStateTransitionParam} */
402
409
  static getAllowedStateTransition(): GetAllowedStateTransitionParam;
403
410
  /** @returns {GetAllowedTemplatesForBulkParam} */
@@ -480,7 +487,7 @@ declare class OrderPlatformValidator {
480
487
  static verifyMobileOTP(): VerifyMobileOTPParam;
481
488
  }
482
489
  declare namespace OrderPlatformValidator {
483
- export { AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateChannelConfigParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FetchCreditBalanceDetailParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetChannelConfigParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ProcessManifestsParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
490
+ export { AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateChannelConfigParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FetchCreditBalanceDetailParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GenerateProcessManifestParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetChannelConfigParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ProcessManifestsParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
484
491
  }
485
492
  type AttachOrderUserParam = {
486
493
  body: OrderPlatformModel.AttachOrderUser;
@@ -528,7 +535,6 @@ type CreateOrderParam = {
528
535
  body: OrderPlatformModel.CreateOrderAPI;
529
536
  };
530
537
  type DispatchManifestsParam = {
531
- manifestId: string;
532
538
  body: OrderPlatformModel.DispatchManifest;
533
539
  };
534
540
  type DownloadBulkActionTemplateParam = {
@@ -567,6 +573,9 @@ type GeneratePOSReceiptByOrderIdParam = {
567
573
  shipmentId?: string;
568
574
  documentType?: string;
569
575
  };
576
+ type GenerateProcessManifestParam = {
577
+ body: OrderPlatformModel.ProcessManifestRequest;
578
+ };
570
579
  type GetAllowedStateTransitionParam = {
571
580
  /**
572
581
  * - Ordering channel
@@ -745,16 +754,48 @@ type GetManifestDetailsParam = {
745
754
  manifestId: string;
746
755
  };
747
756
  type GetManifestShipmentsParam = {
748
- dpIds: number;
749
- stores: string;
757
+ /**
758
+ * - Filter shipments with the specific Courier partner
759
+ * Ids which is a combination of courier partner extension and scheme Ids.
760
+ */
761
+ dpIds: string;
762
+ /**
763
+ * - Filter with the specific store.
764
+ */
765
+ stores: number;
766
+ /**
767
+ * - End date for the shipment search range.
768
+ */
750
769
  toDate: string;
770
+ /**
771
+ * - Start date for the shipment search range.
772
+ */
751
773
  fromDate: string;
774
+ /**
775
+ * - Filter with the specific courier partner name.
776
+ */
752
777
  dpName?: string;
778
+ /**
779
+ * - Comma-separated list of sales channels.
780
+ */
753
781
  salesChannels?: string;
782
+ /**
783
+ * - Type of search (e.g., by shipment ID, order
784
+ * ID, AWB number).
785
+ */
754
786
  searchType?: string;
787
+ /**
788
+ * - Value to search for based on the search type.
789
+ */
755
790
  searchValue?: string;
756
- pageNo?: string;
757
- pageSize?: string;
791
+ /**
792
+ * - Page number for pagination.
793
+ */
794
+ pageNo?: number;
795
+ /**
796
+ * - Number of records per page for pagination.
797
+ */
798
+ pageSize?: number;
758
799
  };
759
800
  type GetManifestfiltersParam = {
760
801
  /**
@@ -40,7 +40,6 @@ const OrderPlatformModel = require("./OrderPlatformModel");
40
40
 
41
41
  /**
42
42
  * @typedef DispatchManifestsParam
43
- * @property {string} manifestId
44
43
  * @property {OrderPlatformModel.DispatchManifest} body
45
44
  */
46
45
 
@@ -87,6 +86,11 @@ const OrderPlatformModel = require("./OrderPlatformModel");
87
86
  * @property {string} [documentType]
88
87
  */
89
88
 
89
+ /**
90
+ * @typedef GenerateProcessManifestParam
91
+ * @property {OrderPlatformModel.ProcessManifestRequest} body
92
+ */
93
+
90
94
  /**
91
95
  * @typedef GetAllowedStateTransitionParam
92
96
  * @property {string} orderingChannel - Ordering channel
@@ -180,16 +184,18 @@ const OrderPlatformModel = require("./OrderPlatformModel");
180
184
 
181
185
  /**
182
186
  * @typedef GetManifestShipmentsParam
183
- * @property {number} dpIds
184
- * @property {string} stores
185
- * @property {string} toDate
186
- * @property {string} fromDate
187
- * @property {string} [dpName]
188
- * @property {string} [salesChannels]
189
- * @property {string} [searchType]
190
- * @property {string} [searchValue]
191
- * @property {string} [pageNo]
192
- * @property {string} [pageSize]
187
+ * @property {string} dpIds - Filter shipments with the specific Courier partner
188
+ * Ids which is a combination of courier partner extension and scheme Ids.
189
+ * @property {number} stores - Filter with the specific store.
190
+ * @property {string} toDate - End date for the shipment search range.
191
+ * @property {string} fromDate - Start date for the shipment search range.
192
+ * @property {string} [dpName] - Filter with the specific courier partner name.
193
+ * @property {string} [salesChannels] - Comma-separated list of sales channels.
194
+ * @property {string} [searchType] - Type of search (e.g., by shipment ID, order
195
+ * ID, AWB number).
196
+ * @property {string} [searchValue] - Value to search for based on the search type.
197
+ * @property {number} [pageNo] - Page number for pagination.
198
+ * @property {number} [pageSize] - Number of records per page for pagination.
193
199
  */
194
200
 
195
201
  /**
@@ -477,7 +483,6 @@ class OrderPlatformValidator {
477
483
  /** @returns {DispatchManifestsParam} */
478
484
  static dispatchManifests() {
479
485
  return Joi.object({
480
- manifestId: Joi.string().allow("").required(),
481
486
  body: OrderPlatformModel.DispatchManifest().required(),
482
487
  }).required();
483
488
  }
@@ -541,6 +546,13 @@ class OrderPlatformValidator {
541
546
  }).required();
542
547
  }
543
548
 
549
+ /** @returns {GenerateProcessManifestParam} */
550
+ static generateProcessManifest() {
551
+ return Joi.object({
552
+ body: OrderPlatformModel.ProcessManifestRequest().required(),
553
+ }).required();
554
+ }
555
+
544
556
  /** @returns {GetAllowedStateTransitionParam} */
545
557
  static getAllowedStateTransition() {
546
558
  return Joi.object({
@@ -658,16 +670,16 @@ class OrderPlatformValidator {
658
670
  /** @returns {GetManifestShipmentsParam} */
659
671
  static getManifestShipments() {
660
672
  return Joi.object({
661
- dpIds: Joi.number().required(),
662
- stores: Joi.string().allow("").required(),
673
+ dpIds: Joi.string().allow("").required(),
674
+ stores: Joi.number().required(),
663
675
  toDate: Joi.string().allow("").required(),
664
676
  fromDate: Joi.string().allow("").required(),
665
677
  dpName: Joi.string().allow(""),
666
678
  salesChannels: Joi.string().allow(""),
667
679
  searchType: Joi.string().allow(""),
668
680
  searchValue: Joi.string().allow(""),
669
- pageNo: Joi.string().allow(""),
670
- pageSize: Joi.string().allow(""),
681
+ pageNo: Joi.number(),
682
+ pageSize: Joi.number(),
671
683
  }).required();
672
684
  }
673
685
 
@@ -132,7 +132,7 @@ export = PaymentPlatformModel;
132
132
  /**
133
133
  * @typedef AggregatorRoute
134
134
  * @property {Object} [data] - Data
135
- * @property {string} [payment_flow_data] - Payment_flow_data
135
+ * @property {Object} [payment_flow_data] - Payment_flow_data
136
136
  * @property {string} [payment_flow] - Payment_flow
137
137
  * @property {string} [api_link] - Api_link
138
138
  */
@@ -1561,7 +1561,7 @@ type AggregatorRoute = {
1561
1561
  /**
1562
1562
  * - Payment_flow_data
1563
1563
  */
1564
- payment_flow_data?: string;
1564
+ payment_flow_data?: any;
1565
1565
  /**
1566
1566
  * - Payment_flow
1567
1567
  */
@@ -148,7 +148,7 @@ const Joi = require("joi");
148
148
  /**
149
149
  * @typedef AggregatorRoute
150
150
  * @property {Object} [data] - Data
151
- * @property {string} [payment_flow_data] - Payment_flow_data
151
+ * @property {Object} [payment_flow_data] - Payment_flow_data
152
152
  * @property {string} [payment_flow] - Payment_flow
153
153
  * @property {string} [api_link] - Api_link
154
154
  */
@@ -1500,7 +1500,7 @@ class PaymentPlatformModel {
1500
1500
  static AggregatorRoute() {
1501
1501
  return Joi.object({
1502
1502
  data: Joi.any().allow(null),
1503
- payment_flow_data: Joi.string().allow("").allow(null),
1503
+ payment_flow_data: Joi.any().allow(null),
1504
1504
  payment_flow: Joi.string().allow("").allow(null),
1505
1505
  api_link: Joi.string().allow("").allow(null),
1506
1506
  });
@@ -15,6 +15,7 @@ declare class PlatformApplicationClient {
15
15
  config: import("./PlatformConfig");
16
16
  companyId: string;
17
17
  applicationId: string;
18
+ analytics: Analytics;
18
19
  cart: Cart;
19
20
  catalog: Catalog;
20
21
  communication: Communication;
@@ -38,6 +39,7 @@ declare class PlatformApplicationClient {
38
39
  */
39
40
  setExtraHeaders(header: object): void;
40
41
  }
42
+ import Analytics = require("./Analytics/AnalyticsPlatformApplicationClient");
41
43
  import Cart = require("./Cart/CartPlatformApplicationClient");
42
44
  import Catalog = require("./Catalog/CatalogPlatformApplicationClient");
43
45
  import Communication = require("./Communication/CommunicationPlatformApplicationClient");
@@ -1,3 +1,5 @@
1
+ const Analytics = require("./Analytics/AnalyticsPlatformApplicationClient");
2
+
1
3
  const Cart = require("./Cart/CartPlatformApplicationClient");
2
4
 
3
5
  const Catalog = require("./Catalog/CatalogPlatformApplicationClient");
@@ -47,6 +49,8 @@ class PlatformApplicationClient {
47
49
  this.companyId = config.companyId;
48
50
  this.applicationId = applicationId;
49
51
 
52
+ this.analytics = new Analytics(config, applicationId);
53
+
50
54
  this.cart = new Cart(config, applicationId);
51
55
 
52
56
  this.catalog = new Catalog(config, applicationId);
@@ -154,6 +154,18 @@ declare class Webhook {
154
154
  * @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/).
155
155
  */
156
156
  registerSubscriberToEvent({ body, requestHeaders }?: WebhookPlatformValidator.RegisterSubscriberToEventParam, { responseHeaders }?: object): Promise<WebhookPlatformModel.SubscriberConfigResponse>;
157
+ /**
158
+ * @param {WebhookPlatformValidator.RegisterSubscriberToEventV2Param} arg - Arg object
159
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
160
+ * @param {import("../PlatformAPIClient").Options} - Options
161
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
162
+ * Success response
163
+ * @name registerSubscriberToEventV2
164
+ * @summary: Register Subscriber.
165
+ * @description: Register Subscriber.
166
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEventV2/).
167
+ */
168
+ registerSubscriberToEventV2({ body, requestHeaders }?: WebhookPlatformValidator.RegisterSubscriberToEventV2Param, { responseHeaders }?: object): Promise<WebhookPlatformModel.SubscriberConfigResponse>;
157
169
  /**
158
170
  * @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
159
171
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -165,6 +177,18 @@ declare class Webhook {
165
177
  * @description: Modify and update subscriber configuration settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
166
178
  */
167
179
  updateSubscriberConfig({ body, requestHeaders }?: WebhookPlatformValidator.UpdateSubscriberConfigParam, { responseHeaders }?: object): Promise<WebhookPlatformModel.SubscriberConfigResponse>;
180
+ /**
181
+ * @param {WebhookPlatformValidator.UpdateSubscriberV2Param} arg - Arg object
182
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
183
+ * @param {import("../PlatformAPIClient").Options} - Options
184
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
185
+ * Success response
186
+ * @name updateSubscriberV2
187
+ * @summary: Update Subscriber.
188
+ * @description: Update Subscriber.
189
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberV2/).
190
+ */
191
+ updateSubscriberV2({ body, requestHeaders }?: WebhookPlatformValidator.UpdateSubscriberV2Param, { responseHeaders }?: object): Promise<WebhookPlatformModel.SubscriberConfigResponse>;
168
192
  }
169
193
  import WebhookPlatformValidator = require("./WebhookPlatformValidator");
170
194
  import WebhookPlatformModel = require("./WebhookPlatformModel");
@@ -1206,6 +1206,89 @@ class Webhook {
1206
1206
  return response;
1207
1207
  }
1208
1208
 
1209
+ /**
1210
+ * @param {WebhookPlatformValidator.RegisterSubscriberToEventV2Param} arg - Arg object
1211
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1212
+ * @param {import("../PlatformAPIClient").Options} - Options
1213
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
1214
+ * Success response
1215
+ * @name registerSubscriberToEventV2
1216
+ * @summary: Register Subscriber.
1217
+ * @description: Register Subscriber.
1218
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEventV2/).
1219
+ */
1220
+ async registerSubscriberToEventV2(
1221
+ { body, requestHeaders } = { requestHeaders: {} },
1222
+ { responseHeaders } = { responseHeaders: false }
1223
+ ) {
1224
+ const {
1225
+ error,
1226
+ } = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
1227
+ {
1228
+ body,
1229
+ },
1230
+ { abortEarly: false, allowUnknown: true }
1231
+ );
1232
+ if (error) {
1233
+ return Promise.reject(new FDKClientValidationError(error));
1234
+ }
1235
+
1236
+ // Showing warrnings if extra unknown parameters are found
1237
+ const {
1238
+ error: warrning,
1239
+ } = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
1240
+ {
1241
+ body,
1242
+ },
1243
+ { abortEarly: false, allowUnknown: false }
1244
+ );
1245
+ if (warrning) {
1246
+ Logger({
1247
+ level: "WARN",
1248
+ message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEventV2 \n ${warrning}`,
1249
+ });
1250
+ }
1251
+
1252
+ const query_params = {};
1253
+
1254
+ const xHeaders = {};
1255
+
1256
+ const response = await PlatformAPIClient.execute(
1257
+ this.config,
1258
+ "post",
1259
+ `/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
1260
+ query_params,
1261
+ body,
1262
+ { ...xHeaders, ...requestHeaders },
1263
+ { responseHeaders }
1264
+ );
1265
+
1266
+ let responseData = response;
1267
+ if (responseHeaders) {
1268
+ responseData = response[0];
1269
+ }
1270
+
1271
+ const {
1272
+ error: res_error,
1273
+ } = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
1274
+ abortEarly: false,
1275
+ allowUnknown: true,
1276
+ });
1277
+
1278
+ if (res_error) {
1279
+ if (this.config.options.strictResponseCheck === true) {
1280
+ return Promise.reject(new FDKResponseValidationError(res_error));
1281
+ } else {
1282
+ Logger({
1283
+ level: "WARN",
1284
+ message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEventV2 \n ${res_error}`,
1285
+ });
1286
+ }
1287
+ }
1288
+
1289
+ return response;
1290
+ }
1291
+
1209
1292
  /**
1210
1293
  * @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
1211
1294
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -1287,6 +1370,87 @@ class Webhook {
1287
1370
 
1288
1371
  return response;
1289
1372
  }
1373
+
1374
+ /**
1375
+ * @param {WebhookPlatformValidator.UpdateSubscriberV2Param} arg - Arg object
1376
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1377
+ * @param {import("../PlatformAPIClient").Options} - Options
1378
+ * @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
1379
+ * Success response
1380
+ * @name updateSubscriberV2
1381
+ * @summary: Update Subscriber.
1382
+ * @description: Update Subscriber.
1383
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberV2/).
1384
+ */
1385
+ async updateSubscriberV2(
1386
+ { body, requestHeaders } = { requestHeaders: {} },
1387
+ { responseHeaders } = { responseHeaders: false }
1388
+ ) {
1389
+ const { error } = WebhookPlatformValidator.updateSubscriberV2().validate(
1390
+ {
1391
+ body,
1392
+ },
1393
+ { abortEarly: false, allowUnknown: true }
1394
+ );
1395
+ if (error) {
1396
+ return Promise.reject(new FDKClientValidationError(error));
1397
+ }
1398
+
1399
+ // Showing warrnings if extra unknown parameters are found
1400
+ const {
1401
+ error: warrning,
1402
+ } = WebhookPlatformValidator.updateSubscriberV2().validate(
1403
+ {
1404
+ body,
1405
+ },
1406
+ { abortEarly: false, allowUnknown: false }
1407
+ );
1408
+ if (warrning) {
1409
+ Logger({
1410
+ level: "WARN",
1411
+ message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberV2 \n ${warrning}`,
1412
+ });
1413
+ }
1414
+
1415
+ const query_params = {};
1416
+
1417
+ const xHeaders = {};
1418
+
1419
+ const response = await PlatformAPIClient.execute(
1420
+ this.config,
1421
+ "put",
1422
+ `/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
1423
+ query_params,
1424
+ body,
1425
+ { ...xHeaders, ...requestHeaders },
1426
+ { responseHeaders }
1427
+ );
1428
+
1429
+ let responseData = response;
1430
+ if (responseHeaders) {
1431
+ responseData = response[0];
1432
+ }
1433
+
1434
+ const {
1435
+ error: res_error,
1436
+ } = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
1437
+ abortEarly: false,
1438
+ allowUnknown: true,
1439
+ });
1440
+
1441
+ if (res_error) {
1442
+ if (this.config.options.strictResponseCheck === true) {
1443
+ return Promise.reject(new FDKResponseValidationError(res_error));
1444
+ } else {
1445
+ Logger({
1446
+ level: "WARN",
1447
+ message: `Response Validation Warnings for platform > Webhook > updateSubscriberV2 \n ${res_error}`,
1448
+ });
1449
+ }
1450
+ }
1451
+
1452
+ return response;
1453
+ }
1290
1454
  }
1291
1455
 
1292
1456
  module.exports = Webhook;