Closed dahlia closed 2 weeks ago
According to the DID Core Services section, there could be many more services other than Export
. So we may need a base class like DidService
(or DidCoreService
?) as well.
Vocabularies are added. Here's example code:
import { Export, Person } from "@fedify/fedify";
const person = new Person({
id: new URL("https://alice-personal-site.example/actor"),
name: "Alice",
service: new Export({
id: new URL("https://alice-personal-site.example/actor#export"),
endpoint: new URL(
"https://alice-personal-site.example/actor/accountExport",
),
}),
});
console.log(await person.toJsonLd());
The above code prints the following JSON-LD:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
"https://w3id.org/security/data-integrity/v1",
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/multikey/v1",
{
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
toot: "http://joinmastodon.org/ns#",
featured: { "@id": "toot:featured", "@type": "@id" },
featuredTags: { "@id": "toot:featuredTags", "@type": "@id" },
discoverable: "toot:discoverable",
suspended: "toot:suspended",
memorial: "toot:memorial",
indexable: "toot:indexable",
schema: "http://schema.org#",
PropertyValue: "schema:PropertyValue",
value: "schema:value",
misskey: "https://misskey-hub.net/ns#",
isCat: "misskey:isCat"
}
],
id: "https://alice-personal-site.example/actor",
type: "Person",
name: "Alice",
service: {
id: "https://alice-personal-site.example/actor#export",
type: "https://w3id.org/fep/9091#Export",
serviceEndpoint: "https://alice-personal-site.example/actor/accountExport"
}
}
… which is semantically equivalent to an example from FEP-9091.
Fedify should have
Export
class andActor.service
property so that applications can implement FEP-9091.See also: