Socket
Book a DemoInstallSign in
Socket

@atproto/lexicon

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atproto/lexicon

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

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
62K
-10.27%
Maintainers
2
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 03 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts