tcm-ts.txt / code
tcm . dev . lexicons
test/
PUBLISH_SCOPE
SCHEMA_COLLECTION
authorityOf
canonicalJson
checkedLexicon
lexiconDid
publishedSchema
sameSchema
tcmts.dev.lexicons
test/ 3 definitions
PUBLISH_SCOPE "atproto repo:com.atproto.lexicon.schema" What signing in to publish lexicons asks to be allowed: writing lexicon schemas, and nothing else.
SCHEMA_COLLECTION "com.atproto.lexicon.schema" The collection lexicons are published in, as `com.atproto.lexicon.schema` records keyed by their NSIDs.
authorityOf (nsid: string) => string The authority an NSID's lexicon is published under: its domain part, as a domain (`codes.tcm.release` → `tcm.codes`), whose `_lexicon` DNS record names the DID publishing it.
canonicalJson (x: unknown) => string JSON with every object's keys in order: two documents saying the same thing are the same text.
checkedLexicon (doc: Record<string, unknown>) => Record<string, unknown> A lexicon document, checked against the Lexicon spec (as @atcute/lexicon-doc reads one): an error says where it isn't one.
lexiconDid (authority: string) => Promise<string | undefined> The DID an authority's `_lexicon.<authority>` DNS record names, if it names one. On a test's network (`TCM_ATPROTO_LOCAL=1`), `$TCM_LEXICON_DID` instead, if it's set: its DNS isn't the test's.
publishedSchema (pds: string, did: string, nsid: string) => Promise<{ cid: string; value: unknown; } | undefined> A lexicon's published schema record, from a PDS: its CID and value, or undefined if there's none.
sameSchema (published: unknown, doc: Record<string, unknown>) => boolean Whether a published schema record (its value, `$type` and all) says what a lexicon document does.