@burdenoff/be-sdk 2026.716.2 → 2026.717.1

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 (60) hide show
  1. package/dist/EventQueueFactory-ELT7NDXK.js +7 -0
  2. package/dist/{EventQueueFactory-BDOT45WD.js.map → EventQueueFactory-ELT7NDXK.js.map} +1 -1
  3. package/dist/auth/index.d.ts +2 -2
  4. package/dist/cache/index.d.ts +2 -1
  5. package/dist/cache/index.js +2 -1
  6. package/dist/{chunk-M5JYRRI6.js → chunk-BWKRHVRX.js} +4 -4
  7. package/dist/{chunk-M5JYRRI6.js.map → chunk-BWKRHVRX.js.map} +1 -1
  8. package/dist/{chunk-IMMJMVP7.js → chunk-EQHHYSOE.js} +17 -4
  9. package/dist/chunk-EQHHYSOE.js.map +1 -0
  10. package/dist/{chunk-X5FPXATC.js → chunk-JAZ473V3.js} +3 -3
  11. package/dist/{chunk-X5FPXATC.js.map → chunk-JAZ473V3.js.map} +1 -1
  12. package/dist/{chunk-5ORHPLOA.js → chunk-JNJSSBKO.js} +19 -2
  13. package/dist/chunk-JNJSSBKO.js.map +1 -0
  14. package/dist/{chunk-CJCO3OWF.js → chunk-L4S54SIX.js} +53 -18
  15. package/dist/chunk-L4S54SIX.js.map +1 -0
  16. package/dist/{chunk-5A5GGMWK.js → chunk-NJ5GTICM.js} +71 -4
  17. package/dist/chunk-NJ5GTICM.js.map +1 -0
  18. package/dist/{chunk-DBIWNA72.js → chunk-Q3SO65JD.js} +2 -2
  19. package/dist/{chunk-DBIWNA72.js.map → chunk-Q3SO65JD.js.map} +1 -1
  20. package/dist/{chunk-A4TGVW5V.js → chunk-SBZ3UZ5J.js} +3 -3
  21. package/dist/{chunk-A4TGVW5V.js.map → chunk-SBZ3UZ5J.js.map} +1 -1
  22. package/dist/{chunk-OQ62HA7Z.js → chunk-URDYOM2L.js} +3 -3
  23. package/dist/{chunk-OQ62HA7Z.js.map → chunk-URDYOM2L.js.map} +1 -1
  24. package/dist/{chunk-YKY24YLZ.js → chunk-V4QNOY4E.js} +4 -4
  25. package/dist/{chunk-YKY24YLZ.js.map → chunk-V4QNOY4E.js.map} +1 -1
  26. package/dist/chunk-VBXPFYZ5.js +61 -0
  27. package/dist/chunk-VBXPFYZ5.js.map +1 -0
  28. package/dist/{chunk-A6WNRJZF.js → chunk-WFVLQELZ.js} +4 -4
  29. package/dist/{chunk-A6WNRJZF.js.map → chunk-WFVLQELZ.js.map} +1 -1
  30. package/dist/{client-u23M69Qt.d.ts → client-Dhi02YAf.d.ts} +5 -1
  31. package/dist/event-queue/index.d.ts +2 -1
  32. package/dist/event-queue/index.js +4 -3
  33. package/dist/export/index.js +3 -3
  34. package/dist/gateway/index.js +2 -2
  35. package/dist/gateway/security/index.js +1 -1
  36. package/dist/graph/index.d.ts +2 -2
  37. package/dist/graph/index.js +6 -5
  38. package/dist/{index-qg-t-NT2.d.ts → index-BfvCLSmh.d.ts} +4 -2
  39. package/dist/{index-2jyc-oTr.d.ts → index-CGTwU6CR.d.ts} +1 -1
  40. package/dist/{index-5QTY_V54.d.ts → index-CQGCVFmI.d.ts} +7 -2
  41. package/dist/{index-Zh4KQBM1.d.ts → index-CgTMsars.d.ts} +6 -1
  42. package/dist/index-CoMKgL-p.d.ts +12 -0
  43. package/dist/index.d.ts +10 -8
  44. package/dist/index.js +20 -16
  45. package/dist/index.js.map +1 -1
  46. package/dist/init/index.js +3 -3
  47. package/dist/lifecycle/index.d.ts +1 -0
  48. package/dist/lifecycle/index.js +5 -0
  49. package/dist/lifecycle/index.js.map +1 -0
  50. package/dist/prisma/index.d.ts +2 -2
  51. package/dist/prisma/index.js +5 -4
  52. package/dist/server/index.d.ts +3 -3
  53. package/dist/shutdown-registry-CW9LryO8.d.ts +10 -0
  54. package/dist/{types-De9M0Yin.d.ts → types-DYE90pls.d.ts} +1 -1
  55. package/package.json +3 -3
  56. package/dist/EventQueueFactory-BDOT45WD.js +0 -6
  57. package/dist/chunk-5A5GGMWK.js.map +0 -1
  58. package/dist/chunk-5ORHPLOA.js.map +0 -1
  59. package/dist/chunk-CJCO3OWF.js.map +0 -1
  60. package/dist/chunk-IMMJMVP7.js.map +0 -1
@@ -0,0 +1,61 @@
1
+ import { logger } from './chunk-CBZNP6RF.js';
2
+ import { __export, __name } from './chunk-XE4OXN2W.js';
3
+
4
+ // src/lifecycle/index.ts
5
+ var lifecycle_exports = {};
6
+ __export(lifecycle_exports, {
7
+ disposeAll: () => disposeAll,
8
+ getRegisteredDisposableCount: () => getRegisteredDisposableCount,
9
+ registerDisposable: () => registerDisposable,
10
+ unregisterDisposable: () => unregisterDisposable
11
+ });
12
+
13
+ // src/lifecycle/shutdown-registry.ts
14
+ var disposables = /* @__PURE__ */ new Set();
15
+ function registerDisposable(d) {
16
+ disposables.add(d);
17
+ }
18
+ __name(registerDisposable, "registerDisposable");
19
+ function unregisterDisposable(d) {
20
+ disposables.delete(d);
21
+ }
22
+ __name(unregisterDisposable, "unregisterDisposable");
23
+ function getRegisteredDisposableCount() {
24
+ return disposables.size;
25
+ }
26
+ __name(getRegisteredDisposableCount, "getRegisteredDisposableCount");
27
+ async function disposeOne(d, timeoutMs) {
28
+ let timer;
29
+ try {
30
+ await Promise.race([
31
+ Promise.resolve(d.dispose()),
32
+ new Promise((_, reject) => {
33
+ timer = setTimeout(() => reject(new Error(`dispose timeout after ${timeoutMs}ms`)), timeoutMs);
34
+ timer.unref?.();
35
+ })
36
+ ]);
37
+ } catch (err) {
38
+ logger.warn("[shutdown] disposable failed to close cleanly", {
39
+ name: d.shutdownName,
40
+ error: err instanceof Error ? err.message : String(err)
41
+ });
42
+ } finally {
43
+ if (timer) clearTimeout(timer);
44
+ }
45
+ }
46
+ __name(disposeOne, "disposeOne");
47
+ async function disposeAll(timeoutMs = 5e3) {
48
+ const current = Array.from(disposables);
49
+ disposables.clear();
50
+ if (current.length === 0) return;
51
+ logger.info("[shutdown] closing registered connections", {
52
+ count: current.length
53
+ });
54
+ await Promise.all(current.map((d) => disposeOne(d, timeoutMs)));
55
+ logger.info("[shutdown] registered connections closed");
56
+ }
57
+ __name(disposeAll, "disposeAll");
58
+
59
+ export { disposeAll, getRegisteredDisposableCount, lifecycle_exports, registerDisposable, unregisterDisposable };
60
+ //# sourceMappingURL=chunk-VBXPFYZ5.js.map
61
+ //# sourceMappingURL=chunk-VBXPFYZ5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lifecycle/index.ts","../src/lifecycle/shutdown-registry.ts"],"names":["disposables","Set","registerDisposable","d","add","unregisterDisposable","delete","getRegisteredDisposableCount","size","disposeOne","timeoutMs","timer","Promise","race","resolve","dispose","_","reject","setTimeout","Error","unref","err","logger","warn","name","shutdownName","error","message","String","disposeAll","current","Array","from","clear","length","info","count","all","map"],"mappings":";;;;AAAA,IAAA,iBAAA,GAAA;;;;;;;;;ACiCA,IAAMA,WAAAA,uBAAkBC,GAAAA,EAAAA;AAGjB,SAASC,mBAAmBC,CAAAA,EAAqB;AACtDH,EAAAA,WAAAA,CAAYI,IAAID,CAAAA,CAAAA;AAClB;AAFgBD,MAAAA,CAAAA,kBAAAA,EAAAA,oBAAAA,CAAAA;AAKT,SAASG,qBAAqBF,CAAAA,EAAqB;AACxDH,EAAAA,WAAAA,CAAYM,OAAOH,CAAAA,CAAAA;AACrB;AAFgBE,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA;AAKT,SAASE,4BAAAA,GAAAA;AACd,EAAA,OAAOP,WAAAA,CAAYQ,IAAAA;AACrB;AAFgBD,MAAAA,CAAAA,4BAAAA,EAAAA,8BAAAA,CAAAA;AAIhB,eAAeE,UAAAA,CAAWN,GAAuBO,SAAAA,EAAiB;AAChE,EAAA,IAAIC,KAAAA;AACJ,EAAA,IAAI;AACF,IAAA,MAAMC,QAAQC,IAAAA,CAAK;MACjBD,OAAAA,CAAQE,OAAAA,CAAQX,CAAAA,CAAEY,OAAAA,EAAO,CAAA;MACzB,IAAIH,OAAAA,CAAe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A,CAAAA","file":"chunk-VBXPFYZ5.js","sourcesContent":["export {\n registerDisposable,\n unregisterDisposable,\n getRegisteredDisposableCount,\n disposeAll,\n type ShutdownDisposable,\n} from './shutdown-registry.js';\n","/**\n * Process-wide graceful-shutdown registry.\n *\n * Long-lived connection holders — the Redis Streams event publisher/consumer\n * (ioredis) and the cache provider (valkey-glide) — open sockets that are not\n * owned by any single object the bootstrap/SDK can reach (services create them\n * via factories). Without an explicit close on SIGTERM, those sockets are only\n * torn down by the OS at `process.exit`, and any that are half-open or slow to\n * FIN linger server-side against the connection cap during churn (this is part\n * of what pinned wspace-prod Redis at its cap during a mass restart — see\n * BOFF-3073).\n *\n * Each holder registers itself here on creation/connect and unregisters on its\n * own disconnect. The bootstrap signal handler and the SDK `shutdown()` both\n * call `disposeAll()`, so every registered connection is closed deterministically\n * (each bounded by a timeout) before the process exits — regardless of how the\n * holder was constructed.\n */\nimport { logger } from '../logger/index.js';\n\n/**\n * A resource that holds long-lived connections and must be closed on graceful\n * shutdown. `dispose()` must be idempotent (it may be called after the resource\n * already disconnected itself) and should not throw — the registry logs and\n * swallows failures so shutdown always proceeds.\n */\nexport interface ShutdownDisposable {\n /** Human-readable label, used only for shutdown logging. */\n readonly shutdownName: string;\n /** Close the underlying connection(s). */\n dispose(): Promise<void> | void;\n}\n\nconst disposables = new Set<ShutdownDisposable>();\n\n/** Register a resource to be closed on graceful shutdown. Idempotent. */\nexport function registerDisposable(d: ShutdownDisposable): void {\n disposables.add(d);\n}\n\n/** Remove a resource from the registry (call after it disconnects itself). */\nexport function unregisterDisposable(d: ShutdownDisposable): void {\n disposables.delete(d);\n}\n\n/** Count of currently-registered disposables (diagnostics / tests). */\nexport function getRegisteredDisposableCount(): number {\n return disposables.size;\n}\n\nasync function disposeOne(d: ShutdownDisposable, timeoutMs: number): Promise<void> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n await Promise.race([\n Promise.resolve(d.dispose()),\n new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(new Error(`dispose timeout after ${timeoutMs}ms`)), timeoutMs);\n timer.unref?.();\n }),\n ]);\n } catch (err) {\n logger.warn('[shutdown] disposable failed to close cleanly', {\n name: d.shutdownName,\n error: err instanceof Error ? err.message : String(err),\n });\n } finally {\n if (timer) clearTimeout(timer);\n }\n}\n\n/**\n * Close every registered resource concurrently, each bounded by `timeoutMs`.\n * The registry is drained up front so concurrent or repeated calls (e.g. both\n * the bootstrap signal handler and an explicit SDK `shutdown()`) are safe — the\n * second call simply finds an empty registry. Never throws.\n */\nexport async function disposeAll(timeoutMs = 5000): Promise<void> {\n const current = Array.from(disposables);\n disposables.clear();\n if (current.length === 0) return;\n logger.info('[shutdown] closing registered connections', { count: current.length });\n await Promise.all(current.map((d) => disposeOne(d, timeoutMs)));\n logger.info('[shutdown] registered connections closed');\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { resetGraphEventEmitter, getGraphEventEmitter, createMemoryPublisher, createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter2, MemoryEventQueue, MemoryEventPublisher, MemoryEventConsumer, MemoryEventBus, GraphEventEmitterImpl } from './chunk-OQ62HA7Z.js';
2
- import { RedisStreamsEventPublisher, RedisStreamsEventConsumer, QueueType, EventQueueFactory } from './chunk-5ORHPLOA.js';
1
+ import { resetGraphEventEmitter, getGraphEventEmitter, createMemoryPublisher, createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter2, MemoryEventQueue, MemoryEventPublisher, MemoryEventConsumer, MemoryEventBus, GraphEventEmitterImpl } from './chunk-URDYOM2L.js';
2
+ import { RedisStreamsEventPublisher, RedisStreamsEventConsumer, QueueType, EventQueueFactory } from './chunk-JNJSSBKO.js';
3
3
  import { streamKey, dlqKey, RedisStreamsConnection } from './chunk-S7LWYERE.js';
4
4
  import { logger } from './chunk-CBZNP6RF.js';
5
5
  import { __export, __name } from './chunk-XE4OXN2W.js';
@@ -460,5 +460,5 @@ function createConsumer(stream, consumer) {
460
460
  __name(createConsumer, "createConsumer");
461
461
 
462
462
  export { EventPriority, EventsModule, ModuleEventsService, createConsumer, createModuleEventsService, createPublisher, event_queue_exports };
463
- //# sourceMappingURL=chunk-A6WNRJZF.js.map
464
- //# sourceMappingURL=chunk-A6WNRJZF.js.map
463
+ //# sourceMappingURL=chunk-WFVLQELZ.js.map
464
+ //# sourceMappingURL=chunk-WFVLQELZ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/event-queue/index.ts","../src/event-queue/module-events.ts","../src/event-queue/events.ts"],"names":["createGraphEventEmitter","ModuleEventsService","productSource","subjectPrefix","loggerLabel","publisher","connected","connecting","config","moduleName","charAt","toUpperCase","slice","process","env","EventQueueFactory","createPublisherFromEnv","logger","info","MemoryEventPublisher","ensureConnected","connect","then","publish","subject","payload","data","buildPayload","type","action","id","userId","tenantId","workspaceId","correlationId","metadata","timestamp","Date","toISOString","buildSubject","entityType","normalizedType","replace","_match","p1","offset","toLowerCase","publishCreated","publishUpdated","publishDeleted","publishCustom","publishBulkCreated","_entityType","items","close","disconnect","healthCheck","result","isHealthy","status","healthy","message","error","createModuleEventsService","EventPriority","EventsModule","client","context","createStream","name","subjects","options","debug","mutation","variables","input","maxMessages","maxBytes","maxAge","storageType","replicas","response","query","getStreamInfo","deleteStream","purgeStream","sequence","purgedCount","createConsumer","streamName","consumerName","queueGroup","durableName","startPosition","ackMode","maxDeliver","ackWait","deleteConsumer","ackMessage","nakMessage","getConsumerInfo","createPublisher","stream","consumer","createConsumerFromEnv","MemoryEventConsumer"],"mappings":";;;;;;;AAAA,IAAA,mBAAA,GAAA;;;;;;;;;;;;;;;;AAAAA,EAAAA,uBAAAA,EAAAA,MAAAA,wBAAAA;AAAA,EAAA,oBAAA,EAAA,MAAA,oBAAA;;;;;;;;;;;;ACsFO,IAAMC,sBAAN,MAAMA;EAtFb;;;AAuFmBC,EAAAA,aAAAA;AACAC,EAAAA,aAAAA;AACAC,EAAAA,WAAAA;AACTC,EAAAA,SAAAA;EACAC,SAAAA,GAAY,KA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A,CAAAA;AACzC;AALgBf,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA","file":"chunk-A6WNRJZF.js","sourcesContent":["/**\n * Event Queue - Public API\n *\n * This module provides a complete abstraction over event queue systems (NATS, RabbitMQ, Kafka, SQS, etc.)\n * allowing the application to publish and consume events without direct dependency on any specific queue implementation.\n *\n * Usage:\n *\n * // Publishing events (workspaces-backend)\n * import { createPublisher } from './utils/event-queue';\n *\n * const publisher = createPublisher();\n * await publisher.connect();\n *\n * await publisher.publish({\n * subject: 'workspace.created',\n * data: { workspaceId: '123', name: 'My Workspace' },\n * metadata: { userId: 'user-123', source: 'api' }\n * });\n *\n * // Consuming events (workspaces-workers)\n * import { createConsumer } from './core/event-queue';\n *\n * const consumer = createConsumer('WORKSPACE_EVENTS', 'workspace-consumer');\n * await consumer.connect();\n *\n * await consumer.subscribe({\n * subject: 'workspace.*',\n * handler: async (event) => {\n * logger.log('Received event:', event.data);\n * await event.ack();\n * }\n * });\n */\n// Import factory for use in convenience functions\nimport { EventQueueFactory } from './factory/EventQueueFactory.js';\n// Import implementations for use in convenience functions\nimport { MemoryEventPublisher, MemoryEventConsumer } from './implementations/memory/MemoryEventQueue.js';\n// Import interfaces for type annotations\nimport type { IEventConsumer } from './interfaces/IEventConsumer.js';\nimport type { IEventPublisher } from './interfaces/IEventPublisher.js';\n\n// Export interfaces\nexport type { IEventQueue } from './interfaces/IEventQueue.js';\nexport type { IEventPublisher, PublishOptions } from './interfaces/IEventPublisher.js';\nexport type { IEventConsumer, ISubscription } from './interfaces/IEventConsumer.js';\n\n// Export types\nexport type {\n EventMessage,\n EventMetadata,\n AcknowledgeableEvent,\n EventHandler,\n StreamConfig,\n SubscriptionOptions,\n ConsumerOptions,\n} from './types/events.js';\n\nexport { QueueType } from './types/config.js';\n\nexport type {\n BaseQueueConfig,\n PublisherConfig,\n ConsumerConfig,\n EventQueueHealthCheckResult,\n QueueStatistics,\n} from './types/config.js';\n\n// Backwards compatibility alias\nexport type { EventQueueHealthCheckResult as HealthCheckResult } from './types/config.js';\n\n// Export factory\nexport { EventQueueFactory } from './factory/EventQueueFactory.js';\n\n// Export Redis Streams implementations\nexport {\n RedisStreamsEventPublisher,\n RedisStreamsEventConsumer,\n RedisStreamsConnection,\n streamKey as redisStreamKey,\n dlqKey as redisDlqKey,\n} from './implementations/redis-streams/index.js';\n\n// Export Memory implementations (for development/testing or fallback)\nexport {\n MemoryEventBus,\n MemoryEventQueue,\n MemoryEventPublisher,\n MemoryEventConsumer,\n createMemoryPublisher,\n createMemoryConsumer,\n createGraphEventEmitter as createMemoryGraphEventEmitter,\n} from './implementations/memory/MemoryEventQueue.js';\n\n// Export Graph Event Emitter (Redis Streams-backed).\nexport {\n GraphEventEmitterImpl,\n getGraphEventEmitter,\n createGraphEventEmitter,\n resetGraphEventEmitter,\n} from './graph-emitter.js';\nexport type { GraphEventEmitter, EntityEventType, EntityEventRbacMetadata } from './graph-emitter.js';\n\n// Export Module Events Service\nexport { ModuleEventsService, createModuleEventsService } from './module-events.js';\nexport type { ModuleEventPayload, BulkEventPayload, ModuleEventsConfig } from './module-events.js';\n\n// Export high-level Events Module (GraphQL-based event publishing)\nexport { EventsModule } from './events.js';\nexport {\n EventPriority,\n type PublishEventOptions,\n type SubscribeOptions,\n type EventMessage as GraphQLEventMessage,\n type PublishResult,\n type StreamInfo,\n} from './events.js';\n\n/**\n * Create an event publisher from environment configuration.\n *\n * Backend resolution:\n * - `REDIS_URL` set → Redis Streams (the only supported backend since\n * the NATS retirement on 2026-05-16).\n * - `REDIS_URL` unset → in-memory (dev/test fallback).\n */\nexport function createPublisher(): IEventPublisher {\n if (process.env['REDIS_URL']) {\n return EventQueueFactory.createPublisherFromEnv();\n }\n return new MemoryEventPublisher();\n}\n\n/**\n * Create an event consumer from environment configuration.\n */\nexport function createConsumer(stream: string, consumer: string): IEventConsumer {\n if (process.env['REDIS_URL']) {\n return EventQueueFactory.createConsumerFromEnv(stream, consumer);\n }\n return new MemoryEventConsumer(stream, consumer);\n}\n","/**\n * Module Events Service\n *\n * Generic event publishing service that modules can configure to publish\n * domain-specific events to NATS JetStream.\n *\n * @module event-queue/module-events\n * @category Events\n *\n * @example\n * ```typescript\n * import { createModuleEventsService } from '@burdenoff/be-sdk/event-queue';\n *\n * // Create a configured event service for the tags module\n * const tagsEventsService = createModuleEventsService({\n * moduleName: 'tags',\n * entityTypes: ['Tag', 'Vocabulary', 'Assignment'],\n * });\n *\n * // Publish events\n * await tagsEventsService.publishCreated('Tag', tagId, tagData, userId);\n * await tagsEventsService.publishUpdated('Vocabulary', vocabId, vocabData, userId);\n * ```\n */\nimport { logger } from '../logger/index.js';\nimport type { IEventPublisher } from './interfaces/IEventPublisher.js';\nimport { MemoryEventPublisher } from './implementations/memory/MemoryEventQueue.js';\nimport { EventQueueFactory } from './factory/EventQueueFactory.js';\n\n/**\n * Event payload structure for module events\n */\nexport interface ModuleEventPayload {\n /** Entity ID */\n id: string;\n /** Entity type (e.g., 'UniversalTag', 'UniversalTagVocabulary') */\n type: string;\n /** Action performed */\n action: 'created' | 'updated' | 'deleted' | 'assigned' | 'removed' | string;\n /** Entity data */\n data: Record<string, unknown>;\n /** Event metadata */\n metadata: {\n tenantId?: string;\n workspaceId?: string;\n userId: string;\n timestamp: string;\n productSource: string;\n correlationId?: string;\n };\n}\n\n/**\n * Bulk event payload structure\n */\nexport interface BulkEventPayload {\n /** Items in the bulk operation */\n items: Array<{ id: string; data: Record<string, unknown> }>;\n /** Event metadata */\n metadata: {\n tenantId?: string;\n workspaceId?: string;\n userId: string;\n timestamp: string;\n productSource: string;\n };\n}\n\n/**\n * Configuration for module events service\n */\nexport interface ModuleEventsConfig {\n /** Module name (used as productSource and in subject prefixes) */\n moduleName: string;\n /** Subject prefix override (defaults to moduleName) */\n subjectPrefix?: string;\n /** Custom logger label */\n loggerLabel?: string;\n}\n\n/**\n * Generic Module Events Service\n *\n * Provides a consistent interface for publishing domain events across all modules.\n * Automatically falls back to in-memory publisher when NATS is not configured.\n */\nexport class ModuleEventsService {\n private readonly productSource: string;\n private readonly subjectPrefix: string;\n private readonly loggerLabel: string;\n private publisher: IEventPublisher;\n private connected = false;\n private connecting: Promise<void> | null = null;\n\n constructor(config: ModuleEventsConfig) {\n this.productSource = config.moduleName;\n this.subjectPrefix = config.subjectPrefix || config.moduleName;\n this.loggerLabel =\n config.loggerLabel || `${config.moduleName.charAt(0).toUpperCase()}${config.moduleName.slice(1)}EventsService`;\n\n // Initialize publisher based on environment\n if (process.env['REDIS_URL']) {\n this.publisher = EventQueueFactory.createPublisherFromEnv();\n logger.info(`[${this.loggerLabel}] Using Redis Streams publisher`);\n } else {\n this.publisher = new MemoryEventPublisher();\n logger.info(`[${this.loggerLabel}] Using in-memory publisher (REDIS_URL not configured)`);\n }\n }\n\n /**\n * Ensure publisher is connected before publishing\n */\n private async ensureConnected(): Promise<void> {\n if (this.connected) {\n return;\n }\n\n if (this.connecting) {\n await this.connecting;\n return;\n }\n\n this.connecting = this.publisher.connect().then(() => {\n this.connected = true;\n this.connecting = null;\n logger.info(`[${this.loggerLabel}] Publisher connected`);\n });\n\n await this.connecting;\n }\n\n /**\n * Publish an event to the queue\n */\n private async publish(subject: string, payload: unknown): Promise<void> {\n await this.ensureConnected();\n await this.publisher.publish({\n subject,\n data: payload as Record<string, unknown>,\n });\n }\n\n /**\n * Build event payload\n */\n private buildPayload(\n type: string,\n action: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string,\n correlationId?: string\n ): ModuleEventPayload {\n return {\n id,\n type,\n action,\n data,\n metadata: {\n tenantId,\n workspaceId,\n userId,\n timestamp: new Date().toISOString(),\n productSource: this.productSource,\n ...(correlationId && { correlationId }),\n },\n };\n }\n\n /**\n * Build subject string\n */\n private buildSubject(entityType: string, action: string): string {\n // Convert entityType from PascalCase to lowercase (e.g., UniversalTag -> tag)\n const normalizedType = entityType\n .replace(/^Universal/, '')\n .replace(/([A-Z])/g, (_match, p1, offset) => (offset > 0 ? '_' : '') + (p1 as string).toLowerCase())\n .replace(/^_/, '');\n return `${this.subjectPrefix}.${normalizedType}.${action}`;\n }\n\n /**\n * Publish entity created event\n */\n async publishCreated(\n entityType: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'created', id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'created'), payload);\n }\n\n /**\n * Publish entity updated event\n */\n async publishUpdated(\n entityType: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'updated', id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'updated'), payload);\n }\n\n /**\n * Publish entity deleted event\n */\n async publishDeleted(\n entityType: string,\n id: string,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'deleted', id, {}, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'deleted'), payload);\n }\n\n /**\n * Publish custom action event\n */\n async publishCustom(\n entityType: string,\n action: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, action, id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, action), payload);\n }\n\n /**\n * Publish bulk created event\n */\n async publishBulkCreated(\n _entityType: string,\n items: Array<{ id: string; data: Record<string, unknown> }>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload: BulkEventPayload = {\n items,\n metadata: {\n tenantId,\n workspaceId,\n userId,\n timestamp: new Date().toISOString(),\n productSource: this.productSource,\n },\n };\n await this.publish(`${this.subjectPrefix}.bulk.created`, payload);\n }\n\n /**\n * Close event queue connection\n */\n async close(): Promise<void> {\n if (this.connected) {\n await this.publisher.disconnect();\n this.connected = false;\n logger.info(`[${this.loggerLabel}] Publisher disconnected`);\n }\n }\n\n /**\n * Get health check status\n */\n async healthCheck(): Promise<{ healthy: boolean; message: string }> {\n const result = await this.publisher.healthCheck();\n const isHealthy = result.status === 'healthy';\n return {\n healthy: isHealthy,\n message: result.error || (isHealthy ? 'Healthy' : 'Unhealthy'),\n };\n }\n}\n\n/**\n * Create a module events service instance\n */\nexport function createModuleEventsService(config: ModuleEventsConfig): ModuleEventsService {\n return new ModuleEventsService(config);\n}\n","/**\n * Events Module\n * Helpers for sending events to the Redis Streams event queue\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { logger } from '../logger/index.js';\n\nexport enum EventPriority {\n LOW = 'low',\n NORMAL = 'normal',\n HIGH = 'high',\n CRITICAL = 'critical',\n}\n\nexport interface PublishEventOptions {\n /** Event subject/topic */\n subject: string;\n /** Event payload */\n data: Record<string, unknown>;\n /** Event priority */\n priority?: EventPriority;\n /** Event metadata */\n metadata?: Record<string, unknown>;\n /** Delay delivery by milliseconds */\n delay?: number;\n /** Message ID (for deduplication) */\n messageId?: string;\n /** Workspace context */\n workspaceId?: string;\n /** Organization context */\n organizationId?: string;\n}\n\nexport interface SubscribeOptions {\n /** Subject pattern to subscribe to */\n subject: string;\n /** Queue group name */\n queueGroup?: string;\n /** Durable consumer name */\n durableName?: string;\n /** Start from specific position */\n startPosition?: 'first' | 'last' | 'new';\n /** Acknowledge mode */\n ackMode?: 'explicit' | 'auto';\n /** Max messages to deliver */\n maxDeliver?: number;\n /** Acknowledgment timeout in milliseconds */\n ackWait?: number;\n}\n\nexport interface EventMessage {\n id: string;\n subject: string;\n data: Record<string, unknown>;\n priority: EventPriority;\n metadata?: Record<string, unknown>;\n workspaceId?: string;\n organizationId?: string;\n publishedAt: string;\n publishedBy?: string;\n}\n\nexport interface PublishResult {\n messageId: string;\n subject: string;\n sequence: number;\n timestamp: string;\n}\n\nexport interface StreamInfo {\n name: string;\n subjects: string[];\n messageCount: number;\n byteCount: number;\n firstSequence: number;\n lastSequence: number;\n consumerCount: number;\n}\n\n/**\n * Events Module\n */\nexport class EventsModule {\n constructor(\n private client: BurdenoffGraphQLClient,\n private context: SDKContext\n ) {}\n\n /**\n * Create stream\n */\n public async createStream(\n name: string,\n subjects: string[],\n options?: {\n maxMessages?: number;\n maxBytes?: number;\n maxAge?: number;\n storageType?: 'file' | 'memory';\n replicas?: number;\n }\n ): Promise<StreamInfo> {\n logger.debug('[Events] Creating stream', { name, subjects });\n\n const mutation = `\n mutation CreateStream($input: CreateStreamInput!) {\n createStream(input: $input) {\n name\n subjects\n messageCount\n byteCount\n firstSequence\n lastSequence\n consumerCount\n }\n }\n `;\n\n const variables = {\n input: {\n name,\n subjects,\n maxMessages: options?.maxMessages,\n maxBytes: options?.maxBytes,\n maxAge: options?.maxAge,\n storageType: options?.storageType || 'file',\n replicas: options?.replicas || 1,\n },\n };\n\n const response = await this.client.query<{ createStream: StreamInfo }>(mutation, variables, this.context);\n\n logger.info('[Events] Stream created', { name });\n\n return response.createStream;\n }\n\n /**\n * Get stream info\n */\n public async getStreamInfo(name: string): Promise<StreamInfo> {\n logger.debug('[Events] Getting stream info', { name });\n\n const query = `\n query GetStreamInfo($name: String!) {\n getStreamInfo(name: $name) {\n name\n subjects\n messageCount\n byteCount\n firstSequence\n lastSequence\n consumerCount\n }\n }\n `;\n\n const response = await this.client.query<{ getStreamInfo: StreamInfo }>(query, { name }, this.context);\n\n return response.getStreamInfo;\n }\n\n /**\n * Delete stream\n */\n public async deleteStream(name: string): Promise<boolean> {\n logger.debug('[Events] Deleting stream', { name });\n\n const mutation = `\n mutation DeleteStream($name: String!) {\n deleteStream(name: $name) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { name }, this.context);\n\n logger.info('[Events] Stream deleted', { name });\n\n return true;\n }\n\n /**\n * Purge stream messages\n */\n public async purgeStream(name: string, options?: { subject?: string; sequence?: number }): Promise<number> {\n logger.debug('[Events] Purging stream', { name, options });\n\n const mutation = `\n mutation PurgeStream($name: String!, $subject: String, $sequence: Int) {\n purgeStream(name: $name, subject: $subject, sequence: $sequence) {\n purgedCount\n }\n }\n `;\n\n const response = await this.client.query<{ purgeStream: { purgedCount: number } }>(\n mutation,\n { name, subject: options?.subject, sequence: options?.sequence },\n this.context\n );\n\n logger.info('[Events] Stream purged', { name, purgedCount: response.purgeStream.purgedCount });\n\n return response.purgeStream.purgedCount;\n }\n\n /**\n * Create consumer\n */\n public async createConsumer(\n streamName: string,\n consumerName: string,\n options: SubscribeOptions\n ): Promise<{ name: string; pending: number }> {\n logger.debug('[Events] Creating consumer', { streamName, consumerName });\n\n const mutation = `\n mutation CreateConsumer($input: CreateConsumerInput!) {\n createConsumer(input: $input) {\n name\n pending\n }\n }\n `;\n\n const variables = {\n input: {\n streamName,\n consumerName,\n subject: options.subject,\n queueGroup: options.queueGroup,\n durableName: options.durableName,\n startPosition: options.startPosition || 'last',\n ackMode: options.ackMode || 'explicit',\n maxDeliver: options.maxDeliver || 5,\n ackWait: options.ackWait || 30000,\n },\n };\n\n const response = await this.client.query<{ createConsumer: { name: string; pending: number } }>(\n mutation,\n variables,\n this.context\n );\n\n logger.info('[Events] Consumer created', { consumerName });\n\n return response.createConsumer;\n }\n\n /**\n * Delete consumer\n */\n public async deleteConsumer(streamName: string, consumerName: string): Promise<boolean> {\n logger.debug('[Events] Deleting consumer', { streamName, consumerName });\n\n const mutation = `\n mutation DeleteConsumer($streamName: String!, $consumerName: String!) {\n deleteConsumer(streamName: $streamName, consumerName: $consumerName) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName }, this.context);\n\n logger.info('[Events] Consumer deleted', { consumerName });\n\n return true;\n }\n\n /**\n * Acknowledge message\n */\n public async ackMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean> {\n logger.debug('[Events] Acknowledging message', { streamName, consumerName, sequence });\n\n const mutation = `\n mutation AckMessage($streamName: String!, $consumerName: String!, $sequence: Int!) {\n ackMessage(streamName: $streamName, consumerName: $consumerName, sequence: $sequence) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName, sequence }, this.context);\n\n return true;\n }\n\n /**\n * Negative acknowledge message (requeue)\n */\n public async nakMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean> {\n logger.debug('[Events] Negative acknowledging message', { streamName, consumerName, sequence });\n\n const mutation = `\n mutation NakMessage($streamName: String!, $consumerName: String!, $sequence: Int!) {\n nakMessage(streamName: $streamName, consumerName: $consumerName, sequence: $sequence) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName, sequence }, this.context);\n\n return true;\n }\n\n /**\n * Get consumer info\n */\n public async getConsumerInfo(\n streamName: string,\n consumerName: string\n ): Promise<{\n name: string;\n pending: number;\n redelivered: number;\n numAckPending: number;\n }> {\n logger.debug('[Events] Getting consumer info', { streamName, consumerName });\n\n const query = `\n query GetConsumerInfo($streamName: String!, $consumerName: String!) {\n getConsumerInfo(streamName: $streamName, consumerName: $consumerName) {\n name\n pending\n redelivered\n numAckPending\n }\n }\n `;\n\n const response = await this.client.query<{\n getConsumerInfo: {\n name: string;\n pending: number;\n redelivered: number;\n numAckPending: number;\n };\n }>(query, { streamName, consumerName }, this.context);\n\n return response.getConsumerInfo;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/event-queue/index.ts","../src/event-queue/module-events.ts","../src/event-queue/events.ts"],"names":["createGraphEventEmitter","ModuleEventsService","productSource","subjectPrefix","loggerLabel","publisher","connected","connecting","config","moduleName","charAt","toUpperCase","slice","process","env","EventQueueFactory","createPublisherFromEnv","logger","info","MemoryEventPublisher","ensureConnected","connect","then","publish","subject","payload","data","buildPayload","type","action","id","userId","tenantId","workspaceId","correlationId","metadata","timestamp","Date","toISOString","buildSubject","entityType","normalizedType","replace","_match","p1","offset","toLowerCase","publishCreated","publishUpdated","publishDeleted","publishCustom","publishBulkCreated","_entityType","items","close","disconnect","healthCheck","result","isHealthy","status","healthy","message","error","createModuleEventsService","EventPriority","EventsModule","client","context","createStream","name","subjects","options","debug","mutation","variables","input","maxMessages","maxBytes","maxAge","storageType","replicas","response","query","getStreamInfo","deleteStream","purgeStream","sequence","purgedCount","createConsumer","streamName","consumerName","queueGroup","durableName","startPosition","ackMode","maxDeliver","ackWait","deleteConsumer","ackMessage","nakMessage","getConsumerInfo","createPublisher","stream","consumer","createConsumerFromEnv","MemoryEventConsumer"],"mappings":";;;;;;;AAAA,IAAA,mBAAA,GAAA;;;;;;;;;;;;;;;;AAAAA,EAAAA,uBAAAA,EAAAA,MAAAA,wBAAAA;AAAA,EAAA,oBAAA,EAAA,MAAA,oBAAA;;;;;;;;;;;;ACsFO,IAAMC,sBAAN,MAAMA;EAtFb;;;AAuFmBC,EAAAA,aAAAA;AACAC,EAAAA,aAAAA;AACAC,EAAAA,WAAAA;AACTC,EAAAA,SAAAA;EACAC,SAAAA,GAAY,KAAA;EACZC,UAAAA,GAAmC,IAAA;AAE3C,EAAA,WAAA,CAAYC,MAAAA,EAA4B;AACtC,IAAA,IAAA,CAAKN,gBAAgBM,MAAAA,CAAOC,UAAAA;AAC5B,IAAA,IAAA,CAAKN,aAAAA,GAAgBK,MAAAA,CAAOL,aAAAA,IAAiBK,MAAAA,CAAOC,UAAAA;AACpD,IAAA,IAAA,CAAKL,cACHI,MAAAA,CAAOJ,WAAAA,IAAe,CAAA,EAAGI,MAAAA,CAAOC,WAAWC,MAAAA,CAAO,CAAA,CAAA,CAAGC,WAAAA,EAAW,CAAA,EAAKH,MAAAA,CAAOC,UAAAA,CAAWG,KAAAA,CAAM,CAAA,CAAA,CAAA,aAAA,CAAA;AAG/F,IAAA,IAAIC,OAAAA,CAAQC,GAAAA,CAAI,WAAA,CAAA,EAAc;AAC5B,MAAA,IAAA,CAAKT,SAAAA,GAAYU,kBAAkBC,sBAAAA,EAAsB;AACzDC,MAAAA,MAAAA,CAAOC,IAAAA,CAAK,CAAA,CAAA,EAAI,IAAA,CAAKd,WAAW,CAAA,+BAAA,CAAiC,C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AASmB,eAAAA;AAClB,EAAA;AACF;;;AF/NO,SAASC,eAAAA,GAAAA;AACd,EAAA,IAAIxF,OAAAA,CAAQC,GAAAA,CAAI,WAAA,CAAA,EAAc;AAC5B,IAAA,OAAOC,kBAAkBC,sBAAAA,EAAsB;AACjD,EAAA;AACA,EAAA,OAAO,IAAIG,oBAAAA,EAAAA;AACb;AALgBkF,MAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA;AAUT,SAASb,cAAAA,CAAec,QAAgBC,QAAAA,EAAgB;AAC7D,EAAA,IAAI1F,OAAAA,CAAQC,GAAAA,CAAI,WAAA,CAAA,EAAc;AAC5B,IAAA,OAAOC,iBAAAA,CAAkByF,qBAAAA,CAAsBF,MAAAA,EAAQC,QAAAA,CAAAA;AACzD,EAAA;AACA,EAAA,OAAO,IAAIE,mBAAAA,CAAoBH,MAAAA,EAAQC,QAAAA,CAAAA;AACzC;AALgBf,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA","file":"chunk-WFVLQELZ.js","sourcesContent":["/**\n * Event Queue - Public API\n *\n * This module provides a complete abstraction over event queue systems (NATS, RabbitMQ, Kafka, SQS, etc.)\n * allowing the application to publish and consume events without direct dependency on any specific queue implementation.\n *\n * Usage:\n *\n * // Publishing events (workspaces-backend)\n * import { createPublisher } from './utils/event-queue';\n *\n * const publisher = createPublisher();\n * await publisher.connect();\n *\n * await publisher.publish({\n * subject: 'workspace.created',\n * data: { workspaceId: '123', name: 'My Workspace' },\n * metadata: { userId: 'user-123', source: 'api' }\n * });\n *\n * // Consuming events (workspaces-workers)\n * import { createConsumer } from './core/event-queue';\n *\n * const consumer = createConsumer('WORKSPACE_EVENTS', 'workspace-consumer');\n * await consumer.connect();\n *\n * await consumer.subscribe({\n * subject: 'workspace.*',\n * handler: async (event) => {\n * logger.log('Received event:', event.data);\n * await event.ack();\n * }\n * });\n */\n// Import factory for use in convenience functions\nimport { EventQueueFactory } from './factory/EventQueueFactory.js';\n// Import implementations for use in convenience functions\nimport { MemoryEventPublisher, MemoryEventConsumer } from './implementations/memory/MemoryEventQueue.js';\n// Import interfaces for type annotations\nimport type { IEventConsumer } from './interfaces/IEventConsumer.js';\nimport type { IEventPublisher } from './interfaces/IEventPublisher.js';\n\n// Export interfaces\nexport type { IEventQueue } from './interfaces/IEventQueue.js';\nexport type { IEventPublisher, PublishOptions } from './interfaces/IEventPublisher.js';\nexport type { IEventConsumer, ISubscription } from './interfaces/IEventConsumer.js';\n\n// Export types\nexport type {\n EventMessage,\n EventMetadata,\n AcknowledgeableEvent,\n EventHandler,\n StreamConfig,\n SubscriptionOptions,\n ConsumerOptions,\n} from './types/events.js';\n\nexport { QueueType } from './types/config.js';\n\nexport type {\n BaseQueueConfig,\n PublisherConfig,\n ConsumerConfig,\n EventQueueHealthCheckResult,\n QueueStatistics,\n} from './types/config.js';\n\n// Backwards compatibility alias\nexport type { EventQueueHealthCheckResult as HealthCheckResult } from './types/config.js';\n\n// Export factory\nexport { EventQueueFactory } from './factory/EventQueueFactory.js';\n\n// Export Redis Streams implementations\nexport {\n RedisStreamsEventPublisher,\n RedisStreamsEventConsumer,\n RedisStreamsConnection,\n streamKey as redisStreamKey,\n dlqKey as redisDlqKey,\n} from './implementations/redis-streams/index.js';\n\n// Export Memory implementations (for development/testing or fallback)\nexport {\n MemoryEventBus,\n MemoryEventQueue,\n MemoryEventPublisher,\n MemoryEventConsumer,\n createMemoryPublisher,\n createMemoryConsumer,\n createGraphEventEmitter as createMemoryGraphEventEmitter,\n} from './implementations/memory/MemoryEventQueue.js';\n\n// Export Graph Event Emitter (Redis Streams-backed).\nexport {\n GraphEventEmitterImpl,\n getGraphEventEmitter,\n createGraphEventEmitter,\n resetGraphEventEmitter,\n} from './graph-emitter.js';\nexport type { GraphEventEmitter, EntityEventType, EntityEventRbacMetadata } from './graph-emitter.js';\n\n// Export Module Events Service\nexport { ModuleEventsService, createModuleEventsService } from './module-events.js';\nexport type { ModuleEventPayload, BulkEventPayload, ModuleEventsConfig } from './module-events.js';\n\n// Export high-level Events Module (GraphQL-based event publishing)\nexport { EventsModule } from './events.js';\nexport {\n EventPriority,\n type PublishEventOptions,\n type SubscribeOptions,\n type EventMessage as GraphQLEventMessage,\n type PublishResult,\n type StreamInfo,\n} from './events.js';\n\n/**\n * Create an event publisher from environment configuration.\n *\n * Backend resolution:\n * - `REDIS_URL` set → Redis Streams (the only supported backend since\n * the NATS retirement on 2026-05-16).\n * - `REDIS_URL` unset → in-memory (dev/test fallback).\n */\nexport function createPublisher(): IEventPublisher {\n if (process.env['REDIS_URL']) {\n return EventQueueFactory.createPublisherFromEnv();\n }\n return new MemoryEventPublisher();\n}\n\n/**\n * Create an event consumer from environment configuration.\n */\nexport function createConsumer(stream: string, consumer: string): IEventConsumer {\n if (process.env['REDIS_URL']) {\n return EventQueueFactory.createConsumerFromEnv(stream, consumer);\n }\n return new MemoryEventConsumer(stream, consumer);\n}\n","/**\n * Module Events Service\n *\n * Generic event publishing service that modules can configure to publish\n * domain-specific events to NATS JetStream.\n *\n * @module event-queue/module-events\n * @category Events\n *\n * @example\n * ```typescript\n * import { createModuleEventsService } from '@burdenoff/be-sdk/event-queue';\n *\n * // Create a configured event service for the tags module\n * const tagsEventsService = createModuleEventsService({\n * moduleName: 'tags',\n * entityTypes: ['Tag', 'Vocabulary', 'Assignment'],\n * });\n *\n * // Publish events\n * await tagsEventsService.publishCreated('Tag', tagId, tagData, userId);\n * await tagsEventsService.publishUpdated('Vocabulary', vocabId, vocabData, userId);\n * ```\n */\nimport { logger } from '../logger/index.js';\nimport type { IEventPublisher } from './interfaces/IEventPublisher.js';\nimport { MemoryEventPublisher } from './implementations/memory/MemoryEventQueue.js';\nimport { EventQueueFactory } from './factory/EventQueueFactory.js';\n\n/**\n * Event payload structure for module events\n */\nexport interface ModuleEventPayload {\n /** Entity ID */\n id: string;\n /** Entity type (e.g., 'UniversalTag', 'UniversalTagVocabulary') */\n type: string;\n /** Action performed */\n action: 'created' | 'updated' | 'deleted' | 'assigned' | 'removed' | string;\n /** Entity data */\n data: Record<string, unknown>;\n /** Event metadata */\n metadata: {\n tenantId?: string;\n workspaceId?: string;\n userId: string;\n timestamp: string;\n productSource: string;\n correlationId?: string;\n };\n}\n\n/**\n * Bulk event payload structure\n */\nexport interface BulkEventPayload {\n /** Items in the bulk operation */\n items: Array<{ id: string; data: Record<string, unknown> }>;\n /** Event metadata */\n metadata: {\n tenantId?: string;\n workspaceId?: string;\n userId: string;\n timestamp: string;\n productSource: string;\n };\n}\n\n/**\n * Configuration for module events service\n */\nexport interface ModuleEventsConfig {\n /** Module name (used as productSource and in subject prefixes) */\n moduleName: string;\n /** Subject prefix override (defaults to moduleName) */\n subjectPrefix?: string;\n /** Custom logger label */\n loggerLabel?: string;\n}\n\n/**\n * Generic Module Events Service\n *\n * Provides a consistent interface for publishing domain events across all modules.\n * Automatically falls back to in-memory publisher when NATS is not configured.\n */\nexport class ModuleEventsService {\n private readonly productSource: string;\n private readonly subjectPrefix: string;\n private readonly loggerLabel: string;\n private publisher: IEventPublisher;\n private connected = false;\n private connecting: Promise<void> | null = null;\n\n constructor(config: ModuleEventsConfig) {\n this.productSource = config.moduleName;\n this.subjectPrefix = config.subjectPrefix || config.moduleName;\n this.loggerLabel =\n config.loggerLabel || `${config.moduleName.charAt(0).toUpperCase()}${config.moduleName.slice(1)}EventsService`;\n\n // Initialize publisher based on environment\n if (process.env['REDIS_URL']) {\n this.publisher = EventQueueFactory.createPublisherFromEnv();\n logger.info(`[${this.loggerLabel}] Using Redis Streams publisher`);\n } else {\n this.publisher = new MemoryEventPublisher();\n logger.info(`[${this.loggerLabel}] Using in-memory publisher (REDIS_URL not configured)`);\n }\n }\n\n /**\n * Ensure publisher is connected before publishing\n */\n private async ensureConnected(): Promise<void> {\n if (this.connected) {\n return;\n }\n\n if (this.connecting) {\n await this.connecting;\n return;\n }\n\n this.connecting = this.publisher.connect().then(() => {\n this.connected = true;\n this.connecting = null;\n logger.info(`[${this.loggerLabel}] Publisher connected`);\n });\n\n await this.connecting;\n }\n\n /**\n * Publish an event to the queue\n */\n private async publish(subject: string, payload: unknown): Promise<void> {\n await this.ensureConnected();\n await this.publisher.publish({\n subject,\n data: payload as Record<string, unknown>,\n });\n }\n\n /**\n * Build event payload\n */\n private buildPayload(\n type: string,\n action: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string,\n correlationId?: string\n ): ModuleEventPayload {\n return {\n id,\n type,\n action,\n data,\n metadata: {\n tenantId,\n workspaceId,\n userId,\n timestamp: new Date().toISOString(),\n productSource: this.productSource,\n ...(correlationId && { correlationId }),\n },\n };\n }\n\n /**\n * Build subject string\n */\n private buildSubject(entityType: string, action: string): string {\n // Convert entityType from PascalCase to lowercase (e.g., UniversalTag -> tag)\n const normalizedType = entityType\n .replace(/^Universal/, '')\n .replace(/([A-Z])/g, (_match, p1, offset) => (offset > 0 ? '_' : '') + (p1 as string).toLowerCase())\n .replace(/^_/, '');\n return `${this.subjectPrefix}.${normalizedType}.${action}`;\n }\n\n /**\n * Publish entity created event\n */\n async publishCreated(\n entityType: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'created', id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'created'), payload);\n }\n\n /**\n * Publish entity updated event\n */\n async publishUpdated(\n entityType: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'updated', id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'updated'), payload);\n }\n\n /**\n * Publish entity deleted event\n */\n async publishDeleted(\n entityType: string,\n id: string,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, 'deleted', id, {}, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, 'deleted'), payload);\n }\n\n /**\n * Publish custom action event\n */\n async publishCustom(\n entityType: string,\n action: string,\n id: string,\n data: Record<string, unknown>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload = this.buildPayload(entityType, action, id, data, userId, tenantId, workspaceId);\n await this.publish(this.buildSubject(entityType, action), payload);\n }\n\n /**\n * Publish bulk created event\n */\n async publishBulkCreated(\n _entityType: string,\n items: Array<{ id: string; data: Record<string, unknown> }>,\n userId: string,\n tenantId?: string,\n workspaceId?: string\n ): Promise<void> {\n const payload: BulkEventPayload = {\n items,\n metadata: {\n tenantId,\n workspaceId,\n userId,\n timestamp: new Date().toISOString(),\n productSource: this.productSource,\n },\n };\n await this.publish(`${this.subjectPrefix}.bulk.created`, payload);\n }\n\n /**\n * Close event queue connection\n */\n async close(): Promise<void> {\n if (this.connected) {\n await this.publisher.disconnect();\n this.connected = false;\n logger.info(`[${this.loggerLabel}] Publisher disconnected`);\n }\n }\n\n /**\n * Get health check status\n */\n async healthCheck(): Promise<{ healthy: boolean; message: string }> {\n const result = await this.publisher.healthCheck();\n const isHealthy = result.status === 'healthy';\n return {\n healthy: isHealthy,\n message: result.error || (isHealthy ? 'Healthy' : 'Unhealthy'),\n };\n }\n}\n\n/**\n * Create a module events service instance\n */\nexport function createModuleEventsService(config: ModuleEventsConfig): ModuleEventsService {\n return new ModuleEventsService(config);\n}\n","/**\n * Events Module\n * Helpers for sending events to the Redis Streams event queue\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { logger } from '../logger/index.js';\n\nexport enum EventPriority {\n LOW = 'low',\n NORMAL = 'normal',\n HIGH = 'high',\n CRITICAL = 'critical',\n}\n\nexport interface PublishEventOptions {\n /** Event subject/topic */\n subject: string;\n /** Event payload */\n data: Record<string, unknown>;\n /** Event priority */\n priority?: EventPriority;\n /** Event metadata */\n metadata?: Record<string, unknown>;\n /** Delay delivery by milliseconds */\n delay?: number;\n /** Message ID (for deduplication) */\n messageId?: string;\n /** Workspace context */\n workspaceId?: string;\n /** Organization context */\n organizationId?: string;\n}\n\nexport interface SubscribeOptions {\n /** Subject pattern to subscribe to */\n subject: string;\n /** Queue group name */\n queueGroup?: string;\n /** Durable consumer name */\n durableName?: string;\n /** Start from specific position */\n startPosition?: 'first' | 'last' | 'new';\n /** Acknowledge mode */\n ackMode?: 'explicit' | 'auto';\n /** Max messages to deliver */\n maxDeliver?: number;\n /** Acknowledgment timeout in milliseconds */\n ackWait?: number;\n}\n\nexport interface EventMessage {\n id: string;\n subject: string;\n data: Record<string, unknown>;\n priority: EventPriority;\n metadata?: Record<string, unknown>;\n workspaceId?: string;\n organizationId?: string;\n publishedAt: string;\n publishedBy?: string;\n}\n\nexport interface PublishResult {\n messageId: string;\n subject: string;\n sequence: number;\n timestamp: string;\n}\n\nexport interface StreamInfo {\n name: string;\n subjects: string[];\n messageCount: number;\n byteCount: number;\n firstSequence: number;\n lastSequence: number;\n consumerCount: number;\n}\n\n/**\n * Events Module\n */\nexport class EventsModule {\n constructor(\n private client: BurdenoffGraphQLClient,\n private context: SDKContext\n ) {}\n\n /**\n * Create stream\n */\n public async createStream(\n name: string,\n subjects: string[],\n options?: {\n maxMessages?: number;\n maxBytes?: number;\n maxAge?: number;\n storageType?: 'file' | 'memory';\n replicas?: number;\n }\n ): Promise<StreamInfo> {\n logger.debug('[Events] Creating stream', { name, subjects });\n\n const mutation = `\n mutation CreateStream($input: CreateStreamInput!) {\n createStream(input: $input) {\n name\n subjects\n messageCount\n byteCount\n firstSequence\n lastSequence\n consumerCount\n }\n }\n `;\n\n const variables = {\n input: {\n name,\n subjects,\n maxMessages: options?.maxMessages,\n maxBytes: options?.maxBytes,\n maxAge: options?.maxAge,\n storageType: options?.storageType || 'file',\n replicas: options?.replicas || 1,\n },\n };\n\n const response = await this.client.query<{ createStream: StreamInfo }>(mutation, variables, this.context);\n\n logger.info('[Events] Stream created', { name });\n\n return response.createStream;\n }\n\n /**\n * Get stream info\n */\n public async getStreamInfo(name: string): Promise<StreamInfo> {\n logger.debug('[Events] Getting stream info', { name });\n\n const query = `\n query GetStreamInfo($name: String!) {\n getStreamInfo(name: $name) {\n name\n subjects\n messageCount\n byteCount\n firstSequence\n lastSequence\n consumerCount\n }\n }\n `;\n\n const response = await this.client.query<{ getStreamInfo: StreamInfo }>(query, { name }, this.context);\n\n return response.getStreamInfo;\n }\n\n /**\n * Delete stream\n */\n public async deleteStream(name: string): Promise<boolean> {\n logger.debug('[Events] Deleting stream', { name });\n\n const mutation = `\n mutation DeleteStream($name: String!) {\n deleteStream(name: $name) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { name }, this.context);\n\n logger.info('[Events] Stream deleted', { name });\n\n return true;\n }\n\n /**\n * Purge stream messages\n */\n public async purgeStream(name: string, options?: { subject?: string; sequence?: number }): Promise<number> {\n logger.debug('[Events] Purging stream', { name, options });\n\n const mutation = `\n mutation PurgeStream($name: String!, $subject: String, $sequence: Int) {\n purgeStream(name: $name, subject: $subject, sequence: $sequence) {\n purgedCount\n }\n }\n `;\n\n const response = await this.client.query<{ purgeStream: { purgedCount: number } }>(\n mutation,\n { name, subject: options?.subject, sequence: options?.sequence },\n this.context\n );\n\n logger.info('[Events] Stream purged', { name, purgedCount: response.purgeStream.purgedCount });\n\n return response.purgeStream.purgedCount;\n }\n\n /**\n * Create consumer\n */\n public async createConsumer(\n streamName: string,\n consumerName: string,\n options: SubscribeOptions\n ): Promise<{ name: string; pending: number }> {\n logger.debug('[Events] Creating consumer', { streamName, consumerName });\n\n const mutation = `\n mutation CreateConsumer($input: CreateConsumerInput!) {\n createConsumer(input: $input) {\n name\n pending\n }\n }\n `;\n\n const variables = {\n input: {\n streamName,\n consumerName,\n subject: options.subject,\n queueGroup: options.queueGroup,\n durableName: options.durableName,\n startPosition: options.startPosition || 'last',\n ackMode: options.ackMode || 'explicit',\n maxDeliver: options.maxDeliver || 5,\n ackWait: options.ackWait || 30000,\n },\n };\n\n const response = await this.client.query<{ createConsumer: { name: string; pending: number } }>(\n mutation,\n variables,\n this.context\n );\n\n logger.info('[Events] Consumer created', { consumerName });\n\n return response.createConsumer;\n }\n\n /**\n * Delete consumer\n */\n public async deleteConsumer(streamName: string, consumerName: string): Promise<boolean> {\n logger.debug('[Events] Deleting consumer', { streamName, consumerName });\n\n const mutation = `\n mutation DeleteConsumer($streamName: String!, $consumerName: String!) {\n deleteConsumer(streamName: $streamName, consumerName: $consumerName) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName }, this.context);\n\n logger.info('[Events] Consumer deleted', { consumerName });\n\n return true;\n }\n\n /**\n * Acknowledge message\n */\n public async ackMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean> {\n logger.debug('[Events] Acknowledging message', { streamName, consumerName, sequence });\n\n const mutation = `\n mutation AckMessage($streamName: String!, $consumerName: String!, $sequence: Int!) {\n ackMessage(streamName: $streamName, consumerName: $consumerName, sequence: $sequence) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName, sequence }, this.context);\n\n return true;\n }\n\n /**\n * Negative acknowledge message (requeue)\n */\n public async nakMessage(streamName: string, consumerName: string, sequence: number): Promise<boolean> {\n logger.debug('[Events] Negative acknowledging message', { streamName, consumerName, sequence });\n\n const mutation = `\n mutation NakMessage($streamName: String!, $consumerName: String!, $sequence: Int!) {\n nakMessage(streamName: $streamName, consumerName: $consumerName, sequence: $sequence) {\n success\n }\n }\n `;\n\n await this.client.query(mutation, { streamName, consumerName, sequence }, this.context);\n\n return true;\n }\n\n /**\n * Get consumer info\n */\n public async getConsumerInfo(\n streamName: string,\n consumerName: string\n ): Promise<{\n name: string;\n pending: number;\n redelivered: number;\n numAckPending: number;\n }> {\n logger.debug('[Events] Getting consumer info', { streamName, consumerName });\n\n const query = `\n query GetConsumerInfo($streamName: String!, $consumerName: String!) {\n getConsumerInfo(streamName: $streamName, consumerName: $consumerName) {\n name\n pending\n redelivered\n numAckPending\n }\n }\n `;\n\n const response = await this.client.query<{\n getConsumerInfo: {\n name: string;\n pending: number;\n redelivered: number;\n numAckPending: number;\n };\n }>(query, { streamName, consumerName }, this.context);\n\n return response.getConsumerInfo;\n }\n}\n"]}
@@ -15,6 +15,8 @@ interface PrismaClientConfig {
15
15
  logLevels?: Array<'query' | 'info' | 'warn' | 'error'>;
16
16
  keepWarm?: boolean;
17
17
  warmupIntervalMillis?: number;
18
+ acquireRetries?: number;
19
+ acquireRetryDelayMillis?: number;
18
20
  }
19
21
  interface DatabaseHealth {
20
22
  healthy: boolean;
@@ -54,6 +56,8 @@ type DatabaseReturnType<T extends PrismaClientBase = PrismaClientBase> = T & {
54
56
  client: T;
55
57
  };
56
58
  declare function createConnectionPool(config: PrismaClientConfig): Pool;
59
+ declare function isTransientAcquireError(error: unknown): boolean;
60
+ declare function installAcquireRetry(pool: Pool, retries: number, baseDelayMillis: number): void;
57
61
  declare function ensureServiceApplicationName(productName: string | undefined): void;
58
62
  declare function createPrismaAdapter(pool: Pool): PrismaPg;
59
63
  declare function configurePrismaLogging<T extends PrismaClientBase>(client: T, config: PrismaClientConfig): T;
@@ -81,4 +85,4 @@ interface PrismaClientConstructorOptions {
81
85
  }
82
86
  declare function createPrismaClient<T extends PrismaClientBase>(PrismaClientConstructor: new (options: PrismaClientConstructorOptions) => T, config: PrismaClientConfig): PrismaClientWrapper<T>;
83
87
 
84
- export { type ConnectionState as C, type DatabaseReturnType as D, type PrismaClientBase as P, type PrismaClientConstructorOptions as a, PrismaClientWrapper as b, type PrismaClientConfig as c, type DatabaseHealth as d, type PrismaEvent as e, type PrismaLogDefinition as f, type PrismaLogEvent as g, type PrismaLogLevel as h, type PrismaQueryEvent as i, type PrismaTransactionOptions as j, configurePrismaLogging as k, createConnectionPool as l, createPrismaAdapter as m, createPrismaClient as n, ensureServiceApplicationName as o };
88
+ export { type ConnectionState as C, type DatabaseReturnType as D, type PrismaClientBase as P, type PrismaClientConstructorOptions as a, PrismaClientWrapper as b, type PrismaClientConfig as c, type DatabaseHealth as d, type PrismaEvent as e, type PrismaLogDefinition as f, type PrismaLogEvent as g, type PrismaLogLevel as h, type PrismaQueryEvent as i, type PrismaTransactionOptions as j, configurePrismaLogging as k, createConnectionPool as l, createPrismaAdapter as m, createPrismaClient as n, ensureServiceApplicationName as o, installAcquireRetry as p, isTransientAcquireError as q };
@@ -1,6 +1,7 @@
1
- export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, c as EventHandler, d as EventMessage, e as EventMetadata, f as EventPriority, g as EventQueueFactory, h as EventQueueHealthCheckResult, E as EventsModule, j as GraphQLEventMessage, h as HealthCheckResult, k as IEventConsumer, I as IEventPublisher, l as IEventQueue, m as ISubscription, M as MemoryEventBus, n as MemoryEventConsumer, o as MemoryEventPublisher, p as MemoryEventQueue, q as ModuleEventPayload, r as ModuleEventsConfig, s as ModuleEventsService, P as PublishEventOptions, t as PublishOptions, u as PublishResult, v as PublisherConfig, Q as QueueStatistics, w as QueueType, R as RedisStreamsConnection, x as RedisStreamsEventConsumer, y as RedisStreamsEventPublisher, S as StreamConfig, z as StreamInfo, D as SubscribeOptions, F as SubscriptionOptions, G as createConsumer, H as createMemoryConsumer, J as createMemoryGraphEventEmitter, K as createMemoryPublisher, L as createModuleEventsService, N as createPublisher, O as redisDlqKey, T as redisStreamKey } from '../index-5QTY_V54.js';
1
+ export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, c as EventHandler, d as EventMessage, e as EventMetadata, f as EventPriority, g as EventQueueFactory, h as EventQueueHealthCheckResult, E as EventsModule, j as GraphQLEventMessage, h as HealthCheckResult, k as IEventConsumer, I as IEventPublisher, l as IEventQueue, m as ISubscription, M as MemoryEventBus, n as MemoryEventConsumer, o as MemoryEventPublisher, p as MemoryEventQueue, q as ModuleEventPayload, r as ModuleEventsConfig, s as ModuleEventsService, P as PublishEventOptions, t as PublishOptions, u as PublishResult, v as PublisherConfig, Q as QueueStatistics, w as QueueType, R as RedisStreamsConnection, x as RedisStreamsEventConsumer, y as RedisStreamsEventPublisher, S as StreamConfig, z as StreamInfo, D as SubscribeOptions, F as SubscriptionOptions, G as createConsumer, H as createMemoryConsumer, J as createMemoryGraphEventEmitter, K as createMemoryPublisher, L as createModuleEventsService, N as createPublisher, O as redisDlqKey, T as redisStreamKey } from '../index-CQGCVFmI.js';
2
2
  export { E as EntityEventRbacMetadata, a as EntityEventType, b as GraphEventEmitter, G as GraphEventEmitterImpl, c as createGraphEventEmitter, g as getGraphEventEmitter, r as resetGraphEventEmitter } from '../graph-emitter-r5TylDBm.js';
3
3
  import '../layer-GNAVXBMf.js';
4
+ import '../shutdown-registry-CW9LryO8.js';
4
5
  import '../graphql-Dxxpbzr3.js';
5
6
  import 'graphql-request';
6
7
  import '../index-B8viwwDM.js';
@@ -1,7 +1,8 @@
1
- export { EventPriority, EventsModule, ModuleEventsService, createConsumer, createModuleEventsService, createPublisher } from '../chunk-A6WNRJZF.js';
2
- export { GraphEventEmitterImpl, MemoryEventBus, MemoryEventConsumer, MemoryEventPublisher, MemoryEventQueue, createGraphEventEmitter2 as createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, createMemoryPublisher, getGraphEventEmitter, resetGraphEventEmitter } from '../chunk-OQ62HA7Z.js';
3
- export { EventQueueFactory, QueueType, RedisStreamsEventConsumer, RedisStreamsEventPublisher } from '../chunk-5ORHPLOA.js';
1
+ export { EventPriority, EventsModule, ModuleEventsService, createConsumer, createModuleEventsService, createPublisher } from '../chunk-WFVLQELZ.js';
2
+ export { GraphEventEmitterImpl, MemoryEventBus, MemoryEventConsumer, MemoryEventPublisher, MemoryEventQueue, createGraphEventEmitter2 as createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, createMemoryPublisher, getGraphEventEmitter, resetGraphEventEmitter } from '../chunk-URDYOM2L.js';
3
+ export { EventQueueFactory, QueueType, RedisStreamsEventConsumer, RedisStreamsEventPublisher } from '../chunk-JNJSSBKO.js';
4
4
  export { RedisStreamsConnection, dlqKey as redisDlqKey, streamKey as redisStreamKey } from '../chunk-S7LWYERE.js';
