]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/context.ts
Improve VideoChannelSyncLatestScheduler logs
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / context.ts
index 3bc40e2aa2749114f9786d0b40a76948776bfd03..349c4d2273ee6d21c273d25aaa3cfeea5268be94 100644 (file)
@@ -15,7 +15,7 @@ export {
 
 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',
@@ -24,6 +24,7 @@ const contextStore = {
     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',
@@ -109,7 +110,8 @@ const contextStore = {
     stopTimestamp: {
       '@type': 'sc:Number',
       '@id': 'pt:stopTimestamp'
-    }
+    },
+    uuid: 'sc:identifier'
   }),
 
   CacheFile: buildContext({
@@ -125,9 +127,34 @@ const contextStore = {
     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(),
@@ -160,7 +187,7 @@ function buildContext (contextValue?: ContextValue) {
 
     {
       pt: 'https://joinpeertube.org/ns#',
-      sc: 'http://schema.org#',
+      sc: 'http://schema.org/',
 
       ...contextValue
     }