omnystore library
OmnyStore — a complete release management and software distribution platform in pure Dart.
This is the core SDK barrel: the domain models, the channel and version rules, the repository ports and their in-memory adapters, the pluggable object-storage backends (local directory, AWS S3, Google Cloud Storage), the OmnyStore service itself, the download manager and the update service.
final store = OmnyStore(
repositories: MemoryRepositories(),
storage: LocalObjectStorage('/var/lib/omnystore'),
);
final release = await store.publishRelease(
packageReference: 'omnyagent',
version: Version.parse('1.2.0'),
);
await store.attachAsset(
releaseId: release.id,
name: 'omnyagent-linux-x64.tar.gz',
data: File('build/omnyagent-linux-x64.tar.gz').openRead(),
platform: 'linux-x64',
);
Other entry points:
package:omnystore/omnystore_hub.dart— the discovery hub that federates storage nodes, and the REST API server built on OmnyHub.package:omnystore/omnystore_node.dart— a storage node that dials a hub and serves its organizations' artifacts.package:omnystore/omnystore_client.dart— the web-compatible client SDK (nodart:io).package:omnystore/omnystore_cli.dart— theomnystorecommand set.
Classes
- AnonymousAuthProvider
- An AuthProvider that sends no credentials.
- Asset
- A downloadable file attached to a Release — a tarball, an installer, a checksum file, a signature.
- AssetDownload
- An open read of an asset's bytes, whichever provider ended up serving them.
- AssetKinds
- The conventional values of Asset.kind, and the rules that read them.
- AssetLocation
- Records that one provider holds the bytes of one asset.
- AssetLocationRepository
- Stores AssetLocation placement records — which provider holds which asset's bytes.
- AssetRepository
- Stores Asset records, keyed by id and by (release, name).
- AuthProvider
- Supplies the credentials a client attaches to each request.
- AwsCredentials
- A set of AWS credentials.
- AwsCredentialsProvider
- Supplies AWS credentials, refreshing them when they expire.
- ByteRange
-
A half-open-at-the-end byte range, in HTTP
Rangesemantics: start and end are both inclusive, andend == nullmeans "to the end of the object". - ChecksumResult
- The size and digest of a byte stream, computed while it was being consumed.
- Checksums
- SHA-256 helpers used wherever OmnyStore hands bytes across a trust boundary: uploads into object storage, downloads onto a client's disk, and replication between providers.
- ChecksumStream
- A stream transformer that hashes and counts bytes as they flow through, leaving the data itself untouched.
- Clock
-
Time source used throughout OmnyHub so tests can fix
now. - CompositeAuthProvider
- An AuthProvider that merges several providers' headers.
- DownloadManager
- Downloads artifacts to disk or into memory, with resume and mandatory checksum verification.
- DownloadProgress
- Progress of an in-flight download.
- DownloadRecord
- One recorded download of an Asset.
- DownloadRepository
- Stores DownloadRecords — append-only, and the highest-volume table in the system by a wide margin.
- DownloadResult
- The outcome of a completed download.
- DownloadStats
- Aggregated download counts, as returned by the downloads API.
- DownloadTarget
- Where a client should go to fetch an asset.
- EnvironmentAwsCredentialsProvider
- An AwsCredentialsProvider reading the standard AWS environment variables.
- Eq
- Structural equality helpers for the immutable models.
- ErrorCodes
- The error codes used by OmnyStore.
- GcpAccessToken
- An OAuth 2.0 access token for the Google Cloud Storage API.
- GcpCredentialsProvider
- Supplies access tokens for Google Cloud APIs, and — when it can — the RSA key material needed to sign download URLs.
- GcpMetadataServerCredentials
- A GcpCredentialsProvider reading the ambient identity from the GCP metadata server.
- GcpServiceAccountCredentials
-
A GcpCredentialsProvider backed by a service account key — the standard
JSON file
gcloud iam service-accounts keys createproduces. - GcpStaticCredentials
-
A GcpCredentialsProvider wrapping a token obtained elsewhere — by
gcloud auth print-access-token, bypackage:googleapis_auth, or by an application's own OAuth flow. - GcsObjectStorage
- An ObjectStorage backed by a Google Cloud Storage bucket.
- HttpDates
-
Parsing for the
Last-ModifiedandDateheaders the object-storage backends read. - IdGenerator
- Generates unique identifiers for connections, nodes and requests.
- Json
-
Manual JSON read helpers for the hand-written decode paths that
json_serializabledoes not cover — API request bodies, error envelopes and the free-formmetadatamaps. - JsonFileRepositories
- Metadata repositories persisted as JSON files in a directory.
- LocalObjectStorage
- An ObjectStorage backed by a directory on the local filesystem.
- Logger
- Structured logging port.
- MemoryAssetLocationRepository
- An in-memory AssetLocationRepository.
- MemoryAssetRepository
- An in-memory AssetRepository.
- MemoryDownloadRepository
- An in-memory DownloadRepository.
- MemoryObjectStorage
- An ObjectStorage holding every object in the heap.
- MemoryOrganizationRepository
- An in-memory OrganizationRepository.
- MemoryPackageRepository
- An in-memory PackageRepository.
- MemoryProjectRepository
- An in-memory ProjectRepository.
- MemoryReleaseRepository
- An in-memory ReleaseRepository.
- MemoryRepositories
- A complete in-memory StoreRepositories bundle.
- Names
- Validation for the human-typed, URL-addressable names OmnyStore uses as secondary keys: organization, project and package names.
- NoopLogger
- A Logger that discards everything. The default throughout the framework.
- NullableVersionConverter
- Serialises a nullable Version.
- ObjectReader
- An open read over a stored object: its metadata plus the byte stream.
- ObjectStorage
- The pluggable binary backend: where asset bytes actually live.
- OmnyStore
- The registry, backed by local repositories and one object store.
- OmnyStoreApi
- The registry's complete operation surface, implemented three times over.
- OmnyStoreClient
- The client SDK: an OmnyStoreApi backed by a remote OmnyStore server.
- Organization
- The top-level tenant: a company, a team, or an open-source org that owns projects.
- OrganizationRepository
- Stores Organization records, keyed by id and by unique name.
- Package
- A distributable artifact line within a Project — the thing that has versions.
- PackageRepository
- Stores Package records, keyed by id and by (project, name).
- Platforms
-
The
os-archplatform tokens OmnyStore tags artifacts with, and how to work out which one the current process is. - Principal
- An authenticated identity attached to a request or a node connection.
- Project
- A product or repository within an Organization, grouping the packages released together.
- ProjectRepository
- Stores Project records, keyed by id and by (organization, name).
- ProviderDescriptor
- The public description of a storage provider: who it is, which organizations it serves, how its bytes are reached, and how much room it has left.
- RandomIdGenerator
- The default IdGenerator: a per-process monotonic counter combined with random entropy, so ids are unique within a process and unpredictable across processes without requiring an external dependency.
- RedirectDownload
- The client should follow url — a presigned bucket URL, or a signed URL at the node that holds the bytes.
- RefreshingAuthProvider
- An AuthProvider that fetches a token on demand and refreshes it when the server rejects it.
- RefreshingAwsCredentialsProvider
- An AwsCredentialsProvider that caches what fetch returns until it is close to expiring, then fetches again.
- Release
- A published version of a Package, with its notes and its Assets.
- ReleaseQuery
- Filters and paging for a release listing.
- ReleaseRepository
- Stores Release records, keyed by id and by (package, version).
- S3ObjectStorage
- An ObjectStorage backed by an AWS S3 bucket, or any S3-compatible service (MinIO, Cloudflare R2, Backblaze B2, Ceph, DigitalOcean Spaces).
- ScopedIdGenerator
- An IdGenerator that stamps a scope into every identifier it produces.
- Sha256Accumulator
- An incremental SHA-256 accumulator.
- SigV4
-
AWS Signature Version 4 signing, in both the forms S3 needs:
Authorizationheaders for requests this process makes, and query-string presigning for URLs handed to a client so it can fetch an artifact straight from the bucket. - StaticAwsCredentialsProvider
- An AwsCredentialsProvider returning a fixed credential set.
- StorageKeys
- Builds and parses the storage keys OmnyStore assigns to asset bytes.
- StoredObject
- Metadata about a stored object, as the backend reports it.
- StoreRepositories
-
The full set of metadata repositories, injected into
OmnyStoreas one unit. - StreamedDownload
-
No URL could be issued, so the caller must stream the bytes itself through
OmnyStoreApi.openAsset. - StructuredLogger
- A Logger that writes one JSON object per line to an IOSink (stderr by default), filtering records below minLevel.
- SystemClock
- The default Clock, backed by the system wall clock (UTC).
- TokenAuthProvider
- An AuthProvider sending a fixed bearer token.
- UpdateChecker
- The client-side update service: "am I running the newest build, and what should I download if not?".
- UpdateInfo
- The answer to "is there a newer version for me?".
- UpdateResolver
-
The decision logic behind every update check, kept in one pure function so
the embedded store, the hub, the REST endpoint and the standalone
UpdateCheckercannot drift apart on the question that matters most: should this client be told to update? - Version
- A parsed semantic version number.
- VersionConstraint
- A VersionConstraint is a predicate that can determine whether a given version is valid or not.
- VersionConstraintConverter
-
Serialises a VersionConstraint as its string form (
'^1.2.0','any'). - VersionConverter
- Serialises a Version as its canonical string form.
- Versions
-
Version helpers that fail with OmnyStore's own typed exceptions instead of
pub_semver's FormatException.
Enums
- DataPlaneMode
- How a provider's bytes reach a client.
- LogLevel
- Severity levels for Logger.
- ProviderKind
- What kind of participant a storage provider is.
- ProviderStatus
- The liveness of a provider, as tracked by the hub.
- ReleaseChannel
- The distribution channel a release belongs to.
- ReplicaState
- Where a replica of an asset's bytes stands.
Constants
- omnyStoreApiVersion → const String
-
The REST API version segment served by the API server (
/api/v1). - omnyStoreVersion → const String
-
The canonical OmnyStore package version (kept in sync with
pubspec.yaml).
Functions
-
omnyStoreExceptionForCode(
String code, String message, {int statusCode = 500, Uri? url, Map< String, Object?> details = const {}}) → OmnyStoreException -
Reconstructs an OmnyStoreException from the
code/messagecarried on a JSON error envelope — the inverse of the mapping the API server uses to render a thrown exception.
Typedefs
-
RepositoryChanged
= Future<
void> Function() - Called after a repository mutates, so a persistence layer can flush.
Exceptions / Errors
- ApiException
- The REST API answered with a status or body the client could not accept.
- AssetNotFoundException
- The referenced asset does not exist.
- ChecksumMismatchException
- Downloaded bytes did not match the checksum recorded for the asset.
- CliException
- The CLI was invoked incorrectly, or a command could not complete.
- ConflictException
- A resource with the same unique key already exists — a second organization with one name, a re-published version, an asset filename used twice within one release.
- DownloadFailedException
- A download could not be completed: the transport failed, the server answered with an error status, or the stream ended short of the expected length.
- ForbiddenException
- The caller is authenticated but not permitted to perform the operation.
- InvalidJsonException
- A payload could not be parsed as the expected JSON shape.
- NotFoundException
- A referenced resource does not exist.
- OmnyStoreException
- Base type for every expected failure raised by OmnyStore.
- OmnyStoreTimeoutException
- An operation exceeded its deadline.
- OrganizationNotFoundException
- The referenced organization does not exist.
- PackageNotFoundException
- The referenced package does not exist.
- ProjectNotFoundException
- The referenced project does not exist.
- ReleaseNotFoundException
- The referenced release does not exist.
- StorageException
- The object storage backend failed (unreachable bucket, denied credentials, an I/O error writing the local directory, ...).
- The caller is not authenticated (missing or invalid credentials).
- UnsupportedOperationException
- The configured backend does not support the requested operation — asking a local-directory store for a presigned URL, for instance.
- ValidationException
- Invalid input: a malformed name, an unparsable version, a negative size, a channel that does not match the version's pre-release tag, and so on.