1 import { signJsonLDObject } from '@server/helpers/peertube-crypto'
2 import { MActor } from '@server/types/models'
3 import { ContextType } from '@shared/models'
4 import { activityPubContextify } from './context'
6 function buildSignedActivity <T> (byActor: MActor, data: T, contextType?: ContextType) {
7 const activity = activityPubContextify(data, contextType)
9 return signJsonLDObject(byActor, activity)
12 function getAPId (object: string | { id: string }) {
13 if (typeof object === 'string') return object