]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/activitypub/activity.ts
0274416b23e1c01de03ce15a18f0608501b563b0
[github/Chocobozzz/PeerTube.git] / shared / models / activitypub / activity.ts
1 import {
2 VideoChannelObject,
3 VideoTorrentObject
4 } from './objects'
5 import { ActivityPubSignature } from './activitypub-signature'
6
7 export type Activity = ActivityCreate | ActivityUpdate | ActivityFlag
8
9 // Flag -> report abuse
10 export type ActivityType = 'Create' | 'Update' | 'Flag'
11
12 export interface BaseActivity {
13 '@context'?: any[]
14 id: string
15 to: string[]
16 actor: string
17 type: ActivityType
18 signature: ActivityPubSignature
19 }
20
21 export interface ActivityCreate extends BaseActivity {
22 type: 'Create'
23 object: VideoTorrentObject | VideoChannelObject
24 }
25
26 export interface ActivityUpdate extends BaseActivity {
27 type: 'Update'
28 object: VideoTorrentObject | VideoChannelObject
29 }
30
31 export interface ActivityFlag extends BaseActivity {
32 type: 'Flag'
33 object: string
34 }