README

tcmts.records.README · #s3memyix · md file

records

The AT Protocol records tcm's libraries are announced and talked about with, as a library of its own: add it to a codebase with tcm lib add @tcm.codes/records (tcm.codes announces it), or by hash from any tcm server that has it. It's a tcm library, not an npm package: it holds everything its code uses, so a codebase that adds it has every definition named. Something that reads or writes these records (a hub of its own, a feed, a bot) uses it to agree with tcm on what they are.

import { parseReleaseRecord, parseAttestation, starOf, RELEASE_COLLECTION } from "#codebase/app/lib/records";

const release = parseReleaseRecord(record); // a ReleaseRecord, or undefined if it isn't one
const advisory = parseAttestation("codes.tcm.advisory", record); // its kind from its collection
const star = starOf(rkey, record); // { author, package, createdAt }, if it's at its own key

What it has

lexicons is all five lexicon documents (Lexicon 1, each with its record key, field types, formats and limits). tcm.codes is their authority (_lexicon.tcm.codes): they're published as its com.atproto.lexicon.schema records by tcm's maintainers (developing tcm), not by the library. starRecord makes a star as the hub writes it.

Reading a record here checks what it says, not who said it: whether a record is its author's is the AT Protocol's part (fetch it with com.atproto.sync.getRecord and check its commit against the key in their DID document).

Its versions follow semver from its API, as any package's do (releases).