* identity: README example and tidy * tidy up package metadata (package.json files) * updated README headers/stubs for several packages * crypto: longer README, with usage * syntax: tweak README * Apply suggestions from code review Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: devin ivy <devinivy@gmail.com> --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: devin ivy <devinivy@gmail.com>
@atproto/lexicon: schema validation library
TypeScript implementation of the Lexicon data and API schema description language, which is part of atproto.
Usage
import { Lexicons } from '@atproto/lexicon'
// create your lexicons collection
const lex = new Lexicons()
// add lexicon documents
lex.add({
lex: 1,
id: 'com.example.post',
defs: {
// ...
}
})
// validate
lex.assertValidRecord('com.example.record', {$type: 'com.example.record', ...})
lex.assertValidXrpcParams('com.example.query', {...})
lex.assertValidXrpcInput('com.example.procedure', {...})
lex.assertValidXrpcOutput('com.example.query', {...})
License
MIT