Skip to content

@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

InterfaceDescription
CacheMiddlewareContextMutable context threaded through a model's cache-middleware pipeline. Handlers read the metadata and transform value in place (or reassign it).
CacheMiddlewarePipelineA 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 AliasDescription
CacheMiddlewareHandlerA single cache-middleware handler (chain-of-responsibility; must call next).
CacheMiddlewareInputUser-supplied cache middleware: one handler or an ordered list of handlers.
CacheMiddlewarePhaseThe phase a cache-middleware pipeline runs in.

Variables

VariableDescription
resourcefulRouterMacro-
versionThe current version of the package.

Functions

FunctionDescription
registerRelationCacheTargetsForModelRegisters a model's configured cacheable 1:1 relations as process-global cache TARGETS, independent of ever constructing a CachingPreloader for it.
resourcefulBelongsToDecorator to define a resourceful belongsTo relationship on a Lucid model property.
resourcefulColumnDecorator to define a resourceful column on a Lucid model property. Applies validation, metadata, and Lucid column options.
resourcefulComputedDecorator to define a resourceful computed accessor on a Lucid model property. Applies validation, metadata, and Lucid computed options.
resourcefulHasManyDecorator to define a resourceful hasMany relationship on a Lucid model property.
resourcefulHasManyThroughDecorator to define a resourceful hasManyThrough relationship on a Lucid model property.
resourcefulHasOneDecorator to define a resourceful hasOne relationship on a Lucid model property.
resourcefulManyToManyDecorator to define a resourceful manyToMany relationship on a Lucid model property.
withResourcefulCreates 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