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