Skip to content

compilePipelinePlan

compilePipelinePlan(declaration): object

Defined in: packages/pipeline/src/services/pipeline-plan.ts:48

Compiles a pipeline declaration into its effective, ordered behaviors and merged options, without resolving instances. Global before behaviors come first, then the handler’s own, then global after ones; a handler entry for a global behavior supplies options at the global position.

PipelineDeclaration

object

behaviorTypes: Constructor<IPipelineBehavior<unknown, unknown>>[]

globalBehaviorIds: Set<BehaviorId>

globalOptions: Map<BehaviorId, Record<string, unknown>>

handlerBehaviorTypes: Constructor<IPipelineBehavior<unknown, unknown>>[] | undefined

handlerOptions: Map<BehaviorId, Record<string, unknown>> | undefined

hasPipeline: boolean

mergedOptions: Map<BehaviorId, Record<string, unknown>>

Error when one behavior is both skipped and declared.

const plan = compilePipelinePlan({
handlerName: 'getPrice',
requestKind: 'query',
handlerBehaviorTypes: [CacheBehavior],
globalBehaviors: { before: [LoggingBehavior] },
});
plan.behaviorTypes; // [LoggingBehavior, CacheBehavior]