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