X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-abuse-interface.ts;h=16806cae2ee36378486f7bb99ad226c4a24e2bac;hb=608624252466acf9f1d9ee1c1170bd4fe4d18d18;hp=4b7f2a2ec2820e620bdaa4ae672c119dbeb9e0ed;hpb=74889a71fe687dda74f2a687653122327807af36;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-abuse-interface.ts b/server/models/video/video-abuse-interface.ts index 4b7f2a2ec..16806cae2 100644 --- a/server/models/video/video-abuse-interface.ts +++ b/server/models/video/video-abuse-interface.ts @@ -1,13 +1,16 @@ import * as Sequelize from 'sequelize' +import * as Promise from 'bluebird' + +import { ServerInstance } from '../server/server-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 > } export interface VideoAbuseClass { @@ -17,12 +20,17 @@ export interface VideoAbuseClass { export interface VideoAbuseAttributes { reporterUsername: string reason: string + videoId: number } export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttributes, Sequelize.Instance { id: number createdAt: Date updatedAt: Date + + Server: ServerInstance + + toFormattedJSON: VideoAbuseMethods.ToFormattedJSON } export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model {}