aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-channel-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-channel-interface.ts')
-rw-r--r--server/models/video/video-channel-interface.ts64
1 files changed, 0 insertions, 64 deletions
diff --git a/server/models/video/video-channel-interface.ts b/server/models/video/video-channel-interface.ts
deleted file mode 100644
index 21f81e901..000000000
--- a/server/models/video/video-channel-interface.ts
+++ /dev/null
@@ -1,64 +0,0 @@
1import * as Promise from 'bluebird'
2import * as Sequelize from 'sequelize'
3
4import { ResultList } from '../../../shared'
5import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object'
6import { VideoChannel as FormattedVideoChannel } from '../../../shared/models/videos/video-channel.model'
7import { AccountInstance } from '../account/account-interface'
8import { VideoInstance } from './video-interface'
9import { VideoChannelShareInstance } from './video-channel-share-interface'
10
11export namespace VideoChannelMethods {
12 export type ToFormattedJSON = (this: VideoChannelInstance) => FormattedVideoChannel
13 export type ToActivityPubObject = (this: VideoChannelInstance) => VideoChannelObject
14 export type IsOwned = (this: VideoChannelInstance) => boolean
15
16 export type CountByAccount = (accountId: number) => Promise<number>
17 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoChannelInstance> >
18 export type LoadByIdAndAccount = (id: number, accountId: number) => Promise<VideoChannelInstance>
19 export type ListByAccount = (accountId: number) => Promise< ResultList<VideoChannelInstance> >
20 export type LoadAndPopulateAccount = (id: number) => Promise<VideoChannelInstance>
21 export type LoadByUUIDAndPopulateAccount = (uuid: string) => Promise<VideoChannelInstance>
22 export type LoadByUUID = (uuid: string, t?: Sequelize.Transaction) => Promise<VideoChannelInstance>
23 export type LoadByHostAndUUID = (uuid: string, serverHost: string, t?: Sequelize.Transaction) => Promise<VideoChannelInstance>
24 export type LoadAndPopulateAccountAndVideos = (id: number) => Promise<VideoChannelInstance>
25 export type LoadByUrl = (uuid: string, t?: Sequelize.Transaction) => Promise<VideoChannelInstance>
26 export type LoadByUUIDOrUrl = (uuid: string, url: string, t?: Sequelize.Transaction) => Promise<VideoChannelInstance>
27}
28
29export interface VideoChannelClass {
30 countByAccount: VideoChannelMethods.CountByAccount
31 listForApi: VideoChannelMethods.ListForApi
32 listByAccount: VideoChannelMethods.ListByAccount
33 loadByIdAndAccount: VideoChannelMethods.LoadByIdAndAccount
34 loadAndPopulateAccount: VideoChannelMethods.LoadAndPopulateAccount
35 loadByUUIDAndPopulateAccount: VideoChannelMethods.LoadByUUIDAndPopulateAccount
36 loadAndPopulateAccountAndVideos: VideoChannelMethods.LoadAndPopulateAccountAndVideos
37 loadByUrl: VideoChannelMethods.LoadByUrl
38 loadByUUIDOrUrl: VideoChannelMethods.LoadByUUIDOrUrl
39}
40
41export interface VideoChannelAttributes {
42 id?: number
43 uuid?: string
44 name: string
45 description: string
46 remote: boolean
47 url?: string
48
49 Account?: AccountInstance
50 Videos?: VideoInstance[]
51 VideoChannelShares?: VideoChannelShareInstance[]
52}
53
54export interface VideoChannelInstance extends VideoChannelClass, VideoChannelAttributes, Sequelize.Instance<VideoChannelAttributes> {
55 id: number
56 createdAt: Date
57 updatedAt: Date
58
59 isOwned: VideoChannelMethods.IsOwned
60 toFormattedJSON: VideoChannelMethods.ToFormattedJSON
61 toActivityPubObject: VideoChannelMethods.ToActivityPubObject
62}
63
64export interface VideoChannelModel extends VideoChannelClass, Sequelize.Model<VideoChannelInstance, VideoChannelAttributes> {}