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

Modify backlinks counting XRPC endpoint name

Now matches the existing XRPC getBacklinks endpoint naming scheme.

This should fix the white-space issue for the` try-it-macros` template as
well.

+13 -16
+4 -4
constellation/src/server/mod.rs
··· 78 78 }), 79 79 ) 80 80 .route( 81 - "/xrpc/blue.microcosm.links.getCounts", 81 + "/xrpc/blue.microcosm.links.getBacklinksCount", 82 82 get({ 83 83 let store = store.clone(); 84 84 move |accept, query| async { 85 - spawn_blocking(|| get_counts(accept, query, store)) 85 + spawn_blocking(|| get_backlink_counts(accept, query, store)) 86 86 .await 87 87 .map_err(to500)? 88 88 } ··· 378 378 source: String, 379 379 } 380 380 #[derive(Template, Serialize)] 381 - #[template(path = "get-counts.html.j2")] 381 + #[template(path = "get-backlinks-count.html.j2")] 382 382 struct GetItemsCountResponse { 383 383 total: u64, 384 384 #[serde(skip_serializing)] 385 385 query: GetItemsCountQuery, 386 386 } 387 - fn get_counts( 387 + fn get_backlink_counts( 388 388 accept: ExtractAccept, 389 389 query: axum_extra::extract::Query<GetItemsCountQuery>, 390 390 store: impl LinkReader,
+2 -2
constellation/templates/hello.html.j2
··· 134 134 <p style="margin-bottom: 0"><strong>Try it:</strong></p> 135 135 {% call try_it::links_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block", ".subject") %} 136 136 137 - <h3 class="route"><code>GET /xrpc/blue.microcosm.links.getCounts</code></h3> 137 + <h3 class="route"><code>GET /xrpc/blue.microcosm.links.getBacklinksCount</code></h3> 138 138 139 139 <p>The total number of links pointing at a given target.</p> 140 140 ··· 146 146 </ul> 147 147 148 148 <p style="margin-bottom: 0"><strong>Try it:</strong></p> 149 - {% call try_it::get_counts("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block:subject.uri") %} 149 + {% call try_it::get_backlinks_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block:subject.uri") %} 150 150 151 151 <h3 class="route"><code>GET /links/count/distinct-dids</code></h3> 152 152
+5 -8
constellation/templates/try-it-macros.html.j2
··· 102 102 </form> 103 103 {% endmacro %} 104 104 105 - {% macro get_counts(subject, source) %} 106 - <form method="get" action="/xrpc/blue.microcosm.links.getCounts"> 107 - <pre class="code"> 108 - <strong>GET</strong> /xrpc/blue.microcosm.links.getCounts 109 - ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 110 - &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> 111 - <button type="submit">get links count</button> 112 - </pre> 105 + {% macro get_backlinks_count(subject, source) %} 106 + <form method="get" action="/xrpc/blue.microcosm.links.getBacklinksCount"> 107 + <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinksCount 108 + ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 109 + &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> <button type="submit">get links count</button></pre> 113 110 </form> 114 111 {% endmacro %} 115 112
+1 -1
lexicons/blue.microcosm/links/getCounts.json lexicons/blue.microcosm/links/getBacklinksCount.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "blue.microcosm.links.getCounts", 3 + "id": "blue.microcosm.links.getBacklinksCount", 4 4 "defs": { 5 5 "main": { 6 6 "type": "query",