]> 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 9ff150c4aaca8ae2a0d79d9350f383f1b3cfa31c..7f126ba4a0a15bb4a6100ab6aefb82ef5c63a995 100644 (file)
@@ -4,11 +4,12 @@ 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
   nsfw: boolean
+
   deleted: boolean
   blacklisted: boolean
 
@@ -17,37 +18,65 @@ export interface VideoAbuse {
 
   thumbnailPath?: string
   channel?: VideoChannel
+
+  countReports: number
+  nthReport: number
 }
 
-export interface VideoCommentAbuse {
+export interface AdminVideoCommentAbuse {
   id: number
-  account?: Account
+  threadId: number
+
+  video: {
+    id: number
+    name: string
+    uuid: string
+  }
+
   text: string
+
   deleted: boolean
 }
 
-export interface Abuse {
+export interface AdminAbuse {
   id: number
+
   reason: string
   predefinedReasons?: AbusePredefinedReasonsString[]
+
   reporterAccount: Account
+  flaggedAccount: Account
 
   state: VideoConstant<AbuseState>
   moderationComment?: string
 
-  video?: VideoAbuse
-  comment?: VideoCommentAbuse
+  video?: AdminVideoAbuse
+  comment?: AdminVideoCommentAbuse
 
   createdAt: Date
   updatedAt: Date
 
-  // FIXME: deprecated in 2.3, remove this
-  startAt: null
-  endAt: null
+  countReportsForReporter?: number
+  countReportsForReportee?: number
+
+  countMessages: number
+
+  // FIXME: deprecated in 2.3, remove the following properties
+
+  // @deprecated
+  startAt?: null
+  // @deprecated
+  endAt?: null
 
+  // @deprecated
   count?: number
+  // @deprecated
   nth?: number
-
-  countReportsForReporter?: number
-  countReportsForReportee?: number
 }
+
+export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
+
+export type UserVideoCommentAbuse = AdminVideoCommentAbuse
+
+export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
+| 'count' | 'nth'>