]>
Commit | Line | Data |
---|---|---|
265ba139 | 1 | import { ActivityPubActor } from './activitypub-actor' |
e4f97bab | 2 | import { ActivityPubSignature } from './activitypub-signature' |
c48e82b5 | 3 | import { CacheFileObject, 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' |
848f499d | 8 | import { APObject } from './objects/object.model' |
e4f97bab | 9 | |
50d6de9c | 10 | export type Activity = ActivityCreate | ActivityUpdate | |
54141398 | 11 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | |
848f499d | 12 | ActivityUndo | ActivityLike | ActivityReject | ActivityView | ActivityDislike | ActivityFlag |
e4f97bab | 13 | |
848f499d C |
14 | export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' | 'Reject' | |
15 | 'View' | 'Dislike' | 'Flag' | |
e4f97bab | 16 | |
63c93323 C |
17 | export interface ActivityAudience { |
18 | to: string[] | |
19 | cc: string[] | |
20 | } | |
21 | ||
e4f97bab C |
22 | export interface BaseActivity { |
23 | '@context'?: any[] | |
24 | id: string | |
afffe988 | 25 | to?: string[] |
9a27cdc2 | 26 | cc?: string[] |
6be84cbc | 27 | actor: string | ActivityPubActor |
e4f97bab | 28 | type: ActivityType |
afffe988 | 29 | signature?: ActivityPubSignature |
e4f97bab C |
30 | } |
31 | ||
32 | export interface ActivityCreate extends BaseActivity { | |
33 | type: 'Create' | |
c48e82b5 | 34 | object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject |
e4f97bab C |
35 | } |
36 | ||
37 | export interface ActivityUpdate extends BaseActivity { | |
38 | type: 'Update' | |
c48e82b5 | 39 | object: VideoTorrentObject | ActivityPubActor | CacheFileObject |
e4f97bab C |
40 | } |
41 | ||
7a7724e6 C |
42 | export interface ActivityDelete extends BaseActivity { |
43 | type: 'Delete' | |
2890b615 | 44 | object: string | { id: string } |
7a7724e6 C |
45 | } |
46 | ||
47 | export interface ActivityFollow extends BaseActivity { | |
48 | type: 'Follow' | |
49 | object: string | |
50 | } | |
51 | ||
52 | export interface ActivityAccept extends BaseActivity { | |
53 | type: 'Accept' | |
e12a0092 | 54 | object: ActivityFollow |
7a7724e6 | 55 | } |
d8465018 | 56 | |
4bbc373f C |
57 | export interface ActivityReject extends BaseActivity { |
58 | type: 'Reject' | |
59 | object: ActivityFollow | |
60 | } | |
61 | ||
d8465018 C |
62 | export interface ActivityAnnounce extends BaseActivity { |
63 | type: 'Announce' | |
848f499d | 64 | object: APObject |
d8465018 | 65 | } |
54141398 C |
66 | |
67 | export interface ActivityUndo extends BaseActivity { | |
68 | type: 'Undo', | |
848f499d | 69 | object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce |
0032ebe9 C |
70 | } |
71 | ||
72 | export interface ActivityLike extends BaseActivity { | |
73 | type: 'Like', | |
848f499d C |
74 | object: APObject |
75 | } | |
76 | ||
77 | export interface ActivityView extends BaseActivity { | |
78 | type: 'View', | |
79 | actor: string | |
80 | object: APObject | |
81 | } | |
82 | ||
83 | export interface ActivityDislike extends BaseActivity { | |
84 | id: string | |
85 | type: 'Dislike' | |
86 | actor: string | |
87 | object: APObject | |
88 | } | |
89 | ||
90 | export interface ActivityFlag extends BaseActivity { | |
91 | type: 'Flag', | |
92 | content: string, | |
93 | object: APObject | |
54141398 | 94 | } |