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
··· 137 137 <p style="margin-bottom: 0"><strong>Try it:</strong></p> 138 138 {% call try_it::links_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block", ".subject") %} 139 139 140 - <h3 class="route"><code>GET /xrpc/blue.microcosm.links.getCounts</code></h3> 140 + <h3 class="route"><code>GET /xrpc/blue.microcosm.links.getBacklinksCount</code></h3> 141 141 142 142 <p>The total number of links pointing at a given target.</p> 143 143 ··· 149 149 </ul> 150 150 151 151 <p style="margin-bottom: 0"><strong>Try it:</strong></p> 152 - {% call try_it::get_counts("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block:subject.uri") %} 152 + {% call try_it::get_backlinks_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block:subject.uri") %} 153 153 154 154 <h3 class="route"><code>GET /links/count/distinct-dids</code></h3> 155 155
+5 -8
constellation/templates/try-it-macros.html.j2
··· 104 104 </form> 105 105 {% endmacro %} 106 106 107 - {% macro get_counts(subject, source) %} 108 - <form method="get" action="/xrpc/blue.microcosm.links.getCounts"> 109 - <pre class="code"> 110 - <strong>GET</strong> /xrpc/blue.microcosm.links.getCounts 111 - ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 112 - &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> 113 - <button type="submit">get links count</button> 114 - </pre> 107 + {% macro get_backlinks_count(subject, source) %} 108 + <form method="get" action="/xrpc/blue.microcosm.links.getBacklinksCount"> 109 + <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinksCount 110 + ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 111 + &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> <button type="submit">get links count</button></pre> 115 112 </form> 116 113 {% endmacro %} 117 114
+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",