5
+ import '../chunk-VBXPFYZ5.js';
5
6
  import '../chunk-CBZNP6RF.js';
6
7
  import '../chunk-XE4OXN2W.js';
7
8
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { BaseModuleExporter, PaginationService, convertToCSV, csvToJSON, estimateCSVSize, getCSVHeaders, parseCSV, triggerExportJob } from '../chunk-X5FPXATC.js';
2
- import '../chunk-A4TGVW5V.js';
3
- import '../chunk-DBIWNA72.js';
1
+ export { BaseModuleExporter, PaginationService, convertToCSV, csvToJSON, estimateCSVSize, getCSVHeaders, parseCSV, triggerExportJob } from '../chunk-JAZ473V3.js';
2
+ import '../chunk-SBZ3UZ5J.js';
3
+ import '../chunk-Q3SO65JD.js';
4
4
  import '../chunk-7UJXIX4I.js';
5
5
  import '../chunk-VFCMR5GX.js';
6
6
  import '../chunk-RZOFS2BQ.js';
@@ -1,5 +1,5 @@
1
- export { CircuitState, GatewayClient, GatewayError, GatewayErrorType, createGatewayClient, createGatewayClientFromEnv } from '../chunk-A4TGVW5V.js';
2
- export { security_exports as Security } from '../chunk-DBIWNA72.js';
1
+ export { CircuitState, GatewayClient, GatewayError, GatewayErrorType, createGatewayClient, createGatewayClientFromEnv } from '../chunk-SBZ3UZ5J.js';
2
+ export { security_exports as Security } from '../chunk-Q3SO65JD.js';
3
3
  import '../chunk-7UJXIX4I.js';
