]>
Commit | Line | Data |
---|---|---|
1 | import { ActivityPubActor } from './activitypub-actor' | |
2 | import { ActivityPubSignature } from './activitypub-signature' | |
3 | import { CacheFileObject, VideoTorrentObject } from './objects' | |
4 | import { DislikeObject } from './objects/dislike-object' | |
5 | import { VideoAbuseObject } from './objects/video-abuse-object' | |
6 | import { VideoCommentObject } from './objects/video-comment-object' | |
7 | import { ViewObject } from './objects/view-object' | |
8 | import { APObject } from './objects/object.model' | |
9 | ||
10 | export type Activity = ActivityCreate | ActivityUpdate | | |
11 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | | |
12 | ActivityUndo | ActivityLike | ActivityReject | ActivityView | ActivityDislike | ActivityFlag | |
13 | ||
14 | export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' | 'Reject' | | |
15 | 'View' | 'Dislike' | 'Flag' | |
16 | ||
17 | export interface ActivityAudience { | |
18 | to: string[] | |
19 | cc: string[] | |
20 | } | |
21 | ||
22 | export interface BaseActivity { | |
23 | '@context'?: any[] | |
24 | id: string | |
25 | to?: string[] | |
26 | cc?: string[] | |
27 | actor: string | ActivityPubActor | |
28 | type: ActivityType | |
29 | signature?: ActivityPubSignature | |
30 | } | |
31 | ||
32 | export interface ActivityCreate extends BaseActivity { | |
33 | type: 'Create' | |
34 | object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject | |
35 | } | |
36 | ||
37 | export interface ActivityUpdate extends BaseActivity { | |
38 | type: 'Update' | |
39 | object: VideoTorrentObject | ActivityPubActor | CacheFileObject | |
40 | } | |
41 | ||
42 | export interface ActivityDelete extends BaseActivity { | |
43 | type: 'Delete' | |
44 | object: string | { id: string } | |
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' | |
54 | object: ActivityFollow | |
55 | } | |
56 | ||
57 | export interface ActivityReject extends BaseActivity { | |
58 | type: 'Reject' | |
59 | object: ActivityFollow | |
60 | } | |
61 | ||
62 | export interface ActivityAnnounce extends BaseActivity { | |
63 | type: 'Announce' | |
64 | object: APObject | |
65 | } | |
66 | ||
67 | export interface ActivityUndo extends BaseActivity { | |
68 | type: 'Undo', | |
69 | object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce | |
70 | } | |
71 | ||
72 | export interface ActivityLike extends BaseActivity { | |
73 | type: 'Like', | |
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 | |
94 | } |