1
0
Fork 0
peertube/shared/models/activitypub/activity.ts

54 lines
1.2 KiB
TypeScript
Raw Normal View History

2017-11-09 16:51:58 +00:00
import {
VideoChannelObject,
VideoTorrentObject
} from './objects'
import { ActivityPubSignature } from './activitypub-signature'
2017-11-13 16:39:41 +00:00
export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag |
ActivityDelete | ActivityFollow | ActivityAccept
2017-11-09 16:51:58 +00:00
// Flag -> report abuse
2017-11-13 16:39:41 +00:00
export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' | 'Delete' | 'Follow' | 'Accept'
2017-11-09 16:51:58 +00: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 13:34:45 +00:00
object: VideoChannelObject
}
export interface ActivityAdd extends BaseActivity {
type: 'Add'
object: VideoTorrentObject
2017-11-09 16:51:58 +00:00
}
export interface ActivityUpdate extends BaseActivity {
type: 'Update'
object: VideoTorrentObject | VideoChannelObject
}
export interface ActivityFlag extends BaseActivity {
type: 'Flag'
object: string
}
2017-11-13 16:39:41 +00:00
export interface ActivityDelete extends BaseActivity {
type: 'Delete'
}
export interface ActivityFollow extends BaseActivity {
type: 'Follow'
object: string
}
export interface ActivityAccept extends BaseActivity {
type: 'Accept'
}