4
4
  export { signServiceJwt } from '../chunk-VFCMR5GX.js';
5
5
  import '../chunk-RZOFS2BQ.js';
@@ -1,4 +1,4 @@
1
- export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-DBIWNA72.js';
1
+ export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-Q3SO65JD.js';
2
2
  import '../../chunk-CBZNP6RF.js';
3
3
  import '../../chunk-XE4OXN2W.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
1
  import '../graphql-Dxxpbzr3.js';
2
2
  import '../index-B8viwwDM.js';
3
- export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DefineEntityConfigOptions, b as DefineGraphConfigOptions, c as DefineRelationshipConfigOptions, E as EdgeDocument, d as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityGraphConfig, k as EntityRbacConfig, l as EntityVertex, m as ExtractedEntityData, n as ExtractedRelationshipData, F as FieldMapper, o as GenericEntityConfig, p as GenericEntityRbacConfig, q as GenericGraphConfig, r as GenericRelationshipConfig, s as GraphEdge, t as GraphEntityConfig, u as GraphEntityExport, v as GraphEvent, w as GraphEventOptions, x as GraphEventPublishOptions, y as GraphEventType, z as GraphEventsHelper, B as GraphEventsHelperConfig, H as GraphEventsPublisher, I as GraphExportResponse, J as GraphExportService, K as GraphExportServiceConfig, G as GraphModule, L as GraphNode, M as GraphRegistry, N as GraphRelationshipData, O as GraphRelationshipExport, P as GraphSchema, Q as GraphValidationError, R as GraphValidationResult, S as InitializeGraphOptions, T as ModuleGraph, U as ModuleGraphConfig, V as ModuleGraphDefinition, W as PrismaGraphIntegration, X as PrismaGraphIntegrationOptions, Y as ProductFacet, Z as QueryGraphOptions, _ as RelationshipDefinition, $ as RelationshipEventData, a0 as RelationshipExportData, a1 as RelationshipFetcher, a2 as RelationshipGraphConfig, a3 as SOFT_DELETE_FIELDS, a4 as STANDARD_FIELDS, a5 as SearchFacets, a6 as SearchFilters, a7 as SearchResponse, a8 as SearchResult, a9 as TENANT_FIELDS, aa as TraverseDirection, ab as TraverseOptions, ac as TraverseResult, ad as TypeFacet, ae as ValidationErrorType, af as createEntityEvent, ag as createGraphEventsHelper, ah as createGraphExportService, ai as createPrismaGraphIntegration, aj as createRelationshipEvent, ak as createRelationshipFromEntity, al as defineEntity, am as defineGraphConfig, an as defineModuleGraph, ao as defineRelationship, ap as extractEntityTitle, aq as extractMinimalFields, ar as getCollectionForEntity, as as getGraphEventsPublisher, at as getGraphStats, au as initializeGraph, av as isGraphInitialized, aw as parseRelationship, ax as shouldSyncEntity, ay as shouldSyncRelationship } from '../index-2jyc-oTr.js';
3
+ export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DefineEntityConfigOptions, b as DefineGraphConfigOptions, c as DefineRelationshipConfigOptions, E as EdgeDocument, d as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityGraphConfig, k as EntityRbacConfig, l as EntityVertex, m as ExtractedEntityData, n as ExtractedRelationshipData, F as FieldMapper, o as GenericEntityConfig, p as GenericEntityRbacConfig, q as GenericGraphConfig, r as GenericRelationshipConfig, s as GraphEdge, t as GraphEntityConfig, u as GraphEntityExport, v as GraphEvent, w as GraphEventOptions, x as GraphEventPublishOptions, y as GraphEventType, z as GraphEventsHelper, B as GraphEventsHelperConfig, H as GraphEventsPublisher, I as GraphExportResponse, J as GraphExportService, K as GraphExportServiceConfig, G as GraphModule, L as GraphNode, M as GraphRegistry, N as GraphRelationshipData, O as GraphRelationshipExport, P as GraphSchema, Q as GraphValidationError, R as GraphValidationResult, S as InitializeGraphOptions, T as ModuleGraph, U as ModuleGraphConfig, V as ModuleGraphDefinition, W as PrismaGraphIntegration, X as PrismaGraphIntegrationOptions, Y as ProductFacet, Z as QueryGraphOptions, _ as RelationshipDefinition, $ as RelationshipEventData, a0 as RelationshipExportData, a1 as RelationshipFetcher, a2 as RelationshipGraphConfig, a3 as SOFT_DELETE_FIELDS, a4 as STANDARD_FIELDS, a5 as SearchFacets, a6 as SearchFilters, a7 as SearchResponse, a8 as SearchResult, a9 as TENANT_FIELDS, aa as TraverseDirection, ab as TraverseOptions, ac as TraverseResult, ad as TypeFacet, ae as ValidationErrorType, af as createEntityEvent, ag as createGraphEventsHelper, ah as createGraphExportService, ai as createPrismaGraphIntegration, aj as createRelationshipEvent, ak as createRelationshipFromEntity, al as defineEntity, am as defineGraphConfig, an as defineModuleGraph, ao as defineRelationship, ap as extractEntityTitle, aq as extractMinimalFields, ar as getCollectionForEntity, as as getGraphEventsPublisher, at as getGraphStats, au as initializeGraph, av as isGraphInitialized, aw as parseRelationship, ax as shouldSyncEntity, ay as shouldSyncRelationship } from '../index-CGTwU6CR.js';
4
4
  export { E as EntityEventType, G as GraphEventEmitter, a as GraphMiddlewareConfig, b as addGraphExtension } from '../prisma-extension-krXnYnrN.js';
