interface CqrsPluginOptions
Since 0.1.0

Options for CqrsPlugin.

Properties

Since 0.1.0
optional
commandHandlers: readonly CommandHandlerRegistration[]

Command handlers registered on the command bus at register() time.

The declarative alternative to resolving CAPABILITIES.COMMAND_BUS and calling register imperatively — which application code has no phase to do, since IApplication exposes no lifecycle hooks and the bus does not exist until the plugin has registered.

Default: [] (no handlers).

Since 0.1.0
optional
queryHandlers: readonly QueryHandlerRegistration[]

Query handlers registered on the query bus at register() time.

Default: [] (no handlers).

optional
behaviors: readonly (IPipelineBehavior | RegistryFactory<IPipelineBehavior>)[]

Pipeline behaviors applied to every command and query execution.

Behaviors are invoked in declared order. Each behavior receives the request and a next() function; returning without calling next() short-circuits the pipeline (the handler and later behaviors do not run).

An entry is either a behavior instance or a factory that builds one from the service registry. At the onInit phase the WHOLE list is resolved in declared order and installed on both buses, so a mixed list runs in declared order — not instances-then-factories.

Default: [] (no behaviors).

Usage

import { type CqrsPluginOptions } from "cqrs-plugin/src/index.ts";