@nhtio/lucid-resourceful
A decorator-driven AdonisJS library that lets you annotate Lucid ORM models with metadata to automatically generate CRUD controllers, validation rules, OpenAPI schemas, and a unified query interface.
Interfaces
| Interface | Description |
|---|---|
| CacheMiddlewareContext | Mutable context threaded through a model's cache-middleware pipeline. Handlers read the metadata and transform value in place (or reassign it). |
| CacheMiddlewarePipeline | A built, reusable cache-middleware pipeline. Structurally a @nhtio/middleware Middleware, but typed via this local interface so the package's public types do NOT pull @nhtio/middleware's declarations into the bundled .d.ts surface. |
Type Aliases
| Type Alias | Description |
|---|---|
| CacheMiddlewareHandler | A single cache-middleware handler (chain-of-responsibility; must call next). |
| CacheMiddlewareInput | User-supplied cache middleware: one handler or an ordered list of handlers. |
| CacheMiddlewarePhase | The phase a cache-middleware pipeline runs in. |
Variables
| Variable | Description |
|---|---|
| resourcefulRouterMacro | - |
| version | The current version of the package. |
Functions
| Function | Description |
|---|---|
| registerRelationCacheTargetsForModel | Registers a model's configured cacheable 1:1 relations as process-global cache TARGETS, independent of ever constructing a CachingPreloader for it. |
| resourcefulBelongsTo | Decorator to define a resourceful belongsTo relationship on a Lucid model property. |
| resourcefulColumn | Decorator to define a resourceful column on a Lucid model property. Applies validation, metadata, and Lucid column options. |
| resourcefulComputed | Decorator to define a resourceful computed accessor on a Lucid model property. Applies validation, metadata, and Lucid computed options. |
| resourcefulHasMany | Decorator to define a resourceful hasMany relationship on a Lucid model property. |
| resourcefulHasManyThrough | Decorator to define a resourceful hasManyThrough relationship on a Lucid model property. |
| resourcefulHasOne | Decorator to define a resourceful hasOne relationship on a Lucid model property. |
| resourcefulManyToMany | Decorator to define a resourceful manyToMany relationship on a Lucid model property. |
| withResourceful | Creates a mixin that adds resourceful CRUD functionality to Lucid models. |
References
CacheDuration
Re-exports CacheDuration
CacheServiceLike
Re-exports CacheServiceLike
definitions
Renames and re-exports @nhtio/lucid-resourceful/definitions
errors
Renames and re-exports @nhtio/lucid-resourceful/errors
isRelationCacheTarget
Re-exports isRelationCacheTarget
odataRouterMacro
Re-exports odataRouterMacro
registerRelationCacheTarget
Re-exports registerRelationCacheTarget
RelationCacheEntryOptions
Re-exports RelationCacheEntryOptions
RelationCacheEvent
Re-exports RelationCacheEvent
RelationCacheEventContext
Re-exports RelationCacheEventContext
RelationsCacheErrorHandler
Re-exports RelationsCacheErrorHandler
RelationsCacheEventHandler
Re-exports RelationsCacheEventHandler
RelationsCacheServiceResolver
Re-exports RelationsCacheServiceResolver
resetDefaultOnRelationsCacheError
Re-exports resetDefaultOnRelationsCacheError
resetDefaultOnRelationsCacheEvent
Re-exports resetDefaultOnRelationsCacheEvent
resetRelationCacheTargets
Re-exports resetRelationCacheTargets
setDefaultOnRelationsCacheError
Re-exports setDefaultOnRelationsCacheError
setDefaultOnRelationsCacheEvent
Re-exports setDefaultOnRelationsCacheEvent
setDefaultRelationsCacheService
Re-exports setDefaultRelationsCacheService