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