@gofynd/fdk-client-javascript 1.3.11-beta.8 → 1.4.0-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 (48) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationModel.d.ts +2 -0
  4. package/sdk/application/Cart/CartApplicationModel.js +2 -0
  5. package/sdk/application/Order/OrderApplicationModel.d.ts +2 -0
  6. package/sdk/application/Order/OrderApplicationModel.js +2 -0
  7. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +3 -15
  8. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -14
  9. package/sdk/partner/Theme/ThemePartnerModel.d.ts +185 -315
  10. package/sdk/partner/Theme/ThemePartnerModel.js +182 -222
  11. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -12
  12. package/sdk/platform/Catalog/CatalogPlatformClient.js +17 -87
  13. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +11 -25
  14. package/sdk/platform/Catalog/CatalogPlatformValidator.js +4 -17
  15. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +1 -1
  16. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +4 -1
  17. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +5 -0
  18. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +2 -0
  19. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  20. package/sdk/platform/Content/ContentPlatformApplicationClient.js +14 -3
  21. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +14 -5
  22. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +13 -4
  23. package/sdk/platform/Content/ContentPlatformClient.d.ts +1 -1
  24. package/sdk/platform/Content/ContentPlatformClient.js +14 -3
  25. package/sdk/platform/Content/ContentPlatformModel.d.ts +6 -0
  26. package/sdk/platform/Content/ContentPlatformModel.js +6 -0
  27. package/sdk/platform/Content/ContentPlatformValidator.d.ts +12 -3
  28. package/sdk/platform/Content/ContentPlatformValidator.js +11 -2
  29. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +2 -0
  30. package/sdk/platform/Discount/DiscountPlatformModel.js +2 -0
  31. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +118 -58
  32. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +122 -68
  33. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -12
  34. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -85
  35. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -12
  36. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -14
  37. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -61
  38. package/sdk/platform/Order/OrderPlatformClient.js +87 -481
  39. package/sdk/platform/Order/OrderPlatformModel.d.ts +442 -171
  40. package/sdk/platform/Order/OrderPlatformModel.js +483 -169
  41. package/sdk/platform/Order/OrderPlatformValidator.d.ts +22 -69
  42. package/sdk/platform/Order/OrderPlatformValidator.js +17 -79
  43. package/sdk/platform/Theme/ThemePlatformModel.d.ts +103 -21
  44. package/sdk/platform/Theme/ThemePlatformModel.js +108 -20
  45. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +2 -2
  46. package/sdk/platform/Webhook/WebhookPlatformClient.js +4 -2
  47. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +21 -27
  48. package/sdk/platform/Webhook/WebhookPlatformModel.js +30 -27
@@ -72,6 +72,7 @@ const Joi = require("joi");
72
72
  /**
73
73
  * @typedef AvailablePageSchema
74
74
  * @property {string} [_id]
75
+ * @property {string} [created_at] - The creation timestamp of the page
75
76
  * @property {string} [path]
76
77
  * @property {Object[]} [props]
77
78
  * @property {AvailablePageSchemaSections[]} [sections]
@@ -80,6 +81,7 @@ const Joi = require("joi");
80
81
  * @property {string} [text]
81
82
  * @property {string} [theme]
82
83
  * @property {string} [type]
84
+ * @property {string} [updated_at] - The last update timestamp of the page
83
85
  * @property {string} [value]
84
86
  */
85
87
 
@@ -91,6 +93,7 @@ const Joi = require("joi");
91
93
  * @property {AvailablePagePredicate} [predicate]
92
94
  * @property {Object} [preset]
93
95
  * @property {Object} [props]
96
+ * @property {string} [source]
94
97
  */
95
98
 
