@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
@@ -1,10 +1,5 @@
1
1
  const Joi = require("joi");
2
2
 
3
- /**
4
- * @typedef Error
5
- * @property {string} [error] - Error message describing the reason for the failure.
6
- */
7
-
8
3
  /**
9
4
  * @typedef Event
10
5
  * @property {string} [event_name]
@@ -13,62 +8,14 @@ const Joi = require("joi");
13
8
  * @property {string} [version]
14
9
  */
15
10
 
16
- /**
17
- * @typedef RetryEventRequest
18
- * @property {string} [search_text]
19
- * @property {string} [end_date]
20
- * @property {string} [start_date]
21
- * @property {number[]} [subscriber_ids]
22
- * @property {Event[]} [event]
23
- * @property {string} [status]
24
- */
25
-
26
- /**
27
- * @typedef Item
28
- * @property {string} [status]
29
- * @property {number} [count]
30
- */
31
-
32
- /**
33
- * @typedef RetryCountResponse
34
- * @property {Item[]} [items]
35
- */
36
-
37
- /**
38
- * @typedef RetrySuccessResponse
39
- * @property {boolean} [success]
40
- * @property {string} [message]
41
- */
42
-
43
- /**
44
- * @typedef Err
45
- * @property {string} [msg]
46
- * @property {string} [param]
47
- * @property {string} [location]
48
- */
49
-
50
- /**
51
- * @typedef RetryFailureResponse
52
- * @property {Err[]} [err]
53
- */
54
-
55
- /**
56
- * @typedef RetryStatusResponse
57
- * @property {number} [total_event] - The total number of events that require retry.
58
- * @property {number} [success_count] - The count of successfully retried events.
59
- * @property {number} [failure_count] - The count of failed retry attempts.
60
- * @property {string} [status] - The overall status of the retry process (e.g.,
61
- * "completed").
62
- */
63
-
64
11
  /**
65
12
  * @typedef EventProcessRequest
66
- * @property {string} [search_text]
67
- * @property {string} [end_date]
68
- * @property {string} [start_date]
69
- * @property {number[]} [subscriber_ids]
70
- * @property {string} [status]
71
- * @property {Event[]} [event]
13
+ * @property {string} search_text
14
+ * @property {string} end_date
15
+ * @property {string} start_date
16
+ * @property {number[]} subscriber_ids
17
+ * @property {string} status
18
+ * @property {Event[]} event
72
19
  */
73
20
 
74
21
  /**
@@ -111,7 +58,7 @@ const Joi = require("joi");
111
58
 
112
59
  /**
113
60
  * @typedef PingWebhook
114
- * @property {string} [webhook_url] - The URL of the subscriber's webhook to ping.
61
+ * @property {string} webhook_url - The URL of the subscriber's webhook to ping.
115
62
  * @property {Object} [auth_meta] - Authentication metadata (if required by the
116
63
  * subscriber).
117
64
  * @property {Object} [custom_headers] - Custom headers to include in the ping request.
@@ -124,6 +71,15 @@ const Joi = require("joi");
124
71
  * @property {number} [code] - The HTTP status code of the ping response (e.g., 200).
125
72
  */
126
73
 
74
+ /**
75
+ * @typedef SubscriberEventMapping
76
+ * @property {number} [id]
77
+ * @property {number} [event_id]
78
+ * @property {number} [subscriber_id]
79
+ * @property {string} [topic]
80
+ * @property {string} [created_on]
81
+ */
82
+
127
83
  /**
128
84
  * @typedef EventConfig
129
85
  * @property {number} [id]
@@ -132,6 +88,7 @@ const Joi = require("joi");
132
88
  * @property {string} [event_category]
133
89
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
134
90
  * @property {Object} [event_schema]
91
+ * @property {string} [group]
135
92
  * @property {string} [version]
136
93
  * @property {string} [display_name]
137
94
  * @property {string} [description]
@@ -146,7 +103,7 @@ const Joi = require("joi");
146
103
 
147
104
  /**
148
105
  * @typedef ReportFiltersPayload
149
- * @property {number[]} [subscriber_ids] - An array of subscriber IDs for
106
+ * @property {number[]} subscriber_ids - An array of subscriber IDs for
150
107
  * filtering filters (optional).
151
108
  */
152
109
 
@@ -158,7 +115,7 @@ const Joi = require("joi");
158
115
 
159
116
  /**
160
117
  * @typedef HistoryPayload
161
- * @property {string} [type] - The type of history report (e.g., "platform").
118
+ * @property {string} type - The type of history report (e.g., "platform").
162
119
  * @property {number} [page_no] - The page number of the history report.
163
120
  * @property {number} [page_size] - The number of records per page.
164
121
  */
@@ -172,6 +129,8 @@ const Joi = require("joi");
172
129
  * @property {string} [start_date] - The start date and time of the history report.
173
130
  * @property {number[]} [subscribers] - An array of subscriber IDs associated
174
131
  * with the history report.
132
+ * @property {string[]} [webhook_type] - An array of webhook type to identify
133
+ * thetype of subscriber i.e (KAFKA or REST).
175
134
  */
176
135
 
177
136
  /**
@@ -224,6 +183,13 @@ const Joi = require("joi");
224
183
 
225
184
  /**
226
185
  * @typedef Association
186
+ * @property {string[]} [application_id]
187
+ * @property {string} [extension_id]
188
+ * @property {string} [criteria]
189
+ */
190
+
191
+ /**
192
+ * @typedef AssociationResp
227
193
  * @property {number} [company_id]
228
194
  * @property {string[]} [application_id]
229
195
  * @property {string} [extension_id]
@@ -236,21 +202,14 @@ const Joi = require("joi");
236
202
  * @property {string} [secret]
237
203
  */
238
204
 
239
- /**
240
- * @typedef SubscriberEventMapping
241
- * @property {number} [id]
242
- * @property {number} [event_id]
243
- * @property {number} [subscriber_id]
244
- * @property {string} [created_on]
245
- */
246
-
247
205
  /**
248
206
  * @typedef SubscriberResponse
249
207
  * @property {number} [id]
250
208
  * @property {string} [modified_by]
251
209
  * @property {string} [name]
210
+ * @property {string} [provider]
252
211
  * @property {string} [webhook_url]
253
- * @property {Association} [association]
212
+ * @property {AssociationResp} [association]
254
213
  * @property {Object} [custom_headers]
255
214
  * @property {SubscriberStatus} [status]
256
215
  * @property {string} [email_id]
@@ -262,16 +221,61 @@ const Joi = require("joi");
262
221
  */
263
222
 
264
223
  /**
265
- * @typedef SubscriberConfig
266
- * @property {number} [id]
224
+ * @typedef Events
225
+ * @property {string} [slug]
226
+ * @property {string} [topic]
227
+ */
228
+
229
+ /**
230
+ * @typedef SubscriberConfigPostRequestV2
267
231
  * @property {string} [name]
268
232
  * @property {string} [webhook_url]
269
- * @property {Association} [association]
233
+ * @property {string} provider
234
+ * @property {Association} association
270
235
  * @property {Object} [custom_headers]
271
- * @property {SubscriberStatus} [status]
272
- * @property {string} [email_id]
236
+ * @property {SubscriberStatus} status
237
+ * @property {string} email_id
273
238
  * @property {AuthMeta} [auth_meta]
274
- * @property {number[]} [event_id]
239
+ * @property {Events[]} [events]
240
+ */
241
+
242
+ /**
243
+ * @typedef SubscriberConfigUpdateRequestV2
244
+ * @property {number} id
245
+ * @property {string} [name]
246
+ * @property {string} [webhook_url]
247
+ * @property {string} provider
248
+ * @property {Association} association
249
+ * @property {Object} [custom_headers]
250
+ * @property {SubscriberStatus} status
251
+ * @property {string} email_id
252
+ * @property {AuthMeta} [auth_meta]
253
+ * @property {Events[]} [events]
254
+ */
255
+
256
+ /**
257
+ * @typedef SubscriberConfigPost
258
+ * @property {string} [name]
259
+ * @property {string} webhook_url
260
+ * @property {Association} association
261
+ * @property {Object} [custom_headers]
262
+ * @property {SubscriberStatus} status
263
+ * @property {string} email_id
264
+ * @property {AuthMeta} [auth_meta]
265
+ * @property {number[]} event_id
266
+ */
267
+
268
+ /**
269
+ * @typedef SubscriberConfigUpdate
270
+ * @property {number} id
271
+ * @property {string} [name]
272
+ * @property {string} webhook_url
273
+ * @property {Association} association
274
+ * @property {Object} [custom_headers]
275
+ * @property {SubscriberStatus} status
276
+ * @property {string} email_id
277
+ * @property {AuthMeta} [auth_meta]
278
+ * @property {number[]} event_id
275
279
  */
