From 26d6bf6533023326fa017812cf31bbe20c752d36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Jun 2020 10:45:25 +0200 Subject: [PATCH] Split types and typings --- server/controllers/activitypub/client.ts | 2 +- server/controllers/activitypub/inbox.ts | 2 +- server/controllers/activitypub/outbox.ts | 2 +- server/controllers/api/search.ts | 2 +- server/controllers/api/users/index.ts | 2 +- server/controllers/api/video-channel.ts | 2 +- server/controllers/api/video-playlist.ts | 2 +- server/controllers/api/videos/abuse.ts | 4 ++-- server/controllers/api/videos/captions.ts | 2 +- server/controllers/api/videos/import.ts | 4 ++-- server/controllers/api/videos/index.ts | 2 +- server/controllers/api/videos/ownership.ts | 2 +- server/controllers/static.ts | 2 +- server/helpers/activitypub.ts | 2 +- server/helpers/actor.ts | 2 +- server/helpers/captions-utils.ts | 2 +- .../custom-validators/video-ownership.ts | 4 ++-- server/helpers/middlewares/accounts.ts | 2 +- server/helpers/middlewares/video-captions.ts | 2 +- server/helpers/middlewares/video-channels.ts | 2 +- server/helpers/middlewares/video-playlists.ts | 2 +- server/helpers/middlewares/videos.ts | 2 +- server/helpers/peertube-crypto.ts | 2 +- server/helpers/video.ts | 2 +- server/helpers/webfinger.ts | 2 +- server/helpers/webtorrent.ts | 6 ++--- server/lib/activitypub/actor.ts | 2 +- server/lib/activitypub/audience.ts | 2 +- server/lib/activitypub/cache-file.ts | 2 +- server/lib/activitypub/follow.ts | 2 +- server/lib/activitypub/playlist.ts | 6 ++--- .../lib/activitypub/process/process-accept.ts | 4 ++-- .../activitypub/process/process-announce.ts | 4 ++-- .../lib/activitypub/process/process-create.ts | 4 ++-- .../lib/activitypub/process/process-delete.ts | 4 ++-- .../activitypub/process/process-dislike.ts | 4 ++-- .../lib/activitypub/process/process-flag.ts | 4 ++-- .../lib/activitypub/process/process-follow.ts | 4 ++-- .../lib/activitypub/process/process-like.ts | 4 ++-- .../lib/activitypub/process/process-reject.ts | 4 ++-- .../lib/activitypub/process/process-undo.ts | 4 ++-- .../lib/activitypub/process/process-update.ts | 4 ++-- .../lib/activitypub/process/process-view.ts | 4 ++-- server/lib/activitypub/process/process.ts | 4 ++-- server/lib/activitypub/send/send-accept.ts | 2 +- server/lib/activitypub/send/send-announce.ts | 4 ++-- server/lib/activitypub/send/send-create.ts | 2 +- server/lib/activitypub/send/send-delete.ts | 4 ++-- server/lib/activitypub/send/send-dislike.ts | 2 +- server/lib/activitypub/send/send-flag.ts | 4 ++-- server/lib/activitypub/send/send-follow.ts | 2 +- server/lib/activitypub/send/send-like.ts | 2 +- server/lib/activitypub/send/send-reject.ts | 2 +- server/lib/activitypub/send/send-undo.ts | 2 +- server/lib/activitypub/send/send-update.ts | 2 +- server/lib/activitypub/send/send-view.ts | 2 +- server/lib/activitypub/send/utils.ts | 2 +- server/lib/activitypub/share.ts | 2 +- server/lib/activitypub/url.ts | 8 +++---- server/lib/activitypub/video-comments.ts | 2 +- server/lib/activitypub/video-rates.ts | 2 +- server/lib/activitypub/videos.ts | 6 ++--- server/lib/avatar.ts | 2 +- server/lib/blocklist.ts | 2 +- server/lib/client-html.ts | 2 +- server/lib/emailer.ts | 6 ++--- server/lib/hls.ts | 2 +- .../job-queue/handlers/activitypub-follow.ts | 2 +- .../handlers/activitypub-http-fetcher.ts | 2 +- .../handlers/utils/activitypub-http-utils.ts | 2 +- .../job-queue/handlers/video-file-import.ts | 2 +- server/lib/job-queue/handlers/video-import.ts | 4 ++-- .../job-queue/handlers/video-transcoding.ts | 2 +- server/lib/moderation.ts | 2 +- server/lib/notifier.ts | 8 +++---- server/lib/oauth-model.ts | 4 ++-- server/lib/peertube-socket.ts | 2 +- server/lib/plugins/plugin-manager.ts | 2 +- server/lib/redundancy.ts | 2 +- .../lib/schedulers/update-videos-scheduler.ts | 2 +- .../schedulers/videos-redundancy-scheduler.ts | 2 +- server/lib/thumbnail.ts | 6 ++--- server/lib/user.ts | 4 ++-- server/lib/video-blacklist.ts | 2 +- server/lib/video-channel.ts | 2 +- server/lib/video-comment.ts | 2 +- server/lib/video-paths.ts | 2 +- server/lib/video-playlist.ts | 4 ++-- server/lib/video-transcoding.ts | 2 +- server/middlewares/validators/follows.ts | 2 +- server/middlewares/validators/users.ts | 2 +- .../validators/videos/video-channels.ts | 2 +- .../validators/videos/video-comments.ts | 4 ++-- .../validators/videos/video-playlists.ts | 4 ++-- .../middlewares/validators/videos/videos.ts | 2 +- server/models/account/account-blocklist.ts | 2 +- server/models/account/account-video-rate.ts | 2 +- server/models/account/account.ts | 2 +- .../account/user-notification-setting.ts | 2 +- server/models/account/user-notification.ts | 2 +- server/models/account/user-video-history.ts | 2 +- server/models/account/user.ts | 2 +- server/models/activitypub/actor-follow.ts | 2 +- server/models/activitypub/actor.ts | 2 +- server/models/avatar/avatar.ts | 2 +- server/models/oauth/oauth-token.ts | 2 +- server/models/redundancy/video-redundancy.ts | 2 +- server/models/server/plugin.ts | 2 +- server/models/server/server-blocklist.ts | 2 +- server/models/server/server.ts | 2 +- server/models/video/schedule-video-update.ts | 2 +- server/models/video/tag.ts | 2 +- server/models/video/thumbnail.ts | 2 +- server/models/video/video-abuse.ts | 2 +- server/models/video/video-blacklist.ts | 2 +- server/models/video/video-caption.ts | 2 +- server/models/video/video-change-ownership.ts | 2 +- server/models/video/video-channel.ts | 2 +- server/models/video/video-comment.ts | 4 ++-- server/models/video/video-file.ts | 4 ++-- server/models/video/video-format-utils.ts | 4 ++-- server/models/video/video-import.ts | 2 +- server/models/video/video-playlist-element.ts | 4 ++-- server/models/video/video-playlist.ts | 6 ++--- server/models/video/video-query-builder.ts | 2 +- server/models/video/video-share.ts | 4 ++-- .../models/video/video-streaming-playlist.ts | 2 +- server/models/video/video.ts | 6 ++--- server/tools/tsconfig.json | 1 + .../activitypub-processor.model.ts | 0 .../models/account/account-blocklist.ts | 0 .../models/account/account.ts | 0 .../models/account/actor-follow.ts | 0 .../models/account/actor.ts | 0 .../models/account/avatar.ts | 2 +- .../models/account/index.ts | 0 server/{typings => types}/models/index.ts | 0 .../{typings => types}/models/oauth/index.ts | 0 .../models/oauth/oauth-client.ts | 0 .../models/oauth/oauth-token.ts | 2 +- .../{typings => types}/models/server/index.ts | 0 .../models/server/plugin.ts | 0 .../models/server/server-blocklist.ts | 2 +- .../models/server/server.ts | 0 .../{typings => types}/models/user/index.ts | 0 .../models/user/user-notification-setting.ts | 0 .../models/user/user-notification.ts | 0 .../models/user/user-video-history.ts | 0 server/{typings => types}/models/user/user.ts | 2 +- .../{typings => types}/models/video/index.ts | 0 .../models/video/schedule-video-update.ts | 2 +- server/{typings => types}/models/video/tag.ts | 0 .../models/video/thumbnail.ts | 0 .../models/video/video-abuse.ts | 0 .../models/video/video-blacklist.ts | 2 +- .../models/video/video-caption.ts | 2 +- .../models/video/video-change-ownership.ts | 2 +- .../models/video/video-channels.ts | 0 .../models/video/video-comment.ts | 0 .../models/video/video-file.ts | 0 .../models/video/video-import.ts | 2 +- .../models/video/video-playlist-element.ts | 2 +- .../models/video/video-playlist.ts | 2 +- .../models/video/video-rate.ts | 2 +- .../models/video/video-redundancy.ts | 2 +- .../models/video/video-share.ts | 0 .../models/video/video-streaming-playlist.ts | 0 .../{typings => types}/models/video/video.ts | 0 server/{typings => types}/sequelize.ts | 0 server/{typings => types}/utils.ts | 0 server/typings/{express.ts => express.d.ts} | 22 +++++++++---------- .../plugins/register-server-option.model.ts | 2 +- shared/extra-utils/server/config.ts | 2 +- .../plugins/register-server-auth.model.ts | 2 +- tsconfig.json | 3 ++- 175 files changed, 208 insertions(+), 206 deletions(-) rename server/{typings => types}/activitypub-processor.model.ts (100%) rename server/{typings => types}/models/account/account-blocklist.ts (100%) rename server/{typings => types}/models/account/account.ts (100%) rename server/{typings => types}/models/account/actor-follow.ts (100%) rename server/{typings => types}/models/account/actor.ts (100%) rename server/{typings => types}/models/account/avatar.ts (84%) rename server/{typings => types}/models/account/index.ts (100%) rename server/{typings => types}/models/index.ts (100%) rename server/{typings => types}/models/oauth/index.ts (100%) rename server/{typings => types}/models/oauth/oauth-client.ts (100%) rename server/{typings => types}/models/oauth/oauth-token.ts (90%) rename server/{typings => types}/models/server/index.ts (100%) rename server/{typings => types}/models/server/plugin.ts (100%) rename server/{typings => types}/models/server/server-blocklist.ts (95%) rename server/{typings => types}/models/server/server.ts (100%) rename server/{typings => types}/models/user/index.ts (100%) rename server/{typings => types}/models/user/user-notification-setting.ts (100%) rename server/{typings => types}/models/user/user-notification.ts (100%) rename server/{typings => types}/models/user/user-video-history.ts (100%) rename server/{typings => types}/models/user/user.ts (97%) rename server/{typings => types}/models/video/index.ts (100%) rename server/{typings => types}/models/video/schedule-video-update.ts (93%) rename server/{typings => types}/models/video/tag.ts (100%) rename server/{typings => types}/models/video/thumbnail.ts (100%) rename server/{typings => types}/models/video/video-abuse.ts (100%) rename server/{typings => types}/models/video/video-blacklist.ts (95%) rename server/{typings => types}/models/video/video-caption.ts (93%) rename server/{typings => types}/models/video/video-change-ownership.ts (95%) rename server/{typings => types}/models/video/video-channels.ts (100%) rename server/{typings => types}/models/video/video-comment.ts (100%) rename server/{typings => types}/models/video/video-file.ts (100%) rename server/{typings => types}/models/video/video-import.ts (94%) rename server/{typings => types}/models/video/video-playlist-element.ts (96%) rename server/{typings => types}/models/video/video-playlist.ts (97%) rename server/{typings => types}/models/video/video-rate.ts (94%) rename server/{typings => types}/models/video/video-redundancy.ts (96%) rename server/{typings => types}/models/video/video-share.ts (100%) rename server/{typings => types}/models/video/video-streaming-playlist.ts (100%) rename server/{typings => types}/models/video/video.ts (100%) rename server/{typings => types}/sequelize.ts (100%) rename server/{typings => types}/utils.ts (100%) rename server/typings/{express.ts => express.d.ts} (80%) diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index e48641836..acce53713 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts @@ -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' diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index c5edf86b7..8b42478ee 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -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() diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index 916a110a8..22328da7f 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts @@ -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() diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index a0da5e30c..2d98b5d34 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts @@ -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() diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 06a43d7a3..c8e9eaeaa 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -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' diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index d779f1aab..4d8cfa340 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts @@ -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') diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 375d711fd..88a2314fb 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts @@ -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 }) diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index 2af7b3864..77843f149 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts @@ -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() diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts index 8c1d12ca8..c4e2ee72c 100644 --- a/server/controllers/api/videos/captions.ts +++ b/server/controllers/api/videos/captions.ts @@ -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' ], diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index ec270148d..24a237304 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -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() diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 3ca5a9192..45c613c75 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -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' diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts index 540a49010..d76fee51d 100644 --- a/server/controllers/api/videos/ownership.ts +++ b/server/controllers/api/videos/ownership.ts @@ -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() diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 271b788f6..3f7bbdbae 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -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' diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index ce48fc543..d28453d79 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -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) { diff --git a/server/helpers/actor.ts b/server/helpers/actor.ts index 117548a60..015b4a39f 100644 --- a/server/helpers/actor.ts +++ b/server/helpers/actor.ts @@ -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' diff --git a/server/helpers/captions-utils.ts b/server/helpers/captions-utils.ts index 73b6d166d..0dad23759 100644 --- a/server/helpers/captions-utils.ts +++ b/server/helpers/captions-utils.ts @@ -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 diff --git a/server/helpers/custom-validators/video-ownership.ts b/server/helpers/custom-validators/video-ownership.ts index 2d1849332..ed5f8cc2f 100644 --- a/server/helpers/custom-validators/video-ownership.ts +++ b/server/helpers/custom-validators/video-ownership.ts @@ -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) diff --git a/server/helpers/middlewares/accounts.ts b/server/helpers/middlewares/accounts.ts index f5aa0bada..bddea7eaa 100644 --- a/server/helpers/middlewares/accounts.ts +++ b/server/helpers/middlewares/accounts.ts @@ -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) diff --git a/server/helpers/middlewares/video-captions.ts b/server/helpers/middlewares/video-captions.ts index 1b2513b60..f5ce29807 100644 --- a/server/helpers/middlewares/video-captions.ts +++ b/server/helpers/middlewares/video-captions.ts @@ -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) diff --git a/server/helpers/middlewares/video-channels.ts b/server/helpers/middlewares/video-channels.ts index 1595ecd94..6eecb8ee5 100644 --- a/server/helpers/middlewares/video-channels.ts +++ b/server/helpers/middlewares/video-channels.ts @@ -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) diff --git a/server/helpers/middlewares/video-playlists.ts b/server/helpers/middlewares/video-playlists.ts index 8e7484483..344104f7c 100644 --- a/server/helpers/middlewares/video-playlists.ts +++ b/server/helpers/middlewares/video-playlists.ts @@ -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') { diff --git a/server/helpers/middlewares/videos.ts b/server/helpers/middlewares/videos.ts index a0bbcdb21..77a48a467 100644 --- a/server/helpers/middlewares/videos.ts +++ b/server/helpers/middlewares/videos.ts @@ -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') { diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts index 394e97fd5..1655cd7b5 100644 --- a/server/helpers/peertube-crypto.ts +++ b/server/helpers/peertube-crypto.ts @@ -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(bcrypt.compare) const bcryptGenSaltPromise = promisify1(bcrypt.genSalt) diff --git a/server/helpers/video.ts b/server/helpers/video.ts index 4bcc6d0b9..89c85accb 100644 --- a/server/helpers/video.ts +++ b/server/helpers/video.ts @@ -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' diff --git a/server/helpers/webfinger.ts b/server/helpers/webfinger.ts index 5443a266b..da7e88077 100644 --- a/server/helpers/webfinger.ts +++ b/server/helpers/webfinger.ts @@ -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, diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index 7cd76d708..089954e32 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -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' diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index 0e5742071..73406e248 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts @@ -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' diff --git a/server/lib/activitypub/audience.ts b/server/lib/activitypub/audience.ts index 4b30d1f6f..2986714d3 100644 --- a/server/lib/activitypub/audience.ts +++ b/server/lib/activitypub/audience.ts @@ -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 { diff --git a/server/lib/activitypub/cache-file.ts b/server/lib/activitypub/cache-file.ts index 8252e95e9..2e6dd34e0 100644 --- a/server/lib/activitypub/cache-file.ts +++ b/server/lib/activitypub/cache-file.ts @@ -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) { diff --git a/server/lib/activitypub/follow.ts b/server/lib/activitypub/follow.ts index 3b5ad47c9..351499bd1 100644 --- a/server/lib/activitypub/follow.ts +++ b/server/lib/activitypub/follow.ts @@ -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' diff --git a/server/lib/activitypub/playlist.ts b/server/lib/activitypub/playlist.ts index c1d932a68..bd442b223 100644 --- a/server/lib/activitypub/playlist.ts +++ b/server/lib/activitypub/playlist.ts @@ -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) diff --git a/server/lib/activitypub/process/process-accept.ts b/server/lib/activitypub/process/process-accept.ts index dcfbb2c84..1799829f8 100644 --- a/server/lib/activitypub/process/process-accept.ts +++ b/server/lib/activitypub/process/process-accept.ts @@ -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) { const { byActor: targetActor, inboxActor } = options diff --git a/server/lib/activitypub/process/process-announce.ts b/server/lib/activitypub/process/process-announce.ts index 26427aaa1..63082466e 100644 --- a/server/lib/activitypub/process/process-announce.ts +++ b/server/lib/activitypub/process/process-announce.ts @@ -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) { const { activity, byActor: actorAnnouncer } = options diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 5e737f49e..74f1032e2 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts @@ -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' diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index 7c8dc83e8..b9fc5e792 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts @@ -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) { const { activity, byActor } = options diff --git a/server/lib/activitypub/process/process-dislike.ts b/server/lib/activitypub/process/process-dislike.ts index fcdd0b86e..0cd204501 100644 --- a/server/lib/activitypub/process/process-dislike.ts +++ b/server/lib/activitypub/process/process-dislike.ts @@ -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) { const { activity, byActor } = options diff --git a/server/lib/activitypub/process/process-flag.ts b/server/lib/activitypub/process/process-flag.ts index 7337f337c..8d1c9c869 100644 --- a/server/lib/activitypub/process/process-flag.ts +++ b/server/lib/activitypub/process/process-flag.ts @@ -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) { diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts index 950d421dd..7eb7e828d 100644 --- a/server/lib/activitypub/process/process-follow.ts +++ b/server/lib/activitypub/process/process-follow.ts @@ -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' diff --git a/server/lib/activitypub/process/process-like.ts b/server/lib/activitypub/process/process-like.ts index fba3c76a4..b800a5618 100644 --- a/server/lib/activitypub/process/process-like.ts +++ b/server/lib/activitypub/process/process-like.ts @@ -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) { const { activity, byActor } = options diff --git a/server/lib/activitypub/process/process-reject.ts b/server/lib/activitypub/process/process-reject.ts index 9804436a2..03b669fd9 100644 --- a/server/lib/activitypub/process/process-reject.ts +++ b/server/lib/activitypub/process/process-reject.ts @@ -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) { const { byActor: targetActor, inboxActor } = options diff --git a/server/lib/activitypub/process/process-undo.ts b/server/lib/activitypub/process/process-undo.ts index 9ef6a8a97..caf672cd6 100644 --- a/server/lib/activitypub/process/process-undo.ts +++ b/server/lib/activitypub/process/process-undo.ts @@ -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) { const { activity, byActor } = options diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts index 98ab0f83d..1bdf23d6f 100644 --- a/server/lib/activitypub/process/process-update.ts +++ b/server/lib/activitypub/process/process-update.ts @@ -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) { diff --git a/server/lib/activitypub/process/process-view.ts b/server/lib/activitypub/process/process-view.ts index b3b6c933d..cc26180af 100644 --- a/server/lib/activitypub/process/process-view.ts +++ b/server/lib/activitypub/process/process-view.ts @@ -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) { const { activity, byActor } = options diff --git a/server/lib/activitypub/process/process.ts b/server/lib/activitypub/process/process.ts index c602bf218..e60dd2a5b 100644 --- a/server/lib/activitypub/process/process.ts +++ b/server/lib/activitypub/process/process.ts @@ -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) => Promise } = { Create: processCreateActivity, diff --git a/server/lib/activitypub/send/send-accept.ts b/server/lib/activitypub/send/send-accept.ts index c4c6b849b..50e192bdd 100644 --- a/server/lib/activitypub/send/send-accept.ts +++ b/server/lib/activitypub/send/send-accept.ts @@ -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 diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.ts index d03b358f1..471dcfa77 100644 --- a/server/lib/activitypub/send/send-announce.ts +++ b/server/lib/activitypub/send/send-announce.ts @@ -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, diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index e521cabbc..9fb218224 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -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' diff --git a/server/lib/activitypub/send/send-delete.ts b/server/lib/activitypub/send/send-delete.ts index 2afd2c05d..e0acced18 100644 --- a/server/lib/activitypub/send/send-delete.ts +++ b/server/lib/activitypub/send/send-delete.ts @@ -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' diff --git a/server/lib/activitypub/send/send-dislike.ts b/server/lib/activitypub/send/send-dislike.ts index 600469c71..1bb7dc937 100644 --- a/server/lib/activitypub/send/send-dislike.ts +++ b/server/lib/activitypub/send/send-dislike.ts @@ -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) diff --git a/server/lib/activitypub/send/send-flag.ts b/server/lib/activitypub/send/send-flag.ts index e4e523631..3a1fe0812 100644 --- a/server/lib/activitypub/send/send-flag.ts +++ b/server/lib/activitypub/send/send-flag.ts @@ -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 diff --git a/server/lib/activitypub/send/send-follow.ts b/server/lib/activitypub/send/send-follow.ts index ce400d8ff..08f1d83f9 100644 --- a/server/lib/activitypub/send/send-follow.ts +++ b/server/lib/activitypub/send/send-follow.ts @@ -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 diff --git a/server/lib/activitypub/send/send-like.ts b/server/lib/activitypub/send/send-like.ts index 5db252325..29fcfc404 100644 --- a/server/lib/activitypub/send/send-like.ts +++ b/server/lib/activitypub/send/send-like.ts @@ -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) diff --git a/server/lib/activitypub/send/send-reject.ts b/server/lib/activitypub/send/send-reject.ts index 643c468a9..befbcb8da 100644 --- a/server/lib/activitypub/send/send-reject.ts +++ b/server/lib/activitypub/send/send-reject.ts @@ -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 diff --git a/server/lib/activitypub/send/send-undo.ts b/server/lib/activitypub/send/send-undo.ts index 33f1d4921..6ed343300 100644 --- a/server/lib/activitypub/send/send-undo.ts +++ b/server/lib/activitypub/send/send-undo.ts @@ -26,7 +26,7 @@ import { MVideoAccountLight, MVideoRedundancyVideo, MVideoShare -} from '../../../typings/models' +} from '../../../types/models' function sendUndoFollow (actorFollow: MActorFollowActors, t: Transaction) { const me = actorFollow.ActorFollower diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts index 7a4cf3f56..305edf429 100644 --- a/server/lib/activitypub/send/send-update.ts +++ b/server/lib/activitypub/send/send-update.ts @@ -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) { diff --git a/server/lib/activitypub/send/send-view.ts b/server/lib/activitypub/send/send-view.ts index 1f864ea52..3358188a2 100644 --- a/server/lib/activitypub/send/send-view.ts +++ b/server/lib/activitypub/send/send-view.ts @@ -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) diff --git a/server/lib/activitypub/send/utils.ts b/server/lib/activitypub/send/utils.ts index 44a8926e5..85a9f009d 100644 --- a/server/lib/activitypub/send/utils.ts +++ b/server/lib/activitypub/send/utils.ts @@ -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' diff --git a/server/lib/activitypub/share.ts b/server/lib/activitypub/share.ts index d2cbc59a8..5e426f5db 100644 --- a/server/lib/activitypub/share.ts +++ b/server/lib/activitypub/share.ts @@ -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) { diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index 6290af34b..7f98751a1 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts @@ -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 diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index 3aee6799e..dcae2a255 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts @@ -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 diff --git a/server/lib/activitypub/video-rates.ts b/server/lib/activitypub/video-rates.ts index 202368c8f..e09e5d9ec 100644 --- a/server/lib/activitypub/video-rates.ts +++ b/server/lib/activitypub/video-rates.ts @@ -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 diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 6d20e0e65..6c5f7f306 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -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) { diff --git a/server/lib/avatar.ts b/server/lib/avatar.ts index 282d834a2..be6657b6f 100644 --- a/server/lib/avatar.ts +++ b/server/lib/avatar.ts @@ -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, diff --git a/server/lib/blocklist.ts b/server/lib/blocklist.ts index d282d091b..d6b684015 100644 --- a/server/lib/blocklist.ts +++ b/server/lib/blocklist.ts @@ -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' diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 4a4b0d12f..3e6da2898 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -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 { diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 04aade83a..c08732b48 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -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' diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 443a60088..60bb3ab7e 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts @@ -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 () { diff --git a/server/lib/job-queue/handlers/activitypub-follow.ts b/server/lib/job-queue/handlers/activitypub-follow.ts index 7034c10d0..7a4f85f8b 100644 --- a/server/lib/job-queue/handlers/activitypub-follow.ts +++ b/server/lib/job-queue/handlers/activitypub-follow.ts @@ -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) { diff --git a/server/lib/job-queue/handlers/activitypub-http-fetcher.ts b/server/lib/job-queue/handlers/activitypub-http-fetcher.ts index 524aadc27..a7c1a556c 100644 --- a/server/lib/job-queue/handlers/activitypub-http-fetcher.ts +++ b/server/lib/job-queue/handlers/activitypub-http-fetcher.ts @@ -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) { diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts index bcb49a731..c030d31ef 100644 --- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts +++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts @@ -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' diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts index ae11f1de3..f9bc3137c 100644 --- a/server/lib/job-queue/handlers/video-file-import.ts +++ b/server/lib/job-queue/handlers/video-file-import.ts @@ -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' diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index a197ef629..9b5f2bb2b 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts @@ -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' diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 46d52e1cf..ce1c419e7 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts @@ -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 diff --git a/server/lib/moderation.ts b/server/lib/moderation.ts index 4afebb32a..60d1b4053 100644 --- a/server/lib/moderation.ts +++ b/server/lib/moderation.ts @@ -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 diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts index 89f91e031..943a087d2 100644 --- a/server/lib/notifier.ts +++ b/server/lib/notifier.ts @@ -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' diff --git a/server/lib/oauth-model.ts b/server/lib/oauth-model.ts index db546efb1..3273c6c2d 100644 --- a/server/lib/oauth-model.ts +++ b/server/lib/oauth-model.ts @@ -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' diff --git a/server/lib/peertube-socket.ts b/server/lib/peertube-socket.ts index 26ced351f..2e4b15b38 100644 --- a/server/lib/peertube-socket.ts +++ b/server/lib/peertube-socket.ts @@ -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 { diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 950acf7ad..7fda5d9a4 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts @@ -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 { diff --git a/server/lib/redundancy.ts b/server/lib/redundancy.ts index 361b401a5..da620b607 100644 --- a/server/lib/redundancy.ts +++ b/server/lib/redundancy.ts @@ -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' diff --git a/server/lib/schedulers/update-videos-scheduler.ts b/server/lib/schedulers/update-videos-scheduler.ts index d32c1c068..3e75babcb 100644 --- a/server/lib/schedulers/update-videos-scheduler.ts +++ b/server/lib/schedulers/update-videos-scheduler.ts @@ -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 { diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 8da9d52b5..54d9a9894 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -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' diff --git a/server/lib/thumbnail.ts b/server/lib/thumbnail.ts index 8dbd41771..78d2f69e3 100644 --- a/server/lib/thumbnail.ts +++ b/server/lib/thumbnail.ts @@ -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 } diff --git a/server/lib/user.ts b/server/lib/user.ts index 8b447583e..43eef8ab1 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -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 } diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index 1ee92d22c..bdbcffda6 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts @@ -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' diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts index 102c1088d..8928dda12 100644 --- a/server/lib/video-channel.ts +++ b/server/lib/video-channel.ts @@ -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' diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index 97aa639fb..c92a7c43a 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts @@ -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' diff --git a/server/lib/video-paths.ts b/server/lib/video-paths.ts index 05aaca8af..a35661f02 100644 --- a/server/lib/video-paths.ts +++ b/server/lib/video-paths.ts @@ -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' diff --git a/server/lib/video-playlist.ts b/server/lib/video-playlist.ts index 75fbd6896..6eeb70c8e 100644 --- a/server/lib/video-playlist.ts +++ b/server/lib/video-playlist.ts @@ -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({ diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index dcda82e0a..628f22f5e 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts @@ -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' diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index 7808135f7..2c1ddf2df 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts @@ -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' diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 3bdbcdf6a..4a9ed6830 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts @@ -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 = [ diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index 6604ae6a8..2e4e755e7 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts @@ -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' diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts index 4846a5e9e..ef019fcf9 100644 --- a/server/middlewares/validators/videos/video-comments.ts +++ b/server/middlewares/validators/videos/video-comments.ts @@ -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 = [ diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 6b15c5464..07fd8533c 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts @@ -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') diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 867c05fc1..40a34d3b8 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -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' diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index 2c6b756d2..cf8872fd5 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts @@ -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' diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.ts index 8aeb486d1..5064987dc 100644 --- a/server/models/account/account-video-rate.ts +++ b/server/models/account/account-video-rate.ts @@ -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. diff --git a/server/models/account/account.ts b/server/models/account/account.ts index ad649837a..4395d179a 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts @@ -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' diff --git a/server/models/account/user-notification-setting.ts b/server/models/account/user-notification-setting.ts index dc69a17fd..b69b47265 100644 --- a/server/models/account/user-notification-setting.ts +++ b/server/models/account/user-notification-setting.ts @@ -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', diff --git a/server/models/account/user-notification.ts b/server/models/account/user-notification.ts index 5a725187a..30985bb0f 100644 --- a/server/models/account/user-notification.ts +++ b/server/models/account/user-notification.ts @@ -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' diff --git a/server/models/account/user-video-history.ts b/server/models/account/user-video-history.ts index 522eebeaf..76b469fbf 100644 --- a/server/models/account/user-video-history.ts +++ b/server/models/account/user-video-history.ts @@ -2,7 +2,7 @@ import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, IsInt, Model, Tabl import { VideoModel } from '../video/video' import { UserModel } from './user' import { DestroyOptions, Op, Transaction } from 'sequelize' -import { MUserAccountId, MUserId } from '@server/typings/models' +import { MUserAccountId, MUserId } from '@server/types/models' @Table({ tableName: 'userVideoHistory', diff --git a/server/models/account/user.ts b/server/models/account/user.ts index fbd3080c6..3bde1e744 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts @@ -68,7 +68,7 @@ import { MUserNotifSettingChannelDefault, MUserWithNotificationSetting, MVideoFullLight -} from '@server/typings/models' +} from '@server/types/models' enum ScopeNames { FOR_ME_API = 'FOR_ME_API', diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 85a371026..3e85cc329 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts @@ -33,7 +33,7 @@ import { MActorFollowFollowingHost, MActorFollowFormattable, MActorFollowSubscriptions -} from '@server/typings/models' +} from '@server/types/models' import { ActivityPubActorType } from '@shared/models' import { VideoModel } from '@server/models/video/video' import { getServerActor } from '@server/models/application/application' diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 34bc91706..b6dacc534 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts @@ -45,7 +45,7 @@ import { MActorServer, MActorSummaryFormattable, MActorUrl, MActorWithInboxes -} from '../../typings/models' +} from '../../types/models' import * as Bluebird from 'bluebird' import { Op, Transaction, literal } from 'sequelize' import { ModelCache } from '@server/models/model-cache' diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts index 950e4b181..d874dec99 100644 --- a/server/models/avatar/avatar.ts +++ b/server/models/avatar/avatar.ts @@ -7,7 +7,7 @@ import { remove } from 'fs-extra' import { CONFIG } from '../../initializers/config' import { throwIfNotValid } from '../utils' import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' -import { MAvatarFormattable } from '@server/typings/models' +import { MAvatarFormattable } from '@server/types/models' @Table({ tableName: 'avatar', diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index 38953e8ad..7f2313dad 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -19,7 +19,7 @@ import { AccountModel } from '../account/account' import { ActorModel } from '../activitypub/actor' import { clearCacheByToken } from '../../lib/oauth-model' import * as Bluebird from 'bluebird' -import { MOAuthTokenUser } from '@server/typings/models/oauth/oauth-token' +import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' export type OAuthTokenInfo = { refreshToken: string diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 6021408bf..1c8b2cf78 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -29,7 +29,7 @@ import * as Bluebird from 'bluebird' import { col, FindOptions, fn, literal, Op, Transaction, WhereOptions } from 'sequelize' import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist' import { CONFIG } from '../../initializers/config' -import { MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/typings/models' +import { MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models' import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model' import { FileRedundancyInformation, diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 53b6227d7..95fb386b5 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts @@ -1,7 +1,7 @@ import * as Bluebird from 'bluebird' import { FindAndCountOptions, json, QueryTypes } from 'sequelize' import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' -import { MPlugin, MPluginFormattable } from '@server/typings/models' +import { MPlugin, MPluginFormattable } from '@server/types/models' import { PeerTubePlugin } from '../../../shared/models/plugins/peertube-plugin.model' import { PluginType } from '../../../shared/models/plugins/plugin.type' import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' diff --git a/server/models/server/server-blocklist.ts b/server/models/server/server-blocklist.ts index ad8e3d1e8..30f0525e5 100644 --- a/server/models/server/server-blocklist.ts +++ b/server/models/server/server-blocklist.ts @@ -4,7 +4,7 @@ import { ServerModel } from './server' import { ServerBlock } from '../../../shared/models/blocklist' import { getSort, searchAttribute } from '../utils' import * as Bluebird from 'bluebird' -import { MServerBlocklist, MServerBlocklistAccountServer, MServerBlocklistFormattable } from '@server/typings/models' +import { MServerBlocklist, MServerBlocklistAccountServer, MServerBlocklistFormattable } from '@server/types/models' import { Op } from 'sequelize' enum ScopeNames { diff --git a/server/models/server/server.ts b/server/models/server/server.ts index 5131257ec..771200797 100644 --- a/server/models/server/server.ts +++ b/server/models/server/server.ts @@ -4,7 +4,7 @@ import { ActorModel } from '../activitypub/actor' import { throwIfNotValid } from '../utils' import { ServerBlocklistModel } from './server-blocklist' import * as Bluebird from 'bluebird' -import { MServer, MServerFormattable } from '@server/typings/models/server' +import { MServer, MServerFormattable } from '@server/types/models/server' @Table({ tableName: 'server', diff --git a/server/models/video/schedule-video-update.ts b/server/models/video/schedule-video-update.ts index 00b7f5524..1ce6bbfe5 100644 --- a/server/models/video/schedule-video-update.ts +++ b/server/models/video/schedule-video-update.ts @@ -2,7 +2,7 @@ import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Model, Ta import { ScopeNames as VideoScopeNames, VideoModel } from './video' import { VideoPrivacy } from '../../../shared/models/videos' import { Op, Transaction } from 'sequelize' -import { MScheduleVideoUpdateFormattable, MScheduleVideoUpdateVideoAll } from '@server/typings/models' +import { MScheduleVideoUpdateFormattable, MScheduleVideoUpdateVideoAll } from '@server/types/models' @Table({ tableName: 'scheduleVideoUpdate', diff --git a/server/models/video/tag.ts b/server/models/video/tag.ts index ed8df8b48..adbc4fb7d 100644 --- a/server/models/video/tag.ts +++ b/server/models/video/tag.ts @@ -6,7 +6,7 @@ import { throwIfNotValid } from '../utils' import { VideoModel } from './video' import { VideoTagModel } from './video-tag' import { VideoPrivacy, VideoState } from '../../../shared/models/videos' -import { MTag } from '@server/typings/models' +import { MTag } from '@server/types/models' @Table({ tableName: 'tag', diff --git a/server/models/video/thumbnail.ts b/server/models/video/thumbnail.ts index e396784d2..20c1e5858 100644 --- a/server/models/video/thumbnail.ts +++ b/server/models/video/thumbnail.ts @@ -19,7 +19,7 @@ import { CONFIG } from '../../initializers/config' import { VideoModel } from './video' import { VideoPlaylistModel } from './video-playlist' import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' -import { MVideoAccountLight } from '@server/typings/models' +import { MVideoAccountLight } from '@server/types/models' import { buildRemoteVideoBaseUrl } from '@server/helpers/activitypub' @Table({ diff --git a/server/models/video/video-abuse.ts b/server/models/video/video-abuse.ts index 40f0ce12b..b2f111337 100644 --- a/server/models/video/video-abuse.ts +++ b/server/models/video/video-abuse.ts @@ -24,7 +24,7 @@ import { isVideoAbuseStateValid } from '../../helpers/custom-validators/video-abuses' import { CONSTRAINTS_FIELDS, VIDEO_ABUSE_STATES } from '../../initializers/constants' -import { MUserAccountId, MVideoAbuse, MVideoAbuseFormattable, MVideoAbuseVideo } from '../../typings/models' +import { MUserAccountId, MVideoAbuse, MVideoAbuseFormattable, MVideoAbuseVideo } from '../../types/models' import { AccountModel } from '../account/account' import { buildBlockedAccountSQL, getSort, searchAttribute, throwIfNotValid } from '../utils' import { ThumbnailModel } from './thumbnail' diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 8cbfe362e..36d2a30fa 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -8,7 +8,7 @@ import { CONSTRAINTS_FIELDS } from '../../initializers/constants' import { FindOptions } from 'sequelize' import { ThumbnailModel } from './thumbnail' import * as Bluebird from 'bluebird' -import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/typings/models' +import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/types/models' @Table({ tableName: 'videoBlacklist', diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index 59d3e1050..b68a6e99f 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts @@ -23,7 +23,7 @@ import { logger } from '../../helpers/logger' import { remove } from 'fs-extra' import { CONFIG } from '../../initializers/config' import * as Bluebird from 'bluebird' -import { MVideoAccountLight, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/typings/models' +import { MVideoAccountLight, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models' import { buildRemoteVideoBaseUrl } from '@server/helpers/activitypub' export enum ScopeNames { diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.ts index 3259b6c02..aecb03c14 100644 --- a/server/models/video/video-change-ownership.ts +++ b/server/models/video/video-change-ownership.ts @@ -3,7 +3,7 @@ import { AccountModel } from '../account/account' import { ScopeNames as VideoScopeNames, VideoModel } from './video' import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' import { getSort } from '../utils' -import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/typings/models/video/video-change-ownership' +import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' import * as Bluebird from 'bluebird' enum ScopeNames { diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index a4231b6b3..9cee64229 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -41,7 +41,7 @@ import { MChannelAP, MChannelFormattable, MChannelSummaryFormattable -} from '../../typings/models/video' +} from '../../types/models/video' export enum ScopeNames { FOR_API = 'FOR_API', diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index cf2a80d53..091cc2a88 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -3,7 +3,7 @@ import { uniq } from 'lodash' import { FindOptions, Op, Order, ScopeOptions, Sequelize, Transaction } from 'sequelize' import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' import { getServerActor } from '@server/models/application/application' -import { MAccount, MAccountId, MUserAccountId } from '@server/typings/models' +import { MAccount, MAccountId, MUserAccountId } from '@server/types/models' import { VideoPrivacy } from '@shared/models' import { ActivityTagObject, ActivityTombstoneObject } from '../../../shared/models/activitypub/objects/common-objects' import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object' @@ -23,7 +23,7 @@ import { MCommentOwnerVideoFeed, MCommentOwnerVideoReply, MVideoImmutable -} from '../../typings/models/video' +} from '../../types/models/video' import { AccountModel } from '../account/account' import { ActorModel, unusedActorAttributesForAPI } from '../activitypub/actor' import { buildBlockedAccountSQL, buildLocalAccountIdsIn, getCommentSort, throwIfNotValid } from '../utils' diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 201f0c0f1..f95022383 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -27,8 +27,8 @@ import { VideoRedundancyModel } from '../redundancy/video-redundancy' import { VideoStreamingPlaylistModel } from './video-streaming-playlist' import { FindOptions, Op, QueryTypes, Transaction } from 'sequelize' import { MIMETYPES, MEMOIZE_LENGTH, MEMOIZE_TTL } from '../../initializers/constants' -import { MVideoFile, MVideoFileStreamingPlaylistVideo, MVideoFileVideo } from '../../typings/models/video/video-file' -import { MStreamingPlaylistVideo, MVideo } from '@server/typings/models' +import { MVideoFile, MVideoFileStreamingPlaylistVideo, MVideoFileVideo } from '../../types/models/video/video-file' +import { MStreamingPlaylistVideo, MVideo } from '@server/types/models' import * as memoizee from 'memoizee' import validator from 'validator' diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 89b0f5050..9b6509dfd 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts @@ -19,8 +19,8 @@ import { MVideoFile, MVideoFormattable, MVideoFormattableDetails -} from '../../typings/models' -import { MVideoFileRedundanciesOpt } from '../../typings/models/video/video-file' +} from '../../types/models' +import { MVideoFileRedundanciesOpt } from '../../types/models/video/video-file' import { VideoFile } from '@shared/models/videos/video-file.model' import { generateMagnetUri } from '@server/helpers/webtorrent' import { extractVideo } from '@server/helpers/video' diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts index fbe0ee0a7..ea1e085af 100644 --- a/server/models/video/video-import.ts +++ b/server/models/video/video-import.ts @@ -21,7 +21,7 @@ import { VideoImport, VideoImportState } from '../../../shared' import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' import { UserModel } from '../account/user' import * as Bluebird from 'bluebird' -import { MVideoImportDefault, MVideoImportFormattable } from '@server/typings/models/video/video-import' +import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' @DefaultScope(() => ({ include: [ diff --git a/server/models/video/video-playlist-element.ts b/server/models/video/video-playlist-element.ts index 9ea73e82e..ba92e129a 100644 --- a/server/models/video/video-playlist-element.ts +++ b/server/models/video/video-playlist-element.ts @@ -31,8 +31,8 @@ import { MVideoPlaylistElementFormattable, MVideoPlaylistElementVideoUrlPlaylistPrivacy, MVideoPlaylistVideoThumbnail -} from '@server/typings/models/video/video-playlist-element' -import { MUserAccountId } from '@server/typings/models' +} from '@server/types/models/video/video-playlist-element' +import { MUserAccountId } from '@server/types/models' @Table({ tableName: 'videoPlaylistElement', diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index d66518c9f..51fe04fc4 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts @@ -51,9 +51,9 @@ import { MVideoPlaylistFull, MVideoPlaylistFullSummary, MVideoPlaylistIdWithElements -} from '../../typings/models/video/video-playlist' -import { MThumbnail } from '../../typings/models/video/thumbnail' -import { MAccountId, MChannelId } from '@server/typings/models' +} from '../../types/models/video/video-playlist' +import { MThumbnail } from '../../types/models/video/thumbnail' +import { MAccountId, MChannelId } from '@server/types/models' enum ScopeNames { AVAILABLE_FOR_LIST = 'AVAILABLE_FOR_LIST', diff --git a/server/models/video/video-query-builder.ts b/server/models/video/video-query-builder.ts index 6211c9e56..984b0e6af 100644 --- a/server/models/video/video-query-builder.ts +++ b/server/models/video/video-query-builder.ts @@ -1,7 +1,7 @@ import { VideoFilter, VideoPrivacy, VideoState } from '@shared/models' import { buildDirectionAndField, createSafeIn } from '@server/models/utils' import { Model } from 'sequelize-typescript' -import { MUserAccountId, MUserId } from '@server/typings/models' +import { MUserAccountId, MUserId } from '@server/types/models' import validator from 'validator' import { exists } from '@server/helpers/custom-validators/misc' diff --git a/server/models/video/video-share.ts b/server/models/video/video-share.ts index 4bbef75e6..f9ee94589 100644 --- a/server/models/video/video-share.ts +++ b/server/models/video/video-share.ts @@ -6,8 +6,8 @@ import { ActorModel } from '../activitypub/actor' import { buildLocalActorIdsIn, throwIfNotValid } from '../utils' import { VideoModel } from './video' import { literal, Op, Transaction } from 'sequelize' -import { MVideoShareActor, MVideoShareFull } from '../../typings/models/video' -import { MActorDefault } from '../../typings/models' +import { MVideoShareActor, MVideoShareFull } from '../../types/models/video' +import { MActorDefault } from '../../types/models' enum ScopeNames { FULL = 'FULL', diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index 249596218..021b9b063 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts @@ -17,7 +17,7 @@ import { join } from 'path' import { sha1 } from '../../helpers/core-utils' import { isArrayOf } from '../../helpers/custom-validators/misc' import { Op, QueryTypes } from 'sequelize' -import { MStreamingPlaylist, MStreamingPlaylistVideo, MVideoFile } from '@server/typings/models' +import { MStreamingPlaylist, MStreamingPlaylistVideo, MVideoFile } from '@server/types/models' import { VideoFileModel } from '@server/models/video/video-file' import { getTorrentFileName, getTorrentFilePath, getVideoFilename } from '@server/lib/video-paths' import * as memoizee from 'memoizee' diff --git a/server/models/video/video.ts b/server/models/video/video.ts index b4efb76ee..e2718300e 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -117,9 +117,9 @@ import { MVideoWithAllFiles, MVideoWithFile, MVideoWithRights -} from '../../typings/models' -import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/models/video/video-file' -import { MThumbnail } from '../../typings/models/video/thumbnail' +} from '../../types/models' +import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../types/models/video/video-file' +import { MThumbnail } from '../../types/models/video/thumbnail' import { VideoFile } from '@shared/models/videos/video-file.model' import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' import { ModelCache } from '@server/models/model-cache' diff --git a/server/tools/tsconfig.json b/server/tools/tsconfig.json index f8a1c705c..156a8ed22 100644 --- a/server/tools/tsconfig.json +++ b/server/tools/tsconfig.json @@ -1,4 +1,5 @@ { "extends": "../../tsconfig.json", + "include": [ ".", "../typings" ], "exclude": [ ] // Overwrite exclude property } diff --git a/server/typings/activitypub-processor.model.ts b/server/types/activitypub-processor.model.ts similarity index 100% rename from server/typings/activitypub-processor.model.ts rename to server/types/activitypub-processor.model.ts diff --git a/server/typings/models/account/account-blocklist.ts b/server/types/models/account/account-blocklist.ts similarity index 100% rename from server/typings/models/account/account-blocklist.ts rename to server/types/models/account/account-blocklist.ts diff --git a/server/typings/models/account/account.ts b/server/types/models/account/account.ts similarity index 100% rename from server/typings/models/account/account.ts rename to server/types/models/account/account.ts diff --git a/server/typings/models/account/actor-follow.ts b/server/types/models/account/actor-follow.ts similarity index 100% rename from server/typings/models/account/actor-follow.ts rename to server/types/models/account/actor-follow.ts diff --git a/server/typings/models/account/actor.ts b/server/types/models/account/actor.ts similarity index 100% rename from server/typings/models/account/actor.ts rename to server/types/models/account/actor.ts diff --git a/server/typings/models/account/avatar.ts b/server/types/models/account/avatar.ts similarity index 84% rename from server/typings/models/account/avatar.ts rename to server/types/models/account/avatar.ts index 21b47180f..6eba59ee4 100644 --- a/server/typings/models/account/avatar.ts +++ b/server/types/models/account/avatar.ts @@ -1,5 +1,5 @@ import { AvatarModel } from '../../../models/avatar/avatar' -import { FunctionProperties } from '@server/typings/utils' +import { FunctionProperties } from '@server/types/utils' export type MAvatar = AvatarModel diff --git a/server/typings/models/account/index.ts b/server/types/models/account/index.ts similarity index 100% rename from server/typings/models/account/index.ts rename to server/types/models/account/index.ts diff --git a/server/typings/models/index.ts b/server/types/models/index.ts similarity index 100% rename from server/typings/models/index.ts rename to server/types/models/index.ts diff --git a/server/typings/models/oauth/index.ts b/server/types/models/oauth/index.ts similarity index 100% rename from server/typings/models/oauth/index.ts rename to server/types/models/oauth/index.ts diff --git a/server/typings/models/oauth/oauth-client.ts b/server/types/models/oauth/oauth-client.ts similarity index 100% rename from server/typings/models/oauth/oauth-client.ts rename to server/types/models/oauth/oauth-client.ts diff --git a/server/typings/models/oauth/oauth-token.ts b/server/types/models/oauth/oauth-token.ts similarity index 90% rename from server/typings/models/oauth/oauth-token.ts rename to server/types/models/oauth/oauth-token.ts index b24a95fd8..396cf6429 100644 --- a/server/typings/models/oauth/oauth-token.ts +++ b/server/types/models/oauth/oauth-token.ts @@ -1,5 +1,5 @@ import { OAuthTokenModel } from '@server/models/oauth/oauth-token' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MUserAccountUrl } from '../user/user' type Use = PickWith diff --git a/server/typings/models/server/index.ts b/server/types/models/server/index.ts similarity index 100% rename from server/typings/models/server/index.ts rename to server/types/models/server/index.ts diff --git a/server/typings/models/server/plugin.ts b/server/types/models/server/plugin.ts similarity index 100% rename from server/typings/models/server/plugin.ts rename to server/types/models/server/plugin.ts diff --git a/server/typings/models/server/server-blocklist.ts b/server/types/models/server/server-blocklist.ts similarity index 95% rename from server/typings/models/server/server-blocklist.ts rename to server/types/models/server/server-blocklist.ts index ff6f49176..cfbf3b73a 100644 --- a/server/typings/models/server/server-blocklist.ts +++ b/server/types/models/server/server-blocklist.ts @@ -1,5 +1,5 @@ import { ServerBlocklistModel } from '@server/models/server/server-blocklist' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MAccountDefault, MAccountFormattable } from '../account/account' import { MServer, MServerFormattable } from './server' diff --git a/server/typings/models/server/server.ts b/server/types/models/server/server.ts similarity index 100% rename from server/typings/models/server/server.ts rename to server/types/models/server/server.ts diff --git a/server/typings/models/user/index.ts b/server/types/models/user/index.ts similarity index 100% rename from server/typings/models/user/index.ts rename to server/types/models/user/index.ts diff --git a/server/typings/models/user/user-notification-setting.ts b/server/types/models/user/user-notification-setting.ts similarity index 100% rename from server/typings/models/user/user-notification-setting.ts rename to server/types/models/user/user-notification-setting.ts diff --git a/server/typings/models/user/user-notification.ts b/server/types/models/user/user-notification.ts similarity index 100% rename from server/typings/models/user/user-notification.ts rename to server/types/models/user/user-notification.ts diff --git a/server/typings/models/user/user-video-history.ts b/server/types/models/user/user-video-history.ts similarity index 100% rename from server/typings/models/user/user-video-history.ts rename to server/types/models/user/user-video-history.ts diff --git a/server/typings/models/user/user.ts b/server/types/models/user/user.ts similarity index 97% rename from server/typings/models/user/user.ts rename to server/types/models/user/user.ts index 31cf075ef..7938ea288 100644 --- a/server/typings/models/user/user.ts +++ b/server/types/models/user/user.ts @@ -12,7 +12,7 @@ import { import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' import { AccountModel } from '@server/models/account/account' import { MChannelFormattable } from '../video/video-channels' -import { MVideoPlaylist } from '@server/typings/models' +import { MVideoPlaylist } from '@server/types/models' type Use = PickWith diff --git a/server/typings/models/video/index.ts b/server/types/models/video/index.ts similarity index 100% rename from server/typings/models/video/index.ts rename to server/types/models/video/index.ts diff --git a/server/typings/models/video/schedule-video-update.ts b/server/types/models/video/schedule-video-update.ts similarity index 93% rename from server/typings/models/video/schedule-video-update.ts rename to server/types/models/video/schedule-video-update.ts index 95a53d139..6336fdabe 100644 --- a/server/typings/models/video/schedule-video-update.ts +++ b/server/types/models/video/schedule-video-update.ts @@ -1,5 +1,5 @@ import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' type Use = PickWith diff --git a/server/typings/models/video/tag.ts b/server/types/models/video/tag.ts similarity index 100% rename from server/typings/models/video/tag.ts rename to server/types/models/video/tag.ts diff --git a/server/typings/models/video/thumbnail.ts b/server/types/models/video/thumbnail.ts similarity index 100% rename from server/typings/models/video/thumbnail.ts rename to server/types/models/video/thumbnail.ts diff --git a/server/typings/models/video/video-abuse.ts b/server/types/models/video/video-abuse.ts similarity index 100% rename from server/typings/models/video/video-abuse.ts rename to server/types/models/video/video-abuse.ts diff --git a/server/typings/models/video/video-blacklist.ts b/server/types/models/video/video-blacklist.ts similarity index 95% rename from server/typings/models/video/video-blacklist.ts rename to server/types/models/video/video-blacklist.ts index ddb4db832..08e59284a 100644 --- a/server/typings/models/video/video-blacklist.ts +++ b/server/types/models/video/video-blacklist.ts @@ -1,5 +1,5 @@ import { VideoBlacklistModel } from '../../../models/video/video-blacklist' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MVideo, MVideoFormattable } from './video' type Use = PickWith diff --git a/server/typings/models/video/video-caption.ts b/server/types/models/video/video-caption.ts similarity index 93% rename from server/typings/models/video/video-caption.ts rename to server/types/models/video/video-caption.ts index e7aff6956..9bb067001 100644 --- a/server/typings/models/video/video-caption.ts +++ b/server/types/models/video/video-caption.ts @@ -1,5 +1,5 @@ import { VideoCaptionModel } from '../../../models/video/video-caption' -import { FunctionProperties, PickWith } from '@server/typings/utils' +import { FunctionProperties, PickWith } from '@server/types/utils' import { MVideo, MVideoUUID } from './video' type Use = PickWith diff --git a/server/typings/models/video/video-change-ownership.ts b/server/types/models/video/video-change-ownership.ts similarity index 95% rename from server/typings/models/video/video-change-ownership.ts rename to server/types/models/video/video-change-ownership.ts index 971dc3db5..7421e081e 100644 --- a/server/typings/models/video/video-change-ownership.ts +++ b/server/types/models/video/video-change-ownership.ts @@ -1,5 +1,5 @@ import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MAccountDefault, MAccountFormattable } from '../account/account' import { MVideo, MVideoWithAllFiles } from './video' diff --git a/server/typings/models/video/video-channels.ts b/server/types/models/video/video-channels.ts similarity index 100% rename from server/typings/models/video/video-channels.ts rename to server/types/models/video/video-channels.ts diff --git a/server/typings/models/video/video-comment.ts b/server/types/models/video/video-comment.ts similarity index 100% rename from server/typings/models/video/video-comment.ts rename to server/types/models/video/video-comment.ts diff --git a/server/typings/models/video/video-file.ts b/server/types/models/video/video-file.ts similarity index 100% rename from server/typings/models/video/video-file.ts rename to server/types/models/video/video-file.ts diff --git a/server/typings/models/video/video-import.ts b/server/types/models/video/video-import.ts similarity index 94% rename from server/typings/models/video/video-import.ts rename to server/types/models/video/video-import.ts index 4e5c2e4f0..f1385877e 100644 --- a/server/typings/models/video/video-import.ts +++ b/server/types/models/video/video-import.ts @@ -1,5 +1,5 @@ import { VideoImportModel } from '@server/models/video/video-import' -import { PickWith, PickWithOpt } from '@server/typings/utils' +import { PickWith, PickWithOpt } from '@server/types/utils' import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' import { MUser } from '../user/user' diff --git a/server/typings/models/video/video-playlist-element.ts b/server/types/models/video/video-playlist-element.ts similarity index 96% rename from server/typings/models/video/video-playlist-element.ts rename to server/types/models/video/video-playlist-element.ts index f33c76594..c50992da7 100644 --- a/server/typings/models/video/video-playlist-element.ts +++ b/server/types/models/video/video-playlist-element.ts @@ -1,5 +1,5 @@ import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' import { MVideoPlaylistPrivacy } from './video-playlist' diff --git a/server/typings/models/video/video-playlist.ts b/server/types/models/video/video-playlist.ts similarity index 97% rename from server/typings/models/video/video-playlist.ts rename to server/types/models/video/video-playlist.ts index 49c27f4a7..b504d1664 100644 --- a/server/typings/models/video/video-playlist.ts +++ b/server/types/models/video/video-playlist.ts @@ -3,7 +3,7 @@ import { PickWith } from '../../utils' import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' import { MThumbnail } from './thumbnail' import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' -import { MVideoPlaylistElementLight } from '@server/typings/models/video/video-playlist-element' +import { MVideoPlaylistElementLight } from '@server/types/models/video/video-playlist-element' type Use = PickWith diff --git a/server/typings/models/video/video-rate.ts b/server/types/models/video/video-rate.ts similarity index 94% rename from server/typings/models/video/video-rate.ts rename to server/types/models/video/video-rate.ts index 64ce4965b..a7682ef31 100644 --- a/server/typings/models/video/video-rate.ts +++ b/server/types/models/video/video-rate.ts @@ -1,5 +1,5 @@ import { AccountVideoRateModel } from '@server/models/account/account-video-rate' -import { PickWith } from '@server/typings/utils' +import { PickWith } from '@server/types/utils' import { MAccountAudience, MAccountUrl } from '../account/account' import { MVideo, MVideoFormattable } from './video' diff --git a/server/typings/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.ts similarity index 96% rename from server/typings/models/video/video-redundancy.ts rename to server/types/models/video/video-redundancy.ts index 5107aa7f4..7c7d52035 100644 --- a/server/typings/models/video/video-redundancy.ts +++ b/server/types/models/video/video-redundancy.ts @@ -1,5 +1,5 @@ import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' -import { PickWith, PickWithOpt } from '@server/typings/utils' +import { PickWith, PickWithOpt } from '@server/types/utils' import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' import { VideoFileModel } from '@server/models/video/video-file' import { MVideoFile, MVideoFileVideo } from './video-file' diff --git a/server/typings/models/video/video-share.ts b/server/types/models/video/video-share.ts similarity index 100% rename from server/typings/models/video/video-share.ts rename to server/types/models/video/video-share.ts diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/types/models/video/video-streaming-playlist.ts similarity index 100% rename from server/typings/models/video/video-streaming-playlist.ts rename to server/types/models/video/video-streaming-playlist.ts diff --git a/server/typings/models/video/video.ts b/server/types/models/video/video.ts similarity index 100% rename from server/typings/models/video/video.ts rename to server/types/models/video/video.ts diff --git a/server/typings/sequelize.ts b/server/types/sequelize.ts similarity index 100% rename from server/typings/sequelize.ts rename to server/types/sequelize.ts diff --git a/server/typings/utils.ts b/server/types/utils.ts similarity index 100% rename from server/typings/utils.ts rename to server/types/utils.ts diff --git a/server/typings/express.ts b/server/typings/express.d.ts similarity index 80% rename from server/typings/express.ts rename to server/typings/express.d.ts index 15d445c2d..451bf9103 100644 --- a/server/typings/express.ts +++ b/server/typings/express.d.ts @@ -18,21 +18,21 @@ import { MVideoShareActor, MVideoThumbnail, MVideoWithRights -} from './models' -import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from './models/video/video-playlist' -import { MVideoImportDefault } from '@server/typings/models/video/video-import' -import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/typings/models' -import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/typings/models/video/video-playlist-element' -import { MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' -import { MVideoChangeOwnershipFull } from './models/video/video-change-ownership' -import { MPlugin, MServer } from '@server/typings/models/server' -import { MServerBlocklist } from './models/server/server-blocklist' -import { MOAuthTokenUser } from '@server/typings/models/oauth/oauth-token' +} from '../types/models' +import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../types/models/video/video-playlist' +import { MVideoImportDefault } from '@server/types/models/video/video-import' +import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models' +import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' +import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' +import { MVideoChangeOwnershipFull } from '../types/models/video/video-change-ownership' +import { MPlugin, MServer } from '@server/types/models/server' +import { MServerBlocklist } from '../types/models/server/server-blocklist' +import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' import { UserRole } from '@shared/models' import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' declare module 'express' { - interface Request { + export interface Request { query: any } diff --git a/server/typings/plugins/register-server-option.model.ts b/server/typings/plugins/register-server-option.model.ts index 8f1d66007..b4594c6cd 100644 --- a/server/typings/plugins/register-server-option.model.ts +++ b/server/typings/plugins/register-server-option.model.ts @@ -17,7 +17,7 @@ import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugi import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model' import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' -import { MVideoThumbnail } from '../models' +import { MVideoThumbnail } from '../../types/models' export type PeerTubeHelpers = { logger: Logger diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index eb06a1516..2b04a0396 100644 --- a/shared/extra-utils/server/config.ts +++ b/shared/extra-utils/server/config.ts @@ -1,6 +1,6 @@ import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' import { CustomConfig } from '../../models/server/custom-config.model' -import { DeepPartial } from '@server/typings/utils' +import { DeepPartial } from '@server/types/utils' import { merge } from 'lodash' function getConfig (url: string) { diff --git a/shared/models/plugins/register-server-auth.model.ts b/shared/models/plugins/register-server-auth.model.ts index 4ffce9456..fc6f0f258 100644 --- a/shared/models/plugins/register-server-auth.model.ts +++ b/shared/models/plugins/register-server-auth.model.ts @@ -1,5 +1,5 @@ import { UserRole } from '@shared/models' -import { MOAuthToken, MUser } from '@server/typings/models' +import { MOAuthToken, MUser } from '@server/types/models' import * as express from 'express' export type RegisterServerAuthOptions = RegisterServerAuthPassOptions | RegisterServerAuthExternalOptions diff --git a/tsconfig.json b/tsconfig.json index da09d0d85..d305722c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ ], "typeRoots": [ "node_modules/sitemap/node_modules/@types", - "node_modules/@types" + "node_modules/@types", + "server/typings" ], "baseUrl": "./", "paths": { -- 2.25.1