activitypub: improve JSON-LD context

Added @type values for most definitions, and made name and value only
scoped to the PropertyValue type. (Blame Volpeon)
This commit is contained in:
Johann150 2023-05-30 17:53:50 +02:00
parent 9c5755cf65
commit 21ab8e75ee
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -17,27 +17,56 @@ export const renderActivity = (x: any): IActivity | null => {
'https://www.w3.org/ns/activitystreams', 'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1', 'https://w3id.org/security/v1',
{ {
xsd: 'http://www.w3.org/2001/XMLSchema#',
// as non-standards // as non-standards
manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', manuallyApprovesFollowers: {
sensitive: 'as:sensitive', '@id': 'as:manuallyApprovesFollowers',
'@type': 'xsd:boolean',
},
sensitive: {
'@id': 'as:sensitive',
'@type': 'xsd:boolean',
},
Hashtag: 'as:Hashtag', Hashtag: 'as:Hashtag',
// Mastodon // Mastodon
toot: 'http://joinmastodon.org/ns#', toot: 'http://joinmastodon.org/ns#',
Emoji: 'toot:Emoji', Emoji: 'toot:Emoji',
featured: 'toot:featured', featured: {
discoverable: 'toot:discoverable', '@id': 'toot:featured',
'@type': '@id',
},
discoverable: {
'@id': 'toot:discoverable',
'@type': 'xsd:boolean',
},
// Fedibird // Fedibird
fedibird: 'http://fedibird.com/ns#', quoteUri: {
quoteUri: 'fedibird:quoteUri', '@id': 'http://fedibird.com/ns#quoteUri',
'@type': '@id',
},
// schema // schema
schema: 'http://schema.org#', schema: 'http://schema.org/',
PropertyValue: 'schema:PropertyValue', PropertyValue: {
value: 'schema:value', '@id': 'schema:PropertyValue',
'@context': {
'value': 'schema:value',
'name': 'schema:name',
},
},
// Misskey // Misskey
misskey: 'https://misskey-hub.net/ns#', misskey: 'https://misskey-hub.net/ns#',
'_misskey_quote': 'misskey:_misskey_quote', '_misskey_quote': {
'_misskey_talk': 'misskey:_misskey_talk', '@id': 'misskey:_misskey_quote',
'isCat': 'misskey:isCat', '@type': '@id',
},
'_misskey_talk': {
'@id': 'misskey:_misskey_talk',
'@type': 'xsd:boolean',
},
'isCat': {
'@id': 'misskey:isCat',
'@type': 'xsd:boolean',
},
// vcard // vcard
vcard: 'http://www.w3.org/2006/vcard/ns#', vcard: 'http://www.w3.org/2006/vcard/ns#',
}, },