Loading CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,10 @@ Version 0.7.0 To be released. - Added `PUBLIC_COLLECTION` constant for [public addressing]. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing Version 0.6.0 ------------- Loading docs/manual/send.md +8 −5 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ recipient's personal inbox. To deliver an activity to the shared inbox, you can pass the `preferSharedInbox` option: ~~~~ typescript import { Actor, Context, Create, Note } from "@fedify/fedify"; import { Actor, Context, Create, Note, PUBLIC_COLLECTION } from "@fedify/fedify"; async function sendNote( ctx: Context<void>, Loading @@ -144,10 +144,10 @@ async function sendNote( recipient, new Create({ actor: ctx.getActorUri(senderHandle), to: new URL("https://www.w3.org/ns/activitystreams#Public"), to: PUBLIC_COLLECTION, object: new Note({ attribution: ctx.getActorUri(senderHandle), to: new URL("https://www.w3.org/ns/activitystreams#Public"), to: PUBLIC_COLLECTION, }), }), { preferSharedInbox: true }, // [!code highlight] Loading @@ -156,9 +156,12 @@ async function sendNote( ~~~~ > [!TIP] > <https://www.w3.org/ns/activitystreams#Public> is a special IRI that > `PUBLIC_COLLECTION` constant contains a `URL` object of > <https://www.w3.org/ns/activitystreams#Public>, a special IRI that > represents the public audience. By setting the `to` property to this IRI, > the activity is visible to everyone. > the activity is visible to everyone. See also the [*Public Addressing* > section](https://www.w3.org/TR/activitypub/#public-addressing) in the > ActivityPub specification. > [!NOTE] > To deliver an activity to the shared inbox, the recipient server must support Loading vocab/constants.ts 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * The special public collection for [public addressing]. *Do not mutate this * object.* * * [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing * * @since 0.7.0 */ export const PUBLIC_COLLECTION: URL = new URL( "https://www.w3.org/ns/activitystreams#Public", ); vocab/mod.ts +1 −0 Original line number Diff line number Diff line Loading @@ -50,5 +50,6 @@ * @module */ export * from "./actor.ts"; export * from "./constants.ts"; export * from "./lookup.ts"; export * from "./vocab.ts"; Loading
CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,10 @@ Version 0.7.0 To be released. - Added `PUBLIC_COLLECTION` constant for [public addressing]. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing Version 0.6.0 ------------- Loading
docs/manual/send.md +8 −5 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ recipient's personal inbox. To deliver an activity to the shared inbox, you can pass the `preferSharedInbox` option: ~~~~ typescript import { Actor, Context, Create, Note } from "@fedify/fedify"; import { Actor, Context, Create, Note, PUBLIC_COLLECTION } from "@fedify/fedify"; async function sendNote( ctx: Context<void>, Loading @@ -144,10 +144,10 @@ async function sendNote( recipient, new Create({ actor: ctx.getActorUri(senderHandle), to: new URL("https://www.w3.org/ns/activitystreams#Public"), to: PUBLIC_COLLECTION, object: new Note({ attribution: ctx.getActorUri(senderHandle), to: new URL("https://www.w3.org/ns/activitystreams#Public"), to: PUBLIC_COLLECTION, }), }), { preferSharedInbox: true }, // [!code highlight] Loading @@ -156,9 +156,12 @@ async function sendNote( ~~~~ > [!TIP] > <https://www.w3.org/ns/activitystreams#Public> is a special IRI that > `PUBLIC_COLLECTION` constant contains a `URL` object of > <https://www.w3.org/ns/activitystreams#Public>, a special IRI that > represents the public audience. By setting the `to` property to this IRI, > the activity is visible to everyone. > the activity is visible to everyone. See also the [*Public Addressing* > section](https://www.w3.org/TR/activitypub/#public-addressing) in the > ActivityPub specification. > [!NOTE] > To deliver an activity to the shared inbox, the recipient server must support Loading
vocab/constants.ts 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * The special public collection for [public addressing]. *Do not mutate this * object.* * * [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing * * @since 0.7.0 */ export const PUBLIC_COLLECTION: URL = new URL( "https://www.w3.org/ns/activitystreams#Public", );
vocab/mod.ts +1 −0 Original line number Diff line number Diff line Loading @@ -50,5 +50,6 @@ * @module */ export * from "./actor.ts"; export * from "./constants.ts"; export * from "./lookup.ts"; export * from "./vocab.ts";