]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/users/user-notification.model.ts
Add new plugin/peertube version notifs
[github/Chocobozzz/PeerTube.git] / shared / models / users / user-notification.model.ts
CommitLineData
883993c8 1import { FollowState } from '../actors'
594d3e48 2import { AbuseState } from '../moderation'
32a18cbf 3import { PluginType } from '../plugins'
883993c8 4
829523cf 5export const enum UserNotificationType {
cef534ed
C
6 NEW_VIDEO_FROM_SUBSCRIPTION = 1,
7 NEW_COMMENT_ON_MY_VIDEO = 2,
310b5219 8 NEW_ABUSE_FOR_MODERATORS = 3,
2f1548fd 9
cef534ed 10 BLACKLIST_ON_MY_VIDEO = 4,
dc133480 11 UNBLACKLIST_ON_MY_VIDEO = 5,
2f1548fd 12
dc133480 13 MY_VIDEO_PUBLISHED = 6,
2f1548fd 14
dc133480 15 MY_VIDEO_IMPORT_SUCCESS = 7,
f7cc67b4 16 MY_VIDEO_IMPORT_ERROR = 8,
2f1548fd 17
f7cc67b4
C
18 NEW_USER_REGISTRATION = 9,
19 NEW_FOLLOW = 10,
7ccddd7b
JM
20 COMMENT_MENTION = 11,
21
883993c8
C
22 VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
23
8424c402
C
24 NEW_INSTANCE_FOLLOWER = 13,
25
594d3e48
C
26 AUTO_INSTANCE_FOLLOWING = 14,
27
28 ABUSE_STATE_CHANGE = 15,
29
32a18cbf
C
30 ABUSE_NEW_MESSAGE = 16,
31
32 NEW_PLUGIN_VERSION = 17,
33 NEW_PEERTUBE_VERSION = 18
cef534ed
C
34}
35
dc133480 36export interface VideoInfo {
cef534ed
C
37 id: number
38 uuid: string
39 name: string
40}
41
457bb213
C
42export interface ActorInfo {
43 id: number
44 displayName: string
45 name: string
38967f7b 46 host: string
457bb213
C
47 avatar?: {
48 path: string
49 }
50}
51
cef534ed
C
52export interface UserNotification {
53 id: number
54 type: UserNotificationType
55 read: boolean
56
57 video?: VideoInfo & {
457bb213 58 channel: ActorInfo
cef534ed
C
59 }
60
dc133480
C
61 videoImport?: {
62 id: number
63 video?: VideoInfo
64 torrentName?: string
65 magnetUri?: string
66 targetUrl?: string
67 }
68
cef534ed
C
69 comment?: {
70 id: number
dc133480 71 threadId: number
457bb213 72 account: ActorInfo
dc133480 73 video: VideoInfo
cef534ed
C
74 }
75
d95d1559 76 abuse?: {
cef534ed 77 id: number
594d3e48 78 state: AbuseState
d95d1559
C
79
80 video?: VideoInfo
81
82 comment?: {
83 threadId: number
84
85 video: {
cfde28ba 86 id: number
d95d1559 87 uuid: string
cfde28ba 88 name: string
d95d1559
C
89 }
90 }
91
92 account?: ActorInfo
cef534ed
C
93 }
94
95 videoBlacklist?: {
96 id: number
97 video: VideoInfo
98 }
99
457bb213 100 account?: ActorInfo
f7cc67b4
C
101
102 actorFollow?: {
103 id: number
457bb213 104 follower: ActorInfo
883993c8 105 state: FollowState
8424c402 106
f7cc67b4 107 following: {
8424c402 108 type: 'account' | 'channel' | 'instance'
f7cc67b4
C
109 name: string
110 displayName: string
8424c402 111 host: string
f7cc67b4
C
112 }
113 }
114
32a18cbf
C
115 plugin?: {
116 name: string
117 type: PluginType
118 latestVersion: string
119 }
120
121 peertube?: {
122 latestVersion: string
123 }
124
cef534ed
C
125 createdAt: string
126 updatedAt: string
127}