@objectstack/spec 0.7.1 → 0.7.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 (91) hide show
  1. package/dist/ai/agent-action.zod.d.ts +8 -8
  2. package/dist/ai/model-registry.zod.d.ts +6 -6
  3. package/dist/ai/orchestration.zod.d.ts +6 -6
  4. package/dist/ai/predictive.zod.d.ts +2 -2
  5. package/dist/ai/rag-pipeline.zod.d.ts +2 -2
  6. package/dist/api/batch.zod.d.ts +81 -8
  7. package/dist/api/batch.zod.d.ts.map +1 -1
  8. package/dist/api/batch.zod.js +14 -1
  9. package/dist/api/graphql.zod.d.ts +224 -224
  10. package/dist/api/odata.zod.d.ts +379 -0
  11. package/dist/api/odata.zod.d.ts.map +1 -1
  12. package/dist/api/odata.zod.js +14 -1
  13. package/dist/api/protocol.zod.d.ts +18 -18
  14. package/dist/api/realtime.zod.d.ts +133 -0
  15. package/dist/api/realtime.zod.d.ts.map +1 -1
  16. package/dist/api/realtime.zod.js +14 -1
  17. package/dist/api/websocket.zod.d.ts +2 -2
  18. package/dist/auth/config.zod.d.ts +12 -12
  19. package/dist/auth/identity.zod.d.ts +3 -3
  20. package/dist/automation/approval.zod.d.ts +16 -16
  21. package/dist/automation/etl.zod.d.ts +2 -2
  22. package/dist/automation/sync.zod.d.ts +4 -4
  23. package/dist/automation/webhook.zod.d.ts +2 -2
  24. package/dist/automation/workflow.zod.d.ts +28 -28
  25. package/dist/data/object.zod.d.ts.map +1 -1
  26. package/dist/data/object.zod.js +3 -1
  27. package/dist/hub/composer.zod.d.ts +9 -8
  28. package/dist/hub/composer.zod.d.ts.map +1 -1
  29. package/dist/hub/marketplace.zod.d.ts +1 -0
  30. package/dist/hub/marketplace.zod.d.ts.map +1 -1
  31. package/dist/hub/plugin-registry.zod.d.ts +9 -9
  32. package/dist/hub/space.zod.d.ts +5 -4
  33. package/dist/hub/space.zod.d.ts.map +1 -1
  34. package/dist/integration/connector/database.zod.d.ts +33 -33
  35. package/dist/integration/connector/file-storage.zod.d.ts +52 -52
  36. package/dist/integration/connector/message-queue.zod.d.ts +43 -43
  37. package/dist/integration/connector/saas.zod.d.ts +31 -30
  38. package/dist/integration/connector/saas.zod.d.ts.map +1 -1
  39. package/dist/integration/connector.zod.d.ts +34 -34
  40. package/dist/stack.zod.d.ts +78 -78
  41. package/dist/system/change-management.zod.d.ts +2 -2
  42. package/dist/system/collaboration.zod.d.ts +6 -6
  43. package/dist/system/events.zod.d.ts +2536 -0
  44. package/dist/system/events.zod.d.ts.map +1 -1
  45. package/dist/system/events.zod.js +582 -1
  46. package/dist/system/http-server.zod.d.ts +2 -2
  47. package/dist/system/index.d.ts +1 -0
  48. package/dist/system/index.d.ts.map +1 -1
  49. package/dist/system/index.js +1 -0
  50. package/dist/system/job.zod.d.ts +3 -2
  51. package/dist/system/job.zod.d.ts.map +1 -1
  52. package/dist/system/logging.zod.d.ts +10 -10
  53. package/dist/system/manifest.zod.d.ts +6 -6
  54. package/dist/system/message-queue.zod.d.ts +10 -10
  55. package/dist/system/metadata-loader.zod.d.ts +3 -3
  56. package/dist/system/notification.zod.d.ts +12 -12
  57. package/dist/system/plugin-capability.zod.d.ts +6 -6
  58. package/dist/system/startup-orchestrator.zod.d.ts +2 -2
  59. package/dist/system/worker.zod.d.ts +1458 -0
  60. package/dist/system/worker.zod.d.ts.map +1 -0
  61. package/dist/system/worker.zod.js +479 -0
  62. package/json-schema/api/BatchConfig.json +51 -0
  63. package/json-schema/api/ODataConfig.json +132 -0
  64. package/json-schema/api/RealtimeConfig.json +90 -0
  65. package/json-schema/data/Object.json +4 -1
  66. package/json-schema/system/BatchProgress.json +72 -0
  67. package/json-schema/system/BatchTask.json +63 -0
  68. package/json-schema/system/DeadLetterQueueEntry.json +137 -0
  69. package/json-schema/system/Event.json +24 -0
  70. package/json-schema/system/EventBusConfig.json +552 -0
  71. package/json-schema/system/EventHandler.json +34 -0
  72. package/json-schema/system/EventLogEntry.json +153 -0
  73. package/json-schema/system/EventMessageQueueConfig.json +79 -0
  74. package/json-schema/system/EventMetadata.json +20 -0
  75. package/json-schema/system/EventPersistence.json +11 -0
  76. package/json-schema/system/EventPriority.json +16 -0
  77. package/json-schema/system/EventQueueConfig.json +67 -0
  78. package/json-schema/system/EventReplayConfig.json +50 -0
  79. package/json-schema/system/EventSourcingConfig.json +65 -0
  80. package/json-schema/system/EventTypeDefinition.json +45 -0
  81. package/json-schema/system/EventWebhookConfig.json +119 -0
  82. package/json-schema/system/QueueConfig.json +133 -0
  83. package/json-schema/system/RealTimeNotificationConfig.json +85 -0
  84. package/json-schema/system/Task.json +145 -0
  85. package/json-schema/system/TaskExecutionResult.json +85 -0
  86. package/json-schema/system/TaskPriority.json +16 -0
  87. package/json-schema/system/TaskRetryPolicy.json +46 -0
  88. package/json-schema/system/TaskStatus.json +19 -0
  89. package/json-schema/system/WorkerConfig.json +188 -0
  90. package/json-schema/system/WorkerStats.json +90 -0
  91. package/package.json +9 -1
@@ -1,4 +1,16 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * Event Priority Enum
4
+ * Priority levels for event processing
5
+ * Lower numbers = higher priority
6
+ */
7
+ export declare const EventPriority: z.ZodEnum<["critical", "high", "normal", "low", "background"]>;
8
+ export type EventPriority = z.infer<typeof EventPriority>;
9
+ /**
10
+ * Event Priority Values
11
+ * Maps priority names to numeric values for sorting
12
+ */
13
+ export declare const EVENT_PRIORITY_VALUES: Record<EventPriority, number>;
2
14
  /**
3
15
  * Event Metadata Schema
4
16
  * Metadata associated with every event
@@ -8,17 +20,67 @@ export declare const EventMetadataSchema: z.ZodObject<{
8
20
  timestamp: z.ZodString;
9
21
  userId: z.ZodOptional<z.ZodString>;
10
22
  tenantId: z.ZodOptional<z.ZodString>;
23
+ correlationId: z.ZodOptional<z.ZodString>;
24
+ causationId: z.ZodOptional<z.ZodString>;
25
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
11
26
  }, "strip", z.ZodTypeAny, {
12
27
  source: string;
28
+ priority: "background" | "normal" | "critical" | "high" | "low";
13
29
  timestamp: string;
14
30
  userId?: string | undefined;
15
31
  tenantId?: string | undefined;
32
+ correlationId?: string | undefined;
33
+ causationId?: string | undefined;
16
34
  }, {
17
35
  source: string;
18
36
  timestamp: string;
37
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
19
38
  userId?: string | undefined;
20
39
  tenantId?: string | undefined;
40
+ correlationId?: string | undefined;
41
+ causationId?: string | undefined;
42
+ }>;
43
+ /**
44
+ * Event Type Definition Schema
45
+ * Defines the structure of an event type
46
+ *
47
+ * @example
48
+ * {
49
+ * "name": "order.created",
50
+ * "version": "1.0.0",
51
+ * "schema": {
52
+ * "type": "object",
53
+ * "properties": {
54
+ * "orderId": { "type": "string" },
55
+ * "customerId": { "type": "string" },
56
+ * "total": { "type": "number" }
57
+ * }
58
+ * }
59
+ * }
60
+ */
61
+ export declare const EventTypeDefinitionSchema: z.ZodObject<{
62
+ name: z.ZodString;
63
+ version: z.ZodDefault<z.ZodString>;
64
+ schema: z.ZodOptional<z.ZodAny>;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
67
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ name: string;
70
+ version: string;
71
+ deprecated: boolean;
72
+ tags?: string[] | undefined;
73
+ description?: string | undefined;
74
+ schema?: any;
75
+ }, {
76
+ name: string;
77
+ tags?: string[] | undefined;
78
+ description?: string | undefined;
79
+ schema?: any;
80
+ version?: string | undefined;
81
+ deprecated?: boolean | undefined;
21
82
  }>;
83
+ export type EventTypeDefinition = z.infer<typeof EventTypeDefinitionSchema>;
22
84
  /**
23
85
  * Event Schema
24
86
  * Base schema for all events in the system
@@ -27,41 +89,71 @@ export declare const EventMetadataSchema: z.ZodObject<{
27
89
  * This aligns with industry standards for event-driven architectures and message queues.
28
90
  */
29
91
  export declare const EventSchema: z.ZodObject<{
92
+ /**
93
+ * Event identifier (for tracking and deduplication)
94
+ */
95
+ id: z.ZodOptional<z.ZodString>;
96
+ /**
97
+ * Event name
98
+ */
30
99
  name: z.ZodString;
100
+ /**
101
+ * Event payload
102
+ */
31
103
  payload: z.ZodAny;
104
+ /**
105
+ * Event metadata
106
+ */
32
107
  metadata: z.ZodObject<{
33
108
  source: z.ZodString;
34
109
  timestamp: z.ZodString;
35
110
  userId: z.ZodOptional<z.ZodString>;
36
111
  tenantId: z.ZodOptional<z.ZodString>;
112
+ correlationId: z.ZodOptional<z.ZodString>;
113
+ causationId: z.ZodOptional<z.ZodString>;
114
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
37
115
  }, "strip", z.ZodTypeAny, {
38
116
  source: string;
117
+ priority: "background" | "normal" | "critical" | "high" | "low";
39
118
  timestamp: string;
40
119
  userId?: string | undefined;
41
120
  tenantId?: string | undefined;
121
+ correlationId?: string | undefined;
122
+ causationId?: string | undefined;
42
123
  }, {
43
124
  source: string;
44
125
  timestamp: string;
126
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
45
127
  userId?: string | undefined;
46
128
  tenantId?: string | undefined;
129
+ correlationId?: string | undefined;
130
+ causationId?: string | undefined;
47
131
  }>;
48
132
  }, "strip", z.ZodTypeAny, {
49
133
  name: string;
50
134
  metadata: {
51
135
  source: string;
136
+ priority: "background" | "normal" | "critical" | "high" | "low";
52
137
  timestamp: string;
53
138
  userId?: string | undefined;
54
139
  tenantId?: string | undefined;
140
+ correlationId?: string | undefined;
141
+ causationId?: string | undefined;
55
142
  };
143
+ id?: string | undefined;
56
144
  payload?: any;
57
145
  }, {
58
146
  name: string;
59
147
  metadata: {
60
148
  source: string;
61
149
  timestamp: string;
150
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
62
151
  userId?: string | undefined;
63
152
  tenantId?: string | undefined;
153
+ correlationId?: string | undefined;
154
+ causationId?: string | undefined;
64
155
  };
156
+ id?: string | undefined;
65
157
  payload?: any;
66
158
  }>;
67
159
  export type Event = z.infer<typeof EventSchema>;
@@ -70,47 +162,184 @@ export type Event = z.infer<typeof EventSchema>;
70
162
  * Defines how to handle a specific event
71
163
  */
72
164
  export declare const EventHandlerSchema: z.ZodObject<{
165
+ /**
166
+ * Handler identifier
167
+ */
168
+ id: z.ZodOptional<z.ZodString>;
169
+ /**
170
+ * Event name pattern
171
+ */
73
172
  eventName: z.ZodString;
173
+ /**
174
+ * Handler function
175
+ */
74
176
  handler: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
177
+ /**
178
+ * Event identifier (for tracking and deduplication)
179
+ */
180
+ id: z.ZodOptional<z.ZodString>;
181
+ /**
182
+ * Event name
183
+ */
75
184
  name: z.ZodString;
185
+ /**
186
+ * Event payload
187
+ */
76
188
  payload: z.ZodAny;
189
+ /**
190
+ * Event metadata
191
+ */
77
192
  metadata: z.ZodObject<{
78
193
  source: z.ZodString;
79
194
  timestamp: z.ZodString;
80
195
  userId: z.ZodOptional<z.ZodString>;
81
196
  tenantId: z.ZodOptional<z.ZodString>;
197
+ correlationId: z.ZodOptional<z.ZodString>;
198
+ causationId: z.ZodOptional<z.ZodString>;
199
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
82
200
  }, "strip", z.ZodTypeAny, {
83
201
  source: string;
202
+ priority: "background" | "normal" | "critical" | "high" | "low";
84
203
  timestamp: string;
85
204
  userId?: string | undefined;
86
205
  tenantId?: string | undefined;
206
+ correlationId?: string | undefined;
207
+ causationId?: string | undefined;
87
208
  }, {
88
209
  source: string;
89
210
  timestamp: string;
211
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
90
212
  userId?: string | undefined;
91
213
  tenantId?: string | undefined;
214
+ correlationId?: string | undefined;
215
+ causationId?: string | undefined;
92
216
  }>;
93
217
  }, "strip", z.ZodTypeAny, {
94
218
  name: string;
95
219
  metadata: {
96
220
  source: string;
221
+ priority: "background" | "normal" | "critical" | "high" | "low";
97
222
  timestamp: string;
98
223
  userId?: string | undefined;
99
224
  tenantId?: string | undefined;
225
+ correlationId?: string | undefined;
226
+ causationId?: string | undefined;
100
227
  };
228
+ id?: string | undefined;
101
229
  payload?: any;
102
230
  }, {
103
231
  name: string;
104
232
  metadata: {
105
233
  source: string;
106
234
  timestamp: string;
235
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
107
236
  userId?: string | undefined;
108
237
  tenantId?: string | undefined;
238
+ correlationId?: string | undefined;
239
+ causationId?: string | undefined;
109
240
  };
241
+ id?: string | undefined;
110
242
  payload?: any;
111
243
  }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
244
+ /**
245
+ * Execution priority
246
+ */
112
247
  priority: z.ZodDefault<z.ZodNumber>;
248
+ /**
249
+ * Async execution
250
+ */
113
251
  async: z.ZodDefault<z.ZodBoolean>;
