]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/video/author-interface.ts
Add video privacy setting
[github/Chocobozzz/PeerTube.git] / server / models / video / author-interface.ts
CommitLineData
e02643f3 1import * as Sequelize from 'sequelize'
6fcd19ba 2import * as Promise from 'bluebird'
e02643f3 3
fdbda9e3 4import { PodInstance } from '../pod/pod-interface'
72c7248b
C
5import { RemoteVideoAuthorCreateData } from '../../../shared/models/pods/remote-video/remote-video-author-create-request.model'
6import { VideoChannelInstance } from './video-channel-interface'
69818c93 7
e02643f3 8export namespace AuthorMethods {
72c7248b
C
9 export type Load = (id: number) => Promise<AuthorInstance>
10 export type LoadByUUID = (uuid: string) => Promise<AuthorInstance>
11 export type LoadAuthorByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Promise<AuthorInstance>
12 export type ListOwned = () => Promise<AuthorInstance[]>
13
14 export type ToAddRemoteJSON = (this: AuthorInstance) => RemoteVideoAuthorCreateData
15 export type IsOwned = (this: AuthorInstance) => boolean
e02643f3
C
16}
17
18export interface AuthorClass {
72c7248b
C
19 loadAuthorByPodAndUUID: AuthorMethods.LoadAuthorByPodAndUUID
20 load: AuthorMethods.Load
21 loadByUUID: AuthorMethods.LoadByUUID
22 listOwned: AuthorMethods.ListOwned
e02643f3
C
23}
24
25export interface AuthorAttributes {
26 name: string
72c7248b
C
27 uuid?: string
28
29 podId?: number
30 userId?: number
e02643f3
C
31}
32
33export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> {
72c7248b
C
34 isOwned: AuthorMethods.IsOwned
35 toAddRemoteJSON: AuthorMethods.ToAddRemoteJSON
36
e02643f3
C
37 id: number
38 createdAt: Date
39 updatedAt: Date
69818c93 40
69818c93 41 Pod: PodInstance
72c7248b 42 VideoChannels: VideoChannelInstance[]
e02643f3
C
43}
44
45export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {}