DVStudioApi class

The Studio API, for requests already decided to be the admin's and allowed.

Constructors

DVStudioApi({List<DVStudioModelSpec> models = const <DVStudioModelSpec>[], DVDatabaseAdapter? database, Future<String?> caller(Request request)?, DVAccountDirectory? accounts, List<String> queues()?, String? root, String? sourceRoot, List<Map<String, Object?>> compiledRoutes()?, String? structureRoot, DVGitHubTransport? gitHub, String? gitHubToken})

Properties

database → DVDatabaseAdapter?
The application's database. Null answers every data endpoint 503: a process with no database has no records, pages or grants to show.
final
hashCode → int
The hash code for this object.
no setterinherited
models → List<DVStudioModelSpec>
The models compiled into this build.
final
root → String?
The directory Studio is served from, where the build writes the project graph and each page's captured structure. Null lists no compiled page.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceRoot → String?
The project's source tree, on a development server: a model designed in Studio can be written out to lib/models there. Null on a deployed server, which has no source to keep in step.
final

Methods

allModels() → Future<List<DVStudioModelSpec>>
Every data model: the ones compiled into this build, then the ones designed in Studio.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(DVStudioModelSpec spec, DVRecordTable table) → Future<void>
Makes sure spec's table has every column its fields name and every index it asks for.
respond(Request request, String rest) → Future<Response>
The answer to request, whose path below the API is rest (no leading slash).
respondRecords(Request request, DVStudioModelSpec spec, List<String> rest, {String? method}) → Future<Response>
The records of spec, for a caller something else has already decided may reach them: the data API of the models designed in Studio.
sitePages({List<Map<String, Object?>>? compiled}) → Future<List<DVStudioSitePage>>
Every page this application answers: the routes a build compiled alongside the documents stored here, each marked for what it is.
storedModels() → Future<List<DVStudioModelSpec>>
The models designed in Studio, from the application's database.
toString() → String
A string representation of this object.
inherited

Operators

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