1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! AT Protocol lexicon resolution and validation library.
//!
//! This library provides functionality for resolving and validating AT Protocol lexicons,
//! which define the schema and structure of AT Protocol data.
//!
//! ## Overview
//!
//! Lexicons in AT Protocol serve as schema definitions that describe the structure
//! and types of data that can be stored and transmitted. This library implements
//! the full lexicon resolution chain as specified by the AT Protocol:
//!
//! 1. Convert NSID to DNS name with `_lexicon` prefix
//! 2. Perform DNS TXT lookup to get the authoritative DID
//! 3. Resolve the DID to get the DID document
//! 4. Extract PDS endpoint from the DID document
//! 5. Make XRPC call to fetch the lexicon schema
//!
//! ## Modules
//!
//! - [`errors`]: Structured error types for all lexicon operations
//! - [`resolve`]: Core lexicon resolution implementation
//! - [`resolve_recursive`]: Recursive resolution with dependency tracking
//! - [`transmogrify`]: Record transformation between lexicon schemas
//! - [`compatibility`]: Schema compatibility analysis (requires `panproto` feature)
//! - [`validation`]: NSID validation, parsing, and helper functions
//!
//! ## Example Usage
//!
//! ```no_run
//! # use anyhow::Result;
//! # #[tokio::main]
//! # async fn main() -> Result<()> {
//! use atproto_lexicon::resolve::{DefaultLexiconResolver, LexiconResolver};
//! use atproto_identity::resolve::HickoryDnsResolver;
//!
//! let http_client = reqwest::Client::new();
//! let dns_resolver = HickoryDnsResolver::create_resolver(&[]);
//! let resolver = DefaultLexiconResolver::new(http_client, dns_resolver);
//!
//! // Resolve a lexicon
//! let lexicon = resolver.resolve("app.bsky.feed.post").await?;
//! # Ok(())
//! # }
//! ```