@gofynd/fdk-client-javascript 1.4.5 → 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 (79) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +2 -2
  4. package/sdk/application/ApplicationClient.js +2 -2
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +5 -5
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +5 -5
  7. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +6 -0
  8. package/sdk/application/Catalog/CatalogApplicationModel.js +6 -0
  9. package/sdk/application/Content/ContentApplicationModel.d.ts +2 -0
  10. package/sdk/application/Content/ContentApplicationModel.js +2 -0
  11. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -2
  12. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  13. package/sdk/application/Order/OrderApplicationClient.js +1 -1
  14. package/sdk/application/Order/OrderApplicationModel.d.ts +70 -9
  15. package/sdk/application/Order/OrderApplicationModel.js +43 -7
  16. package/sdk/application/Order/OrderApplicationValidator.d.ts +2 -2
  17. package/sdk/application/Order/OrderApplicationValidator.js +1 -1
  18. package/sdk/application/Payment/PaymentApplicationModel.d.ts +18 -18
  19. package/sdk/application/Payment/PaymentApplicationModel.js +41 -35
  20. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
  21. package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
  22. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
  23. package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
  24. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
  25. package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
  26. package/sdk/application/index.d.ts +1 -1
  27. package/sdk/application/index.js +2 -2
  28. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
  29. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  30. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
  31. package/sdk/partner/Webhook/WebhookPartnerModel.js +20 -23
  32. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
  33. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
  34. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
  35. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
  36. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
  37. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
  38. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +10 -0
  39. package/sdk/platform/Cart/CartPlatformApplicationClient.js +80 -0
  40. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -1
  41. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -0
  42. package/sdk/platform/Cart/CartPlatformModel.d.ts +2 -0
  43. package/sdk/platform/Cart/CartPlatformModel.js +2 -0
  44. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +34 -7
  45. package/sdk/platform/Catalog/CatalogPlatformClient.js +88 -13
  46. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +120 -17
  47. package/sdk/platform/Catalog/CatalogPlatformModel.js +153 -27
  48. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +71 -7
  49. package/sdk/platform/Catalog/CatalogPlatformValidator.js +32 -5
  50. package/sdk/platform/Content/ContentPlatformModel.d.ts +2 -0
  51. package/sdk/platform/Content/ContentPlatformModel.js +2 -0
  52. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
  53. package/sdk/platform/Order/OrderPlatformClient.js +82 -5
  54. package/sdk/platform/Order/OrderPlatformModel.d.ts +163 -15
  55. package/sdk/platform/Order/OrderPlatformModel.js +157 -55
  56. package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
  57. package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
  58. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -2
  59. package/sdk/platform/Payment/PaymentPlatformModel.js +24 -18
  60. package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
  61. package/sdk/platform/PlatformApplicationClient.js +4 -0
  62. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -0
  63. package/sdk/platform/Webhook/WebhookPlatformClient.js +164 -0
  64. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +71 -18
  65. package/sdk/platform/Webhook/WebhookPlatformModel.js +76 -23
  66. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +19 -1
  67. package/sdk/platform/Webhook/WebhookPlatformValidator.js +24 -0
  68. package/sdk/platform/index.d.ts +1 -0
  69. package/sdk/platform/index.js +2 -0
  70. package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
  71. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  72. package/sdk/public/Webhook/WebhookPublicModel.d.ts +2 -0
  73. package/sdk/public/Webhook/WebhookPublicModel.js +3 -1
  74. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +0 -323
  75. package/sdk/application/PosCart/PosCartApplicationClient.js +0 -2364
  76. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +0 -1857
  77. package/sdk/application/PosCart/PosCartApplicationModel.js +0 -1906
  78. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +0 -483
  79. package/sdk/application/PosCart/PosCartApplicationValidator.js +0 -492
@@ -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
  */
@@ -1448,9 +1448,9 @@ class PaymentPlatformModel {
1448
1448
  retry_count: Joi.number().allow(null),
1449
1449
  card_name: Joi.string().allow("").allow(null),
1450
1450
  timeout: Joi.number().allow(null),
1451
- intent_app_error_dict_list: Joi.array().items(
1452
- PaymentPlatformModel.IntentAppErrorList()
1453
- ),
1451
+ intent_app_error_dict_list: Joi.array()
1452
+ .items(PaymentPlatformModel.IntentAppErrorList())
1453
+ .allow(null, ""),
1454
1454
  card_brand_image: Joi.string().allow("").allow(null),
1455
1455
  expired: Joi.boolean().allow(null),
1456
1456
  logo_url: PaymentPlatformModel.PaymentModeLogo(),
@@ -1459,12 +1459,16 @@ class PaymentPlatformModel {
1459
1459
  cod_charges: Joi.number().allow(null),
1460
1460
  product_cod_data: PaymentPlatformModel.ProductCODData(),
1461
1461
  cod_limit: Joi.number().allow(null),
1462
- intent_app: Joi.array().items(PaymentPlatformModel.IntentApp()),
1462
+ intent_app: Joi.array()
1463
+ .items(PaymentPlatformModel.IntentApp())
1464
+ .allow(null, ""),
1463
1465
  nickname: Joi.string().allow("").allow(null),
1464
1466
  compliant_with_tokenisation_guidelines: Joi.boolean().allow(null),
1465
1467
  exp_year: Joi.number().allow(null),
1466
1468
  name: Joi.string().allow("").allow(null),
1467
- intent_app_error_list: Joi.array().items(Joi.string().allow("")),
1469
+ intent_app_error_list: Joi.array()
1470
+ .items(Joi.string().allow(""))
1471
+ .allow(null, ""),
1468
1472
  });
1469
1473
  }
1470
1474
 
@@ -1496,7 +1500,7 @@ class PaymentPlatformModel {
1496
1500
  static AggregatorRoute() {
1497
1501
  return Joi.object({
1498
1502
  data: Joi.any().allow(null),
1499
- payment_flow_data: Joi.string().allow("").allow(null),
1503
+ payment_flow_data: Joi.any().allow(null),
1500
1504
  payment_flow: Joi.string().allow("").allow(null),
1501
1505
  api_link: Joi.string().allow("").allow(null),
1502
1506
  });
@@ -1553,9 +1557,9 @@ class PaymentPlatformModel {
1553
1557
  prepayment_value: Joi.number().allow(null),
1554
1558
  cancellation_type: Joi.string().allow("").allow(null),
1555
1559
  refund_time_limit: Joi.number().allow(null),
1556
- all_prepayment_type: Joi.array().items(
1557
- Joi.string().allow("").allow(null)
1558
- ),
1560
+ all_prepayment_type: Joi.array()
1561
+ .items(Joi.string().allow("").allow(null))
1562
+ .allow(null, ""),
1559
1563
  allow_custom_advance_amount: Joi.boolean().allow(null),
1560
1564
  });
1561
1565
  }
@@ -1576,7 +1580,9 @@ class PaymentPlatformModel {
1576
1580
  display_priority: Joi.number().allow(null),
1577
1581
  payment_mode_id: Joi.number().allow(null),
1578
1582
  display_name: Joi.string().allow("").allow(null),
1579
- list: Joi.array().items(PaymentPlatformModel.PaymentModeList()),
1583
+ list: Joi.array()
1584
+ .items(PaymentPlatformModel.PaymentModeList())
1585
+ .allow(null, ""),
1580
1586
  split: PaymentPlatformModel.SplitObject(),
1581
1587
  advance: PaymentPlatformModel.AdvanceObject(),
1582
1588
  });
@@ -1588,9 +1594,9 @@ class PaymentPlatformModel {
1588
1594
  payment_options: PaymentPlatformModel.PaymentOptionAndFlow().required(),
1589
1595
  success: Joi.boolean().required(),
1590
1596
  payment_breakup: Joi.any(),
1591
- advance_payment: Joi.array().items(
1592
- PaymentPlatformModel.AdvancePaymentObject()
1593
- ),
1597
+ advance_payment: Joi.array()
1598
+ .items(PaymentPlatformModel.AdvancePaymentObject())
1599
+ .allow(null, ""),
1594
1600
  });
1595
1601
  }
1596
1602
 
