APIDBModule class

Inheritance

Constructors

APIDBModule(APIRoot apiRoot, {String name = 'db', bool onlyOnDevelopment = true, APICredential? credential})

Properties

allRoutesNames → Set<String>
Returns all the routes names.
no setterinherited
apiConfig → APIConfig
The APIConfig from apiRoot.
no setterinherited
apiRoot → APIRoot
The API root, that is loading this module.
finalinherited
authenticationRoute → String
no setterinherited
basePath → String
no setter
credential → APICredential?
final
defaultRouteName → String?
The default route to use when the request doesn't match.
no setteroverride
development → bool
no setter
entityRepositoryProviders → Future<List<EntityRepositoryProvider>>
no setter
hashCode → int
The hash code for this object.
no setterinherited
initializationStatus → InitializationStatus
Returns the current InitializationStatus.
no setterinherited
isAsyncInitialization → bool
Returns true if this instance initialization was asynchronous.
no setterinherited
isInitialized → bool
Returns true if this instance is already initialized.
no setterinherited
isInitializing → bool
Returns true if this instance is in the middle of the initialization process.
no setterinherited
name → String
The name of this API module.
finalinherited
onlyOnDevelopment → bool
final
routes → APIRouteBuilder<APIModule>
Returns the routes builder of this module.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
security → APISecurity?
no setterinherited
version → String?
Optional module version.
finalinherited

Methods

acceptsRequest(APIRequest apiRequest) → bool
Returns true if apiRequest is an accepted route/call for this module.
inherited
addRoute(APIRequestMethod? method, String name, APIRouteFunction function, {Map<String, TypeInfo>? parameters, Iterable<APIRouteRule>? rules, APIRouteConfig? config}) → APIModule
Adds a route, of name, to this module.
inherited
addRouteHandler(APIRouteHandler routeHandler) → APIModule
Adds a routeHandler, of name, to this module.
inherited
apiInfo([APIRequest? apiRequest]) → APIModuleInfo
Returns a APIModuleInfo.
inherited
call<T>(APIRequest request) → FutureOr<APIResponse<T>>
Calls a route for request.
inherited
checkAuthentication(APIRequest request) → Future<APIResponse<Object>?>
checkInitialized() → void
Checks if this instance is initialized.
inherited
configure() → void
Configures this API module. Usually defines the routes of this instance.
override
delete(String table, APIRequest apiRequest, Object? id) → Future<APIResponse<String>>
doInitialization({Initializable? parent}) → FutureOr<InitializationResult>
Initialize this instance if is not initialized yet.
inherited
dump(bool zip) → Future<APIResponse<Object>>
ensureConfigured() → void
inherited
ensureInitialized({Initializable? parent}) → FutureOr<InitializationResult>
Ensures that this instance is initialized.
inherited
ensureInitializedAsync({Initializable? parent}) → FutureOr<InitializationResult>
Ensures that this instance is initialized. If is not initialized yet it will force an asynchronous initialization and return a Future.
inherited
executeInitialized<R>(ExecuteInitializedCallback<R> callback, {Initializable? parent}) → FutureOr<R>
Executes the callback ensuring that this instances was fully initialized.
inherited
getRouteHandler<T>(String name, [APIRequestMethod? method]) → APIRouteHandler<T>?
Returns a route handler for name.
inherited
getRouteHandlerByRequest<T>(APIRequest request, [String? routeName]) → APIRouteHandler<T>?
Returns a route handler for request.
inherited
getRoutesHandlersNames({APIRequestMethod? method}) → Iterable<String>
Returns the routes names for method.
inherited
initialize() → FutureOr<InitializationResult>
Initialization implementation. Do not call it directly, use doInitialization.
inherited
initializeDependencies() → FutureOr<List<Initializable>>
Return a List of Initializable instances that need to be initialized BEFORE initialize this instance.
inherited
insert(String table, APIRequest apiRequest, {Object? id}) → Future<APIResponse<String>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveRoute(APIRequest request) → String
Resolves the route name of the request.
inherited
select(String table, APIRequest apiRequest, {bool? eager, bool json = false, int? limit, int? offset, int? page, bool? orderByID, OrderDirection? orderDirection}) → Future<APIResponse>
tables({bool json = false}) → Future<APIResponse>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

selectQueryDirectives → const List<String>
The directives accepted by the query String of select, as &-joined KEY=VALUE tokens. Everything else in the query String is the entity condition query.