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