96
99
  /**
@@ -109,7 +112,6 @@ const Joi = require("joi");
109
112
  * @typedef AvailablePageSeo
110
113
  * @property {string} [_id]
111
114
  * @property {SEObreadcrumb[]} [breadcrumb]
112
- * @property {string} [canonical_url]
113
115
  * @property {string} [description]
114
116
  * @property {SEOMetaItem[]} [meta_tags]
115
117
  * @property {SEOSitemap} [sitemap]
@@ -202,6 +204,7 @@ const Joi = require("joi");
202
204
 
203
205
  /**
204
206
  * @typedef CSS
207
+ * @property {string} [link]
205
208
  * @property {string[]} [links]
206
209
  */
207
210
 
@@ -249,6 +252,12 @@ const Joi = require("joi");
249
252
  * price color
250
253
  */
251
254
 
255
+ /**
256
+ * @typedef DividerStrokeHighlight
257
+ * @property {string} [divider_strokes]
258
+ * @property {string} [highlight]
259
+ */
260
+
252
261
  /**
253
262
  * @typedef DummyResponse
254
263
  * @property {string} [message]
@@ -322,10 +331,22 @@ const Joi = require("joi");
322
331
  * @property {string} [_id] - The unique identifier for the marketplace theme.
323
332
  * @property {string} [created_at] - Creation date of the theme
324
333
  * @property {boolean} [is_default] - Whether the theme is the default theme.
325
- * @property {ReleaseVersionOnly} [release]
334
+ * @property {Release} [release]
326
335
  * @property {string} [updated_at] - Update date of the theme
327
336
  */
328
337
 
338
+ /**
339
+ * @typedef OrderTracking
340
+ * @property {boolean} [show_footer]
341
+ * @property {boolean} [show_header]
342
+ */
343
+
344
+ /**
345
+ * @typedef OverlayPopup
346
+ * @property {string} [dialog_backgroung]
347
+ * @property {string} [overlay]
348
+ */
349
+
329
350
  /**
330
351
  * @typedef Page
331
352
  * @property {number} [current]
@@ -356,6 +377,7 @@ const Joi = require("joi");
356
377
  * @property {string} [info] - Additional information about the property
357
378
  * @property {string} [label] - The label of the property
358
379
  * @property {string} [type] - The type of the property
380
+ * @property {string} [value] - The value of the property
359
381
  */
360
382
 
361
383
  /**
@@ -370,11 +392,6 @@ const Joi = require("joi");
370
392
  * @property {string} [version] - The version of the theme
371
393
  */
372
394
 
373
- /**
374
- * @typedef ReleaseVersionOnly
375
- * @property {string} [version] - The version of the theme
376
- */
377
-
378
395
  /**
379
396
  * @typedef Route
380
397
  * @property {string} [exact_url] - The exact URL of the route.
@@ -448,12 +465,22 @@ const Joi = require("joi");
448
465
  * @property {string} [value] - The value of the text property.
449
466
  */
450
467
 
468
+ /**
469
+ * @typedef ThemeConfigListPage
470
+ * @property {string} [page] - Name of the page
471
+ * @property {ThemeConfigListPageSettingsProps} [settings]
472
+ */
473
+
474
+ /**
475
+ * @typedef ThemeConfigListPageSettingsProps
476
+ * @property {Object} [props]
477
+ */
478
+
451
479
  /**
452
480
  * @typedef ThemeConfiguration
453
- * @property {CustomConfig} [custom]
454
481
  * @property {Object} [global_config]
455
482
  * @property {string} [name] - The name of the configuration
456
- * @property {string[]} [page] - An array of pages
483
+ * @property {ThemeConfigListPage[]} [page] - An array of pages
457
484
  */
458
485
 
