Skip to content

@nhtio/lucid-resourceful/types

Types utilized by @nhtio/lucid-resourceful

Namespaces

NamespaceDescription
OpenAPIV3-

Interfaces

InterfaceDescription
AdditionalResourcefulRouteDetailsAdditional route details with OpenAPI metadata
AdditionalResourcefulRoutesMap-
AdvancedResourcefulMixinOptions-
ApplicationServiceApplication service is a singleton resolved from the container
BaseInterfaceBase interface for all Resourceful data type options. Includes common modifier properties that apply to all data types.
DateTimeA DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.
ExternalDocumentationObject-
GeneratedRouteGenerated route configuration used internally by services
HttpContextHttp context encapsulates properties for a given HTTP request. The context class can be extended using macros and getters.
LocalResourcefulPropertyDefinition-
LucidModelShape of the model static properties. The $ prefix is to denote special properties from the base model.
ModelQueryBuilderContractModel query builder will have extras methods on top of the Database query builder
NormalizedAdditionalResourcefulRouteDetailsNormalized additional route details for internal processing
NormalizedAdditionalResourcefulRoutesNormalized additional routes for internal processing
NormalizedResourcefulRouterOptionsNormalized configuration options for internal processing
ODataRouterMacro-
ODataRouterService-
OpenApiGeneratorServiceOpenAPI generator service interface
ParsedNamedMiddlewareParsed named middleware type
ResolvedResourcefulHttpContext-
ResourcefulAccessControlFilter-
ResourcefulArrayTypeOptionsConfiguration options for ResourcefulArrayType instances. Defines array schemas with typed items and validation constraints. Supports complex item types including nested objects and arrays.
ResourcefulBigintTypeOptionsConfiguration options for ResourcefulBigintType instances. Defines validation rules and constraints for 64-bit integer fields in OpenAPI schemas.
ResourcefulBinaryTypeOptionsConfiguration options for ResourcefulBinaryType instances. Defines constraints for binary data represented as base64-encoded strings.
ResourcefulBooleanTypeOptionsConfiguration options for ResourcefulBooleanType instances. Currently has no specific configuration options as boolean types are straightforward.
ResourcefulColumnDefinition-
ResourcefulComputedAccessorDefinition-
ResourcefulDateTimeTypeOptionsConfiguration options for ResourcefulDateTimeType instances. Represents date-time values formatted as ISO 8601 date-time strings.
ResourcefulDateTypeOptionsConfiguration options for ResourcefulDateType instances. Represents date-only values formatted as ISO 8601 date strings.
ResourcefulErrorMiddlewareHeadersConfiguration object for custom HTTP headers to be included in error responses. Allows for CORS headers, security headers, API versioning, or any custom headers that should be consistently applied to all error responses.
ResourcefulErrorMiddlewareOptionsConfiguration options for the ResourcefulErrorMiddleware class. Defines event handlers for different error types and response formatting options.
ResourcefulFormattedErrorStandardized error response format used by the ResourcefulErrorMiddleware. Provides consistent structure for all API error responses with support for field-level validation details and error chaining.
ResourcefulFormattedErrorDetailsIndividual error detail within a formatted error response. Provides field-level information for validation errors or error chain details.
ResourcefulGeneralAccessControlFilter-
ResourcefulHooksCombined hook interface providing both query scoping and payload validation.
ResourcefulIndexResponse-
ResourcefulIndexResultResult object returned by the resourceful index/list operation.
ResourcefulIntegerTypeOptionsConfiguration options for ResourcefulIntegerType instances. Defines validation rules and constraints for 32-bit integer fields in OpenAPI schemas.
ResourcefulMixinOptions-
ResourcefulModelEnhanced Lucid model interface providing resourceful CRUD functionality.
ResourcefulModelColumnMetaSchema-
ResourcefulModelComputedAccessorMetaSchema-
ResourcefulModelMetaSchema-
ResourcefulModelRelationshipMetaSchema-
ResourcefulNumberTypeOptionsConfiguration options for ResourcefulNumberType instances. Defines validation rules and constraints for numeric fields in OpenAPI schemas.
ResourcefulObjectTypeOptionsConfiguration options for ResourcefulObjectType instances. Defines complex object schemas with typed properties and validation rules. Supports advanced OpenAPI features like oneOf, allOf, anyOf, and not operators.
ResourcefulOpenAPISpecOpenAPI specification structure for resourceful endpoints
ResourcefulPayloadSchemaGetterFunction type for generating request-specific payload validation schemas.
ResourcefulPayloadValidatorGetterFunction type for generating payload validation schemas based on request context.
ResourcefulPolicy-
ResourcefulPropertyDefinition-
ResourcefulQueryScopeCallbackFunction type for applying query-level scoping to database queries.
ResourcefulRelationshipDefinition-
ResourcefulResourceAccessControlFilter-
ResourcefulRouterMacroMain resourceful router macro function signature
ResourcefulRouterModelMappedOptions-
ResourcefulRouterModelOptions-
ResourcefulRouterModelServiceOptions-
ResourcefulRouterMutatorOptions-
ResourcefulRouterOptionsConfiguration options for the resourceful router macro
ResourcefulSecuritySchemaDefinition-
ResourcefulStringTypeOptionsConfiguration options for ResourcefulStringType instances. Defines validation rules and constraints for string-based fields in OpenAPI schemas.
ResourcefulUnsignedIntegerTypeOptionsConfiguration options for ResourcefulUnsignedIntegerType instances. Defines validation rules and constraints for unsigned integer fields in OpenAPI schemas.
RouteGeneratorServiceRoute generator service interface
RouterRegistrationServiceRouter registration service interface (AdonisJS router type to be defined)
ServableResourcefulIndexResult-
ValidationScoper-

