Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

bikeshed did filter name for m2m queries

authored by bad-example.com and committed by tangled.org decf5597 87fcfd54

+13 -8
+7 -2
constellation/src/server/mod.rs
··· 292 292 /// path to the secondary link in the linking record 293 293 path_to_other: String, 294 294 /// filter to linking records (join of the m2m) by these DIDs 295 + /// 296 + /// TODO: this should be called `link_did`, deprecate + add an alias 297 + /// TODO: should we have an `other_did` filter as well? 295 298 #[serde(default)] 296 299 did: Vec<String>, 297 300 /// filter to specific secondary records ··· 700 703 /// path to the secondary link in the linking record 701 704 path_to_other: String, 702 705 /// filter to linking records (join of the m2m) by these DIDs 706 + /// 707 + /// TODO: should we have an `other_did` filter as well? 703 708 #[serde(default)] 704 - did: Vec<String>, 709 + link_did: Vec<String>, 705 710 /// filter to specific secondary records 706 711 #[serde(default)] 707 712 other_subject: Vec<String>, ··· 740 745 } 741 746 742 747 let filter_dids: HashSet<Did> = query 743 - .did 748 + .link_did 744 749 .iter() 745 750 .map(|d| d.trim()) 746 751 .filter(|d| !d.is_empty())
+4 -4
constellation/src/storage/rocks_store.rs
··· 945 945 path_to_other: &str, 946 946 limit: u64, 947 947 after: Option<String>, 948 - filter_dids: &HashSet<Did>, 948 + filter_link_dids: &HashSet<Did>, 949 949 filter_to_targets: &HashSet<String>, 950 950 ) -> Result<PagedOrderedCollection<(String, u64, u64), String>> { 951 951 let collection = Collection(collection.to_string()); ··· 965 965 return Ok(PagedOrderedCollection::empty()); 966 966 }; 967 967 968 - let filter_did_ids: HashMap<DidId, bool> = filter_dids 968 + let filter_did_ids: HashMap<DidId, bool> = filter_link_dids 969 969 .iter() 970 970 .filter_map(|did| self.did_id_table.get_id_val(&self.db, did).transpose()) 971 971 .collect::<Result<Vec<DidIdValue>>>()? ··· 1134 1134 path_to_other: &str, 1135 1135 limit: u64, 1136 1136 after: Option<String>, 1137 - filter_dids: &HashSet<Did>, 1137 + filter_link_dids: &HashSet<Did>, 1138 1138 filter_to_targets: &HashSet<String>, 1139 1139 ) -> Result<PagedOrderedCollection<(RecordId, String), String>> { 1140 1140 // helper to resolve dids ··· 1175 1175 eprintln!("cursor: {:#?}", cursor); 1176 1176 1177 1177 // (__active__) did ids and filter targets 1178 - let filter_did_ids: HashMap<DidId, bool> = filter_dids 1178 + let filter_did_ids: HashMap<DidId, bool> = filter_link_dids 1179 1179 .iter() 1180 1180 .filter_map(|did| self.did_id_table.get_id_val(&self.db, did).transpose()) 1181 1181 .collect::<Result<Vec<DidIdValue>>>()?
+2 -2
constellation/templates/get-many-to-many.html.j2
··· 6 6 7 7 {% block content %} 8 8 9 - {% call try_it::get_many_to_many(query.subject, query.source, query.path_to_other, query.did, query.other_subject, query.limit) %} 9 + {% call try_it::get_many_to_many(query.subject, query.source, query.path_to_other, query.link_did, query.other_subject, query.limit) %} 10 10 11 11 <h2> 12 12 Many-to-many links to <code>{{ query.subject }}</code> ··· 36 36 <input type="hidden" name="subject" value="{{ query.subject }}" /> 37 37 <input type="hidden" name="source" value="{{ query.source }}" /> 38 38 <input type="hidden" name="pathToOther" value="{{ query.path_to_other }}" /> 39 - {% for did in query.did %} 39 + {% for did in query.link_did %} 40 40 <input type="hidden" name="did" value="{{ did }}" /> 41 41 {% endfor %} 42 42 {% for other in query.other_subject %}