A better Rust ATProto crate

lexicon and codegen updates.

Orual a679f602 f7ce1f07

Changed files
+2366 -451
crates
jacquard
jacquard-api
lexicons
src
app_bsky
com_atproto
community_lexicon
calendar
events_smokesignal
lol_atmo
lol_skittr
my_skylights
place_atwork
pub_leaflet
sh_tangled
repo
issue
pull
sh_weaver
tools_ozone
jacquard-axum
jacquard-common
jacquard-derive
jacquard-identity
jacquard-lexicon
jacquard-oauth
nix
modules
+8 -8
Cargo.lock
···
[[package]]
name = "jacquard"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"async-trait",
"bon",
···
[[package]]
name = "jacquard-api"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"bon",
"bytes",
···
[[package]]
name = "jacquard-axum"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"axum",
"axum-macros",
···
[[package]]
name = "jacquard-common"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"async-trait",
"base64 0.22.1",
···
[[package]]
name = "jacquard-derive"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"heck 0.5.0",
"itertools",
···
[[package]]
name = "jacquard-identity"
-
version = "0.3.0"
+
version = "0.3.1"
dependencies = [
"async-trait",
"bon",
···
[[package]]
name = "jacquard-lexicon"
-
version = "0.3.0"
+
version = "0.4.0"
dependencies = [
"async-trait",
"clap",
···
[[package]]
name = "jacquard-oauth"
-
version = "0.3.0"
+
version = "0.3.1"
dependencies = [
"async-trait",
"base64 0.22.1",
+1 -1
Cargo.toml
···
[workspace.package]
edition = "2024"
-
version = "0.3.0"
+
version = "0.4.0"
authors = ["Orual <orual@nonbinary.computer>"]
repository = "https://tangled.org/@nonbinary.computer/jacquard"
keywords = ["atproto", "at", "bluesky", "api", "client"]
+47 -51
crates/jacquard-api/Cargo.toml
···
name = "jacquard-api"
description = "Generated AT Protocol API bindings for Jacquard"
edition.workspace = true
-
version.workspace = true
+
version = "0.4.0"
authors.workspace = true
repository.workspace = true
keywords.workspace = true
···
license.workspace = true
[package.metadata.docs.rs]
-
features = [ "bluesky", "other", "ufos" ]
+
features = [ "bluesky", "other", "lexicon_community", "ufos" ]
[dependencies]
bon.workspace = true
bytes = { workspace = true, features = ["serde"] }
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common" }
-
jacquard-derive = { version = "0.3.0", path = "../jacquard-derive" }
+
jacquard-common = { version = "*", path = "../jacquard-common" }
+
jacquard-derive = { version = "*", path = "../jacquard-derive" }
miette.workspace = true
serde.workspace = true
thiserror.workspace = true
[features]
-
default = [ "com_atproto", "com_bad_example"]
-
bluesky = [ "com_atproto", "app_bsky", "chat_bsky", "tools_ozone"]
-
other = ["sh_tangled", "sh_weaver", "pub_leaflet", "net_anisota", "events_smokesignal","network_slices", "tools_smokesignal", "com_whtwnd", "community_lexicon", "place_stream", "blue__2048" ]
-
lexicon_community = ["community_lexicon", "my_skylights", "com_whtwnd", "social_psky", "lol_atmo", "blue_linkat"]
-
ufos = ["place_artwork", "moe_karashiiro", "dev_regnault", "buzz_bookhive", "place_artwork", "how_bun", "lol_atmo", "inc_toronto", "uk_ewancroft", "lol_skittr", "win_tomo", "dev_fudgeu", "dev_ocbwoy3", "blog_pckt", "blue_rito", "com_welistskyblue", "net_bnewbold", "club_stellz", "dev_baileytownsend", "net_aftertheinter", "org_devcon","org_robocracy", "garden_lexicon", "social_clippr", "social_grain", "social_pmsky", "com_crabdance", "app_blebbit", "app_ocho", "uk_skyblur", "us_polhem", "blue_atplane", "net_mmatt" ]
-
app_bsky = []
-
chat_bsky = []
-
com_atproto = []
-
tools_ozone = []
-
sh_tangled = []
-
sh_weaver = []
-
pub_leaflet = []
-
net_anisota = []
-
network_slices = []
-
place_atwork = []
-
tools_smokesignal = []
-
uk_ewancroft = []
-
place_artwork = []
-
moe_karashiiro = []
-
buzz_bookhive = []
-
dev_regnault = []
-
events_smokesignal = []
-
dev_baileytownsend = []
+
default = [ "minimal"]
+
minimal = [ "com_atproto", "com_bad_example"]
+
bluesky = [ "com_atproto", "app_bsky", "chat_bsky", "tools_ozone", "minimal"]
+
other = ["sh_tangled", "sh_weaver", "pub_leaflet", "net_anisota", "network_slices", "tools_smokesignal", "com_whtwnd", "community_lexicon", "place_stream", "blue__2048", "minimal" ]
+
lexicon_community = ["community_lexicon", "my_skylights", "com_whtwnd", "social_psky", "blue_linkat", "minimal"]
+
ufos = [ "moe_karashiiro", "dev_regnault", "buzz_bookhive", "uk_ewancroft", "win_tomo_x", "dev_fudgeu", "dev_ocbwoy3", "blog_pckt", "net_bnewbold", "club_stellz", "dev_baileytownsend", "net_aftertheinter", "org_devcon","org_robocracy", "garden_lexicon", "social_clippr", "social_grain", "social_pmsky", "com_crabdance", "app_blebbit", "app_ocho", "uk_skyblur", "us_polhem", "blue_atplane", "net_mmatt", "minimal" ]
+
+
# --- generated ---
+
# Generated namespace features
+
# Each namespace feature automatically enables its dependencies
+
app_blebbit = []
+
app_bsky = ["com_atproto"]
+
app_ocho = []
+
beauty_cybernetic = []
+
blog_pckt = []
blue__2048 = []
blue_atplane = []
+
blue_linkat = []
+
blue_zio = []
+
buzz_bookhive = []
+
chat_bsky = ["app_bsky"]
club_stellz = []
-
net_mmatt = []
-
how_bun = []
-
lol_atmo = []
-
lol_skittr = []
-
win_tomo = []
-
inc_toronto = []
+
com_atproto = []
com_bad_example = []
-
dev_ocbwoy3 = []
-
dev_fudgeu = []
-
com_welistskyblue = []
-
blog_pckt = []
-
blue_rito = []
-
net_bnewbold = []
-
win_tomo_x = []
+
com_crabdance = []
com_shinolabs = []
-
fyi_unravel = []
-
blue_zio = []
-
blue_linkat = []
com_whtwnd = []
community_lexicon = []
-
social_psky = []
-
place_stream = []
+
dev_baileytownsend = []
+
dev_fudgeu = []
+
dev_ocbwoy3 = []
+
dev_regnault = []
+
fyi_unravel = []
+
garden_lexicon = []
+
moe_karashiiro = []
my_skylights = []
net_aftertheinter = []
+
net_anisota = ["app_bsky", "com_atproto"]
+
net_bnewbold = []
+
net_mmatt = []
+
network_slices = []
org_devcon = []
org_robocracy = []
-
garden_lexicon = []
+
place_atwork = []
+
place_stream = []
+
pub_leaflet = []
+
sh_tangled = []
+
sh_weaver = ["app_bsky"]
social_clippr = []
-
social_grain = []
+
social_grain = ["com_atproto"]
social_pmsky = []
-
com_crabdance = []
-
app_blebbit = []
-
beauty_cybernetic = []
-
app_ocho = []
+
social_psky = []
+
tools_ozone = ["chat_bsky", "com_atproto"]
+
tools_smokesignal = []
+
uk_ewancroft = []
uk_skyblur = []
us_polhem = []
+
win_tomo_x = []
+46
crates/jacquard-api/lexicons/events_smokesignal_automation_InvokeWebhook.json
···
+
{
+
"lexicon": 1,
+
"id": "events.smokesignal.automation.InvokeWebhook",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Process a Smoke Signal webhook event.",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"event",
+
"record",
+
"context"
+
],
+
"properties": {
+
"context": {
+
"type": "object",
+
"properties": {}
+
},
+
"event": {
+
"type": "string",
+
"knownValues": [
+
"test",
+
"rsvp.created",
+
"event.created"
+
]
+
},
+
"record": {
+
"type": "object",
+
"properties": {}
+
}
+
}
+
}
+
},
+
"output": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"properties": {}
+
}
+
}
+
}
+
}
+
}
+18
crates/jacquard-api/src/app_bsky/actor/status.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///Advertises an account as currently offering live content.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Live;
+
impl std::fmt::Display for Live {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "live")
+
}
+
}
+
///A declaration of a Bluesky account status.
#[jacquard_derive::lexicon]
#[derive(
+252
crates/jacquard-api/src/app_bsky/feed.rs
···
pub uri: jacquard_common::types::string::AtUri<'a>,
}
+
///User clicked through to the author of the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ClickthroughAuthor;
+
impl std::fmt::Display for ClickthroughAuthor {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "clickthroughAuthor")
+
}
+
}
+
+
///User clicked through to the embedded content of the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ClickthroughEmbed;
+
impl std::fmt::Display for ClickthroughEmbed {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "clickthroughEmbed")
+
}
+
}
+
+
///User clicked through to the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ClickthroughItem;
+
impl std::fmt::Display for ClickthroughItem {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "clickthroughItem")
+
}
+
}
+
+
///User clicked through to the reposter of the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ClickthroughReposter;
+
impl std::fmt::Display for ClickthroughReposter {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "clickthroughReposter")
+
}
+
}
+
+
///Declares the feed generator returns any types of posts.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ContentModeUnspecified;
+
impl std::fmt::Display for ContentModeUnspecified {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "contentModeUnspecified")
+
}
+
}
+
+
///Declares the feed generator returns posts containing app.bsky.embed.video embeds.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ContentModeVideo;
+
impl std::fmt::Display for ContentModeVideo {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "contentModeVideo")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
pub req_id: std::option::Option<jacquard_common::CowStr<'a>>,
}
+
///User liked the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionLike;
+
impl std::fmt::Display for InteractionLike {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionLike")
+
}
+
}
+
+
///User quoted the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionQuote;
+
impl std::fmt::Display for InteractionQuote {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionQuote")
+
}
+
}
+
+
///User replied to the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionReply;
+
impl std::fmt::Display for InteractionReply {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionReply")
+
}
+
}
+
+
///User reposted the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionRepost;
+
impl std::fmt::Display for InteractionRepost {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionRepost")
+
}
+
}
+
+
///Feed item was seen by user
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionSeen;
+
impl std::fmt::Display for InteractionSeen {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionSeen")
+
}
+
}
+
+
///User shared the feed item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InteractionShare;
+
impl std::fmt::Display for InteractionShare {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interactionShare")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ReplyRefRecordRoot<'a> {}
+
///Request that less content like the given feed item be shown in the feed
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RequestLess;
+
impl std::fmt::Display for RequestLess {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "requestLess")
+
}
+
}
+
+
///Request that more content like the given feed item be shown in the feed
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RequestMore;
+
impl std::fmt::Display for RequestMore {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "requestMore")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
+54
crates/jacquard-api/src/app_bsky/graph.rs
···
pub mod unmute_thread;
pub mod verification;
+
///A list of actors used for curation purposes such as list feeds or interaction gating.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Curatelist;
+
impl std::fmt::Display for Curatelist {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "curatelist")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
pub muted: std::option::Option<bool>,
}
+
///A list of actors to apply an aggregate moderation action (mute/block) on.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Modlist;
+
impl std::fmt::Display for Modlist {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "modlist")
+
}
+
}
+
///indicates that a handle or DID could not be resolved
#[jacquard_derive::lexicon]
#[derive(
···
#[serde(borrow)]
pub actor: jacquard_common::types::ident::AtIdentifier<'a>,
pub not_found: bool,
+
}
+
+
///A list of actors used for only for reference purposes such as within a starter pack.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Referencelist;
+
impl std::fmt::Display for Referencelist {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "referencelist")
+
}
}
///lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)
+90
crates/jacquard-api/src/buzz_bookhive.rs
···
pub mod hive_book;
pub mod search_books;
+
///User has abandoned the book
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Abandoned;
+
impl std::fmt::Display for Abandoned {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "abandoned")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
pub parent: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
}
+
///User has finished reading the book
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Finished;
+
impl std::fmt::Display for Finished {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "finished")
+
}
+
}
+
+
///User owns the book
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Owned;
+
impl std::fmt::Display for Owned {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "owned")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
#[serde(borrow)]
pub handle: jacquard_common::CowStr<'a>,
pub reviews: i64,
+
}
+
+
///User is currently reading the book
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Reading;
+
impl std::fmt::Display for Reading {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reading")
+
}
}
#[jacquard_derive::lexicon]
···
///The title of the book
#[serde(borrow)]
pub title: jacquard_common::CowStr<'a>,
+
}
+
+
///User wants to read the book
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct WantToRead;
+
impl std::fmt::Display for WantToRead {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "wantToRead")
+
}
}
+126
crates/jacquard-api/src/com_atproto/moderation.rs
···
pub mod create_report;
+
///Appeal a previously taken moderation action
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonAppeal;
+
impl std::fmt::Display for ReasonAppeal {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonAppeal")
+
}
+
}
+
+
///Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleading;
+
impl std::fmt::Display for ReasonMisleading {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleading")
+
}
+
}
+
+
///Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonOther;
+
impl std::fmt::Display for ReasonOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonOther")
+
}
+
}
+
+
///Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonRude;
+
impl std::fmt::Display for ReasonRude {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonRude")
+
}
+
}
+
+
///Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexual;
+
impl std::fmt::Display for ReasonSexual {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexual")
+
}
+
}
+
+
///Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSpam;
+
impl std::fmt::Display for ReasonSpam {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSpam")
+
}
+
}
+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReasonType<'a> {
ComAtprotoModerationDefsReasonSpam,
···
}
ReasonType::Other(v) => ReasonType::Other(v.into_static()),
}
+
}
+
}
+
+
///Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolation;
+
impl std::fmt::Display for ReasonViolation {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolation")
}
}
+144
crates/jacquard-api/src/community_lexicon/calendar/event.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///The event has been cancelled.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Cancelled;
+
impl std::fmt::Display for Cancelled {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "cancelled")
+
}
+
}
+
+
///A hybrid event that takes place both online and offline.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Hybrid;
+
impl std::fmt::Display for Hybrid {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "hybrid")
+
}
+
}
+
+
///An in-person event that takes place offline.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Inperson;
+
impl std::fmt::Display for Inperson {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "inperson")
+
}
+
}
+
///A calendar event.
#[jacquard_derive::lexicon]
#[derive(
···
}
}
+
///The event has been created, but not finalized.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Planned;
+
impl std::fmt::Display for Planned {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "planned")
+
}
+
}
+
+
///The event has been postponed and a new start date has not been set.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Postponed;
+
impl std::fmt::Display for Postponed {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "postponed")
+
}
+
}
+
+
///The event has been rescheduled.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Rescheduled;
+
impl std::fmt::Display for Rescheduled {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "rescheduled")
+
}
+
}
+
+
///The event has been created and scheduled.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Scheduled;
+
impl std::fmt::Display for Scheduled {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "scheduled")
+
}
+
}
+
///The status of the event.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Status<'a> {
···
pub name: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::Uri<'a>,
+
}
+
+
///A virtual event that takes place online.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Virtual;
+
impl std::fmt::Display for Virtual {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "virtual")
+
}
}
+54
crates/jacquard-api/src/community_lexicon/calendar/rsvp.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///Going to the event
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Going;
+
impl std::fmt::Display for Going {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "going")
+
}
+
}
+
+
///Interested in the event
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Interested;
+
impl std::fmt::Display for Interested {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "interested")
+
}
+
}
+
///An RSVP for an event.
#[jacquard_derive::lexicon]
#[derive(
···
impl jacquard_common::types::collection::Collection for Rsvp<'_> {
const NSID: &'static str = "community.lexicon.calendar.rsvp";
+
}
+
+
///Not going to the event
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Notgoing;
+
impl std::fmt::Display for Notgoing {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "notgoing")
+
}
}
-6
crates/jacquard-api/src/events_smokesignal.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod automation;
-6
crates/jacquard-api/src/events_smokesignal/automation.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod invoke_webhook;
-78
crates/jacquard-api/src/events_smokesignal/automation/invoke_webhook.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// Lexicon: events.smokesignal.automation.InvokeWebhook
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
bon::Builder,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
#[builder(start_fn = new)]
-
pub struct InvokeWebhook<'a> {
-
#[serde(borrow)]
-
pub context: InvokeWebhookRecordContext<'a>,
-
#[serde(borrow)]
-
#[builder(into)]
-
pub event: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub record: InvokeWebhookRecordRecord<'a>,
-
#[serde(flatten)]
-
#[serde(borrow)]
-
#[builder(default)]
-
pub extra_data: ::std::collections::BTreeMap<
-
::jacquard_common::smol_str::SmolStr,
-
::jacquard_common::types::value::Data<'a>,
-
>,
-
}
-
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
pub struct InvokeWebhookOutput<'a> {}
-
///Response type for
-
///events.smokesignal.automation.InvokeWebhook
-
pub struct InvokeWebhookResponse;
-
impl jacquard_common::xrpc::XrpcResp for InvokeWebhookResponse {
-
const NSID: &'static str = "events.smokesignal.automation.InvokeWebhook";
-
const ENCODING: &'static str = "application/json";
-
type Output<'de> = InvokeWebhookOutput<'de>;
-
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
-
}
-
-
impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for InvokeWebhook<'de> {
-
const NSID: &'static str = "events.smokesignal.automation.InvokeWebhook";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
-
"application/json",
-
);
-
type Response = InvokeWebhookResponse;
-
}
-
-
///Endpoint type for
-
///events.smokesignal.automation.InvokeWebhook
-
pub struct InvokeWebhookRequest;
-
impl jacquard_common::xrpc::XrpcEndpoint for InvokeWebhookRequest {
-
const PATH: &'static str = "/xrpc/events.smokesignal.automation.InvokeWebhook";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
-
"application/json",
-
);
-
type Request<'de> = InvokeWebhook<'de>;
-
type Response = InvokeWebhookResponse;
-
}
-6
crates/jacquard-api/src/lol_atmo.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod link;
-28
crates/jacquard-api/src/lol_atmo/link.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// Lexicon: lol.atmo.link
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
pub struct Link<'a> {
-
#[serde(borrow)]
-
pub short: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub url: jacquard_common::CowStr<'a>,
-
}
-
-
impl jacquard_common::types::collection::Collection for Link<'_> {
-
const NSID: &'static str = "lol.atmo.link";
-
}
-7
crates/jacquard-api/src/lol_skittr.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod actor;
-
pub mod server;
-7
crates/jacquard-api/src/lol_skittr/actor.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod get_theme;
-
pub mod theme;
-66
crates/jacquard-api/src/lol_skittr/actor/get_theme.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// Lexicon: lol.skittr.actor.getTheme
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
bon::Builder,
-
jacquard_derive::IntoStatic
-
)]
-
#[builder(start_fn = new)]
-
#[serde(rename_all = "camelCase")]
-
pub struct GetTheme<'a> {
-
#[serde(borrow)]
-
pub actor: jacquard_common::types::ident::AtIdentifier<'a>,
-
}
-
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
pub struct GetThemeOutput<'a> {
-
#[serde(flatten)]
-
#[serde(borrow)]
-
pub value: crate::lol_skittr::actor::theme::Theme<'a>,
-
}
-
-
///Response type for
-
///lol.skittr.actor.getTheme
-
pub struct GetThemeResponse;
-
impl jacquard_common::xrpc::XrpcResp for GetThemeResponse {
-
const NSID: &'static str = "lol.skittr.actor.getTheme";
-
const ENCODING: &'static str = "application/json";
-
type Output<'de> = GetThemeOutput<'de>;
-
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
-
}
-
-
impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for GetTheme<'de> {
-
const NSID: &'static str = "lol.skittr.actor.getTheme";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
-
type Response = GetThemeResponse;
-
}
-
-
///Endpoint type for
-
///lol.skittr.actor.getTheme
-
pub struct GetThemeRequest;
-
impl jacquard_common::xrpc::XrpcEndpoint for GetThemeRequest {
-
const PATH: &'static str = "/xrpc/lol.skittr.actor.getTheme";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
-
type Request<'de> = GetTheme<'de>;
-
type Response = GetThemeResponse;
-
}
-39
crates/jacquard-api/src/lol_skittr/actor/theme.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// Lexicon: lol.skittr.actor.theme
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
///Profile customization values
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
pub struct Theme<'a> {
-
///A background image, must be either PNG or JPEG
-
#[serde(skip_serializing_if = "std::option::Option::is_none")]
-
#[serde(borrow)]
-
pub background: std::option::Option<jacquard_common::types::blob::Blob<'a>>,
-
#[serde(borrow)]
-
pub bg_color: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub link_color: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub side_border: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub side_color: jacquard_common::CowStr<'a>,
-
#[serde(borrow)]
-
pub text_color: jacquard_common::CowStr<'a>,
-
}
-
-
impl jacquard_common::types::collection::Collection for Theme<'_> {
-
const NSID: &'static str = "lol.skittr.actor.theme";
-
}
-6
crates/jacquard-api/src/lol_skittr/server.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
pub mod get_meta;
-67
crates/jacquard-api/src/lol_skittr/server/get_meta.rs
···
-
// @generated by jacquard-lexicon. DO NOT EDIT.
-
//
-
// Lexicon: lol.skittr.server.getMeta
-
//
-
// This file was automatically generated from Lexicon schemas.
-
// Any manual changes will be overwritten on the next regeneration.
-
-
#[jacquard_derive::lexicon]
-
#[derive(
-
serde::Serialize,
-
serde::Deserialize,
-
Debug,
-
Clone,
-
PartialEq,
-
Eq,
-
jacquard_derive::IntoStatic
-
)]
-
#[serde(rename_all = "camelCase")]
-
pub struct GetMetaOutput<'a> {
-
#[serde(borrow)]
-
pub software: jacquard_common::CowStr<'a>,
-
#[serde(skip_serializing_if = "std::option::Option::is_none")]
-
#[serde(borrow)]
-
pub supported_extensions: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
-
#[serde(borrow)]
-
pub supported_lexicons: Vec<jacquard_common::CowStr<'a>>,
-
#[serde(borrow)]
-
pub version: jacquard_common::CowStr<'a>,
-
}
-
-
/// XRPC request marker type
-
#[derive(
-
Debug,
-
Clone,
-
Copy,
-
PartialEq,
-
Eq,
-
serde::Serialize,
-
serde::Deserialize,
-
jacquard_derive::IntoStatic
-
)]
-
pub struct GetMeta;
-
///Response type for
-
///lol.skittr.server.getMeta
-
pub struct GetMetaResponse;
-
impl jacquard_common::xrpc::XrpcResp for GetMetaResponse {
-
const NSID: &'static str = "lol.skittr.server.getMeta";
-
const ENCODING: &'static str = "application/json";
-
type Output<'de> = GetMetaOutput<'de>;
-
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
-
}
-
-
impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for GetMeta {
-
const NSID: &'static str = "lol.skittr.server.getMeta";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
-
type Response = GetMetaResponse;
-
}
-
-
///Endpoint type for
-
///lol.skittr.server.getMeta
-
pub struct GetMetaRequest;
-
impl jacquard_common::xrpc::XrpcEndpoint for GetMetaRequest {
-
const PATH: &'static str = "/xrpc/lol.skittr.server.getMeta";
-
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
-
type Request<'de> = GetMeta;
-
type Response = GetMetaResponse;
-
}
+90
crates/jacquard-api/src/my_skylights/list_item.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///User gave up on finishing the item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Abandoned;
+
impl std::fmt::Display for Abandoned {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "abandoned")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
ListItemWishlist(Box<crate::my_skylights::list_item::Wishlist>),
}
+
///User is currently reading/watching/... the item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct InProgress;
+
impl std::fmt::Display for InProgress {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "inProgress")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
···
pub enum ListItemRecordList<'a> {
#[serde(rename = "my.skylights.list")]
List(Box<crate::my_skylights::list::List<'a>>),
+
}
+
+
///User owns the item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Owned;
+
impl std::fmt::Display for Owned {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "owned")
+
}
+
}
+
+
///User plans to read/watch/... the item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Queue;
+
impl std::fmt::Display for Queue {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "queue")
+
}
+
}
+
+
///User wants to own the item
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Wishlist;
+
impl std::fmt::Display for Wishlist {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "wishlist")
+
}
}
+36
crates/jacquard-api/src/place_atwork/profile.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///Indicates the identity is available for hire
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Forhire;
+
impl std::fmt::Display for Forhire {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "forhire")
+
}
+
}
+
+
///Indicates the identity is actively hiring
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Hiring;
+
impl std::fmt::Display for Hiring {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "hiring")
+
}
+
}
+
///A user profile for AT://Work.Place
#[jacquard_derive::lexicon]
#[derive(
+51
crates/jacquard-api/src/pub_leaflet/pages/linear_document.rs
···
pub end: crate::pub_leaflet::pages::linear_document::Position<'a>,
#[serde(borrow)]
pub start: crate::pub_leaflet::pages::linear_document::Position<'a>,
+
}
+
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TextAlignCenter;
+
impl std::fmt::Display for TextAlignCenter {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "textAlignCenter")
+
}
+
}
+
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TextAlignLeft;
+
impl std::fmt::Display for TextAlignLeft {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "textAlignLeft")
+
}
+
}
+
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TextAlignRight;
+
impl std::fmt::Display for TextAlignRight {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "textAlignRight")
+
}
}
+17
crates/jacquard-api/src/sh_tangled/repo/issue/state/closed.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///closed issue
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Closed;
+
impl std::fmt::Display for Closed {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "main")
+
}
+
}
+17
crates/jacquard-api/src/sh_tangled/repo/issue/state/open.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///open issue
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Open;
+
impl std::fmt::Display for Open {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "main")
+
}
+
}
+17
crates/jacquard-api/src/sh_tangled/repo/pull/status/closed.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///closed pull request
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Closed;
+
impl std::fmt::Display for Closed {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "main")
+
}
+
}
+17
crates/jacquard-api/src/sh_tangled/repo/pull/status/merged.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///merged pull request
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Merged;
+
impl std::fmt::Display for Merged {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "main")
+
}
+
}
+17
crates/jacquard-api/src/sh_tangled/repo/pull/status/open.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///open pull request
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct Open;
+
impl std::fmt::Display for Open {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "main")
+
}
+
}
+3 -3
crates/jacquard-api/src/sh_weaver/embed/record_with_media.rs
···
#[serde(rename = "sh.weaver.embed.external")]
External(Box<crate::sh_weaver::embed::external::ExternalRecord<'a>>),
#[serde(rename = "app.bsky.embed.images")]
-
Images(Box<crate::app_bsky::embed::images::Images<'a>>),
+
BskyImages(Box<crate::app_bsky::embed::images::Images<'a>>),
#[serde(rename = "app.bsky.embed.video")]
Video(Box<crate::app_bsky::embed::video::Video<'a>>),
#[serde(rename = "app.bsky.embed.external")]
-
External(Box<crate::app_bsky::embed::external::ExternalRecord<'a>>),
+
BskyExternal(Box<crate::app_bsky::embed::external::ExternalRecord<'a>>),
}
#[jacquard_derive::open_union]
···
#[serde(rename = "app.bsky.embed.video#view")]
VideoView(Box<crate::app_bsky::embed::video::View<'a>>),
#[serde(rename = "app.bsky.embed.external#view")]
-
ExternalView(Box<crate::app_bsky::embed::external::View<'a>>),
+
BskyExternalView(Box<crate::app_bsky::embed::external::View<'a>>),
}
#[jacquard_derive::open_union]
+126
crates/jacquard-api/src/tools_ozone/moderation.rs
···
pub takendown_record_count: i64,
+
///Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReviewClosed;
+
impl std::fmt::Display for ReviewClosed {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reviewClosed")
+
}
+
}
+
+
///Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReviewEscalated;
+
impl std::fmt::Display for ReviewEscalated {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reviewEscalated")
+
}
+
}
+
+
///Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReviewNone;
+
impl std::fmt::Display for ReviewNone {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reviewNone")
+
}
+
}
+
+
///Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReviewOpen;
+
impl std::fmt::Display for ReviewOpen {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reviewOpen")
+
}
+
}
+
///Account credentials revocation by moderators. Only works on DID subjects.
#[jacquard_derive::lexicon]
#[derive(
···
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum SubjectViewRecordProfile<'a> {}
+
///Moderation event timeline event for a PLC create operation
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TimelineEventPlcCreate;
+
impl std::fmt::Display for TimelineEventPlcCreate {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "timelineEventPlcCreate")
+
}
+
}
+
+
///Moderation event timeline event for generic PLC operation
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TimelineEventPlcOperation;
+
impl std::fmt::Display for TimelineEventPlcOperation {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "timelineEventPlcOperation")
+
}
+
}
+
+
///Moderation event timeline event for a PLC tombstone operation
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct TimelineEventPlcTombstone;
+
impl std::fmt::Display for TimelineEventPlcTombstone {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "timelineEventPlcTombstone")
+
}
+
}
+
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
+720
crates/jacquard-api/src/tools_ozone/report.rs
···
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.
+
///Appeal a previously taken moderation action
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonAppeal;
+
impl std::fmt::Display for ReasonAppeal {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonAppeal")
+
}
+
}
+
+
///Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonChildSafetyCsam;
+
impl std::fmt::Display for ReasonChildSafetyCsam {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonChildSafetyCSAM")
+
}
+
}
+
+
///Grooming or predatory behavior. These reports will be sent only be sent to the application's Moderation Authority.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonChildSafetyGroom;
+
impl std::fmt::Display for ReasonChildSafetyGroom {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonChildSafetyGroom")
+
}
+
}
+
+
///Harassment or bullying of minors
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonChildSafetyHarassment;
+
impl std::fmt::Display for ReasonChildSafetyHarassment {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonChildSafetyHarassment")
+
}
+
}
+
+
///Other child safety. These reports will be sent only be sent to the application's Moderation Authority.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonChildSafetyOther;
+
impl std::fmt::Display for ReasonChildSafetyOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonChildSafetyOther")
+
}
+
}
+
+
///Privacy violation involving a minor
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonChildSafetyPrivacy;
+
impl std::fmt::Display for ReasonChildSafetyPrivacy {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonChildSafetyPrivacy")
+
}
+
}
+
+
///Doxxing
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonHarassmentDoxxing;
+
impl std::fmt::Display for ReasonHarassmentDoxxing {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonHarassmentDoxxing")
+
}
+
}
+
+
///Hate speech
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonHarassmentHateSpeech;
+
impl std::fmt::Display for ReasonHarassmentHateSpeech {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonHarassmentHateSpeech")
+
}
+
}
+
+
///Other harassing or hateful content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonHarassmentOther;
+
impl std::fmt::Display for ReasonHarassmentOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonHarassmentOther")
+
}
+
}
+
+
///Targeted harassment
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonHarassmentTargeted;
+
impl std::fmt::Display for ReasonHarassmentTargeted {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonHarassmentTargeted")
+
}
+
}
+
+
///Trolling
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonHarassmentTroll;
+
impl std::fmt::Display for ReasonHarassmentTroll {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonHarassmentTroll")
+
}
+
}
+
+
///Fake account or bot
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingBot;
+
impl std::fmt::Display for ReasonMisleadingBot {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingBot")
+
}
+
}
+
+
///False information about elections
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingElections;
+
impl std::fmt::Display for ReasonMisleadingElections {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingElections")
+
}
+
}
+
+
///Impersonation
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingImpersonation;
+
impl std::fmt::Display for ReasonMisleadingImpersonation {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingImpersonation")
+
}
+
}
+
+
///Other misleading content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingOther;
+
impl std::fmt::Display for ReasonMisleadingOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingOther")
+
}
+
}
+
+
///Scam
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingScam;
+
impl std::fmt::Display for ReasonMisleadingScam {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingScam")
+
}
+
}
+
+
///Spam
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonMisleadingSpam;
+
impl std::fmt::Display for ReasonMisleadingSpam {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonMisleadingSpam")
+
}
+
}
+
+
///An issue not included in these options
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonOther;
+
impl std::fmt::Display for ReasonOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonOther")
+
}
+
}
+
+
///Banned user returning
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonRuleBanEvasion;
+
impl std::fmt::Display for ReasonRuleBanEvasion {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonRuleBanEvasion")
+
}
+
}
+
+
///Other
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonRuleOther;
+
impl std::fmt::Display for ReasonRuleOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonRuleOther")
+
}
+
}
+
+
///Promoting or selling prohibited items or services
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonRuleProhibitedSales;
+
impl std::fmt::Display for ReasonRuleProhibitedSales {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonRuleProhibitedSales")
+
}
+
}
+
+
///Hacking or system attacks
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonRuleSiteSecurity;
+
impl std::fmt::Display for ReasonRuleSiteSecurity {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonRuleSiteSecurity")
+
}
+
}
+
+
///Content promoting or depicting self-harm
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSelfHarmContent;
+
impl std::fmt::Display for ReasonSelfHarmContent {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSelfHarmContent")
+
}
+
}
+
+
///Eating disorders
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSelfHarmEd;
+
impl std::fmt::Display for ReasonSelfHarmEd {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSelfHarmED")
+
}
+
}
+
+
///Other dangerous content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSelfHarmOther;
+
impl std::fmt::Display for ReasonSelfHarmOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSelfHarmOther")
+
}
+
}
+
+
///Dangerous challenges or activities
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSelfHarmStunts;
+
impl std::fmt::Display for ReasonSelfHarmStunts {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSelfHarmStunts")
+
}
+
}
+
+
///Dangerous substances or drug abuse
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSelfHarmSubstances;
+
impl std::fmt::Display for ReasonSelfHarmSubstances {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSelfHarmSubstances")
+
}
+
}
+
+
///Adult sexual abuse content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualAbuseContent;
+
impl std::fmt::Display for ReasonSexualAbuseContent {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualAbuseContent")
+
}
+
}
+
+
///Animal sexual abuse
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualAnimal;
+
impl std::fmt::Display for ReasonSexualAnimal {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualAnimal")
+
}
+
}
+
+
///Deepfake adult content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualDeepfake;
+
impl std::fmt::Display for ReasonSexualDeepfake {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualDeepfake")
+
}
+
}
+
+
///Non-consensual intimate imagery
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualNcii;
+
impl std::fmt::Display for ReasonSexualNcii {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualNCII")
+
}
+
}
+
+
///Other sexual violence content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualOther;
+
impl std::fmt::Display for ReasonSexualOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualOther")
+
}
+
}
+
+
///Unlabelled adult content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonSexualUnlabeled;
+
impl std::fmt::Display for ReasonSexualUnlabeled {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonSexualUnlabeled")
+
}
+
}
+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReasonType<'a> {
ToolsOzoneReportDefsReasonAppeal,
···
}
ReasonType::Other(v) => ReasonType::Other(v.into_static()),
}
+
}
+
}
+
+
///Animal welfare violations
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceAnimal;
+
impl std::fmt::Display for ReasonViolenceAnimal {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceAnimal")
+
}
+
}
+
+
///Extremist content. These reports will be sent only be sent to the application's Moderation Authority.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceExtremistContent;
+
impl std::fmt::Display for ReasonViolenceExtremistContent {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceExtremistContent")
+
}
+
}
+
+
///Glorification of violence
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceGlorification;
+
impl std::fmt::Display for ReasonViolenceGlorification {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceGlorification")
+
}
+
}
+
+
///Graphic violent content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceGraphicContent;
+
impl std::fmt::Display for ReasonViolenceGraphicContent {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceGraphicContent")
+
}
+
}
+
+
///Other violent content
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceOther;
+
impl std::fmt::Display for ReasonViolenceOther {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceOther")
+
}
+
}
+
+
///Threats or incitement
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceThreats;
+
impl std::fmt::Display for ReasonViolenceThreats {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceThreats")
+
}
+
}
+
+
///Human trafficking
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct ReasonViolenceTrafficking;
+
impl std::fmt::Display for ReasonViolenceTrafficking {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "reasonViolenceTrafficking")
}
}
+72
crates/jacquard-api/src/tools_ozone/team.rs
···
pub role: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
+
}
+
+
///Admin role. Highest level of access, can perform all actions.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RoleAdmin;
+
impl std::fmt::Display for RoleAdmin {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "roleAdmin")
+
}
+
}
+
+
///Moderator role. Can perform most actions.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RoleModerator;
+
impl std::fmt::Display for RoleModerator {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "roleModerator")
+
}
+
}
+
+
///Triage role. Mostly intended for monitoring and escalating issues.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RoleTriage;
+
impl std::fmt::Display for RoleTriage {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "roleTriage")
+
}
+
}
+
+
///Verifier role. Only allowed to issue verifications.
+
#[derive(
+
serde::Serialize,
+
serde::Deserialize,
+
Debug,
+
Clone,
+
PartialEq,
+
Eq,
+
Hash,
+
jacquard_derive::IntoStatic
+
)]
+
pub struct RoleVerifier;
+
impl std::fmt::Display for RoleVerifier {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, "roleVerifier")
+
}
}
+3 -3
crates/jacquard-axum/Cargo.toml
···
[package]
name = "jacquard-axum"
edition.workspace = true
-
version.workspace = true
+
version = "0.4.0"
authors.workspace = true
repository.workspace = true
keywords.workspace = true
···
axum = "0.8.6"
axum-macros = "0.5.0"
bytes.workspace = true
-
jacquard = { version = "0.3.0", path = "../jacquard" }
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common", features = ["reqwest-client"] }
+
jacquard = { version = "*", path = "../jacquard" }
+
jacquard-common = { version = "*", path = "../jacquard-common", features = ["reqwest-client"] }
miette.workspace = true
serde.workspace = true
serde_html_form.workspace = true
+1 -1
crates/jacquard-common/Cargo.toml
···
name = "jacquard-common"
description = "Core AT Protocol types and utilities for Jacquard"
edition.workspace = true
-
version.workspace = true
+
version = "0.4.0"
authors.workspace = true
repository.workspace = true
keywords.workspace = true
+13 -10
crates/jacquard-common/src/types/value/convert.rs
···
+
use crate::IntoStatic;
use crate::types::{
DataModelType,
cid::Cid,
string::AtprotoStr,
value::{Array, Data, Object, RawData, parsing},
};
-
use crate::{CowStr, IntoStatic};
use bytes::Bytes;
-
use core::{any::TypeId, fmt};
+
use core::any::TypeId;
use smol_str::SmolStr;
use std::{borrow::ToOwned, boxed::Box, collections::BTreeMap, vec::Vec};
···
if let Some(RawData::String(type_str)) = map.get("$type") {
if parsing::infer_from_type(type_str) == DataModelType::Blob {
// Try to parse as blob
-
if let (Some(RawData::CidLink(cid)), Some(RawData::String(mime)), Some(size)) = (
-
map.get("ref"),
-
map.get("mimeType"),
-
map.get("size")
-
) {
+
if let (
+
Some(RawData::CidLink(cid)),
+
Some(RawData::String(mime)),
+
Some(size),
+
) = (map.get("ref"), map.get("mimeType"), map.get("size"))
+
{
let size_val = match size {
RawData::UnsignedInt(u) => *u as usize,
RawData::SignedInt(i) => *i as usize,
-
_ => return Err(ConversionError::InvalidRawData {
-
message: "blob size must be integer".to_string(),
-
}),
+
_ => {
+
return Err(ConversionError::InvalidRawData {
+
message: "blob size must be integer".to_string(),
+
});
+
}
};
return Ok(Data::Blob(crate::types::blob::Blob {
r#ref: cid.clone(),
+3 -6
crates/jacquard-common/src/types/value/serde_impl.rs
···
-
// ========================================================================
-
// SERIALIZER IMPLEMENTATION - Serializing to RawData
-
// ========================================================================
-
/// Error type for RawData serialization
#[derive(Debug)]
pub enum RawDataSerializerError {
+
/// Error message
Message(String),
···
-
// Sequence serializer accumulator
+
/// Sequence serializer accumulator
pub struct RawDataSeqSerializer {
items: Vec<RawData<'static>>,
···
-
// Map serializer accumulator
+
/// Map serializer accumulator
pub struct RawDataMapSerializer {
map: BTreeMap<SmolStr, RawData<'static>>,
next_key: Option<SmolStr>,
+18 -7
crates/jacquard-common/src/xrpc.rs
···
type Err<'de>: Error + Deserialize<'de> + IntoStatic;
}
+
/// XRPC server endpoint trait
+
///
+
/// Defines the fully-qualified path and method, as well as request and response types
+
/// This exists primarily to work around lifetime issues for crates like Axum
+
/// by moving the lifetime from the trait itself into an associated type.
+
///
+
/// It is implemented by the code generation on a marker struct, like the client-side [XrpcResp] trait.
+
pub trait XrpcEndpoint {
+
/// Fully-qualified path ('/xrpc/[nsid]') where this endpoint should live on the server
+
const PATH: &'static str;
+
/// XRPC method (query/GET or procedure/POST)
+
const METHOD: XrpcMethod;
+
/// XRPC Request data type
+
type Request<'de>: XrpcRequest<'de> + IntoStatic;
+
/// XRPC Response data type
+
type Response: XrpcResp;
+
}
+
/// Error type for XRPC endpoints that don't define any errors
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct GenericError<'a>(#[serde(borrow)] Data<'a>);
···
builder
.body(body)
.map_err(|e| TransportError::InvalidRequest(e.to_string()))
-
}
-
-
pub trait XrpcEndpoint {
-
const PATH: &'static str;
-
const METHOD: XrpcMethod;
-
type Request<'de>: XrpcRequest<'de> + IntoStatic;
-
type Response: XrpcResp;
}
/// XRPC response wrapper that owns the response buffer
+1 -1
crates/jacquard-derive/Cargo.toml
···
[dev-dependencies]
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common" }
+
jacquard-common = { version = "*", path = "../jacquard-common" }
+4 -4
crates/jacquard-identity/Cargo.toml
···
[package]
name = "jacquard-identity"
edition.workspace = true
-
version.workspace = true
+
version = "0.3.1"
authors.workspace = true
repository.workspace = true
keywords.workspace = true
···
exclude.workspace = true
homepage.workspace = true
license.workspace = true
-
description.workspace = true
+
description = "ATProto identity resolution utilities for Jacquard"
[features]
dns = ["dep:hickory-resolver"]
···
async-trait.workspace = true
bon.workspace = true
bytes.workspace = true
-
jacquard-common = { version = "0.3", path = "../jacquard-common", features = ["reqwest-client"] }
+
jacquard-common = { version = "*", path = "../jacquard-common", features = ["reqwest-client"] }
+
jacquard-api = { version = "*", path = "../jacquard-api" }
percent-encoding.workspace = true
reqwest.workspace = true
url.workspace = true
···
thiserror.workspace = true
miette.workspace = true
http.workspace = true
-
jacquard-api = { version = "0.3.0", path = "../jacquard-api" }
serde_html_form.workspace = true
urlencoding.workspace = true
+3 -3
crates/jacquard-lexicon/Cargo.toml
···
glob = "0.3"
heck.workspace = true
itertools.workspace = true
-
jacquard-api = { version = "0.3.0", path = "../jacquard-api" }
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common" }
-
jacquard-identity = { version = "0.3.0", path = "../jacquard-identity" }
+
jacquard-api = { version = "*", path = "../jacquard-api" }
+
jacquard-common = { version = "*", path = "../jacquard-common" }
+
jacquard-identity = { version = "*", path = "../jacquard-identity" }
kdl = "6"
miette = { workspace = true, features = ["fancy"] }
prettyplease.workspace = true
+33
crates/jacquard-lexicon/src/bin/lex_fetch.rs
···
codegen.write_to_disk(&config.output.codegen_dir)?;
println!("Generated code to {:?}", config.output.codegen_dir);
+
+
// Update Cargo.toml features if cargo_toml_path is specified
+
if let Some(cargo_toml_path) = &config.output.cargo_toml_path {
+
if args.verbose {
+
println!("Updating Cargo.toml features...");
+
}
+
+
update_cargo_features(&codegen, cargo_toml_path, &config.output.codegen_dir)?;
+
println!("Updated features in {:?}", cargo_toml_path);
+
}
} else {
println!("Lexicons written to {:?}", config.output.lexicons_dir);
}
Ok(())
}
+
+
fn update_cargo_features(codegen: &CodeGenerator, cargo_toml_path: &PathBuf, codegen_dir: &PathBuf) -> Result<()> {
+
// Read existing Cargo.toml
+
let content = std::fs::read_to_string(cargo_toml_path).into_diagnostic()?;
+
+
// Find the "# --- generated ---" marker
+
const MARKER: &str = "# --- generated ---";
+
+
let (before, _after) = content.split_once(MARKER)
+
.ok_or_else(|| miette::miette!("Cargo.toml missing '{}' marker", MARKER))?;
+
+
// Generate new features, passing lib.rs path to detect existing modules
+
let lib_rs_path = codegen_dir.join("lib.rs");
+
let features = codegen.generate_cargo_features(Some(&lib_rs_path));
+
+
// Reconstruct file
+
let new_content = format!("{}{}\n{}", before, MARKER, features);
+
+
// Write back
+
std::fs::write(cargo_toml_path, new_content).into_diagnostic()?;
+
+
Ok(())
+
}
+232 -23
crates/jacquard-lexicon/src/codegen.rs
···
pub struct CodeGenerator<'c> {
corpus: &'c LexiconCorpus,
root_module: String,
+
/// Track namespace dependencies (namespace -> set of namespaces it depends on)
+
namespace_deps:
+
std::cell::RefCell<std::collections::HashMap<String, std::collections::HashSet<String>>>,
}
impl<'c> CodeGenerator<'c> {
···
Self {
corpus,
root_module: root_module.into(),
+
namespace_deps: std::cell::RefCell::new(std::collections::HashMap::new()),
}
}
···
LexUserType::Object(obj) => self.generate_object(nsid, def_name, obj),
LexUserType::XrpcQuery(query) => self.generate_query(nsid, def_name, query),
LexUserType::XrpcProcedure(proc) => self.generate_procedure(nsid, def_name, proc),
-
LexUserType::Token(_) => {
-
// Token types are marker types used in knownValues enums.
-
// We don't generate anything for them - the knownValues enum
-
// is the actual type that gets used.
-
Ok(quote! {})
+
LexUserType::Token(token) => {
+
// Token types are marker structs that can be used as union refs
+
let type_name = self.def_to_type_name(nsid, def_name);
+
let ident = syn::Ident::new(&type_name, proc_macro2::Span::call_site());
+
let doc = self.generate_doc_comment(token.description.as_ref());
+
+
// Token name for Display impl (just the def name, not the full ref)
+
let token_name = def_name;
+
+
Ok(quote! {
+
#doc
+
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic)]
+
pub struct #ident;
+
+
impl std::fmt::Display for #ident {
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+
write!(f, #token_name)
+
}
+
}
+
})
}
LexUserType::String(s) if s.known_values.is_some() => {
self.generate_known_values_enum(nsid, def_name, s)
···
// Clone refs to avoid lifetime issues
let refs: Vec<_> = union.refs.iter().cloned().collect();
let union_def =
-
self.generate_union(&union_name, &refs, None, union.closed)?;
+
self.generate_union(nsid, &union_name, &refs, None, union.closed)?;
unions.push(union_def);
}
LexObjectProperty::Object(nested_obj) => {
···
LexObjectProperty::Union(union) => {
let union_name = format!("{}Record{}", type_name, field_name.to_pascal_case());
let refs: Vec<_> = union.refs.iter().cloned().collect();
-
let union_def = self.generate_union(&union_name, &refs, None, union.closed)?;
+
let union_def =
+
self.generate_union(nsid, &union_name, &refs, None, union.closed)?;
unions.push(union_def);
}
LexObjectProperty::Object(nested_obj) => {
···
}
if let Some(body) = &query.output {
-
let output_struct = self.generate_output_struct(&type_base, body)?;
+
let output_struct = self.generate_output_struct(nsid, &type_base, body)?;
output.push(output_struct);
}
···
}
if let Some(body) = &proc.input {
-
let input_struct = self.generate_input_struct(&type_base, body)?;
+
let input_struct = self.generate_input_struct(nsid, &type_base, body)?;
output.push(input_struct);
}
if let Some(body) = &proc.output {
-
let output_struct = self.generate_output_struct(&type_base, body)?;
+
let output_struct = self.generate_output_struct(nsid, &type_base, body)?;
output.push(output_struct);
}
···
if let Some(message) = &sub.message {
if let Some(schema) = &message.schema {
-
let message_type = self.generate_subscription_message(&type_base, schema)?;
+
let message_type = self.generate_subscription_message(nsid, &type_base, schema)?;
output.push(message_type);
}
}
···
fn generate_subscription_message(
&self,
+
nsid: &str,
type_base: &str,
schema: &LexXrpcSubscriptionMessageSchema<'static>,
) -> Result<TokenStream> {
···
format!("{}Record{}", struct_name, field_name.to_pascal_case());
let refs: Vec<_> = union.refs.iter().cloned().collect();
let union_def =
-
self.generate_union(&union_name, &refs, None, union.closed)?;
+
self.generate_union(nsid, &union_name, &refs, None, union.closed)?;
unions.push(union_def);
}
}
···
/// Generate input struct from XRPC body
fn generate_input_struct(
&self,
+
nsid: &str,
type_base: &str,
body: &LexXrpcBody<'static>,
) -> Result<TokenStream> {
···
if let LexObjectProperty::Union(union) = field_type {
let union_name = format!("{}Record{}", type_base, field_name.to_pascal_case());
let refs: Vec<_> = union.refs.iter().cloned().collect();
-
let union_def = self.generate_union(&union_name, &refs, None, union.closed)?;
+
let union_def =
+
self.generate_union(nsid, &union_name, &refs, None, union.closed)?;
unions.push(union_def);
···
/// Generate output struct from XRPC body
fn generate_output_struct(
&self,
+
nsid: &str,
type_base: &str,
body: &LexXrpcBody<'static>,
) -> Result<TokenStream> {
···
let union_name =
format!("{}Record{}", struct_name, field_name.to_pascal_case());
let refs: Vec<_> = union.refs.iter().cloned().collect();
-
let union_def = self.generate_union(&union_name, &refs, None, union.closed)?;
+
let union_def =
+
self.generate_union(nsid, &union_name, &refs, None, union.closed)?;
unions.push(union_def);
···
/// Generate a union enum
pub fn generate_union(
&self,
+
current_nsid: &str,
union_name: &str,
refs: &[jacquard_common::CowStr<'static>],
description: Option<&str>,
···
) -> Result<TokenStream> {
let enum_ident = syn::Ident::new(union_name, proc_macro2::Span::call_site());
-
let mut variants = Vec::new();
+
// Extract namespace prefix from current NSID (first two segments: "sh.weaver" from "sh.weaver.embed.recordWithMedia")
+
let parts: Vec<_> = current_nsid.splitn(3, '.').collect();
+
let current_namespace = if parts.len() >= 2 {
+
format!("{}.{}", parts[0], parts[1])
+
} else {
+
current_nsid.to_string()
+
};
+
+
// First pass: collect all variant names and detect collisions
+
#[derive(Debug)]
+
struct VariantInfo<'a> {
+
ref_str: &'a str,
+
ref_nsid: &'a str,
+
simple_name: String,
+
is_current_namespace: bool,
+
}
+
+
let mut variant_infos = Vec::new();
for ref_str in refs {
// Parse ref to get NSID and def name
let (ref_nsid, ref_def) = if let Some((nsid, fragment)) = ref_str.split_once('#') {
···
continue;
-
// Generate variant name from def name (or last NSID segment if main)
-
// For non-main refs, include the last NSID segment to avoid collisions
-
// e.g. app.bsky.embed.images#view -> ImagesView
-
// app.bsky.embed.video#view -> VideoView
-
let variant_name = if ref_def == "main" {
+
// Check if ref is in current namespace
+
let is_current_namespace = ref_nsid.starts_with(&current_namespace);
+
+
// Generate simple variant name (without namespace prefix)
+
let simple_name = if ref_def == "main" {
ref_nsid.split('.').last().unwrap().to_pascal_case()
} else {
let last_segment = ref_nsid.split('.').last().unwrap().to_pascal_case();
format!("{}{}", last_segment, ref_def.to_pascal_case())
};
+
+
variant_infos.push(VariantInfo {
+
ref_str: ref_str.as_ref(),
+
ref_nsid,
+
simple_name,
+
is_current_namespace,
+
});
+
}
+
+
// Second pass: detect collisions and disambiguate
+
use std::collections::HashMap;
+
let mut name_counts: HashMap<String, usize> = HashMap::new();
+
for info in &variant_infos {
+
*name_counts.entry(info.simple_name.clone()).or_insert(0) += 1;
+
}
+
+
let mut variants = Vec::new();
+
for info in variant_infos {
+
let has_collision = name_counts.get(&info.simple_name).copied().unwrap_or(0) > 1;
+
+
// Track namespace dependency for foreign refs
+
if !info.is_current_namespace {
+
let parts: Vec<_> = info.ref_nsid.splitn(3, '.').collect();
+
let foreign_namespace = if parts.len() >= 2 {
+
format!("{}.{}", parts[0], parts[1])
+
} else {
+
info.ref_nsid.to_string()
+
};
+
self.namespace_deps
+
.borrow_mut()
+
.entry(current_namespace.clone())
+
.or_default()
+
.insert(foreign_namespace);
+
}
+
+
// Disambiguate: add second NSID segment prefix only to foreign refs when there's a collision
+
let variant_name = if has_collision && !info.is_current_namespace {
+
// Get second segment (namespace identifier: "bsky" from "app.bsky.embed.images")
+
let segments: Vec<&str> = info.ref_nsid.split('.').collect();
+
let prefix = if segments.len() >= 2 {
+
segments[1].to_pascal_case()
+
} else {
+
// Fallback: use first segment if only one exists
+
segments[0].to_pascal_case()
+
};
+
format!("{}{}", prefix, info.simple_name)
+
} else {
+
info.simple_name.clone()
+
};
+
let variant_ident = syn::Ident::new(&variant_name, proc_macro2::Span::call_site());
// Get the Rust type for this ref
-
let rust_type = self.ref_to_rust_type(ref_str.as_ref())?;
+
let rust_type = self.ref_to_rust_type(info.ref_str)?;
// Add serde rename for the full NSID
-
let ref_str_literal = ref_str.as_ref();
+
let ref_str_literal = info.ref_str;
variants.push(quote! {
#[serde(rename = #ref_str_literal)]
#variant_ident(Box<#rust_type>)
···
+
+
/// Get namespace dependencies collected during code generation
+
pub fn get_namespace_dependencies(
+
&self,
+
) -> std::collections::HashMap<String, std::collections::HashSet<String>> {
+
self.namespace_deps.borrow().clone()
+
}
+
+
/// Generate Cargo.toml features section from namespace dependencies
+
pub fn generate_cargo_features(&self, lib_rs_path: Option<&std::path::Path>) -> String {
+
use std::fmt::Write;
+
+
let deps = self.namespace_deps.borrow();
+
let mut all_namespaces: std::collections::HashSet<String> =
+
std::collections::HashSet::new();
+
+
// Collect all namespaces from the corpus (first two segments of each NSID)
+
for (nsid, _doc) in self.corpus.iter() {
+
let parts: Vec<_> = nsid.as_str().splitn(3, '.').collect();
+
let namespace = if parts.len() >= 2 {
+
format!("{}.{}", parts[0], parts[1])
+
} else {
+
nsid.to_string()
+
};
+
all_namespaces.insert(namespace);
+
}
+
+
// Also collect existing feature names from lib.rs
+
let mut existing_features = std::collections::HashSet::new();
+
if let Some(lib_rs) = lib_rs_path {
+
if let Ok(content) = std::fs::read_to_string(lib_rs) {
+
for line in content.lines() {
+
if let Some(feature) = line.trim()
+
.strip_prefix("#[cfg(feature = \"")
+
.and_then(|s| s.strip_suffix("\")]"))
+
{
+
existing_features.insert(feature.to_string());
+
}
+
}
+
}
+
}
+
+
let mut output = String::new();
+
writeln!(&mut output, "# Generated namespace features").unwrap();
+
writeln!(&mut output, "# Each namespace feature automatically enables its dependencies").unwrap();
+
+
// Convert namespace to feature name (matching module path sanitization)
+
let to_feature_name = |ns: &str| {
+
ns.split('.')
+
.map(|segment| {
+
// Apply same sanitization as module names
+
let mut result = segment.replace('-', "_");
+
// Prefix with underscore if starts with digit
+
if result.chars().next().map_or(false, |c| c.is_ascii_digit()) {
+
result.insert(0, '_');
+
}
+
result
+
})
+
.collect::<Vec<_>>()
+
.join("_")
+
};
+
+
// Collect all feature names (from corpus + existing lib.rs)
+
let mut all_feature_names = std::collections::HashSet::new();
+
for ns in &all_namespaces {
+
all_feature_names.insert(to_feature_name(ns));
+
}
+
all_feature_names.extend(existing_features);
+
+
// Sort for consistent output
+
let mut feature_names: Vec<_> = all_feature_names.iter().collect();
+
feature_names.sort();
+
+
// Map namespace to feature name for dependency lookup
+
let mut ns_to_feature: std::collections::HashMap<&str, String> = std::collections::HashMap::new();
+
for ns in &all_namespaces {
+
ns_to_feature.insert(ns.as_str(), to_feature_name(ns));
+
}
+
+
for feature_name in feature_names {
+
// Find corresponding namespace for this feature (if any) to look up deps
+
let feature_deps: Vec<String> = all_namespaces
+
.iter()
+
.find(|ns| to_feature_name(ns) == *feature_name)
+
.and_then(|ns| deps.get(ns.as_str()))
+
.map(|ns_deps| {
+
let mut dep_features: Vec<_> = ns_deps
+
.iter()
+
.map(|d| format!("\"{}\"", to_feature_name(d)))
+
.collect();
+
dep_features.sort();
+
dep_features
+
})
+
.unwrap_or_default();
+
+
if !feature_deps.is_empty() {
+
writeln!(
+
&mut output,
+
"{} = [{}]",
+
feature_name,
+
feature_deps.join(", ")
+
)
+
.unwrap();
+
} else {
+
writeln!(&mut output, "{} = []", feature_name).unwrap();
+
}
+
}
+
+
output
+
}
/// Enum variant kind for IntoStatic generation
···
];
let tokens = codegen
-
.generate_union("RecordEmbed", &refs, Some("Post embed union"), None)
+
.generate_union(
+
"app.bsky.feed.post",
+
"RecordEmbed",
+
&refs,
+
Some("Post embed union"),
+
None,
+
)
.expect("generate union");
let file: syn::File = syn::parse2(tokens).expect("parse tokens");
+11
crates/jacquard-lexicon/src/fetch/config.rs
···
pub lexicons_dir: PathBuf,
pub codegen_dir: PathBuf,
pub root_module: Option<String>,
+
pub cargo_toml_path: Option<PathBuf>,
}
impl Config {
···
let mut lexicons_dir: Option<PathBuf> = None;
let mut codegen_dir: Option<PathBuf> = None;
let mut root_module: Option<String> = None;
+
let mut cargo_toml_path: Option<PathBuf> = None;
for child in children.nodes() {
match child.name().value() {
···
.ok_or_else(|| miette!("root-module expects a string value"))?;
root_module = Some(val.to_string());
}
+
"cargo-toml" => {
+
let val = child
+
.entries()
+
.get(0)
+
.and_then(|e| e.value().as_string())
+
.ok_or_else(|| miette!("cargo-toml expects a string value"))?;
+
cargo_toml_path = Some(PathBuf::from(val));
+
}
other => {
return Err(miette!("Unknown output field: {}", other));
}
···
lexicons_dir: lexicons_dir.ok_or_else(|| miette!("Missing lexicons directory"))?,
codegen_dir: codegen_dir.ok_or_else(|| miette!("Missing codegen directory"))?,
root_module,
+
cargo_toml_path,
})
}
+4 -4
crates/jacquard-oauth/Cargo.toml
···
[package]
name = "jacquard-oauth"
-
version = "0.3.0"
-
edition = "2024"
+
version = "0.3.1"
+
edition.workspace = true
description = "AT Protocol OAuth 2.1 core types and helpers for Jacquard"
authors.workspace = true
repository.workspace = true
···
license.workspace = true
[dependencies]
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common", features = ["reqwest-client"] }
-
jacquard-identity = { version = "0.3.0", path = "../jacquard-identity" }
+
jacquard-common = { version = "*", path = "../jacquard-common", features = ["reqwest-client"] }
+
jacquard-identity = { version = "*", path = "../jacquard-identity" }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
url = { workspace = true }
+14 -9
crates/jacquard/Cargo.toml
···
name = "jacquard"
description.workspace = true
edition.workspace = true
-
version = "0.3.0"
+
version.workspace = true
authors.workspace = true
repository.workspace = true
keywords.workspace = true
···
license.workspace = true
[features]
-
default = ["api_all", "dns", "fancy", "loopback"]
+
default = ["api_full", "dns", "fancy", "loopback"]
derive = ["dep:jacquard-derive"]
-
api = ["jacquard-api/com_atproto"]
-
api_all = ["api", "jacquard-api/app_bsky", "jacquard-api/chat_bsky", "jacquard-api/tools_ozone"]
+
api = ["jacquard-api/com_atproto", "jacquard-api/com_bad_example" ]
+
api_bluesky = ["api", "jacquard-api/bluesky" ]
+
api_full = ["api", "jacquard-api/bluesky", "jacquard-api/other", "jacquard-api/lexicon_community"]
+
api_all = ["api_full", "jacquard-api/ufos"]
dns = ["jacquard-identity/dns"]
fancy = ["miette/fancy"]
# Propagate loopback to oauth (server + browser helper)
···
[dependencies]
-
jacquard-api = { version = "0.3.0", path = "../jacquard-api" }
-
jacquard-common = { version = "0.3.0", path = "../jacquard-common", features = ["reqwest-client"] }
-
jacquard-oauth = { version = "0.3.0", path = "../jacquard-oauth" }
-
jacquard-derive = { version = "0.3.0", path = "../jacquard-derive", optional = true }
-
jacquard-identity = { version = "0.3.0", path = "../jacquard-identity" }
+
jacquard-api = { version = "*", path = "../jacquard-api" }
+
jacquard-common = { version = "*", path = "../jacquard-common", features = ["reqwest-client"] }
+
jacquard-oauth = { version = "*", path = "../jacquard-oauth" }
+
jacquard-derive = { version = "*", path = "../jacquard-derive", optional = true }
+
jacquard-identity = { version = "*", path = "../jacquard-identity" }
bon.workspace = true
async-trait.workspace = true
···
jose-jwk = { workspace = true, features = ["p256"] }
p256 = { workspace = true, features = ["ecdsa"] }
rand_core.workspace = true
+
+
[package.metadata.docs.rs]
+
features = [ "api_all", "derive", "dns", "fancy", "loopback" ]
+2 -1
lexicons.kdl
···
output {
lexicons "crates/jacquard-api/lexicons"
codegen "crates/jacquard-api/src"
+
cargo-toml "crates/jacquard-api/Cargo.toml"
}
source "leaflet" type="git" priority=100 {
···
pattern "**/*.json"
}
-
source "lexicon-community" type="git" priority=50 {
+
source "lexicon-community" type="git" priority=60 {
repo "https://github.com/lexicon-community/lexicon"
pattern "**/*.json"
}
+1
nix/modules/devshell.nix
···
bacon
rust-analyzer
cargo-release
+
cargo-semver-checks
];
};
};