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