type ContextValue = { [ id: string ]: (string | { '@type': string, '@id': string }) }
-const contextStore = {
+const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string })[] } = {
Video: buildContext({
Hashtag: 'as:Hashtag',
uuid: 'sc:identifier',
subtitleLanguage: 'sc:subtitleLanguage',
sensitive: 'as:sensitive',
language: 'sc:inLanguage',
+ identifier: 'sc:identifier',
// TODO: remove in a few versions, introduced in 4.2
icons: 'as:icon',
stopTimestamp: {
'@type': 'sc:Number',
'@id': 'pt:stopTimestamp'
- }
+ },
+ uuid: 'sc:identifier'
}),
CacheFile: buildContext({
playlists: {
'@id': 'pt:playlists',
'@type': '@id'
- }
+ },
+ support: {
+ '@type': 'sc:Text',
+ '@id': 'pt:support'
+ },
+
+ // TODO: remove in a few versions, introduced in 4.2
+ icons: 'as:icon'
+ }),
+
+ WatchAction: buildContext({
+ WatchAction: 'sc:WatchAction',
+ startTimestamp: {
+ '@type': 'sc:Number',
+ '@id': 'pt:startTimestamp'
+ },
+ stopTimestamp: {
+ '@type': 'sc:Number',
+ '@id': 'pt:stopTimestamp'
+ },
+ watchSection: {
+ '@type': 'sc:Number',
+ '@id': 'pt:stopTimestamp'
+ },
+ uuid: 'sc:identifier'
}),
+ Collection: buildContext(),
Follow: buildContext(),
Reject: buildContext(),
Accept: buildContext(),
{
pt: 'https://joinpeertube.org/ns#',
- sc: 'http://schema.org#',
+ sc: 'http://schema.org/',
...contextValue
}