Create comment on replied mastodon statutes
[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 { VideoCommentObject } from './objects/video-comment-object'
6 import { ViewObject } from './objects/view-object'
7
8 export type Activity = ActivityCreate | ActivityUpdate |
9   ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
10   ActivityUndo | ActivityLike
11
12 export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like'
13
14 export interface ActivityAudience {
15   to: string[]
16   cc: string[]
17 }
18
19 export interface BaseActivity {
20   '@context'?: any[]
21   id: string
22   to?: string[]
23   cc?: string[]
24   actor: string
25   type: ActivityType
26   signature?: ActivityPubSignature
27 }
28
29 export interface ActivityCreate extends BaseActivity {
30   type: 'Create'
31   object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject
32 }
33
34 export interface ActivityUpdate extends BaseActivity {
35   type: 'Update'
36   object: VideoTorrentObject
37 }
38
39 export interface ActivityDelete extends BaseActivity {
40   type: 'Delete'
41 }
42
43 export interface ActivityFollow extends BaseActivity {
44   type: 'Follow'
45   object: string
46 }
47
48 export interface ActivityAccept extends BaseActivity {
49   type: 'Accept'
50   object: ActivityFollow
51 }
52
53 export interface ActivityAnnounce extends BaseActivity {
54   type: 'Announce'
55   object: ActivityCreate | string
56 }
57
58 export interface ActivityUndo extends BaseActivity {
59   type: 'Undo',
60   object: ActivityFollow | ActivityLike | ActivityCreate
61 }
62
63 export interface ActivityLike extends BaseActivity {
64   type: 'Like',
65   object: string
66 }