import * as Bluebird from 'bluebird'
import * as validator from 'validator'
import { ResultList } from '../../shared/models'
-import { Activity, ActivityPubActor } from '../../shared/models/activitypub'
+import { Activity } from '../../shared/models/activitypub'
import { ACTIVITY_PUB } from '../initializers'
import { ActorModel } from '../models/activitypub/actor'
import { signJsonLDObject } from './peertube-crypto'
'https://w3id.org/security/v1',
{
RsaSignature2017: 'https://w3id.org/security#RsaSignature2017',
- pt: 'https://joinpeertube.org/ns',
+ pt: 'https://joinpeertube.org/ns#',
sc: 'http://schema.org#',
Hashtag: 'as:Hashtag',
uuid: 'sc:identifier',
size: 'sc:Number',
fps: 'sc:Number',
commentsEnabled: 'sc:Boolean',
+ downloadEnabled: 'sc:Boolean',
waitTranscoding: 'sc:Boolean',
expires: 'sc:expires',
support: 'sc:Text',
- CacheFile: 'pt:CacheFile'
+ CacheFile: 'pt:CacheFile',
+ Infohash: 'pt:Infohash',
+ originallyPublishedAt: 'sc:DateTime'
},
{
likes: {
return signJsonLDObject(byActor, activity) as Promise<Activity>
}
-function getActorUrl (activityActor: string | ActivityPubActor) {
- if (typeof activityActor === 'string') return activityActor
+function getAPId (activity: string | { id: string }) {
+ if (typeof activity === 'string') return activity
- return activityActor.id
+ return activity.id
}
function checkUrlsSameHost (url1: string, url2: string) {
export {
checkUrlsSameHost,
- getActorUrl,
+ getAPId,
activityPubContextify,
activityPubCollectionPagination,
buildSignedActivity