Skip to content

Commit fb39cd7

Browse files
committed
Remove code examples in querying followers that access internal types
1 parent fbf6118 commit fb39cd7

3 files changed

Lines changed: 22 additions & 73 deletions

File tree

docs/manual/relay.md

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -280,46 +280,6 @@ Each follower entry contains:
280280
> supports listing by prefix (Redis, PostgreSQL, SQLite, Deno KV all support
281281
> this).
282282
283-
Follower data is stored in the [`KvStore`](./kv.md) with keys following the
284-
pattern `["follower", actorId]`. Each entry contains:
285-
286-
- `actor`: The actor's JSON-LD data
287-
- `state`: Either `"pending"` or `"accepted"`
288-
289-
### Querying followers
290-
291-
~~~~ typescript twoslash
292-
import type { KvStore } from "@fedify/fedify";
293-
const kv = null as unknown as KvStore;
294-
// ---cut-before---
295-
import type { RelayFollower } from "@fedify/relay";
296-
297-
for await (const entry of kv.list<RelayFollower>(["follower"])) {
298-
console.log(`Follower: ${entry.value.actor["@id"]}`);
299-
console.log(`State: ${entry.value.state}`);
300-
}
301-
~~~~
302-
303-
> [!NOTE]
304-
> The `~KvStore.list()` method requires a `KvStore` implementation that
305-
> supports listing by prefix (Redis, PostgreSQL, SQLite, Deno KV all support
306-
> this).
307-
308-
### Validating follower objects
309-
310-
~~~~ typescript twoslash
311-
import type { KvStore } from "@fedify/fedify";
312-
const kv = null as unknown as KvStore;
313-
// ---cut-before---
314-
import { isRelayFollower } from "@fedify/relay";
315-
316-
for await (const entry of kv.list(["follower"])) {
317-
if (isRelayFollower(entry.value)) {
318-
console.log(`Valid follower in state: ${entry.value.state}`);
319-
}
320-
}
321-
~~~~
322-
323283

324284
Storage requirements
325285
--------------------
@@ -399,7 +359,7 @@ import { configure, getConsoleSink } from "@logtape/logtape";
399359
await configure({
400360
sinks: { console: getConsoleSink() },
401361
loggers: [
402-
{ category: ["fedify"], level: "info", sinks: ["console"] },
362+
{ category: ["fedify"], lowestLevel: "info", sinks: ["console"] },
403363
],
404364
});
405365
~~~~

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@fedify/sveltekit": "workspace:",
2121
"@fedify/testing": "workspace:",
2222
"@fedify/vocab-runtime": "workspace:",
23+
"@fedify/relay": "workspace:",
2324
"@hono/node-server": "^1.13.7",
2425
"@js-temporal/polyfill": "catalog:",
2526
"@logtape/file": "catalog:",

pnpm-lock.yaml

Lines changed: 20 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)