dumb lexicon codegen script

Current need to manually cleanup a couple of the esquema code generation
outputs (profile record ref in "authors" and extra `sh` module
declaration). Otherwise it f-ing compiles

+591 -44
+2
Cargo.lock
··· 3395 3395 "atrium-identity", 3396 3396 "atrium-lex", 3397 3397 "atrium-oauth", 3398 + "atrium-xrpc", 3398 3399 "atrium-xrpc-client", 3399 3400 "esquema-codegen", 3400 3401 "http", ··· 3406 3407 "n0-future", 3407 3408 "owo-colors", 3408 3409 "serde", 3410 + "serde_bytes", 3409 3411 "serde_cbor", 3410 3412 "serde_html_form", 3411 3413 "serde_ipld_dagcbor",
+2
crates/weaver-common/Cargo.toml
··· 43 43 44 44 http = "1.3.1" 45 45 serde_html_form = "0.2.7" 46 + serde_bytes = "0.11.17" 47 + atrium-xrpc = "0.12.3" 46 48 47 49 48 50 [dev-dependencies]
+12
crates/weaver-common/src/lexicons/app/bsky/actor.rs
··· 10 10 pub mod search_actors; 11 11 pub mod search_actors_typeahead; 12 12 pub mod status; 13 + #[derive(Debug)] 14 + pub struct Profile; 15 + impl atrium_api::types::Collection for Profile { 16 + const NSID: &'static str = "app.bsky.actor.profile"; 17 + type Record = profile::Record; 18 + } 19 + #[derive(Debug)] 20 + pub struct Status; 21 + impl atrium_api::types::Collection for Status { 22 + const NSID: &'static str = "app.bsky.actor.status"; 23 + type Record = status::Record; 24 + }
+36
crates/weaver-common/src/lexicons/app/bsky/feed.rs
··· 25 25 pub mod search_posts; 26 26 pub mod send_interactions; 27 27 pub mod threadgate; 28 + #[derive(Debug)] 29 + pub struct Generator; 30 + impl atrium_api::types::Collection for Generator { 31 + const NSID: &'static str = "app.bsky.feed.generator"; 32 + type Record = generator::Record; 33 + } 34 + #[derive(Debug)] 35 + pub struct Like; 36 + impl atrium_api::types::Collection for Like { 37 + const NSID: &'static str = "app.bsky.feed.like"; 38 + type Record = like::Record; 39 + } 40 + #[derive(Debug)] 41 + pub struct Post; 42 + impl atrium_api::types::Collection for Post { 43 + const NSID: &'static str = "app.bsky.feed.post"; 44 + type Record = post::Record; 45 + } 46 + #[derive(Debug)] 47 + pub struct Postgate; 48 + impl atrium_api::types::Collection for Postgate { 49 + const NSID: &'static str = "app.bsky.feed.postgate"; 50 + type Record = postgate::Record; 51 + } 52 + #[derive(Debug)] 53 + pub struct Repost; 54 + impl atrium_api::types::Collection for Repost { 55 + const NSID: &'static str = "app.bsky.feed.repost"; 56 + type Record = repost::Record; 57 + } 58 + #[derive(Debug)] 59 + pub struct Threadgate; 60 + impl atrium_api::types::Collection for Threadgate { 61 + const NSID: &'static str = "app.bsky.feed.threadgate"; 62 + type Record = threadgate::Record; 63 + }
+42
crates/weaver-common/src/lexicons/app/bsky/graph.rs
··· 29 29 pub mod unmute_actor_list; 30 30 pub mod unmute_thread; 31 31 pub mod verification; 32 + #[derive(Debug)] 33 + pub struct Block; 34 + impl atrium_api::types::Collection for Block { 35 + const NSID: &'static str = "app.bsky.graph.block"; 36 + type Record = block::Record; 37 + } 38 + #[derive(Debug)] 39 + pub struct Follow; 40 + impl atrium_api::types::Collection for Follow { 41 + const NSID: &'static str = "app.bsky.graph.follow"; 42 + type Record = follow::Record; 43 + } 44 + #[derive(Debug)] 45 + pub struct List; 46 + impl atrium_api::types::Collection for List { 47 + const NSID: &'static str = "app.bsky.graph.list"; 48 + type Record = list::Record; 49 + } 50 + #[derive(Debug)] 51 + pub struct Listblock; 52 + impl atrium_api::types::Collection for Listblock { 53 + const NSID: &'static str = "app.bsky.graph.listblock"; 54 + type Record = listblock::Record; 55 + } 56 + #[derive(Debug)] 57 + pub struct Listitem; 58 + impl atrium_api::types::Collection for Listitem { 59 + const NSID: &'static str = "app.bsky.graph.listitem"; 60 + type Record = listitem::Record; 61 + } 62 + #[derive(Debug)] 63 + pub struct Starterpack; 64 + impl atrium_api::types::Collection for Starterpack { 65 + const NSID: &'static str = "app.bsky.graph.starterpack"; 66 + type Record = starterpack::Record; 67 + } 68 + #[derive(Debug)] 69 + pub struct Verification; 70 + impl atrium_api::types::Collection for Verification { 71 + const NSID: &'static str = "app.bsky.graph.verification"; 72 + type Record = verification::Record; 73 + }
+6
crates/weaver-common/src/lexicons/app/bsky/labeler.rs
··· 3 3 pub mod defs; 4 4 pub mod get_services; 5 5 pub mod service; 6 + #[derive(Debug)] 7 + pub struct Service; 8 + impl atrium_api::types::Collection for Service { 9 + const NSID: &'static str = "app.bsky.labeler.service"; 10 + type Record = service::Record; 11 + }
+6
crates/weaver-common/src/lexicons/chat/bsky/actor.rs
··· 4 4 pub mod defs; 5 5 pub mod delete_account; 6 6 pub mod export_account_data; 7 + #[derive(Debug)] 8 + pub struct Declaration; 9 + impl atrium_api::types::Collection for Declaration { 10 + const NSID: &'static str = "chat.bsky.actor.declaration"; 11 + type Record = declaration::Record; 12 + }
+6
crates/weaver-common/src/lexicons/com/atproto/lexicon.rs
··· 1 1 // @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT. 2 2 //!Definitions for the `com.atproto.lexicon` namespace. 3 3 pub mod schema; 4 + #[derive(Debug)] 5 + pub struct Schema; 6 + impl atrium_api::types::Collection for Schema { 7 + const NSID: &'static str = "com.atproto.lexicon.schema"; 8 + type Record = schema::Record; 9 + }
+5
crates/weaver-common/src/lexicons/mod.rs
··· 1 1 // @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT. 2 + pub mod app; 3 + pub mod chat; 4 + pub mod client; 5 + pub mod com; 2 6 pub mod record; 3 7 pub mod sh; 8 + pub mod tools;
+304
crates/weaver-common/src/lexicons/record.rs
··· 3 3 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 4 4 #[serde(tag = "$type")] 5 5 pub enum KnownRecord { 6 + #[serde(rename = "app.bsky.actor.profile")] 7 + LexiconsAppBskyActorProfile(Box<crate::lexicons::app::bsky::actor::profile::Record>), 8 + #[serde(rename = "app.bsky.actor.status")] 9 + LexiconsAppBskyActorStatus(Box<crate::lexicons::app::bsky::actor::status::Record>), 10 + #[serde(rename = "app.bsky.feed.generator")] 11 + LexiconsAppBskyFeedGenerator( 12 + Box<crate::lexicons::app::bsky::feed::generator::Record>, 13 + ), 14 + #[serde(rename = "app.bsky.feed.like")] 15 + LexiconsAppBskyFeedLike(Box<crate::lexicons::app::bsky::feed::like::Record>), 16 + #[serde(rename = "app.bsky.feed.post")] 17 + LexiconsAppBskyFeedPost(Box<crate::lexicons::app::bsky::feed::post::Record>), 18 + #[serde(rename = "app.bsky.feed.postgate")] 19 + LexiconsAppBskyFeedPostgate(Box<crate::lexicons::app::bsky::feed::postgate::Record>), 20 + #[serde(rename = "app.bsky.feed.repost")] 21 + LexiconsAppBskyFeedRepost(Box<crate::lexicons::app::bsky::feed::repost::Record>), 22 + #[serde(rename = "app.bsky.feed.threadgate")] 23 + LexiconsAppBskyFeedThreadgate( 24 + Box<crate::lexicons::app::bsky::feed::threadgate::Record>, 25 + ), 26 + #[serde(rename = "app.bsky.graph.block")] 27 + LexiconsAppBskyGraphBlock(Box<crate::lexicons::app::bsky::graph::block::Record>), 28 + #[serde(rename = "app.bsky.graph.follow")] 29 + LexiconsAppBskyGraphFollow(Box<crate::lexicons::app::bsky::graph::follow::Record>), 30 + #[serde(rename = "app.bsky.graph.list")] 31 + LexiconsAppBskyGraphList(Box<crate::lexicons::app::bsky::graph::list::Record>), 32 + #[serde(rename = "app.bsky.graph.listblock")] 33 + LexiconsAppBskyGraphListblock( 34 + Box<crate::lexicons::app::bsky::graph::listblock::Record>, 35 + ), 36 + #[serde(rename = "app.bsky.graph.listitem")] 37 + LexiconsAppBskyGraphListitem( 38 + Box<crate::lexicons::app::bsky::graph::listitem::Record>, 39 + ), 40 + #[serde(rename = "app.bsky.graph.starterpack")] 41 + LexiconsAppBskyGraphStarterpack( 42 + Box<crate::lexicons::app::bsky::graph::starterpack::Record>, 43 + ), 44 + #[serde(rename = "app.bsky.graph.verification")] 45 + LexiconsAppBskyGraphVerification( 46 + Box<crate::lexicons::app::bsky::graph::verification::Record>, 47 + ), 48 + #[serde(rename = "app.bsky.labeler.service")] 49 + LexiconsAppBskyLabelerService( 50 + Box<crate::lexicons::app::bsky::labeler::service::Record>, 51 + ), 52 + #[serde(rename = "chat.bsky.actor.declaration")] 53 + LexiconsChatBskyActorDeclaration( 54 + Box<crate::lexicons::chat::bsky::actor::declaration::Record>, 55 + ), 56 + #[serde(rename = "com.atproto.lexicon.schema")] 57 + LexiconsComAtprotoLexiconSchema( 58 + Box<crate::lexicons::com::atproto::lexicon::schema::Record>, 59 + ), 6 60 #[serde(rename = "sh.tangled.actor.profile")] 7 61 LexiconsShTangledActorProfile( 8 62 Box<crate::lexicons::sh::tangled::actor::profile::Record>, 9 63 ), 64 + #[serde(rename = "sh.weaver.actor.profile")] 65 + LexiconsShWeaverActorProfile( 66 + Box<crate::lexicons::sh::weaver::actor::profile::Record>, 67 + ), 68 + #[serde(rename = "sh.weaver.notebook.authors")] 69 + LexiconsShWeaverNotebookAuthors( 70 + Box<crate::lexicons::sh::weaver::notebook::authors::Record>, 71 + ), 72 + #[serde(rename = "sh.weaver.notebook.entry")] 73 + LexiconsShWeaverNotebookEntry( 74 + Box<crate::lexicons::sh::weaver::notebook::entry::Record>, 75 + ), 76 + } 77 + impl From<crate::lexicons::app::bsky::actor::profile::Record> for KnownRecord { 78 + fn from(record: crate::lexicons::app::bsky::actor::profile::Record) -> Self { 79 + KnownRecord::LexiconsAppBskyActorProfile(Box::new(record)) 80 + } 81 + } 82 + impl From<crate::lexicons::app::bsky::actor::profile::RecordData> for KnownRecord { 83 + fn from( 84 + record_data: crate::lexicons::app::bsky::actor::profile::RecordData, 85 + ) -> Self { 86 + KnownRecord::LexiconsAppBskyActorProfile(Box::new(record_data.into())) 87 + } 88 + } 89 + impl From<crate::lexicons::app::bsky::actor::status::Record> for KnownRecord { 90 + fn from(record: crate::lexicons::app::bsky::actor::status::Record) -> Self { 91 + KnownRecord::LexiconsAppBskyActorStatus(Box::new(record)) 92 + } 93 + } 94 + impl From<crate::lexicons::app::bsky::actor::status::RecordData> for KnownRecord { 95 + fn from(record_data: crate::lexicons::app::bsky::actor::status::RecordData) -> Self { 96 + KnownRecord::LexiconsAppBskyActorStatus(Box::new(record_data.into())) 97 + } 98 + } 99 + impl From<crate::lexicons::app::bsky::feed::generator::Record> for KnownRecord { 100 + fn from(record: crate::lexicons::app::bsky::feed::generator::Record) -> Self { 101 + KnownRecord::LexiconsAppBskyFeedGenerator(Box::new(record)) 102 + } 103 + } 104 + impl From<crate::lexicons::app::bsky::feed::generator::RecordData> for KnownRecord { 105 + fn from( 106 + record_data: crate::lexicons::app::bsky::feed::generator::RecordData, 107 + ) -> Self { 108 + KnownRecord::LexiconsAppBskyFeedGenerator(Box::new(record_data.into())) 109 + } 110 + } 111 + impl From<crate::lexicons::app::bsky::feed::like::Record> for KnownRecord { 112 + fn from(record: crate::lexicons::app::bsky::feed::like::Record) -> Self { 113 + KnownRecord::LexiconsAppBskyFeedLike(Box::new(record)) 114 + } 115 + } 116 + impl From<crate::lexicons::app::bsky::feed::like::RecordData> for KnownRecord { 117 + fn from(record_data: crate::lexicons::app::bsky::feed::like::RecordData) -> Self { 118 + KnownRecord::LexiconsAppBskyFeedLike(Box::new(record_data.into())) 119 + } 120 + } 121 + impl From<crate::lexicons::app::bsky::feed::post::Record> for KnownRecord { 122 + fn from(record: crate::lexicons::app::bsky::feed::post::Record) -> Self { 123 + KnownRecord::LexiconsAppBskyFeedPost(Box::new(record)) 124 + } 125 + } 126 + impl From<crate::lexicons::app::bsky::feed::post::RecordData> for KnownRecord { 127 + fn from(record_data: crate::lexicons::app::bsky::feed::post::RecordData) -> Self { 128 + KnownRecord::LexiconsAppBskyFeedPost(Box::new(record_data.into())) 129 + } 130 + } 131 + impl From<crate::lexicons::app::bsky::feed::postgate::Record> for KnownRecord { 132 + fn from(record: crate::lexicons::app::bsky::feed::postgate::Record) -> Self { 133 + KnownRecord::LexiconsAppBskyFeedPostgate(Box::new(record)) 134 + } 135 + } 136 + impl From<crate::lexicons::app::bsky::feed::postgate::RecordData> for KnownRecord { 137 + fn from( 138 + record_data: crate::lexicons::app::bsky::feed::postgate::RecordData, 139 + ) -> Self { 140 + KnownRecord::LexiconsAppBskyFeedPostgate(Box::new(record_data.into())) 141 + } 142 + } 143 + impl From<crate::lexicons::app::bsky::feed::repost::Record> for KnownRecord { 144 + fn from(record: crate::lexicons::app::bsky::feed::repost::Record) -> Self { 145 + KnownRecord::LexiconsAppBskyFeedRepost(Box::new(record)) 146 + } 147 + } 148 + impl From<crate::lexicons::app::bsky::feed::repost::RecordData> for KnownRecord { 149 + fn from(record_data: crate::lexicons::app::bsky::feed::repost::RecordData) -> Self { 150 + KnownRecord::LexiconsAppBskyFeedRepost(Box::new(record_data.into())) 151 + } 152 + } 153 + impl From<crate::lexicons::app::bsky::feed::threadgate::Record> for KnownRecord { 154 + fn from(record: crate::lexicons::app::bsky::feed::threadgate::Record) -> Self { 155 + KnownRecord::LexiconsAppBskyFeedThreadgate(Box::new(record)) 156 + } 157 + } 158 + impl From<crate::lexicons::app::bsky::feed::threadgate::RecordData> for KnownRecord { 159 + fn from( 160 + record_data: crate::lexicons::app::bsky::feed::threadgate::RecordData, 161 + ) -> Self { 162 + KnownRecord::LexiconsAppBskyFeedThreadgate(Box::new(record_data.into())) 163 + } 164 + } 165 + impl From<crate::lexicons::app::bsky::graph::block::Record> for KnownRecord { 166 + fn from(record: crate::lexicons::app::bsky::graph::block::Record) -> Self { 167 + KnownRecord::LexiconsAppBskyGraphBlock(Box::new(record)) 168 + } 169 + } 170 + impl From<crate::lexicons::app::bsky::graph::block::RecordData> for KnownRecord { 171 + fn from(record_data: crate::lexicons::app::bsky::graph::block::RecordData) -> Self { 172 + KnownRecord::LexiconsAppBskyGraphBlock(Box::new(record_data.into())) 173 + } 174 + } 175 + impl From<crate::lexicons::app::bsky::graph::follow::Record> for KnownRecord { 176 + fn from(record: crate::lexicons::app::bsky::graph::follow::Record) -> Self { 177 + KnownRecord::LexiconsAppBskyGraphFollow(Box::new(record)) 178 + } 179 + } 180 + impl From<crate::lexicons::app::bsky::graph::follow::RecordData> for KnownRecord { 181 + fn from(record_data: crate::lexicons::app::bsky::graph::follow::RecordData) -> Self { 182 + KnownRecord::LexiconsAppBskyGraphFollow(Box::new(record_data.into())) 183 + } 184 + } 185 + impl From<crate::lexicons::app::bsky::graph::list::Record> for KnownRecord { 186 + fn from(record: crate::lexicons::app::bsky::graph::list::Record) -> Self { 187 + KnownRecord::LexiconsAppBskyGraphList(Box::new(record)) 188 + } 189 + } 190 + impl From<crate::lexicons::app::bsky::graph::list::RecordData> for KnownRecord { 191 + fn from(record_data: crate::lexicons::app::bsky::graph::list::RecordData) -> Self { 192 + KnownRecord::LexiconsAppBskyGraphList(Box::new(record_data.into())) 193 + } 194 + } 195 + impl From<crate::lexicons::app::bsky::graph::listblock::Record> for KnownRecord { 196 + fn from(record: crate::lexicons::app::bsky::graph::listblock::Record) -> Self { 197 + KnownRecord::LexiconsAppBskyGraphListblock(Box::new(record)) 198 + } 199 + } 200 + impl From<crate::lexicons::app::bsky::graph::listblock::RecordData> for KnownRecord { 201 + fn from( 202 + record_data: crate::lexicons::app::bsky::graph::listblock::RecordData, 203 + ) -> Self { 204 + KnownRecord::LexiconsAppBskyGraphListblock(Box::new(record_data.into())) 205 + } 206 + } 207 + impl From<crate::lexicons::app::bsky::graph::listitem::Record> for KnownRecord { 208 + fn from(record: crate::lexicons::app::bsky::graph::listitem::Record) -> Self { 209 + KnownRecord::LexiconsAppBskyGraphListitem(Box::new(record)) 210 + } 211 + } 212 + impl From<crate::lexicons::app::bsky::graph::listitem::RecordData> for KnownRecord { 213 + fn from( 214 + record_data: crate::lexicons::app::bsky::graph::listitem::RecordData, 215 + ) -> Self { 216 + KnownRecord::LexiconsAppBskyGraphListitem(Box::new(record_data.into())) 217 + } 218 + } 219 + impl From<crate::lexicons::app::bsky::graph::starterpack::Record> for KnownRecord { 220 + fn from(record: crate::lexicons::app::bsky::graph::starterpack::Record) -> Self { 221 + KnownRecord::LexiconsAppBskyGraphStarterpack(Box::new(record)) 222 + } 223 + } 224 + impl From<crate::lexicons::app::bsky::graph::starterpack::RecordData> for KnownRecord { 225 + fn from( 226 + record_data: crate::lexicons::app::bsky::graph::starterpack::RecordData, 227 + ) -> Self { 228 + KnownRecord::LexiconsAppBskyGraphStarterpack(Box::new(record_data.into())) 229 + } 230 + } 231 + impl From<crate::lexicons::app::bsky::graph::verification::Record> for KnownRecord { 232 + fn from(record: crate::lexicons::app::bsky::graph::verification::Record) -> Self { 233 + KnownRecord::LexiconsAppBskyGraphVerification(Box::new(record)) 234 + } 235 + } 236 + impl From<crate::lexicons::app::bsky::graph::verification::RecordData> for KnownRecord { 237 + fn from( 238 + record_data: crate::lexicons::app::bsky::graph::verification::RecordData, 239 + ) -> Self { 240 + KnownRecord::LexiconsAppBskyGraphVerification(Box::new(record_data.into())) 241 + } 242 + } 243 + impl From<crate::lexicons::app::bsky::labeler::service::Record> for KnownRecord { 244 + fn from(record: crate::lexicons::app::bsky::labeler::service::Record) -> Self { 245 + KnownRecord::LexiconsAppBskyLabelerService(Box::new(record)) 246 + } 247 + } 248 + impl From<crate::lexicons::app::bsky::labeler::service::RecordData> for KnownRecord { 249 + fn from( 250 + record_data: crate::lexicons::app::bsky::labeler::service::RecordData, 251 + ) -> Self { 252 + KnownRecord::LexiconsAppBskyLabelerService(Box::new(record_data.into())) 253 + } 254 + } 255 + impl From<crate::lexicons::chat::bsky::actor::declaration::Record> for KnownRecord { 256 + fn from(record: crate::lexicons::chat::bsky::actor::declaration::Record) -> Self { 257 + KnownRecord::LexiconsChatBskyActorDeclaration(Box::new(record)) 258 + } 259 + } 260 + impl From<crate::lexicons::chat::bsky::actor::declaration::RecordData> for KnownRecord { 261 + fn from( 262 + record_data: crate::lexicons::chat::bsky::actor::declaration::RecordData, 263 + ) -> Self { 264 + KnownRecord::LexiconsChatBskyActorDeclaration(Box::new(record_data.into())) 265 + } 266 + } 267 + impl From<crate::lexicons::com::atproto::lexicon::schema::Record> for KnownRecord { 268 + fn from(record: crate::lexicons::com::atproto::lexicon::schema::Record) -> Self { 269 + KnownRecord::LexiconsComAtprotoLexiconSchema(Box::new(record)) 270 + } 271 + } 272 + impl From<crate::lexicons::com::atproto::lexicon::schema::RecordData> for KnownRecord { 273 + fn from( 274 + record_data: crate::lexicons::com::atproto::lexicon::schema::RecordData, 275 + ) -> Self { 276 + KnownRecord::LexiconsComAtprotoLexiconSchema(Box::new(record_data.into())) 277 + } 10 278 } 11 279 impl From<crate::lexicons::sh::tangled::actor::profile::Record> for KnownRecord { 12 280 fn from(record: crate::lexicons::sh::tangled::actor::profile::Record) -> Self { ··· 18 286 record_data: crate::lexicons::sh::tangled::actor::profile::RecordData, 19 287 ) -> Self { 20 288 KnownRecord::LexiconsShTangledActorProfile(Box::new(record_data.into())) 289 + } 290 + } 291 + impl From<crate::lexicons::sh::weaver::actor::profile::Record> for KnownRecord { 292 + fn from(record: crate::lexicons::sh::weaver::actor::profile::Record) -> Self { 293 + KnownRecord::LexiconsShWeaverActorProfile(Box::new(record)) 294 + } 295 + } 296 + impl From<crate::lexicons::sh::weaver::actor::profile::RecordData> for KnownRecord { 297 + fn from( 298 + record_data: crate::lexicons::sh::weaver::actor::profile::RecordData, 299 + ) -> Self { 300 + KnownRecord::LexiconsShWeaverActorProfile(Box::new(record_data.into())) 301 + } 302 + } 303 + impl From<crate::lexicons::sh::weaver::notebook::authors::Record> for KnownRecord { 304 + fn from(record: crate::lexicons::sh::weaver::notebook::authors::Record) -> Self { 305 + KnownRecord::LexiconsShWeaverNotebookAuthors(Box::new(record)) 306 + } 307 + } 308 + impl From<crate::lexicons::sh::weaver::notebook::authors::RecordData> for KnownRecord { 309 + fn from( 310 + record_data: crate::lexicons::sh::weaver::notebook::authors::RecordData, 311 + ) -> Self { 312 + KnownRecord::LexiconsShWeaverNotebookAuthors(Box::new(record_data.into())) 313 + } 314 + } 315 + impl From<crate::lexicons::sh::weaver::notebook::entry::Record> for KnownRecord { 316 + fn from(record: crate::lexicons::sh::weaver::notebook::entry::Record) -> Self { 317 + KnownRecord::LexiconsShWeaverNotebookEntry(Box::new(record)) 318 + } 319 + } 320 + impl From<crate::lexicons::sh::weaver::notebook::entry::RecordData> for KnownRecord { 321 + fn from( 322 + record_data: crate::lexicons::sh::weaver::notebook::entry::RecordData, 323 + ) -> Self { 324 + KnownRecord::LexiconsShWeaverNotebookEntry(Box::new(record_data.into())) 21 325 } 22 326 } 23 327 impl Into<atrium_api::types::Unknown> for KnownRecord {
+6
crates/weaver-common/src/lexicons/sh/weaver/actor.rs
··· 2 2 //!Definitions for the `sh.weaver.actor` namespace. 3 3 pub mod defs; 4 4 pub mod profile; 5 + #[derive(Debug)] 6 + pub struct Profile; 7 + impl atrium_api::types::Collection for Profile { 8 + const NSID: &'static str = "sh.weaver.actor.profile"; 9 + type Record = profile::Record; 10 + }
-2
crates/weaver-common/src/lexicons/sh/weaver/actor/defs.rs
··· 17 17 pub indexed_at: core::option::Option<atrium_api::types::string::Datetime>, 18 18 #[serde(skip_serializing_if = "core::option::Option::is_none")] 19 19 pub labels: core::option::Option<Vec<crate::com::atproto::label::defs::Label>>, 20 - #[serde(skip_serializing_if = "core::option::Option::is_none")] 21 - pub status: core::option::Option<StatusView>, 22 20 } 23 21 pub type ProfileView = atrium_api::types::Object<ProfileViewData>;
+1
crates/weaver-common/src/lexicons/sh/weaver/embed.rs
··· 1 1 // @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT. 2 2 //!Definitions for the `sh.weaver.embed` namespace. 3 3 pub mod defs; 4 + pub mod external; 4 5 pub mod images; 5 6 pub mod record_with_media; 6 7 pub mod records;
+35
crates/weaver-common/src/lexicons/sh/weaver/embed/external.rs
··· 1 + // @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT. 2 + //!Definitions for the `sh.weaver.embed.external` namespace. 3 + //!A set of records embedded in a blog post. 4 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 5 + #[serde(rename_all = "camelCase")] 6 + pub struct MainData { 7 + pub embeds: Vec<External>, 8 + } 9 + pub type Main = atrium_api::types::Object<MainData>; 10 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 11 + #[serde(rename_all = "camelCase")] 12 + pub struct ExternalData { 13 + pub description: String, 14 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 15 + pub thumb: core::option::Option<atrium_api::types::BlobRef>, 16 + pub title: String, 17 + pub uri: String, 18 + } 19 + pub type External = atrium_api::types::Object<ExternalData>; 20 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 21 + #[serde(rename_all = "camelCase")] 22 + pub struct ViewData { 23 + pub external: ViewExternal, 24 + } 25 + pub type View = atrium_api::types::Object<ViewData>; 26 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 27 + #[serde(rename_all = "camelCase")] 28 + pub struct ViewExternalData { 29 + pub description: String, 30 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 31 + pub thumb: core::option::Option<String>, 32 + pub title: String, 33 + pub uri: String, 34 + } 35 + pub type ViewExternal = atrium_api::types::Object<ViewExternalData>;
+6 -6
crates/weaver-common/src/lexicons/sh/weaver/embed/record_with_media.rs
··· 34 34 pub enum MainRecordRefs { 35 35 #[serde(rename = "app.bsky.embed.record")] 36 36 AppBskyEmbedRecordMain(Box<crate::app::bsky::embed::record::Main>), 37 - #[serde(rename = "sh.weaver.embed.record")] 38 - ShWeaverEmbedRecordMain(Box<crate::sh::weaver::embed::record::Main>), 37 + #[serde(rename = "sh.weaver.embed.records")] 38 + ShWeaverEmbedRecordsMain(Box<crate::sh::weaver::embed::records::Main>), 39 39 } 40 40 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 41 41 #[serde(tag = "$type")] 42 42 pub enum ViewMediaRefs { 43 - #[serde(rename = "sh.weaver.embed.images#view")] 44 - ShWeaverEmbedImagesView(Box<crate::sh::weaver::embed::images::View>), 43 + #[serde(rename = "sh.weaver.embed.images")] 44 + ShWeaverEmbedImagesMain(Box<crate::sh::weaver::embed::images::Main>), 45 45 #[serde(rename = "sh.weaver.embed.external#view")] 46 46 ShWeaverEmbedExternalView(Box<crate::sh::weaver::embed::external::View>), 47 47 #[serde(rename = "app.bsky.embed.images#view")] ··· 54 54 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 55 55 #[serde(tag = "$type")] 56 56 pub enum ViewRecordRefs { 57 - #[serde(rename = "sh.weaver.embed.record#view")] 58 - ShWeaverEmbedRecordView(Box<crate::sh::weaver::embed::record::View>), 57 + #[serde(rename = "sh.weaver.embed.records#view")] 58 + ShWeaverEmbedRecordsView(Box<crate::sh::weaver::embed::records::View>), 59 59 #[serde(rename = "app.bsky.embed.record#view")] 60 60 AppBskyEmbedRecordView(Box<crate::app::bsky::embed::record::View>), 61 61 }
+90 -15
crates/weaver-common/src/lexicons/sh/weaver/embed/records.rs
··· 4 4 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 5 5 #[serde(rename_all = "camelCase")] 6 6 pub struct MainData { 7 - pub records: Vec<External>, 7 + pub records: Vec<crate::com::atproto::repo::strong_ref::Main>, 8 8 } 9 9 pub type Main = atrium_api::types::Object<MainData>; 10 10 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 11 11 #[serde(rename_all = "camelCase")] 12 - pub struct ExternalData { 13 - pub description: String, 14 - #[serde(skip_serializing_if = "core::option::Option::is_none")] 15 - pub thumb: core::option::Option<atrium_api::types::BlobRef>, 16 - pub title: String, 12 + pub struct ViewData { 13 + pub record: atrium_api::types::Union<ViewRecordRefs>, 14 + } 15 + pub type View = atrium_api::types::Object<ViewData>; 16 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 17 + #[serde(rename_all = "camelCase")] 18 + pub struct ViewBlockedData { 19 + pub author: crate::app::bsky::feed::defs::BlockedAuthor, 20 + pub blocked: bool, 21 + pub uri: String, 22 + } 23 + pub type ViewBlocked = atrium_api::types::Object<ViewBlockedData>; 24 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 25 + #[serde(rename_all = "camelCase")] 26 + pub struct ViewDetachedData { 27 + pub detached: bool, 17 28 pub uri: String, 18 29 } 19 - pub type External = atrium_api::types::Object<ExternalData>; 30 + pub type ViewDetached = atrium_api::types::Object<ViewDetachedData>; 20 31 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 21 32 #[serde(rename_all = "camelCase")] 22 - pub struct ViewData { 23 - pub external: ViewExternal, 33 + pub struct ViewNotFoundData { 34 + pub not_found: bool, 35 + pub uri: String, 24 36 } 25 - pub type View = atrium_api::types::Object<ViewData>; 37 + pub type ViewNotFound = atrium_api::types::Object<ViewNotFoundData>; 26 38 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 27 39 #[serde(rename_all = "camelCase")] 28 - pub struct ViewExternalData { 29 - pub description: String, 40 + pub struct ViewRecordData { 41 + pub author: atrium_api::types::Union<ViewRecordAuthorRefs>, 42 + pub cid: atrium_api::types::string::Cid, 30 43 #[serde(skip_serializing_if = "core::option::Option::is_none")] 31 - pub thumb: core::option::Option<String>, 32 - pub title: String, 44 + pub embeds: core::option::Option< 45 + Vec<atrium_api::types::Union<ViewRecordEmbedsItem>>, 46 + >, 47 + pub indexed_at: atrium_api::types::string::Datetime, 48 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 49 + pub labels: core::option::Option<Vec<crate::com::atproto::label::defs::Label>>, 50 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 51 + pub like_count: core::option::Option<i64>, 52 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 53 + pub quote_count: core::option::Option<i64>, 54 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 55 + pub reply_count: core::option::Option<i64>, 56 + #[serde(skip_serializing_if = "core::option::Option::is_none")] 57 + pub repost_count: core::option::Option<i64>, 33 58 pub uri: String, 59 + ///The record data itself. 60 + pub value: atrium_api::types::Unknown, 34 61 } 35 - pub type ViewExternal = atrium_api::types::Object<ViewExternalData>; 62 + pub type ViewRecord = atrium_api::types::Object<ViewRecordData>; 63 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 64 + #[serde(tag = "$type")] 65 + pub enum ViewRecordAuthorRefs { 66 + #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] 67 + AppBskyActorDefsProfileViewBasic( 68 + Box<crate::app::bsky::actor::defs::ProfileViewBasic>, 69 + ), 70 + } 71 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 72 + #[serde(tag = "$type")] 73 + pub enum ViewRecordEmbedsItem { 74 + #[serde(rename = "app.bsky.embed.images#view")] 75 + AppBskyEmbedImagesView(Box<crate::app::bsky::embed::images::View>), 76 + #[serde(rename = "app.bsky.embed.video#view")] 77 + AppBskyEmbedVideoView(Box<crate::app::bsky::embed::video::View>), 78 + #[serde(rename = "app.bsky.embed.external#view")] 79 + AppBskyEmbedExternalView(Box<crate::app::bsky::embed::external::View>), 80 + #[serde(rename = "app.bsky.embed.record#view")] 81 + AppBskyEmbedRecordView(Box<crate::app::bsky::embed::record::View>), 82 + #[serde(rename = "app.bsky.embed.recordWithMedia#view")] 83 + AppBskyEmbedRecordWithMediaView( 84 + Box<crate::app::bsky::embed::record_with_media::View>, 85 + ), 86 + #[serde(rename = "sh.weaver.embed.records#view")] 87 + ShWeaverEmbedRecordsView(Box<crate::sh::weaver::embed::records::View>), 88 + } 89 + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 90 + #[serde(tag = "$type")] 91 + pub enum ViewRecordRefs { 92 + #[serde(rename = "sh.weaver.embed.records#viewRecord")] 93 + ViewRecord(Box<ViewRecord>), 94 + #[serde(rename = "sh.weaver.embed.records#viewNotFound")] 95 + ViewNotFound(Box<ViewNotFound>), 96 + #[serde(rename = "sh.weaver.embed.records#viewBlocked")] 97 + ViewBlocked(Box<ViewBlocked>), 98 + #[serde(rename = "sh.weaver.embed.records#viewDetached")] 99 + ViewDetached(Box<ViewDetached>), 100 + #[serde(rename = "app.bsky.feed.defs#generatorView")] 101 + AppBskyFeedDefsGeneratorView(Box<crate::app::bsky::feed::defs::GeneratorView>), 102 + #[serde(rename = "app.bsky.graph.defs#listView")] 103 + AppBskyGraphDefsListView(Box<crate::app::bsky::graph::defs::ListView>), 104 + #[serde(rename = "app.bsky.labeler.defs#labelerView")] 105 + AppBskyLabelerDefsLabelerView(Box<crate::app::bsky::labeler::defs::LabelerView>), 106 + #[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")] 107 + AppBskyGraphDefsStarterPackViewBasic( 108 + Box<crate::app::bsky::graph::defs::StarterPackViewBasic>, 109 + ), 110 + }
+12
crates/weaver-common/src/lexicons/sh/weaver/notebook.rs
··· 3 3 pub mod authors; 4 4 pub mod defs; 5 5 pub mod entry; 6 + #[derive(Debug)] 7 + pub struct Authors; 8 + impl atrium_api::types::Collection for Authors { 9 + const NSID: &'static str = "sh.weaver.notebook.authors"; 10 + type Record = authors::Record; 11 + } 12 + #[derive(Debug)] 13 + pub struct Entry; 14 + impl atrium_api::types::Collection for Entry { 15 + const NSID: &'static str = "sh.weaver.notebook.entry"; 16 + type Record = entry::Record; 17 + }
+3 -9
crates/weaver-common/src/lexicons/sh/weaver/notebook/authors.rs
··· 21 21 #[serde(skip_serializing_if = "core::option::Option::is_none")] 22 22 pub index: core::option::Option<i64>, 23 23 #[serde(skip_serializing_if = "core::option::Option::is_none")] 24 - pub profile: core::option::Option< 25 - atrium_api::types::Union<AuthorListItemProfileRefs>, 26 - >, 24 + pub profile: core::option::Option<atrium_api::types::Union<AuthorListItemProfileRefs>>, 27 25 } 28 26 pub type AuthorListItem = atrium_api::types::Object<AuthorListItemData>; 29 27 #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 30 28 #[serde(tag = "$type")] 31 29 pub enum AuthorListItemProfileRefs { 32 30 #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] 33 - AppBskyActorDefsProfileViewBasic( 34 - Box<crate::app::bsky::actor::defs::ProfileViewBasic>, 35 - ), 31 + AppBskyActorDefsProfileViewBasic(Box<crate::app::bsky::actor::defs::ProfileViewBasic>), 36 32 #[serde(rename = "sh.weaver.actor.profile")] 37 - ShWeaverActorProfileMain(Box<crate::sh::weaver::actor::profile::Main>), 38 - #[serde(rename = "sh.tangled.actor.defs#profileView")] 39 - ShTangledActorDefsProfileView(Box<crate::sh::tangled::actor::defs::ProfileView>), 33 + ShWeaverActorProfileMain(Box<crate::sh::weaver::actor::profile::Record>), 40 34 }
+10
lexicon-codegen.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + 4 + #cargo install esquema-cli --locked --git https://github.com/fatfingers23/esquema.git 5 + mkdir -p ./target/lexicons 6 + cp -r ./lexicons ./target/lexicons 7 + cp -r ./atproto/lexicons ./target/lexicons 8 + 9 + 10 + ~/.cargo/bin/esquema-cli generate local --lexdir ./target/lexicons/ --outdir ./crates/weaver-common/src/ --module lexicons
-5
lexicons/sh.weaver/actor/defs.json
··· 26 26 "labels": { 27 27 "type": "array", 28 28 "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } 29 - }, 30 - 31 - "status": { 32 - "type": "ref", 33 - "ref": "#statusView" 34 29 } 35 30 } 36 31 }
+3 -3
lexicons/sh.weaver/embed/external.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "sh.weaver.embed.records", 3 + "id": "sh.weaver.embed.external", 4 4 "description": "A set of records embedded in a blog post.", 5 5 "defs": { 6 6 "main": { 7 7 "type": "object", 8 - "required": ["records"], 8 + "required": ["embeds"], 9 9 "properties": { 10 - "records": { 10 + "embeds": { 11 11 "type": "array", 12 12 "items": { "type": "ref", "ref": "#external" }, 13 13 "maxLength": 48
+3 -3
lexicons/sh.weaver/embed/recordWithMedia.json
··· 9 9 "properties": { 10 10 "record": { 11 11 "type": "union", 12 - "refs": ["app.bsky.embed.record", "sh.weaver.embed.record"] 12 + "refs": ["app.bsky.embed.record", "sh.weaver.embed.records"] 13 13 }, 14 14 "media": { 15 15 "type": "union", ··· 23 23 "properties": { 24 24 "record": { 25 25 "type": "union", 26 - "refs": ["sh.weaver.embed.record#view", "app.bsky.embed.record#view"] 26 + "refs": ["sh.weaver.embed.records#view", "app.bsky.embed.record#view"] 27 27 }, 28 28 "media": { 29 29 "type": "union", 30 30 "refs": [ 31 - "sh.weaver.embed.images#view", 31 + "sh.weaver.embed.images", 32 32 "sh.weaver.embed.external#view", 33 33 "app.bsky.embed.images#view", 34 34 "app.bsky.embed.video#view",
+1 -1
lexicons/sh.weaver/notebook/authors.json
··· 28 28 "properties": { 29 29 "profile": { 30 30 "type": "union", 31 - "refs": ["app.bsky.actor.defs#profileViewBasic", "sh.weaver.actor.profile", "sh.tangled.actor.defs#profileView"] 31 + "refs": ["app.bsky.actor.defs#profileViewBasic", "sh.weaver.actor.profile", "sh.weaver.actor.profile"] 32 32 }, 33 33 "index": { "type": "integer" } 34 34 }