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