Split types and typings

pull/2884/head
Chocobozzz 2020-06-18 10:45:25 +02:00
parent d6d951ddc0
commit 26d6bf6533
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
175 changed files with 208 additions and 206 deletions

View File

@ -35,7 +35,7 @@ import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
import { VideoPlaylistModel } from '../../models/video/video-playlist'
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/typings/models'
import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/types/models'
import { getServerActor } from '@server/models/application/application'
import { getRateUrl } from '@server/lib/activitypub/video-rates'

View File

@ -6,7 +6,7 @@ import { processActivities } from '../../lib/activitypub/process/process'
import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares'
import { activityPubValidator } from '../../middlewares/validators/activitypub/activity'
import { queue } from 'async'
import { MActorDefault, MActorSignature } from '../../typings/models'
import { MActorDefault, MActorSignature } from '../../types/models'
const inboxRouter = express.Router()

View File

@ -8,7 +8,7 @@ import { buildAudience } from '../../lib/activitypub/audience'
import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } from '../../middlewares'
import { VideoModel } from '../../models/video/video'
import { activityPubResponse } from './utils'
import { MActorLight } from '@server/typings/models'
import { MActorLight } from '@server/types/models'
import { apPaginationValidator } from '../../middlewares/validators/activitypub'
const outboxRouter = express.Router()

View File

@ -28,7 +28,7 @@ import {
} from '../../middlewares'
import { VideoModel } from '../../models/video/video'
import { VideoChannelModel } from '../../models/video/video-channel'
import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../typings/models'
import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../types/models'
const searchRouter = express.Router()

View File

@ -47,7 +47,7 @@ import { CONFIG } from '../../../initializers/config'
import { sequelizeTypescript } from '../../../initializers/database'
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
import { UserRegister } from '../../../../shared/models/users/user-register.model'
import { MUser, MUserAccountDefault } from '@server/typings/models'
import { MUser, MUserAccountDefault } from '@server/types/models'
import { Hooks } from '@server/lib/plugins/hooks'
import { tokensRouter } from '@server/controllers/api/users/token'

View File

@ -35,7 +35,7 @@ import { VideoPlaylistModel } from '../../models/video/video-playlist'
import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
import { CONFIG } from '../../initializers/config'
import { sequelizeTypescript } from '../../initializers/database'
import { MChannelAccountDefault } from '@server/typings/models'
import { MChannelAccountDefault } from '@server/types/models'
import { getServerActor } from '@server/models/application/application'
const auditLogger = auditLoggerFactory('channels')

View File

@ -40,7 +40,7 @@ import { JobQueue } from '../../lib/job-queue'
import { CONFIG } from '../../initializers/config'
import { sequelizeTypescript } from '../../initializers/database'
import { createPlaylistMiniatureFromExisting } from '../../lib/thumbnail'
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/typings/models'
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models'
import { getServerActor } from '@server/models/application/application'
const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })

View File

@ -22,9 +22,9 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse'
import { auditLoggerFactory, VideoAbuseAuditView } from '../../../helpers/audit-logger'
import { Notifier } from '../../../lib/notifier'
import { sendVideoAbuse } from '../../../lib/activitypub/send/send-flag'
import { MVideoAbuseAccountVideo } from '../../../typings/models/video'
import { MVideoAbuseAccountVideo } from '../../../types/models/video'
import { getServerActor } from '@server/models/application/application'
import { MAccountDefault } from '@server/typings/models'
import { MAccountDefault } from '@server/types/models'
const auditLogger = auditLoggerFactory('abuse')
const abuseVideoRouter = express.Router()

View File

@ -10,7 +10,7 @@ import { federateVideoIfNeeded } from '../../../lib/activitypub/videos'
import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
import { CONFIG } from '../../../initializers/config'
import { sequelizeTypescript } from '../../../initializers/database'
import { MVideoCaptionVideo } from '@server/typings/models'
import { MVideoCaptionVideo } from '@server/types/models'
const reqVideoCaptionAdd = createReqFiles(
[ 'captionfile' ],

View File

@ -34,8 +34,8 @@ import {
MVideoTag,
MVideoThumbnailAccountDefault,
MVideoWithBlacklistLight
} from '@server/typings/models'
import { MVideoImport, MVideoImportFormattable } from '@server/typings/models/video/video-import'
} from '@server/types/models'
import { MVideoImport, MVideoImportFormattable } from '@server/types/models/video/video-import'
const auditLogger = auditLoggerFactory('video-imports')
const videoImportsRouter = express.Router()

View File

@ -58,7 +58,7 @@ import { sequelizeTypescript } from '../../../initializers/database'
import { createVideoMiniatureFromExisting, generateVideoMiniature } from '../../../lib/thumbnail'
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
import { Hooks } from '../../../lib/plugins/hooks'
import { MVideoDetails, MVideoFullLight } from '@server/typings/models'
import { MVideoDetails, MVideoFullLight } from '@server/types/models'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { getVideoFilePath } from '@server/lib/video-paths'
import toInt from 'validator/lib/toInt'

View File

@ -18,7 +18,7 @@ import { getFormattedObjects } from '../../../helpers/utils'
import { changeVideoChannelShare } from '../../../lib/activitypub/share'
import { sendUpdateVideo } from '../../../lib/activitypub/send'
import { VideoModel } from '../../../models/video/video'
import { MVideoFullLight } from '@server/typings/models'
import { MVideoFullLight } from '@server/types/models'
const ownershipVideoRouter = express.Router()

View File

@ -22,7 +22,7 @@ import { root } from '../helpers/core-utils'
import { CONFIG, isEmailEnabled } from '../initializers/config'
import { getPreview, getVideoCaption } from './lazy-static'
import { VideoStreamingPlaylistType } from '@shared/models/videos/video-streaming-playlist.type'
import { MVideoFile, MVideoFullLight } from '@server/typings/models'
import { MVideoFile, MVideoFullLight } from '@server/types/models'
import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths'
import { getThemeOrDefault } from '../lib/plugins/theme-utils'
import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'

View File

@ -6,7 +6,7 @@ import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants'
import { signJsonLDObject } from './peertube-crypto'
import { pageToStartAndCount } from './core-utils'
import { URL } from 'url'
import { MActor, MVideoAccountLight } from '../typings/models'
import { MActor, MVideoAccountLight } from '../types/models'
import { ContextType } from '@shared/models/activitypub/context'
function getContextData (type: ContextType) {

View File

@ -1,6 +1,6 @@
import { ActorModel } from '../models/activitypub/actor'
import * as Bluebird from 'bluebird'
import { MActorFull, MActorAccountChannelId } from '../typings/models'
import { MActorFull, MActorAccountChannelId } from '../types/models'
type ActorFetchByUrlType = 'all' | 'association-ids'

View File

@ -2,7 +2,7 @@ import { join } from 'path'
import { CONFIG } from '../initializers/config'
import * as srt2vtt from 'srt-to-vtt'
import { createReadStream, createWriteStream, move, remove } from 'fs-extra'
import { MVideoCaptionFormattable } from '@server/typings/models'
import { MVideoCaptionFormattable } from '@server/types/models'
async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) {
const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR

View File

@ -1,7 +1,7 @@
import { Response } from 'express'
import { VideoChangeOwnershipModel } from '../../models/video/video-change-ownership'
import { MVideoChangeOwnershipFull } from '@server/typings/models/video/video-change-ownership'
import { MUserId } from '@server/typings/models'
import { MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
import { MUserId } from '@server/types/models'
export async function doesChangeVideoOwnershipExist (idArg: number | string, res: Response) {
const id = parseInt(idArg + '', 10)

View File

@ -1,7 +1,7 @@
import { Response } from 'express'
import { AccountModel } from '../../models/account/account'
import * as Bluebird from 'bluebird'
import { MAccountDefault } from '../../typings/models'
import { MAccountDefault } from '../../types/models'
function doesAccountIdExist (id: number, res: Response, sendNotFound = true) {
const promise = AccountModel.load(id)

View File

@ -1,6 +1,6 @@
import { Response } from 'express'
import { VideoCaptionModel } from '../../models/video/video-caption'
import { MVideoId } from '@server/typings/models'
import { MVideoId } from '@server/types/models'
async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)

View File

@ -1,6 +1,6 @@
import * as express from 'express'
import { VideoChannelModel } from '../../models/video/video-channel'
import { MChannelAccountDefault } from '@server/typings/models'
import { MChannelAccountDefault } from '@server/types/models'
async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)

View File

@ -1,6 +1,6 @@
import * as express from 'express'
import { VideoPlaylistModel } from '../../models/video/video-playlist'
import { MVideoPlaylist } from '../../typings/models/video/video-playlist'
import { MVideoPlaylist } from '../../types/models/video/video-playlist'
export type VideoPlaylistFetchType = 'summary' | 'all'
async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: VideoPlaylistFetchType = 'summary') {

View File

@ -11,7 +11,7 @@ import {
MVideoImmutable,
MVideoThumbnail,
MVideoWithRights
} from '@server/typings/models'
} from '@server/types/models'
import { VideoFileModel } from '@server/models/video/video-file'
async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {

View File

@ -6,7 +6,7 @@ import { logger } from './logger'
import { cloneDeep } from 'lodash'
import { createSign, createVerify } from 'crypto'
import * as bcrypt from 'bcrypt'
import { MActor } from '../typings/models'
import { MActor } from '../types/models'
const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare)
const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt)

View File

@ -11,7 +11,7 @@ import {
MVideoImmutable,
MVideoThumbnail,
MVideoWithRights
} from '@server/typings/models'
} from '@server/types/models'
import { Response } from 'express'
import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants'
import { JobQueue } from '@server/lib/job-queue'

View File

@ -4,7 +4,7 @@ import { ActorModel } from '../models/activitypub/actor'
import { isTestInstance } from './core-utils'
import { isActivityPubUrlValid } from './custom-validators/activitypub/misc'
import { WEBSERVER } from '../initializers/constants'
import { MActorFull } from '../typings/models'
import { MActorFull } from '../types/models'
const webfinger = new WebFinger({
webfist_fallback: false,

View File

@ -6,9 +6,9 @@ import { CONFIG } from '../initializers/config'
import { dirname, join } from 'path'
import * as createTorrent from 'create-torrent'
import { promisify2 } from './core-utils'
import { MVideo } from '@server/typings/models/video/video'
import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/typings/models/video/video-file'
import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/typings/models/video/video-streaming-playlist'
import { MVideo } from '@server/types/models/video/video'
import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file'
import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist'
import { WEBSERVER } from '@server/initializers/constants'
import * as parseTorrent from 'parse-torrent'
import * as magnetUtil from 'magnet-uri'

View File

@ -33,7 +33,7 @@ import {
MActorFullActor,
MActorId,
MChannel
} from '../../typings/models'
} from '../../types/models'
import { extname } from 'path'
import { getServerActor } from '@server/models/application/application'

View File

@ -4,7 +4,7 @@ import { ACTIVITY_PUB } from '../../initializers/constants'
import { ActorModel } from '../../models/activitypub/actor'
import { VideoModel } from '../../models/video/video'
import { VideoShareModel } from '../../models/video/video-share'
import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../typings/models'
import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../types/models'
function getRemoteVideoAudience (accountActor: MActorUrl, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience {
return {

View File

@ -2,7 +2,7 @@ import { CacheFileObject } from '../../../shared/index'
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
import { Transaction } from 'sequelize'
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/typings/models'
import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models'
function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId) {

View File

@ -1,4 +1,4 @@
import { MActorFollowActors } from '../../typings/models'
import { MActorFollowActors } from '../../types/models'
import { CONFIG } from '../../initializers/config'
import { SERVER_ACTOR_NAME } from '../../initializers/constants'
import { JobQueue } from '../job-queue'

View File

@ -15,9 +15,9 @@ import { VideoPlaylistElementModel } from '../../models/video/video-playlist-ele
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
import { sequelizeTypescript } from '../../initializers/database'
import { createPlaylistMiniatureFromUrl } from '../thumbnail'
import { FilteredModelAttributes } from '../../typings/sequelize'
import { MAccountDefault, MAccountId, MVideoId } from '../../typings/models'
import { MVideoPlaylist, MVideoPlaylistId, MVideoPlaylistOwner } from '../../typings/models/video/video-playlist'
import { FilteredModelAttributes } from '../../types/sequelize'
import { MAccountDefault, MAccountId, MVideoId } from '../../types/models'
import { MVideoPlaylist, MVideoPlaylistId, MVideoPlaylistOwner } from '../../types/models/video/video-playlist'
function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) {
const privacy = to.includes(ACTIVITY_PUB.PUBLIC)

View File

@ -1,8 +1,8 @@
import { ActivityAccept } from '../../../../shared/models/activitypub'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { addFetchOutboxJob } from '../actor'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorDefault, MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorDefault, MActorSignature } from '../../../types/models'
async function processAcceptActivity (options: APProcessorOptions<ActivityAccept>) {
const { byActor: targetActor, inboxActor } = options

View File

@ -6,8 +6,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { Notifier } from '../../notifier'
import { logger } from '../../../helpers/logger'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature, MVideoAccountLightBlacklistAllFiles } from '../../../types/models'
async function processAnnounceActivity (options: APProcessorOptions<ActivityAnnounce>) {
const { activity, byActor: actorAnnouncer } = options

View File

@ -5,8 +5,8 @@ import { VideoCommentObject } from '../../../../shared/models/activitypub/object
import { retryTransactionWrapper } from '../../../helpers/database-utils'
import { logger } from '../../../helpers/logger'
import { sequelizeTypescript } from '../../../initializers/database'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../types/models'
import { Notifier } from '../../notifier'
import { createOrUpdateCacheFile } from '../cache-file'
import { createOrUpdateVideoPlaylist } from '../playlist'

View File

@ -8,8 +8,8 @@ import { VideoCommentModel } from '../../../models/video/video-comment'
import { markCommentAsDeleted } from '../../video-comment'
import { forwardVideoRelatedActivity } from '../send/utils'
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor } from '../../../types/models'
async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) {
const { activity, byActor } = options

View File

@ -6,8 +6,8 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { forwardVideoRelatedActivity } from '../send/utils'
import { getVideoDislikeActivityPubUrl } from '../url'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature } from '../../../types/models'
async function processDislikeActivity (options: APProcessorOptions<ActivityCreate | ActivityDislike>) {
const { activity, byActor } = options

View File

@ -7,8 +7,8 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse'
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { Notifier } from '../../notifier'
import { getAPId } from '../../../helpers/activitypub'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature, MVideoAbuseAccountVideo } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature, MVideoAbuseAccountVideo } from '../../../types/models'
import { AccountModel } from '@server/models/account/account'
async function processFlagActivity (options: APProcessorOptions<ActivityCreate | ActivityFlag>) {

View File

@ -8,8 +8,8 @@ import { sendAccept, sendReject } from '../send'
import { Notifier } from '../../notifier'
import { getAPId } from '../../../helpers/activitypub'
import { CONFIG } from '../../../initializers/config'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorFollowActors, MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorFollowActors, MActorSignature } from '../../../types/models'
import { autoFollowBackIfNeeded } from '../follow'
import { getServerActor } from '@server/models/application/application'

View File

@ -6,8 +6,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { getVideoLikeActivityPubUrl } from '../url'
import { getAPId } from '../../../helpers/activitypub'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature } from '../../../types/models'
async function processLikeActivity (options: APProcessorOptions<ActivityLike>) {
const { activity, byActor } = options

View File

@ -1,8 +1,8 @@
import { ActivityReject } from '../../../../shared/models/activitypub/activity'
import { sequelizeTypescript } from '../../../initializers/database'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActor } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActor } from '../../../types/models'
async function processRejectActivity (options: APProcessorOptions<ActivityReject>) {
const { byActor: targetActor, inboxActor } = options

View File

@ -10,8 +10,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { VideoShareModel } from '../../../models/video/video-share'
import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature } from '../../../types/models'
async function processUndoActivity (options: APProcessorOptions<ActivityUndo>) {
const { activity, byActor } = options

View File

@ -14,8 +14,8 @@ import { createOrUpdateCacheFile } from '../cache-file'
import { forwardVideoRelatedActivity } from '../send/utils'
import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
import { createOrUpdateVideoPlaylist } from '../playlist'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature, MAccountIdActor } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature, MAccountIdActor } from '../../../types/models'
import { isRedundancyAccepted } from '@server/lib/redundancy'
async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) {

View File

@ -2,8 +2,8 @@ import { getOrCreateVideoAndAccountAndChannel } from '../videos'
import { forwardVideoRelatedActivity } from '../send/utils'
import { Redis } from '../../redis'
import { ActivityCreate, ActivityView, ViewObject } from '../../../../shared/models/activitypub'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorSignature } from '../../../types/models'
async function processViewActivity (options: APProcessorOptions<ActivityCreate | ActivityView>) {
const { activity, byActor } = options

View File

@ -14,8 +14,8 @@ import { getOrCreateActorAndServerAndModel } from '../actor'
import { processDislikeActivity } from './process-dislike'
import { processFlagActivity } from './process-flag'
import { processViewActivity } from './process-view'
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
import { MActorDefault, MActorSignature } from '../../../typings/models'
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
import { MActorDefault, MActorSignature } from '../../../types/models'
const processActivity: { [ P in ActivityType ]: (options: APProcessorOptions<Activity>) => Promise<any> } = {
Create: processCreateActivity,

View File

@ -3,7 +3,7 @@ import { getActorFollowAcceptActivityPubUrl, getActorFollowActivityPubUrl } from
import { unicastTo } from './utils'
import { buildFollowActivity } from './send-follow'
import { logger } from '../../../helpers/logger'
import { MActor, MActorFollowActors } from '../../../typings/models'
import { MActor, MActorFollowActors } from '../../../types/models'
function sendAccept (actorFollow: MActorFollowActors) {
const follower = actorFollow.ActorFollower

View File

@ -3,8 +3,8 @@ import { ActivityAnnounce, ActivityAudience } from '../../../../shared/models/ac
import { broadcastToFollowers } from './utils'
import { audiencify, getActorsInvolvedInVideo, getAudience, getAudienceFromFollowersOf } from '../audience'
import { logger } from '../../../helpers/logger'
import { MActorLight, MVideo } from '../../../typings/models'
import { MVideoShare } from '../../../typings/models/video'
import { MActorLight, MVideo } from '../../../types/models'
import { MVideoShare } from '../../../types/models/video'
async function buildAnnounceWithVideoAudience (
byActor: MActorLight,

View File

@ -14,7 +14,7 @@ import {
MVideoPlaylistFull,
MVideoRedundancyFileVideo,
MVideoRedundancyStreamingPlaylistVideo
} from '../../../typings/models'
} from '../../../types/models'
import { getServerActor } from '@server/models/application/application'
import { ContextType } from '@shared/models/activitypub/context'

View File

@ -5,8 +5,8 @@ import { logger } from '../../../helpers/logger'
import { ActorModel } from '../../../models/activitypub/actor'
import { VideoCommentModel } from '../../../models/video/video-comment'
import { VideoShareModel } from '../../../models/video/video-share'
import { MActorUrl } from '../../../typings/models'
import { MCommentOwnerVideo, MVideoAccountLight, MVideoPlaylistFullSummary } from '../../../typings/models/video'
import { MActorUrl } from '../../../types/models'
import { MCommentOwnerVideo, MVideoAccountLight, MVideoPlaylistFullSummary } from '../../../types/models/video'
import { audiencify, getActorsInvolvedInVideo, getVideoCommentAudience } from '../audience'
import { getDeleteActivityPubUrl } from '../url'
import { broadcastToActors, broadcastToFollowers, sendVideoRelatedActivity, unicastTo } from './utils'

View File

@ -4,7 +4,7 @@ import { logger } from '../../../helpers/logger'
import { ActivityAudience, ActivityDislike } from '../../../../shared/models/activitypub'
import { sendVideoRelatedActivity } from './utils'
import { audiencify, getAudience } from '../audience'
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../typings/models'
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../types/models'
function sendDislike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
logger.info('Creating job to dislike %s.', video.url)

View File

@ -4,8 +4,8 @@ import { logger } from '../../../helpers/logger'
import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub'
import { audiencify, getAudience } from '../audience'
import { Transaction } from 'sequelize'
import { MActor, MVideoFullLight } from '../../../typings/models'
import { MVideoAbuseVideo } from '../../../typings/models/video'
import { MActor, MVideoFullLight } from '../../../types/models'
import { MVideoAbuseVideo } from '../../../types/models/video'
function sendVideoAbuse (byActor: MActor, videoAbuse: MVideoAbuseVideo, video: MVideoFullLight, t: Transaction) {
if (!video.VideoChannel.Account.Actor.serverId) return // Local user

View File

@ -3,7 +3,7 @@ import { getActorFollowActivityPubUrl } from '../url'
import { unicastTo } from './utils'
import { logger } from '../../../helpers/logger'
import { Transaction } from 'sequelize'
import { MActor, MActorFollowActors } from '../../../typings/models'
import { MActor, MActorFollowActors } from '../../../types/models'
function sendFollow (actorFollow: MActorFollowActors, t: Transaction) {
const me = actorFollow.ActorFollower

View File

@ -4,7 +4,7 @@ import { getVideoLikeActivityPubUrl } from '../url'
import { sendVideoRelatedActivity } from './utils'
import { audiencify, getAudience } from '../audience'
import { logger } from '../../../helpers/logger'
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../typings/models'
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../types/models'
function sendLike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
logger.info('Creating job to like %s.', video.url)

View File

@ -3,7 +3,7 @@ import { getActorFollowActivityPubUrl, getActorFollowRejectActivityPubUrl } from
import { unicastTo } from './utils'
import { buildFollowActivity } from './send-follow'
import { logger } from '../../../helpers/logger'
import { MActor } from '../../../typings/models'
import { MActor } from '../../../types/models'
function sendReject (follower: MActor, following: MActor) {
if (!follower.serverId) { // This should never happen

View File

@ -26,7 +26,7 @@ import {
MVideoAccountLight,
MVideoRedundancyVideo,
MVideoShare
} from '../../../typings/models'
} from '../../../types/models'
function sendUndoFollow (actorFollow: MActorFollowActors, t: Transaction) {
const me = actorFollow.ActorFollower

View File

@ -18,7 +18,7 @@ import {
MVideoAPWithoutCaption,
MVideoPlaylistFull,
MVideoRedundancyVideo
} from '../../../typings/models'
} from '../../../types/models'
import { getServerActor } from '@server/models/application/application'
async function sendUpdateVideo (videoArg: MVideoAPWithoutCaption, t: Transaction, overrodeByActor?: MActor) {

View File

@ -5,7 +5,7 @@ import { getVideoLikeActivityPubUrl } from '../url'
import { sendVideoRelatedActivity } from './utils'
import { audiencify, getAudience } from '../audience'
import { logger } from '../../../helpers/logger'
import { MActorAudience, MVideoImmutable, MVideoUrl } from '@server/typings/models'
import { MActorAudience, MVideoImmutable, MVideoUrl } from '@server/types/models'
async function sendView (byActor: ActorModel, video: MVideoImmutable, t: Transaction) {
logger.info('Creating job to send view of %s.', video.url)

View File

@ -6,7 +6,7 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { JobQueue } from '../../job-queue'
import { getActorsInvolvedInVideo, getAudienceFromFollowersOf, getRemoteVideoAudience } from '../audience'
import { afterCommitIfTransaction } from '../../../helpers/database-utils'
import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../typings/models'
import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../types/models'
import { getServerActor } from '@server/models/application/application'
import { ContextType } from '@shared/models/activitypub/context'

View File

@ -8,7 +8,7 @@ import { getOrCreateActorAndServerAndModel } from './actor'
import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models/video'
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../types/models/video'
import { getServerActor } from '@server/models/application/application'
async function shareVideoByServerAndChannel (video: MVideoAccountLight, t: Transaction) {

View File

@ -9,10 +9,10 @@ import {
MVideoId,
MVideoUrl,
MVideoUUID
} from '../../typings/models'
import { MVideoPlaylist, MVideoPlaylistUUID } from '../../typings/models/video/video-playlist'
import { MVideoFileVideoUUID } from '../../typings/models/video/video-file'
import { MStreamingPlaylist } from '../../typings/models/video/video-streaming-playlist'
} from '../../types/models'
import { MVideoPlaylist, MVideoPlaylistUUID } from '../../types/models/video/video-playlist'
import { MVideoFileVideoUUID } from '../../types/models/video/video-file'
import { MStreamingPlaylist } from '../../types/models/video/video-streaming-playlist'
function getVideoActivityPubUrl (video: MVideoUUID) {
return WEBSERVER.URL + '/videos/watch/' + video.uuid

View File

@ -7,7 +7,7 @@ import { getOrCreateActorAndServerAndModel } from './actor'
import { getOrCreateVideoAndAccountAndChannel } from './videos'
import * as Bluebird from 'bluebird'
import { checkUrlsSameHost } from '../../helpers/activitypub'
import { MCommentOwner, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../typings/models/video'
import { MCommentOwner, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../types/models/video'
type ResolveThreadParams = {
url: string

View File

@ -10,7 +10,7 @@ import { doRequest } from '../../helpers/requests'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url'
import { sendDislike } from './send/send-dislike'
import { MAccountActor, MActorUrl, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models'
import { MAccountActor, MActorUrl, MVideo, MVideoAccountLight, MVideoId } from '../../types/models'
async function createRates (ratesUrl: string[], video: MVideo, rate: VideoRateType) {
let rateCounts = 0

View File

@ -52,7 +52,7 @@ import { sequelizeTypescript } from '../../initializers/database'
import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '../thumbnail'
import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
import { join } from 'path'
import { FilteredModelAttributes } from '../../typings/sequelize'
import { FilteredModelAttributes } from '../../types/sequelize'
import { autoBlacklistVideoIfNeeded } from '../video-blacklist'
import { ActorFollowScoreCache } from '../files-cache'
import {
@ -71,8 +71,8 @@ import {
MVideoId,
MVideoImmutable,
MVideoThumbnail
} from '../../typings/models'
import { MThumbnail } from '../../typings/models/video/thumbnail'
} from '../../types/models'
import { MThumbnail } from '../../types/models/video/thumbnail'
import { maxBy, minBy } from 'lodash'
async function federateVideoIfNeeded (videoArg: MVideoAPWithoutCaption, isNewVideo: boolean, transaction?: sequelize.Transaction) {

View File

@ -11,7 +11,7 @@ import { sequelizeTypescript } from '../initializers/database'
import * as LRUCache from 'lru-cache'
import { queue } from 'async'
import { downloadImage } from '../helpers/requests'
import { MAccountDefault, MChannelDefault } from '../typings/models'
import { MAccountDefault, MChannelDefault } from '../types/models'
async function updateActorAvatarFile (
avatarPhysicalFile: Express.Multer.File,

View File

@ -1,6 +1,6 @@
import { sequelizeTypescript } from '@server/initializers/database'
import { getServerActor } from '@server/models/application/application'
import { MAccountBlocklist, MAccountId, MAccountServer, MServerBlocklist } from '@server/typings/models'
import { MAccountBlocklist, MAccountId, MAccountServer, MServerBlocklist } from '@server/types/models'
import { AccountBlocklistModel } from '../models/account/account-blocklist'
import { ServerBlocklistModel } from '../models/server/server-blocklist'

View File

@ -13,7 +13,7 @@ import { VideoChannelModel } from '../models/video/video-channel'
import * as Bluebird from 'bluebird'
import { CONFIG } from '../initializers/config'
import { logger } from '../helpers/logger'
import { MAccountActor, MChannelActor, MVideo } from '../typings/models'
import { MAccountActor, MChannelActor, MVideo } from '../types/models'
export class ClientHtml {

View File

@ -12,9 +12,9 @@ import {
MVideoAccountLight,
MVideoBlacklistLightVideo,
MVideoBlacklistVideo
} from '../typings/models/video'
import { MActorFollowActors, MActorFollowFull, MUser } from '../typings/models'
import { MVideoImport, MVideoImportVideo } from '@server/typings/models/video/video-import'
} from '../types/models/video'
import { MActorFollowActors, MActorFollowFull, MUser } from '../types/models'
import { MVideoImport, MVideoImportVideo } from '@server/types/models/video/video-import'
import { EmailPayload } from '@shared/models'
import { join } from 'path'
import { VideoAbuse } from '../../shared/models/videos'

View File

@ -11,7 +11,7 @@ import { flatten, uniq } from 'lodash'
import { VideoFileModel } from '../models/video/video-file'
import { CONFIG } from '../initializers/config'
import { sequelizeTypescript } from '../initializers/database'
import { MVideoWithFile } from '@server/typings/models'
import { MVideoWithFile } from '@server/types/models'
import { getVideoFilename, getVideoFilePath } from './video-paths'
async function updateStreamingPlaylistsInfohashesIfNeeded () {

View File

@ -10,7 +10,7 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { ActorModel } from '../../../models/activitypub/actor'
import { Notifier } from '../../notifier'
import { sequelizeTypescript } from '../../../initializers/database'
import { MActor, MActorFollowActors, MActorFull } from '../../../typings/models'
import { MActor, MActorFollowActors, MActorFull } from '../../../types/models'
import { ActivitypubFollowPayload } from '@shared/models'
async function processActivityPubFollow (job: Bull.Job) {

View File

@ -12,7 +12,7 @@ import { AccountModel } from '../../../models/account/account'
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
import { VideoShareModel } from '../../../models/video/video-share'
import { VideoCommentModel } from '../../../models/video/video-comment'
import { MAccountDefault, MVideoFullLight } from '../../../typings/models'
import { MAccountDefault, MVideoFullLight } from '../../../types/models'
import { ActivitypubHttpFetcherPayload, FetchType } from '@shared/models'
async function processActivityPubHttpFetcher (job: Bull.Job) {

View File

@ -1,7 +1,7 @@
import { buildSignedActivity } from '../../../../helpers/activitypub'
import { ActorModel } from '../../../../models/activitypub/actor'
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '../../../../initializers/constants'
import { MActor } from '../../../../typings/models'
import { MActor } from '../../../../types/models'
import { getServerActor } from '@server/models/application/application'
import { buildDigest } from '@server/helpers/peertube-crypto'
import { ContextType } from '@shared/models/activitypub/context'

View File

@ -6,7 +6,7 @@ import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg
import { copy, stat } from 'fs-extra'
import { VideoFileModel } from '../../../models/video/video-file'
import { extname } from 'path'
import { MVideoFile, MVideoWithFile } from '@server/typings/models'
import { MVideoFile, MVideoWithFile } from '@server/types/models'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { getVideoFilePath } from '@server/lib/video-paths'
import { VideoFileImportPayload } from '@shared/models'

View File

@ -5,7 +5,7 @@ import { addOptimizeOrMergeAudioJob } from '@server/helpers/video'
import { isPostImportVideoAccepted } from '@server/lib/moderation'
import { Hooks } from '@server/lib/plugins/hooks'
import { getVideoFilePath } from '@server/lib/video-paths'
import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/typings/models/video/video-import'
import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import'
import {
VideoImportPayload,
VideoImportTorrentPayload,
@ -27,7 +27,7 @@ import { sequelizeTypescript } from '../../../initializers/database'
import { VideoModel } from '../../../models/video/video'
import { VideoFileModel } from '../../../models/video/video-file'
import { VideoImportModel } from '../../../models/video/video-import'
import { MThumbnail } from '../../../typings/models/video/thumbnail'
import { MThumbnail } from '../../../types/models/video/thumbnail'
import { federateVideoIfNeeded } from '../../activitypub/videos'
import { Notifier } from '../../notifier'
import { generateVideoMiniature } from '../../thumbnail'

View File

@ -15,7 +15,7 @@ import { computeResolutionsToTranscode } from '../../../helpers/ffmpeg-utils'
import { generateHlsPlaylist, mergeAudioVideofile, optimizeOriginalVideofile, transcodeNewResolution } from '../../video-transcoding'
import { Notifier } from '../../notifier'
import { CONFIG } from '../../../initializers/config'
import { MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/typings/models'
import { MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models'
async function processVideoTranscoding (job: Bull.Job) {
const payload = job.data as VideoTranscodingPayload

View File

@ -9,7 +9,7 @@ import { ActorModel } from '../models/activitypub/actor'
import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object'
import { VideoFileModel } from '@server/models/video/video-file'
import { PathLike } from 'fs-extra'
import { MUser } from '@server/typings/models'
import { MUser } from '@server/types/models'
export type AcceptResult = {
accepted: boolean

View File

@ -7,8 +7,8 @@ import {
MUserNotifSettingAccount,
MUserWithNotificationSetting,
UserNotificationModelForApi
} from '@server/typings/models/user'
import { MVideoImportVideo } from '@server/typings/models/video/video-import'
} from '@server/types/models/user'
import { MVideoImportVideo } from '@server/types/models/video/video-import'
import { UserNotificationSettingValue, UserNotificationType, UserRight } from '../../shared/models/users'
import { VideoAbuse, VideoPrivacy, VideoState } from '../../shared/models/videos'
import { logger } from '../helpers/logger'
@ -16,7 +16,7 @@ import { CONFIG } from '../initializers/config'
import { AccountBlocklistModel } from '../models/account/account-blocklist'
import { UserModel } from '../models/account/user'
import { UserNotificationModel } from '../models/account/user-notification'
import { MAccountServer, MActorFollowFull } from '../typings/models'
import { MAccountServer, MActorFollowFull } from '../types/models'
import {
MCommentOwnerVideo,
MVideoAbuseVideo,
@ -24,7 +24,7 @@ import {
MVideoBlacklistLightVideo,
MVideoBlacklistVideo,
MVideoFullLight
} from '../typings/models/video'
} from '../types/models/video'
import { isBlockedByServerOrAccount } from './blocklist'
import { Emailer } from './emailer'
import { PeerTubeSocket } from './peertube-socket'

View File

@ -8,8 +8,8 @@ import { LRU_CACHE } from '../initializers/constants'
import { Transaction } from 'sequelize'
import { CONFIG } from '../initializers/config'
import * as LRUCache from 'lru-cache'
import { MOAuthTokenUser } from '@server/typings/models/oauth/oauth-token'
import { MUser } from '@server/typings/models/user/user'
import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
import { MUser } from '@server/types/models/user/user'
import { UserAdminFlag } from '@shared/models/users/user-flag.model'
import { createUserAccountAndChannelAndPlaylist } from './user'
import { UserRole } from '@shared/models/users/user-role'

View File

@ -2,7 +2,7 @@ import * as SocketIO from 'socket.io'
import { authenticateSocket } from '../middlewares'
import { logger } from '../helpers/logger'
import { Server } from 'http'
import { UserNotificationModelForApi } from '@server/typings/models/user'
import { UserNotificationModelForApi } from '@server/types/models/user'
class PeerTubeSocket {

View File

@ -21,7 +21,7 @@ import { ClientHtml } from '../client-html'
import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model'
import { RegisterHelpersStore } from './register-helpers-store'
import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model'
import { MOAuthTokenUser, MUser } from '@server/typings/models'
import { MOAuthTokenUser, MUser } from '@server/types/models'
import { RegisterServerAuthPassOptions, RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
export interface RegisteredPlugin {

View File

@ -1,7 +1,7 @@
import { VideoRedundancyModel } from '../models/redundancy/video-redundancy'
import { sendUndoCacheFile } from './activitypub/send'
import { Transaction } from 'sequelize'
import { MActorSignature, MVideoRedundancyVideo } from '@server/typings/models'
import { MActorSignature, MVideoRedundancyVideo } from '@server/types/models'
import { CONFIG } from '@server/initializers/config'
import { logger } from '@server/helpers/logger'
import { ActorFollowModel } from '@server/models/activitypub/actor-follow'

View File

@ -6,7 +6,7 @@ import { federateVideoIfNeeded } from '../activitypub/videos'
import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants'
import { Notifier } from '../notifier'
import { sequelizeTypescript } from '../../initializers/database'
import { MVideoFullLight } from '@server/typings/models'
import { MVideoFullLight } from '@server/types/models'
export class UpdateVideosScheduler extends AbstractScheduler {

View File

@ -22,7 +22,7 @@ import {
MVideoRedundancyStreamingPlaylistVideo,
MVideoRedundancyVideo,
MVideoWithAllFiles
} from '@server/typings/models'
} from '@server/types/models'
import { getVideoFilename } from '../video-paths'
import { VideoModel } from '@server/models/video/video'
import { getServerActor } from '@server/models/application/application'

View File

@ -6,9 +6,9 @@ import { ThumbnailType } from '../../shared/models/videos/thumbnail.type'
import { processImage } from '../helpers/image-utils'
import { join } from 'path'
import { downloadImage } from '../helpers/requests'
import { MVideoPlaylistThumbnail } from '../typings/models/video/video-playlist'
import { MVideoFile, MVideoThumbnail } from '../typings/models'
import { MThumbnail } from '../typings/models/video/thumbnail'
import { MVideoPlaylistThumbnail } from '../types/models/video/video-playlist'
import { MVideoFile, MVideoThumbnail } from '../types/models'
import { MThumbnail } from '../types/models/video/thumbnail'
import { getVideoFilePath } from './video-paths'
type ImageSize = { height: number, width: number }

View File

@ -12,8 +12,8 @@ import { sequelizeTypescript } from '../initializers/database'
import { Transaction } from 'sequelize/types'
import { Redis } from './redis'
import { Emailer } from './emailer'
import { MAccountDefault, MActorDefault, MChannelActor } from '../typings/models'
import { MUser, MUserDefault, MUserId } from '../typings/models/user'
import { MAccountDefault, MActorDefault, MChannelActor } from '../types/models'
import { MUser, MUserDefault, MUserId } from '../types/models/user'
import { getAccountActivityPubUrl } from './activitypub/url'
type ChannelNames = { name: string, displayName: string }

View File

@ -7,7 +7,7 @@ import {
MVideoBlacklistVideo,
MVideoFullLight,
MVideoWithBlacklistLight
} from '@server/typings/models'
} from '@server/types/models'
import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models'
import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
import { logger } from '../helpers/logger'

View File

@ -4,7 +4,7 @@ import { VideoChannelCreate } from '../../shared/models'
import { VideoChannelModel } from '../models/video/video-channel'
import { buildActorInstance } from './activitypub/actor'
import { VideoModel } from '../models/video/video'
import { MAccountId, MChannelDefault, MChannelId } from '../typings/models'
import { MAccountId, MChannelDefault, MChannelId } from '../types/models'
import { getVideoChannelActivityPubUrl } from './activitypub/url'
import { federateVideoIfNeeded } from './activitypub/videos'

View File

@ -5,7 +5,7 @@ import { sequelizeTypescript } from '@server/initializers/database'
import { ResultList } from '../../shared/models'
import { VideoCommentThreadTree } from '../../shared/models/videos/video-comment.model'
import { VideoCommentModel } from '../models/video/video-comment'
import { MAccountDefault, MComment, MCommentOwnerVideoReply, MVideoFullLight, MCommentOwnerVideo } from '../typings/models'
import { MAccountDefault, MComment, MCommentOwnerVideoReply, MVideoFullLight, MCommentOwnerVideo } from '../types/models'
import { sendCreateVideoComment, sendDeleteVideoComment } from './activitypub/send'
import { getVideoCommentActivityPubUrl } from './activitypub/url'
import { Hooks } from './plugins/hooks'

View File

@ -1,4 +1,4 @@
import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/typings/models'
import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
import { join } from 'path'
import { CONFIG } from '@server/initializers/config'
import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'

View File

@ -3,8 +3,8 @@ import { VideoPlaylistModel } from '../models/video/video-playlist'
import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
import { getVideoPlaylistActivityPubUrl } from './activitypub/url'
import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
import { MAccount } from '../typings/models'
import { MVideoPlaylistOwner } from '../typings/models/video/video-playlist'
import { MAccount } from '../types/models'
import { MVideoPlaylistOwner } from '../types/models/video/video-playlist'
async function createWatchLaterPlaylist (account: MAccount, t: Sequelize.Transaction) {
const videoPlaylist: MVideoPlaylistOwner = new VideoPlaylistModel({

View File

@ -17,7 +17,7 @@ import { updateMasterHLSPlaylist, updateSha256Segments } from './hls'
import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
import { CONFIG } from '../initializers/config'
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/typings/models'
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths'

View File

@ -9,7 +9,7 @@ import { areValidationErrors } from './utils'
import { ActorModel } from '../../models/activitypub/actor'
import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger'
import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
import { MActorFollowActorsDefault } from '@server/typings/models'
import { MActorFollowActorsDefault } from '@server/types/models'
import { isFollowStateValid } from '@server/helpers/custom-validators/follows'
import { getServerActor } from '@server/models/application/application'

View File

@ -35,7 +35,7 @@ import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
import { doesVideoExist } from '../../helpers/middlewares'
import { UserRole } from '../../../shared/models/users'
import { MUserDefault } from '@server/typings/models'
import { MUserDefault } from '@server/types/models'
import { Hooks } from '@server/lib/plugins/hooks'
const usersAddValidator = [

View File

@ -1,7 +1,7 @@
import * as express from 'express'
import { body, param, query } from 'express-validator'
import { VIDEO_CHANNELS } from '@server/initializers/constants'
import { MChannelAccountDefault, MUser } from '@server/typings/models'
import { MChannelAccountDefault, MUser } from '@server/types/models'
import { UserRight } from '../../../../shared'
import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
import { isBooleanValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc'

View File

@ -1,6 +1,6 @@
import * as express from 'express'
import { body, param } from 'express-validator'
import { MUserAccountUrl } from '@server/typings/models'
import { MUserAccountUrl } from '@server/types/models'
import { UserRight } from '../../../../shared'
import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc'
import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments'
@ -9,7 +9,7 @@ import { doesVideoExist } from '../../../helpers/middlewares'
import { AcceptResult, isLocalVideoCommentReplyAccepted, isLocalVideoThreadAccepted } from '../../../lib/moderation'
import { Hooks } from '../../../lib/plugins/hooks'
import { VideoCommentModel } from '../../../models/video/video-comment'
import { MCommentOwnerVideoReply, MVideo, MVideoFullLight, MVideoId } from '../../../typings/models/video'
import { MCommentOwnerVideoReply, MVideo, MVideoFullLight, MVideoId } from '../../../types/models/video'
import { areValidationErrors } from '../utils'
const listVideoCommentThreadsValidator = [

View File

@ -27,8 +27,8 @@ import { authenticatePromiseIfNeeded } from '../../oauth'
import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
import { doesVideoChannelIdExist, doesVideoExist, doesVideoPlaylistExist, VideoPlaylistFetchType } from '../../../helpers/middlewares'
import { MVideoPlaylist } from '../../../typings/models/video/video-playlist'
import { MUserAccountId } from '@server/typings/models'
import { MVideoPlaylist } from '../../../types/models/video/video-playlist'
import { MUserAccountId } from '@server/types/models'
const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([
body('displayName')

View File

@ -47,7 +47,7 @@ import {
doesVideoExist,
doesVideoFileOfVideoExist
} from '../../../helpers/middlewares'
import { MVideoFullLight } from '@server/typings/models'
import { MVideoFullLight } from '@server/types/models'
import { getVideoWithAttributes } from '../../../helpers/video'
import { getServerActor } from '@server/models/application/application'

View File

@ -4,7 +4,7 @@ import { getSort, searchAttribute } from '../utils'
import { AccountBlock } from '../../../shared/models/blocklist'
import { Op } from 'sequelize'
import * as Bluebird from 'bluebird'
import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/typings/models'
import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models'
import { ActorModel } from '../activitypub/actor'
import { ServerModel } from '../server/server'

View File

@ -16,7 +16,7 @@ import {
MAccountVideoRateAccountUrl,
MAccountVideoRateAccountVideo,
MAccountVideoRateFormattable
} from '@server/typings/models/video/video-rate'
} from '@server/types/models/video/video-rate'
/*
Account rates per video.

View File

@ -32,7 +32,7 @@ import { FindOptions, IncludeOptions, Op, Transaction, WhereOptions } from 'sequ
import { AccountBlocklistModel } from './account-blocklist'
import { ServerBlocklistModel } from '../server/server-blocklist'
import { ActorFollowModel } from '../activitypub/actor-follow'
import { MAccountActor, MAccountAP, MAccountDefault, MAccountFormattable, MAccountSummaryFormattable, MAccount } from '../../typings/models'
import { MAccountActor, MAccountAP, MAccountDefault, MAccountFormattable, MAccountSummaryFormattable, MAccount } from '../../types/models'
import * as Bluebird from 'bluebird'
import { ModelCache } from '@server/models/model-cache'
import { VideoModel } from '../video/video'

View File

@ -17,7 +17,7 @@ import { UserModel } from './user'
import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
import { clearCacheByUserId } from '../../lib/oauth-model'
import { MNotificationSettingFormattable } from '@server/typings/models'
import { MNotificationSettingFormattable } from '@server/types/models'
@Table({
tableName: 'userNotificationSetting',

View File

@ -16,7 +16,7 @@ import { ActorModel } from '../activitypub/actor'
import { ActorFollowModel } from '../activitypub/actor-follow'
import { AvatarModel } from '../avatar/avatar'
import { ServerModel } from '../server/server'
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/typings/models/user'
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'
enum ScopeNames {
WITH_ALL = 'WITH_ALL'

Some files were not shown because too many files have changed in this diff Show More