diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/models/video/video-channel-interface.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip |
Move models to typescript-sequelize
Diffstat (limited to 'server/models/video/video-channel-interface.ts')
-rw-r--r-- | server/models/video/video-channel-interface.ts | 64 |
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 @@ | |||
1 | import * as Promise from 'bluebird' | ||
2 | import * as Sequelize from 'sequelize' | ||
3 | |||
4 | import { ResultList } from '../../../shared' | ||
5 | import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object' | ||
6 | import { VideoChannel as FormattedVideoChannel } from '../../../shared/models/videos/video-channel.model' | ||
7 | import { AccountInstance } from '../account/account-interface' | ||
8 | import { VideoInstance } from './video-interface' | ||
9 | import { VideoChannelShareInstance } from './video-channel-share-interface' | ||
10 | |||
11 | export 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 | |||
29 | export 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 | |||
41 | export 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 | |||
54 | export 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 | |||
64 | export interface VideoChannelModel extends VideoChannelClass, Sequelize.Model<VideoChannelInstance, VideoChannelAttributes> {} | ||