@pattern-stack/codegen 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/dist/{chunk-VNBC3VXM.js → chunk-3A34R6CI.js} +7 -7
- package/dist/{chunk-I6UXRJ3Q.js → chunk-43SBT72G.js} +4 -4
- package/dist/{chunk-BK5ICA2F.js → chunk-4MVGAMUA.js} +4 -4
- package/dist/{chunk-KK5A7B2T.js → chunk-524YKITE.js} +134 -20
- package/dist/chunk-524YKITE.js.map +1 -0
- package/dist/{chunk-P7EZCTIN.js → chunk-6CJRZHV4.js} +11 -11
- package/dist/{chunk-COGHTKXY.js → chunk-7625PLY7.js} +4 -4
- package/dist/{chunk-5RT7JGKT.js → chunk-7OVCARTQ.js} +4 -4
- package/dist/{chunk-BHZP6LOV.js → chunk-CDLWYZVQ.js} +7 -7
- package/dist/{chunk-W2UIDI3R.js → chunk-CLWBNXKF.js} +4 -4
- package/dist/{chunk-AODME4YK.js → chunk-EEJC66ZF.js} +6 -6
- package/dist/{chunk-YK5JEVLX.js → chunk-FFUDEIFF.js} +6 -6
- package/dist/{chunk-VOYFPR3S.js → chunk-G3IKPDTP.js} +4 -4
- package/dist/chunk-G3IKPDTP.js.map +1 -0
- package/dist/{chunk-AJILKWGO.js → chunk-GMRTI7AK.js} +13 -13
- package/dist/{chunk-4OC5MSHO.js → chunk-GOO5ZMYO.js} +4 -4
- package/dist/{chunk-M3TIZGIB.js → chunk-GV337QP3.js} +9 -9
- package/dist/{chunk-CZQUOIDY.js → chunk-J7JMVS2B.js} +4 -4
- package/dist/{chunk-SZYZ4SHF.js → chunk-MBFSG4KQ.js} +10 -10
- package/dist/{chunk-T6SCOJF4.js → chunk-NXHL5YII.js} +4 -4
- package/dist/{chunk-XWBK3XJK.js → chunk-O2A6XHGD.js} +4 -4
- package/dist/{chunk-ATVGYF3D.js → chunk-QFUIE37H.js} +3 -3
- package/dist/{chunk-SGSWVNNB.js → chunk-R6F6KFIL.js} +7 -7
- package/dist/{chunk-MB5VVG4Z.js → chunk-TKU6VYG3.js} +11 -11
- package/dist/{chunk-DUMI2J5M.js → chunk-VQOAATIG.js} +4 -4
- package/dist/{chunk-E45CSC33.js → chunk-XKWOJZZ4.js} +2 -2
- package/dist/{chunk-MVKW2BCR.js → chunk-YULGWXCY.js} +4 -4
- package/dist/{chunk-HCAKMT64.js → chunk-YXI7K4MJ.js} +8 -8
- package/dist/runtime/base-classes/index.js +17 -17
- package/dist/runtime/subsystems/analytics/analytics.module.js +2 -2
- package/dist/runtime/subsystems/analytics/index.js +4 -4
- package/dist/runtime/subsystems/auth/auth.module.js +3 -3
- package/dist/runtime/subsystems/auth/index.js +7 -7
- package/dist/runtime/subsystems/bridge/bridge-delivery-handler.js +3 -3
- package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js +3 -3
- package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js +7 -7
- package/dist/runtime/subsystems/bridge/bridge.module.js +19 -19
- package/dist/runtime/subsystems/bridge/event-flow.service.js +2 -2
- package/dist/runtime/subsystems/bridge/index.js +23 -23
- package/dist/runtime/subsystems/cache/cache.module.js +2 -2
- package/dist/runtime/subsystems/cache/index.js +4 -4
- package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js +3 -3
- package/dist/runtime/subsystems/events/event-bus.memory-backend.js +2 -2
- package/dist/runtime/subsystems/events/events.module.d.ts +24 -7
- package/dist/runtime/subsystems/events/events.module.js +5 -5
- package/dist/runtime/subsystems/events/index.js +7 -7
- package/dist/runtime/subsystems/index.js +75 -75
- package/dist/runtime/subsystems/integration/build-change-source.js +2 -2
- package/dist/runtime/subsystems/integration/index.js +22 -22
- package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js +2 -2
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js +2 -2
- package/dist/runtime/subsystems/integration/integration.module.js +4 -4
- package/dist/runtime/subsystems/jobs/index.js +43 -43
- package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js +8 -8
- package/dist/runtime/subsystems/jobs/job-orchestrator.drizzle-backend.js +4 -4
- package/dist/runtime/subsystems/jobs/job-orchestrator.memory-backend.js +2 -2
- package/dist/runtime/subsystems/jobs/job-run-service.drizzle-backend.js +3 -3
- package/dist/runtime/subsystems/jobs/job-run-service.memory-backend.js +2 -2
- package/dist/runtime/subsystems/jobs/job-worker.bullmq-backend.js +3 -3
- package/dist/runtime/subsystems/jobs/job-worker.js +4 -4
- package/dist/runtime/subsystems/jobs/job-worker.module.js +12 -12
- package/dist/runtime/subsystems/jobs/jobs-domain.module.js +10 -10
- package/dist/runtime/subsystems/observability/index.js +3 -3
- package/dist/runtime/subsystems/observability/observability.module.js +3 -3
- package/dist/runtime/subsystems/observability/observability.service.js +2 -2
- package/dist/runtime/subsystems/storage/index.js +4 -4
- package/dist/runtime/subsystems/storage/storage.module.js +2 -2
- package/dist/src/cli/index.js +123 -84
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.d.ts +111 -1
- package/dist/src/index.js +10 -8
- package/package.json +1 -1
- package/runtime/subsystems/events/events.module.ts +24 -7
- package/dist/chunk-KK5A7B2T.js.map +0 -1
- package/dist/chunk-VOYFPR3S.js.map +0 -1
- /package/dist/{chunk-VNBC3VXM.js.map → chunk-3A34R6CI.js.map} +0 -0
- /package/dist/{chunk-I6UXRJ3Q.js.map → chunk-43SBT72G.js.map} +0 -0
- /package/dist/{chunk-BK5ICA2F.js.map → chunk-4MVGAMUA.js.map} +0 -0
- /package/dist/{chunk-P7EZCTIN.js.map → chunk-6CJRZHV4.js.map} +0 -0
- /package/dist/{chunk-COGHTKXY.js.map → chunk-7625PLY7.js.map} +0 -0
- /package/dist/{chunk-5RT7JGKT.js.map → chunk-7OVCARTQ.js.map} +0 -0
- /package/dist/{chunk-BHZP6LOV.js.map → chunk-CDLWYZVQ.js.map} +0 -0
- /package/dist/{chunk-W2UIDI3R.js.map → chunk-CLWBNXKF.js.map} +0 -0
- /package/dist/{chunk-AODME4YK.js.map → chunk-EEJC66ZF.js.map} +0 -0
- /package/dist/{chunk-YK5JEVLX.js.map → chunk-FFUDEIFF.js.map} +0 -0
- /package/dist/{chunk-AJILKWGO.js.map → chunk-GMRTI7AK.js.map} +0 -0
- /package/dist/{chunk-4OC5MSHO.js.map → chunk-GOO5ZMYO.js.map} +0 -0
- /package/dist/{chunk-M3TIZGIB.js.map → chunk-GV337QP3.js.map} +0 -0
- /package/dist/{chunk-CZQUOIDY.js.map → chunk-J7JMVS2B.js.map} +0 -0
- /package/dist/{chunk-SZYZ4SHF.js.map → chunk-MBFSG4KQ.js.map} +0 -0
- /package/dist/{chunk-T6SCOJF4.js.map → chunk-NXHL5YII.js.map} +0 -0
- /package/dist/{chunk-XWBK3XJK.js.map → chunk-O2A6XHGD.js.map} +0 -0
- /package/dist/{chunk-ATVGYF3D.js.map → chunk-QFUIE37H.js.map} +0 -0
- /package/dist/{chunk-SGSWVNNB.js.map → chunk-R6F6KFIL.js.map} +0 -0
- /package/dist/{chunk-MB5VVG4Z.js.map → chunk-TKU6VYG3.js.map} +0 -0
- /package/dist/{chunk-DUMI2J5M.js.map → chunk-VQOAATIG.js.map} +0 -0
- /package/dist/{chunk-E45CSC33.js.map → chunk-XKWOJZZ4.js.map} +0 -0
- /package/dist/{chunk-MVKW2BCR.js.map → chunk-YULGWXCY.js.map} +0 -0
- /package/dist/{chunk-HCAKMT64.js.map → chunk-YXI7K4MJ.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../runtime/subsystems/events/events.module.ts"],"sourcesContent":["/**\n * EventsModule — DynamicModule factory for the event bus subsystem.\n *\n * Register once in AppModule:\n * ```typescript\n * @Module({\n * imports: [\n * EventsModule.forRoot({ backend: 'drizzle' }),\n * ],\n * })\n * export class AppModule {}\n * ```\n *\n * Tests swap to the memory backend without touching application code:\n * ```typescript\n * Test.createTestingModule({\n * imports: [EventsModule.forRoot({ backend: 'memory' })],\n * });\n * ```\n *\n * Per-pool drain isolation (EVT-4):\n * ```typescript\n * EventsModule.forRoot({ backend: 'drizzle', pools: ['events_change'] });\n * ```\n * Each process restricts its drain loop to the pools listed here. `pools`\n * is undefined by default → drain all pending rows (backwards-compatible).\n *\n * Typed facade + multi-tenancy (EVT-6):\n * - `TYPED_EVENT_BUS` resolves to the generated `TypedEventBus` wrapping\n * whichever backend is selected.\n * - `multiTenant: true` makes `TypedEventBus.publish` throw\n * `MissingTenantIdError` when the caller forgets `metadata.tenantId`.\n *\n * `global: true` means entity modules do not need to import EventsModule\n * individually — the EVENT_BUS and TYPED_EVENT_BUS tokens are available\n * project-wide.\n *\n * Async configuration (`forRootAsync`):\n * The async factory returns `EventsModuleOptions`; the EVENT_BUS provider\n * then receives its backend dependencies — DRIZZLE for the drizzle\n * backend, REDIS_URL for the redis backend, the resolved options for the\n * memory backend — through a proper `useFactory` so Nest DI wires them\n * correctly. Earlier revisions hand-constructed backends with\n * `new Class()` which silently left `db` / `redisUrl` undefined\n * (issue #108).\n */\nimport {\n Inject,\n Injectable,\n Logger,\n Module,\n Optional,\n type DynamicModule,\n type OnModuleDestroy,\n type OnModuleInit,\n type Provider,\n type Type,\n} from '@nestjs/common';\nimport {\n EVENT_BUS,\n EVENT_READ_PORT,\n EVENTS_MODULE_OPTIONS,\n EVENTS_MULTI_TENANT,\n REDIS_URL,\n TYPED_EVENT_BUS,\n} from './events.tokens';\nimport { DRIZZLE } from '../../constants/tokens';\nimport type { DrizzleClient } from '../../types/drizzle';\nimport { DrizzleEventBus } from './event-bus.drizzle-backend';\nimport { MemoryEventBus } from './event-bus.memory-backend';\nimport type { IEventBus } from './event-bus.protocol';\nimport {\n EventScheduler,\n scheduledEventsFromRegistry,\n type RegistrySchedule,\n} from './event-scheduler';\n// #6 — `RedisEventBus` is lazy-loaded only when `backend: 'redis'` is selected.\n// The file is filtered out of the vendor set for non-redis installs (see\n// `backendFileFilter` in src/cli/commands/subsystem.ts); the dynamic-string\n// import below makes TS treat the specifier as `any` so the consumer's tsc\n// never tries to resolve the absent file.\nimport { TypedEventBus } from './generated/bus';\n\n/**\n * Lazy-load the Redis backend. Routed through a non-literal specifier so\n * the consumer's `tsc` doesn't resolve `./event-bus.redis-backend` at type\n * check time — important because that file is filtered out of drizzle/\n * memory installs (#6).\n */\nasync function loadRedisEventBus(): Promise<new (url: string) => object> {\n // Non-literal specifier — TS gives this an `any` module type, sidestepping\n // resolution of a file that may not be vendored.\n const specifier = './event-bus.redis-backend';\n const mod = (await import(specifier)) as { RedisEventBus: new (url: string) => object };\n return mod.RedisEventBus;\n}\n\nexport interface EventsModuleOptions {\n backend: 'drizzle' | 'memory' | 'redis';\n /**\n * Redis connection URL used when `backend` is `'redis'`.\n * Falls back to the REDIS_URL environment variable, then\n * `redis://localhost:6379` if neither is set.\n */\n redisUrl?: string;\n /**\n * Restrict the drain loop to these pools. Each pool name matches the\n * `domain_events.pool` column (populated from `event.metadata.pool` at\n * publish time). Leave undefined to drain all pending rows.\n *\n * Typical lane split: one process per `events_inbound` /\n * `events_change` / `events_outbound` so a slow outbound handler\n * cannot stall change-event propagation (see ADR-022).\n */\n pools?: string[];\n /**\n * LISTEN-NOTIFY-1 — when `true` (drizzle backend only), the drainer holds a\n * dedicated listener connection and LISTENs on `codegen_events_wake`. Each\n * `publish`/`publishMany` emits an in-tx `pg_notify(codegen_events_wake,\n * <pool>)` so the drainer wakes the moment the publishing transaction commits,\n * instead of waiting for the next poll tick. Polling continues unchanged as\n * the fallback heartbeat; a lost notify degrades to poll latency, never to\n * lost work. Defaults to `false`.\n *\n * Ignored by the memory + redis backends (memory dispatches inline; redis has\n * its own fan-out). Requires a direct (non-transaction-pooler) connection —\n * see the events/jobs config block re: PgBouncer.\n */\n listenNotify?: boolean;\n /**\n * Multi-tenancy opt-in (EVT-6).\n *\n * When `true`, every `TypedEventBus.publish()` call must supply\n * `opts.metadata.tenantId` — otherwise it throws `MissingTenantIdError`.\n * The tenantId is preserved on `event.metadata` and, for the Drizzle\n * backend, written to `domain_events.tenant_id` (EVT-4).\n *\n * Drain-side tenant filtering is deferred — the tenant-context model\n * (per-process vs. per-request vs. async-local-storage) is still\n * unsettled; see ADR-024 §Multi-tenancy. Only the publish-side\n * requirement ships here.\n *\n * Defaults to `false`.\n */\n multiTenant?: boolean;\n /**\n * The generated `TypedEventBus` class to bind to `TYPED_EVENT_BUS`.\n *\n * **Package mode (ADR-037).** When the runtime is imported from\n * `@pattern-stack/codegen` (not vendored), the bundled `./generated/bus`\n * `TypedEventBus` is typed to an EMPTY event union and reads the bundled\n * empty `eventRegistry` — a consumer's `events/*.yaml` are scanned into\n * `src/generated/events/bus.ts` (typed to THEIR union, reading THEIR\n * registry), which the package can't import. The generated subsystem barrel\n * therefore threads that class in here:\n * `EventsModule.forRoot({ ..., typedBus: TypedEventBus })`. Nest constructs\n * it with this module's `EVENT_BUS` + `EVENTS_MULTI_TENANT` providers (the\n * generated class injects the same string-valued tokens, which match across\n * the package boundary).\n *\n * Omitted (vendored mode / tests) ⇒ falls back to the bundled\n * `./generated/bus`, which in a vendored tree IS the consumer's generated\n * file. Without this, a package-mode consumer's typed `publish<'…'>()` calls\n * resolve against the empty union and their events never get the right\n * `pool` / `direction` stamped.\n *\n * Only consulted by `forRoot` (the path the barrel emits); `forRootAsync`\n * keeps the bundled bus.\n */\n typedBus?: Type<unknown>;\n /**\n * ADR-039 — the consumer's generated `eventRegistry`, threaded so the\n * `EventScheduler` can read the `schedule:` block + routing metadata of every\n * scheduled event. Package mode: the generated subsystem barrel passes the\n * consumer's `eventRegistry` (the bundled one is the package's empty/fixture\n * registry, which the package can't see the consumer's events through — same\n * reason `typedBus` is threaded). Omitted ⇒ no scheduler is spawned (vendored\n * tree reads its own bundled registry only if the barrel passes it; tests\n * pass a registry directly).\n *\n * Structural shape: each value needs `schedule?` + `direction` + `pool`. The\n * generated `EventMetadata` satisfies it; typing it loosely here avoids a\n * runtime dependency on the generated types from the module file.\n */\n eventRegistry?: Record<\n string,\n { schedule?: RegistrySchedule; direction: string | null; pool: string | null }\n >;\n}\n\n/**\n * Lifecycle holder for the `EventScheduler` (ADR-039). Registered as a provider\n * on the drizzle/memory `forRoot` branches; Nest drives `onModuleInit` (after\n * the bus is constructed) and `onModuleDestroy`. Reads the scheduled-event set\n * from the threaded `eventRegistry` and starts the materialiser. No-op when\n * nothing declared `schedule:`, or under the redis backend (no outbox history).\n */\n@Injectable()\nexport class EventSchedulerLifecycle implements OnModuleInit, OnModuleDestroy {\n private readonly logger = new Logger(EventSchedulerLifecycle.name);\n private scheduler: EventScheduler | null = null;\n\n constructor(\n @Inject(EVENT_BUS) private readonly bus: IEventBus,\n @Optional()\n @Inject(EVENTS_MODULE_OPTIONS)\n private readonly opts: EventsModuleOptions | null = null,\n ) {}\n\n async onModuleInit(): Promise<void> {\n const registry = this.opts?.eventRegistry;\n if (!registry) return;\n if (typeof this.bus.materializeScheduledEvent !== 'function') return; // redis\n const schedules = scheduledEventsFromRegistry(registry);\n if (schedules.length === 0) return;\n this.scheduler = new EventScheduler(this.bus, schedules);\n await this.scheduler.start();\n this.logger.log(`EventScheduler wired for ${schedules.length} scheduled event(s).`);\n }\n\n async onModuleDestroy(): Promise<void> {\n if (this.scheduler) {\n this.scheduler.stop();\n this.scheduler = null;\n }\n }\n}\n\nexport interface EventsModuleAsyncOptions {\n useFactory: (...args: unknown[]) => Promise<EventsModuleOptions> | EventsModuleOptions;\n inject?: unknown[];\n imports?: unknown[];\n}\n\n/**\n * Shared provider set: `TypedEventBus` itself, the `TYPED_EVENT_BUS` token\n * binding, and the resolved `EVENTS_MULTI_TENANT` flag. Returned from one\n * place so every `forRoot` branch and `forRootAsync` agree.\n */\nfunction buildTypedBusProviders(\n multiTenant: boolean,\n typedBus?: Type<unknown>,\n): Provider[] {\n // Package mode threads the consumer's generated `TypedEventBus` (typed to\n // their event union, reading their registry) via `typedBus`; vendored mode\n // omits it and we fall back to the bundled `./generated/bus` (which IS the\n // consumer's generated file in a vendored tree). See `EventsModuleOptions.typedBus`.\n const BusClass = typedBus ?? TypedEventBus;\n return [\n BusClass,\n { provide: TYPED_EVENT_BUS, useExisting: BusClass },\n { provide: EVENTS_MULTI_TENANT, useValue: multiTenant },\n ];\n}\n\n/**\n * Construct the backend instance for the async path, routing constructor\n * arguments through Nest-resolved dependencies.\n *\n * DRIZZLE is declared optional at inject time so that memory-backend\n * consumers aren't required to also import `DatabaseModule`. If the\n * drizzle backend is selected but no DRIZZLE provider is registered, we\n * throw a clear error instead of silently constructing a broken bus.\n */\nasync function buildEventBusAsync(\n options: EventsModuleOptions,\n db: DrizzleClient | null,\n redisUrl: string,\n): Promise<unknown> {\n if (options.backend === 'drizzle') {\n if (!db) {\n throw new Error(\n \"EventsModule.forRootAsync: backend: 'drizzle' selected but DRIZZLE provider is not available. \" +\n 'Ensure DatabaseModule (or another provider exposing DRIZZLE) is imported before EventsModule.forRootAsync.',\n );\n }\n return new DrizzleEventBus(db, options);\n }\n if (options.backend === 'redis') {\n // #6: lazy import — the redis backend ships only with `--backend redis`\n // installs; drizzle/memory consumers never touch the file.\n const RedisEventBus = await loadRedisEventBus();\n return new RedisEventBus(redisUrl);\n }\n return new MemoryEventBus(options);\n}\n\n@Module({})\nexport class EventsModule {\n static forRootAsync(asyncOptions: EventsModuleAsyncOptions): DynamicModule {\n return {\n module: EventsModule,\n global: true,\n imports: (asyncOptions.imports ?? []) as Parameters<typeof Module>[0]['imports'],\n providers: [\n {\n provide: EVENTS_MODULE_OPTIONS,\n useFactory: asyncOptions.useFactory,\n inject: (asyncOptions.inject ?? []) as (string | symbol | Function)[],\n },\n {\n provide: EVENTS_MULTI_TENANT,\n useFactory: (options: EventsModuleOptions) => options.multiTenant ?? false,\n inject: [EVENTS_MODULE_OPTIONS],\n },\n {\n provide: REDIS_URL,\n useFactory: (options: EventsModuleOptions) =>\n options.redisUrl ?? process.env['REDIS_URL'] ?? 'redis://localhost:6379',\n inject: [EVENTS_MODULE_OPTIONS],\n },\n {\n provide: EVENT_BUS,\n useFactory: (\n options: EventsModuleOptions,\n db: DrizzleClient | null,\n redisUrl: string,\n ) => buildEventBusAsync(options, db, redisUrl),\n inject: [\n EVENTS_MODULE_OPTIONS,\n { token: DRIZZLE, optional: true },\n REDIS_URL,\n ],\n },\n {\n // Read port (OBS-LIST-1). Drizzle + memory backends implement\n // IEventReadPort on the EVENT_BUS instance; the redis backend\n // retains no history, so EVENT_READ_PORT resolves to `null` and\n // optional consumers (the observability combiner) degrade to\n // empty results.\n provide: EVENT_READ_PORT,\n useFactory: (options: EventsModuleOptions, bus: unknown) =>\n options.backend === 'redis' ? null : bus,\n inject: [EVENTS_MODULE_OPTIONS, EVENT_BUS],\n },\n TypedEventBus,\n { provide: TYPED_EVENT_BUS, useExisting: TypedEventBus },\n ],\n exports: [EVENT_BUS, EVENT_READ_PORT, TYPED_EVENT_BUS, EVENTS_MULTI_TENANT],\n };\n }\n\n static forRoot(\n options: EventsModuleOptions = { backend: 'drizzle' },\n ): DynamicModule {\n const multiTenant = options.multiTenant ?? false;\n\n if (options.backend === 'redis') {\n const resolvedUrl =\n options.redisUrl ?? process.env['REDIS_URL'] ?? 'redis://localhost:6379';\n\n return {\n module: EventsModule,\n global: true,\n providers: [\n { provide: EVENTS_MODULE_OPTIONS, useValue: options },\n { provide: REDIS_URL, useValue: resolvedUrl },\n {\n // #6: useFactory + dynamic import so the consumer's tsc never\n // needs to resolve `event-bus.redis-backend.ts` for drizzle/\n // memory installs (the file is filtered out by\n // `backendFileFilter`). Nest awaits async factories + manages\n // lifecycle on the returned instance, so we drop the old bare\n // `RedisEventBus` provider entry.\n provide: EVENT_BUS,\n useFactory: async (url: string): Promise<object> => {\n const RedisEventBus = await loadRedisEventBus();\n return new RedisEventBus(url);\n },\n inject: [REDIS_URL],\n },\n ...buildTypedBusProviders(multiTenant, options.typedBus),\n ],\n exports: [EVENT_BUS, TYPED_EVENT_BUS, EVENTS_MULTI_TENANT],\n };\n }\n\n const provider =\n options.backend === 'drizzle'\n ? { provide: EVENT_BUS, useClass: DrizzleEventBus }\n : { provide: EVENT_BUS, useClass: MemoryEventBus };\n\n return {\n module: EventsModule,\n global: true,\n providers: [\n { provide: EVENTS_MODULE_OPTIONS, useValue: options },\n provider,\n // Read port (OBS-LIST-1): drizzle + memory backends implement\n // IEventReadPort on the same instance as EVENT_BUS. The redis\n // backend retains no history and does not provide this token.\n { provide: EVENT_READ_PORT, useExisting: EVENT_BUS },\n // ADR-039 — the scheduler lifecycle. No-op unless `eventRegistry` was\n // threaded AND some event declared `schedule:`. Drizzle/memory only\n // (the redis branch above never reaches here).\n EventSchedulerLifecycle,\n ...buildTypedBusProviders(multiTenant, options.typedBus),\n ],\n exports: [EVENT_BUS, EVENT_READ_PORT, TYPED_EVENT_BUS, EVENTS_MULTI_TENANT],\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAgCP,eAAe,oBAA0D;AAGvE,QAAM,YAAY;AAClB,QAAM,MAAO,MAAM,OAAO;AAC1B,SAAO,IAAI;AACb;AAuGO,IAAM,0BAAN,MAAuE;AAAA,EAI5E,YACsC,KAGnB,OAAmC,MACpD;AAJoC;AAGnB;AAAA,EAChB;AAAA,EAJmC;AAAA,EAGnB;AAAA,EAPF,SAAS,IAAI,OAAO,wBAAwB,IAAI;AAAA,EACzD,YAAmC;AAAA,EAS3C,MAAM,eAA8B;AAClC,UAAM,WAAW,KAAK,MAAM;AAC5B,QAAI,CAAC,SAAU;AACf,QAAI,OAAO,KAAK,IAAI,8BAA8B,WAAY;AAC9D,UAAM,YAAY,4BAA4B,QAAQ;AACtD,QAAI,UAAU,WAAW,EAAG;AAC5B,SAAK,YAAY,IAAI,eAAe,KAAK,KAAK,SAAS;AACvD,UAAM,KAAK,UAAU,MAAM;AAC3B,SAAK,OAAO,IAAI,4BAA4B,UA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AA,MAC3D;AAAA,IACF;AAEA,UAAM,WACJ,QAAQ,YAAY,YAChB,EAAE,SAAS,WAAW,UAAU,gBAAgB,IAChD,EAAE,SAAS,WAAW,UAAU,eAAe;AAErD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW;AAAA,QACT,EAAE,SAAS,uBAAuB,UAAU,QAAQ;AAAA,QACpD;AAAA;AAAA;AAAA;AAAA,QAIA,EAAE,SAAS,iBAAiB,aAAa,UAAU;AAAA;AAAA;AAAA;AAAA,QAInD;AAAA,QACA,GAAG,uBAAuB,aAAa,QAAQ,QAAQ;AAAA,MACzD;AAAA,MACA,SAAS,CAAC,WAAW,iBAAiB,iBAAiB,mBAAmB;AAAA,IAC5E;AAAA,EACF;AACF;AAjHa,eAAN;AAAA,EADN,OAAO,CAAC,CAAC;AAAA,GACG;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|