- VideoChannelInstance,
- VideoChannelAttributes,
-
- VideoChannelMethods
-} from './video-channel-interface'
-
-let VideoChannel: Sequelize.Model<VideoChannelInstance, VideoChannelAttributes>
-let toFormattedJSON: VideoChannelMethods.ToFormattedJSON
-let toActivityPubObject: VideoChannelMethods.ToActivityPubObject
-let isOwned: VideoChannelMethods.IsOwned
-let countByAccount: VideoChannelMethods.CountByAccount
-let listOwned: VideoChannelMethods.ListOwned
-let listForApi: VideoChannelMethods.ListForApi
-let listByAccount: VideoChannelMethods.ListByAccount
-let loadByIdAndAccount: VideoChannelMethods.LoadByIdAndAccount
-let loadByUUID: VideoChannelMethods.LoadByUUID
-let loadAndPopulateAccount: VideoChannelMethods.LoadAndPopulateAccount
-let loadByUUIDAndPopulateAccount: VideoChannelMethods.LoadByUUIDAndPopulateAccount
-let loadByHostAndUUID: VideoChannelMethods.LoadByHostAndUUID
-let loadAndPopulateAccountAndVideos: VideoChannelMethods.LoadAndPopulateAccountAndVideos
-
-export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
- VideoChannel = sequelize.define<VideoChannelInstance, VideoChannelAttributes>('VideoChannel',
+ AllowNull, BeforeDestroy, BelongsTo, Column, CreatedAt, DefaultScope, ForeignKey, HasMany, Is, Model, Scopes, Table,
+ UpdatedAt, Default
+} from 'sequelize-typescript'
+import { ActivityPubActor } from '../../../shared/models/activitypub'
+import { VideoChannel } from '../../../shared/models/videos'
+import {
+ isVideoChannelDescriptionValid, isVideoChannelNameValid,
+ isVideoChannelSupportValid
+} from '../../helpers/custom-validators/video-channels'
+import { logger } from '../../helpers/logger'
+import { sendDeleteActor } from '../../lib/activitypub/send'
+import { AccountModel } from '../account/account'
+import { ActorModel } from '../activitypub/actor'
+import { getSort, throwIfNotValid } from '../utils'
+import { VideoModel } from './video'
+
+enum ScopeNames {
+ WITH_ACCOUNT = 'WITH_ACCOUNT',
+ WITH_ACTOR = 'WITH_ACTOR',
+ WITH_VIDEOS = 'WITH_VIDEOS'
+}
+
+@DefaultScope({
+ include: [