459
486
  /**
@@ -500,6 +527,7 @@ const Joi = require("joi");
500
527
  * @property {string} [marketplace_theme_id] - The ID of the theme in the marketplace
501
528
  * @property {ThemeMeta} [meta]
502
529
  * @property {string} [name] - The name of the theme
530
+ * @property {string} [src]
503
531
  * @property {Object} [styles] - The styles associated with the theme
504
532
  * @property {string[]} [tags] - An array of tags associated with the theme
505
533
  * @property {string} [template_theme_id] - The ID of the template theme
@@ -529,6 +557,7 @@ const Joi = require("joi");
529
557
 
530
558
  /**
531
559
  * @typedef UMDJs
560
+ * @property {string} [link]
532
561
  * @property {string[]} [links] - An array of pages
533
562
  */
534
563
 
@@ -549,6 +578,16 @@ const Joi = require("joi");
549
578
  * @property {string} [value] - The value of the URL property.
550
579
  */
551
580
 
581
+ /**
582
+ * @typedef UserAlerts
583
+ * @property {string} [error_background]
584
+ * @property {string} [error_text]
585
+ * @property {string} [info_background]
586
+ * @property {string} [info_text]
587
+ * @property {string} [success_background]
588
+ * @property {string} [success_text]
589
+ */
590
+
552
591
  /**
553
592
  * @typedef {| "about-us"
554
593
  * | "addresses"
@@ -698,6 +737,7 @@ class ThemePlatformModel {
698
737
  static AvailablePageSchema() {
699
738
  return Joi.object({
700
739
  _id: Joi.string().allow(""),
740
+ created_at: Joi.string().allow(""),
701
741
  path: Joi.string().allow(""),
702
742
  props: Joi.array().items(Joi.any()),
703
743
  sections: Joi.array().items(
@@ -710,6 +750,7 @@ class ThemePlatformModel {
710
750
  text: Joi.string().allow(""),
711
751
  theme: Joi.string().allow(""),
712
752
  type: Joi.string().allow(""),
753
+ updated_at: Joi.string().allow(""),
713
754
  value: Joi.string().allow(""),
714
755
  });
715
756
  }
@@ -723,6 +764,7 @@ class ThemePlatformModel {
723
764
  predicate: ThemePlatformModel.AvailablePagePredicate(),
724
765
  preset: Joi.any(),
725
766
  props: Joi.any(),
767
+ source: Joi.string().allow(""),
726
768
  });
727
769
  }
728
770
 
@@ -747,7 +789,6 @@ class ThemePlatformModel {
747
789
  return Joi.object({
748
790
  _id: Joi.string().allow(""),
749
791
  breadcrumb: Joi.array().items(ThemePlatformModel.SEObreadcrumb()),
750
- canonical_url: Joi.string().allow(""),
751
792
  description: Joi.string().allow(""),
752
793
  meta_tags: Joi.array().items(ThemePlatformModel.SEOMetaItem()),
753
794
  sitemap: ThemePlatformModel.SEOSitemap(),
@@ -865,6 +906,7 @@ class ThemePlatformModel {
865
906
  /** @returns {CSS} */
866
907
  static CSS() {
867
908
  return Joi.object({
909
+ link: Joi.string().allow(""),
868
910
  links: Joi.array().items(Joi.string().allow("")),
869
911
  });
870
912
  }
@@ -912,6 +954,14 @@ class ThemePlatformModel {
912
954
  });
913
955
  }
914
956
 
957
+ /** @returns {DividerStrokeHighlight} */
958
+ static DividerStrokeHighlight() {
959
+ return Joi.object({
960
+ divider_strokes: Joi.string().allow(""),
961
+ highlight: Joi.string().allow(""),
962
+ });
963
+ }
964
+
915
965
  /** @returns {DummyResponse} */
916
966
  static DummyResponse() {
917
967
  return Joi.object({
@@ -1006,11 +1056,27 @@ class ThemePlatformModel {
1006
1056
  _id: Joi.string().allow(""),
1007
1057
  created_at: Joi.string().allow(""),
1008
1058
  is_default: Joi.boolean(),
1009
- release: ThemePlatformModel.ReleaseVersionOnly(),
1059
+ release: ThemePlatformModel.Release(),
1010
1060
  updated_at: Joi.string().allow(""),
1011
1061
  });
1012
1062
  }
1013
1063
 
1064
+ /** @returns {OrderTracking} */
1065
+ static OrderTracking() {
1066
+ return Joi.object({
1067
+ show_footer: Joi.boolean(),
1068
+ show_header: Joi.boolean(),
1069
+ });
1070
+ }
1071
+
1072
+ /** @returns {OverlayPopup} */
1073
+ static OverlayPopup() {
1074
+ return Joi.object({
1075
+ dialog_backgroung: Joi.string().allow(""),
1076
+ overlay: Joi.string().allow(""),
1077
+ });
1078
+ }
1079
+
1014
1080
  /** @returns {Page} */
1015
1081
  static Page() {
1016
1082
  return Joi.object({
@@ -1048,6 +1114,7 @@ class ThemePlatformModel {
1048
1114
  info: Joi.string().allow(""),
1049
1115
  label: Joi.string().allow(""),
1050
1116
  type: Joi.string().allow(""),
1117
+ value: Joi.string().allow(""),
1051
1118
  });
1052
1119
  }
1053
1120
 
@@ -1067,13 +1134,6 @@ class ThemePlatformModel {
1067
1134
  });
1068
1135
  }
1069
1136
 
1070
- /** @returns {ReleaseVersionOnly} */
1071
- static ReleaseVersionOnly() {
1072
- return Joi.object({
1073
- version: Joi.string().allow(""),
1074
- });
1075
- }
1076
-
1077
1137
  /** @returns {Route} */
