]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/moderation/abuse/abuse.model.ts
Add server API to abuse messages
[github/Chocobozzz/PeerTube.git] / shared / models / moderation / abuse / abuse.model.ts
index 0a0c6bd3583751beffafd3c586bb90761446f40c..7f126ba4a0a15bb4a6100ab6aefb82ef5c63a995 100644 (file)
@@ -4,7 +4,7 @@ import { AbusePredefinedReasonsString } from './abuse-reason.model'
 import { VideoConstant } from '../../videos/video-constant.model'
 import { VideoChannel } from '../../videos/channel/video-channel.model'
 
-export interface VideoAbuse {
+export interface AdminVideoAbuse {
   id: number
   name: string
   uuid: string
@@ -23,7 +23,7 @@ export interface VideoAbuse {
   nthReport: number
 }
 
-export interface VideoCommentAbuse {
+export interface AdminVideoCommentAbuse {
   id: number
   threadId: number
 
@@ -38,7 +38,7 @@ export interface VideoCommentAbuse {
   deleted: boolean
 }
 
-export interface Abuse {
+export interface AdminAbuse {
   id: number
 
   reason: string
@@ -50,8 +50,8 @@ export interface Abuse {
   state: VideoConstant<AbuseState>
   moderationComment?: string
 
-  video?: VideoAbuse
-  comment?: VideoCommentAbuse
+  video?: AdminVideoAbuse
+  comment?: AdminVideoCommentAbuse
 
   createdAt: Date
   updatedAt: Date
@@ -59,6 +59,8 @@ export interface Abuse {
   countReportsForReporter?: number
   countReportsForReportee?: number
 
+  countMessages: number
+
   // FIXME: deprecated in 2.3, remove the following properties
 
   // @deprecated
@@ -71,3 +73,10 @@ export interface Abuse {
   // @deprecated
   nth?: number
 }
+
+export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
+
+export type UserVideoCommentAbuse = AdminVideoCommentAbuse
+
+export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
+| 'count' | 'nth'>