@bluelibs/runner - v5.5.0
    Preparing search index...

    Interface IResourceMiddlewareDefinition<TConfig, TEnforceInputContract, TEnforceOutputContract, TDependencies>

    interface IResourceMiddlewareDefinition<
        TConfig = any,
        TEnforceInputContract = void,
        TEnforceOutputContract = void,
        TDependencies extends DependencyMapType = any,
    > {
        configSchema?: IValidationSchema<TConfig>;
        dependencies?: TDependencies | ((config: TConfig) => TDependencies);
        everywhere?:
            | boolean
            | ((resource: IResource<any, any, any, any, any>) => boolean);
        id: string;
        meta?: IMiddlewareMeta;
        run: (
            input: IResourceMiddlewareExecutionInput<
                TEnforceInputContract extends void ? any : TEnforceInputContract,
                TEnforceOutputContract extends void ? any : TEnforceOutputContract,
            >,
            dependencies: DependencyValuesType<TDependencies>,
            config: TConfig,
        ) => Promise<any>;
        tags?: TagType[];
        throws?: ThrowsList;
    }

    Type Parameters

    • TConfig = any
    • TEnforceInputContract = void
    • TEnforceOutputContract = void
    • TDependencies extends DependencyMapType = any

    Hierarchy (View Summary)

    Index

    Properties

    configSchema?: IValidationSchema<TConfig>

    Optional validation schema for runtime config validation. When provided, middleware config will be validated when .with() is called.

    dependencies?: TDependencies | ((config: TConfig) => TDependencies)

    Static or lazy dependency map.

    everywhere?:
        | boolean
        | ((resource: IResource<any, any, any, any, any>) => boolean)
    id: string
    run: (
        input: IResourceMiddlewareExecutionInput<
            TEnforceInputContract extends void ? any : TEnforceInputContract,
            TEnforceOutputContract extends void ? any : TEnforceOutputContract,
        >,
        dependencies: DependencyValuesType<TDependencies>,
        config: TConfig,
    ) => Promise<any>

    The middleware body, called with resource execution input.

    tags?: TagType[]
    throws?: ThrowsList

    Declares which typed errors are part of this middleware's contract. Declarative only — does not imply DI or enforcement.