1078
1138
  static Route() {
1079
1139
  return Joi.object({
@@ -1169,13 +1229,27 @@ class ThemePlatformModel {
1169
1229
  });
1170
1230
  }
1171
1231
 
1232
+ /** @returns {ThemeConfigListPage} */
1233
+ static ThemeConfigListPage() {
1234
+ return Joi.object({
1235
+ page: Joi.string().allow(""),
1236
+ settings: ThemePlatformModel.ThemeConfigListPageSettingsProps(),
1237
+ });
1238
+ }
1239
+
1240
+ /** @returns {ThemeConfigListPageSettingsProps} */
1241
+ static ThemeConfigListPageSettingsProps() {
1242
+ return Joi.object({
1243
+ props: Joi.any(),
1244
+ });
1245
+ }
1246
+
1172
1247
  /** @returns {ThemeConfiguration} */
1173
1248
  static ThemeConfiguration() {
1174
1249
  return Joi.object({
1175
- custom: ThemePlatformModel.CustomConfig(),
1176
1250
  global_config: Joi.any(),
1177
1251
  name: Joi.string().allow(""),
1178
- page: Joi.array().items(Joi.string().allow("")),
1252
+ page: Joi.array().items(ThemePlatformModel.ThemeConfigListPage()),
1179
1253
  });
1180
1254
  }
1181
1255
 
@@ -1231,6 +1305,7 @@ class ThemePlatformModel {
1231
1305
  marketplace_theme_id: Joi.string().allow(""),
1232
1306
  meta: ThemePlatformModel.ThemeMeta(),
1233
1307
  name: Joi.string().allow(""),
1308
+ src: Joi.string().allow(""),
1234
1309
  styles: Joi.any(),
1235
1310
  tags: Joi.array().items(Joi.string().allow("")),
1236
1311
  template_theme_id: Joi.string().allow(""),
@@ -1268,6 +1343,7 @@ class ThemePlatformModel {
1268
1343
  /** @returns {UMDJs} */
1269
1344
  static UMDJs() {
1270
1345
  return Joi.object({
1346
+ link: Joi.string().allow(""),
1271
1347
  links: Joi.array().items(Joi.string().allow("")),
1272
1348
  });
1273
1349
  }
@@ -1295,6 +1371,18 @@ class ThemePlatformModel {
1295
1371
  });
1296
1372
  }
1297
1373
 
1374
+ /** @returns {UserAlerts} */
1375
+ static UserAlerts() {
1376
+ return Joi.object({
1377
+ error_background: Joi.string().allow(""),
1378
+ error_text: Joi.string().allow(""),
1379
+ info_background: Joi.string().allow(""),
1380
+ info_text: Joi.string().allow(""),
1381
+ success_background: Joi.string().allow(""),
1382
+ success_text: Joi.string().allow(""),
1383
+ });
1384
+ }
1385
+
1298
1386
  /**
1299
1387
  * Enum: PageType Used By: Theme
1300
1388
  *
@@ -28,13 +28,13 @@ declare class Webhook {
28
28
  * @param {WebhookPlatformValidator.FetchAllEventConfigurationsParam} arg - Arg object
29
29
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
30
30
  * @param {import("../PlatformAPIClient").Options} - Options
31
- * @returns {Promise<Object>} - Success response
31
+ * @returns {Promise<WebhookPlatformModel.EventConfigResponse>} - Success response
32
32
  * @name fetchAllEventConfigurations
33
33
  * @summary: Get All Webhook Events.
34
34
  * @description: To fetch all webhook events.
35
35
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/fetchAllEventConfigurations/).
36
36
  */
37
- fetchAllEventConfigurations({ requestHeaders }?: any, { responseHeaders }?: object): Promise<any>;
37
+ fetchAllEventConfigurations({ requestHeaders }?: any, { responseHeaders }?: object): Promise<WebhookPlatformModel.EventConfigResponse>;
38
38
  /**
39
39
  * @param {WebhookPlatformValidator.GetDeliveryReportsParam} arg - Arg object
40
40
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -180,7 +180,7 @@ class Webhook {
180
180
  * @param {WebhookPlatformValidator.FetchAllEventConfigurationsParam} arg - Arg object
181
181
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
182
182
  * @param {import("../PlatformAPIClient").Options} - Options
183
- * @returns {Promise<Object>} - Success response
183
+ * @returns {Promise<WebhookPlatformModel.EventConfigResponse>} - Success response
184
184
  * @name fetchAllEventConfigurations
185
185
  * @summary: Get All Webhook Events.
186
186
  * @description: To fetch all webhook events.
@@ -233,7 +233,9 @@ class Webhook {
233
233
  responseData = response[0];
234
234
  }
235
235
 
236
- const { error: res_error } = Joi.any().validate(responseData, {
236
+ const {
237
+ error: res_error,
238
+ } = WebhookPlatformModel.EventConfigResponse().validate(responseData, {
237
239
  abortEarly: false,
238
240
  allowUnknown: true,
239
241
  });
@@ -47,22 +47,15 @@ export = WebhookPlatformModel;
47
47
  * @property {string} [display_name]
48
48
  * @property {string} [event_category]
49
49
  * @property {string} [event_name]
50
+ * @property {Object} [event_schema]
50
51
  * @property {string} [event_type]
51
52
  * @property {number} [id]
53
+ * @property {string} [updated_on]
52
54
  * @property {string} [version]
53
55
  */
54
56
  /**
55
57
  * @typedef EventConfigResponse
56
- * @property {string} [created_on]
57
- * @property {string} [description]
58
- * @property {string} [display_name]
59
- * @property {string} [event_category]
60
- * @property {string} [event_name]
61
- * @property {Object} [event_schema]
62
- * @property {string} [event_type]
63
- * @property {number} [id]
64
- * @property {string} [updated_on]
65
- * @property {string} [version]
58
+ * @property {EventConfig[]} [event_configs]
66
59
  */
67
60
  /**
68
61
  * @typedef EventConfigs
@@ -224,7 +217,7 @@ export = WebhookPlatformModel;
224
217
  * @property {number[]} [event_id]
225
218
  * @property {number} [id]
226
219
  * @property {string} [name]
227
- * @property {string} [status]
220
+ * @property {SubscriberStatus} [status]
228
221
  * @property {string} [webhook_url]
229
222
  */
230
223
  /**
@@ -243,7 +236,7 @@ export = WebhookPlatformModel;
243
236
  * @property {number} [id]
244
237
  * @property {string} [modified_by]
245
238
  * @property {string} [name]
246
- * @property {string} [status]
239
+ * @property {SubscriberStatus} [status]
247
240
  * @property {string} [type]
248
241
  * @property {string} [updated_on]
249
242
  * @property {string} [webhook_url]
@@ -272,7 +265,7 @@ export = WebhookPlatformModel;
272
265
  * @property {number} [id]
273
266
  * @property {string} [modified_by]
274
267
  * @property {string} [name]
275
- * @property {string} [status]
268
+ * @property {SubscriberStatus} [status]
276
269
  * @property {string} [type]
277
270
  * @property {string} [updated_on]
278
271
  * @property {string} [webhook_url]
@@ -286,10 +279,11 @@ export = WebhookPlatformModel;
286
279
  * @property {string} [name] - The name of the uploaded report file.
287
280
  * @property {string} [url] - The URL of the uploaded report file.
288
281
  */
282
+ /** @typedef {"active" | "inactive" | "blocked"} SubscriberStatus */
289
283
  declare class WebhookPlatformModel {
290
284
  }
291
285
  declare namespace WebhookPlatformModel {
292
- export { Association, AuthMeta, CancelResponse, CdnObject, DownloadReportResponse, Err, Error, Event, EventConfig, EventConfigResponse, EventConfigs, EventProcessReportObject, EventProcessReports, EventProcessRequest, HistoryAssociation, HistoryFilters, HistoryItems, HistoryPayload, HistoryResponse, Item, Page, PingWebhook, PingWebhookResponse, ReportFilterResponse, ReportFiltersPayload, RetryCountResponse, RetryEventRequest, RetryFailureResponse, RetryStatusResponse, RetrySuccessResponse, SubscriberConfig, SubscriberConfigList, SubscriberConfigResponse, SubscriberEventMapping, SubscriberFailureResponse, SubscriberResponse, UploadServiceObject, Url };
286
+ export { Association, AuthMeta, CancelResponse, CdnObject, DownloadReportResponse, Err, Error, Event, EventConfig, EventConfigResponse, EventConfigs, EventProcessReportObject, EventProcessReports, EventProcessRequest, HistoryAssociation, HistoryFilters, HistoryItems, HistoryPayload, HistoryResponse, Item, Page, PingWebhook, PingWebhookResponse, ReportFilterResponse, ReportFiltersPayload, RetryCountResponse, RetryEventRequest, RetryFailureResponse, RetryStatusResponse, RetrySuccessResponse, SubscriberConfig, SubscriberConfigList, SubscriberConfigResponse, SubscriberEventMapping, SubscriberFailureResponse, SubscriberResponse, UploadServiceObject, Url, SubscriberStatus };
293
287
  }
294
288
  /** @returns {Association} */
295
289
  declare function Association(): Association;
@@ -354,23 +348,16 @@ type EventConfig = {
354
348
  display_name?: string;
355
349
  event_category?: string;
356
350
  event_name?: string;
351
+ event_schema?: any;
357
352
  event_type?: string;
358
353
  id?: number;
354
+ updated_on?: string;
359
355
  version?: string;
360
356
  };
361
357
  /** @returns {EventConfigResponse} */
362
358
  declare function EventConfigResponse(): EventConfigResponse;
363
359
  type EventConfigResponse = {
364
- created_on?: string;
365
- description?: string;
366
- display_name?: string;
367
- event_category?: string;
368
- event_name?: string;
369
- event_schema?: any;
370
- event_type?: string;
371
- id?: number;
372
- updated_on?: string;
373
- version?: string;
360
+ event_configs?: EventConfig[];
374
361
  };
375
362
  /** @returns {EventConfigs} */
376
363
  declare function EventConfigs(): EventConfigs;
@@ -658,7 +645,7 @@ type SubscriberConfig = {
658
645
  event_id?: number[];
659
646
  id?: number;
660
647
  name?: string;
661
- status?: string;
648
+ status?: SubscriberStatus;
662
649
  webhook_url?: string;
663
650
  };
664
651
  /** @returns {SubscriberConfigList} */
@@ -679,7 +666,7 @@ type SubscriberConfigResponse = {
679
666
  id?: number;
680
667
  modified_by?: string;
681
668
  name?: string;
682
- status?: string;
669
+ status?: SubscriberStatus;
683
670
  type?: string;
684
671
  updated_on?: string;
685
672
  webhook_url?: string;
@@ -711,7 +698,7 @@ type SubscriberResponse = {
711
698
  id?: number;
712
699
  modified_by?: string;
713
700
  name?: string;
714
- status?: string;
701
+ status?: SubscriberStatus;
715
702
  type?: string;
716
703
  updated_on?: string;
717
704
  webhook_url?: string;
@@ -733,3 +720,10 @@ type Url = {
733
720
  */
734
721
  url?: string;
735
722
  };
723
+ /**
724
+ * Enum: SubscriberStatus Used By: Webhook
725
+ *
726
+ * @returns {SubscriberStatus}
727
+ */
728
+ declare function SubscriberStatus(): SubscriberStatus;
729
+ type SubscriberStatus = "active" | "inactive" | "blocked";
@@ -56,23 +56,16 @@ const Joi = require("joi");
56
56
  * @property {string} [display_name]
57
57
  * @property {string} [event_category]
58
58
  * @property {string} [event_name]
59
+ * @property {Object} [event_schema]
59
60
  * @property {string} [event_type]
60
61
  * @property {number} [id]
62
+ * @property {string} [updated_on]
61
63
  * @property {string} [version]
62
64
  */
63
65
 
64
66
  /**
65
67
  * @typedef EventConfigResponse
66
- * @property {string} [created_on]
67
- * @property {string} [description]
68
- * @property {string} [display_name]
69
- * @property {string} [event_category]
70
- * @property {string} [event_name]
71
- * @property {Object} [event_schema]
72
- * @property {string} [event_type]
73
- * @property {number} [id]
74
- * @property {string} [updated_on]
75
- * @property {string} [version]
68
+ * @property {EventConfig[]} [event_configs]
76
69
  */
77
70
 
78
71
  /**
@@ -255,7 +248,7 @@ const Joi = require("joi");
255
248
  * @property {number[]} [event_id]
256
249
  * @property {number} [id]
257
250
  * @property {string} [name]
258
- * @property {string} [status]
251
+ * @property {SubscriberStatus} [status]
259
252
  * @property {string} [webhook_url]
260
253
  */
261
254
 
@@ -276,7 +269,7 @@ const Joi = require("joi");
276
269
  * @property {number} [id]
277
270
  * @property {string} [modified_by]
278
271
  * @property {string} [name]
279
- * @property {string} [status]
272
+ * @property {SubscriberStatus} [status]
280
273
  * @property {string} [type]
281
274
  * @property {string} [updated_on]
282
275
  * @property {string} [webhook_url]
@@ -308,7 +301,7 @@ const Joi = require("joi");
308
301
  * @property {number} [id]
309
302
  * @property {string} [modified_by]
310
303
  * @property {string} [name]
311
- * @property {string} [status]
304
+ * @property {SubscriberStatus} [status]
312
305
  * @property {string} [type]
313
306
  * @property {string} [updated_on]
314
307
  * @property {string} [webhook_url]
@@ -325,6 +318,8 @@ const Joi = require("joi");
325
318
  * @property {string} [url] - The URL of the uploaded report file.
326
319
  */
327
320
 
321
+ /** @typedef {"active" | "inactive" | "blocked"} SubscriberStatus */
322
+
328
323
  class WebhookPlatformModel {
329
324
  /** @returns {Association} */
330
325
  static Association() {
@@ -395,12 +390,14 @@ class WebhookPlatformModel {
395
390
  static EventConfig() {
396
391
  return Joi.object({
397
392
  created_on: Joi.string().allow(""),
398
- description: Joi.string().allow(""),
393
+ description: Joi.string().allow("").allow(null),
399
394
  display_name: Joi.string().allow(""),
400
395
  event_category: Joi.string().allow(""),
401
396
  event_name: Joi.string().allow(""),
397
+ event_schema: Joi.object().pattern(/\S/, Joi.any()),
402
398
  event_type: Joi.string().allow(""),
403
399
  id: Joi.number(),
400
+ updated_on: Joi.string().allow(""),
404
401
  version: Joi.string().allow(""),
405
402
  });
406
403
  }
@@ -408,16 +405,7 @@ class WebhookPlatformModel {
408
405
  /** @returns {EventConfigResponse} */
409
406
  static EventConfigResponse() {
410
407
  return Joi.object({
411
- created_on: Joi.string().allow(""),
412
- description: Joi.string().allow("").allow(null),
413
- display_name: Joi.string().allow(""),
414
- event_category: Joi.string().allow(""),
415
- event_name: Joi.string().allow(""),
416
- event_schema: Joi.object().pattern(/\S/, Joi.any()),
417
- event_type: Joi.string().allow(""),
418
- id: Joi.number(),
419
- updated_on: Joi.string().allow(""),
420
- version: Joi.string().allow(""),
408
+ event_configs: Joi.array().items(WebhookPlatformModel.EventConfig()),
421
409
  });
422
410
  }
423
411
 
@@ -636,7 +624,7 @@ class WebhookPlatformModel {
636
624
  event_id: Joi.array().items(Joi.number()),
637
625
  id: Joi.number(),
638
626
  name: Joi.string().allow(""),
639
- status: Joi.string().allow(""),
627
+ status: WebhookPlatformModel.SubscriberStatus(),
640
628
  webhook_url: Joi.string().allow(""),
641
629
  });
642
630
  }
@@ -661,7 +649,7 @@ class WebhookPlatformModel {
661
649
  id: Joi.number(),
662
650
  modified_by: Joi.string().allow(""),
663
651
  name: Joi.string().allow(""),
664
- status: Joi.string().allow(""),
652
+ status: WebhookPlatformModel.SubscriberStatus(),
665
653
  type: Joi.string().allow("").allow(null),
666
654
  updated_on: Joi.string().allow(""),
667
655
  webhook_url: Joi.string().allow(""),
@@ -699,7 +687,7 @@ class WebhookPlatformModel {
699
687
  id: Joi.number(),
700
688
  modified_by: Joi.string().allow(""),
701
689
  name: Joi.string().allow(""),
702
- status: Joi.string().allow(""),
690
+ status: WebhookPlatformModel.SubscriberStatus(),
703
691
  type: Joi.string().allow("").allow(null),
704
692
  updated_on: Joi.string().allow(""),
705
693
  webhook_url: Joi.string().allow(""),
@@ -720,5 +708,20 @@ class WebhookPlatformModel {
720
708
  url: Joi.string().allow(""),
721
709
  });
722
710
  }
711
+
712
+ /**
713
+ * Enum: SubscriberStatus Used By: Webhook
714
+ *
715
+ * @returns {SubscriberStatus}
716
+ */
717
+ static SubscriberStatus() {
718
+ return Joi.string().valid(
719
+ "active",
720
+
721
+ "inactive",
722
+
723
+ "blocked"
724
+ );
725
+ }
723
726
  }
724
727
  module.exports = WebhookPlatformModel;