252
+ /**
253
+ * Retry configuration
254
+ */
255
+ retry: z.ZodOptional<z.ZodObject<{
256
+ maxRetries: z.ZodDefault<z.ZodNumber>;
257
+ backoffMs: z.ZodDefault<z.ZodNumber>;
258
+ backoffMultiplier: z.ZodDefault<z.ZodNumber>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ maxRetries: number;
261
+ backoffMs: number;
262
+ backoffMultiplier: number;
263
+ }, {
264
+ maxRetries?: number | undefined;
265
+ backoffMs?: number | undefined;
266
+ backoffMultiplier?: number | undefined;
267
+ }>>;
268
+ /**
269
+ * Timeout
270
+ */
271
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
272
+ /**
273
+ * Filter function
274
+ */
275
+ filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
276
+ /**
277
+ * Event identifier (for tracking and deduplication)
278
+ */
279
+ id: z.ZodOptional<z.ZodString>;
280
+ /**
281
+ * Event name
282
+ */
283
+ name: z.ZodString;
284
+ /**
285
+ * Event payload
286
+ */
287
+ payload: z.ZodAny;
288
+ /**
289
+ * Event metadata
290
+ */
291
+ metadata: z.ZodObject<{
292
+ source: z.ZodString;
293
+ timestamp: z.ZodString;
294
+ userId: z.ZodOptional<z.ZodString>;
295
+ tenantId: z.ZodOptional<z.ZodString>;
296
+ correlationId: z.ZodOptional<z.ZodString>;
297
+ causationId: z.ZodOptional<z.ZodString>;
298
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ source: string;
301
+ priority: "background" | "normal" | "critical" | "high" | "low";
302
+ timestamp: string;
303
+ userId?: string | undefined;
304
+ tenantId?: string | undefined;
305
+ correlationId?: string | undefined;
306
+ causationId?: string | undefined;
307
+ }, {
308
+ source: string;
309
+ timestamp: string;
310
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
311
+ userId?: string | undefined;
312
+ tenantId?: string | undefined;
313
+ correlationId?: string | undefined;
314
+ causationId?: string | undefined;
315
+ }>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ name: string;
318
+ metadata: {
319
+ source: string;
320
+ priority: "background" | "normal" | "critical" | "high" | "low";
321
+ timestamp: string;
322
+ userId?: string | undefined;
323
+ tenantId?: string | undefined;
324
+ correlationId?: string | undefined;
325
+ causationId?: string | undefined;
326
+ };
327
+ id?: string | undefined;
328
+ payload?: any;
329
+ }, {
330
+ name: string;
331
+ metadata: {
332
+ source: string;
333
+ timestamp: string;
334
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
335
+ userId?: string | undefined;
336
+ tenantId?: string | undefined;
337
+ correlationId?: string | undefined;
338
+ causationId?: string | undefined;
339
+ };
340
+ id?: string | undefined;
341
+ payload?: any;
342
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
114
343
  }, "strip", z.ZodTypeAny, {
115
344
  async: boolean;
116
345
  handler: (args_0: {
@@ -118,27 +347,77 @@ export declare const EventHandlerSchema: z.ZodObject<{
118
347
  metadata: {
119
348
  source: string;
120
349
  timestamp: string;
350
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
121
351
  userId?: string | undefined;
122
352
  tenantId?: string | undefined;
353
+ correlationId?: string | undefined;
354
+ causationId?: string | undefined;
123
355
  };
356
+ id?: string | undefined;
124
357
  payload?: any;
125
358
  }, ...args: unknown[]) => Promise<void>;
126
359
  priority: number;
127
360
  eventName: string;
361
+ filter?: ((args_0: {
362
+ name: string;
363
+ metadata: {
364
+ source: string;
365
+ timestamp: string;
366
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
367
+ userId?: string | undefined;
368
+ tenantId?: string | undefined;
369
+ correlationId?: string | undefined;
370
+ causationId?: string | undefined;
371
+ };
372
+ id?: string | undefined;
373
+ payload?: any;
374
+ }, ...args: unknown[]) => boolean) | undefined;
375
+ id?: string | undefined;
376
+ retry?: {
377
+ maxRetries: number;
378
+ backoffMs: number;
379
+ backoffMultiplier: number;
380
+ } | undefined;
381
+ timeoutMs?: number | undefined;
128
382
  }, {
129
383
  handler: (args_0: {
130
384
  name: string;
131
385
  metadata: {
132
386
  source: string;
387
+ priority: "background" | "normal" | "critical" | "high" | "low";
133
388
  timestamp: string;
134
389
  userId?: string | undefined;
135
390
  tenantId?: string | undefined;
391
+ correlationId?: string | undefined;
392
+ causationId?: string | undefined;
136
393
  };
394
+ id?: string | undefined;
137
395
  payload?: any;
138
396
  }, ...args: unknown[]) => Promise<void>;
139
397
  eventName: string;
398
+ filter?: ((args_0: {
399
+ name: string;
400
+ metadata: {
401
+ source: string;
402
+ priority: "background" | "normal" | "critical" | "high" | "low";
403
+ timestamp: string;
404
+ userId?: string | undefined;
405
+ tenantId?: string | undefined;
406
+ correlationId?: string | undefined;
407
+ causationId?: string | undefined;
408
+ };
409
+ id?: string | undefined;
410
+ payload?: any;
411
+ }, ...args: unknown[]) => boolean) | undefined;
140
412
  async?: boolean | undefined;
141
413
  priority?: number | undefined;
414
+ id?: string | undefined;
415
+ retry?: {
416
+ maxRetries?: number | undefined;
417
+ backoffMs?: number | undefined;
418
+ backoffMultiplier?: number | undefined;
419
+ } | undefined;
420
+ timeoutMs?: number | undefined;
142
421
  }>;
143
422
  export type EventHandler = z.infer<typeof EventHandlerSchema>;
144
423
  /**
@@ -167,14 +446,2271 @@ export declare const EventPersistenceSchema: z.ZodObject<{
167
446
  enabled: z.ZodDefault<z.ZodBoolean>;
168
447
  retention: z.ZodNumber;
169
448
  filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
449
+ storage: z.ZodDefault<z.ZodEnum<["database", "file", "s3", "custom"]>>;
170
450
  }, "strip", z.ZodTypeAny, {
171
451
  enabled: boolean;
452
+ storage: "custom" | "database" | "file" | "s3";
172
453
  retention: number;
173
454
  filter?: ((...args: unknown[]) => unknown) | undefined;
174
455
  }, {
175
456
  retention: number;
176
457
  filter?: ((...args: unknown[]) => unknown) | undefined;
177
458
  enabled?: boolean | undefined;
459
+ storage?: "custom" | "database" | "file" | "s3" | undefined;
178
460
  }>;
179
461
  export type EventPersistence = z.infer<typeof EventPersistenceSchema>;
462
+ /**
463
+ * Event Queue Configuration Schema
464
+ * Configuration for async event processing queue
465
+ *
466
+ * @example
467
+ * {
468
+ * "name": "event_queue",
469
+ * "concurrency": 10,
470
+ * "retryPolicy": {
471
+ * "maxRetries": 3,
472
+ * "backoffStrategy": "exponential"
473
+ * }
474
+ * }
475
+ */
476
+ export declare const EventQueueConfigSchema: z.ZodObject<{
477
+ /**
478
+ * Queue name
479
+ */
480
+ name: z.ZodDefault<z.ZodString>;
481
+ /**
482
+ * Concurrency
483
+ */
484
+ concurrency: z.ZodDefault<z.ZodNumber>;
485
+ /**
486
+ * Retry policy
487
+ */
488
+ retryPolicy: z.ZodOptional<z.ZodObject<{
489
+ maxRetries: z.ZodDefault<z.ZodNumber>;
490
+ backoffStrategy: z.ZodDefault<z.ZodEnum<["fixed", "linear", "exponential"]>>;
491
+ initialDelayMs: z.ZodDefault<z.ZodNumber>;
492
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
493
+ }, "strip", z.ZodTypeAny, {
494
+ maxRetries: number;
495
+ backoffStrategy: "fixed" | "linear" | "exponential";
496
+ initialDelayMs: number;
497
+ maxDelayMs: number;
498
+ }, {
499
+ maxRetries?: number | undefined;
500
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
501
+ initialDelayMs?: number | undefined;
502
+ maxDelayMs?: number | undefined;
503
+ }>>;
504
+ /**
505
+ * Dead letter queue
506
+ */
507
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
508
+ /**
509
+ * Enable priority processing
510
+ */
511
+ priorityEnabled: z.ZodDefault<z.ZodBoolean>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ name: string;
514
+ concurrency: number;
515
+ priorityEnabled: boolean;
516
+ retryPolicy?: {
517
+ maxRetries: number;
518
+ backoffStrategy: "fixed" | "linear" | "exponential";
519
+ initialDelayMs: number;
520
+ maxDelayMs: number;
521
+ } | undefined;
522
+ deadLetterQueue?: string | undefined;
523
+ }, {
524
+ name?: string | undefined;
525
+ concurrency?: number | undefined;
526
+ retryPolicy?: {
527
+ maxRetries?: number | undefined;
528
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
529
+ initialDelayMs?: number | undefined;
530
+ maxDelayMs?: number | undefined;
531
+ } | undefined;
532
+ deadLetterQueue?: string | undefined;
533
+ priorityEnabled?: boolean | undefined;
534
+ }>;
535
+ export type EventQueueConfig = z.infer<typeof EventQueueConfigSchema>;
536
+ /**
537
+ * Event Replay Configuration Schema
538
+ * Configuration for replaying historical events
539
+ *
540
+ * @example
541
+ * {
542
+ * "fromTimestamp": "2024-01-01T00:00:00Z",
543
+ * "toTimestamp": "2024-01-31T23:59:59Z",
544
+ * "eventTypes": ["order.created", "order.updated"],
545
+ * "speed": 10
546
+ * }
547
+ */
548
+ export declare const EventReplayConfigSchema: z.ZodObject<{
549
+ /**
550
+ * Start timestamp
551
+ */
552
+ fromTimestamp: z.ZodString;
553
+ /**
554
+ * End timestamp
555
+ */
556
+ toTimestamp: z.ZodOptional<z.ZodString>;
557
+ /**
558
+ * Event types to replay
559
+ */
560
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
561
+ /**
562
+ * Event filters
563
+ */
564
+ filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
565
+ /**
566
+ * Replay speed multiplier
567
+ */
568
+ speed: z.ZodDefault<z.ZodNumber>;
569
+ /**
570
+ * Target handlers
571
+ */
572
+ targetHandlers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
573
+ }, "strip", z.ZodTypeAny, {
574
+ fromTimestamp: string;
575
+ speed: number;
576
+ filters?: Record<string, any> | undefined;
577
+ eventTypes?: string[] | undefined;
578
+ toTimestamp?: string | undefined;
579
+ targetHandlers?: string[] | undefined;
580
+ }, {
581
+ fromTimestamp: string;
582
+ filters?: Record<string, any> | undefined;
583
+ eventTypes?: string[] | undefined;
584
+ toTimestamp?: string | undefined;
585
+ speed?: number | undefined;
586
+ targetHandlers?: string[] | undefined;
587
+ }>;
588
+ export type EventReplayConfig = z.infer<typeof EventReplayConfigSchema>;
589
+ /**
590
+ * Event Sourcing Configuration Schema
591
+ * Configuration for event sourcing pattern
592
+ *
593
+ * Event sourcing stores all changes to application state as a sequence of events.
594
+ * The current state can be reconstructed by replaying the events.
595
+ *
596
+ * @example
597
+ * {
598
+ * "enabled": true,
599
+ * "snapshotInterval": 100,
600
+ * "retention": 365
601
+ * }
602
+ */
603
+ export declare const EventSourcingConfigSchema: z.ZodObject<{
604
+ /**
605
+ * Enable event sourcing
606
+ */
607
+ enabled: z.ZodDefault<z.ZodBoolean>;
608
+ /**
609
+ * Snapshot interval
610
+ */
611
+ snapshotInterval: z.ZodDefault<z.ZodNumber>;
612
+ /**
613
+ * Snapshot retention
614
+ */
615
+ snapshotRetention: z.ZodDefault<z.ZodNumber>;
616
+ /**
617
+ * Event retention
618
+ */
619
+ retention: z.ZodDefault<z.ZodNumber>;
620
+ /**
621
+ * Aggregate types
622
+ */
623
+ aggregateTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
624
+ /**
625
+ * Storage configuration
626
+ */
627
+ storage: z.ZodOptional<z.ZodObject<{
628
+ type: z.ZodDefault<z.ZodEnum<["database", "file", "s3", "eventstore"]>>;
629
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
630
+ }, "strip", z.ZodTypeAny, {
631
+ type: "database" | "file" | "s3" | "eventstore";
632
+ options?: Record<string, any> | undefined;
633
+ }, {
634
+ options?: Record<string, any> | undefined;
635
+ type?: "database" | "file" | "s3" | "eventstore" | undefined;
636
+ }>>;
637
+ }, "strip", z.ZodTypeAny, {
638
+ enabled: boolean;
639
+ retention: number;
640
+ snapshotInterval: number;
641
+ snapshotRetention: number;
642
+ storage?: {
643
+ type: "database" | "file" | "s3" | "eventstore";
644
+ options?: Record<string, any> | undefined;
645
+ } | undefined;
646
+ aggregateTypes?: string[] | undefined;
647
+ }, {
648
+ enabled?: boolean | undefined;
649
+ storage?: {
650
+ options?: Record<string, any> | undefined;
651
+ type?: "database" | "file" | "s3" | "eventstore" | undefined;
652
+ } | undefined;
653
+ retention?: number | undefined;
654
+ snapshotInterval?: number | undefined;
655
+ snapshotRetention?: number | undefined;
656
+ aggregateTypes?: string[] | undefined;
657
+ }>;
658
+ export type EventSourcingConfig = z.infer<typeof EventSourcingConfigSchema>;
659
+ /**
660
+ * Dead Letter Queue Entry Schema
661
+ * Represents a failed event in the dead letter queue
662
+ */
663
+ export declare const DeadLetterQueueEntrySchema: z.ZodObject<{
664
+ /**
665
+ * Entry identifier
666
+ */
667
+ id: z.ZodString;
668
+ /**
669
+ * Original event
670
+ */
671
+ event: z.ZodObject<{
672
+ /**
673
+ * Event identifier (for tracking and deduplication)
674
+ */
675
+ id: z.ZodOptional<z.ZodString>;
676
+ /**
677
+ * Event name
678
+ */
679
+ name: z.ZodString;
680
+ /**
681
+ * Event payload
682
+ */
683
+ payload: z.ZodAny;
684
+ /**
685
+ * Event metadata
686
+ */
687
+ metadata: z.ZodObject<{
688
+ source: z.ZodString;
689
+ timestamp: z.ZodString;
690
+ userId: z.ZodOptional<z.ZodString>;
691
+ tenantId: z.ZodOptional<z.ZodString>;
692
+ correlationId: z.ZodOptional<z.ZodString>;
693
+ causationId: z.ZodOptional<z.ZodString>;
694
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
695
+ }, "strip", z.ZodTypeAny, {
696
+ source: string;
697
+ priority: "background" | "normal" | "critical" | "high" | "low";
698
+ timestamp: string;
699
+ userId?: string | undefined;
700
+ tenantId?: string | undefined;
701
+ correlationId?: string | undefined;
702
+ causationId?: string | undefined;
703
+ }, {
704
+ source: string;
705
+ timestamp: string;
706
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
707
+ userId?: string | undefined;
708
+ tenantId?: string | undefined;
709
+ correlationId?: string | undefined;
710
+ causationId?: string | undefined;
711
+ }>;
712
+ }, "strip", z.ZodTypeAny, {
713
+ name: string;
714
+ metadata: {
715
+ source: string;
716
+ priority: "background" | "normal" | "critical" | "high" | "low";
717
+ timestamp: string;
718
+ userId?: string | undefined;
719
+ tenantId?: string | undefined;
720
+ correlationId?: string | undefined;
721
+ causationId?: string | undefined;
722
+ };
723
+ id?: string | undefined;
724
+ payload?: any;
725
+ }, {
726
+ name: string;
727
+ metadata: {
728
+ source: string;
729
+ timestamp: string;
730
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
731
+ userId?: string | undefined;
732
+ tenantId?: string | undefined;
733
+ correlationId?: string | undefined;
734
+ causationId?: string | undefined;
735
+ };
736
+ id?: string | undefined;
737
+ payload?: any;
738
+ }>;
739
+ /**
740
+ * Failure reason
741
+ */
742
+ error: z.ZodObject<{
743
+ message: z.ZodString;
744
+ stack: z.ZodOptional<z.ZodString>;
745
+ code: z.ZodOptional<z.ZodString>;
746
+ }, "strip", z.ZodTypeAny, {
747
+ message: string;
748
+ code?: string | undefined;
749
+ stack?: string | undefined;
750
+ }, {
751
+ message: string;
752
+ code?: string | undefined;
753
+ stack?: string | undefined;
754
+ }>;
755
+ /**
756
+ * Retry count
757
+ */
758
+ retries: z.ZodNumber;
759
+ /**
760
+ * Timestamps
761
+ */
762
+ firstFailedAt: z.ZodString;
763
+ lastFailedAt: z.ZodString;
764
+ /**
765
+ * Handler that failed
766
+ */
767
+ failedHandler: z.ZodOptional<z.ZodString>;
768
+ }, "strip", z.ZodTypeAny, {
769
+ error: {
770
+ message: string;
771
+ code?: string | undefined;
772
+ stack?: string | undefined;
773
+ };
774
+ id: string;
775
+ event: {
776
+ name: string;
777
+ metadata: {
778
+ source: string;
779
+ priority: "background" | "normal" | "critical" | "high" | "low";
780
+ timestamp: string;
781
+ userId?: string | undefined;
782
+ tenantId?: string | undefined;
783
+ correlationId?: string | undefined;
784
+ causationId?: string | undefined;
785
+ };
786
+ id?: string | undefined;
787
+ payload?: any;
788
+ };
789
+ retries: number;
790
+ firstFailedAt: string;
791
+ lastFailedAt: string;
792
+ failedHandler?: string | undefined;
793
+ }, {
794
+ error: {
795
+ message: string;
796
+ code?: string | undefined;
797
+ stack?: string | undefined;
798
+ };
799
+ id: string;
800
+ event: {
801
+ name: string;
802
+ metadata: {
803
+ source: string;
804
+ timestamp: string;
805
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
806
+ userId?: string | undefined;
807
+ tenantId?: string | undefined;
808
+ correlationId?: string | undefined;
809
+ causationId?: string | undefined;
810
+ };
811
+ id?: string | undefined;
812
+ payload?: any;
813
+ };
814
+ retries: number;
815
+ firstFailedAt: string;
816
+ lastFailedAt: string;
817
+ failedHandler?: string | undefined;
818
+ }>;
819
+ export type DeadLetterQueueEntry = z.infer<typeof DeadLetterQueueEntrySchema>;
820
+ /**
821
+ * Event Log Entry Schema
822
+ * Represents a logged event
823
+ */
824
+ export declare const EventLogEntrySchema: z.ZodObject<{
825
+ /**
826
+ * Log entry ID
827
+ */
828
+ id: z.ZodString;
829
+ /**
830
+ * Event
831
+ */
832
+ event: z.ZodObject<{
833
+ /**
834
+ * Event identifier (for tracking and deduplication)
835
+ */
836
+ id: z.ZodOptional<z.ZodString>;
837
+ /**
838
+ * Event name
839
+ */
840
+ name: z.ZodString;
841
+ /**
842
+ * Event payload
843
+ */
844
+ payload: z.ZodAny;
845
+ /**
846
+ * Event metadata
847
+ */
848
+ metadata: z.ZodObject<{
849
+ source: z.ZodString;
850
+ timestamp: z.ZodString;
851
+ userId: z.ZodOptional<z.ZodString>;
852
+ tenantId: z.ZodOptional<z.ZodString>;
853
+ correlationId: z.ZodOptional<z.ZodString>;
854
+ causationId: z.ZodOptional<z.ZodString>;
855
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
856
+ }, "strip", z.ZodTypeAny, {
857
+ source: string;
858
+ priority: "background" | "normal" | "critical" | "high" | "low";
859
+ timestamp: string;
860
+ userId?: string | undefined;
861
+ tenantId?: string | undefined;
862
+ correlationId?: string | undefined;
863
+ causationId?: string | undefined;
864
+ }, {
865
+ source: string;
866
+ timestamp: string;
867
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
868
+ userId?: string | undefined;
869
+ tenantId?: string | undefined;
870
+ correlationId?: string | undefined;
871
+ causationId?: string | undefined;
872
+ }>;
873
+ }, "strip", z.ZodTypeAny, {
874
+ name: string;
875
+ metadata: {
876
+ source: string;
877
+ priority: "background" | "normal" | "critical" | "high" | "low";
878
+ timestamp: string;
879
+ userId?: string | undefined;
880
+ tenantId?: string | undefined;
881
+ correlationId?: string | undefined;
882
+ causationId?: string | undefined;
883
+ };
884
+ id?: string | undefined;
885
+ payload?: any;
886
+ }, {
887
+ name: string;
888
+ metadata: {
889
+ source: string;
890
+ timestamp: string;
891
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
892
+ userId?: string | undefined;
893
+ tenantId?: string | undefined;
894
+ correlationId?: string | undefined;
895
+ causationId?: string | undefined;
896
+ };
897
+ id?: string | undefined;
898
+ payload?: any;
899
+ }>;
900
+ /**
901
+ * Status
902
+ */
903
+ status: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
904
+ /**
905
+ * Handlers executed
906
+ */
907
+ handlersExecuted: z.ZodOptional<z.ZodArray<z.ZodObject<{
908
+ handlerId: z.ZodString;
909
+ status: z.ZodEnum<["success", "failed", "timeout"]>;
910
+ durationMs: z.ZodOptional<z.ZodNumber>;
911
+ error: z.ZodOptional<z.ZodString>;
912
+ }, "strip", z.ZodTypeAny, {
913
+ status: "timeout" | "success" | "failed";
914
+ handlerId: string;
915
+ error?: string | undefined;
916
+ durationMs?: number | undefined;
917
+ }, {
918
+ status: "timeout" | "success" | "failed";
919
+ handlerId: string;
920
+ error?: string | undefined;
921
+ durationMs?: number | undefined;
922
+ }>, "many">>;
923
+ /**
924
+ * Timestamps
925
+ */
926
+ receivedAt: z.ZodString;
927
+ processedAt: z.ZodOptional<z.ZodString>;
928
+ /**
929
+ * Total duration
930
+ */
931
+ totalDurationMs: z.ZodOptional<z.ZodNumber>;
932
+ }, "strip", z.ZodTypeAny, {
933
+ status: "pending" | "processing" | "completed" | "failed";
934
+ id: string;
935
+ event: {
936
+ name: string;
937
+ metadata: {
938
+ source: string;
939
+ priority: "background" | "normal" | "critical" | "high" | "low";
940
+ timestamp: string;
941
+ userId?: string | undefined;
942
+ tenantId?: string | undefined;
943
+ correlationId?: string | undefined;
944
+ causationId?: string | undefined;
945
+ };
946
+ id?: string | undefined;
947
+ payload?: any;
948
+ };
949
+ receivedAt: string;
950
+ handlersExecuted?: {
951
+ status: "timeout" | "success" | "failed";
952
+ handlerId: string;
953
+ error?: string | undefined;
954
+ durationMs?: number | undefined;
955
+ }[] | undefined;
956
+ processedAt?: string | undefined;
957
+ totalDurationMs?: number | undefined;
958
+ }, {
959
+ status: "pending" | "processing" | "completed" | "failed";
960
+ id: string;
961
+ event: {
962
+ name: string;
963
+ metadata: {
964
+ source: string;
965
+ timestamp: string;
966
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
967
+ userId?: string | undefined;
968
+ tenantId?: string | undefined;
969
+ correlationId?: string | undefined;
970
+ causationId?: string | undefined;
971
+ };
972
+ id?: string | undefined;
973
+ payload?: any;
974
+ };
975
+ receivedAt: string;
976
+ handlersExecuted?: {
977
+ status: "timeout" | "success" | "failed";
978
+ handlerId: string;
979
+ error?: string | undefined;
980
+ durationMs?: number | undefined;
981
+ }[] | undefined;
982
+ processedAt?: string | undefined;
983
+ totalDurationMs?: number | undefined;
984
+ }>;
985
+ export type EventLogEntry = z.infer<typeof EventLogEntrySchema>;
986
+ /**
987
+ * Event Webhook Configuration Schema
988
+ * Configuration for sending events to webhooks
989
+ *
990
+ * @example
991
+ * {
992
+ * "eventPattern": "order.*",
993
+ * "url": "https://api.example.com/webhooks/orders",
994
+ * "method": "POST",
995
+ * "headers": { "Authorization": "Bearer token" }
996
+ * }
997
+ */
998
+ export declare const EventWebhookConfigSchema: z.ZodObject<{
999
+ /**
1000
+ * Webhook identifier
1001
+ */
1002
+ id: z.ZodOptional<z.ZodString>;
1003
+ /**
1004
+ * Event pattern to match
1005
+ */
1006
+ eventPattern: z.ZodString;
1007
+ /**
1008
+ * Target URL
1009
+ */
1010
+ url: z.ZodString;
1011
+ /**
1012
+ * HTTP method
1013
+ */
1014
+ method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "PATCH"]>>;
1015
+ /**
1016
+ * Headers
1017
+ */
1018
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1019
+ /**
1020
+ * Authentication
1021
+ */
1022
+ authentication: z.ZodOptional<z.ZodObject<{
1023
+ type: z.ZodEnum<["none", "bearer", "basic", "api-key"]>;
1024
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1025
+ }, "strip", z.ZodTypeAny, {
1026
+ type: "none" | "api-key" | "basic" | "bearer";
1027
+ credentials?: Record<string, string> | undefined;
1028
+ }, {
1029
+ type: "none" | "api-key" | "basic" | "bearer";
1030
+ credentials?: Record<string, string> | undefined;
1031
+ }>>;
1032
+ /**
1033
+ * Retry policy
1034
+ */
1035
+ retryPolicy: z.ZodOptional<z.ZodObject<{
1036
+ maxRetries: z.ZodDefault<z.ZodNumber>;
1037
+ backoffStrategy: z.ZodDefault<z.ZodEnum<["fixed", "linear", "exponential"]>>;
1038
+ initialDelayMs: z.ZodDefault<z.ZodNumber>;
1039
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
1040
+ }, "strip", z.ZodTypeAny, {
1041
+ maxRetries: number;
1042
+ backoffStrategy: "fixed" | "linear" | "exponential";
1043
+ initialDelayMs: number;
1044
+ maxDelayMs: number;
1045
+ }, {
1046
+ maxRetries?: number | undefined;
1047
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1048
+ initialDelayMs?: number | undefined;
1049
+ maxDelayMs?: number | undefined;
1050
+ }>>;
1051
+ /**
1052
+ * Timeout
1053
+ */
1054
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
1055
+ /**
1056
+ * Event transformation
1057
+ */
1058
+ transform: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1059
+ /**
1060
+ * Event identifier (for tracking and deduplication)
1061
+ */
1062
+ id: z.ZodOptional<z.ZodString>;
1063
+ /**
1064
+ * Event name
1065
+ */
1066
+ name: z.ZodString;
1067
+ /**
1068
+ * Event payload
1069
+ */
1070
+ payload: z.ZodAny;
1071
+ /**
1072
+ * Event metadata
1073
+ */
1074
+ metadata: z.ZodObject<{
1075
+ source: z.ZodString;
1076
+ timestamp: z.ZodString;
1077
+ userId: z.ZodOptional<z.ZodString>;
1078
+ tenantId: z.ZodOptional<z.ZodString>;
1079
+ correlationId: z.ZodOptional<z.ZodString>;
1080
+ causationId: z.ZodOptional<z.ZodString>;
1081
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
1082
+ }, "strip", z.ZodTypeAny, {
1083
+ source: string;
1084
+ priority: "background" | "normal" | "critical" | "high" | "low";
1085
+ timestamp: string;
1086
+ userId?: string | undefined;
1087
+ tenantId?: string | undefined;
1088
+ correlationId?: string | undefined;
1089
+ causationId?: string | undefined;
1090
+ }, {
1091
+ source: string;
1092
+ timestamp: string;
1093
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1094
+ userId?: string | undefined;
1095
+ tenantId?: string | undefined;
1096
+ correlationId?: string | undefined;
1097
+ causationId?: string | undefined;
1098
+ }>;
1099
+ }, "strip", z.ZodTypeAny, {
1100
+ name: string;
1101
+ metadata: {
1102
+ source: string;
1103
+ priority: "background" | "normal" | "critical" | "high" | "low";
1104
+ timestamp: string;
1105
+ userId?: string | undefined;
1106
+ tenantId?: string | undefined;
1107
+ correlationId?: string | undefined;
1108
+ causationId?: string | undefined;
1109
+ };
1110
+ id?: string | undefined;
1111
+ payload?: any;
1112
+ }, {
1113
+ name: string;
1114
+ metadata: {
1115
+ source: string;
1116
+ timestamp: string;
1117
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1118
+ userId?: string | undefined;
1119
+ tenantId?: string | undefined;
1120
+ correlationId?: string | undefined;
1121
+ causationId?: string | undefined;
1122
+ };
1123
+ id?: string | undefined;
1124
+ payload?: any;
1125
+ }>], z.ZodUnknown>, z.ZodAny>>;
1126
+ /**
1127
+ * Enabled
1128
+ */
1129
+ enabled: z.ZodDefault<z.ZodBoolean>;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ enabled: boolean;
1132
+ url: string;
1133
+ method: "GET" | "POST" | "PUT" | "PATCH";
1134
+ timeoutMs: number;
1135
+ eventPattern: string;
1136
+ transform?: ((args_0: {
1137
+ name: string;
1138
+ metadata: {
1139
+ source: string;
1140
+ timestamp: string;
1141
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1142
+ userId?: string | undefined;
1143
+ tenantId?: string | undefined;
1144
+ correlationId?: string | undefined;
1145
+ causationId?: string | undefined;
1146
+ };
1147
+ id?: string | undefined;
1148
+ payload?: any;
1149
+ }, ...args: unknown[]) => any) | undefined;
1150
+ headers?: Record<string, string> | undefined;
1151
+ id?: string | undefined;
1152
+ authentication?: {
1153
+ type: "none" | "api-key" | "basic" | "bearer";
1154
+ credentials?: Record<string, string> | undefined;
1155
+ } | undefined;
1156
+ retryPolicy?: {
1157
+ maxRetries: number;
1158
+ backoffStrategy: "fixed" | "linear" | "exponential";
1159
+ initialDelayMs: number;
1160
+ maxDelayMs: number;
1161
+ } | undefined;
1162
+ }, {
1163
+ url: string;
1164
+ eventPattern: string;
1165
+ transform?: ((args_0: {
1166
+ name: string;
1167
+ metadata: {
1168
+ source: string;
1169
+ priority: "background" | "normal" | "critical" | "high" | "low";
1170
+ timestamp: string;
1171
+ userId?: string | undefined;
1172
+ tenantId?: string | undefined;
1173
+ correlationId?: string | undefined;
1174
+ causationId?: string | undefined;
1175
+ };
1176
+ id?: string | undefined;
1177
+ payload?: any;
1178
+ }, ...args: unknown[]) => any) | undefined;
1179
+ enabled?: boolean | undefined;
1180
+ method?: "GET" | "POST" | "PUT" | "PATCH" | undefined;
1181
+ headers?: Record<string, string> | undefined;
1182
+ id?: string | undefined;
1183
+ authentication?: {
1184
+ type: "none" | "api-key" | "basic" | "bearer";
1185
+ credentials?: Record<string, string> | undefined;
1186
+ } | undefined;
1187
+ timeoutMs?: number | undefined;
1188
+ retryPolicy?: {
1189
+ maxRetries?: number | undefined;
1190
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1191
+ initialDelayMs?: number | undefined;
1192
+ maxDelayMs?: number | undefined;
1193
+ } | undefined;
1194
+ }>;
1195
+ export type EventWebhookConfig = z.infer<typeof EventWebhookConfigSchema>;
1196
+ /**
1197
+ * Event Message Queue Configuration Schema
1198
+ * Configuration for publishing events to message queues
1199
+ *
1200
+ * @example
1201
+ * {
1202
+ * "provider": "kafka",
1203
+ * "topic": "events",
1204
+ * "eventPattern": "*",
1205
+ * "partitionKey": "metadata.tenantId"
1206
+ * }
1207
+ */
1208
+ export declare const EventMessageQueueConfigSchema: z.ZodObject<{
1209
+ /**
1210
+ * Provider
1211
+ */
1212
+ provider: z.ZodEnum<["kafka", "rabbitmq", "aws-sqs", "redis-pubsub", "google-pubsub", "azure-service-bus"]>;
1213
+ /**
1214
+ * Topic/Queue name
1215
+ */
1216
+ topic: z.ZodString;
1217
+ /**
1218
+ * Event pattern
1219
+ */
1220
+ eventPattern: z.ZodDefault<z.ZodString>;
1221
+ /**
1222
+ * Partition key
1223
+ */
1224
+ partitionKey: z.ZodOptional<z.ZodString>;
1225
+ /**
1226
+ * Message format
1227
+ */
1228
+ format: z.ZodDefault<z.ZodEnum<["json", "avro", "protobuf"]>>;
1229
+ /**
1230
+ * Include metadata
1231
+ */
1232
+ includeMetadata: z.ZodDefault<z.ZodBoolean>;
1233
+ /**
1234
+ * Compression
1235
+ */
1236
+ compression: z.ZodDefault<z.ZodEnum<["none", "gzip", "snappy", "lz4"]>>;
1237
+ /**
1238
+ * Batch size
1239
+ */
1240
+ batchSize: z.ZodDefault<z.ZodNumber>;
1241
+ /**
1242
+ * Flush interval
1243
+ */
1244
+ flushIntervalMs: z.ZodDefault<z.ZodNumber>;
1245
+ }, "strip", z.ZodTypeAny, {
1246
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
1247
+ format: "json" | "avro" | "protobuf";
1248
+ batchSize: number;
1249
+ compression: "none" | "gzip" | "snappy" | "lz4";
1250
+ eventPattern: string;
1251
+ topic: string;
1252
+ includeMetadata: boolean;
1253
+ flushIntervalMs: number;
1254
+ partitionKey?: string | undefined;
1255
+ }, {
1256
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
1257
+ topic: string;
1258
+ format?: "json" | "avro" | "protobuf" | undefined;
1259
+ batchSize?: number | undefined;
1260
+ compression?: "none" | "gzip" | "snappy" | "lz4" | undefined;
1261
+ eventPattern?: string | undefined;
1262
+ partitionKey?: string | undefined;
1263
+ includeMetadata?: boolean | undefined;
1264
+ flushIntervalMs?: number | undefined;
1265
+ }>;
1266
+ export type EventMessageQueueConfig = z.infer<typeof EventMessageQueueConfigSchema>;
1267
+ /**
1268
+ * Real-time Notification Configuration Schema
1269
+ * Configuration for real-time event notifications via WebSocket/SSE
1270
+ *
1271
+ * @example
1272
+ * {
1273
+ * "enabled": true,
1274
+ * "protocol": "websocket",
1275
+ * "eventPattern": "notification.*",
1276
+ * "userFilter": true
1277
+ * }
1278
+ */
1279
+ export declare const RealTimeNotificationConfigSchema: z.ZodObject<{
1280
+ /**
1281
+ * Enable real-time notifications
1282
+ */
1283
+ enabled: z.ZodDefault<z.ZodBoolean>;
1284
+ /**
1285
+ * Protocol
1286
+ */
1287
+ protocol: z.ZodDefault<z.ZodEnum<["websocket", "sse", "long-polling"]>>;
1288
+ /**
1289
+ * Event pattern
1290
+ */
1291
+ eventPattern: z.ZodDefault<z.ZodString>;
1292
+ /**
1293
+ * User-specific filtering
1294
+ */
1295
+ userFilter: z.ZodDefault<z.ZodBoolean>;
1296
+ /**
1297
+ * Tenant-specific filtering
1298
+ */
1299
+ tenantFilter: z.ZodDefault<z.ZodBoolean>;
1300
+ /**
1301
+ * Channels
1302
+ */
1303
+ channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1304
+ name: z.ZodString;
1305
+ eventPattern: z.ZodString;
1306
+ filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1307
+ /**
1308
+ * Event identifier (for tracking and deduplication)
1309
+ */
1310
+ id: z.ZodOptional<z.ZodString>;
1311
+ /**
1312
+ * Event name
1313
+ */
1314
+ name: z.ZodString;
1315
+ /**
1316
+ * Event payload
1317
+ */
1318
+ payload: z.ZodAny;
1319
+ /**
1320
+ * Event metadata
1321
+ */
1322
+ metadata: z.ZodObject<{
1323
+ source: z.ZodString;
1324
+ timestamp: z.ZodString;
1325
+ userId: z.ZodOptional<z.ZodString>;
1326
+ tenantId: z.ZodOptional<z.ZodString>;
1327
+ correlationId: z.ZodOptional<z.ZodString>;
1328
+ causationId: z.ZodOptional<z.ZodString>;
1329
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
1330
+ }, "strip", z.ZodTypeAny, {
1331
+ source: string;
1332
+ priority: "background" | "normal" | "critical" | "high" | "low";
1333
+ timestamp: string;
1334
+ userId?: string | undefined;
1335
+ tenantId?: string | undefined;
1336
+ correlationId?: string | undefined;
1337
+ causationId?: string | undefined;
1338
+ }, {
1339
+ source: string;
1340
+ timestamp: string;
1341
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1342
+ userId?: string | undefined;
1343
+ tenantId?: string | undefined;
1344
+ correlationId?: string | undefined;
1345
+ causationId?: string | undefined;
1346
+ }>;
1347
+ }, "strip", z.ZodTypeAny, {
1348
+ name: string;
1349
+ metadata: {
1350
+ source: string;
1351
+ priority: "background" | "normal" | "critical" | "high" | "low";
1352
+ timestamp: string;
1353
+ userId?: string | undefined;
1354
+ tenantId?: string | undefined;
1355
+ correlationId?: string | undefined;
1356
+ causationId?: string | undefined;
1357
+ };
1358
+ id?: string | undefined;
1359
+ payload?: any;
1360
+ }, {
1361
+ name: string;
1362
+ metadata: {
1363
+ source: string;
1364
+ timestamp: string;
1365
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1366
+ userId?: string | undefined;
1367
+ tenantId?: string | undefined;
1368
+ correlationId?: string | undefined;
1369
+ causationId?: string | undefined;
1370
+ };
1371
+ id?: string | undefined;
1372
+ payload?: any;
1373
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
1374
+ }, "strip", z.ZodTypeAny, {
1375
+ name: string;
1376
+ eventPattern: string;
1377
+ filter?: ((args_0: {
1378
+ name: string;
1379
+ metadata: {
1380
+ source: string;
1381
+ timestamp: string;
1382
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1383
+ userId?: string | undefined;
1384
+ tenantId?: string | undefined;
1385
+ correlationId?: string | undefined;
1386
+ causationId?: string | undefined;
1387
+ };
1388
+ id?: string | undefined;
1389
+ payload?: any;
1390
+ }, ...args: unknown[]) => boolean) | undefined;
1391
+ }, {
1392
+ name: string;
1393
+ eventPattern: string;
1394
+ filter?: ((args_0: {
1395
+ name: string;
1396
+ metadata: {
1397
+ source: string;
1398
+ priority: "background" | "normal" | "critical" | "high" | "low";
1399
+ timestamp: string;
1400
+ userId?: string | undefined;
1401
+ tenantId?: string | undefined;
1402
+ correlationId?: string | undefined;
1403
+ causationId?: string | undefined;
1404
+ };
1405
+ id?: string | undefined;
1406
+ payload?: any;
1407
+ }, ...args: unknown[]) => boolean) | undefined;
1408
+ }>, "many">>;
1409
+ /**
1410
+ * Rate limiting
1411
+ */
1412
+ rateLimit: z.ZodOptional<z.ZodObject<{
1413
+ maxEventsPerSecond: z.ZodNumber;
1414
+ windowMs: z.ZodDefault<z.ZodNumber>;
1415
+ }, "strip", z.ZodTypeAny, {
1416
+ windowMs: number;
1417
+ maxEventsPerSecond: number;
1418
+ }, {
1419
+ maxEventsPerSecond: number;
1420
+ windowMs?: number | undefined;
1421
+ }>>;
1422
+ }, "strip", z.ZodTypeAny, {
1423
+ enabled: boolean;
1424
+ eventPattern: string;
1425
+ protocol: "websocket" | "sse" | "long-polling";
1426
+ userFilter: boolean;
1427
+ tenantFilter: boolean;
1428
+ rateLimit?: {
1429
+ windowMs: number;
1430
+ maxEventsPerSecond: number;
1431
+ } | undefined;
1432
+ channels?: {
1433
+ name: string;
1434
+ eventPattern: string;
1435
+ filter?: ((args_0: {
1436
+ name: string;
1437
+ metadata: {
1438
+ source: string;
1439
+ timestamp: string;
1440
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1441
+ userId?: string | undefined;
1442
+ tenantId?: string | undefined;
1443
+ correlationId?: string | undefined;
1444
+ causationId?: string | undefined;
1445
+ };
1446
+ id?: string | undefined;
1447
+ payload?: any;
1448
+ }, ...args: unknown[]) => boolean) | undefined;
1449
+ }[] | undefined;
1450
+ }, {
1451
+ enabled?: boolean | undefined;
1452
+ rateLimit?: {
1453
+ maxEventsPerSecond: number;
1454
+ windowMs?: number | undefined;
1455
+ } | undefined;
1456
+ eventPattern?: string | undefined;
1457
+ protocol?: "websocket" | "sse" | "long-polling" | undefined;
1458
+ userFilter?: boolean | undefined;
1459
+ tenantFilter?: boolean | undefined;
1460
+ channels?: {
1461
+ name: string;
1462
+ eventPattern: string;
1463
+ filter?: ((args_0: {
1464
+ name: string;
1465
+ metadata: {
1466
+ source: string;
1467
+ priority: "background" | "normal" | "critical" | "high" | "low";
1468
+ timestamp: string;
1469
+ userId?: string | undefined;
1470
+ tenantId?: string | undefined;
1471
+ correlationId?: string | undefined;
1472
+ causationId?: string | undefined;
1473
+ };
1474
+ id?: string | undefined;
1475
+ payload?: any;
1476
+ }, ...args: unknown[]) => boolean) | undefined;
1477
+ }[] | undefined;
1478
+ }>;
1479
+ export type RealTimeNotificationConfig = z.infer<typeof RealTimeNotificationConfigSchema>;
1480
+ /**
1481
+ * Event Bus Configuration Schema
1482
+ * Complete configuration for the event bus system
1483
+ *
1484
+ * @example
1485
+ * {
1486
+ * "persistence": { "enabled": true, "retention": 365 },
1487
+ * "queue": { "concurrency": 20 },
1488
+ * "eventSourcing": { "enabled": true },
1489
+ * "webhooks": [],
1490
+ * "messageQueue": { "provider": "kafka", "topic": "events" },
1491
+ * "realtime": { "enabled": true, "protocol": "websocket" }
1492
+ * }
1493
+ */
1494
+ export declare const EventBusConfigSchema: z.ZodObject<{
1495
+ /**
1496
+ * Event persistence
1497
+ */
1498
+ persistence: z.ZodOptional<z.ZodObject<{
1499
+ enabled: z.ZodDefault<z.ZodBoolean>;
1500
+ retention: z.ZodNumber;
1501
+ filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
1502
+ storage: z.ZodDefault<z.ZodEnum<["database", "file", "s3", "custom"]>>;
1503
+ }, "strip", z.ZodTypeAny, {
1504
+ enabled: boolean;
1505
+ storage: "custom" | "database" | "file" | "s3";
1506
+ retention: number;
1507
+ filter?: ((...args: unknown[]) => unknown) | undefined;
1508
+ }, {
1509
+ retention: number;
1510
+ filter?: ((...args: unknown[]) => unknown) | undefined;
1511
+ enabled?: boolean | undefined;
1512
+ storage?: "custom" | "database" | "file" | "s3" | undefined;
1513
+ }>>;
1514
+ /**
1515
+ * Event queue
1516
+ */
1517
+ queue: z.ZodOptional<z.ZodObject<{
1518
+ /**
1519
+ * Queue name
1520
+ */
1521
+ name: z.ZodDefault<z.ZodString>;
1522
+ /**
1523
+ * Concurrency
1524
+ */
1525
+ concurrency: z.ZodDefault<z.ZodNumber>;
1526
+ /**
1527
+ * Retry policy
1528
+ */
1529
+ retryPolicy: z.ZodOptional<z.ZodObject<{
1530
+ maxRetries: z.ZodDefault<z.ZodNumber>;
1531
+ backoffStrategy: z.ZodDefault<z.ZodEnum<["fixed", "linear", "exponential"]>>;
1532
+ initialDelayMs: z.ZodDefault<z.ZodNumber>;
1533
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
1534
+ }, "strip", z.ZodTypeAny, {
1535
+ maxRetries: number;
1536
+ backoffStrategy: "fixed" | "linear" | "exponential";
1537
+ initialDelayMs: number;
1538
+ maxDelayMs: number;
1539
+ }, {
1540
+ maxRetries?: number | undefined;
1541
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1542
+ initialDelayMs?: number | undefined;
1543
+ maxDelayMs?: number | undefined;
1544
+ }>>;
1545
+ /**
1546
+ * Dead letter queue
1547
+ */
1548
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
1549
+ /**
1550
+ * Enable priority processing
1551
+ */
1552
+ priorityEnabled: z.ZodDefault<z.ZodBoolean>;
1553
+ }, "strip", z.ZodTypeAny, {
1554
+ name: string;
1555
+ concurrency: number;
1556
+ priorityEnabled: boolean;
1557
+ retryPolicy?: {
1558
+ maxRetries: number;
1559
+ backoffStrategy: "fixed" | "linear" | "exponential";
1560
+ initialDelayMs: number;
1561
+ maxDelayMs: number;
1562
+ } | undefined;
1563
+ deadLetterQueue?: string | undefined;
1564
+ }, {
1565
+ name?: string | undefined;
1566
+ concurrency?: number | undefined;
1567
+ retryPolicy?: {
1568
+ maxRetries?: number | undefined;
1569
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1570
+ initialDelayMs?: number | undefined;
1571
+ maxDelayMs?: number | undefined;
1572
+ } | undefined;
1573
+ deadLetterQueue?: string | undefined;
1574
+ priorityEnabled?: boolean | undefined;
1575
+ }>>;
1576
+ /**
1577
+ * Event sourcing
1578
+ */
1579
+ eventSourcing: z.ZodOptional<z.ZodObject<{
1580
+ /**
1581
+ * Enable event sourcing
1582
+ */
1583
+ enabled: z.ZodDefault<z.ZodBoolean>;
1584
+ /**
1585
+ * Snapshot interval
1586
+ */
1587
+ snapshotInterval: z.ZodDefault<z.ZodNumber>;
1588
+ /**
1589
+ * Snapshot retention
1590
+ */
1591
+ snapshotRetention: z.ZodDefault<z.ZodNumber>;
1592
+ /**
1593
+ * Event retention
1594
+ */
1595
+ retention: z.ZodDefault<z.ZodNumber>;
1596
+ /**
1597
+ * Aggregate types
1598
+ */
1599
+ aggregateTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1600
+ /**
1601
+ * Storage configuration
1602
+ */
1603
+ storage: z.ZodOptional<z.ZodObject<{
1604
+ type: z.ZodDefault<z.ZodEnum<["database", "file", "s3", "eventstore"]>>;
1605
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1606
+ }, "strip", z.ZodTypeAny, {
1607
+ type: "database" | "file" | "s3" | "eventstore";
1608
+ options?: Record<string, any> | undefined;
1609
+ }, {
1610
+ options?: Record<string, any> | undefined;
1611
+ type?: "database" | "file" | "s3" | "eventstore" | undefined;
1612
+ }>>;
1613
+ }, "strip", z.ZodTypeAny, {
1614
+ enabled: boolean;
1615
+ retention: number;
1616
+ snapshotInterval: number;
1617
+ snapshotRetention: number;
1618
+ storage?: {
1619
+ type: "database" | "file" | "s3" | "eventstore";
1620
+ options?: Record<string, any> | undefined;
1621
+ } | undefined;
1622
+ aggregateTypes?: string[] | undefined;
1623
+ }, {
1624
+ enabled?: boolean | undefined;
1625
+ storage?: {
1626
+ options?: Record<string, any> | undefined;
1627
+ type?: "database" | "file" | "s3" | "eventstore" | undefined;
1628
+ } | undefined;
1629
+ retention?: number | undefined;
1630
+ snapshotInterval?: number | undefined;
1631
+ snapshotRetention?: number | undefined;
1632
+ aggregateTypes?: string[] | undefined;
1633
+ }>>;
1634
+ /**
1635
+ * Event replay
1636
+ */
1637
+ replay: z.ZodOptional<z.ZodObject<{
1638
+ enabled: z.ZodDefault<z.ZodBoolean>;
1639
+ }, "strip", z.ZodTypeAny, {
1640
+ enabled: boolean;
1641
+ }, {
1642
+ enabled?: boolean | undefined;
1643
+ }>>;
1644
+ /**
1645
+ * Webhooks
1646
+ */
1647
+ webhooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1648
+ /**
1649
+ * Webhook identifier
1650
+ */
1651
+ id: z.ZodOptional<z.ZodString>;
1652
+ /**
1653
+ * Event pattern to match
1654
+ */
1655
+ eventPattern: z.ZodString;
1656
+ /**
1657
+ * Target URL
1658
+ */
1659
+ url: z.ZodString;
1660
+ /**
1661
+ * HTTP method
1662
+ */
1663
+ method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "PATCH"]>>;
1664
+ /**
1665
+ * Headers
1666
+ */
1667
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1668
+ /**
1669
+ * Authentication
1670
+ */
1671
+ authentication: z.ZodOptional<z.ZodObject<{
1672
+ type: z.ZodEnum<["none", "bearer", "basic", "api-key"]>;
1673
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1674
+ }, "strip", z.ZodTypeAny, {
1675
+ type: "none" | "api-key" | "basic" | "bearer";
1676
+ credentials?: Record<string, string> | undefined;
1677
+ }, {
1678
+ type: "none" | "api-key" | "basic" | "bearer";
1679
+ credentials?: Record<string, string> | undefined;
1680
+ }>>;
1681
+ /**
1682
+ * Retry policy
1683
+ */
1684
+ retryPolicy: z.ZodOptional<z.ZodObject<{
1685
+ maxRetries: z.ZodDefault<z.ZodNumber>;
1686
+ backoffStrategy: z.ZodDefault<z.ZodEnum<["fixed", "linear", "exponential"]>>;
1687
+ initialDelayMs: z.ZodDefault<z.ZodNumber>;
1688
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
1689
+ }, "strip", z.ZodTypeAny, {
1690
+ maxRetries: number;
1691
+ backoffStrategy: "fixed" | "linear" | "exponential";
1692
+ initialDelayMs: number;
1693
+ maxDelayMs: number;
1694
+ }, {
1695
+ maxRetries?: number | undefined;
1696
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1697
+ initialDelayMs?: number | undefined;
1698
+ maxDelayMs?: number | undefined;
1699
+ }>>;
1700
+ /**
1701
+ * Timeout
1702
+ */
1703
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
1704
+ /**
1705
+ * Event transformation
1706
+ */
1707
+ transform: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1708
+ /**
1709
+ * Event identifier (for tracking and deduplication)
1710
+ */
1711
+ id: z.ZodOptional<z.ZodString>;
1712
+ /**
1713
+ * Event name
1714
+ */
1715
+ name: z.ZodString;
1716
+ /**
1717
+ * Event payload
1718
+ */
1719
+ payload: z.ZodAny;
1720
+ /**
1721
+ * Event metadata
1722
+ */
1723
+ metadata: z.ZodObject<{
1724
+ source: z.ZodString;
1725
+ timestamp: z.ZodString;
1726
+ userId: z.ZodOptional<z.ZodString>;
1727
+ tenantId: z.ZodOptional<z.ZodString>;
1728
+ correlationId: z.ZodOptional<z.ZodString>;
1729
+ causationId: z.ZodOptional<z.ZodString>;
1730
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
1731
+ }, "strip", z.ZodTypeAny, {
1732
+ source: string;
1733
+ priority: "background" | "normal" | "critical" | "high" | "low";
1734
+ timestamp: string;
1735
+ userId?: string | undefined;
1736
+ tenantId?: string | undefined;
1737
+ correlationId?: string | undefined;
1738
+ causationId?: string | undefined;
1739
+ }, {
1740
+ source: string;
1741
+ timestamp: string;
1742
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1743
+ userId?: string | undefined;
1744
+ tenantId?: string | undefined;
1745
+ correlationId?: string | undefined;
1746
+ causationId?: string | undefined;
1747
+ }>;
1748
+ }, "strip", z.ZodTypeAny, {
1749
+ name: string;
1750
+ metadata: {
1751
+ source: string;
1752
+ priority: "background" | "normal" | "critical" | "high" | "low";
1753
+ timestamp: string;
1754
+ userId?: string | undefined;
1755
+ tenantId?: string | undefined;
1756
+ correlationId?: string | undefined;
1757
+ causationId?: string | undefined;
1758
+ };
1759
+ id?: string | undefined;
1760
+ payload?: any;
1761
+ }, {
1762
+ name: string;
1763
+ metadata: {
1764
+ source: string;
1765
+ timestamp: string;
1766
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1767
+ userId?: string | undefined;
1768
+ tenantId?: string | undefined;
1769
+ correlationId?: string | undefined;
1770
+ causationId?: string | undefined;
1771
+ };
1772
+ id?: string | undefined;
1773
+ payload?: any;
1774
+ }>], z.ZodUnknown>, z.ZodAny>>;
1775
+ /**
1776
+ * Enabled
1777
+ */
1778
+ enabled: z.ZodDefault<z.ZodBoolean>;
1779
+ }, "strip", z.ZodTypeAny, {
1780
+ enabled: boolean;
1781
+ url: string;
1782
+ method: "GET" | "POST" | "PUT" | "PATCH";
1783
+ timeoutMs: number;
1784
+ eventPattern: string;
1785
+ transform?: ((args_0: {
1786
+ name: string;
1787
+ metadata: {
1788
+ source: string;
1789
+ timestamp: string;
1790
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1791
+ userId?: string | undefined;
1792
+ tenantId?: string | undefined;
1793
+ correlationId?: string | undefined;
1794
+ causationId?: string | undefined;
1795
+ };
1796
+ id?: string | undefined;
1797
+ payload?: any;
1798
+ }, ...args: unknown[]) => any) | undefined;
1799
+ headers?: Record<string, string> | undefined;
1800
+ id?: string | undefined;
1801
+ authentication?: {
1802
+ type: "none" | "api-key" | "basic" | "bearer";
1803
+ credentials?: Record<string, string> | undefined;
1804
+ } | undefined;
1805
+ retryPolicy?: {
1806
+ maxRetries: number;
1807
+ backoffStrategy: "fixed" | "linear" | "exponential";
1808
+ initialDelayMs: number;
1809
+ maxDelayMs: number;
1810
+ } | undefined;
1811
+ }, {
1812
+ url: string;
1813
+ eventPattern: string;
1814
+ transform?: ((args_0: {
1815
+ name: string;
1816
+ metadata: {
1817
+ source: string;
1818
+ priority: "background" | "normal" | "critical" | "high" | "low";
1819
+ timestamp: string;
1820
+ userId?: string | undefined;
1821
+ tenantId?: string | undefined;
1822
+ correlationId?: string | undefined;
1823
+ causationId?: string | undefined;
1824
+ };
1825
+ id?: string | undefined;
1826
+ payload?: any;
1827
+ }, ...args: unknown[]) => any) | undefined;
1828
+ enabled?: boolean | undefined;
1829
+ method?: "GET" | "POST" | "PUT" | "PATCH" | undefined;
1830
+ headers?: Record<string, string> | undefined;
1831
+ id?: string | undefined;
1832
+ authentication?: {
1833
+ type: "none" | "api-key" | "basic" | "bearer";
1834
+ credentials?: Record<string, string> | undefined;
1835
+ } | undefined;
1836
+ timeoutMs?: number | undefined;
1837
+ retryPolicy?: {
1838
+ maxRetries?: number | undefined;
1839
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
1840
+ initialDelayMs?: number | undefined;
1841
+ maxDelayMs?: number | undefined;
1842
+ } | undefined;
1843
+ }>, "many">>;
1844
+ /**
1845
+ * Message queue integration
1846
+ */
1847
+ messageQueue: z.ZodOptional<z.ZodObject<{
1848
+ /**
1849
+ * Provider
1850
+ */
1851
+ provider: z.ZodEnum<["kafka", "rabbitmq", "aws-sqs", "redis-pubsub", "google-pubsub", "azure-service-bus"]>;
1852
+ /**
1853
+ * Topic/Queue name
1854
+ */
1855
+ topic: z.ZodString;
1856
+ /**
1857
+ * Event pattern
1858
+ */
1859
+ eventPattern: z.ZodDefault<z.ZodString>;
1860
+ /**
1861
+ * Partition key
1862
+ */
1863
+ partitionKey: z.ZodOptional<z.ZodString>;
1864
+ /**
1865
+ * Message format
1866
+ */
1867
+ format: z.ZodDefault<z.ZodEnum<["json", "avro", "protobuf"]>>;
1868
+ /**
1869
+ * Include metadata
1870
+ */
1871
+ includeMetadata: z.ZodDefault<z.ZodBoolean>;
1872
+ /**
1873
+ * Compression
1874
+ */
1875
+ compression: z.ZodDefault<z.ZodEnum<["none", "gzip", "snappy", "lz4"]>>;
1876
+ /**
1877
+ * Batch size
1878
+ */
1879
+ batchSize: z.ZodDefault<z.ZodNumber>;
1880
+ /**
1881
+ * Flush interval
1882
+ */
1883
+ flushIntervalMs: z.ZodDefault<z.ZodNumber>;
1884
+ }, "strip", z.ZodTypeAny, {
1885
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
1886
+ format: "json" | "avro" | "protobuf";
1887
+ batchSize: number;
1888
+ compression: "none" | "gzip" | "snappy" | "lz4";
1889
+ eventPattern: string;
1890
+ topic: string;
1891
+ includeMetadata: boolean;
1892
+ flushIntervalMs: number;
1893
+ partitionKey?: string | undefined;
1894
+ }, {
1895
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
1896
+ topic: string;
1897
+ format?: "json" | "avro" | "protobuf" | undefined;
1898
+ batchSize?: number | undefined;
1899
+ compression?: "none" | "gzip" | "snappy" | "lz4" | undefined;
1900
+ eventPattern?: string | undefined;
1901
+ partitionKey?: string | undefined;
1902
+ includeMetadata?: boolean | undefined;
1903
+ flushIntervalMs?: number | undefined;
1904
+ }>>;
1905
+ /**
1906
+ * Real-time notifications
1907
+ */
1908
+ realtime: z.ZodOptional<z.ZodObject<{
1909
+ /**
1910
+ * Enable real-time notifications
1911
+ */
1912
+ enabled: z.ZodDefault<z.ZodBoolean>;
1913
+ /**
1914
+ * Protocol
1915
+ */
1916
+ protocol: z.ZodDefault<z.ZodEnum<["websocket", "sse", "long-polling"]>>;
1917
+ /**
1918
+ * Event pattern
1919
+ */
1920
+ eventPattern: z.ZodDefault<z.ZodString>;
1921
+ /**
1922
+ * User-specific filtering
1923
+ */
1924
+ userFilter: z.ZodDefault<z.ZodBoolean>;
1925
+ /**
1926
+ * Tenant-specific filtering
1927
+ */
1928
+ tenantFilter: z.ZodDefault<z.ZodBoolean>;
1929
+ /**
1930
+ * Channels
1931
+ */
1932
+ channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1933
+ name: z.ZodString;
1934
+ eventPattern: z.ZodString;
1935
+ filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1936
+ /**
1937
+ * Event identifier (for tracking and deduplication)
1938
+ */
1939
+ id: z.ZodOptional<z.ZodString>;
1940
+ /**
1941
+ * Event name
1942
+ */
1943
+ name: z.ZodString;
1944
+ /**
1945
+ * Event payload
1946
+ */
1947
+ payload: z.ZodAny;
1948
+ /**
1949
+ * Event metadata
1950
+ */
1951
+ metadata: z.ZodObject<{
1952
+ source: z.ZodString;
1953
+ timestamp: z.ZodString;
1954
+ userId: z.ZodOptional<z.ZodString>;
1955
+ tenantId: z.ZodOptional<z.ZodString>;
1956
+ correlationId: z.ZodOptional<z.ZodString>;
1957
+ causationId: z.ZodOptional<z.ZodString>;
1958
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
1959
+ }, "strip", z.ZodTypeAny, {
1960
+ source: string;
1961
+ priority: "background" | "normal" | "critical" | "high" | "low";
1962
+ timestamp: string;
1963
+ userId?: string | undefined;
1964
+ tenantId?: string | undefined;
1965
+ correlationId?: string | undefined;
1966
+ causationId?: string | undefined;
1967
+ }, {
1968
+ source: string;
1969
+ timestamp: string;
1970
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1971
+ userId?: string | undefined;
1972
+ tenantId?: string | undefined;
1973
+ correlationId?: string | undefined;
1974
+ causationId?: string | undefined;
1975
+ }>;
1976
+ }, "strip", z.ZodTypeAny, {
1977
+ name: string;
1978
+ metadata: {
1979
+ source: string;
1980
+ priority: "background" | "normal" | "critical" | "high" | "low";
1981
+ timestamp: string;
1982
+ userId?: string | undefined;
1983
+ tenantId?: string | undefined;
1984
+ correlationId?: string | undefined;
1985
+ causationId?: string | undefined;
1986
+ };
1987
+ id?: string | undefined;
1988
+ payload?: any;
1989
+ }, {
1990
+ name: string;
1991
+ metadata: {
1992
+ source: string;
1993
+ timestamp: string;
1994
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
1995
+ userId?: string | undefined;
1996
+ tenantId?: string | undefined;
1997
+ correlationId?: string | undefined;
1998
+ causationId?: string | undefined;
1999
+ };
2000
+ id?: string | undefined;
2001
+ payload?: any;
2002
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
2003
+ }, "strip", z.ZodTypeAny, {
2004
+ name: string;
2005
+ eventPattern: string;
2006
+ filter?: ((args_0: {
2007
+ name: string;
2008
+ metadata: {
2009
+ source: string;
2010
+ timestamp: string;
2011
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2012
+ userId?: string | undefined;
2013
+ tenantId?: string | undefined;
2014
+ correlationId?: string | undefined;
2015
+ causationId?: string | undefined;
2016
+ };
2017
+ id?: string | undefined;
2018
+ payload?: any;
2019
+ }, ...args: unknown[]) => boolean) | undefined;
2020
+ }, {
2021
+ name: string;
2022
+ eventPattern: string;
2023
+ filter?: ((args_0: {
2024
+ name: string;
2025
+ metadata: {
2026
+ source: string;
2027
+ priority: "background" | "normal" | "critical" | "high" | "low";
2028
+ timestamp: string;
2029
+ userId?: string | undefined;
2030
+ tenantId?: string | undefined;
2031
+ correlationId?: string | undefined;
2032
+ causationId?: string | undefined;
2033
+ };
2034
+ id?: string | undefined;
2035
+ payload?: any;
2036
+ }, ...args: unknown[]) => boolean) | undefined;
2037
+ }>, "many">>;
2038
+ /**
2039
+ * Rate limiting
2040
+ */
2041
+ rateLimit: z.ZodOptional<z.ZodObject<{
2042
+ maxEventsPerSecond: z.ZodNumber;
2043
+ windowMs: z.ZodDefault<z.ZodNumber>;
2044
+ }, "strip", z.ZodTypeAny, {
2045
+ windowMs: number;
2046
+ maxEventsPerSecond: number;
2047
+ }, {
2048
+ maxEventsPerSecond: number;
2049
+ windowMs?: number | undefined;
2050
+ }>>;
2051
+ }, "strip", z.ZodTypeAny, {
2052
+ enabled: boolean;
2053
+ eventPattern: string;
2054
+ protocol: "websocket" | "sse" | "long-polling";
2055
+ userFilter: boolean;
2056
+ tenantFilter: boolean;
2057
+ rateLimit?: {
2058
+ windowMs: number;
2059
+ maxEventsPerSecond: number;
2060
+ } | undefined;
2061
+ channels?: {
2062
+ name: string;
2063
+ eventPattern: string;
2064
+ filter?: ((args_0: {
2065
+ name: string;
2066
+ metadata: {
2067
+ source: string;
2068
+ timestamp: string;
2069
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2070
+ userId?: string | undefined;
2071
+ tenantId?: string | undefined;
2072
+ correlationId?: string | undefined;
2073
+ causationId?: string | undefined;
2074
+ };
2075
+ id?: string | undefined;
2076
+ payload?: any;
2077
+ }, ...args: unknown[]) => boolean) | undefined;
2078
+ }[] | undefined;
2079
+ }, {
2080
+ enabled?: boolean | undefined;
2081
+ rateLimit?: {
2082
+ maxEventsPerSecond: number;
2083
+ windowMs?: number | undefined;
2084
+ } | undefined;
2085
+ eventPattern?: string | undefined;
2086
+ protocol?: "websocket" | "sse" | "long-polling" | undefined;
2087
+ userFilter?: boolean | undefined;
2088
+ tenantFilter?: boolean | undefined;
2089
+ channels?: {
2090
+ name: string;
2091
+ eventPattern: string;
2092
+ filter?: ((args_0: {
2093
+ name: string;
2094
+ metadata: {
2095
+ source: string;
2096
+ priority: "background" | "normal" | "critical" | "high" | "low";
2097
+ timestamp: string;
2098
+ userId?: string | undefined;
2099
+ tenantId?: string | undefined;
2100
+ correlationId?: string | undefined;
2101
+ causationId?: string | undefined;
2102
+ };
2103
+ id?: string | undefined;
2104
+ payload?: any;
2105
+ }, ...args: unknown[]) => boolean) | undefined;
2106
+ }[] | undefined;
2107
+ }>>;
2108
+ /**
2109
+ * Event type definitions
2110
+ */
2111
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2112
+ name: z.ZodString;
2113
+ version: z.ZodDefault<z.ZodString>;
2114
+ schema: z.ZodOptional<z.ZodAny>;
2115
+ description: z.ZodOptional<z.ZodString>;
2116
+ deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2117
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2118
+ }, "strip", z.ZodTypeAny, {
2119
+ name: string;
2120
+ version: string;
2121
+ deprecated: boolean;
2122
+ tags?: string[] | undefined;
2123
+ description?: string | undefined;
2124
+ schema?: any;
2125
+ }, {
2126
+ name: string;
2127
+ tags?: string[] | undefined;
2128
+ description?: string | undefined;
2129
+ schema?: any;
2130
+ version?: string | undefined;
2131
+ deprecated?: boolean | undefined;
2132
+ }>, "many">>;
2133
+ /**
2134
+ * Global handlers
2135
+ */
2136
+ handlers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2137
+ /**
2138
+ * Handler identifier
2139
+ */
2140
+ id: z.ZodOptional<z.ZodString>;
2141
+ /**
2142
+ * Event name pattern
2143
+ */
2144
+ eventName: z.ZodString;
2145
+ /**
2146
+ * Handler function
2147
+ */
2148
+ handler: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2149
+ /**
2150
+ * Event identifier (for tracking and deduplication)
2151
+ */
2152
+ id: z.ZodOptional<z.ZodString>;
2153
+ /**
2154
+ * Event name
2155
+ */
2156
+ name: z.ZodString;
2157
+ /**
2158
+ * Event payload
2159
+ */
2160
+ payload: z.ZodAny;
2161
+ /**
2162
+ * Event metadata
2163
+ */
2164
+ metadata: z.ZodObject<{
2165
+ source: z.ZodString;
2166
+ timestamp: z.ZodString;
2167
+ userId: z.ZodOptional<z.ZodString>;
2168
+ tenantId: z.ZodOptional<z.ZodString>;
2169
+ correlationId: z.ZodOptional<z.ZodString>;
2170
+ causationId: z.ZodOptional<z.ZodString>;
2171
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
2172
+ }, "strip", z.ZodTypeAny, {
2173
+ source: string;
2174
+ priority: "background" | "normal" | "critical" | "high" | "low";
2175
+ timestamp: string;
2176
+ userId?: string | undefined;
2177
+ tenantId?: string | undefined;
2178
+ correlationId?: string | undefined;
2179
+ causationId?: string | undefined;
2180
+ }, {
2181
+ source: string;
2182
+ timestamp: string;
2183
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2184
+ userId?: string | undefined;
2185
+ tenantId?: string | undefined;
2186
+ correlationId?: string | undefined;
2187
+ causationId?: string | undefined;
2188
+ }>;
2189
+ }, "strip", z.ZodTypeAny, {
2190
+ name: string;
2191
+ metadata: {
2192
+ source: string;
2193
+ priority: "background" | "normal" | "critical" | "high" | "low";
2194
+ timestamp: string;
2195
+ userId?: string | undefined;
2196
+ tenantId?: string | undefined;
2197
+ correlationId?: string | undefined;
2198
+ causationId?: string | undefined;
2199
+ };
2200
+ id?: string | undefined;
2201
+ payload?: any;
2202
+ }, {
2203
+ name: string;
2204
+ metadata: {
2205
+ source: string;
2206
+ timestamp: string;
2207
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2208
+ userId?: string | undefined;
2209
+ tenantId?: string | undefined;
2210
+ correlationId?: string | undefined;
2211
+ causationId?: string | undefined;
2212
+ };
2213
+ id?: string | undefined;
2214
+ payload?: any;
2215
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2216
+ /**
2217
+ * Execution priority
2218
+ */
2219
+ priority: z.ZodDefault<z.ZodNumber>;
2220
+ /**
2221
+ * Async execution
2222
+ */
2223
+ async: z.ZodDefault<z.ZodBoolean>;
2224
+ /**
2225
+ * Retry configuration
2226
+ */
2227
+ retry: z.ZodOptional<z.ZodObject<{
2228
+ maxRetries: z.ZodDefault<z.ZodNumber>;
2229
+ backoffMs: z.ZodDefault<z.ZodNumber>;
2230
+ backoffMultiplier: z.ZodDefault<z.ZodNumber>;
2231
+ }, "strip", z.ZodTypeAny, {
2232
+ maxRetries: number;
2233
+ backoffMs: number;
2234
+ backoffMultiplier: number;
2235
+ }, {
2236
+ maxRetries?: number | undefined;
2237
+ backoffMs?: number | undefined;
2238
+ backoffMultiplier?: number | undefined;
2239
+ }>>;
2240
+ /**
2241
+ * Timeout
2242
+ */
2243
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2244
+ /**
2245
+ * Filter function
2246
+ */
2247
+ filter: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2248
+ /**
2249
+ * Event identifier (for tracking and deduplication)
2250
+ */
2251
+ id: z.ZodOptional<z.ZodString>;
2252
+ /**
2253
+ * Event name
2254
+ */
2255
+ name: z.ZodString;
2256
+ /**
2257
+ * Event payload
2258
+ */
2259
+ payload: z.ZodAny;
2260
+ /**
2261
+ * Event metadata
2262
+ */
2263
+ metadata: z.ZodObject<{
2264
+ source: z.ZodString;
2265
+ timestamp: z.ZodString;
2266
+ userId: z.ZodOptional<z.ZodString>;
2267
+ tenantId: z.ZodOptional<z.ZodString>;
2268
+ correlationId: z.ZodOptional<z.ZodString>;
2269
+ causationId: z.ZodOptional<z.ZodString>;
2270
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["critical", "high", "normal", "low", "background"]>>>;
2271
+ }, "strip", z.ZodTypeAny, {
2272
+ source: string;
2273
+ priority: "background" | "normal" | "critical" | "high" | "low";
2274
+ timestamp: string;
2275
+ userId?: string | undefined;
2276
+ tenantId?: string | undefined;
2277
+ correlationId?: string | undefined;
2278
+ causationId?: string | undefined;
2279
+ }, {
2280
+ source: string;
2281
+ timestamp: string;
2282
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2283
+ userId?: string | undefined;
2284
+ tenantId?: string | undefined;
2285
+ correlationId?: string | undefined;
2286
+ causationId?: string | undefined;
2287
+ }>;
2288
+ }, "strip", z.ZodTypeAny, {
2289
+ name: string;
2290
+ metadata: {
2291
+ source: string;
2292
+ priority: "background" | "normal" | "critical" | "high" | "low";
2293
+ timestamp: string;
2294
+ userId?: string | undefined;
2295
+ tenantId?: string | undefined;
2296
+ correlationId?: string | undefined;
2297
+ causationId?: string | undefined;
2298
+ };
2299
+ id?: string | undefined;
2300
+ payload?: any;
2301
+ }, {
2302
+ name: string;
2303
+ metadata: {
2304
+ source: string;
2305
+ timestamp: string;
2306
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2307
+ userId?: string | undefined;
2308
+ tenantId?: string | undefined;
2309
+ correlationId?: string | undefined;
2310
+ causationId?: string | undefined;
2311
+ };
2312
+ id?: string | undefined;
2313
+ payload?: any;
2314
+ }>], z.ZodUnknown>, z.ZodBoolean>>;
2315
+ }, "strip", z.ZodTypeAny, {
2316
+ async: boolean;
2317
+ handler: (args_0: {
2318
+ name: string;
2319
+ metadata: {
2320
+ source: string;
2321
+ timestamp: string;
2322
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2323
+ userId?: string | undefined;
2324
+ tenantId?: string | undefined;
2325
+ correlationId?: string | undefined;
2326
+ causationId?: string | undefined;
2327
+ };
2328
+ id?: string | undefined;
2329
+ payload?: any;
2330
+ }, ...args: unknown[]) => Promise<void>;
2331
+ priority: number;
2332
+ eventName: string;
2333
+ filter?: ((args_0: {
2334
+ name: string;
2335
+ metadata: {
2336
+ source: string;
2337
+ timestamp: string;
2338
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2339
+ userId?: string | undefined;
2340
+ tenantId?: string | undefined;
2341
+ correlationId?: string | undefined;
2342
+ causationId?: string | undefined;
2343
+ };
2344
+ id?: string | undefined;
2345
+ payload?: any;
2346
+ }, ...args: unknown[]) => boolean) | undefined;
2347
+ id?: string | undefined;
2348
+ retry?: {
2349
+ maxRetries: number;
2350
+ backoffMs: number;
2351
+ backoffMultiplier: number;
2352
+ } | undefined;
2353
+ timeoutMs?: number | undefined;
2354
+ }, {
2355
+ handler: (args_0: {
2356
+ name: string;
2357
+ metadata: {
2358
+ source: string;
2359
+ priority: "background" | "normal" | "critical" | "high" | "low";
2360
+ timestamp: string;
2361
+ userId?: string | undefined;
2362
+ tenantId?: string | undefined;
2363
+ correlationId?: string | undefined;
2364
+ causationId?: string | undefined;
2365
+ };
2366
+ id?: string | undefined;
2367
+ payload?: any;
2368
+ }, ...args: unknown[]) => Promise<void>;
2369
+ eventName: string;
2370
+ filter?: ((args_0: {
2371
+ name: string;
2372
+ metadata: {
2373
+ source: string;
2374
+ priority: "background" | "normal" | "critical" | "high" | "low";
2375
+ timestamp: string;
2376
+ userId?: string | undefined;
2377
+ tenantId?: string | undefined;
2378
+ correlationId?: string | undefined;
2379
+ causationId?: string | undefined;
2380
+ };
2381
+ id?: string | undefined;
2382
+ payload?: any;
2383
+ }, ...args: unknown[]) => boolean) | undefined;
2384
+ async?: boolean | undefined;
2385
+ priority?: number | undefined;
2386
+ id?: string | undefined;
2387
+ retry?: {
2388
+ maxRetries?: number | undefined;
2389
+ backoffMs?: number | undefined;
2390
+ backoffMultiplier?: number | undefined;
2391
+ } | undefined;
2392
+ timeoutMs?: number | undefined;
2393
+ }>, "many">>;
2394
+ }, "strip", z.ZodTypeAny, {
2395
+ eventTypes?: {
2396
+ name: string;
2397
+ version: string;
2398
+ deprecated: boolean;
2399
+ tags?: string[] | undefined;
2400
+ description?: string | undefined;
2401
+ schema?: any;
2402
+ }[] | undefined;
2403
+ persistence?: {
2404
+ enabled: boolean;
2405
+ storage: "custom" | "database" | "file" | "s3";
2406
+ retention: number;
2407
+ filter?: ((...args: unknown[]) => unknown) | undefined;
2408
+ } | undefined;
2409
+ queue?: {
2410
+ name: string;
2411
+ concurrency: number;
2412
+ priorityEnabled: boolean;
2413
+ retryPolicy?: {
2414
+ maxRetries: number;
2415
+ backoffStrategy: "fixed" | "linear" | "exponential";
2416
+ initialDelayMs: number;
2417
+ maxDelayMs: number;
2418
+ } | undefined;
2419
+ deadLetterQueue?: string | undefined;
2420
+ } | undefined;
2421
+ eventSourcing?: {
2422
+ enabled: boolean;
2423
+ retention: number;
2424
+ snapshotInterval: number;
2425
+ snapshotRetention: number;
2426
+ storage?: {
2427
+ type: "database" | "file" | "s3" | "eventstore";
2428
+ options?: Record<string, any> | undefined;
2429
+ } | undefined;
2430
+ aggregateTypes?: string[] | undefined;
2431
+ } | undefined;
2432
+ replay?: {
2433
+ enabled: boolean;
2434
+ } | undefined;
2435
+ webhooks?: {
2436
+ enabled: boolean;
2437
+ url: string;
2438
+ method: "GET" | "POST" | "PUT" | "PATCH";
2439
+ timeoutMs: number;
2440
+ eventPattern: string;
2441
+ transform?: ((args_0: {
2442
+ name: string;
2443
+ metadata: {
2444
+ source: string;
2445
+ timestamp: string;
2446
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2447
+ userId?: string | undefined;
2448
+ tenantId?: string | undefined;
2449
+ correlationId?: string | undefined;
2450
+ causationId?: string | undefined;
2451
+ };
2452
+ id?: string | undefined;
2453
+ payload?: any;
2454
+ }, ...args: unknown[]) => any) | undefined;
2455
+ headers?: Record<string, string> | undefined;
2456
+ id?: string | undefined;
2457
+ authentication?: {
2458
+ type: "none" | "api-key" | "basic" | "bearer";
2459
+ credentials?: Record<string, string> | undefined;
2460
+ } | undefined;
2461
+ retryPolicy?: {
2462
+ maxRetries: number;
2463
+ backoffStrategy: "fixed" | "linear" | "exponential";
2464
+ initialDelayMs: number;
2465
+ maxDelayMs: number;
2466
+ } | undefined;
2467
+ }[] | undefined;
2468
+ messageQueue?: {
2469
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
2470
+ format: "json" | "avro" | "protobuf";
2471
+ batchSize: number;
2472
+ compression: "none" | "gzip" | "snappy" | "lz4";
2473
+ eventPattern: string;
2474
+ topic: string;
2475
+ includeMetadata: boolean;
2476
+ flushIntervalMs: number;
2477
+ partitionKey?: string | undefined;
2478
+ } | undefined;
2479
+ realtime?: {
2480
+ enabled: boolean;
2481
+ eventPattern: string;
2482
+ protocol: "websocket" | "sse" | "long-polling";
2483
+ userFilter: boolean;
2484
+ tenantFilter: boolean;
2485
+ rateLimit?: {
2486
+ windowMs: number;
2487
+ maxEventsPerSecond: number;
2488
+ } | undefined;
2489
+ channels?: {
2490
+ name: string;
2491
+ eventPattern: string;
2492
+ filter?: ((args_0: {
2493
+ name: string;
2494
+ metadata: {
2495
+ source: string;
2496
+ timestamp: string;
2497
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2498
+ userId?: string | undefined;
2499
+ tenantId?: string | undefined;
2500
+ correlationId?: string | undefined;
2501
+ causationId?: string | undefined;
2502
+ };
2503
+ id?: string | undefined;
2504
+ payload?: any;
2505
+ }, ...args: unknown[]) => boolean) | undefined;
2506
+ }[] | undefined;
2507
+ } | undefined;
2508
+ handlers?: {
2509
+ async: boolean;
2510
+ handler: (args_0: {
2511
+ name: string;
2512
+ metadata: {
2513
+ source: string;
2514
+ timestamp: string;
2515
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2516
+ userId?: string | undefined;
2517
+ tenantId?: string | undefined;
2518
+ correlationId?: string | undefined;
2519
+ causationId?: string | undefined;
2520
+ };
2521
+ id?: string | undefined;
2522
+ payload?: any;
2523
+ }, ...args: unknown[]) => Promise<void>;
2524
+ priority: number;
2525
+ eventName: string;
2526
+ filter?: ((args_0: {
2527
+ name: string;
2528
+ metadata: {
2529
+ source: string;
2530
+ timestamp: string;
2531
+ priority?: "background" | "normal" | "critical" | "high" | "low" | undefined;
2532
+ userId?: string | undefined;
2533
+ tenantId?: string | undefined;
2534
+ correlationId?: string | undefined;
2535
+ causationId?: string | undefined;
2536
+ };
2537
+ id?: string | undefined;
2538
+ payload?: any;
2539
+ }, ...args: unknown[]) => boolean) | undefined;
2540
+ id?: string | undefined;
2541
+ retry?: {
2542
+ maxRetries: number;
2543
+ backoffMs: number;
2544
+ backoffMultiplier: number;
2545
+ } | undefined;
2546
+ timeoutMs?: number | undefined;
2547
+ }[] | undefined;
2548
+ }, {
2549
+ eventTypes?: {
2550
+ name: string;
2551
+ tags?: string[] | undefined;
2552
+ description?: string | undefined;
2553
+ schema?: any;
2554
+ version?: string | undefined;
2555
+ deprecated?: boolean | undefined;
2556
+ }[] | undefined;
2557
+ persistence?: {
2558
+ retention: number;
2559
+ filter?: ((...args: unknown[]) => unknown) | undefined;
2560
+ enabled?: boolean | undefined;
2561
+ storage?: "custom" | "database" | "file" | "s3" | undefined;
2562
+ } | undefined;
2563
+ queue?: {
2564
+ name?: string | undefined;
2565
+ concurrency?: number | undefined;
2566
+ retryPolicy?: {
2567
+ maxRetries?: number | undefined;
2568
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
2569
+ initialDelayMs?: number | undefined;
2570
+ maxDelayMs?: number | undefined;
2571
+ } | undefined;
2572
+ deadLetterQueue?: string | undefined;
2573
+ priorityEnabled?: boolean | undefined;
2574
+ } | undefined;
2575
+ eventSourcing?: {
2576
+ enabled?: boolean | undefined;
2577
+ storage?: {
2578
+ options?: Record<string, any> | undefined;
2579
+ type?: "database" | "file" | "s3" | "eventstore" | undefined;
2580
+ } | undefined;
2581
+ retention?: number | undefined;
2582
+ snapshotInterval?: number | undefined;
2583
+ snapshotRetention?: number | undefined;
2584
+ aggregateTypes?: string[] | undefined;
2585
+ } | undefined;
2586
+ replay?: {
2587
+ enabled?: boolean | undefined;
2588
+ } | undefined;
2589
+ webhooks?: {
2590
+ url: string;
2591
+ eventPattern: string;
2592
+ transform?: ((args_0: {
2593
+ name: string;
2594
+ metadata: {
2595
+ source: string;
2596
+ priority: "background" | "normal" | "critical" | "high" | "low";
2597
+ timestamp: string;
2598
+ userId?: string | undefined;
2599
+ tenantId?: string | undefined;
2600
+ correlationId?: string | undefined;
2601
+ causationId?: string | undefined;
2602
+ };
2603
+ id?: string | undefined;
2604
+ payload?: any;
2605
+ }, ...args: unknown[]) => any) | undefined;
2606
+ enabled?: boolean | undefined;
2607
+ method?: "GET" | "POST" | "PUT" | "PATCH" | undefined;
2608
+ headers?: Record<string, string> | undefined;
2609
+ id?: string | undefined;
2610
+ authentication?: {
2611
+ type: "none" | "api-key" | "basic" | "bearer";
2612
+ credentials?: Record<string, string> | undefined;
2613
+ } | undefined;
2614
+ timeoutMs?: number | undefined;
2615
+ retryPolicy?: {
2616
+ maxRetries?: number | undefined;
2617
+ backoffStrategy?: "fixed" | "linear" | "exponential" | undefined;
2618
+ initialDelayMs?: number | undefined;
2619
+ maxDelayMs?: number | undefined;
2620
+ } | undefined;
2621
+ }[] | undefined;
2622
+ messageQueue?: {
2623
+ provider: "kafka" | "rabbitmq" | "aws-sqs" | "redis-pubsub" | "google-pubsub" | "azure-service-bus";
2624
+ topic: string;
2625
+ format?: "json" | "avro" | "protobuf" | undefined;
2626
+ batchSize?: number | undefined;
2627
+ compression?: "none" | "gzip" | "snappy" | "lz4" | undefined;
2628
+ eventPattern?: string | undefined;
2629
+ partitionKey?: string | undefined;
2630
+ includeMetadata?: boolean | undefined;
2631
+ flushIntervalMs?: number | undefined;
2632
+ } | undefined;
2633
+ realtime?: {
2634
+ enabled?: boolean | undefined;
2635
+ rateLimit?: {
2636
+ maxEventsPerSecond: number;
2637
+ windowMs?: number | undefined;
2638
+ } | undefined;
2639
+ eventPattern?: string | undefined;
2640
+ protocol?: "websocket" | "sse" | "long-polling" | undefined;
2641
+ userFilter?: boolean | undefined;
2642
+ tenantFilter?: boolean | undefined;
2643
+ channels?: {
2644
+ name: string;
2645
+ eventPattern: string;
2646
+ filter?: ((args_0: {
2647
+ name: string;
2648
+ metadata: {
2649
+ source: string;
2650
+ priority: "background" | "normal" | "critical" | "high" | "low";
2651
+ timestamp: string;
2652
+ userId?: string | undefined;
2653
+ tenantId?: string | undefined;
2654
+ correlationId?: string | undefined;
2655
+ causationId?: string | undefined;
2656
+ };
2657
+ id?: string | undefined;
2658
+ payload?: any;
2659
+ }, ...args: unknown[]) => boolean) | undefined;
2660
+ }[] | undefined;
2661
+ } | undefined;
2662
+ handlers?: {
2663
+ handler: (args_0: {
2664
+ name: string;
2665
+ metadata: {
2666
+ source: string;
2667
+ priority: "background" | "normal" | "critical" | "high" | "low";
2668
+ timestamp: string;
2669
+ userId?: string | undefined;
2670
+ tenantId?: string | undefined;
2671
+ correlationId?: string | undefined;
2672
+ causationId?: string | undefined;
2673
+ };
2674
+ id?: string | undefined;
2675
+ payload?: any;
2676
+ }, ...args: unknown[]) => Promise<void>;
2677
+ eventName: string;
2678
+ filter?: ((args_0: {
2679
+ name: string;
2680
+ metadata: {
2681
+ source: string;
2682
+ priority: "background" | "normal" | "critical" | "high" | "low";
2683
+ timestamp: string;
2684
+ userId?: string | undefined;
2685
+ tenantId?: string | undefined;
2686
+ correlationId?: string | undefined;
2687
+ causationId?: string | undefined;
2688
+ };
2689
+ id?: string | undefined;
2690
+ payload?: any;
2691
+ }, ...args: unknown[]) => boolean) | undefined;
2692
+ async?: boolean | undefined;
2693
+ priority?: number | undefined;
2694
+ id?: string | undefined;
2695
+ retry?: {
2696
+ maxRetries?: number | undefined;
2697
+ backoffMs?: number | undefined;
2698
+ backoffMultiplier?: number | undefined;
2699
+ } | undefined;
2700
+ timeoutMs?: number | undefined;
2701
+ }[] | undefined;
2702
+ }>;
2703
+ export type EventBusConfig = z.infer<typeof EventBusConfigSchema>;
2704
+ /**
2705
+ * Helper to create event bus configuration
2706
+ */
2707
+ export declare function createEventBusConfig<T extends z.input<typeof EventBusConfigSchema>>(config: T): T;
2708
+ /**
2709
+ * Helper to create event type definition
2710
+ */
2711
+ export declare function createEventTypeDefinition<T extends z.input<typeof EventTypeDefinitionSchema>>(definition: T): T;
2712
+ /**
2713
+ * Helper to create event webhook configuration
2714
+ */
2715
+ export declare function createEventWebhookConfig<T extends z.input<typeof EventWebhookConfigSchema>>(config: T): T;
180
2716
  //# sourceMappingURL=events.zod.d.ts.map