+function activityPubContextify <T> (data: T) {
+ return Object.assign(data, {
+ '@context': [
+ 'https://www.w3.org/ns/activitystreams',
+ 'https://w3id.org/security/v1',
+ {
+ RsaSignature2017: 'https://w3id.org/security#RsaSignature2017',
+ pt: 'https://joinpeertube.org/ns#',
+ sc: 'http://schema.org#',
+ Hashtag: 'as:Hashtag',
+ uuid: 'sc:identifier',
+ category: 'sc:category',
+ licence: 'sc:license',
+ subtitleLanguage: 'sc:subtitleLanguage',
+ sensitive: 'as:sensitive',
+ language: 'sc:inLanguage',
+ views: 'sc:Number',
+ state: 'sc:Number',
+ size: 'sc:Number',
+ fps: 'sc:Number',
+ startTimestamp: 'sc:Number',
+ stopTimestamp: 'sc:Number',
+ position: 'sc:Number',
+ commentsEnabled: 'sc:Boolean',
+ downloadEnabled: 'sc:Boolean',
+ waitTranscoding: 'sc:Boolean',
+ expires: 'sc:expires',
+ support: 'sc:Text',
+ CacheFile: 'pt:CacheFile',
+ Infohash: 'pt:Infohash',
+ originallyPublishedAt: 'sc:DateTime'
+ },
+ {
+ likes: {
+ '@id': 'as:likes',
+ '@type': '@id'
+ },
+ dislikes: {
+ '@id': 'as:dislikes',
+ '@type': '@id'
+ },
+ playlists: {
+ '@id': 'pt:playlists',
+ '@type': '@id'
+ },
+ shares: {
+ '@id': 'as:shares',
+ '@type': '@id'
+ },
+ comments: {
+ '@id': 'as:comments',
+ '@type': '@id'
+ }
+ }
+ ]
+ })