PeerTube/shared/models/activitypub/activity.ts

40 lines
878 B
TypeScript
Raw Normal View History

2017-11-09 17:51:58 +01:00
import {
VideoChannelObject,
VideoTorrentObject
} from './objects'
import { ActivityPubSignature } from './activitypub-signature'
2017-11-10 17:27:49 +01:00
export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag
2017-11-09 17:51:58 +01:00
// Flag -> report abuse
2017-11-10 14:34:45 +01:00
export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag'
2017-11-09 17:51:58 +01:00
export interface BaseActivity {
'@context'?: any[]
id: string
to: string[]
actor: string
type: ActivityType
signature: ActivityPubSignature
}
export interface ActivityCreate extends BaseActivity {
type: 'Create'
2017-11-10 14:34:45 +01:00
object: VideoChannelObject
}
export interface ActivityAdd extends BaseActivity {
type: 'Add'
object: VideoTorrentObject
2017-11-09 17:51:58 +01:00
}
export interface ActivityUpdate extends BaseActivity {
type: 'Update'
object: VideoTorrentObject | VideoChannelObject
}
export interface ActivityFlag extends BaseActivity {
type: 'Flag'
object: string
}