lightweight com.atproto.sync.listReposByCollection
45
fork

Configure Feed

Select the types of activity you want to include in your feed.

oh that works? cool

phil 5ed3cf9c d2eea4ce

+60 -20
+24 -5
Cargo.lock
··· 1965 1965 "getrandom 0.2.17", 1966 1966 "gloo-storage", 1967 1967 "http", 1968 - "jacquard-api", 1968 + "jacquard-api 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", 1969 1969 "jacquard-common", 1970 1970 "jacquard-identity", 1971 1971 "jacquard-oauth", ··· 2006 2006 ] 2007 2007 2008 2008 [[package]] 2009 + name = "jacquard-api" 2010 + version = "0.9.5" 2011 + source = "git+https://tangled.org/nonbinary.computer/jacquard?rev=f2f45e460bfce6dfa4319f29d1cfc19011cd3c50#f2f45e460bfce6dfa4319f29d1cfc19011cd3c50" 2012 + dependencies = [ 2013 + "bon", 2014 + "bytes", 2015 + "jacquard-common", 2016 + "jacquard-derive", 2017 + "jacquard-lexicon", 2018 + "miette", 2019 + "rustversion", 2020 + "serde", 2021 + "serde_bytes", 2022 + "serde_ipld_dagcbor", 2023 + "thiserror 2.0.18", 2024 + "unicode-segmentation", 2025 + ] 2026 + 2027 + [[package]] 2009 2028 name = "jacquard-axum" 2010 2029 version = "0.9.6" 2011 2030 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2094 2113 "bon", 2095 2114 "bytes", 2096 2115 "http", 2097 - "jacquard-api", 2116 + "jacquard-api 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", 2098 2117 "jacquard-common", 2099 2118 "jacquard-lexicon", 2100 2119 "miette", ··· 2172 2191 [[package]] 2173 2192 name = "jacquard-repo" 2174 2193 version = "0.9.6" 2175 - source = "registry+https://github.com/rust-lang/crates.io-index" 2176 - checksum = "c59705c56678f4d57229ab7790313b9f7d8f244a658d01ad1f4344e7d2efe2a3" 2194 + source = "git+https://tangled.org/nonbinary.computer/jacquard?rev=f2f45e460bfce6dfa4319f29d1cfc19011cd3c50#f2f45e460bfce6dfa4319f29d1cfc19011cd3c50" 2177 2195 dependencies = [ 2178 2196 "bytes", 2179 2197 "cid", 2180 2198 "ed25519-dalek", 2181 2199 "iroh-car", 2200 + "jacquard-api 0.9.5 (git+https://tangled.org/nonbinary.computer/jacquard?rev=f2f45e460bfce6dfa4319f29d1cfc19011cd3c50)", 2182 2201 "jacquard-common", 2183 2202 "jacquard-derive", 2184 2203 "k256", ··· 2318 2337 "futures", 2319 2338 "governor", 2320 2339 "http", 2321 - "jacquard-api", 2340 + "jacquard-api 0.9.5 (git+https://tangled.org/nonbinary.computer/jacquard?rev=f2f45e460bfce6dfa4319f29d1cfc19011cd3c50)", 2322 2341 "jacquard-axum", 2323 2342 "jacquard-common", 2324 2343 "jacquard-derive",
+18 -1
Cargo.toml
··· 14 14 futures = "0.3" 15 15 governor = "0.6" 16 16 http = "1" 17 - jacquard-api = { version = "0.9.5", default-features = false, features = ["com_atproto", "streaming"] } 17 + jacquard-api = { git = "https://tangled.org/nonbinary.computer/jacquard", rev = "f2f45e460bfce6dfa4319f29d1cfc19011cd3c50", default-features = false, features = ["com_atproto", "streaming"] } 18 18 jacquard-axum = { version = "0.9.6", default-features = false, features = ["tracing"] } 19 19 jacquard-common = { version = "0.9.5", features = ["websocket", "reqwest-client", "streaming"] } 20 20 jacquard-derive = "0.9.5" ··· 43 43 jacquard-lexicon = { version = "0.9.5", features = ["codegen"] } 44 44 serde_json = "1" 45 45 wiremock = "0.6" 46 + 47 + # jacquard-repo and jacquard-api are pinned to a git rev for fixes not yet on 48 + # crates.io. The patch sections keep everything unified: 49 + # 50 + # [patch.crates-io] makes repo-stream (which depends on crates.io jacquard-repo) 51 + # resolve to the same git copy we use directly, avoiding a two-versions split. 52 + # 53 + # [patch."git url"] redirects the git workspace siblings that don't need to 54 + # come from git back to the crates.io copies. 55 + 56 + [patch.crates-io] 57 + jacquard-repo = { git = "https://tangled.org/nonbinary.computer/jacquard", rev = "f2f45e460bfce6dfa4319f29d1cfc19011cd3c50" } 58 + 59 + [patch."https://tangled.org/nonbinary.computer/jacquard"] 60 + jacquard-common = { version = "0.9.5" } 61 + jacquard-derive = { version = "0.9.5" } 62 + jacquard-lexicon = { version = "0.9.5" } 46 63 47 64 [[example]] 48 65 name = "lexgen"
+7 -6
src/mst/mortality.rs
··· 123 123 use std::sync::Arc; 124 124 125 125 use bytes::Bytes; 126 + use jacquard_api::com_atproto::sync::subscribe_repos::RepoOpAction; 126 127 use jacquard_common::CowStr; 127 128 use jacquard_common::types::string::Did; 128 129 use jacquard_common::types::tid::Tid; ··· 135 136 136 137 fn op_create(path: &'static str) -> RepoOp<'static> { 137 138 RepoOp { 138 - action: CowStr::Borrowed("create"), 139 + action: RepoOpAction::Create, 139 140 path: CowStr::Borrowed(path), 140 141 cid: None, 141 142 prev: None, ··· 145 146 146 147 fn op_delete(path: &'static str) -> RepoOp<'static> { 147 148 RepoOp { 148 - action: CowStr::Borrowed("delete"), 149 + action: RepoOpAction::Delete, 149 150 path: CowStr::Borrowed(path), 150 151 cid: None, 151 152 prev: None, ··· 195 196 async fn update_ops_ignored() { 196 197 let parsed = make_parsed_car(&["app.bsky.feed.post/abc123"]).await; 197 198 let ops = [RepoOp { 198 - action: CowStr::Borrowed("update"), 199 + action: RepoOpAction::Update, 199 200 path: CowStr::Borrowed("app.bsky.feed.post/abc123"), 200 201 cid: None, 201 202 prev: None, ··· 312 313 313 314 use bytes::Bytes; 314 315 use cid::Cid as IpldCid; 315 - use jacquard_api::com_atproto::sync::subscribe_repos::RepoOp; 316 + use jacquard_api::com_atproto::sync::subscribe_repos::{RepoOp, RepoOpAction}; 316 317 use jacquard_common::CowStr; 317 318 use jacquard_common::types::string::Did; 318 319 use jacquard_common::types::tid::Tid; ··· 540 541 let ops: Vec<_> = adds 541 542 .iter() 542 543 .map(|p| RepoOp { 543 - action: CowStr::Owned("create".into()), 544 + action: RepoOpAction::Create, 544 545 path: CowStr::Owned((*p).into()), 545 546 cid: None, 546 547 prev: None, 547 548 extra_data: Default::default(), 548 549 }) 549 550 .chain(dels.iter().map(|p| RepoOp { 550 - action: CowStr::Owned("delete".into()), 551 + action: RepoOpAction::Delete, 551 552 path: CowStr::Owned((*p).into()), 552 553 cid: None, 553 554 prev: None,
+4 -2
src/server/list_repos.rs
··· 9 9 http::StatusCode, 10 10 response::{IntoResponse, Response}, 11 11 }; 12 - use jacquard_api::com_atproto::sync::list_repos::{ListReposOutput, ListReposRequest, Repo}; 12 + use jacquard_api::com_atproto::sync::list_repos::{ 13 + ListReposOutput, ListReposRequest, Repo, RepoStatus, 14 + }; 13 15 use jacquard_axum::ExtractXrpc; 14 16 use jacquard_common::CowStr; 15 17 use jacquard_common::types::string::{Cid as JCid, Did}; ··· 109 111 did, 110 112 head, 111 113 rev: prev.rev, 112 - status: info.status.status().map(CowStr::copy_from_str), 114 + status: info.status.status().map(|s| RepoStatus::from(s.to_owned())), 113 115 extra_data: None, 114 116 }) 115 117 })
+6 -5
src/sync/firehose/account_event.rs
··· 15 15 let new_status = if account.active { 16 16 storage::repo::AccountStatus::Active 17 17 } else { 18 - match account.status.as_deref() { 19 - Some("takendown") => storage::repo::AccountStatus::Takendown, 20 - Some("suspended") => storage::repo::AccountStatus::Suspended, 21 - Some("deactivated") => storage::repo::AccountStatus::Deactivated, 22 - Some("deleted") => storage::repo::AccountStatus::Deleted, 18 + use jacquard_api::com_atproto::sync::subscribe_repos::AccountStatus; 19 + match account.status.as_ref() { 20 + Some(AccountStatus::Takendown) => storage::repo::AccountStatus::Takendown, 21 + Some(AccountStatus::Suspended) => storage::repo::AccountStatus::Suspended, 22 + Some(AccountStatus::Deactivated) => storage::repo::AccountStatus::Deactivated, 23 + Some(AccountStatus::Deleted) => storage::repo::AccountStatus::Deleted, 23 24 _ => storage::repo::AccountStatus::Deactivated, 24 25 } 25 26 };
+1 -1
src/sync/firehose/commit_event.rs
··· 19 19 use jacquard_api::com_atproto::sync::subscribe_repos::Commit; 20 20 use jacquard_common::types::{string::Did, string::Nsid, tid::Tid}; 21 21 use jacquard_repo::commit::firehose::validate_v1_1; 22 - use tracing::{debug, error, info, trace, warn}; 22 + use tracing::{debug, error, info, warn}; 23 23 24 24 use super::validate::{self, CarDrop}; 25 25 use crate::identity::Resolver;