]>
Commit | Line | Data |
---|---|---|
e02643f3 | 1 | import * as Sequelize from 'sequelize' |
6fcd19ba | 2 | import * as Promise from 'bluebird' |
e02643f3 | 3 | |
fdbda9e3 | 4 | import { PodInstance } from '../pod/pod-interface' |
72c7248b C |
5 | import { RemoteVideoAuthorCreateData } from '../../../shared/models/pods/remote-video/remote-video-author-create-request.model' |
6 | import { VideoChannelInstance } from './video-channel-interface' | |
69818c93 | 7 | |
e02643f3 | 8 | export 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 | ||
18 | export interface AuthorClass { | |
72c7248b C |
19 | loadAuthorByPodAndUUID: AuthorMethods.LoadAuthorByPodAndUUID |
20 | load: AuthorMethods.Load | |
21 | loadByUUID: AuthorMethods.LoadByUUID | |
22 | listOwned: AuthorMethods.ListOwned | |
e02643f3 C |
23 | } |
24 | ||
25 | export interface AuthorAttributes { | |
26 | name: string | |
72c7248b C |
27 | uuid?: string |
28 | ||
29 | podId?: number | |
30 | userId?: number | |
e02643f3 C |
31 | } |
32 | ||
33 | export 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 | ||
45 | export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {} |