5
5
  import 'graphql-request';
6
6
  import '../layer-GNAVXBMf.js';
7
- import '../client-u23M69Qt.js';
7
+ import '../client-Dhi02YAf.js';
8
8
  import '@prisma/adapter-pg';
9
9
  import 'pg';
10
10
  import '../graph-emitter-r5TylDBm.js';
@@ -1,9 +1,10 @@
1
- export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-YKY24YLZ.js';
2
- export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship } from '../chunk-5A5GGMWK.js';
3
- import '../chunk-A6WNRJZF.js';
4
- import '../chunk-OQ62HA7Z.js';
5
- import '../chunk-5ORHPLOA.js';
1
+ export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-V4QNOY4E.js';
2
+ export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship } from '../chunk-NJ5GTICM.js';
3
+ import '../chunk-WFVLQELZ.js';
4
+ import '../chunk-URDYOM2L.js';
5
+ import '../chunk-JNJSSBKO.js';
6
6
  import '../chunk-S7LWYERE.js';
7
+ import '../chunk-VBXPFYZ5.js';
7
8
  import '../chunk-QGBXVNRM.js';
8
9
  import '../chunk-YFOHAHZE.js';
9
10
  import '../chunk-CBZNP6RF.js';
@@ -1,4 +1,4 @@
1
- import { P as PrismaClientBase, b as PrismaClientWrapper, c as PrismaClientConfig, a as PrismaClientConstructorOptions, D as DatabaseReturnType, d as DatabaseHealth, C as ConnectionState, e as PrismaEvent, f as PrismaLogDefinition, g as PrismaLogEvent, h as PrismaLogLevel, i as PrismaQueryEvent, j as PrismaTransactionOptions, k as configurePrismaLogging, l as createConnectionPool, m as createPrismaAdapter, n as createPrismaClient, o as ensureServiceApplicationName } from './client-u23M69Qt.js';
1
+ import { P as PrismaClientBase, b as PrismaClientWrapper, c as PrismaClientConfig, a as PrismaClientConstructorOptions, D as DatabaseReturnType, d as DatabaseHealth, C as ConnectionState, e as PrismaEvent, f as PrismaLogDefinition, g as PrismaLogEvent, h as PrismaLogLevel, i as PrismaQueryEvent, j as PrismaTransactionOptions, k as configurePrismaLogging, l as createConnectionPool, m as createPrismaAdapter, n as createPrismaClient, o as ensureServiceApplicationName, p as installAcquireRetry, q as isTransientAcquireError } from './client-Dhi02YAf.js';
2
2
  import { G as GraphEventEmitter } from './prisma-extension-krXnYnrN.js';
3
3
  import { W as WorkspaceExtensionConfig, a as WorkspaceContext, b as addWorkspaceExtension, g as getWorkspaceContext, i as injectWhereWorkspaceId, m as maybeSetRlsGuc, c as maybeTagConnection, s as setWorkspaceContext, w as withWorkspaceContext, d as withWorkspaceContextSync } from './workspace-extension-TquhDEKU.js';
4
4
 
@@ -160,7 +160,9 @@ declare const index_hasModel: typeof hasModel;
160
160
  declare const index_initializeDatabase: typeof initializeDatabase;
161
161
  declare const index_initializeDatabaseWithConfig: typeof initializeDatabaseWithConfig;
162
162
  declare const index_injectWhereWorkspaceId: typeof injectWhereWorkspaceId;
163
+ declare const index_installAcquireRetry: typeof installAcquireRetry;
163
164
  declare const index_isDatabaseInitialized: typeof isDatabaseInitialized;
165
+ declare const index_isTransientAcquireError: typeof isTransientAcquireError;
164
166
  declare const index_loadGeneratedFields: typeof loadGeneratedFields;
165
167
  declare const index_maybeSetRlsGuc: typeof maybeSetRlsGuc;
166
168
  declare const index_maybeTagConnection: typeof maybeTagConnection;
@@ -174,7 +176,7 @@ declare const index_toContextJson: typeof toContextJson;
174
176
  declare const index_withWorkspaceContext: typeof withWorkspaceContext;
175
177
  declare const index_withWorkspaceContextSync: typeof withWorkspaceContextSync;
176
178
  declare namespace index {
177
- export { index_ConnectionState as ConnectionState, type index_ContextFilterInput as ContextFilterInput, type index_DatabaseClient as DatabaseClient, type index_DatabaseClientConfig as DatabaseClientConfig, index_DatabaseHealth as DatabaseHealth, index_DatabaseReturnType as DatabaseReturnType, type index_FieldExtractionOptions as FieldExtractionOptions, type index_FieldExtractionResult as FieldExtractionResult, type index_InputJsonValue as InputJsonValue, type index_JsonValue as JsonValue, type index_ModelFieldsMap as ModelFieldsMap, type index_OperationContext as OperationContext, type index_PoolTuningEnv as PoolTuningEnv, index_PrismaClientBase as PrismaClientBase, index_PrismaClientConfig as PrismaClientConfig, index_PrismaClientConstructorOptions as PrismaClientConstructorOptions, index_PrismaClientWrapper as PrismaClientWrapper, index_PrismaEvent as PrismaEvent, type index_PrismaJsonFilter as PrismaJsonFilter, index_PrismaLogDefinition as PrismaLogDefinition, index_PrismaLogEvent as PrismaLogEvent, index_PrismaLogLevel as PrismaLogLevel, index_PrismaQueryEvent as PrismaQueryEvent, index_PrismaTransactionOptions as PrismaTransactionOptions, index_WorkspaceContext as WorkspaceContext, index_WorkspaceExtensionConfig as WorkspaceExtensionConfig, index_addWorkspaceExtension as addWorkspaceExtension, index_buildContextWhereClause as buildContextWhereClause, index_buildContextWhereConditions as buildContextWhereConditions, index_checkDatabaseHealth as checkDatabaseHealth, index_configurePrismaLogging as configurePrismaLogging, index_contextMatches as contextMatches, index_createConnectionPool as createConnectionPool, index_createContextFromSDK as createContextFromSDK, index_createDatabaseClient as createDatabaseClient, index_createDatabaseClientFromEnv as createDatabaseClientFromEnv, index_createPrismaAdapter as createPrismaAdapter, index_createPrismaClient as createPrismaClient, index_ensureServiceApplicationName as ensureServiceApplicationName, index_extractFieldsFromModel as extractFieldsFromModel, index_getAllModelNames as getAllModelNames, index_getDatabaseManager as getDatabaseManager, index_getDatabaseProductName as getDatabaseProductName, index_getDatabaseStats as getDatabaseStats, index_getDatabaseVersion as getDatabaseVersion, index_getDb as getDb, index_getModelFields as getModelFields, index_getWorkspaceContext as getWorkspaceContext, index_hasModel as hasModel, index_initializeDatabase as initializeDatabase, index_initializeDatabaseWithConfig as initializeDatabaseWithConfig, index_injectWhereWorkspaceId as injectWhereWorkspaceId, index_isDatabaseInitialized as isDatabaseInitialized, index_loadGeneratedFields as loadGeneratedFields, index_maybeSetRlsGuc as maybeSetRlsGuc, index_maybeTagConnection as maybeTagConnection, index_mergeContext as mergeContext, index_parseContext as parseContext, index_resetDatabaseManager as resetDatabaseManager, index_resolvePoolTuningFromEnv as resolvePoolTuningFromEnv, index_setWorkspaceContext as setWorkspaceContext, index_testConnection as testConnection, index_toContextJson as toContextJson, index_withWorkspaceContext as withWorkspaceContext, index_withWorkspaceContextSync as withWorkspaceContextSync };
179
+ export { index_ConnectionState as ConnectionState, type index_ContextFilterInput as ContextFilterInput, type index_DatabaseClient as DatabaseClient, type index_DatabaseClientConfig as DatabaseClientConfig, index_DatabaseHealth as DatabaseHealth, index_DatabaseReturnType as DatabaseReturnType, type index_FieldExtractionOptions as FieldExtractionOptions, type index_FieldExtractionResult as FieldExtractionResult, type index_InputJsonValue as InputJsonValue, type index_JsonValue as JsonValue, type index_ModelFieldsMap as ModelFieldsMap, type index_OperationContext as OperationContext, type index_PoolTuningEnv as PoolTuningEnv, index_PrismaClientBase as PrismaClientBase, index_PrismaClientConfig as PrismaClientConfig, index_PrismaClientConstructorOptions as PrismaClientConstructorOptions, index_PrismaClientWrapper as PrismaClientWrapper, index_PrismaEvent as PrismaEvent, type index_PrismaJsonFilter as PrismaJsonFilter, index_PrismaLogDefinition as PrismaLogDefinition, index_PrismaLogEvent as PrismaLogEvent, index_PrismaLogLevel as PrismaLogLevel, index_PrismaQueryEvent as PrismaQueryEvent, index_PrismaTransactionOptions as PrismaTransactionOptions, index_WorkspaceContext as WorkspaceContext, index_WorkspaceExtensionConfig as WorkspaceExtensionConfig, index_addWorkspaceExtension as addWorkspaceExtension, index_buildContextWhereClause as buildContextWhereClause, index_buildContextWhereConditions as buildContextWhereConditions, index_checkDatabaseHealth as checkDatabaseHealth, index_configurePrismaLogging as configurePrismaLogging, index_contextMatches as contextMatches, index_createConnectionPool as createConnectionPool, index_createContextFromSDK as createContextFromSDK, index_createDatabaseClient as createDatabaseClient, index_createDatabaseClientFromEnv as createDatabaseClientFromEnv, index_createPrismaAdapter as createPrismaAdapter, index_createPrismaClient as createPrismaClient, index_ensureServiceApplicationName as ensureServiceApplicationName, index_extractFieldsFromModel as extractFieldsFromModel, index_getAllModelNames as getAllModelNames, index_getDatabaseManager as getDatabaseManager, index_getDatabaseProductName as getDatabaseProductName, index_getDatabaseStats as getDatabaseStats, index_getDatabaseVersion as getDatabaseVersion, index_getDb as getDb, index_getModelFields as getModelFields, index_getWorkspaceContext as getWorkspaceContext, index_hasModel as hasModel, index_initializeDatabase as initializeDatabase, index_initializeDatabaseWithConfig as initializeDatabaseWithConfig, index_injectWhereWorkspaceId as injectWhereWorkspaceId, index_installAcquireRetry as installAcquireRetry, index_isDatabaseInitialized as isDatabaseInitialized, index_isTransientAcquireError as isTransientAcquireError, index_loadGeneratedFields as loadGeneratedFields, index_maybeSetRlsGuc as maybeSetRlsGuc, index_maybeTagConnection as maybeTagConnection, index_mergeContext as mergeContext, index_parseContext as parseContext, index_resetDatabaseManager as resetDatabaseManager, index_resolvePoolTuningFromEnv as resolvePoolTuningFromEnv, index_setWorkspaceContext as setWorkspaceContext, index_testConnection as testConnection, index_toContextJson as toContextJson, index_withWorkspaceContext as withWorkspaceContext, index_withWorkspaceContextSync as withWorkspaceContextSync };
178
180
  }
179
181
 
180
182
  export { resetDatabaseManager as A, resolvePoolTuningFromEnv as B, type ContextFilterInput as C, type DatabaseClient as D, testConnection as E, type FieldExtractionOptions as F, toContextJson as G, type InputJsonValue as I, type JsonValue as J, type ModelFieldsMap as M, type OperationContext as O, type PoolTuningEnv as P, type DatabaseClientConfig as a, type FieldExtractionResult as b, type PrismaJsonFilter as c, buildContextWhereClause as d, buildContextWhereConditions as e, checkDatabaseHealth as f, contextMatches as g, createContextFromSDK as h, index as i, createDatabaseClient as j, createDatabaseClientFromEnv as k, extractFieldsFromModel as l, getAllModelNames as m, getDatabaseManager as n, getDatabaseProductName as o, getDatabaseStats as p, getDatabaseVersion as q, getDb as r, getModelFields as s, hasModel as t, initializeDatabase as u, initializeDatabaseWithConfig as v, isDatabaseInitialized as w, loadGeneratedFields as x, mergeContext as y, parseContext as z };
@@ -1,6 +1,6 @@
1
1
  import { B as BurdenoffGraphQLClient } from './graphql-Dxxpbzr3.js';
2
2
  import { S as SDKContext } from './index-B8viwwDM.js';
3
- import { P as PrismaClientBase } from './client-u23M69Qt.js';
3
+ import { P as PrismaClientBase } from './client-Dhi02YAf.js';
4
4
  import { G as GraphEventEmitterImpl, E as EntityEventRbacMetadata } from './graph-emitter-r5TylDBm.js';
5
5
  import { G as GraphEventEmitter, E as EntityEventType, a as GraphMiddlewareConfig, b as addGraphExtension } from './prisma-extension-krXnYnrN.js';
6
6
 
@@ -1,4 +1,5 @@
1
1
  import { S as ServiceLayer } from './layer-GNAVXBMf.js';
2
+ import { S as ShutdownDisposable } from './shutdown-registry-CW9LryO8.js';
2
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';
3
4
  import { B as BurdenoffGraphQLClient } from './graphql-Dxxpbzr3.js';
4
5
  import { S as SDKContext } from './index-B8viwwDM.js';
@@ -264,7 +265,7 @@ interface RedisStreamsPublisherConfig extends PublisherConfig {
264
265
  dedupTtlSeconds?: number;
265
266
  keyPrefix?: string;
266
267
  }
267
- declare class RedisStreamsEventPublisher implements IEventPublisher {
268
+ declare class RedisStreamsEventPublisher implements IEventPublisher, ShutdownDisposable {
268
269
  private config;
269
270
  private connection;
270
271
  private publishCount;
@@ -272,7 +273,9 @@ declare class RedisStreamsEventPublisher implements IEventPublisher {
272
273
  private readonly maxLen;
273
274
  private readonly dedupTtl;
274
275
  private readonly keyPrefix;
276
+ readonly shutdownName: string;
275
277
  constructor(config: RedisStreamsPublisherConfig);
278
+ dispose(): Promise<void>;
276
279
  connect(): Promise<void>;
277
280
  disconnect(): Promise<void>;
278
281
  isConnected(): boolean;
@@ -304,7 +307,8 @@ declare class RedisStreamsEventPublisher implements IEventPublisher {
304
307
  interface RedisStreamsConsumerConfig extends ConsumerConfig {
305
308
  keyPrefix?: string;
306
309
  }
307
- declare class RedisStreamsEventConsumer implements IEventConsumer {
310
+ declare class RedisStreamsEventConsumer implements IEventConsumer, ShutdownDisposable {
311
+ readonly shutdownName: string;
308
312
  private readonly connection;
309
313
  private subscriptions;
310
314
  private readonly subscriptionLoops;
@@ -322,6 +326,7 @@ declare class RedisStreamsEventConsumer implements IEventConsumer {
322
326
  private delayqTimer;
323
327
  private knownStreams;
324
328
  constructor(config: RedisStreamsConsumerConfig);
329
+ dispose(): Promise<void>;
325
330
  connect(): Promise<void>;
326
331
  disconnect(): Promise<void>;
327
332
  isConnected(): boolean;
@@ -1,4 +1,5 @@
1
1
  import { S as ServiceLayer } from './layer-GNAVXBMf.js';
2
+ import { S as ShutdownDisposable } from './shutdown-registry-CW9LryO8.js';
2
3
 
3
4
  declare enum CacheProviderType {
4
5
  VALKEY = "valkey",
@@ -165,7 +166,7 @@ interface ValkeyGlideConfig {
165
166
  port: number;
166
167
  }>;
167
168
  }
168
- declare class ValkeyGlideProvider implements ICacheProvider {
169
+ declare class ValkeyGlideProvider implements ICacheProvider, ShutdownDisposable {
169
170
  private client;
170
171
  private clusterScanCursor;
171
172
  private clientIsCluster;
@@ -173,6 +174,7 @@ declare class ValkeyGlideProvider implements ICacheProvider {
173
174
  private connectPromise;
174
175
  private lastConnectFailureAt;
175
176
  private consecutiveOpFailures;
177
+ private lastCooldownLogAt;
176
178
  private readonly config;
177
179
  private namespace;
178
180
  private dbNamespaceSuffixApplied;
@@ -186,9 +188,12 @@ declare class ValkeyGlideProvider implements ICacheProvider {
186
188
  private ensureConnected;
187
189
  private withConnectBudget;
188
190
  connect(): Promise<void>;
191
+ get shutdownName(): string;
192
+ dispose(): Promise<void>;
189
193
  disconnect(): Promise<void>;
190
194
  private recordOpSuccess;
191
195
  private noteOpError;
196
+ private logOpError;
192
197
  private resetClientForReconnect;
193
198
  isConnected(): boolean;
194
199
  healthCheck(): Promise<CacheHealthCheckResult>;
@@ -0,0 +1,12 @@
1
+ import { S as ShutdownDisposable, d as disposeAll, g as getRegisteredDisposableCount, r as registerDisposable, u as unregisterDisposable } from './shutdown-registry-CW9LryO8.js';
2
+
3
+ declare const index_ShutdownDisposable: typeof ShutdownDisposable;
4
+ declare const index_disposeAll: typeof disposeAll;
5
+ declare const index_getRegisteredDisposableCount: typeof getRegisteredDisposableCount;
6
+ declare const index_registerDisposable: typeof registerDisposable;
7
+ declare const index_unregisterDisposable: typeof unregisterDisposable;
8
+ declare namespace index {
9
+ export { index_ShutdownDisposable as ShutdownDisposable, index_disposeAll as disposeAll, index_getRegisteredDisposableCount as getRegisteredDisposableCount, index_registerDisposable as registerDisposable, index_unregisterDisposable as unregisterDisposable };
10
+ }
11
+
12
+ export { index as i };
package/dist/index.d.ts CHANGED
@@ -9,21 +9,22 @@ import { RBACModule } from './rbac/index.js';
9
9
  export { LayerAwareRBACConfig, RBACDirectiveConfig, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './rbac/index.js';
10
10
  import { A as ActivityModule, U as UsageModule, T as TrackerModule } from './index-CDPSJW0O.js';
11
11
  import { DatabaseConfig, DatabaseModule } from './database/index.js';
12
- import { E as EventsModule, I as IEventPublisher } from './index-5QTY_V54.js';
13
- export { i as EventQueue } from './index-5QTY_V54.js';
14
- import { G as GraphModule } from './index-2jyc-oTr.js';
15
- export { i as Graph } from './index-2jyc-oTr.js';
12
+ import { E as EventsModule, I as IEventPublisher } from './index-CQGCVFmI.js';
13
+ export { i as EventQueue } from './index-CQGCVFmI.js';
14
+ import { G as GraphModule } from './index-CGTwU6CR.js';
15
+ export { i as Graph } from './index-CGTwU6CR.js';
16
16
  import { B as BurdenoffGraphQLClient } from './graphql-Dxxpbzr3.js';
17
17
  import { TemporalModule } from './temporal/index.js';
18
18
  export { TemporalClient, TemporalClientConfig, TemporalClientFactory, TemporalWorker, TemporalWorkerConfig, TemporalWorkerFactory, TemporalWorkerManager, WorkflowStartOptions } from './temporal/index.js';
19
19
  export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './client/internal-client.js';
20
+ export { i as Lifecycle } from './index-CoMKgL-p.js';
20
21
  export { PlanTier, RESOURCE_CAP_DEFAULTS, ResourceCap, ResourceCapDefaults, ResourceCapExceededError, ResourceCapsConfig, ResourceCapsModule, ResourceName, getResourceCaps } from './resource-caps/index.js';
21
22
  export { i as Sharing } from './index-kssw5ziY.js';
22
- export { i as Cache } from './index-Zh4KQBM1.js';
23
+ export { i as Cache } from './index-CgTMsars.js';
23
24
  export { i as Middleware } from './index-DSOpj8DI.js';
24
25
  export { i as Observability } from './index-4gKQKZ2B.js';
25
26
  export { i as GraphQL } from './index-joONjwLt.js';
26
- export { i as Prisma } from './index-qg-t-NT2.js';
27
+ export { i as Prisma } from './index-BfvCLSmh.js';
27
28
  export { i as Utils } from './index-PaojfSdd.js';
28
29
  export { i as I18n, I as I18nCapableContext, T as Translator, c as createTranslator, g as getLanguage, a as getLocale, h as hasI18n, t } from './index-D4l1u8VR.js';
29
30
  export { i as Export } from './index-B4ciT3OZ.js';
@@ -37,10 +38,11 @@ export { i as FeatureFlags } from './index-BdPnlJ8_.js';
37
38
  export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
38
39
  export { i as Platform } from './index-lcW5eSTp.js';
39
40
  export { C as CircuitBreakerConfig, h as DEFAULT_CIRCUIT_BREAKER_CONFIG, i as DEFAULT_GATEWAY_RETRY_CONFIG, D as DEFAULT_GATEWAY_ROUTING, b as DEFAULT_LAYER_RESOURCES, c as DEFAULT_LAYER_STREAMS, f as GatewayRequestHeaders, g as GatewayRetryConfig, G as GatewayRoutingConfig, L as LayerConfig, a as LayerFullConfig, d as LayerGatewayConfig, e as LayerResourceUrls, S as ServiceLayer } from './layer-GNAVXBMf.js';
40
- import './types-De9M0Yin.js';
41
+ export { S as ShutdownDisposable, d as disposeAll, g as getRegisteredDisposableCount, r as registerDisposable, u as unregisterDisposable } from './shutdown-registry-CW9LryO8.js';
42
+ import './types-DYE90pls.js';
41
43
  import 'graphql';
42
44
  import 'graphql-yoga';
43
- import './client-u23M69Qt.js';
45
+ import './client-Dhi02YAf.js';
44
46
  import '@prisma/adapter-pg';
45
47
  import 'pg';
46
48
  import './workspace-extension-TquhDEKU.js';