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

bikeshed did filter name for m2m queries

+13 -8
+7 -2
constellation/src/server/mod.rs
··· 278 278 /// path to the secondary link in the linking record 279 279 path_to_other: String, 280 280 /// filter to linking records (join of the m2m) by these DIDs 281 + /// 282 + /// TODO: this should be called `link_did`, deprecate + add an alias 283 + /// TODO: should we have an `other_did` filter as well? 281 284 #[serde(default)] 282 285 did: Vec<String>, 283 286 /// filter to specific secondary records ··· 686 689 /// path to the secondary link in the linking record 687 690 path_to_other: String, 688 691 /// filter to linking records (join of the m2m) by these DIDs 692 + /// 693 + /// TODO: should we have an `other_did` filter as well? 689 694 #[serde(default)] 690 - did: Vec<String>, 695 + link_did: Vec<String>, 691 696 /// filter to specific secondary records 692 697 #[serde(default)] 693 698 other_subject: Vec<String>, ··· 726 731 } 727 732 728 733 let filter_dids: HashSet<Did> = query 729 - .did 734 + .link_did 730 735 .iter() 731 736 .map(|d| d.trim()) 732 737 .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 %}