A better Rust ATProto crate
at main 2.1 kB view raw
1// Example lex-fetch configuration file 2// This demonstrates the available source types and configuration options 3 4// Output configuration (required) 5output { 6 // Where to save fetched lexicon JSON files 7 lexicons "lexicons" 8 9 // Where to generate Rust code 10 codegen "src" 11 12 // Path to Cargo.toml for feature generation (optional) 13 // cargo-toml "Cargo.toml" 14} 15 16// Fetch ATProto and Bluesky lexicons from official repo 17// Higher priority (101) means these override conflicts from other sources 18source "atproto" type="git" priority=101 { 19 repo "https://github.com/bluesky-social/atproto" 20 pattern "lexicons/**/*.json" 21} 22 23// Fetch a single lexicon by NSID - will use DNS to resolve authority 24source "bsky-post" type="atproto" priority=30 { 25 endpoint "app.bsky.feed.post" 26} 27 28// Fetch lexicons from a Git repository 29source "my-lexicons" type="git" priority=100 { 30 repo "https://github.com/example/my-lexicons" 31 32 // Optional: specific branch/tag/commit 33 // ref "main" 34 35 // Glob pattern for finding lexicon files (defaults to **/*.json) 36 pattern "**/*.json" 37} 38 39// Use local directory for custom/in-development lexicons 40source "local-dev" type="local" priority=200 { 41 path "./my-lexicons" 42 43 // Optional pattern (omit to use **/*.json) 44 pattern "*.json" 45} 46 47// Fetch from an AT Protocol endpoint (user's repo) 48source "custom-user" type="atproto" { 49 endpoint "did:plc:example123456789" 50 51 // Optional: specific slice within their repo 52 // slice "app.example.slice" 53} 54 55// Fetch from HTTP endpoint returning lexicon array 56// source "http-lexicons" type="http" { 57// url "https://api.example.com/lexicons" 58// } 59 60// Fetch from network.slices 61// source "slices-example" type="slices" { 62// slice "at://did:plc:example/network.slices.slice/record123" 63// } 64 65// Load a single JSON file containing multiple lexicons 66// source "single-file" type="jsonfile" { 67// path "./lexicons-bundle.json" 68// } 69 70// Priority notes: 71// - Higher numbers override lower numbers when lexicons conflict 72// - Useful for preferring official schemas over community forks 73// - Default priority if not specified: 50