@gofynd/fdk-client-javascript 1.4.7 → 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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
- package/sdk/application/Cart/CartApplicationClient.js +118 -13
- package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
- package/sdk/application/Cart/CartApplicationModel.js +98 -26
- package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
- package/sdk/application/Cart/CartApplicationValidator.js +26 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
- package/sdk/application/Content/ContentApplicationClient.js +5 -3
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -18
- package/sdk/application/Content/ContentApplicationModel.js +4 -20
- package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationValidator.js +4 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
- package/sdk/application/Lead/LeadApplicationClient.js +0 -167
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
- package/sdk/application/Lead/LeadApplicationModel.js +0 -126
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
- package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +2 -0
- package/sdk/application/Order/OrderApplicationModel.js +2 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
- package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
- package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
- package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
- package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
- package/sdk/platform/Cart/CartPlatformModel.js +164 -24
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +6 -4
- package/sdk/platform/Content/ContentPlatformModel.js +6 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
- package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
- package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
- package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
- package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
- package/sdk/platform/Order/OrderPlatformModel.d.ts +108 -15
- package/sdk/platform/Order/OrderPlatformModel.js +47 -14
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
- package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
- package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +112 -164
- package/sdk/platform/Webhook/WebhookPlatformModel.js +118 -169
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
- package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
- package/sdk/public/Billing/BillingPublicClient.js +156 -3
- package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
- package/sdk/public/Billing/BillingPublicModel.js +317 -18
- package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
- package/sdk/public/Billing/BillingPublicValidator.js +22 -3
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
- package/sdk/public/Webhook/WebhookPublicModel.js +22 -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}
|
|
67
|
-
* @property {string}
|
|
68
|
-
* @property {string}
|
|
69
|
-
* @property {number[]}
|
|
70
|
-
* @property {string}
|
|
71
|
-
* @property {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}
|
|
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.
|
|
@@ -156,7 +103,7 @@ const Joi = require("joi");
|
|
|
156
103
|
|
|
157
104
|
/**
|
|
158
105
|
* @typedef ReportFiltersPayload
|
|
159
|
-
* @property {number[]}
|
|
106
|
+
* @property {number[]} subscriber_ids - An array of subscriber IDs for
|
|
160
107
|
* filtering filters (optional).
|
|
161
108
|
*/
|
|
162
109
|
|
|
@@ -168,7 +115,7 @@ const Joi = require("joi");
|
|
|
168
115
|
|
|
169
116
|
/**
|
|
170
117
|
* @typedef HistoryPayload
|
|
171
|
-
* @property {string}
|
|
118
|
+
* @property {string} type - The type of history report (e.g., "platform").
|
|
172
119
|
* @property {number} [page_no] - The page number of the history report.
|
|
173
120
|
* @property {number} [page_size] - The number of records per page.
|
|
174
121
|
*/
|
|
@@ -236,6 +183,13 @@ const Joi = require("joi");
|
|
|
236
183
|
|
|
237
184
|
/**
|
|
238
185
|
* @typedef Association
|
|
186
|
+
* @property {string[]} [application_id]
|
|
187
|
+
* @property {string} [extension_id]
|
|
188
|
+
* @property {string} [criteria]
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @typedef AssociationResp
|
|
239
193
|
* @property {number} [company_id]
|
|
240
194
|
* @property {string[]} [application_id]
|
|
241
195
|
* @property {string} [extension_id]
|
|
@@ -255,7 +209,7 @@ const Joi = require("joi");
|
|
|
255
209
|
* @property {string} [name]
|
|
256
210
|
* @property {string} [provider]
|
|
257
211
|
* @property {string} [webhook_url]
|
|
258
|
-
* @property {
|
|
212
|
+
* @property {AssociationResp} [association]
|
|
259
213
|
* @property {Object} [custom_headers]
|
|
260
214
|
* @property {SubscriberStatus} [status]
|
|
261
215
|
* @property {string} [email_id]
|
|
@@ -273,30 +227,55 @@ const Joi = require("joi");
|
|
|
273
227
|
*/
|
|
274
228
|
|
|
275
229
|
/**
|
|
276
|
-
* @typedef
|
|
277
|
-
* @property {number} [id]
|
|
230
|
+
* @typedef SubscriberConfigPostRequestV2
|
|
278
231
|
* @property {string} [name]
|
|
279
232
|
* @property {string} [webhook_url]
|
|
280
|
-
* @property {string}
|
|
281
|
-
* @property {Association}
|
|
233
|
+
* @property {string} provider
|
|
234
|
+
* @property {Association} association
|
|
282
235
|
* @property {Object} [custom_headers]
|
|
283
|
-
* @property {SubscriberStatus}
|
|
284
|
-
* @property {string}
|
|
236
|
+
* @property {SubscriberStatus} status
|
|
237
|
+
* @property {string} email_id
|
|
285
238
|
* @property {AuthMeta} [auth_meta]
|
|
286
239
|
* @property {Events[]} [events]
|
|
287
240
|
*/
|
|
288
241
|
|
|
289
242
|
/**
|
|
290
|
-
* @typedef
|
|
291
|
-
* @property {number}
|
|
243
|
+
* @typedef SubscriberConfigUpdateRequestV2
|
|
244
|
+
* @property {number} id
|
|
292
245
|
* @property {string} [name]
|
|
293
246
|
* @property {string} [webhook_url]
|
|
294
|
-
* @property {
|
|
247
|
+
* @property {string} provider
|
|
248
|
+
* @property {Association} association
|
|
295
249
|
* @property {Object} [custom_headers]
|
|
296
|
-
* @property {SubscriberStatus}
|
|
297
|
-
* @property {string}
|
|
250
|
+
* @property {SubscriberStatus} status
|
|
251
|
+
* @property {string} email_id
|
|
298
252
|
* @property {AuthMeta} [auth_meta]
|
|
299
|
-
* @property {
|
|
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
|
|
300
279
|
*/
|
|
301
280
|
|
|
302
281
|
/**
|
|
@@ -306,7 +285,7 @@ const Joi = require("joi");
|
|
|
306
285
|
* @property {string} [name]
|
|
307
286
|
* @property {string} [webhook_url]
|
|
308
287
|
* @property {string} [provider]
|
|
309
|
-
* @property {
|
|
288
|
+
* @property {AssociationResp} [association]
|
|
310
289
|
* @property {Object} [custom_headers]
|
|
311
290
|
* @property {SubscriberStatus} [status]
|
|
312
291
|
* @property {string} [email_id]
|
|
@@ -326,13 +305,6 @@ const Joi = require("joi");
|
|
|
326
305
|
/** @typedef {"active" | "inactive"} SubscriberStatus */
|
|
327
306
|
|
|
328
307
|
class WebhookPlatformModel {
|
|
329
|
-
/** @returns {Error} */
|
|
330
|
-
static Error() {
|
|
331
|
-
return Joi.object({
|
|
332
|
-
error: Joi.string().allow(""),
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
|
|
336
308
|
/** @returns {Event} */
|
|
337
309
|
static Event() {
|
|
338
310
|
return Joi.object({
|
|
@@ -343,76 +315,15 @@ class WebhookPlatformModel {
|
|
|
343
315
|
});
|
|
344
316
|
}
|
|
345
317
|
|
|
346
|
-
/** @returns {RetryEventRequest} */
|
|
347
|
-
static RetryEventRequest() {
|
|
348
|
-
return Joi.object({
|
|
349
|
-
search_text: Joi.string().allow(""),
|
|
350
|
-
end_date: Joi.string().allow(""),
|
|
351
|
-
start_date: Joi.string().allow(""),
|
|
352
|
-
subscriber_ids: Joi.array().items(Joi.number()),
|
|
353
|
-
event: Joi.array().items(WebhookPlatformModel.Event()),
|
|
354
|
-
status: Joi.string().allow(""),
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/** @returns {Item} */
|
|
359
|
-
static Item() {
|
|
360
|
-
return Joi.object({
|
|
361
|
-
status: Joi.string().allow(""),
|
|
362
|
-
count: Joi.number(),
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/** @returns {RetryCountResponse} */
|
|
367
|
-
static RetryCountResponse() {
|
|
368
|
-
return Joi.object({
|
|
369
|
-
items: Joi.array().items(WebhookPlatformModel.Item()),
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/** @returns {RetrySuccessResponse} */
|
|
374
|
-
static RetrySuccessResponse() {
|
|
375
|
-
return Joi.object({
|
|
376
|
-
success: Joi.boolean(),
|
|
377
|
-
message: Joi.string().allow(""),
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/** @returns {Err} */
|
|
382
|
-
static Err() {
|
|
383
|
-
return Joi.object({
|
|
384
|
-
msg: Joi.string().allow(""),
|
|
385
|
-
param: Joi.string().allow(""),
|
|
386
|
-
location: Joi.string().allow(""),
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/** @returns {RetryFailureResponse} */
|
|
391
|
-
static RetryFailureResponse() {
|
|
392
|
-
return Joi.object({
|
|
393
|
-
err: Joi.array().items(WebhookPlatformModel.Err()),
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/** @returns {RetryStatusResponse} */
|
|
398
|
-
static RetryStatusResponse() {
|
|
399
|
-
return Joi.object({
|
|
400
|
-
total_event: Joi.number(),
|
|
401
|
-
success_count: Joi.number(),
|
|
402
|
-
failure_count: Joi.number(),
|
|
403
|
-
status: Joi.string().allow(""),
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
318
|
/** @returns {EventProcessRequest} */
|
|
408
319
|
static EventProcessRequest() {
|
|
409
320
|
return Joi.object({
|
|
410
|
-
search_text: Joi.string().allow(""),
|
|
411
|
-
end_date: Joi.string().allow(""),
|
|
412
|
-
start_date: Joi.string().allow(""),
|
|
413
|
-
subscriber_ids: Joi.array().items(Joi.number()),
|
|
414
|
-
status: Joi.string().allow(""),
|
|
415
|
-
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(),
|
|
416
327
|
});
|
|
417
328
|
}
|
|
418
329
|
|
|
@@ -465,7 +376,7 @@ class WebhookPlatformModel {
|
|
|
465
376
|
/** @returns {PingWebhook} */
|
|
466
377
|
static PingWebhook() {
|
|
467
378
|
return Joi.object({
|
|
468
|
-
webhook_url: Joi.string().allow(""),
|
|
379
|
+
webhook_url: Joi.string().allow("").required(),
|
|
469
380
|
auth_meta: Joi.any(),
|
|
470
381
|
custom_headers: Joi.any(),
|
|
471
382
|
});
|
|
@@ -519,7 +430,7 @@ class WebhookPlatformModel {
|
|
|
519
430
|
/** @returns {ReportFiltersPayload} */
|
|
520
431
|
static ReportFiltersPayload() {
|
|
521
432
|
return Joi.object({
|
|
522
|
-
subscriber_ids: Joi.array().items(Joi.number()),
|
|
433
|
+
subscriber_ids: Joi.array().items(Joi.number()).required(),
|
|
523
434
|
});
|
|
524
435
|
}
|
|
525
436
|
|
|
@@ -534,7 +445,7 @@ class WebhookPlatformModel {
|
|
|
534
445
|
/** @returns {HistoryPayload} */
|
|
535
446
|
static HistoryPayload() {
|
|
536
447
|
return Joi.object({
|
|
537
|
-
type: Joi.string().allow(""),
|
|
448
|
+
type: Joi.string().allow("").required(),
|
|
538
449
|
page_no: Joi.number(),
|
|
539
450
|
page_size: Joi.number(),
|
|
540
451
|
});
|
|
@@ -615,6 +526,15 @@ class WebhookPlatformModel {
|
|
|
615
526
|
|
|
616
527
|
/** @returns {Association} */
|
|
617
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() {
|
|
618
538
|
return Joi.object({
|
|
619
539
|
company_id: Joi.number(),
|
|
620
540
|
application_id: Joi.array().items(Joi.string().allow("")),
|
|
@@ -639,7 +559,7 @@ class WebhookPlatformModel {
|
|
|
639
559
|
name: Joi.string().allow(""),
|
|
640
560
|
provider: Joi.string().allow(""),
|
|
641
561
|
webhook_url: Joi.string().allow(""),
|
|
642
|
-
association: WebhookPlatformModel.
|
|
562
|
+
association: WebhookPlatformModel.AssociationResp(),
|
|
643
563
|
custom_headers: Joi.any(),
|
|
644
564
|
status: WebhookPlatformModel.SubscriberStatus(),
|
|
645
565
|
email_id: Joi.string().allow(""),
|
|
@@ -659,34 +579,63 @@ class WebhookPlatformModel {
|
|
|
659
579
|
});
|
|
660
580
|
}
|
|
661
581
|
|
|
662
|
-
/** @returns {
|
|
663
|
-
static
|
|
582
|
+
/** @returns {SubscriberConfigPostRequestV2} */
|
|
583
|
+
static SubscriberConfigPostRequestV2() {
|
|
664
584
|
return Joi.object({
|
|
665
|
-
id: Joi.number(),
|
|
666
585
|
name: Joi.string().allow(""),
|
|
667
586
|
webhook_url: Joi.string().allow(""),
|
|
668
|
-
provider: Joi.string().allow(""),
|
|
669
|
-
association: WebhookPlatformModel.Association(),
|
|
587
|
+
provider: Joi.string().allow("").required(),
|
|
588
|
+
association: WebhookPlatformModel.Association().required(),
|
|
670
589
|
custom_headers: Joi.any(),
|
|
671
|
-
status: WebhookPlatformModel.SubscriberStatus(),
|
|
672
|
-
email_id: Joi.string().allow(""),
|
|
590
|
+
status: WebhookPlatformModel.SubscriberStatus().required(),
|
|
591
|
+
email_id: Joi.string().allow("").required(),
|
|
673
592
|
auth_meta: WebhookPlatformModel.AuthMeta(),
|
|
674
593
|
events: Joi.array().items(WebhookPlatformModel.Events()),
|
|
675
594
|
});
|
|
676
595
|
}
|
|
677
596
|
|
|
678
|
-
/** @returns {
|
|
679
|
-
static
|
|
597
|
+
/** @returns {SubscriberConfigUpdateRequestV2} */
|
|
598
|
+
static SubscriberConfigUpdateRequestV2() {
|
|
680
599
|
return Joi.object({
|
|
681
|
-
id: Joi.number(),
|
|
600
|
+
id: Joi.number().required(),
|
|
682
601
|
name: Joi.string().allow(""),
|
|
683
602
|
webhook_url: Joi.string().allow(""),
|
|
684
|
-
|
|
603
|
+
provider: Joi.string().allow("").required(),
|
|
604
|
+
association: WebhookPlatformModel.Association().required(),
|
|
685
605
|
custom_headers: Joi.any(),
|
|
686
|
-
status: WebhookPlatformModel.SubscriberStatus(),
|
|
687
|
-
email_id: Joi.string().allow(""),
|
|
606
|
+
status: WebhookPlatformModel.SubscriberStatus().required(),
|
|
607
|
+
email_id: Joi.string().allow("").required(),
|
|
688
608
|
auth_meta: WebhookPlatformModel.AuthMeta(),
|
|
689
|
-
|
|
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(),
|
|
690
639
|
});
|
|
691
640
|
}
|
|
692
641
|
|
|
@@ -698,7 +647,7 @@ class WebhookPlatformModel {
|
|
|
698
647
|
name: Joi.string().allow(""),
|
|
699
648
|
webhook_url: Joi.string().allow(""),
|
|
700
649
|
provider: Joi.string().allow(""),
|
|
701
|
-
association: WebhookPlatformModel.
|
|
650
|
+
association: WebhookPlatformModel.AssociationResp(),
|
|
702
651
|
custom_headers: Joi.any(),
|
|
703
652
|
status: WebhookPlatformModel.SubscriberStatus(),
|
|
704
653
|
email_id: Joi.string().allow(""),
|
|
@@ -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,30 +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.
|
|
45
|
+
* @property {WebhookPlatformModel.SubscriberConfigPost} body
|
|
56
46
|
*/
|
|
57
47
|
/**
|
|
58
48
|
* @typedef RegisterSubscriberToEventV2Param
|
|
59
|
-
* @property {WebhookPlatformModel.
|
|
49
|
+
* @property {WebhookPlatformModel.SubscriberConfigPostRequestV2} body
|
|
60
50
|
*/
|
|
61
51
|
/**
|
|
62
52
|
* @typedef UpdateSubscriberConfigParam
|
|
63
|
-
* @property {WebhookPlatformModel.
|
|
53
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdate} body
|
|
64
54
|
*/
|
|
65
55
|
/**
|
|
66
56
|
* @typedef UpdateSubscriberV2Param
|
|
67
|
-
* @property {WebhookPlatformModel.
|
|
57
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdateRequestV2} body
|
|
68
58
|
*/
|
|
69
59
|
declare class WebhookPlatformValidator {
|
|
70
60
|
/** @returns {CancelJobByNameParam} */
|
|
@@ -75,12 +65,8 @@ declare class WebhookPlatformValidator {
|
|
|
75
65
|
static fetchAllEventConfigurations(): any;
|
|
76
66
|
/** @returns {GetDeliveryReportsParam} */
|
|
77
67
|
static getDeliveryReports(): GetDeliveryReportsParam;
|
|
78
|
-
/** @returns {GetEventCountsParam} */
|
|
79
|
-
static getEventCounts(): GetEventCountsParam;
|
|
80
68
|
/** @returns {GetHistoricalReportsParam} */
|
|
81
69
|
static getHistoricalReports(): GetHistoricalReportsParam;
|
|
82
|
-
/** @returns {GetManualRetryStatusParam} */
|
|
83
|
-
static getManualRetryStatus(): any;
|
|
84
70
|
/** @returns {GetReportFiltersParam} */
|
|
85
71
|
static getReportFilters(): GetReportFiltersParam;
|
|
86
72
|
/** @returns {GetSubscriberByIdParam} */
|
|
@@ -89,10 +75,6 @@ declare class WebhookPlatformValidator {
|
|
|
89
75
|
static getSubscribersByCompany(): GetSubscribersByCompanyParam;
|
|
90
76
|
/** @returns {GetSubscribersByExtensionIdParam} */
|
|
91
77
|
static getSubscribersByExtensionId(): GetSubscribersByExtensionIdParam;
|
|
92
|
-
/** @returns {ManualRetryCancelParam} */
|
|
93
|
-
static manualRetryCancel(): any;
|
|
94
|
-
/** @returns {ManualRetryOfFailedEventParam} */
|
|
95
|
-
static manualRetryOfFailedEvent(): ManualRetryOfFailedEventParam;
|
|
96
78
|
/** @returns {PingWebhookParam} */
|
|
97
79
|
static pingWebhook(): PingWebhookParam;
|
|
98
80
|
/** @returns {RegisterSubscriberToEventParam} */
|
|
@@ -105,7 +87,7 @@ declare class WebhookPlatformValidator {
|
|
|
105
87
|
static updateSubscriberV2(): UpdateSubscriberV2Param;
|
|
106
88
|
}
|
|
107
89
|
declare namespace WebhookPlatformValidator {
|
|
108
|
-
export { CancelJobByNameParam, DownloadDeliveryReportParam, FetchAllEventConfigurationsParam, GetDeliveryReportsParam,
|
|
90
|
+
export { CancelJobByNameParam, DownloadDeliveryReportParam, FetchAllEventConfigurationsParam, GetDeliveryReportsParam, GetHistoricalReportsParam, GetReportFiltersParam, GetSubscriberByIdParam, GetSubscribersByCompanyParam, GetSubscribersByExtensionIdParam, PingWebhookParam, RegisterSubscriberToEventParam, RegisterSubscriberToEventV2Param, UpdateSubscriberConfigParam, UpdateSubscriberV2Param };
|
|
109
91
|
}
|
|
110
92
|
type CancelJobByNameParam = {
|
|
111
93
|
filename: string;
|
|
@@ -116,9 +98,6 @@ type DownloadDeliveryReportParam = {
|
|
|
116
98
|
type GetDeliveryReportsParam = {
|
|
117
99
|
body: WebhookPlatformModel.EventProcessRequest;
|
|
118
100
|
};
|
|
119
|
-
type GetEventCountsParam = {
|
|
120
|
-
body: WebhookPlatformModel.RetryEventRequest;
|
|
121
|
-
};
|
|
122
101
|
type GetHistoricalReportsParam = {
|
|
123
102
|
body: WebhookPlatformModel.HistoryPayload;
|
|
124
103
|
};
|
|
@@ -159,25 +138,20 @@ type GetSubscribersByExtensionIdParam = {
|
|
|
159
138
|
*/
|
|
160
139
|
extensionId: string;
|
|
161
140
|
};
|
|
162
|
-
type ManualRetryOfFailedEventParam = {
|
|
163
|
-
body: WebhookPlatformModel.RetryEventRequest;
|
|
164
|
-
};
|
|
165
141
|
type PingWebhookParam = {
|
|
166
142
|
body: WebhookPlatformModel.PingWebhook;
|
|
167
143
|
};
|
|
168
144
|
type RegisterSubscriberToEventParam = {
|
|
169
|
-
body: WebhookPlatformModel.
|
|
145
|
+
body: WebhookPlatformModel.SubscriberConfigPost;
|
|
170
146
|
};
|
|
171
147
|
type RegisterSubscriberToEventV2Param = {
|
|
172
|
-
body: WebhookPlatformModel.
|
|
148
|
+
body: WebhookPlatformModel.SubscriberConfigPostRequestV2;
|
|
173
149
|
};
|
|
174
150
|
type UpdateSubscriberConfigParam = {
|
|
175
|
-
body: WebhookPlatformModel.
|
|
151
|
+
body: WebhookPlatformModel.SubscriberConfigUpdate;
|
|
176
152
|
};
|
|
177
153
|
type UpdateSubscriberV2Param = {
|
|
178
|
-
body: WebhookPlatformModel.
|
|
154
|
+
body: WebhookPlatformModel.SubscriberConfigUpdateRequestV2;
|
|
179
155
|
};
|
|
180
156
|
type FetchAllEventConfigurationsParam = any;
|
|
181
|
-
type GetManualRetryStatusParam = any;
|
|
182
|
-
type ManualRetryCancelParam = any;
|
|
183
157
|
import WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
@@ -19,18 +19,11 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
19
19
|
* @property {WebhookPlatformModel.EventProcessRequest} body
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* @typedef GetEventCountsParam
|
|
24
|
-
* @property {WebhookPlatformModel.RetryEventRequest} body
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
22
|
/**
|
|
28
23
|
* @typedef GetHistoricalReportsParam
|
|
29
24
|
* @property {WebhookPlatformModel.HistoryPayload} body
|
|
30
25
|
*/
|
|
31
26
|
|
|
32
|
-
/** @typedef GetManualRetryStatusParam */
|
|
33
|
-
|
|
34
27
|
/**
|
|
35
28
|
* @typedef GetReportFiltersParam
|
|
36
29
|
* @property {WebhookPlatformModel.ReportFiltersPayload} body
|
|
@@ -55,13 +48,6 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
55
48
|
* @property {string} extensionId - Extension_id
|
|
56
49
|
*/
|
|
57
50
|
|
|
58
|
-
/** @typedef ManualRetryCancelParam */
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @typedef ManualRetryOfFailedEventParam
|
|
62
|
-
* @property {WebhookPlatformModel.RetryEventRequest} body
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
51
|
/**
|
|
66
52
|
* @typedef PingWebhookParam
|
|
67
53
|
* @property {WebhookPlatformModel.PingWebhook} body
|
|
@@ -69,22 +55,22 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
69
55
|
|
|
70
56
|
/**
|
|
71
57
|
* @typedef RegisterSubscriberToEventParam
|
|
72
|
-
* @property {WebhookPlatformModel.
|
|
58
|
+
* @property {WebhookPlatformModel.SubscriberConfigPost} body
|
|
73
59
|
*/
|
|
74
60
|
|
|
75
61
|
/**
|
|
76
62
|
* @typedef RegisterSubscriberToEventV2Param
|
|
77
|
-
* @property {WebhookPlatformModel.
|
|
63
|
+
* @property {WebhookPlatformModel.SubscriberConfigPostRequestV2} body
|
|
78
64
|
*/
|
|
79
65
|
|
|
80
66
|
/**
|
|
81
67
|
* @typedef UpdateSubscriberConfigParam
|
|
82
|
-
* @property {WebhookPlatformModel.
|
|
68
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdate} body
|
|
83
69
|
*/
|
|
84
70
|
|
|
85
71
|
/**
|
|
86
72
|
* @typedef UpdateSubscriberV2Param
|
|
87
|
-
* @property {WebhookPlatformModel.
|
|
73
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdateRequestV2} body
|
|
88
74
|
*/
|
|
89
75
|
|
|
90
76
|
class WebhookPlatformValidator {
|
|
@@ -114,13 +100,6 @@ class WebhookPlatformValidator {
|
|
|
114
100
|
}).required();
|
|
115
101
|
}
|
|
116
102
|
|
|
117
|
-
/** @returns {GetEventCountsParam} */
|
|
118
|
-
static getEventCounts() {
|
|
119
|
-
return Joi.object({
|
|
120
|
-
body: WebhookPlatformModel.RetryEventRequest().required(),
|
|
121
|
-
}).required();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
103
|
/** @returns {GetHistoricalReportsParam} */
|
|
125
104
|
static getHistoricalReports() {
|
|
126
105
|
return Joi.object({
|
|
@@ -128,11 +107,6 @@ class WebhookPlatformValidator {
|
|
|
128
107
|
}).required();
|
|
129
108
|
}
|
|
130
109
|
|
|
131
|
-
/** @returns {GetManualRetryStatusParam} */
|
|
132
|
-
static getManualRetryStatus() {
|
|
133
|
-
return Joi.object({}).required();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
110
|
/** @returns {GetReportFiltersParam} */
|
|
137
111
|
static getReportFilters() {
|
|
138
112
|
return Joi.object({
|
|
@@ -165,18 +139,6 @@ class WebhookPlatformValidator {
|
|
|
165
139
|
}).required();
|
|
166
140
|
}
|
|
167
141
|
|
|
168
|
-
/** @returns {ManualRetryCancelParam} */
|
|
169
|
-
static manualRetryCancel() {
|
|
170
|
-
return Joi.object({}).required();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** @returns {ManualRetryOfFailedEventParam} */
|
|
174
|
-
static manualRetryOfFailedEvent() {
|
|
175
|
-
return Joi.object({
|
|
176
|
-
body: WebhookPlatformModel.RetryEventRequest().required(),
|
|
177
|
-
}).required();
|
|
178
|
-
}
|
|
179
|
-
|
|
180
142
|
/** @returns {PingWebhookParam} */
|
|
181
143
|
static pingWebhook() {
|
|
182
144
|
return Joi.object({
|
|
@@ -187,28 +149,28 @@ class WebhookPlatformValidator {
|
|
|
187
149
|
/** @returns {RegisterSubscriberToEventParam} */
|
|
188
150
|
static registerSubscriberToEvent() {
|
|
189
151
|
return Joi.object({
|
|
190
|
-
body: WebhookPlatformModel.
|
|
152
|
+
body: WebhookPlatformModel.SubscriberConfigPost().required(),
|
|
191
153
|
}).required();
|
|
192
154
|
}
|
|
193
155
|
|
|
194
156
|
/** @returns {RegisterSubscriberToEventV2Param} */
|
|
195
157
|
static registerSubscriberToEventV2() {
|
|
196
158
|
return Joi.object({
|
|
197
|
-
body: WebhookPlatformModel.
|
|
159
|
+
body: WebhookPlatformModel.SubscriberConfigPostRequestV2().required(),
|
|
198
160
|
}).required();
|
|
199
161
|
}
|
|
200
162
|
|
|
201
163
|
/** @returns {UpdateSubscriberConfigParam} */
|
|
202
164
|
static updateSubscriberConfig() {
|
|
203
165
|
return Joi.object({
|
|
204
|
-
body: WebhookPlatformModel.
|
|
166
|
+
body: WebhookPlatformModel.SubscriberConfigUpdate().required(),
|
|
205
167
|
}).required();
|
|
206
168
|
}
|
|
207
169
|
|
|
208
170
|
/** @returns {UpdateSubscriberV2Param} */
|
|
209
171
|
static updateSubscriberV2() {
|
|
210
172
|
return Joi.object({
|
|
211
|
-
body: WebhookPlatformModel.
|
|
173
|
+
body: WebhookPlatformModel.SubscriberConfigUpdateRequestV2().required(),
|
|
212
174
|
}).required();
|
|
213
175
|
}
|
|
214
176
|
}
|