at_primitives 1.2.0
at_primitives: ^1.2.0 copied to clipboard
Primitive types and utilities for AT Protocol. This package provides basic data structures and utilities used across AT Protocol implementations.
Release Note #
1.2.0 #
- feat: added
TidGenerator, a stateful, strictly-monotonic TID generator for record keys.next()never repeats or regresses, even when the system clock is coarse or steps backwards, and the encoding is exact on both the VM and the web.
1.1.1 #
- docs: fixed the README, which imported the non-existent
package:at_primitives/at_primitives.dartbarrel throughout; every snippet now imports the correct sub-barrel (at_identifier.dart/at_uri.dart/nsid.dart/tid.dart/record_key.dart). - docs: corrected the
AtUri.collectiontype note (collectionreturns anNSID, only'com.example.post'via.toString()) and documented the non-throwingcollectionOrNull/rkeyOrNullgetters. - docs: documented the previously undocumented TID (
isValidTid/ensureValidTid/InvalidTidError) and Record Key (isValidRecordKey/ensureValidRecordKey/InvalidRecordKeyError) modules with runnable snippets.
1.1.0 #
- fix!:
collection/rkeyon a path-lessAtUrinow throwInvalidAtUriErrorinstead of a rawStateError/RangeError; addedcollectionOrNull/rkeyOrNullfor the non-throwing path. - feat: added
AtUri.parseStrictfor full validation (ensureValidAtUri+ handle/NSID checks).AtUri.parsestays lenient for backwards compatibility. - fix:
AtUrinow preserves the query string (search/searchParams) throughparse/toStringinstead of silently dropping it. - fix: NSID length limits corrected to the current spec (317 overall / 63 per segment).
- fix:
Invalid*Errortypes now overridetoString()so their message is shown. - perf: hoisted per-call
RegExps tostatic final. - fix: NSID validation now matches the official spec: middle domain-authority segments may start with a digit (
com.4chan.exampleis valid), the name segment must be letters and digits only (com.example.foo-baris now rejected), and segments can not start with a hyphen. - feat: added TID validation (
ensureValidTid/isValidTid,InvalidTidError), exported frompackage:at_primitives/tid.dart. - feat: added Record Key validation (
ensureValidRecordKey/isValidRecordKey,InvalidRecordKeyError), exported frompackage:at_primitives/record_key.dart. - fix:
AtUri.parseStrictnow validates the record key path segment (rejects./.., over 512 chars, disallowed chars), mirroring the official strict AT URI parsing.ensureValidAtUristays rkey-lenient to match the officialensureValidAtUri. - fix: DID length limit corrected from 8192 to the spec's hard limit of 2048 characters.
- fix:
AtUri.parsenow accepts DIDs containing.and_(e.g.at://did:web:example.com%3A3000/...no longer throws).
1.0.0 #
- NEW: Initial release of the consolidated
at_primitivespackage. - FEATURE: Unified primitive types for AT Protocol including:
AtIdentifier- Core identifier syntax handling (migrated fromat_identifierpackage)AtUri- AT URI parsing and validation (migrated fromat_uripackage)NSID- Namespaced identifier parsing (migrated fromnsidpackage)
- CONSOLIDATION: This package replaces the separate
at_identifier,at_uri, andnsidpackages to reduce dependency complexity and improve maintainability. - COMPATIBILITY: Provides the same API surface as the individual packages for seamless migration.