Loading CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ To be released. - Activity Vocabulary classes now have `typeId` static property. - Dispatcher setters and inbox listener setters in `Federation` now take a path as <code>`${string}{handle}${string}`</code> instead of `string` so that it is more type-safe. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [LogTape]: https://github.com/dahlia/logtape Loading federation/middleware.ts +5 −5 Original line number Diff line number Diff line Loading @@ -523,7 +523,7 @@ export class Federation<TContextData> { * @throws {RouterError} Thrown if the path pattern is invalid. */ setActorDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>, ): ActorCallbackSetters<TContextData> { if (this.#router.has("actor")) { Loading Loading @@ -574,7 +574,7 @@ export class Federation<TContextData> { * @throws {@link RouterError} Thrown if the path pattern is invalid. */ setOutboxDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("outbox")) { Loading Loading @@ -623,7 +623,7 @@ export class Federation<TContextData> { * @throws {RouterError} Thrown if the path pattern is invalid. */ setFollowingDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("following")) { Loading Loading @@ -672,7 +672,7 @@ export class Federation<TContextData> { * @throws {@link RouterError} Thrown if the path pattern is invalid. */ setFollowersDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("followers")) { Loading Loading @@ -739,7 +739,7 @@ export class Federation<TContextData> { * @throws {RouteError} Thrown if the path pattern is invalid. */ setInboxListeners( inboxPath: string, inboxPath: `${string}{handle}${string}`, sharedInboxPath?: string, ): InboxListenerSetter<TContextData> { if (this.#router.has("inbox")) { Loading Loading
CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ To be released. - Activity Vocabulary classes now have `typeId` static property. - Dispatcher setters and inbox listener setters in `Federation` now take a path as <code>`${string}{handle}${string}`</code> instead of `string` so that it is more type-safe. [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch [LogTape]: https://github.com/dahlia/logtape Loading
federation/middleware.ts +5 −5 Original line number Diff line number Diff line Loading @@ -523,7 +523,7 @@ export class Federation<TContextData> { * @throws {RouterError} Thrown if the path pattern is invalid. */ setActorDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>, ): ActorCallbackSetters<TContextData> { if (this.#router.has("actor")) { Loading Loading @@ -574,7 +574,7 @@ export class Federation<TContextData> { * @throws {@link RouterError} Thrown if the path pattern is invalid. */ setOutboxDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("outbox")) { Loading Loading @@ -623,7 +623,7 @@ export class Federation<TContextData> { * @throws {RouterError} Thrown if the path pattern is invalid. */ setFollowingDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("following")) { Loading Loading @@ -672,7 +672,7 @@ export class Federation<TContextData> { * @throws {@link RouterError} Thrown if the path pattern is invalid. */ setFollowersDispatcher( path: string, path: `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, TContextData>, ): CollectionCallbackSetters<TContextData> { if (this.#router.has("followers")) { Loading Loading @@ -739,7 +739,7 @@ export class Federation<TContextData> { * @throws {RouteError} Thrown if the path pattern is invalid. */ setInboxListeners( inboxPath: string, inboxPath: `${string}{handle}${string}`, sharedInboxPath?: string, ): InboxListenerSetter<TContextData> { if (this.#router.has("inbox")) { Loading