Interface IResourceMiddlewareDefinition<TConfig, TEnforceInputContract, TEnforceOutputContract, TDependencies>
interface IResourceMiddlewareDefinition<TConfig, TEnforceInputContract, TEnforceOutputContract, TDependencies> { configSchema?: IValidationSchema<TConfig>; dependencies?: TDependencies | ((config: TConfig) => TDependencies); everywhere?: boolean | ((resource: IResource<any, any, any, any, any, TagType[], ResourceMiddlewareAttachmentType[]>) => 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[]; } Type Parameters
- TConfig = any
- TEnforceInputContract = void
- TEnforceOutputContract = void
- TDependencies extends DependencyMapType = any
- IResourceMiddlewareDefinition
Properties
Optional validation schema for runtime config validation. When provided, middleware config will be validated when .with() is called.