]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - shared/models/activitypub/activity.ts
Create comment on replied mastodon statutes
[github/Chocobozzz/PeerTube.git] / shared / models / activitypub / activity.ts
... / ...
CommitLineData
1import { ActivityPubSignature } from './activitypub-signature'
2import { VideoTorrentObject } from './objects'
3import { DislikeObject } from './objects/dislike-object'
4import { VideoAbuseObject } from './objects/video-abuse-object'
5import { VideoCommentObject } from './objects/video-comment-object'
6import { ViewObject } from './objects/view-object'
7
8export type Activity = ActivityCreate | ActivityUpdate |
9 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
10 ActivityUndo | ActivityLike
11
12export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like'
13
14export interface ActivityAudience {
15 to: string[]
16 cc: string[]
17}
18
19export 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
29export interface ActivityCreate extends BaseActivity {
30 type: 'Create'
31 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject
32}
33
34export interface ActivityUpdate extends BaseActivity {
35 type: 'Update'
36 object: VideoTorrentObject
37}
38
39export interface ActivityDelete extends BaseActivity {
40 type: 'Delete'
41}
42
43export interface ActivityFollow extends BaseActivity {
44 type: 'Follow'
45 object: string
46}
47
48export interface ActivityAccept extends BaseActivity {
49 type: 'Accept'
50 object: ActivityFollow
51}
52
53export interface ActivityAnnounce extends BaseActivity {
54 type: 'Announce'
55 object: ActivityCreate | string
56}
57
58export interface ActivityUndo extends BaseActivity {
59 type: 'Undo',
60 object: ActivityFollow | ActivityLike | ActivityCreate
61}
62
63export interface ActivityLike extends BaseActivity {
64 type: 'Like',
65 object: string
66}