]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/activitypub/activity.ts
Handle mastodon shares
[github/Chocobozzz/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 object: ActivityFollow
50 }
51
52 export interface ActivityAnnounce extends BaseActivity {
53 type: 'Announce'
54 object: ActivityCreate | string
55 }
56
57 export interface ActivityUndo extends BaseActivity {
58 type: 'Undo',
59 object: ActivityFollow | ActivityLike | ActivityCreate
60 }
61
62 export interface ActivityLike extends BaseActivity {
63 type: 'Like',
64 object: string
65 }