actorDehydrator<TContextData>(activity: Activity,_context: Context<TContextData>,): Activity
An activity transformer that dehydrates the actor property of an activity so that it only contains the actor's URI. For example, suppose we have an activity like this:
import { Follow, Person } from "@fedify/fedify/vocab"; const input = new Follow({ id: new URL("http://example.com/activities/1"), actor: new Person({ id: new URL("http://example.com/actors/1"), name: "Alice", preferredUsername: "alice", }), object: new Person({ id: new URL("http://example.com/actors/2"), name: "Bob", preferredUsername: "bob", }), });
The result of applying this transformer would be:
import { Follow, Person } from "@fedify/fedify/vocab"; const output = new Follow({ id: new URL("http://example.com/activities/1"), actor: new URL("http://example.com/actors/1"), object: new Person({ id: new URL("http://example.com/actors/2"), name: "Bob", preferredUsername: "bob", }), });
As some ActivityPub implementations like Threads fail to deal with inlined actor objects, this transformer can be used to work around this issue.
_context: Context<TContextData>