276
280
 
277
281
  /**
@@ -280,7 +284,8 @@ const Joi = require("joi");
280
284
  * @property {string} [modified_by]
281
285
  * @property {string} [name]
282
286
  * @property {string} [webhook_url]
283
- * @property {Association} [association]
287
+ * @property {string} [provider]
288
+ * @property {AssociationResp} [association]
284
289
  * @property {Object} [custom_headers]
285
290
  * @property {SubscriberStatus} [status]
286
291
  * @property {string} [email_id]
@@ -297,16 +302,9 @@ const Joi = require("joi");
297
302
  * @property {Page} [page]
298
303
  */
299
304
 
300
- /** @typedef {"active" | "inactive" | "blocked"} SubscriberStatus */
305
+ /** @typedef {"active" | "inactive"} SubscriberStatus */
301
306
 
302
307
  class WebhookPlatformModel {
303
- /** @returns {Error} */
304
- static Error() {
305
- return Joi.object({
306
- error: Joi.string().allow(""),
307
- });
308
- }
309
-
310
308
  /** @returns {Event} */
311
309
  static Event() {
312
310
  return Joi.object({
@@ -317,76 +315,15 @@ class WebhookPlatformModel {
317
315
  });
318
316
  }
319
317
 
320
- /** @returns {RetryEventRequest} */
321
- static RetryEventRequest() {
322
- return Joi.object({
323
- search_text: Joi.string().allow(""),
324
- end_date: Joi.string().allow(""),
325
- start_date: Joi.string().allow(""),
326
- subscriber_ids: Joi.array().items(Joi.number()),
327
- event: Joi.array().items(WebhookPlatformModel.Event()),
328
- status: Joi.string().allow(""),
329
- });
330
- }
331
-
332
- /** @returns {Item} */
333
- static Item() {
334
- return Joi.object({
335
- status: Joi.string().allow(""),
336
- count: Joi.number(),
337
- });
338
- }
339
-
340
- /** @returns {RetryCountResponse} */
341
- static RetryCountResponse() {
342
- return Joi.object({
343
- items: Joi.array().items(WebhookPlatformModel.Item()),
344
- });
345
- }
346
-
347
- /** @returns {RetrySuccessResponse} */
348
- static RetrySuccessResponse() {
349
- return Joi.object({
350
- success: Joi.boolean(),
351
- message: Joi.string().allow(""),
352
- });
353
- }
354
-
355
- /** @returns {Err} */
356
- static Err() {
357
- return Joi.object({
358
- msg: Joi.string().allow(""),
359
- param: Joi.string().allow(""),
360
- location: Joi.string().allow(""),
361
- });
362
- }
363
-
364
- /** @returns {RetryFailureResponse} */
365
- static RetryFailureResponse() {
366
- return Joi.object({
367
- err: Joi.array().items(WebhookPlatformModel.Err()),
368
- });
369
- }
370
-
371
- /** @returns {RetryStatusResponse} */
372
- static RetryStatusResponse() {
373
- return Joi.object({
374
- total_event: Joi.number(),
375
- success_count: Joi.number(),
376
- failure_count: Joi.number(),
377
- status: Joi.string().allow(""),
378
- });
379
- }
380
-
381
318
  /** @returns {EventProcessRequest} */
382
319
  static EventProcessRequest() {
383
320
  return Joi.object({
384
- search_text: Joi.string().allow(""),
385
- end_date: Joi.string().allow(""),
386
- start_date: Joi.string().allow(""),
387
- subscriber_ids: Joi.array().items(Joi.number()),
388
- status: Joi.string().allow(""),
389
- event: Joi.array().items(WebhookPlatformModel.Event()),
321
+ search_text: Joi.string().allow("").required(),
322
+ end_date: Joi.string().allow("").required(),
323
+ start_date: Joi.string().allow("").required(),
324
+ subscriber_ids: Joi.array().items(Joi.number()).required(),
325
+ status: Joi.string().allow("").required(),
326
+ event: Joi.array().items(WebhookPlatformModel.Event()).required(),
390
327
  });
391
328
  }
392
329
 
@@ -439,7 +376,7 @@ class WebhookPlatformModel {
439
376
  /** @returns {PingWebhook} */
440
377
  static PingWebhook() {
441
378
  return Joi.object({
442
- webhook_url: Joi.string().allow(""),
379
+ webhook_url: Joi.string().allow("").required(),
443
380
  auth_meta: Joi.any(),
444
381
  custom_headers: Joi.any(),
445
382
  });
@@ -454,6 +391,17 @@ class WebhookPlatformModel {
454
391
  });
455
392
  }
456
393
 
394
+ /** @returns {SubscriberEventMapping} */
395
+ static SubscriberEventMapping() {
396
+ return Joi.object({
397
+ id: Joi.number(),
398
+ event_id: Joi.number(),
399
+ subscriber_id: Joi.number(),
400
+ topic: Joi.string().allow("").allow(null),
401
+ created_on: Joi.string().allow(""),
402
+ });
403
+ }
404
+
457
405
  /** @returns {EventConfig} */
458
406
  static EventConfig() {
459
407
  return Joi.object({
@@ -463,6 +411,7 @@ class WebhookPlatformModel {
463
411
  event_category: Joi.string().allow(""),
464
412
  subscriber_event_mapping: WebhookPlatformModel.SubscriberEventMapping(),
465
413
  event_schema: Joi.object().pattern(/\S/, Joi.any()).allow(null, ""),
414
+ group: Joi.string().allow("").allow(null),
466
415
  version: Joi.string().allow(""),
467
416
  display_name: Joi.string().allow(""),
468
417
  description: Joi.string().allow("").allow(null),
@@ -481,7 +430,7 @@ class WebhookPlatformModel {
481
430
  /** @returns {ReportFiltersPayload} */
482
431
  static ReportFiltersPayload() {
483
432
  return Joi.object({
484
- subscriber_ids: Joi.array().items(Joi.number()),
433
+ subscriber_ids: Joi.array().items(Joi.number()).required(),
485
434
  });
486
435
  }
487
436
 
@@ -496,7 +445,7 @@ class WebhookPlatformModel {
496
445
  /** @returns {HistoryPayload} */
497
446
  static HistoryPayload() {
498
447
  return Joi.object({
499
- type: Joi.string().allow(""),
448
+ type: Joi.string().allow("").required(),
500
449
  page_no: Joi.number(),
501
450
  page_size: Joi.number(),
502
451
  });
@@ -511,6 +460,7 @@ class WebhookPlatformModel {
511
460
  end_date: Joi.string().allow(""),
512
461
  start_date: Joi.string().allow(""),
513
462
  subscribers: Joi.array().items(Joi.number()),
463
+ webhook_type: Joi.array().items(Joi.string().allow("")),
514
464
  });
515
465
  }
516
466
 
@@ -576,6 +526,15 @@ class WebhookPlatformModel {
576
526
 
577
527
  /** @returns {Association} */
578
528
  static Association() {
529
+ return Joi.object({
530
+ application_id: Joi.array().items(Joi.string().allow("")),
531
+ extension_id: Joi.string().allow(""),
532
+ criteria: Joi.string().allow(""),
533
+ });
534
+ }
535
+
536
+ /** @returns {AssociationResp} */
537
+ static AssociationResp() {
579
538
  return Joi.object({
580
539
  company_id: Joi.number(),
581
540
  application_id: Joi.array().items(Joi.string().allow("")),
@@ -592,24 +551,15 @@ class WebhookPlatformModel {
592
551
  });
593
552
  }
594
553
 
595
- /** @returns {SubscriberEventMapping} */
596
- static SubscriberEventMapping() {
597
- return Joi.object({
598
- id: Joi.number(),
599
- event_id: Joi.number(),
600
- subscriber_id: Joi.number(),
601
- created_on: Joi.string().allow(""),
602
- });
603
- }
604
-
605
554
  /** @returns {SubscriberResponse} */
606
555
  static SubscriberResponse() {
607
556
  return Joi.object({
608
557
  id: Joi.number(),
609
558
  modified_by: Joi.string().allow(""),
610
559
  name: Joi.string().allow(""),
560
+ provider: Joi.string().allow(""),
611
561
  webhook_url: Joi.string().allow(""),
612
- association: WebhookPlatformModel.Association(),
562
+ association: WebhookPlatformModel.AssociationResp(),
613
563
  custom_headers: Joi.any(),
614
564
  status: WebhookPlatformModel.SubscriberStatus(),
615
565
  email_id: Joi.string().allow(""),
@@ -621,18 +571,71 @@ class WebhookPlatformModel {
621
571
  });
622
572
  }
623
573
 
624
- /** @returns {SubscriberConfig} */
625
- static SubscriberConfig() {
574
+ /** @returns {Events} */
575
+ static Events() {
576
+ return Joi.object({
577
+ slug: Joi.string().allow(""),
578
+ topic: Joi.string().allow(""),
579
+ });
580
+ }
581
+
582
+ /** @returns {SubscriberConfigPostRequestV2} */
583
+ static SubscriberConfigPostRequestV2() {
626
584
  return Joi.object({
627
- id: Joi.number(),
628
585
  name: Joi.string().allow(""),
629
586
  webhook_url: Joi.string().allow(""),
630
- association: WebhookPlatformModel.Association(),
587
+ provider: Joi.string().allow("").required(),
588
+ association: WebhookPlatformModel.Association().required(),
631
589
  custom_headers: Joi.any(),
632
- status: WebhookPlatformModel.SubscriberStatus(),
633
- email_id: Joi.string().allow(""),
590
+ status: WebhookPlatformModel.SubscriberStatus().required(),
591
+ email_id: Joi.string().allow("").required(),
634
592
  auth_meta: WebhookPlatformModel.AuthMeta(),
635
- event_id: Joi.array().items(Joi.number()),
593
+ events: Joi.array().items(WebhookPlatformModel.Events()),
594
+ });
595
+ }
596
+
597
+ /** @returns {SubscriberConfigUpdateRequestV2} */
598
+ static SubscriberConfigUpdateRequestV2() {
599
+ return Joi.object({
600
+ id: Joi.number().required(),
601
+ name: Joi.string().allow(""),
602
+ webhook_url: Joi.string().allow(""),
603
+ provider: Joi.string().allow("").required(),
604
+ association: WebhookPlatformModel.Association().required(),
605
+ custom_headers: Joi.any(),
606
+ status: WebhookPlatformModel.SubscriberStatus().required(),
607
+ email_id: Joi.string().allow("").required(),
608
+ auth_meta: WebhookPlatformModel.AuthMeta(),
609
+ events: Joi.array().items(WebhookPlatformModel.Events()),
610
+ });
611
+ }
612
+
613
+ /** @returns {SubscriberConfigPost} */
614
+ static SubscriberConfigPost() {
615
+ return Joi.object({
616
+ name: Joi.string().allow(""),
617
+ webhook_url: Joi.string().allow("").required(),
618
+ association: WebhookPlatformModel.Association().required(),
619
+ custom_headers: Joi.any(),
620
+ status: WebhookPlatformModel.SubscriberStatus().required(),
621
+ email_id: Joi.string().allow("").required(),
622
+ auth_meta: WebhookPlatformModel.AuthMeta(),
623
+ event_id: Joi.array().items(Joi.number()).required(),
624
+ });
625
+ }
626
+
627
+ /** @returns {SubscriberConfigUpdate} */
628
+ static SubscriberConfigUpdate() {
629
+ return Joi.object({
630
+ id: Joi.number().required(),
631
+ name: Joi.string().allow(""),
632
+ webhook_url: Joi.string().allow("").required(),
633
+ association: WebhookPlatformModel.Association().required(),
634
+ custom_headers: Joi.any(),
635
+ status: WebhookPlatformModel.SubscriberStatus().required(),
636
+ email_id: Joi.string().allow("").required(),
637
+ auth_meta: WebhookPlatformModel.AuthMeta(),
638
+ event_id: Joi.array().items(Joi.number()).required(),
636
639
  });
637
640
  }
638
641
 
@@ -643,7 +646,8 @@ class WebhookPlatformModel {
643
646
  modified_by: Joi.string().allow(""),
644
647
  name: Joi.string().allow(""),
645
648
  webhook_url: Joi.string().allow(""),
646
- association: WebhookPlatformModel.Association(),
649
+ provider: Joi.string().allow(""),
650
+ association: WebhookPlatformModel.AssociationResp(),
647
651
  custom_headers: Joi.any(),
648
652
  status: WebhookPlatformModel.SubscriberStatus(),
649
653
  email_id: Joi.string().allow(""),
@@ -672,9 +676,7 @@ class WebhookPlatformModel {
672
676
  return Joi.string().valid(
673
677
  "active",
674
678
 
675
- "inactive",
676
-
677
- "blocked"
679
+ "inactive"
678
680
  );
679
681
  }
680
682
  }
@@ -12,15 +12,10 @@ export = WebhookPlatformValidator;
12
12
  * @typedef GetDeliveryReportsParam
13
13
  * @property {WebhookPlatformModel.EventProcessRequest} body
14
14
  */
15
- /**
16
- * @typedef GetEventCountsParam
17
- * @property {WebhookPlatformModel.RetryEventRequest} body
18
- */
19
15
  /**
20
16
  * @typedef GetHistoricalReportsParam
21
17
  * @property {WebhookPlatformModel.HistoryPayload} body
22
18
  */
23
- /** @typedef GetManualRetryStatusParam */
24
19
  /**
25
20
  * @typedef GetReportFiltersParam
26
21
  * @property {WebhookPlatformModel.ReportFiltersPayload} body
@@ -41,22 +36,25 @@ export = WebhookPlatformValidator;
41
36
  * @property {number} [pageSize] - Page Size
42
37
  * @property {string} extensionId - Extension_id
43
38
  */
44
- /** @typedef ManualRetryCancelParam */
45
- /**
46
- * @typedef ManualRetryOfFailedEventParam
47
- * @property {WebhookPlatformModel.RetryEventRequest} body
48
- */
49
39
  /**
50
40
  * @typedef PingWebhookParam
51
41
  * @property {WebhookPlatformModel.PingWebhook} body
52
42
  */
53
43
  /**
54
44
  * @typedef RegisterSubscriberToEventParam
55
- * @property {WebhookPlatformModel.SubscriberConfig} body
45
+ * @property {WebhookPlatformModel.SubscriberConfigPost} body
46
+ */
47
+ /**
48
+ * @typedef RegisterSubscriberToEventV2Param
49
+ * @property {WebhookPlatformModel.SubscriberConfigPostRequestV2} body
56
50
  */
57
51
  /**
58
52
  * @typedef UpdateSubscriberConfigParam
59
- * @property {WebhookPlatformModel.SubscriberConfig} body
53
+ * @property {WebhookPlatformModel.SubscriberConfigUpdate} body
54
+ */
55
+ /**
56
+ * @typedef UpdateSubscriberV2Param
57
+ * @property {WebhookPlatformModel.SubscriberConfigUpdateRequestV2} body
60
58
  */
61
59
  declare class WebhookPlatformValidator {
62
60
  /** @returns {CancelJobByNameParam} */
@@ -67,12 +65,8 @@ declare class WebhookPlatformValidator {
67
65
  static fetchAllEventConfigurations(): any;
68
66
  /** @returns {GetDeliveryReportsParam} */
69
67
  static getDeliveryReports(): GetDeliveryReportsParam;
70
- /** @returns {GetEventCountsParam} */
71
- static getEventCounts(): GetEventCountsParam;
72
68
  /** @returns {GetHistoricalReportsParam} */
73
69
  static getHistoricalReports(): GetHistoricalReportsParam;
74
- /** @returns {GetManualRetryStatusParam} */
75
- static getManualRetryStatus(): any;
76
70
  /** @returns {GetReportFiltersParam} */
77
71
  static getReportFilters(): GetReportFiltersParam;
78
72
  /** @returns {GetSubscriberByIdParam} */
@@ -81,19 +75,19 @@ declare class WebhookPlatformValidator {
81
75
  static getSubscribersByCompany(): GetSubscribersByCompanyParam;
82
76
  /** @returns {GetSubscribersByExtensionIdParam} */
83
77
  static getSubscribersByExtensionId(): GetSubscribersByExtensionIdParam;
84
- /** @returns {ManualRetryCancelParam} */
85
- static manualRetryCancel(): any;
86
- /** @returns {ManualRetryOfFailedEventParam} */
87
- static manualRetryOfFailedEvent(): ManualRetryOfFailedEventParam;
88
78
  /** @returns {PingWebhookParam} */
89
79
  static pingWebhook(): PingWebhookParam;
90
80
  /** @returns {RegisterSubscriberToEventParam} */
91
81
  static registerSubscriberToEvent(): RegisterSubscriberToEventParam;
82
+ /** @returns {RegisterSubscriberToEventV2Param} */
83
+ static registerSubscriberToEventV2(): RegisterSubscriberToEventV2Param;
92
84
  /** @returns {UpdateSubscriberConfigParam} */
93
85
  static updateSubscriberConfig(): UpdateSubscriberConfigParam;
86
+ /** @returns {UpdateSubscriberV2Param} */
87
+ static updateSubscriberV2(): UpdateSubscriberV2Param;
94
88
  }
95
89
  declare namespace WebhookPlatformValidator {
96
- export { CancelJobByNameParam, DownloadDeliveryReportParam, FetchAllEventConfigurationsParam, GetDeliveryReportsParam, GetEventCountsParam, GetHistoricalReportsParam, GetManualRetryStatusParam, GetReportFiltersParam, GetSubscriberByIdParam, GetSubscribersByCompanyParam, GetSubscribersByExtensionIdParam, ManualRetryCancelParam, ManualRetryOfFailedEventParam, PingWebhookParam, RegisterSubscriberToEventParam, UpdateSubscriberConfigParam };
90
+ export { CancelJobByNameParam, DownloadDeliveryReportParam, FetchAllEventConfigurationsParam, GetDeliveryReportsParam, GetHistoricalReportsParam, GetReportFiltersParam, GetSubscriberByIdParam, GetSubscribersByCompanyParam, GetSubscribersByExtensionIdParam, PingWebhookParam, RegisterSubscriberToEventParam, RegisterSubscriberToEventV2Param, UpdateSubscriberConfigParam, UpdateSubscriberV2Param };
97
91
  }
98
92
  type CancelJobByNameParam = {
99
93
  filename: string;
@@ -104,9 +98,6 @@ type DownloadDeliveryReportParam = {
104
98
  type GetDeliveryReportsParam = {
105
99
  body: WebhookPlatformModel.EventProcessRequest;
106
100
  };
107
- type GetEventCountsParam = {
108
- body: WebhookPlatformModel.RetryEventRequest;
109
- };
110
101
  type GetHistoricalReportsParam = {
111
102
  body: WebhookPlatformModel.HistoryPayload;
112
103
  };
@@ -147,19 +138,20 @@ type GetSubscribersByExtensionIdParam = {
147
138
  */
148
139
  extensionId: string;
149
140
  };
150
- type ManualRetryOfFailedEventParam = {
151
- body: WebhookPlatformModel.RetryEventRequest;
152
- };
153
141
  type PingWebhookParam = {
154
142
  body: WebhookPlatformModel.PingWebhook;
155
143
  };
156
144
  type RegisterSubscriberToEventParam = {
157
- body: WebhookPlatformModel.SubscriberConfig;
145
+ body: WebhookPlatformModel.SubscriberConfigPost;
146
+ };
147
+ type RegisterSubscriberToEventV2Param = {
148
+ body: WebhookPlatformModel.SubscriberConfigPostRequestV2;
158
149
  };
159
150
  type UpdateSubscriberConfigParam = {
160
- body: WebhookPlatformModel.SubscriberConfig;
151
+ body: WebhookPlatformModel.SubscriberConfigUpdate;
152
+ };
153
+ type UpdateSubscriberV2Param = {
154
+ body: WebhookPlatformModel.SubscriberConfigUpdateRequestV2;
161
155
  };
162
156
  type FetchAllEventConfigurationsParam = any;
163
- type GetManualRetryStatusParam = any;
164
- type ManualRetryCancelParam = any;
165
157
  import WebhookPlatformModel = require("./WebhookPlatformModel");