Type Aliases

Type AliasDescription
BaseClassBase type constraint for abstract constructor functions used in data type generation.
BaseModel-
CallableNewableA hybrid type that represents a constructor function which can be called both with and without the new keyword. This type enables creating data type classes that work as both constructors and factory functions.
ComputedOptionsRepresents a computed property on the model
ConstructorConstructor type for controllers
DataTypeColumnOptions-
DataTypeComputedOptions-
DateColumnOptionsOptions for date columns including autoCreate and autoUpdate flags.
EventMapThe default shape of the event map.
GetControllerHandlersController handler methods type
HasManyThroughRelationOptionsOptions for hasManyThrough relation decorators.
KeyA utility type used to extract the event key from the event map.
LazyImportLazy import type for controllers
ListenerA utility type used to extract the shape of the listener function from the event map.
LucidBinaryValue-
LucidPlainObject-
MacroModelsMapMap of resource names to their corresponding ResourcefulModel classes
MiddlewareAsClass-
MiddlewareFnMiddleware function type (simplified for now)
ModelColumnOptionsShape of column options after they have set on the model
NormalizeConstructorNormalizes constructor to work with mixins. There is an open bug for mixins to allow constructors other than ...args: any[]
OneOrMoreOne or more middleware items
PromiseAble-
Promised-
RelatedModelRelationOptionsOptions for relation decorators on related models.
Resolvable-
ResolvedModelsMapResolved map of resource names to their corresponding ResourcefulModel classes
ResourcefulACLOperationType-
ResourcefulACLOperationType-
ResourcefulDataTypeUnion type representing all available resourceful data types. Provides a comprehensive type for working with any resourceful data type instance.
ResourcefulEnum-
ResourcefulEnumObject-
ResourcefulErrorHandlerMethod-
ResourcefulErrorHandlerMethod-
ResourcefulErrorMiddlewareEventsEvent map defining the types of errors that can be emitted by the ResourcefulErrorMiddleware. Each event type maps to the specific error instance that will be passed to event handlers.
ResourcefulHttpVerb-
ResourcefulIndexResponseHook-
ResourcefulMixinEventMap-
ResourcefulModelFieldRelationshipMeta-
ResourcefulModelOpenApiRelatedSchema-
ResourcefulModelOpenApiSchema-
ResourcefulModelPropertyMetaSchema-
ResourcefulModelRelationshipMeta-
ResourcefulModelRelationshipMetaChoice-
ResourcefulModelSerializableAttributes-
ResourcefulPropertySchema-
ResourcefulResponseFormat-
ResourcefulRouterOperation-
ResourcefulRouterOptionsExcludedFromModelOptions-
ResourcefulRouterVerb-
ResourcefulRouterVerbMetaOperation-
ResourcefulScopeHooksArray of query scope callback functions.
ResourcefulValidationHooksArray of payload validation schema getter functions.
ResourceResourcefulRecordResponse-
ResourceResourcefulRecordResponseHook-
RouteCallbackRoute callback that can be either a function or controller tuple
RouteFnRoute callback function type
SchemaUnion type of all available Joi schema types
VineValidationErrorType alias for Vine validation errors thrown by the VineJS validation library.

Variables

VariableDescription
odataRouterMacro-
ResourcefulHttpVerb-
ResourcefulResponseFormat-
ResourcefulRouterOperation-
ResourcefulRouterVerb-
ResourcefulRouterVerbMetaOperation-

References

AnySchema

Re-exports AnySchema


ArraySchema

Re-exports ArraySchema


BinarySchema

Re-exports BinarySchema


BooleanSchema

Re-exports BooleanSchema


DatabaseQueryBuilderContract

Re-exports DatabaseQueryBuilderContract


DateSchema

Re-exports DateSchema


NumberSchema

Re-exports NumberSchema


ObjectSchema

Re-exports ObjectSchema


StringSchema

Re-exports StringSchema


ValidationError

Re-exports ValidationError