···251251 ///
252252 /// deprecated: use `did`, which can be repeated multiple times
253253 from_dids: Option<String>, // comma separated: gross
254254- limit: Option<u64>,
254254+ #[serde(default = "get_default_limit")]
255255+ limit: u64,
255256 // TODO: allow reverse (er, forward) order as well
257257+}
258258+fn get_default_limit() -> u64 {
259259+ DEFAULT_CURSOR_LIMIT
256260}
257261#[derive(Template, Serialize)]
258262#[template(path = "links.html.j2")]
···278282 .transpose()?
279283 .map(|c| c.next);
280284281281- let limit = query.limit.unwrap_or(DEFAULT_CURSOR_LIMIT);
285285+ let limit = query.limit;
282286 if limit > DEFAULT_CURSOR_LIMIT_MAX {
283287 return Err(http::StatusCode::BAD_REQUEST);
284288 }
285289286286- let mut filter_dids: HashSet<Did> = HashSet::from_iter(query.did.iter().map(|d| Did(d.to_string())));
290290+ let mut filter_dids: HashSet<Did> = HashSet::from_iter(
291291+ query
292292+ .did
293293+ .iter()
294294+ .map(|d| d.trim())
295295+ .filter(|d| !d.is_empty())
296296+ .map(|d| Did(d.to_string())),
297297+ );
287298288299 if let Some(comma_joined) = &query.from_dids {
289300 if !filter_dids.is_empty() {
+9-6
constellation/templates/hello.html.j2
···20202121 <p>
2222 This server has indexed <span class="stat">{{ stats.linking_records|human_number }}</span> links between <span class="stat">{{ stats.targetables|human_number }}</span> targets and sources from <span class="stat">{{ stats.dids|human_number }}</span> identities over <span class="stat">{{ days_indexed|human_number }}</span> days.<br/>
2323- <small>(indexing new records in real time, backfill still TODO)</small>
2323+ <small>(indexing new records in real time, backfill coming soon!)</small>
2424 </p>
25252626- <p>The API is currently <strong>unstable</strong>. But feel free to use it! If you want to be nice, put your project name and bsky username (or email) in your user-agent header for api requests.</p>
2626+ <p>But feel free to use it! If you want to be nice, put your project name and bsky username (or email) in your user-agent header for api requests.</p>
272728282929 <h2>API Endpoints</h2>
···3535 <h4>Query parameters:</h4>
36363737 <ul>
3838- <li><code>target</code>: required, must url-encode. Example: <code>at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lgwdn7vd722r</code></li>
3939- <li><code>collection</code>: required. Example: <code>app.bsky.feed.like</code></li>
4040- <li><code>path</code>: required, must url-encode. Example: <code>.subject.uri</code></li>
3838+ <li><p><code>target</code>: required, must url-encode. Example: <code>at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lgwdn7vd722r</code></p></li>
3939+ <li><p><code>collection</code>: required. Example: <code>app.bsky.feed.like</code></p></li>
4040+ <li><p><code>path</code>: required, must url-encode. Example: <code>.subject.uri</code></p></li>
4141+ <li><p><code>did</code>: optional, filter links to those from specific users. Include multiple times to filter by multiple users. Example: <code>did=did:plc:vc7f4oafdgxsihk4cry2xpze&did=did:plc:vc7f4oafdgxsihk4cry2xpze</code></p></li>
4242+ <li><p><code>from_dids</code> [deprecated]: optional. Use <code>did</code> instead. Example: <code>from_dids=did:plc:vc7f4oafdgxsihk4cry2xpze,did:plc:vc7f4oafdgxsihk4cry2xpze</code></p></li>
4343+ <li><p><code>limit</code>: optional. Default: <code>16</code>. Maximum: <code>100</code></p></li>
4144 </ul>
42454346 <p style="margin-bottom: 0"><strong>Try it:</strong></p>
4444- {% call try_it::links("at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lgwdn7vd722r", "app.bsky.feed.like", ".subject.uri") %}
4747+ {% call try_it::links("at://did:plc:a4pqq234yw7fqbddawjo7y35/app.bsky.feed.post/3m237ilwc372e", "app.bsky.feed.like", ".subject.uri", [""], 16) %}
454846494750 <h3 class="route"><code>GET /links/distinct-dids</code></h3>