ActivityPub server framework in TypeScript
Released on May 6, 2024.
The CLI toolchain for testing and debugging is now available on JSR: @fedify/cli. You can install it with deno install -A --unstable-fs --unstable-kv --unstable-temporal -n fedify jsr:@fedify/cli
, or download a standalone executable from the releases page.
fedify
command.fedify lookup
subcommand.fedify inbox
subcommand.Implemented followers collection synchronization mechanism.
RequestContext.sendActivity()
overload that takes "followers"
as the second parameter.CollectionCallbackSetters
interface.CollectionDispatcher
type.CollectionDispatcher
type.CollectionCounter
type.CollectionCounter
type.CollectionCursor
type.CollectionCursor
type.Relaxed the required type for activity recipients.
Recipient
interface.Context.sendActivity()
method became Recipient | Recipient[]
(was Actor | Actor[]
). However, since Recipient
is a supertype of Actor
, the existing code should work without any change.Followers collection now has to consist of Recipient
objects only. (It could consist of URL
s as well as Actor
s before.)
Federation.setFollowersDispatcher()
method's second parameter became CollectionDispatcher<Recipient, TContextData, URL>
(was CollectionDispatcher<Actor | URL, TContextData>
).Some of the responsibility of a document loader was separated to a context loader and a document loader.
contextLoader
option to constructors, fromJsonLd()
static methods, clone()
methods, and all non-scalar accessors (get*()
) of Activity Vocabulary classes.documentLoader
option to contextLoader
in toJsonLd()
methods of Activity Vocabulary objects.contextLoader
option to LookupObjectOptions
interface.contextLoader
property to Context
interface.contextLoader
option to FederationParameters
interface.documentLoader
option to contextLoader
in RespondWithObjectOptions
interface.GetKeyOwnerOptions
interface.getKeyOwner()
function became GetKeyOwnerOptions
(was DocumentLoader
).DoesActorOwnKeyOptions
interface.doesActorOwnKey()
function became DoesActorOwnKeyOptions
(was DocumentLoader
).Added width
and height
properties to Document
class for better compatibility with Mastodon. [#47]
Document.width
property.Document.height
property.new Document()
constructor now accepts width
option.new Document()
constructor now accepts height
option.Document.clone()
method now accepts width
option.Document.clone()
method now accepts height
option.Removed the dependency on @js-temporal/polyfill on Deno, and Fedify now requires --unstable-temporal
flag. On other runtime, it still depends on @js-temporal/polyfill.
Added more log messages using the LogTape library. Currently the below logger categories are used:
["fedify", "federation", "collection"]
["fedify", "httpsig", "verify"]
["fedify", "runtime", "docloader"]
Fixed a bug where the authenticated document loader had thrown InvalidUrl
error when the URL redirection was involved in Bun.
Fixed a bug of lookupObject()
that it had failed to look up the actor object when WebFinger response had no links with "type": "application/activity+json"
but had "type": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
.
Released on April 23, 2024.
Added PUBLIC_COLLECTION
constant for public addressing.
Federation
now supports authorized fetch for actor dispatcher and collection dispatchers.
ActorCallbackSetters.authorize()
method.CollectionCallbackSetters.authorize()
method.AuthorizedPredicate
type.RequestContext.getSignedKey()
method.RequestContext.getSignedKeyOwner()
method.FederationFetchOptions.onUnauthorized
option for handling unauthorized fetches.getKeyOwner()
function.The default implementation of FederationFetchOptions.onNotAcceptable
option now responds with Vary: Accept, Signature
header.
Added log messages using the LogTape library. Currently the below logger categories are used:
["fedify"]
["fedify", "federation"]
["fedify", "federation", "inbox"]
["fedify", "federation", "outbox"]
Added RequestContext.getActor()
method.
Activity Vocabulary classes now have typeId
static property.
Dispatcher setters and inbox listener setters in Federation
now take a path as `${string}{handle}${string}`
instead of string
so that it is more type-safe.
Added generalized object dispatchers. [#33]
Federation.setObjectDispatcher()
method.ObjectDispatcher
type.ObjectAuthorizePredicate
type.Context.getObjectUri()
method.RequestContext.getObject()
method.Released on April 17, 2024.
new Federation()
constructor that if it is once called the process will never exit. [#39]Released on April 17, 2024.
new Federation()
constructor that if it is once called the process will never exit. [#39]Released on April 9, 2024.
DocumentLoader
is now propagated to the loaded remote objects from Activity Vocabulary objects. [#27]
options
parameter to Activity Vocabulary constructors.options
parameter to clone()
method of Activity Vocabulary objects.InboxListener
now implicitly loads remote object with an authenticated DocumentLoader
.Added Federation.fetch()
method.
Federation.handle()
method. Use Federation.fetch()
method instead.FederationHandlerParameters
type to FederationFetchOptions
.integrateFetchOptions()
function.integrateHandlerOptions()
function.Added @fedify/fedify/x/hono
module for integrating with Hono middleware. [#25]
federation()
function.ContextDataFactory
type.Context.sendActivity()
method now throws TypeError
instead of silently failing when the given Activity
object lacks the actor property.
Context.sendActivity()
method now uses an authenticated document loader under the hood.
Added outbox error handler to Federation
.
onOutboxError
option to new Federation()
constructor.OutboxErrorHandler
type.Released on April 5, 2024.
Federation
that its actor/collection dispatchers had done content negotiation before determining if the resource exists or not. It also fixed a bug that integrateHandler()
from @fedify/fedify/x/fresh
had responded with 406 Not Acceptable
instead of 404 Not Found
when the resource does not exist in the web browser. [#34]Released on April 2, 2024.
Fedify is now available on npm: @fedify/fedify. [#24]
Abstract key-value store for caching.
KvStore
interface.KvStoreSetOptions
interface.KvKey
type.DenoKvStore
class.KvCacheParameters.kv
option now accepts a KvStore
instead of Deno.Kv
.KvCacheParameters.prefix
option now accepts a KvKey
instead of Deno.KvKey
.FederationParameters.kv
option now accepts a KvStore
instead of Deno.Kv
.FederationKvPrefixes.activityIdempotence
option now accepts a KvKey
instead of Deno.KvKey
.FederationKvPrefixes.remoteDocument
option now accepts a KvKey
instead of Deno.KvKey
.Abstract message queue for outgoing activities.
MessageQueue
interface.MessageQueueEnqueueOptions
interface.InProcessMessageQueue
class.FederationParameters.queue
option.Added @fedify/fedify/x/denokv
module for adapting Deno.Kv
to KvStore
and MessageQueue
. It is only available in Deno runtime.
DenoKvStore
class.DenoKvMessageQueue
class.Added PropertyValue
to Activity Vocabulary API. [#29]
PropertyValue
class.new Object()
constructor's attachments
option now accepts PropertyValue
objects.new Object()
constructor's attachment
option now accepts a PropertyValue
object.Object.getAttachments()
method now yields PropertyValue
objects besides Object
and Link
objects.Object.getAttachment()
method now returns a PropertyValue
object besides an Object
and a Link
object.Object.clone()
method's attachments
option now accepts PropertyValue
objects.Object.clone()
method's attachment
option now accepts a PropertyValue
object.Removed dependency on jose.
exportSpki()
function.importSpki()
function.Fixed a bug that Application.manuallyApprovesFollowers
, Group.manuallyApprovesFollowers
, Organization.manuallyApprovesFollowers
, Person.manuallyApprovesFollowers
, and Service.manuallyApprovesFollowers
properties were not properly displayed in Mastodon.
Released on March 26, 2024.
Added @fedify/fedify/x/fresh
module for integrating with Fresh middleware.
integrateHandler()
function.integrateHandlerOptions()
function.Added getActorHandle()
function.
Fedify now has authenticated document loader. [#12]
Context.getDocumentLoader()
method.getAuthenticatedDocumentLoader()
function.AuthenticatedDocumentLoaderFactory
type.authenticatedDocumentLoaderFactory
option to new Federation()
constructor.Context.documentLoader
property now returns an authenticated document loader in personal inbox listeners. (Note that it's not affected in shared inbox listeners.)Added singular accessors to Object
's icon
and image
properties.
new Object()
constructor now accepts icon
option.new Object()
constructor now accepts image
option.Object.getIcon()
method.Object.getImage()
method.Object.clone()
method now accepts icon
option.Object.clone()
method now accepts image
option.Object
's icon
and image
properties no more accept Link
objects.
new Object()
constructor's icons
option no more accepts Link
objects.new Object()
constructor's images
option no more accepts Link
objects.Object.getIcons()
method no more yields Link
objects.Object.getImages()
method no more yields Link
objects.Object.clone()
method's icons
option no more accepts Link
objects.Object.clone()
method's images
option no more accepts Link
objects.Object
's attributedTo
property was renamed to attribution
.
new Object()
constructor's attributedTo
option was renamed to attribution
.new Object()
constructor's attributedTos
option was renamed to attributions
.Object.getAttributedTo()
method is renamed to Object.getAttribution()
.Object.getAttributedTos()
method is renamed to Object.getAttributions()
.Object.clone()
method's attributedTo
option is renamed to attribution
.Object.clone()
method's attributedTos
option is renamed to attributions
.Object
's attribution
property (was attributedTo
) now accepts only Actor
objects.
new Object()
constructor's attribution
option (was attributedTo
) now accepts only an Actor
object.new Object()
constructor's attributions
option (was attributedTos
) now accepts only Actor
objects.Object.getAttribution()
method (was getAttributedTo()
) now returns only an Actor
object.Object.getAttributions()
method (was getAttributedTos()
) now returns only Actor
objects.Object.clone()
method's attribution
option (attributedTo
) now accepts only an Actor
object.Object.clone()
method's attributions
option (attributedTos
) now accepts only Actor
objects.Activity
's object
property no more accepts Link
objects.
new Activity()
constructor's object
option no more accepts a Link
object.new Activity()
constructor's objects
option no more accepts Link
objects.Activity.getObject()
method no more returns a Link
object.Activity.getObjects()
method no more returns Link
objects.Activity.clone()
method's object
option no more accepts a Link
object.Activity.clone()
method's objects
option no more accepts Link
objects.Activity
's actor
property now accepts only Actor
objects.
new Activity()
constructor's actor
option now accepts only an Actor
object.new Activity()
constructor's actors
option now accepts only Actor
objects.Activity.getActor()
method now returns only an Actor
object.Activity.getActors()
method now returns only Actor
objects.Activity.clone()
method's actor
option now accepts only an Actor
object.Activity.clone()
method's actors
option now accepts only Actor
objects.Added sensitive
property to Object
class.
new Object()
constructor now accepts sensitive
option.Object.sensitive
attribute.Object.clone()
method now accepts sensitive
option.Now lookupWebFinger()
follows redirections.
The http://webfinger.net/rel/profile-page
links in WebFinger responses now omit type
property.
Released on March 15, 2024.
Added utility functions for responding with an ActivityPub object:
respondWithObject()
function.respondWithObjectIfAcceptable()
function.RespondWithObjectOptions
interface.Added utility functions for generating and exporting cryptographic keys which are compatible with popular ActivityPub software:
generateCryptoKeyPair()
function.exportJwk()
function.importJwk()
function.The following functions and methods now throw TypeError
if the specified CryptoKey
is not extractable
:
Context.getActorKey()
methodContext.sendActivity()
methodFederation.sendActivity()
methodAdded immediate
option to Context.sendActivity()
and Federation.sendActivity()
methods.
Added SendActivityOptions
interface.
Now onNotFound
/onNotAcceptable
options are optional for Federation.handle()
method. [#9]
Released on March 10, 2024.
Implemented NodeInfo 2.1 protocol. [#1]
Federation.handle()
accepts requests for /.well-known/nodeinfo.Federation.setNodeInfoDispatcher()
method.Context.getNodeInfoUri()
method.NodeInfo
interface.Software
interface.Protocol
type.Services
interface.InboundService
type.OutboundService
type.Usage
interface.NodeInfoDispatcher
type.nodeInfoToJson()
function.Implemented WebFinger client.
lookupObject()
function.lookupWebFinger()
function.Federation.handle()
now responds with Access-Control-Allow-Origin: *
header for WebFinger requests.
fetchDocumentLoader()
, the default document loader, now sends Accept: application/activity+json, application/ld+json
header (was Accept: application/ld+json
only).