]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/activitypub/activity.ts
Fix delete activities
[github/Chocobozzz/PeerTube.git] / shared / models / activitypub / activity.ts
1 import { ActivityPubActor } from './activitypub-actor'
2 import { ActivityPubSignature } from './activitypub-signature'
3 import { VideoTorrentObject } from './objects'
4 import { DislikeObject } from './objects/dislike-object'
5 import { VideoAbuseObject } from './objects/video-abuse-object'
6 import { VideoCommentObject } from './objects/video-comment-object'
7 import { ViewObject } from './objects/view-object'
8
9 export type Activity = ActivityCreate | ActivityUpdate |
10 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
11 ActivityUndo | ActivityLike
12
13 export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like'
14
15 export interface ActivityAudience {
16 to: string[]
17 cc: string[]
18 }
19
20 export interface BaseActivity {
21 '@context'?: any[]
22 id: string
23 to?: string[]
24 cc?: string[]
25 actor: string
26 type: ActivityType
27 signature?: ActivityPubSignature
28 }
29
30 export interface ActivityCreate extends BaseActivity {
31 type: 'Create'
32 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject
33 }
34
35 export interface ActivityUpdate extends BaseActivity {
36 type: 'Update'
37 object: VideoTorrentObject | ActivityPubActor
38 }
39
40 export interface ActivityDelete extends BaseActivity {
41 type: 'Delete'
42 object: string
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 object: ActivityFollow
53 }
54
55 export interface ActivityAnnounce extends BaseActivity {
56 type: 'Announce'
57 object: ActivityCreate | string
58 }
59
60 export interface ActivityUndo extends BaseActivity {
61 type: 'Undo',
62 object: ActivityFollow | ActivityLike | ActivityCreate
63 }
64
65 export interface ActivityLike extends BaseActivity {
66 type: 'Like',
67 object: string
68 }