Begin moving video channel to actor
[oweals/peertube.git] / shared / models / activitypub / activity.ts
1 import { ActivityPubSignature } from './activitypub-signature'
2 import { VideoTorrentObject } from './objects'
3 import { DislikeObject } from './objects/dislike-object'
4 import { VideoAbuseObject } from './objects/video-abuse-object'
5 import { ViewObject } from './objects/view-object'
6
7 export type Activity = ActivityCreate | ActivityUpdate |
8   ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
9   ActivityUndo | ActivityLike
10
11 export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like'
12
13 export interface ActivityAudience {
14   to: string[]
15   cc: string[]
16 }
17
18 export interface BaseActivity {
19   '@context'?: any[]
20   id: string
21   to?: string[]
22   cc?: string[]
23   actor: string
24   type: ActivityType
25   signature?: ActivityPubSignature
26 }
27
28 export interface ActivityCreate extends BaseActivity {
29   type: 'Create'
30   object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject
31 }
32
33 export interface ActivityUpdate extends BaseActivity {
34   type: 'Update'
35   object: VideoTorrentObject
36 }
37
38 export interface ActivityDelete extends BaseActivity {
39   type: 'Delete'
40 }
41
42 export interface ActivityFollow extends BaseActivity {
43   type: 'Follow'
44   object: string
45 }
46
47 export interface ActivityAccept extends BaseActivity {
48   type: 'Accept'
49 }
50
51 export interface ActivityAnnounce extends BaseActivity {
52   type: 'Announce'
53   object: ActivityCreate
54 }
55
56 export interface ActivityUndo extends BaseActivity {
57   type: 'Undo',
58   object: ActivityFollow | ActivityLike | ActivityCreate
59 }
60
61 export interface ActivityLike extends BaseActivity {
62   type: 'Like',
63   object: string
64 }