]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/activitypub/activity.ts
Send account activitypub update events
[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 }
43
44 export interface ActivityFollow extends BaseActivity {
45 type: 'Follow'
46 object: string
47 }
48
49 export interface ActivityAccept extends BaseActivity {
50 type: 'Accept'
51 object: ActivityFollow
52 }
53
54 export interface ActivityAnnounce extends BaseActivity {
55 type: 'Announce'
56 object: ActivityCreate | string
57 }
58
59 export interface ActivityUndo extends BaseActivity {
60 type: 'Undo',
61 object: ActivityFollow | ActivityLike | ActivityCreate
62 }
63
64 export interface ActivityLike extends BaseActivity {
65 type: 'Like',
66 object: string
67 }