]>
Commit | Line | Data |
---|---|---|
8e13fa7d | 1 | import { VideoChannelObject, VideoTorrentObject } from './objects' |
e4f97bab | 2 | import { ActivityPubSignature } from './activitypub-signature' |
8e13fa7d | 3 | import { VideoAbuseObject } from './objects/video-abuse-object' |
e4f97bab | 4 | |
7a7724e6 | 5 | export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag | |
d8465018 | 6 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
e4f97bab C |
7 | |
8 | // Flag -> report abuse | |
d8465018 | 9 | export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' | 'Delete' | 'Follow' | 'Accept' | 'Announce' |
e4f97bab C |
10 | |
11 | export interface BaseActivity { | |
12 | '@context'?: any[] | |
13 | id: string | |
afffe988 | 14 | to?: string[] |
e4f97bab C |
15 | actor: string |
16 | type: ActivityType | |
afffe988 | 17 | signature?: ActivityPubSignature |
e4f97bab C |
18 | } |
19 | ||
20 | export interface ActivityCreate extends BaseActivity { | |
21 | type: 'Create' | |
8e13fa7d | 22 | object: VideoChannelObject | VideoAbuseObject |
0d0e8dd0 C |
23 | } |
24 | ||
25 | export interface ActivityAdd extends BaseActivity { | |
26 | type: 'Add' | |
20494f12 | 27 | target: string |
0d0e8dd0 | 28 | object: VideoTorrentObject |
e4f97bab C |
29 | } |
30 | ||
31 | export interface ActivityUpdate extends BaseActivity { | |
32 | type: 'Update' | |
33 | object: VideoTorrentObject | VideoChannelObject | |
34 | } | |
35 | ||
36 | export interface ActivityFlag extends BaseActivity { | |
37 | type: 'Flag' | |
38 | object: string | |
39 | } | |
7a7724e6 C |
40 | |
41 | export interface ActivityDelete extends BaseActivity { | |
42 | type: 'Delete' | |
43 | } | |
44 | ||
45 | export interface ActivityFollow extends BaseActivity { | |
46 | type: 'Follow' | |
47 | object: string | |
48 | } | |
49 | ||
50 | export interface ActivityAccept extends BaseActivity { | |
51 | type: 'Accept' | |
52 | } | |
d8465018 C |
53 | |
54 | export interface ActivityAnnounce extends BaseActivity { | |
55 | type: 'Announce' | |
20494f12 | 56 | object: ActivityCreate | ActivityAdd |
d8465018 | 57 | } |