]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-abuse-interface.ts
Remove sequelize deprecated operators
[github/Chocobozzz/PeerTube.git] / server / models / video / video-abuse-interface.ts
index f3e32f79c55f41e5d07d7447ac58e989eeebc197..978268926cbb9ad44f8c406fd2ab5edb67f13f93 100644 (file)
@@ -1,15 +1,16 @@
 import * as Sequelize from 'sequelize'
+import * as Promise from 'bluebird'
 
-import { PodInstance } from '../pod'
+import { PodInstance } from '../pod/pod-interface'
+import { ResultList } from '../../../shared'
 
 // Don't use barrel, import just what we need
-import { VideoAbuse as FormatedVideoAbuse } from '../../../shared/models/video-abuse.model'
+import { VideoAbuse as FormattedVideoAbuse } from '../../../shared/models/videos/video-abuse.model'
 
 export namespace VideoAbuseMethods {
-  export type toFormatedJSON = () => FormatedVideoAbuse
+  export type ToFormattedJSON = (this: VideoAbuseInstance) => FormattedVideoAbuse
 
-  export type ListForApiCallback = (err: Error, videoAbuseInstances?: VideoAbuseInstance[], total?: number) => void
-  export type ListForApi = (start: number, count: number, sort: string, callback: ListForApiCallback) => void
+  export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> >
 }
 
 export interface VideoAbuseClass {
@@ -19,7 +20,7 @@ export interface VideoAbuseClass {
 export interface VideoAbuseAttributes {
   reporterUsername: string
   reason: string
-  videoId: string
+  videoId: number
 }
 
 export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttributes, Sequelize.Instance<VideoAbuseAttributes> {
@@ -28,6 +29,8 @@ export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttribute
   updatedAt: Date
 
   Pod: PodInstance
+
+  toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
 }
 
 export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {}