PipelineContext
Defined in: packages/pipeline/src/pipeline.context.ts:128
Concrete pipeline context created per request. Pre-computed handler metadata is injected via PipelineHandlerMeta.
Extends
Section titled “Extends”BasePipelineContext<TRequest,TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
Section titled “TRequest”TRequest = unknown
TResponse
Section titled “TResponse”TResponse = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PipelineContext<
TRequest,TResponse>(request,meta):PipelineContext<TRequest,TResponse>
Defined in: packages/pipeline/src/pipeline.context.ts:154
Parameters
Section titled “Parameters”request
Section titled “request”TRequest
Returns
Section titled “Returns”PipelineContext<TRequest, TResponse>
Overrides
Section titled “Overrides”BasePipelineContext.constructor
Properties
Section titled “Properties”behaviorOptionsMap
Section titled “behaviorOptionsMap”
protectedreadonlybehaviorOptionsMap:Map<BehaviorId,Record<string,unknown>> |undefined
Defined in: packages/pipeline/src/pipeline.context.ts:138
Options per behavior for this handler: global [Behavior, opts] tuple
options, shallowly overridden by the call site’s options.
Overrides
Section titled “Overrides”BasePipelineContext.behaviorOptionsMap
handlerName
Section titled “handlerName”
readonlyhandlerName:string
Defined in: packages/pipeline/src/pipeline.context.ts:135
The handler class name string, e.g. “CreateUserHandler”.
Overrides
Section titled “Overrides”BasePipelineContext.handlerName
handlerType
Section titled “handlerType”
readonlyhandlerType:Constructor
Defined in: packages/pipeline/src/pipeline.context.ts:134
The handler class (constructor) that will process this request.
Overrides
Section titled “Overrides”BasePipelineContext.handlerType
readonlyitems:Map<string|symbol,unknown>
Defined in: packages/pipeline/src/pipeline.context.ts:79
Bag for sharing arbitrary data between behaviors in the same execution. Supports string and unique symbol keys.
Inherited from
Section titled “Inherited from”requestKind
Section titled “requestKind”
readonlyrequestKind:"command"|"query"|"event"|"unknown"
Defined in: packages/pipeline/src/pipeline.context.ts:136
‘command’, ‘query’, or ‘event’: declared when wrapping, or read from the request’s brand.
Overrides
Section titled “Overrides”BasePipelineContext.requestKind
requestName
Section titled “requestName”
readonlyrequestName:string
Defined in: packages/pipeline/src/pipeline.context.ts:133
The class name string, e.g. “CreateUserCommand”.
Overrides
Section titled “Overrides”BasePipelineContext.requestName
requestType
Section titled “requestType”
readonlyrequestType:Constructor<TRequest>
Defined in: packages/pipeline/src/pipeline.context.ts:132
The class (constructor) of the command/query/event.
Overrides
Section titled “Overrides”BasePipelineContext.requestType
startedAt
Section titled “startedAt”
readonlystartedAt:Date
Defined in: packages/pipeline/src/pipeline.context.ts:74
UTC timestamp when the pipeline execution started.
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”correlationId
Section titled “correlationId”Get Signature
Section titled “Get Signature”get correlationId():
string
Defined in: packages/pipeline/src/pipeline.context.ts:34
Immutable correlation ID for distributed tracing: the current correlation
id when the pipeline starts (from @cqrs-ddd/pipeline-correlation, or the
enclosing pipeline), otherwise a new one from the correlation source’s
create() (uuidv7() without one). Nested dispatches
inherit it.
Returns
Section titled “Returns”string
Immutable correlation ID for distributed tracing: the current correlation
id when the pipeline starts (from @cqrs-ddd/pipeline-correlation, or the
enclosing pipeline), otherwise a new one from the correlation source’s
create() (uuidv7() without one). Nested dispatches
inherit it.
Inherited from
Section titled “Inherited from”BasePipelineContext.correlationId
request
Section titled “request”Get Signature
Section titled “Get Signature”get request():
TRequest
Defined in: packages/pipeline/src/pipeline.context.ts:145
The input of this execution, or the replacement a behavior handed in.
Returns
Section titled “Returns”TRequest
The command/query/event instance with all its property values.
Overrides
Section titled “Overrides”response
Section titled “response”Get Signature
Section titled “Get Signature”get response():
TResponse|undefined
Defined in: packages/pipeline/src/pipeline.context.ts:85
The handler’s return value. Read-only for behaviors.
Returns
Section titled “Returns”TResponse | undefined
The handler’s return value, set automatically after the real handler executes.
Available to behaviors in their post-next() code path.
undefined before the handler runs or for event handlers that return void.
Inherited from
Section titled “Inherited from”tenantId
Section titled “tenantId”Get Signature
Section titled “Get Signature”get tenantId():
string|undefined
Defined in: packages/pipeline/src/pipeline.context.ts:48
Active tenant identifier for multi-tenant pipeline executions.
Returns
Section titled “Returns”string | undefined
Tenant of this execution: the current tenant when the pipeline starts
(from @cqrs-ddd/pipeline-tenant, or the enclosing pipeline), which nested
dispatches inherit. Absent when there is none; tenant-scoped behaviors
then fail closed.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[SET_CORRELATION_ID]()
Section titled “[SET_CORRELATION_ID]()”[SET_CORRELATION_ID](
value):void
Defined in: packages/pipeline/src/pipeline.context.ts:39
Internal
Assigns the ID before the behavior chain starts.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”BasePipelineContext.[SET_CORRELATION_ID]
[SET_REQUEST]()
Section titled “[SET_REQUEST]()”[SET_REQUEST](
value):void
Defined in: packages/pipeline/src/pipeline.context.ts:150
Replaces the input the handler receives; see replaceRequest.
Parameters
Section titled “Parameters”TRequest
Returns
Section titled “Returns”void
[SET_RESPONSE]()
Section titled “[SET_RESPONSE]()”[SET_RESPONSE](
value):void
Defined in: packages/pipeline/src/pipeline.context.ts:93
Symbol-keyed setter — only callable by code that imports SET_RESPONSE.
This keeps response effectively readonly for behaviors.
Parameters
Section titled “Parameters”TResponse | undefined
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”BasePipelineContext.[SET_RESPONSE]
[SET_TENANT_ID]()
Section titled “[SET_TENANT_ID]()”[SET_TENANT_ID](
value):void
Defined in: packages/pipeline/src/pipeline.context.ts:58
Assigns the tenant once per execution. A different value after one is set (by the runner, from the tenant source or the enclosing pipeline) throws, so a behavior cannot move an execution to another tenant after an earlier behavior has used it.
Parameters
Section titled “Parameters”string | undefined
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”BasePipelineContext.[SET_TENANT_ID]
getBehaviorOptions()
Section titled “getBehaviorOptions()”getBehaviorOptions<
T>(behaviorType):T|undefined
Defined in: packages/pipeline/src/pipeline.context.ts:115
Returns the options for a behavior on this handler: the options from a
global [Behavior, opts] tuple, shallowly overridden by the options of the
call site’s [Behavior, opts] entry.
Type Parameters
Section titled “Type Parameters”T = Record<string, unknown>
Parameters
Section titled “Parameters”behaviorType
Section titled “behaviorType”Returns
Section titled “Returns”T | undefined