dartvel_core library

Classes

AlgoliaSearchProvider<TModel, TFacets>
Algolia query endpoint.
Analytics
Analytics manager supporting multiple providers
AnalyticsEvent
AnalyticsProvider
AnthropicDVAIAdapter
Talks to the Anthropic Messages API (POST /v1/messages).
ApnsPushProvider
Apple Push Notification service.
Auth
Auth manager
AuthProvider
Authentication provider
AuthUser
User model
BillingPlan
BuildConfig
Platform-specific build configuration
Delete
Annotation for a DELETE handler
DVAIAdapter
DVAIAgentRequest
DVAIAgentResult
DVAIHidden
Annotation for excluding a backend function from AI tool auto-exposure.
DVAITool
Annotation for exposing a function as an AI-callable tool.
DVAIToolDefinition
A registered AI tool: the handler plus the description and JSON Schema a provider needs in order to decide when to call it.
DVAIToolEntry
DVAIToolRegistry
DVAITranscript
DVAppKey
The application key: generated once per install and per user, used to encrypt what Dartvel stores at rest on a device.
DVAppKeyCipher
AES-256-GCM over the application key.
DVAppKeyStore
Where the application key is kept.
DVAtomicCacheAdapter
Atomic write-if-absent, the compare-and-set the spec requires from a distributed provider before its locks count. DV.Cache.lock uses this when the adapter offers it; single-process adapters get by without.
DVAuthAuthorization
DVAuthTokenRecord
One issued token, as stored.
DVAuthTokenResult
The outcome of a redemption.
DVAuthTokens
Issues and redeems magic links and one-time passcodes.
DVAuthTokenStore
Where issued tokens live between request and redemption.
DVAwsCredentials
DVAwsSigV4
Signs requests with AWS Signature Version 4.
DVBackendCron
Annotation for a Backend Cron Job
DVBackendFunction
Annotation for a Dartvel Backend Function
DVBillingCheckoutSession
DVBillingProvider
DVBrowserHttpTransport
The browser's own stack, reached through package:http on web.
DVCacheAdapter
Storage behind DV.Cache. Expiry is the adapter's responsibility: a read of an expired key must behave exactly like a read of a missing key.
DVCacheTags
DVClientCron
Annotation for a Client Cron Job
DVCompositeHttpTransport
Routes each protocol to whichever transport can speak it.
DVContext
The context handed to a DV.transaction body and to backend functions.
DVContextLifecycle
Lifecycle signals scoped to a single context.
DVCronEntry
DVCSRF
CSRF helper surface used by generated backend, form, model, DB, and realtime flows.
DVDatabase
The database facade behind DV.Database.
DVDatabaseAdapter
DVDatabaseCacheAdapter
Cache backed by a DVDatabaseAdapter, so cache entries survive process restarts and can share the application's database.
DVDatabaseQueueAdapter
Queue storage backed by a DVDatabaseAdapter, so dispatched jobs survive a process restart. With SQLite this is the durable local queue the spec calls for, sharing one database file with the application and cache.
One Link header from a 103 Early Hints response.
DVEarlyHints
A 103 Early Hints informational response (RFC 8297).
DVExportOptions<TModel>
DVExportResult
DVFileStorageAdapter
DVFormControls
DVFunctionalWidget
Annotation for a functional widget Page
DVGraphQL
The schema registry and executor.
DVGraphQLField
A resolvable field on a registered type.
DVGraphQLObjectType
A registered object type.
DVHomeWidget
Annotation for supported home-screen and lock-screen widgets.
DVHttpAIAdapter
DVHttpFallbackClient
Walks a request's protocol chain until one succeeds.
DVHttpMailProvider
Shared behaviour for mail providers that speak HTTP.
DVHttpProtocolChain
The order protocols are attempted in, best first.
DVHttpRequest
DVHttpResponse
DVHttpSearchProvider<TModel, TFacets>
Shared behaviour for hosted search services reached over HTTP.
DVHttpStreamedResponse
A response whose body is still arriving.
DVHttpTransport
A thing that can put a request on the wire over one specific protocol.
DVImage
An image held by a model field.
DVImportChunk
DVImportResult<TModel>
DVImportRowError
DVInMemoryQueueAdapter
DVInMemorySearchProvider<TModel, TFacets>
A concrete local search provider for development, tests, and small apps.
DVJob
Annotation for a durable background job.
DVJobEnvelope<TPayload>
DVJobPayload
Type-erased queue storage marker. User job payloads remain strongly typed at dispatch and handler registration boundaries.
DVJobPayloadCodec<TPayload>
Converts a job payload to and from JSON so a durable queue can store it.
DVJobPayloadCodecs
Codecs that let DVDatabaseQueueAdapter persist job payloads.
DVJsonBool
DVJsonCodec
Converts between Dartvel's typed DVJsonValue tree and the plain Object? tree that dart:convert produces and consumes.
DVJsonList
DVJsonMap
DVJsonNull
DVJsonNumber
DVJsonString
DVJsonValue
DVLifecycleRegistry
The lifecycle signals reachable from DV.lifecycle.
DVLifecycleSignal<T>
A read-only reactive value.
DVLocalBillingProvider
An issued magic link.
DVMailAddress
DVMailMessage
DVMailProvider
DVMcpClient
Consumes an external MCP server.
DVMcpServer
Serves Dartvel's registered AI tools over MCP.
DVMcpStreamTransport
A transport over a pair of byte streams, framed as newline-delimited JSON.
DVMcpTransport
A bidirectional JSON-RPC channel — stdio, a socket, a WebSocket.
DVMemcachedCacheAdapter
DV.Cache on Memcached.
DVMemcachedConnection
One Memcached connection.
DVMemoryAppKeyStore
Holds the key for the lifetime of the process only.
DVMemoryAuthTokenStore
In-memory store. Fine for one process; use a database- or cache-backed store when more than one serves the same users.
DVMemoryCacheAdapter
Process-local cache. The default, and what DV.Cache used exclusively before adapters existed.
DVMemoryFileStorageAdapter
Process-local storage. The default, and what DV.FileStorage used exclusively before adapters existed.
DVMemoryMailProvider
DVMemoryNotificationProvider
DVMiddleware
Annotation for backend function/page middleware.
DVMiddlewareKey
DVMiddlewares
DVModel
Annotation metadata for a Dartvel data model.
DVModelChange<T>
One model change, as delivered to watchers.
DVModelSync
The model sync hub.
DVModelSyncTransport
Where sync events cross process boundaries.
DVModelWatch
A running Model.watch(...). Cancel it when the watcher goes away.
DVModule
A mounted Dartvel module.
DVModuleRegistry
The registry behind DV.Modules.
DVMutableLifecycleSignal<T>
The framework-facing half of a lifecycle signal.
DVMySqlConnection
One MySQL connection. Abstracted like the Postgres and Redis transports.
DVMySqlDatabaseAdapter
DV.Database on MySQL or MariaDB.
DVNotificationMail
DVNotificationMessage
DVNotificationProvider
DVNotificationsService
DVOAuth2Authorization
A started authorization. Hold this until the provider redirects back: the state proves the callback belongs to this attempt and the codeVerifier proves the exchange comes from whoever started it.
DVOAuth2Client
Drives the authorization-code flow with PKCE.
DVOAuth2Config
Endpoints and client identity for one identity provider.
DVOAuth2Tokens
DVPackageHttpTransport
The package:http transport: HTTP/1.1 everywhere, and nothing more.
DVPage
Annotation for a Dartvel Page.
DVPasswordHasher
PBKDF2-HMAC-SHA256 password hashing.
DVPolicies
DVPolicy
Annotation for model/resource authorization policies.
DVPolicyAction
DVPostgresConnection
One Postgres connection. Abstracted like the Redis and SMTP transports so the protocol layer stays testable and web builds get a stub.
DVPostgresDatabaseAdapter
DV.Database on PostgreSQL.
DVPostgresSearchProvider<TModel, TFacets>
Search over a PostgreSQL table using its own full-text engine.
DVPresence
Channel membership.
DVPresenceEvent
DVPresenceMember
One participant on a channel.
DVPresenceTransport
Carries presence between processes, the way DVModelSyncTransport carries model changes. Without one, presence is per-process.
DVQueueAdapter
DVQueues
DVRedisCacheAdapter
DV.Cache on Redis (or Valkey).
DVRedisClient
A minimal RESP2 client: commands out as arrays of bulk strings, replies parsed into Dart values. Covers what the cache adapter needs; not a general Redis library.
DVRedisConnection
One Redis connection. The transport is abstracted the way SMTP's is, so the protocol layer stays testable and web builds get a stub.
DVRedisQueueAdapter
DV.Queues on Redis.
DVReportResult
DVRustHttpTransport
The native transport, as web sees it: never available.
DVScheduledReport
DVSearchable
Marks a model property for generated search indexing.
DVSearchProvider<TModel, TFacets>
DVSearchResultPage<TModel>
DVSecrets
Reads secrets from the process environment.
DVSensitiveModelField
Marks a model field as sensitive.
DVSentNotification
DVShell
DVShellCommand
DVShellResult
DVSmtpClient
DVSmtpConnection
One SMTP connection. The transport is abstracted so tests drive a scripted conversation instead of opening a socket.
DVSqliteSearchProvider<TModel, TFacets>
Full-text search backed by SQLite's FTS5 extension.
DVTenants
Resolves a tenant from a request, and holds the tenant the current work is running for.
DVTestHarness
DVTransactionRunner
Runs reversible units of work.
DVUnconfiguredSearchProvider<TModel, TFacets>
Fails loudly when a searchable model has no configured provider.
DVUseMiddleware
Typed annotation for page, layout, model, storage, and backend middleware.
DVWebPush
Encrypts payloads for Web Push subscriptions.
DVWebPushKeyPair
An application server key pair — the sender's identity to the push service, and the ephemeral half of the key agreement.
DVWebPushMessage
An encrypted Web Push message: the body to POST and the headers that describe it.
DVWebPushSubscription
The subscription a browser hands back from PushManager.subscribe().
DVWebPushVapid
Builds the Authorization header a push service requires.
Entitlement
FirebasePushProvider
Firebase Cloud Messaging, HTTP v1.
GeminiDVAIAdapter
Talks to the Gemini generative-language REST API.
Get
Annotation for a GET handler
Headers
JwtTokenManager
JWT token manager
LocalAnalyticsProvider
In-memory analytics provider for local development and tests.
LocalAuthProvider
In-memory auth provider for local development and tests.
LocalDVAIAdapter
Deterministic in-process adapter for development and tests. It never reaches the network, so tests cannot accidentally pass because a provider was unreachable.
MailgunMailProvider
Mailgun messages API. Unlike the others this is form-encoded, and it authenticates with HTTP Basic using the literal user name api.
MeilisearchProvider<TModel, TFacets>
Meilisearch search endpoint. Paging is 1-based, matching Dartvel.
MemoryDVDatabaseAdapter
MultipartFile
OllamaDVAIAdapter
Talks to a local Ollama runtime. The API key is optional and only sent when the runtime is fronted by an authenticating proxy.
OpenAIDVAIAdapter
Talks to the OpenAI REST API. OpenRouterDVAIAdapter reuses this wire format against a different host.
OpenRouterDVAIAdapter
OpenRouter exposes the OpenAI chat-completions wire format under its own host. It does not serve embeddings or transcription.
OpenSearchProvider<TModel, TFacets>
OpenSearch and Elasticsearch, which share this query API.
OtaUpdater
OTA Update manager
Patch
Annotation for a PATCH handler
PlatformConfig
Platform configuration for Dartvel
Post
Annotation for a POST handler
PostmarkMailProvider
Postmark single-message send.
Put
Annotation for a PUT handler
Request
Res
ResendMailProvider
Resend (https://resend.com) transactional mail.
Response
Route
Annotation for a route
S3FileStorageAdapter
S3 and S3-compatible object stores (AWS S3, Cloudflare R2, MinIO), authenticated with AWS Signature Version 4.
SendGridMailProvider
SendGrid v3 mail send.
SesMailProvider
Amazon SES v2, signed with AWS Signature Version 4.
ShorebirdUpdater
Shorebird integration
SmtpMailProvider
Sends through an SMTP server.
SqliteDVDatabaseAdapter
TwilioSmsProvider
Twilio SMS.
UpdateCheckResult
Update check result
UpdateProgress
Update download progress
WebPushProvider
Web Push, per RFC 8291 (encryption) and RFC 8292 (VAPID).

Enums

ApnsEnvironment
Which APNS environment a device token belongs to.
ApnsPushType
What kind of notification is being delivered.
AuthFailure
Why an authentication attempt failed.
AuthState
Auth state
DVAppLifecycle
Application-level lifecycle states.
DVAuthTokenFailure
Why a redemption failed.
DVBuildLifecycle
Build pipeline lifecycle states, observed through DV.lifecycle.build.
DVCronTarget
DVHttpProtocol
An HTTP wire protocol, identified by its ALPN token.
DVImageSource
Where a DVImage's bytes come from.
DVJobState
DVMailPriority
DVModelChangeKind
What happened to a model.
DVModelPageDataMode
How a generated Model.Page(...) resolves the data it renders.
DVModelPageRole
The part a field plays in a generated model page, set by the field-scoped @DVModel.featuredImage(), .pageTitle(), .mainContent() and .hideFromPage() constructors.
DVModuleLifecycle
Module lifecycle states, observed through DV.Modules.<id>.lifecycle.
DVNotificationChannel
DVNotificationProviderKind
DVPageLifecycle
Page-level lifecycle states, observed through context.lifecycle.page.
DVPageShellMode
Platform shell used by DVPage.
DVPresenceEventKind
What happened on a channel.
DVRequestLifecycle
Backend request lifecycle states, observed through context.lifecycle.request.
DVTenantIsolation
How tenant data is separated.
DVTenantSource
Where a request's tenant is read from.
DVTransactionLifecycle
Transaction lifecycle states, observed through context.lifecycle.transaction.
Platform
Supported platforms for Dartvel framework

Constants

dvIsWeb → const bool
True when running on the web.
dvMcpProtocolVersion → const String
The MCP revision these implementations negotiate.

Properties

dvHttpTransport DVHttpTransport
The transport outbound requests use.
no setter
dvHttpTransportHint String?
Why the faster transport is not available, when something knows.
getter/setter pair
dvModelDeserializers Map<Type, Object? Function(Map<String, Object?>)>
final
dvModelFactories Map<Type, Object? Function()>
final
dvModelSerializers Map<Type, Map<String, Object?> Function(Object?)>
final
formControlsFactories Map<Type, DVFormControlsFactory>
final

Functions

apnsFailureReason(DVHttpResponse response) String
A readable explanation for an APNS rejection.
cors() Object
createDVModel<T>() → T?
describeNativeTransportAbsence(String? path, Object? error) String
Why the native transport is unavailable here.
deserializeDVModel<T>(Map<String, Object?> json) → T?
Rebuilds a T from json, or null when no deserializer is registered.
dvAudioFileNameFor(String mimeType) String
dvConnectSmtp(String host, int port, {required bool secure}) Future<DVSmtpConnection>
dvEncodeFormBody(List<(String, String)> fields) List<int>
application/x-www-form-urlencoded body. Repeated keys are supported because several mail APIs express multiple recipients that way.
dvEncodeMultipartBody({required String boundary, required Map<String, String> fields, required String fileField, required String fileName, required String fileContentType, required List<int> fileBytes}) List<int>
dvEncodeMultipartFields({required String boundary, required Map<String, String> fields}) List<int>
A multipart/form-data body of plain fields, with no file part.
dvGenerateMultipartBoundary([Random? random]) String
dvSendAIHttpRequest(DVAIHttpRequest request) Future<DVAIHttpResponse>
dvSendHttpRequest(DVHttpRequest request) Future<DVHttpResponse>
Sends request, walking its protocol chain until one succeeds.
dvStreamHttpRequest(DVHttpRequest request) Future<DVHttpStreamedResponse>
Sends request and yields the body as it arrives.
dvUseHttpTransport(DVHttpTransport? transport) DVHttpTransport?
Installs transport as the default, returning the previous one.
dvWebPushBase64Decode(String value) Uint8List
Decodes the unpadded base64url the Web Push APIs use throughout.
dvWebPushBase64Encode(List<int> bytes) String
Encodes to the unpadded base64url the Web Push APIs use throughout.
dvWebPushSignEs256(List<int> message, Uint8List privateKey) Uint8List
ES256 over message with a P-256 privateKey, as JWS wants it.
encodeNativeRequest(DVHttpRequest request, DVHttpProtocol protocol) String
Identical to the native encoder, and deliberately duplicated.
installNativeHttpTransport() Future<bool>
Always false on web; nothing is installed.
parseLinkHeader(String value) List<DVEarlyHintLink>
Parses a Link header field value into its entries.
registerDVModelDeserializer<T>(DVModelDeserializer<T> deserializer) → void
Registers how a T is rebuilt from a JSON map.
registerDVModelFactory<T>(DVModelFactory<T> factory) → void
registerDVModelSerializer<T>(DVModelSerializer<T> serializer) → void
registerFormControlsFactory<T>(DVFormControlsFactory factory) → void
resolveNativeLibraryPath() Future<String>
Always throws on web: there is no native library to locate.
serializeDVModel<T>(T model) Map<String, Object?>?
webPushFailureReason(DVHttpResponse response) String
A readable explanation for a push service rejection.

Typedefs

DebugAnalyticsProvider = LocalAnalyticsProvider
DebugAuthProvider = LocalAuthProvider
DVAccessTokenSupplier = Future<String> Function()
Supplies a short-lived OAuth2 access token for a push service.
DVAIHttpRequest = DVHttpRequest
Retained names for the shared HTTP seam, which now lives in src/http/transport.dart so mail and other provider adapters share it.
DVAIHttpResponse = DVHttpResponse
DVAIHttpSend = DVHttpSend
DVAIToolHandler = FutureOr<DVJsonValue> Function(DVJsonObject input)
DVEarlyHintsCallback = void Function(DVEarlyHints hints)
Called for each 103 response received before the final one.
DVFormControlsFactory = DVFormControls Function(Object? model, {void onReset()?, void onSubmit()?})
DVHttpSend = Future<DVHttpResponse> Function(DVHttpRequest request)
DVJobHandler<TPayload> = FutureOr<void> Function(TPayload payload)
DVJsonObject = Map<String, DVJsonValue>
DVMemcachedConnect = Future<DVMemcachedConnection> Function(String host, int port)
DVModelDeserializer<T> = T Function(Map<String, Object?> json)
DVModelFactory<T> = T Function()
DVModelSerializer<T> = Map<String, Object?> Function(T model)
DVMySqlConnect = Future<DVMySqlConnection> Function(String host, int port)
DVPolicyCheck<TUser, TResource> = FutureOr<bool> Function(TUser user, TResource resource)
DVPostgresConnect = Future<DVPostgresConnection> Function(String host, int port)
DVPublicPathsResolver = Future<List<String>> Function()
Supplies the concrete parameter values a parameterized route needs during static generation.
DVRedisConnect = Future<DVRedisConnection> Function(String host, int port)
DVSearchDocument<TModel> = String Function(TModel model)
DVSearchFacetFilter<TFacets> = List<String> Function(TFacets? facets)
Builds provider filter expressions from typed facets. Meilisearch and Algolia both express facets as filter strings, so this is where an application maps its own facet type onto that syntax.
DVSearchFacetMatcher<TModel, TFacets> = bool Function(TModel model, TFacets? facets)
DVSmtpConnect = Future<DVSmtpConnection> Function(String host, int port, {required bool secure})
RequestType = Request
ResponseType = Response

Exceptions / Errors

AuthException
DVAIProviderException
Thrown when a provider rejects a request or returns a payload Dartvel cannot interpret. Provider failures are never swallowed into empty results.
DVCompensationException
Thrown when a compensation handler itself fails during rollback.
DVFileStorageException
Thrown when an object store rejects a request.
DVHttpNegotiationFailure
Why a protocol attempt failed, so the fallback driver can tell a "try the next one" from a "stop".
DVHttpProtocolExhausted
Raised when every protocol in a chain failed.
DVMailProviderException
Thrown when a mail provider rejects a message. Delivery failures are never swallowed - a caller always learns the message did not go out.
DVMcpException
Thrown when a peer reports a JSON-RPC error.
DVMemcachedException
Thrown when Memcached reports a protocol error.
DVMySqlException
Thrown when MySQL reports an error.
DVOAuth2Exception
DVPostgresException
Thrown when Postgres reports an error.
DVPushProviderException
Thrown when a push service rejects a notification.
DVRedisException
Thrown when Redis answers with an error reply.
DVSearchProviderException
Thrown when a hosted search service rejects a query or answers with a shape Dartvel cannot read. A failed search never degrades to an empty page.
DVSecretNotFoundException
Thrown when a secret is asked for and no source provides it.
DVSmtpException
Thrown when the server answers with an unexpected status.
DVUnknownModuleException
Thrown when a module is requested that was never registered.