]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/activitypub/activity.ts
Fix lint
[github/Chocobozzz/PeerTube.git] / shared / models / activitypub / activity.ts
CommitLineData
e4f97bab 1import { ActivityPubSignature } from './activitypub-signature'
40ff5707 2import { VideoChannelObject, VideoTorrentObject } from './objects'
8e13fa7d 3import { VideoAbuseObject } from './objects/video-abuse-object'
40ff5707 4import { ViewObject } from './objects/view-object'
e4f97bab 5
79d5caf9 6export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate |
54141398
C
7 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
8 ActivityUndo
e4f97bab 9
54141398 10export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo'
e4f97bab
C
11
12export interface BaseActivity {
13 '@context'?: any[]
14 id: string
afffe988 15 to?: string[]
9a27cdc2 16 cc?: string[]
e4f97bab
C
17 actor: string
18 type: ActivityType
afffe988 19 signature?: ActivityPubSignature
e4f97bab
C
20}
21
22export interface ActivityCreate extends BaseActivity {
23 type: 'Create'
40ff5707 24 object: VideoChannelObject | VideoAbuseObject | ViewObject
0d0e8dd0
C
25}
26
27export interface ActivityAdd extends BaseActivity {
28 type: 'Add'
20494f12 29 target: string
0d0e8dd0 30 object: VideoTorrentObject
e4f97bab
C
31}
32
33export interface ActivityUpdate extends BaseActivity {
34 type: 'Update'
35 object: VideoTorrentObject | VideoChannelObject
36}
37
7a7724e6
C
38export interface ActivityDelete extends BaseActivity {
39 type: 'Delete'
40}
41
42export interface ActivityFollow extends BaseActivity {
43 type: 'Follow'
44 object: string
45}
46
47export interface ActivityAccept extends BaseActivity {
48 type: 'Accept'
49}
d8465018
C
50
51export interface ActivityAnnounce extends BaseActivity {
52 type: 'Announce'
20494f12 53 object: ActivityCreate | ActivityAdd
d8465018 54}
54141398
C
55
56export interface ActivityUndo extends BaseActivity {
57 type: 'Undo',
58 object: ActivityFollow
59}