aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-abuse-interface.ts
blob: feafc4a19640b7c337ba9e0dd05a4ec94d2e17fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as Promise from 'bluebird'
import * as Sequelize from 'sequelize'
import { ResultList } from '../../../shared'
import { VideoAbuse as FormattedVideoAbuse } from '../../../shared/models/videos/video-abuse.model'
import { AccountInstance } from '../account/account-interface'
import { ServerInstance } from '../server/server-interface'
import { VideoInstance } from './video-interface'
import { VideoAbuseObject } from '../../../shared/models/activitypub/objects/video-abuse-object'

export namespace VideoAbuseMethods {
  export type ToFormattedJSON = (this: VideoAbuseInstance) => FormattedVideoAbuse

  export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> >
  export type ToActivityPubObject = () => VideoAbuseObject
}

export interface VideoAbuseClass {
  listForApi: VideoAbuseMethods.ListForApi
  toActivityPubObject: VideoAbuseMethods.ToActivityPubObject
}

export interface VideoAbuseAttributes {
  reason: string
  videoId: number
  reporterAccountId: number

  Account?: AccountInstance
  Video?: VideoInstance
}

export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttributes, Sequelize.Instance<VideoAbuseAttributes> {
  id: number
  createdAt: Date
  updatedAt: Date

  Server: ServerInstance

  toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
}

export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {}