]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/moderation/abuse/abuse.model.ts
Add server API to abuse messages
[github/Chocobozzz/PeerTube.git] / shared / models / moderation / abuse / abuse.model.ts
1 import { Account } from '../../actors/account.model'
2 import { AbuseState } from './abuse-state.model'
3 import { AbusePredefinedReasonsString } from './abuse-reason.model'
4 import { VideoConstant } from '../../videos/video-constant.model'
5 import { VideoChannel } from '../../videos/channel/video-channel.model'
6
7 export interface AdminVideoAbuse {
8 id: number
9 name: string
10 uuid: string
11 nsfw: boolean
12
13 deleted: boolean
14 blacklisted: boolean
15
16 startAt: number | null
17 endAt: number | null
18
19 thumbnailPath?: string
20 channel?: VideoChannel
21
22 countReports: number
23 nthReport: number
24 }
25
26 export interface AdminVideoCommentAbuse {
27 id: number
28 threadId: number
29
30 video: {
31 id: number
32 name: string
33 uuid: string
34 }
35
36 text: string
37
38 deleted: boolean
39 }
40
41 export interface AdminAbuse {
42 id: number
43
44 reason: string
45 predefinedReasons?: AbusePredefinedReasonsString[]
46
47 reporterAccount: Account
48 flaggedAccount: Account
49
50 state: VideoConstant<AbuseState>
51 moderationComment?: string
52
53 video?: AdminVideoAbuse
54 comment?: AdminVideoCommentAbuse
55
56 createdAt: Date
57 updatedAt: Date
58
59 countReportsForReporter?: number
60 countReportsForReportee?: number
61
62 countMessages: number
63
64 // FIXME: deprecated in 2.3, remove the following properties
65
66 // @deprecated
67 startAt?: null
68 // @deprecated
69 endAt?: null
70
71 // @deprecated
72 count?: number
73 // @deprecated
74 nth?: number
75 }
76
77 export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
78
79 export type UserVideoCommentAbuse = AdminVideoCommentAbuse
80
81 export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
82 | 'count' | 'nth'>