···33// This file was automatically generated from Lexicon schemas.
44// Any manual changes will be overwritten on the next regeneration.
5566+#[cfg(feature = "app_bsky")]
67pub mod app_bsky;
88+99+#[cfg(feature = "chat_bsky")]
710pub mod chat_bsky;
1111+1212+#[cfg(feature = "com_atproto")]
813pub mod com_atproto;
1414+1515+#[cfg(feature = "tools_ozone")]
916pub mod tools_ozone;
+1-1
crates/jacquard-common/src/cowstr.rs
···991010use crate::IntoStatic;
11111212-/// Shamelessly copied from https://github.com/bearcove/merde
1212+/// Shamelessly copied from [](https://github.com/bearcove/merde)
1313/// A copy-on-write immutable string type that uses [`SmolStr`] for
1414/// the "owned" variant.
1515///
+1-1
crates/jacquard-common/src/into_static.rs
···77use std::hash::Hash;
88use std::sync::Arc;
991010-/// Shamelessly copied from https://github.com/bearcove/merde
1010+/// Shamelessly copied from [](https://github.com/bearcove/merde)
1111/// Allow turning a value into an "owned" variant, which can then be
1212/// returned, moved, etc.
1313///
+1-1
crates/jacquard-common/src/types/aturi.rs
···14141515/// at:// URI type
1616///
1717-/// based on the regex here: https://github.com/bluesky-social/atproto/blob/main/packages/syntax/src/aturi_validation.ts
1717+/// based on the regex here: [](https://github.com/bluesky-social/atproto/blob/main/packages/syntax/src/aturi_validation.ts)
1818///
1919/// Doesn't support the query segment, but then neither does the Typescript SDK.
2020#[derive(PartialEq, Eq, Debug)]
···7676 /// Infallible constructor for when you *know* the string is a valid DID.
7777 /// Will panic on invalid DIDs. If you're manually decoding atproto records
7878 /// or API values you know are valid (rather than using serde), this is the one to use.
7979- /// The From<String> and From<CowStr> impls use the same logic.
7979+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
8080 pub fn raw(did: &'d str) -> Self {
8181 let did = did.strip_prefix("at://").unwrap_or(did);
8282 if did.len() > 2048 {
+1-1
crates/jacquard-common/src/types/handle.rs
···9595 /// Infallible constructor for when you *know* the string is a valid handle.
9696 /// Will panic on invalid handles. If you're manually decoding atproto records
9797 /// or API values you know are valid (rather than using serde), this is the one to use.
9898- /// The From<String> and From<CowStr> impls use the same logic.
9898+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
9999 ///
100100 /// Accepts (and strips) preceding '@' or 'at://' if present
101101 pub fn raw(handle: &'h str) -> Self {
+1-1
crates/jacquard-common/src/types/ident.rs
···4949 /// Infallible constructor for when you *know* the string is a valid identifier.
5050 /// Will panic on invalid identifiers. If you're manually decoding atproto records
5151 /// or API values you know are valid (rather than using serde), this is the one to use.
5252- /// The From<String> and From<CowStr> impls use the same logic.
5252+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
5353 pub fn raw(ident: &'i str) -> Self {
5454 if let Ok(did) = ident.parse() {
5555 AtIdentifier::Did(did)
+1-1
crates/jacquard-common/src/types/language.rs
···3434 /// Infallible constructor for when you *know* the string is a valid IETF language tag.
3535 /// Will panic on invalid tag. If you're manually decoding atproto records
3636 /// or API values you know are valid (rather than using serde), this is the one to use.
3737- /// The From<String> and From<CowStr> impls use the same logic.
3737+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
3838 pub fn raw(lang: impl AsRef<str>) -> Self {
3939 let lang = lang.as_ref();
4040 let tag = langtag::LangTag::new(lang).expect("valid IETF language tag");
+1-1
crates/jacquard-common/src/types/nsid.rs
···7171 /// Infallible constructor for when you *know* the string is a valid NSID.
7272 /// Will panic on invalid NSIDs. If you're manually decoding atproto records
7373 /// or API values you know are valid (rather than using serde), this is the one to use.
7474- /// The From<String> and From<CowStr> impls use the same logic.
7474+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
7575 pub fn raw(nsid: &'n str) -> Self {
7676 if nsid.len() > 317 {
7777 panic!("NSID too long")
+3-3
crates/jacquard-common/src/types/recordkey.rs
···1414/// This is deliberately public (so that consumers can develop specialized record key types),
1515/// but is marked as unsafe, because the implementer is expected to uphold the invariants
1616/// required by this trait, namely compliance with the [spec](https://atproto.com/specs/record-key)
1717-/// as described by [`RKEY_REGEX`](RKEY_REGEX).
1717+/// as described by [`RKEY_REGEX`].
1818///
1919/// This crate provides implementations for TID, NSID, literals, and generic strings
2020pub unsafe trait RecordKeyType: Clone + Serialize {
···5757}
58585959/// ATProto Record Key (type `any`)
6060-/// Catch-all for any string meeting the overall Record Key requirements detailed https://atproto.com/specs/record-key
6060+/// Catch-all for any string meeting the overall Record Key requirements detailed [](https://atproto.com/specs/record-key)
6161#[derive(Clone, PartialEq, Eq, Serialize, Hash)]
6262#[serde(transparent)]
6363#[repr(transparent)]
···298298 /// Infallible constructor for when you *know* the string is a valid rkey.
299299 /// Will panic on invalid rkeys. If you're manually decoding atproto records
300300 /// or API values you know are valid (rather than using serde), this is the one to use.
301301- /// The From<String> and From<CowStr> impls use the same logic.
301301+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
302302 pub fn raw(rkey: &str) -> Self {
303303 if !rkey.eq_ignore_ascii_case(T::LITERAL) {
304304 panic!(
+1-1
crates/jacquard-common/src/types/tid.rs
···7171 /// Infallible constructor for when you *know* the string is a valid TID.
7272 /// Will panic on invalid TID. If you're manually decoding atproto records
7373 /// or API values you know are valid (rather than using serde), this is the one to use.
7474- /// The From<String> and From<CowStr> impls use the same logic.
7474+ /// The `From<String>` and `From<CowStr>` impls use the same logic.
7575 pub fn raw(tid: impl AsRef<str>) -> Self {
7676 let tid = tid.as_ref();
7777 if tid.len() != 13 {
+10-1
crates/jacquard-lexicon/src/codegen.rs
···10891089 path
10901090 };
1091109110921092+ let is_root = dir.components().count() == 0;
10921093 let mods: Vec<_> = module_names
10931094 .iter()
10941095 .map(|name| {
10951096 let ident = syn::Ident::new(name, proc_macro2::Span::call_site());
10961096- quote! { pub mod #ident; }
10971097+ if is_root {
10981098+ // Top-level modules get feature gates
10991099+ quote! {
11001100+ #[cfg(feature = #name)]
11011101+ pub mod #ident;
11021102+ }
11031103+ } else {
11041104+ quote! { pub mod #ident; }
11051105+ }
10971106 })
10981107 .collect();
10991108
+6-1
crates/jacquard/Cargo.toml
···66version.workspace = true
77edition.workspace = true
8899-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99+[features]
1010+default = ["api_all"]
1111+derive = ["dep:jacquard-derive"]
1212+api = ["jacquard-api/com_atproto"]
1313+api_all = ["api", "jacquard-api/app_bsky", "jacquard-api/chat_bsky", "jacquard-api/tools_ozone"]
10141115[lib]
1216name = "jacquard"
···2226http = "1.3.1"
2327jacquard-api = { version = "0.1.0", path = "../jacquard-api" }
2428jacquard-common = { path = "../jacquard-common" }
2929+jacquard-derive = { path = "../jacquard-derive", optional = true }
2530miette = "7.6.0"
2631reqwest = { version = "0.12.23", default-features = false, features = ["charset", "http2", "json", "system-proxy", "gzip", "rustls-tls"] }
2732serde = { version = "1.0", features = ["derive"] }
+5
crates/jacquard/src/lib.rs
···11pub mod client;
2233// Re-export common types
44+#[cfg(feature = "api")]
55+pub use jacquard_api as api;
46pub use jacquard_common::*;
77+88+#[cfg(feature = "derive")]
99+pub use jacquard_derive::*;