From 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Dec 2017 17:53:50 +0100 Subject: Move models to typescript-sequelize --- server/models/video/video-channel-interface.ts | 64 -------------------------- 1 file changed, 64 deletions(-) delete mode 100644 server/models/video/video-channel-interface.ts (limited to 'server/models/video/video-channel-interface.ts') 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 @@ -import * as Promise from 'bluebird' -import * as Sequelize from 'sequelize' - -import { ResultList } from '../../../shared' -import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object' -import { VideoChannel as FormattedVideoChannel } from '../../../shared/models/videos/video-channel.model' -import { AccountInstance } from '../account/account-interface' -import { VideoInstance } from './video-interface' -import { VideoChannelShareInstance } from './video-channel-share-interface' - -export namespace VideoChannelMethods { - export type ToFormattedJSON = (this: VideoChannelInstance) => FormattedVideoChannel - export type ToActivityPubObject = (this: VideoChannelInstance) => VideoChannelObject - export type IsOwned = (this: VideoChannelInstance) => boolean - - export type CountByAccount = (accountId: number) => Promise - export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList > - export type LoadByIdAndAccount = (id: number, accountId: number) => Promise - export type ListByAccount = (accountId: number) => Promise< ResultList > - export type LoadAndPopulateAccount = (id: number) => Promise - export type LoadByUUIDAndPopulateAccount = (uuid: string) => Promise - export type LoadByUUID = (uuid: string, t?: Sequelize.Transaction) => Promise - export type LoadByHostAndUUID = (uuid: string, serverHost: string, t?: Sequelize.Transaction) => Promise - export type LoadAndPopulateAccountAndVideos = (id: number) => Promise - export type LoadByUrl = (uuid: string, t?: Sequelize.Transaction) => Promise - export type LoadByUUIDOrUrl = (uuid: string, url: string, t?: Sequelize.Transaction) => Promise -} - -export interface VideoChannelClass { - countByAccount: VideoChannelMethods.CountByAccount - listForApi: VideoChannelMethods.ListForApi - listByAccount: VideoChannelMethods.ListByAccount - loadByIdAndAccount: VideoChannelMethods.LoadByIdAndAccount - loadAndPopulateAccount: VideoChannelMethods.LoadAndPopulateAccount - loadByUUIDAndPopulateAccount: VideoChannelMethods.LoadByUUIDAndPopulateAccount - loadAndPopulateAccountAndVideos: VideoChannelMethods.LoadAndPopulateAccountAndVideos - loadByUrl: VideoChannelMethods.LoadByUrl - loadByUUIDOrUrl: VideoChannelMethods.LoadByUUIDOrUrl -} - -export interface VideoChannelAttributes { - id?: number - uuid?: string - name: string - description: string - remote: boolean - url?: string - - Account?: AccountInstance - Videos?: VideoInstance[] - VideoChannelShares?: VideoChannelShareInstance[] -} - -export interface VideoChannelInstance extends VideoChannelClass, VideoChannelAttributes, Sequelize.Instance { - id: number - createdAt: Date - updatedAt: Date - - isOwned: VideoChannelMethods.IsOwned - toFormattedJSON: VideoChannelMethods.ToFormattedJSON - toActivityPubObject: VideoChannelMethods.ToActivityPubObject -} - -export interface VideoChannelModel extends VideoChannelClass, Sequelize.Model {} -- cgit v1.2.3