Paul Frazee 4804475478
Package version bumps ()
* lexicon@0.0.2

* xrpc@0.0.2

* api@0.0.5
2023-01-02 20:33:54 -06:00
..
2023-01-02 17:38:30 -06:00
2023-01-02 17:38:30 -06:00
2023-01-02 20:33:54 -06:00
2022-12-01 12:26:18 -06:00

Lexicon

Lexicon is the semantic schemas & contracts system for ATP. This library provides definitions and APIs for ATP software.

npm install @atproto/lexicon

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', {...})