@burdenoff/be-sdk 2026.1021.2 → 2026.1021.4

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/dist/EventQueueFactory-JG7S6HOL.js +8 -0
  2. package/dist/{EventQueueFactory-ZHBJD3OD.js.map → EventQueueFactory-JG7S6HOL.js.map} +1 -1
  3. package/dist/{chunk-P67HNJGL.js → chunk-DNULGVN3.js} +14 -7
  4. package/dist/chunk-DNULGVN3.js.map +1 -0
  5. package/dist/{chunk-E5HKS7KD.js → chunk-DTE2MHKE.js} +4 -4
  6. package/dist/{chunk-E5HKS7KD.js.map → chunk-DTE2MHKE.js.map} +1 -1
  7. package/dist/{chunk-RTBCGUHC.js → chunk-GSIJ2DBJ.js} +6 -5
  8. package/dist/chunk-GSIJ2DBJ.js.map +1 -0
  9. package/dist/{chunk-XTIOBNT7.js → chunk-HEAQSZBX.js} +7 -6
  10. package/dist/chunk-HEAQSZBX.js.map +1 -0
  11. package/dist/{chunk-6VK53YR3.js → chunk-IZZ45AGA.js} +253 -15
  12. package/dist/chunk-IZZ45AGA.js.map +1 -0
  13. package/dist/chunk-JV7XNJP4.js +1334 -0
  14. package/dist/chunk-JV7XNJP4.js.map +1 -0
  15. package/dist/chunk-KS2HQCJR.js +56 -0
  16. package/dist/chunk-KS2HQCJR.js.map +1 -0
  17. package/dist/{chunk-GJR6AQAL.js → chunk-V3N6HDFE.js} +30 -9
  18. package/dist/chunk-V3N6HDFE.js.map +1 -0
  19. package/dist/{chunk-HDUS6UBO.js → chunk-YCSIHUYP.js} +3 -3
  20. package/dist/{chunk-HDUS6UBO.js.map → chunk-YCSIHUYP.js.map} +1 -1
  21. package/dist/env-4UWSUS64.js +4 -0
  22. package/dist/env-4UWSUS64.js.map +1 -0
  23. package/dist/event-queue/index.d.ts +1 -1
  24. package/dist/event-queue/index.js +4 -3
  25. package/dist/graph/index.d.ts +2 -2
  26. package/dist/graph/index.js +6 -5
  27. package/dist/index-BVXRewdr.d.ts +1066 -0
  28. package/dist/{index-Dl8EAdYu.d.ts → index-CL7koBpQ.d.ts} +1 -1
  29. package/dist/{index-D3DzCz1d.d.ts → index-DG5lCWNk.d.ts} +21 -152
  30. package/dist/index.d.ts +6 -6
  31. package/dist/index.js +19 -18
  32. package/dist/index.js.map +1 -1
  33. package/dist/init/index.js +1 -1
  34. package/dist/prisma/index.d.ts +2 -2
  35. package/dist/prisma/index.js +5 -4
  36. package/dist/prisma-extension-gYhYriA0.d.ts +174 -0
  37. package/dist/tracker/index.js +2 -2
  38. package/package.json +1 -1
  39. package/dist/EventQueueFactory-ZHBJD3OD.js +0 -7
  40. package/dist/chunk-6VK53YR3.js.map +0 -1
  41. package/dist/chunk-GJR6AQAL.js.map +0 -1
  42. package/dist/chunk-P67HNJGL.js.map +0 -1
  43. package/dist/chunk-RTBCGUHC.js.map +0 -1
  44. package/dist/chunk-VD4B362H.js +0 -464
  45. package/dist/chunk-VD4B362H.js.map +0 -1
  46. package/dist/chunk-XTIOBNT7.js.map +0 -1
  47. package/dist/index-CpXKka7c.d.ts +0 -690
  48. package/dist/prisma-extension-krXnYnrN.d.ts +0 -30
@@ -1,690 +0,0 @@
1
- import { S as ServiceLayer } from './layer-GNAVXBMf.js';
2
- import { S as ShutdownDisposable } from './shutdown-registry-CW9LryO8.js';
3
- import { E as EntityEventRbacMetadata, a as EntityEventType$1, b as GraphEventEmitter$1, G as GraphEventEmitterImpl, c as createGraphEventEmitter$1, g as getGraphEventEmitter, r as resetGraphEventEmitter } from './graph-emitter-r5TylDBm.js';
4
- import { B as BurdenoffGraphQLClient } from './graphql-AaLJfGzz.js';
5
- import { a as SDKContext } from './index-CfRZtB99.js';
6
-
7
- interface EventMessage$1<T = unknown> {
8
- id: string;
9
- subject: string;
10
- data: T;
11
- metadata: EventMetadata;
12
- timestamp: string;
13
- sequence?: number;
14
- }
15
- interface EventMetadata {
16
- correlationId: string;
17
- tenantId?: string;
18
- workspaceId?: string;
19
- userId?: string;
20
- source?: string;
21
- version?: string;
22
- [key: string]: unknown;
23
- }
24
- interface AcknowledgeableEvent<T = unknown> extends EventMessage$1<T> {
25
- ack(): Promise<void>;
26
- nak(delay?: number): Promise<void>;
27
- term(): Promise<void>;
28
- isRedelivered(): boolean;
29
- getDeliveryAttempt(): number;
30
- }
31
- type EventHandler<T = unknown> = (event: AcknowledgeableEvent<T>) => Promise<void>;
32
- interface StreamConfig {
33
- name: string;
34
- subjects: string[];
35
- description?: string;
36
- retention?: 'limits' | 'interest' | 'workqueue';
37
- maxAge?: number;
38
- maxMsgs?: number;
39
- maxBytes?: number;
40
- storage?: 'file' | 'memory';
41
- replicas?: number;
42
- maxConsumers?: number;
43
- duplicateWindow?: number;
44
- }
45
- interface ConsumerOptions {
46
- name: string;
47
- stream: string;
48
- filterSubject?: string;
49
- deliverPolicy?: 'all' | 'last' | 'new' | 'byStartSequence' | 'byStartTime';
50
- ackPolicy?: 'explicit' | 'all' | 'none';
51
- ackWait?: number;
52
- maxDeliver?: number;
53
- maxAckPending?: number;
54
- }
55
- interface SubscriptionOptions {
56
- stream?: string;
57
- consumer?: string;
58
- maxConcurrent?: number;
59
- maxRetries?: number;
60
- retryBackoff?: 'exponential' | 'linear' | 'fixed';
61
- retryDelay?: number;
62
- timeout?: number;
63
- useLocking?: boolean;
64
- lockTTL?: number;
65
- ackPolicy?: 'explicit' | 'all' | 'none';
66
- deliverPolicy?: 'all' | 'last' | 'new' | 'byStartSequence' | 'byStartTime';
67
- maxDeliver?: number;
68
- ackWait?: number;
69
- maxAckPending?: number;
70
- streamSubjects?: string[];
71
- retention?: 'limits' | 'interest' | 'workqueue';
72
- storage?: 'file' | 'memory';
73
- }
74
-
75
- declare enum QueueType {
76
- REDIS_STREAMS = "redis-streams",
77
- RABBITMQ = "rabbitmq",
78
- KAFKA = "kafka",
79
- SQS = "sqs"
80
- }
81
- interface BaseQueueConfig {
82
- type: QueueType | string;
83
- url: string;
84
- user?: string;
85
- password?: string;
86
- token?: string;
87
- creds?: string;
88
- credsFile?: string;
89
- maxReconnectAttempts?: number;
90
- reconnectTimeWait?: number;
91
- connectionTimeout?: number;
92
- name?: string;
93
- }
94
- interface PublisherConfig extends BaseQueueConfig {
95
- defaultTTL?: number;
96
- enableDeduplication?: boolean;
97
- defaultPriority?: 'low' | 'normal' | 'high';
98
- }
99
- interface ConsumerConfig extends Partial<BaseQueueConfig> {
100
- stream: string;
101
- consumer: string;
102
- filterSubject?: string;
103
- maxConcurrent?: number;
104
- maxDeliver?: number;
105
- ackWait?: number;
106
- ackPolicy?: 'explicit' | 'all' | 'none';
107
- deliverPolicy?: 'all' | 'last' | 'new' | 'byStartSequence' | 'byStartTime';
108
- maxAckPending?: number;
109
- }
110
- interface EventQueueHealthCheckResult {
111
- status: 'healthy' | 'unhealthy' | 'degraded';
112
- timestamp: string;
113
- connected?: boolean;
114
- latencyMs?: number;
115
- details?: Record<string, unknown>;
116
- error?: string;
117
- }
118
- interface QueueStatistics {
119
- messagesPublished?: number;
120
- messagesConsumed?: number;
121
- messagesPending?: number;
122
- queueSize?: number;
123
- messagesFailed?: number;
124
- activeConsumers?: number;
125
- activePublishers?: number;
126
- avgProcessingTimeMs?: number;
127
- lastActivity?: string | null;
128
- details?: Record<string, unknown>;
129
- }
130
-
131
- interface IEventQueue {
132
- connect(): Promise<void>;
133
- disconnect(): Promise<void>;
134
- isConnected(): boolean;
135
- healthCheck(): Promise<EventQueueHealthCheckResult>;
136
- getStatistics(): Promise<QueueStatistics>;
137
- }
138
-
139
- interface ISubscription {
140
- id: string;
141
- subject: string;
142
- unsubscribe(): Promise<void>;
143
- isActive(): boolean;
144
- getStats(): {
145
- messagesReceived: number;
146
- messagesProcessed: number;
147
- messagesFailed: number;
148
- lastActivity: string;
149
- };
150
- }
151
- interface IEventConsumer extends IEventQueue {
152
- ensureStream(config: StreamConfig): Promise<void>;
153
- ensureConsumer(config: ConsumerConfig): Promise<void>;
154
- subscribe<T = unknown>(options: {
155
- subject: string;
156
- handler: EventHandler<T>;
157
- options?: SubscriptionOptions;
158
- }): Promise<ISubscription>;
159
- subscribeMultiple<T = unknown>(subjects: string[], handler: EventHandler<T>, options?: SubscriptionOptions): Promise<ISubscription[]>;
160
- pull<T = unknown>(options: {
161
- subject: string;
162
- batch?: number;
163
- timeout?: number;
164
- }): Promise<AcknowledgeableEvent<T>[]>;
165
- unsubscribeAll(): Promise<void>;
166
- getSubscriptions(): ISubscription[];
167
- processDLQ<T = unknown>(handler: EventHandler<T>): Promise<void>;
168
- listSubjects?(stream?: string): Promise<string[]>;
169
- }
170
-
171
- interface PublishOptions {
172
- messageId?: string;
173
- priority?: 'low' | 'normal' | 'high';
174
- ttl?: number;
175
- delay?: number;
176
- expectedStream?: string;
177
- stream?: string;
178
- streamSubjects?: string[];
179
- retention?: 'limits' | 'interest' | 'workqueue';
180
- storage?: 'file' | 'memory';
181
- }
182
- interface IEventPublisher extends IEventQueue {
183
- ensureStream(config: StreamConfig): Promise<void>;
184
- publish<T = unknown>(options: {
185
- subject: string;
186
- data: T;
187
- metadata?: Partial<EventMetadata>;
188
- options?: PublishOptions;
189
- }): Promise<number | string>;
190
- publishBatch<T = unknown>(events: Array<{
191
- subject: string;
192
- data: T;
193
- metadata?: Partial<EventMetadata>;
194
- options?: PublishOptions;
195
- }>): Promise<Array<number | string>>;
196
- publishWithAck<T = unknown, R = unknown>(options: {
197
- subject: string;
198
- data: T;
199
- metadata?: Partial<EventMetadata>;
200
- timeout?: number;
201
- }): Promise<R>;
202
- }
203
-
204
- declare class EventQueueFactory {
205
- static createPublisher(config: PublisherConfig): IEventPublisher;
206
- static createConsumer(config: ConsumerConfig): IEventConsumer;
207
- static createPublisherFromEnv(): IEventPublisher;
208
- static createConsumerFromEnv(stream: string, consumer: string): IEventConsumer;
209
- static createPublisherForLayer(_layer: ServiceLayer, serviceName: string): IEventPublisher;
210
- static createConsumerForLayer(_layer: ServiceLayer, serviceName: string, stream: string, consumer: string): IEventConsumer;
211
- }
212
-
213
- type IoRedis = {
214
- status: string;
215
- connect: () => Promise<void>;
216
- disconnect: () => void;
217
- quit: () => Promise<unknown>;
218
- ping: () => Promise<string>;
219
- on: (event: string, handler: (...args: unknown[]) => void) => void;
220
- duplicate: () => IoRedis;
221
- xadd: (...args: unknown[]) => Promise<string>;
222
- xack: (...args: unknown[]) => Promise<number>;
223
- xreadgroup: (...args: unknown[]) => Promise<unknown>;
224
- xgroup: (...args: unknown[]) => Promise<unknown>;
225
- xautoclaim: (...args: unknown[]) => Promise<unknown>;
226
- xpending: (...args: unknown[]) => Promise<unknown>;
227
- xlen: (key: string) => Promise<number>;
228
- xinfo: (...args: unknown[]) => Promise<unknown>;
229
- xrevrange: (...args: unknown[]) => Promise<unknown>;
230
- xrange: (...args: unknown[]) => Promise<unknown>;
231
- xdel: (key: string, ...ids: string[]) => Promise<number>;
232
- set: (...args: unknown[]) => Promise<string | null>;
233
- expire: (key: string, seconds: number) => Promise<number>;
234
- del: (...keys: string[]) => Promise<number>;
235
- sadd: (key: string, ...members: string[]) => Promise<number>;
236
- smembers: (key: string) => Promise<string[]>;
237
- zadd: (...args: unknown[]) => Promise<number>;
238
- zrangebyscore: (...args: unknown[]) => Promise<string[]>;
239
- zrem: (key: string, ...members: string[]) => Promise<number>;
240
- pipeline: () => {
241
- xadd: (...args: unknown[]) => unknown;
242
- exec: () => Promise<Array<[Error | null, unknown]>>;
243
- };
244
- };
245
- declare class RedisStreamsConnection {
246
- private readonly config;
247
- private client;
248
- private connecting;
249
- private readonly tls;
250
- private readonly host;
251
- private readonly normalisedUrl;
252
- private readonly dbIndex;
253
- constructor(config: BaseQueueConfig);
254
- isConnected(): boolean;
255
- connect(): Promise<void>;
256
- private doConnect;
257
- disconnect(): Promise<void>;
258
- getClient(): IoRedis;
259
- makeBlockingClient(): Promise<IoRedis>;
260
- ping(): Promise<string>;
261
- }
262
-
263
- interface RedisStreamsPublisherConfig extends PublisherConfig {
264
- maxLen?: number;
265
- dedupTtlSeconds?: number;
266
- keyPrefix?: string;
267
- }
268
- declare class RedisStreamsEventPublisher implements IEventPublisher, ShutdownDisposable {
269
- private config;
270
- private connection;
271
- private publishCount;
272
- private lastPublishTime;
273
- private readonly maxLen;
274
- private readonly dedupTtl;
275
- private readonly keyPrefix;
276
- readonly shutdownName: string;
277
- constructor(config: RedisStreamsPublisherConfig);
278
- dispose(): Promise<void>;
279
- connect(): Promise<void>;
280
- disconnect(): Promise<void>;
281
- isConnected(): boolean;
282
- healthCheck(): Promise<EventQueueHealthCheckResult>;
283
- getStatistics(): Promise<QueueStatistics>;
284
- ensureStream(_config: StreamConfig): Promise<void>;
285
- publish<T = unknown>(options: {
286
- subject: string;
287
- data: T;
288
- metadata?: Partial<EventMetadata>;
289
- options?: PublishOptions;
290
- }): Promise<number | string>;
291
- private publishInternal;
292
- publishBatch<T = unknown>(events: Array<{
293
- subject: string;
294
- data: T;
295
- metadata?: Partial<EventMetadata>;
296
- options?: PublishOptions;
297
- }>): Promise<Array<number | string>>;
298
- publishWithAck<T = unknown, R = unknown>(opts: {
299
- subject: string;
300
- data: T;
301
- metadata?: Partial<EventMetadata>;
302
- timeout?: number;
303
- }): Promise<R>;
304
- sendReply(correlationId: string, data: unknown): Promise<void>;
305
- }
306
-
307
- interface RedisStreamsConsumerConfig extends ConsumerConfig {
308
- keyPrefix?: string;
309
- }
310
- declare class RedisStreamsEventConsumer implements IEventConsumer, ShutdownDisposable {
311
- readonly shutdownName: string;
312
- private readonly connection;
313
- private subscriptions;
314
- private readonly subscriptionLoops;
315
- private readonly keyPrefix;
316
- private readonly consumerName;
317
- private readonly group;
318
- private readonly maxDeliver;
319
- private readonly ackWaitMs;
320
- private readonly maxConcurrent;
321
- private consumedCount;
322
- private failedCount;
323
- private lastActivity;
324
- private stopped;
325
- private sweepTimer;
326
- private delayqTimer;
327
- private readonly settlements;
328
- private retainedSerializedFieldsBytes;
329
- private knownStreams;
330
- constructor(config: RedisStreamsConsumerConfig);
331
- dispose(): Promise<void>;
332
- connect(): Promise<void>;
333
- disconnect(): Promise<void>;
334
- isConnected(): boolean;
335
- healthCheck(): Promise<EventQueueHealthCheckResult>;
336
- getStatistics(): Promise<QueueStatistics>;
337
- ensureStream(_config: StreamConfig): Promise<void>;
338
- ensureConsumer(_config: ConsumerConfig): Promise<void>;
339
- subscribe<T = unknown>(opts: {
340
- subject: string;
341
- handler: EventHandler<T>;
342
- options?: SubscriptionOptions;
343
- }): Promise<ISubscription>;
344
- subscribeMultiple<T = unknown>(subjects: string[], handler: EventHandler<T>, options?: SubscriptionOptions): Promise<ISubscription[]>;
345
- pull<T = unknown>(opts: {
346
- subject: string;
347
- batch?: number;
348
- timeout?: number;
349
- }): Promise<AcknowledgeableEvent<T>[]>;
350
- unsubscribeAll(): Promise<void>;
351
- getSubscriptions(): ISubscription[];
352
- processDLQ<T = unknown>(handler: EventHandler<T>): Promise<void>;
353
- listSubjects(_stream?: string): Promise<string[]>;
354
- private resolveStartId;
355
- private ensureGroup;
356
- private spawnLoop;
357
- private parseEntry;
358
- private toAcknowledgeable;
359
- private settlement;
360
- private sweepPending;
361
- private drainDelayQueues;
362
- }
363
-
364
- interface KeyspaceOptions {
365
- prefix?: string;
366
- }
367
- declare function streamKey(subject: string, opts?: KeyspaceOptions): string;
368
- declare function dlqKey(stream: string): string;
369
-
370
- type EntityEventType = 'entity.created' | 'entity.updated' | 'entity.deleted';
371
- interface GraphEventEmitter {
372
- publishEntityEvent(eventType: EntityEventType, entity: {
373
- id: string;
374
- type: string;
375
- data: Record<string, unknown>;
376
- }, context: {
377
- productName: string;
378
- organizationId: string;
379
- userId?: string;
380
- workspaceId?: string;
381
- }): Promise<void>;
382
- }
383
- declare class MemoryEventBus {
384
- private handlers;
385
- emit<T>(event: string, data: T): void;
386
- on<T>(event: string, handler: EventHandler<T>): void;
387
- off<T>(event: string, handler: EventHandler<T>): void;
388
- private matchesPattern;
389
- clear(): void;
390
- }
391
- declare class MemoryEventQueue implements GraphEventEmitter {
392
- private queue;
393
- private processing;
394
- private handlers;
395
- private maxRetries;
396
- private retryDelay;
397
- constructor(options?: {
398
- maxRetries?: number;
399
- retryDelay?: number;
400
- });
401
- publishEntityEvent(eventType: EntityEventType, entity: {
402
- id: string;
403
- type: string;
404
- data: Record<string, unknown>;
405
- }, context: {
406
- productName: string;
407
- organizationId: string;
408
- userId?: string;
409
- workspaceId?: string;
410
- }): Promise<void>;
411
- enqueue<T>(subject: string, data: T, metadata?: Record<string, unknown>): string;
412
- registerHandler<T>(subject: string, handler: EventHandler<T>): void;
413
- private processQueue;
414
- get length(): number;
415
- clear(): void;
416
- publish<T>(subject: string, data: T, metadata?: Record<string, unknown>): Promise<void>;
417
- close(): Promise<void>;
418
- }
419
- declare class MemoryEventPublisher implements IEventPublisher {
420
- private queue;
421
- private _connected;
422
- private publishCount;
423
- constructor();
424
- connect(): Promise<void>;
425
- disconnect(): Promise<void>;
426
- isConnected(): boolean;
427
- ensureStream(): Promise<void>;
428
- publish<T = unknown>(options: {
429
- subject: string;
430
- data: T;
431
- metadata?: Record<string, unknown>;
432
- options?: PublishOptions;
433
- }): Promise<string>;
434
- publishBatch<T = unknown>(events: Array<{
435
- subject: string;
436
- data: T;
437
- metadata?: Record<string, unknown>;
438
- options?: PublishOptions;
439
- }>): Promise<string[]>;
440
- publishWithAck<T = unknown, R = unknown>(options: {
441
- subject: string;
442
- data: T;
443
- metadata?: Partial<EventMetadata>;
444
- timeout?: number;
445
- }): Promise<R>;
446
- healthCheck(): Promise<EventQueueHealthCheckResult>;
447
- getStatistics(): Promise<QueueStatistics>;
448
- getQueue(): MemoryEventQueue;
449
- }
450
- declare class MemoryEventConsumer implements IEventConsumer {
451
- private streamName;
452
- private consumerName;
453
- private queue;
454
- private bus;
455
- private _connected;
456
- private _subscriptions;
457
- private consumeCount;
458
- private subIdCounter;
459
- constructor(streamName: string, consumerName: string);
460
- connect(): Promise<void>;
461
- disconnect(): Promise<void>;
462
- isConnected(): boolean;
463
- ensureStream(): Promise<void>;
464
- ensureConsumer(): Promise<void>;
465
- subscribe<T = unknown>(options: {
466
- subject: string;
467
- handler: EventHandler<T>;
468
- queueGroup?: string;
469
- }): Promise<ISubscription>;
470
- subscribeMultiple<T = unknown>(subjects: string[], handler: EventHandler<T>): Promise<ISubscription[]>;
471
- pull<T = unknown>(): Promise<AcknowledgeableEvent<T>[]>;
472
- unsubscribeAll(): Promise<void>;
473
- getSubscriptions(): ISubscription[];
474
- processDLQ<T = unknown>(_handler: EventHandler<T>): Promise<void>;
475
- healthCheck(): Promise<EventQueueHealthCheckResult>;
476
- getStatistics(): Promise<QueueStatistics>;
477
- getBus(): MemoryEventBus;
478
- getQueue(): MemoryEventQueue;
479
- }
480
- declare function createMemoryPublisher(): IEventPublisher;
481
- declare function createMemoryConsumer(stream: string, consumer: string): IEventConsumer;
482
- declare function createGraphEventEmitter(): GraphEventEmitter;
483
-
484
- interface ModuleEventPayload {
485
- id: string;
486
- type: string;
487
- action: 'created' | 'updated' | 'deleted' | 'assigned' | 'removed' | string;
488
- data: Record<string, unknown>;
489
- metadata: {
490
- tenantId?: string;
491
- workspaceId?: string;
492
- userId: string;
493
- timestamp: string;
494
- productSource: string;
495
- correlationId?: string;
496
- };
497
- }
498
- interface BulkEventPayload {
499
- items: Array<{
500
- id: string;
501
- data: Record<string, unknown>;
502
- }>;
503
- metadata: {
504
- tenantId?: string;
505
- workspaceId?: string;
506
- userId: string;
507
- timestamp: string;
508
- productSource: string;
509
- };
510
- }
511
- interface ModuleEventsConfig {
512
- moduleName: string;
513
- subjectPrefix?: string;
514
- loggerLabel?: string;
515
- }
516
- declare class ModuleEventsService {
517
- private readonly productSource;
518
- private readonly subjectPrefix;
519
- private readonly loggerLabel;
520
- private publisher;
521
- private connected;
522
- private connecting;
523
- constructor(config: ModuleEventsConfig);
524
- private ensureConnected;
525
- private publish;
526
- private buildPayload;
527
- private buildSubject;
528
- publishCreated(entityType: string, id: string, data: Record<string, unknown>, userId: string, tenantId?: string, workspaceId?: string): Promise<void>;
529
- publishUpdated(entityType: string, id: string, data: Record<string, unknown>, userId: string, tenantId?: string, workspaceId?: string): Promise<void>;
530
- publishDeleted(entityType: string, id: string, userId: string, tenantId?: string, workspaceId?: string): Promise<void>;
531
- publishCustom(entityType: string, action: string, id: string, data: Record<string, unknown>, userId: string, tenantId?: string, workspaceId?: string): Promise<void>;
532
- publishBulkCreated(_entityType: string, items: Array<{
533
- id: string;
534
- data: Record<string, unknown>;
535
- }>, userId: string, tenantId?: string, workspaceId?: string): Promise<void>;
536
- close(): Promise<void>;
537
- healthCheck(): Promise<{
538
- healthy: boolean;
539
- message: string;
540
- }>;
541
- }
542
- declare function createModuleEventsService(config: ModuleEventsConfig): ModuleEventsService;
543
-
544
- declare enum EventPriority {
545
- LOW = "low",
546
- NORMAL = "normal",
547
- HIGH = "high",
548
- CRITICAL = "critical"
549
- }
550
- interface PublishEventOptions {
551
- subject: string;
552
- data: Record<string, unknown>;
553
- priority?: EventPriority;
554
- metadata?: Record<string, unknown>;
555
- delay?: number;
556
- messageId?: string;
557
- workspaceId?: string;
558
- organizationId?: string;
559
- }
560
- interface SubscribeOptions {
561
- subject: string;
562
- queueGroup?: string;
563
- durableName?: string;
564
- startPosition?: 'first' | 'last' | 'new';
565
- ackMode?: 'explicit' | 'auto';
566
- maxDeliver?: number;
567
- ackWait?: number;
568
- }
569
- interface EventMessage {
570
- id: string;
571
- subject: string;
572
- data: Record<string, unknown>;
573
- priority: EventPriority;
574
- metadata?: Record<string, unknown>;
575
- workspaceId?: string;
576
- organizationId?: string;
577
- publishedAt: string;
578
- publishedBy?: string;
579
- }
580
- interface PublishResult {
581
- messageId: string;
582
- subject: string;
583
- sequence: number;
584
- timestamp: string;
585
- }
586
- interface StreamInfo {
587
- name: string;
588
- subjects: string[];
589
- messageCount: number;
590
- byteCount: number;
591
- firstSequence: number;
592
- lastSequence: number;
593
- consumerCount: number;
594
- }
595
- declare class EventsModule {
596
- private client;
597
- private context;
598
- constructor(client: BurdenoffGraphQLClient, context: SDKContext);
599
- createStream(name: string, subjects: string[], options?: {
600
- maxMessages?: number;
601
- maxBytes?: number;
602
- maxAge?: number;
603
- storageType?: 'file' | 'memory';
604
- replicas?: number;
605
- }): Promise<StreamInfo>;
606
- getStreamInfo(name: string): Promise<StreamInfo>;
607
- deleteStream(name: string): Promise<boolean>;
608
- purgeStream(name: string, options?: {
609
- subject?: string;
610
- sequence?: number;
611
- }): Promise<number>;
612
- createConsumer(streamName: string, consumerName: string, options: SubscribeOptions): Promise<{
613
- name: string;
614
- pending: number;
615
- }>;
616
- deleteConsumer(streamName: string, consumerName: string): Promise<boolean>;
617
- ackMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean>;
618
- nakMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean>;
619
- getConsumerInfo(streamName: string, consumerName: string): Promise<{
620
- name: string;
621
- pending: number;
622
- redelivered: number;
623
- numAckPending: number;
624
- }>;
625
- }
626
-
627
- declare function createPublisher(): IEventPublisher;
628
- declare function createConsumer(stream: string, consumer: string): IEventConsumer;
629
-
630
- type index_AcknowledgeableEvent<T = unknown> = AcknowledgeableEvent<T>;
631
- type index_BaseQueueConfig = BaseQueueConfig;
632
- type index_BulkEventPayload = BulkEventPayload;
633
- type index_ConsumerConfig = ConsumerConfig;
634
- type index_ConsumerOptions = ConsumerOptions;
635
- declare const index_EntityEventRbacMetadata: typeof EntityEventRbacMetadata;
636
- type index_EventHandler<T = unknown> = EventHandler<T>;
637
- type index_EventMetadata = EventMetadata;
638
- type index_EventPriority = EventPriority;
639
- declare const index_EventPriority: typeof EventPriority;
640
- type index_EventQueueFactory = EventQueueFactory;
641
- declare const index_EventQueueFactory: typeof EventQueueFactory;
642
- type index_EventQueueHealthCheckResult = EventQueueHealthCheckResult;
643
- type index_EventsModule = EventsModule;
644
- declare const index_EventsModule: typeof EventsModule;
645
- declare const index_GraphEventEmitterImpl: typeof GraphEventEmitterImpl;
646
- type index_IEventConsumer = IEventConsumer;
647
- type index_IEventPublisher = IEventPublisher;
648
- type index_IEventQueue = IEventQueue;
649
- type index_ISubscription = ISubscription;
650
- type index_MemoryEventBus = MemoryEventBus;
651
- declare const index_MemoryEventBus: typeof MemoryEventBus;
652
- type index_MemoryEventConsumer = MemoryEventConsumer;
653
- declare const index_MemoryEventConsumer: typeof MemoryEventConsumer;
654
- type index_MemoryEventPublisher = MemoryEventPublisher;
655
- declare const index_MemoryEventPublisher: typeof MemoryEventPublisher;
656
- type index_MemoryEventQueue = MemoryEventQueue;
657
- declare const index_MemoryEventQueue: typeof MemoryEventQueue;
658
- type index_ModuleEventPayload = ModuleEventPayload;
659
- type index_ModuleEventsConfig = ModuleEventsConfig;
660
- type index_ModuleEventsService = ModuleEventsService;
661
- declare const index_ModuleEventsService: typeof ModuleEventsService;
662
- type index_PublishEventOptions = PublishEventOptions;
663
- type index_PublishOptions = PublishOptions;
664
- type index_PublishResult = PublishResult;
665
- type index_PublisherConfig = PublisherConfig;
666
- type index_QueueStatistics = QueueStatistics;
667
- type index_QueueType = QueueType;
668
- declare const index_QueueType: typeof QueueType;
669
- type index_RedisStreamsConnection = RedisStreamsConnection;
670
- declare const index_RedisStreamsConnection: typeof RedisStreamsConnection;
671
- type index_RedisStreamsEventConsumer = RedisStreamsEventConsumer;
672
- declare const index_RedisStreamsEventConsumer: typeof RedisStreamsEventConsumer;
673
- type index_RedisStreamsEventPublisher = RedisStreamsEventPublisher;
674
- declare const index_RedisStreamsEventPublisher: typeof RedisStreamsEventPublisher;
675
- type index_StreamConfig = StreamConfig;
676
- type index_StreamInfo = StreamInfo;
677
- type index_SubscribeOptions = SubscribeOptions;
678
- type index_SubscriptionOptions = SubscriptionOptions;
679
- declare const index_createConsumer: typeof createConsumer;
680
- declare const index_createMemoryConsumer: typeof createMemoryConsumer;
681
- declare const index_createMemoryPublisher: typeof createMemoryPublisher;
682
- declare const index_createModuleEventsService: typeof createModuleEventsService;
683
- declare const index_createPublisher: typeof createPublisher;
684
- declare const index_getGraphEventEmitter: typeof getGraphEventEmitter;
685
- declare const index_resetGraphEventEmitter: typeof resetGraphEventEmitter;
686
- declare namespace index {
687
- export { type index_AcknowledgeableEvent as AcknowledgeableEvent, type index_BaseQueueConfig as BaseQueueConfig, type index_BulkEventPayload as BulkEventPayload, type index_ConsumerConfig as ConsumerConfig, type index_ConsumerOptions as ConsumerOptions, index_EntityEventRbacMetadata as EntityEventRbacMetadata, EntityEventType$1 as EntityEventType, type index_EventHandler as EventHandler, type EventMessage$1 as EventMessage, type index_EventMetadata as EventMetadata, index_EventPriority as EventPriority, index_EventQueueFactory as EventQueueFactory, type index_EventQueueHealthCheckResult as EventQueueHealthCheckResult, index_EventsModule as EventsModule, GraphEventEmitter$1 as GraphEventEmitter, index_GraphEventEmitterImpl as GraphEventEmitterImpl, type EventMessage as GraphQLEventMessage, type EventQueueHealthCheckResult as HealthCheckResult, type index_IEventConsumer as IEventConsumer, type index_IEventPublisher as IEventPublisher, type index_IEventQueue as IEventQueue, type index_ISubscription as ISubscription, index_MemoryEventBus as MemoryEventBus, index_MemoryEventConsumer as MemoryEventConsumer, index_MemoryEventPublisher as MemoryEventPublisher, index_MemoryEventQueue as MemoryEventQueue, type index_ModuleEventPayload as ModuleEventPayload, type index_ModuleEventsConfig as ModuleEventsConfig, index_ModuleEventsService as ModuleEventsService, type index_PublishEventOptions as PublishEventOptions, type index_PublishOptions as PublishOptions, type index_PublishResult as PublishResult, type index_PublisherConfig as PublisherConfig, type index_QueueStatistics as QueueStatistics, index_QueueType as QueueType, index_RedisStreamsConnection as RedisStreamsConnection, index_RedisStreamsEventConsumer as RedisStreamsEventConsumer, index_RedisStreamsEventPublisher as RedisStreamsEventPublisher, type index_StreamConfig as StreamConfig, type index_StreamInfo as StreamInfo, type index_SubscribeOptions as SubscribeOptions, type index_SubscriptionOptions as SubscriptionOptions, index_createConsumer as createConsumer, createGraphEventEmitter$1 as createGraphEventEmitter, index_createMemoryConsumer as createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, index_createMemoryPublisher as createMemoryPublisher, index_createModuleEventsService as createModuleEventsService, index_createPublisher as createPublisher, index_getGraphEventEmitter as getGraphEventEmitter, dlqKey as redisDlqKey, streamKey as redisStreamKey, index_resetGraphEventEmitter as resetGraphEventEmitter };
688
- }
689
-
690
- export { type AcknowledgeableEvent as A, type BaseQueueConfig as B, type ConsumerConfig as C, type SubscribeOptions as D, EventsModule as E, type SubscriptionOptions as F, createConsumer as G, createMemoryConsumer as H, type IEventPublisher as I, createGraphEventEmitter as J, createMemoryPublisher as K, createModuleEventsService as L, MemoryEventBus as M, createPublisher as N, dlqKey as O, type PublishEventOptions as P, type QueueStatistics as Q, RedisStreamsConnection as R, type StreamConfig as S, streamKey as T, type BulkEventPayload as a, type ConsumerOptions as b, type EventHandler as c, type EventMessage$1 as d, type EventMetadata as e, EventPriority as f, EventQueueFactory as g, type EventQueueHealthCheckResult as h, index as i, type EventMessage as j, type IEventConsumer as k, type IEventQueue as l, type ISubscription as m, MemoryEventConsumer as n, MemoryEventPublisher as o, MemoryEventQueue as p, type ModuleEventPayload as q, type ModuleEventsConfig as r, ModuleEventsService as s, type PublishOptions as t, type PublishResult as u, type PublisherConfig as v, QueueType as w, RedisStreamsEventConsumer as x, RedisStreamsEventPublisher as y, type StreamInfo as z };