@@ -1844,9 +1850,9 @@ class PaymentPlatformModel {
1844
1850
  /** @returns {OrderBeneficiaryResponse} */
1845
1851
  static OrderBeneficiaryResponse() {
1846
1852
  return Joi.object({
1847
- beneficiaries: Joi.array().items(
1848
- PaymentPlatformModel.OrderBeneficiaryDetails()
1849
- ),
1853
+ beneficiaries: Joi.array()
1854
+ .items(PaymentPlatformModel.OrderBeneficiaryDetails())
1855
+ .allow(null, ""),
1850
1856
  show_beneficiary_details: Joi.boolean(),
1851
1857
  });
1852
1858
  }
@@ -2445,7 +2451,7 @@ class PaymentPlatformModel {
2445
2451
  static PlatformPaymentModeResponse() {
2446
2452
  return Joi.object({
2447
2453
  message: Joi.string().allow("").allow(null),
2448
- items: Joi.array().items(Joi.any()),
2454
+ items: Joi.array().items(Joi.any()).allow(null, ""),
2449
2455
  success: Joi.boolean().required(),
2450
2456
  });
2451
2457
  }
@@ -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;
@@ -107,6 +107,14 @@ export = WebhookPlatformModel;
107
107
  * @property {string} [message] - An optional message related to the ping.
108
108
  * @property {number} [code] - The HTTP status code of the ping response (e.g., 200).
109
109
  */
110
+ /**
111
+ * @typedef SubscriberEventMapping
112
+ * @property {number} [id]
113
+ * @property {number} [event_id]
114
+ * @property {number} [subscriber_id]
115
+ * @property {string} [topic]
116
+ * @property {string} [created_on]
117
+ */
110
118
  /**
111
119
  * @typedef EventConfig
112
120
  * @property {number} [id]
@@ -115,6 +123,7 @@ export = WebhookPlatformModel;
115
123
  * @property {string} [event_category]
116
124
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
117
125
  * @property {Object} [event_schema]
126
+ * @property {string} [group]
118
127
  * @property {string} [version]
119
128
  * @property {string} [display_name]
120
129
  * @property {string} [description]
@@ -150,6 +159,8 @@ export = WebhookPlatformModel;
150
159
  * @property {string} [start_date] - The start date and time of the history report.
151
160
  * @property {number[]} [subscribers] - An array of subscriber IDs associated
152
161
  * with the history report.
162
+ * @property {string[]} [webhook_type] - An array of webhook type to identify
163
+ * thetype of subscriber i.e (KAFKA or REST).
153
164
  */
154
165
  /**
155
166
  * @typedef Url
@@ -204,18 +215,12 @@ export = WebhookPlatformModel;
204
215
  * @property {string} [type]
205
216
  * @property {string} [secret]
206
217
  */
207
- /**
208
- * @typedef SubscriberEventMapping
209
- * @property {number} [id]
210
- * @property {number} [event_id]
211
- * @property {number} [subscriber_id]
212
- * @property {string} [created_on]
213
- */
214
218
  /**
215
219
  * @typedef SubscriberResponse
216
220
  * @property {number} [id]
217
221
  * @property {string} [modified_by]
218
222
  * @property {string} [name]
223
+ * @property {string} [provider]
219
224
  * @property {string} [webhook_url]
220
225
  * @property {Association} [association]
221
226
  * @property {Object} [custom_headers]
@@ -227,6 +232,24 @@ export = WebhookPlatformModel;
227
232
  * @property {AuthMeta} [auth_meta]
228
233
  * @property {EventConfig[]} [event_configs]
229
234
  */
235
+ /**
236
+ * @typedef Events
237
+ * @property {string} [slug]
238
+ * @property {string} [topic]
239
+ */
240
+ /**
241
+ * @typedef SubscriberConfigRequestV2
242
+ * @property {number} [id]
243
+ * @property {string} [name]
244
+ * @property {string} [webhook_url]
245
+ * @property {string} [provider]
246
+ * @property {Association} [association]
247
+ * @property {Object} [custom_headers]
248
+ * @property {SubscriberStatus} [status]
249
+ * @property {string} [email_id]
250
+ * @property {AuthMeta} [auth_meta]
251
+ * @property {Events[]} [events]
252
+ */
230
253
  /**
231
254
  * @typedef SubscriberConfig
232
255
  * @property {number} [id]
@@ -245,6 +268,7 @@ export = WebhookPlatformModel;
245
268
  * @property {string} [modified_by]
246
269
  * @property {string} [name]
247
270
  * @property {string} [webhook_url]
271
+ * @property {string} [provider]
248
272
  * @property {Association} [association]
249
273
  * @property {Object} [custom_headers]
250
274
  * @property {SubscriberStatus} [status]
@@ -260,11 +284,11 @@ export = WebhookPlatformModel;
260
284
  * @property {SubscriberResponse[]} [items]
261
285
  * @property {Page} [page]
262
286
  */
263
- /** @typedef {"active" | "inactive" | "blocked"} SubscriberStatus */
287
+ /** @typedef {"active" | "inactive"} SubscriberStatus */
264
288
  declare class WebhookPlatformModel {
265
289
  }
266
290
  declare namespace WebhookPlatformModel {
267
- export { Error, Event, RetryEventRequest, Item, RetryCountResponse, RetrySuccessResponse, Err, RetryFailureResponse, RetryStatusResponse, EventProcessRequest, DownloadReportResponse, EventProcessReports, EventProcessReportObject, Page, PingWebhook, PingWebhookResponse, EventConfig, EventConfigResponse, ReportFiltersPayload, ReportFilterResponse, HistoryPayload, HistoryFilters, Url, CdnObject, UploadServiceObject, HistoryAssociation, HistoryItems, HistoryResponse, CancelResponse, Association, AuthMeta, SubscriberEventMapping, SubscriberResponse, SubscriberConfig, SubscriberConfigResponse, SubscriberConfigList, SubscriberStatus };
291
+ export { Error, Event, RetryEventRequest, Item, RetryCountResponse, RetrySuccessResponse, Err, RetryFailureResponse, RetryStatusResponse, EventProcessRequest, DownloadReportResponse, EventProcessReports, EventProcessReportObject, Page, PingWebhook, PingWebhookResponse, SubscriberEventMapping, EventConfig, EventConfigResponse, ReportFiltersPayload, ReportFilterResponse, HistoryPayload, HistoryFilters, Url, CdnObject, UploadServiceObject, HistoryAssociation, HistoryItems, HistoryResponse, CancelResponse, Association, AuthMeta, SubscriberResponse, Events, SubscriberConfigRequestV2, SubscriberConfig, SubscriberConfigResponse, SubscriberConfigList, SubscriberStatus };
268
292
  }
269
293
  /** @returns {Error} */
270
294
  declare function Error(): Error;
@@ -453,6 +477,15 @@ type PingWebhookResponse = {
453
477
  */
454
478
  code?: number;
455
479
  };
480
+ /** @returns {SubscriberEventMapping} */
481
+ declare function SubscriberEventMapping(): SubscriberEventMapping;
482
+ type SubscriberEventMapping = {
483
+ id?: number;
484
+ event_id?: number;
485
+ subscriber_id?: number;
486
+ topic?: string;
487
+ created_on?: string;
488
+ };
456
489
  /** @returns {EventConfig} */
457
490
  declare function EventConfig(): EventConfig;
458
491
  type EventConfig = {
@@ -462,6 +495,7 @@ type EventConfig = {
462
495
  event_category?: string;
463
496
  subscriber_event_mapping?: SubscriberEventMapping;
464
497
  event_schema?: any;
498
+ group?: string;
465
499
  version?: string;
466
500
  display_name?: string;
467
501
  description?: string;
@@ -529,6 +563,11 @@ type HistoryFilters = {
529
563
  * with the history report.
530
564
  */
531
565
  subscribers?: number[];
566
+ /**
567
+ * - An array of webhook type to identify
568
+ * thetype of subscriber i.e (KAFKA or REST).
569
+ */
570
+ webhook_type?: string[];
532
571
  };
533
572
  /** @returns {Url} */
534
573
  declare function Url(): Url;
@@ -619,20 +658,13 @@ type AuthMeta = {
619
658
  type?: string;
620
659
  secret?: string;
621
660
  };
622
- /** @returns {SubscriberEventMapping} */
623
- declare function SubscriberEventMapping(): SubscriberEventMapping;
624
- type SubscriberEventMapping = {
625
- id?: number;
626
- event_id?: number;
627
- subscriber_id?: number;
628
- created_on?: string;
629
- };
630
661
  /** @returns {SubscriberResponse} */
631
662
  declare function SubscriberResponse(): SubscriberResponse;
632
663
  type SubscriberResponse = {
633
664
  id?: number;
634
665
  modified_by?: string;
635
666
  name?: string;
667
+ provider?: string;
636
668
  webhook_url?: string;
637
669
  association?: Association;
638
670
  custom_headers?: any;
@@ -644,6 +676,26 @@ type SubscriberResponse = {
644
676
  auth_meta?: AuthMeta;
645
677
  event_configs?: EventConfig[];
646
678
  };
679
+ /** @returns {Events} */
680
+ declare function Events(): Events;
681
+ type Events = {
682
+ slug?: string;
683
+ topic?: string;
684
+ };
685
+ /** @returns {SubscriberConfigRequestV2} */
686
+ declare function SubscriberConfigRequestV2(): SubscriberConfigRequestV2;
687
+ type SubscriberConfigRequestV2 = {
688
+ id?: number;
689
+ name?: string;
690
+ webhook_url?: string;
691
+ provider?: string;
692
+ association?: Association;
693
+ custom_headers?: any;
694
+ status?: SubscriberStatus;
695
+ email_id?: string;
696
+ auth_meta?: AuthMeta;
697
+ events?: Events[];
698
+ };
647
699
  /** @returns {SubscriberConfig} */
648
700
  declare function SubscriberConfig(): SubscriberConfig;
649
701
  type SubscriberConfig = {
@@ -664,6 +716,7 @@ type SubscriberConfigResponse = {
664
716
  modified_by?: string;
665
717
  name?: string;
666
718
  webhook_url?: string;
719
+ provider?: string;
667
720
  association?: Association;
668
721
  custom_headers?: any;
669
722
  status?: SubscriberStatus;
@@ -686,4 +739,4 @@ type SubscriberConfigList = {
686
739
  * @returns {SubscriberStatus}
687
740
  */
688
741
  declare function SubscriberStatus(): SubscriberStatus;
689
- type SubscriberStatus = "active" | "inactive" | "blocked";
742
+ type SubscriberStatus = "active" | "inactive";