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