mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Reorganize imports
This commit is contained in:
parent
c0e8b12e7f
commit
4c7e60bc17
165 changed files with 268 additions and 328 deletions
|
@ -1,10 +1,10 @@
|
|||
import * as express from 'express'
|
||||
import { asyncMiddleware, authenticate } from '../../middlewares'
|
||||
import { removeComment } from '@server/lib/video-comment'
|
||||
import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk'
|
||||
import { VideoCommentModel } from '@server/models/video/video-comment'
|
||||
import { removeComment } from '@server/lib/video-comment'
|
||||
import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
|
||||
import { asyncMiddleware, authenticate } from '../../middlewares'
|
||||
|
||||
const bulkRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ServerConfigManager } from '@server/lib/server-config-manager'
|
||||
import * as express from 'express'
|
||||
import { remove, writeJSON } from 'fs-extra'
|
||||
import { snakeCase } from 'lodash'
|
||||
import validator from 'validator'
|
||||
import { ServerConfigManager } from '@server/lib/server-config-manager'
|
||||
import { UserRight } from '../../../shared'
|
||||
import { About } from '../../../shared/models/server/about.model'
|
||||
import { CustomConfig } from '../../../shared/models/server/custom-config.model'
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import * as express from 'express'
|
||||
import { ServerConfigManager } from '@server/lib/server-config-manager'
|
||||
import { ActorCustomPageModel } from '@server/models/account/actor-custom-page'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { UserRight } from '@shared/models'
|
||||
import { HttpStatusCode, UserRight } from '@shared/models'
|
||||
import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares'
|
||||
|
||||
const customPageRouter = express.Router()
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import * as express from 'express'
|
||||
import { buildNSFWFilter } from '../../helpers/express-utils'
|
||||
import { VideoModel } from '../../models/video/video'
|
||||
import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares'
|
||||
import { TagModel } from '../../models/video/tag'
|
||||
import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews'
|
||||
import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants'
|
||||
import * as memoizee from 'memoizee'
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews'
|
||||
import { buildNSFWFilter } from '../../helpers/express-utils'
|
||||
import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants'
|
||||
import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares'
|
||||
import { TagModel } from '../../models/video/tag'
|
||||
import { VideoModel } from '../../models/video/video'
|
||||
|
||||
const overviewsRouter = express.Router()
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import {
|
|||
updatePluginSettingsValidator
|
||||
} from '@server/middlewares/validators/plugins'
|
||||
import { PluginModel } from '@server/models/server/plugin'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import {
|
||||
HttpStatusCode,
|
||||
InstallOrUpdatePlugin,
|
||||
ManagePlugin,
|
||||
PeertubePluginIndexList,
|
||||
|
|
|
@ -6,8 +6,7 @@ import { WEBSERVER } from '@server/initializers/constants'
|
|||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { ResultList, VideoChannel } from '@shared/models'
|
||||
import { HttpStatusCode, ResultList, VideoChannel } from '@shared/models'
|
||||
import { VideoChannelsSearchQuery } from '../../../../shared/models/search'
|
||||
import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
|
|
|
@ -5,14 +5,14 @@ import { logger } from '@server/helpers/logger'
|
|||
import { doJSONRequest } from '@server/helpers/requests'
|
||||
import { getFormattedObjects } from '@server/helpers/utils'
|
||||
import { CONFIG } from '@server/initializers/config'
|
||||
import { WEBSERVER } from '@server/initializers/constants'
|
||||
import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { VideoPlaylistModel } from '@server/models/video/video-playlist'
|
||||
import { MVideoPlaylistFullSummary } from '@server/types/models'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models'
|
||||
import { HttpStatusCode, ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
openapiOperationDoc,
|
||||
|
@ -23,7 +23,6 @@ import {
|
|||
videoPlaylistsListSearchValidator,
|
||||
videoPlaylistsSearchSortValidator
|
||||
} from '../../../middlewares'
|
||||
import { WEBSERVER } from '@server/initializers/constants'
|
||||
|
||||
const searchPlaylistsRouter = express.Router()
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ import { WEBSERVER } from '@server/initializers/constants'
|
|||
import { getOrCreateAPVideo } from '@server/lib/activitypub/videos'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { ResultList, Video } from '@shared/models'
|
||||
import { HttpStatusCode, ResultList, Video } from '@shared/models'
|
||||
import { VideosSearchQuery } from '../../../../shared/models/search'
|
||||
import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import * as express from 'express'
|
||||
import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares'
|
||||
import { Redis } from '../../../lib/redis'
|
||||
import { Emailer } from '../../../lib/emailer'
|
||||
import { ContactForm } from '../../../../shared/models/server'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { ContactForm } from '../../../../shared/models/server'
|
||||
import { Emailer } from '../../../lib/emailer'
|
||||
import { Redis } from '../../../lib/redis'
|
||||
import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares'
|
||||
|
||||
const contactRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import * as express from 'express'
|
||||
import { contactRouter } from './contact'
|
||||
import { debugRouter } from './debug'
|
||||
import { serverFollowsRouter } from './follows'
|
||||
import { statsRouter } from './stats'
|
||||
import { logsRouter } from './logs'
|
||||
import { serverRedundancyRouter } from './redundancy'
|
||||
import { serverBlocklistRouter } from './server-blocklist'
|
||||
import { contactRouter } from './contact'
|
||||
import { logsRouter } from './logs'
|
||||
import { debugRouter } from './debug'
|
||||
import { statsRouter } from './stats'
|
||||
|
||||
const serverRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import * as express from 'express'
|
||||
import { UserRight } from '../../../../shared/models/users'
|
||||
import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares'
|
||||
import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs'
|
||||
import { readdir, readFile } from 'fs-extra'
|
||||
import { AUDIT_LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS, LOG_FILENAME } from '../../../initializers/constants'
|
||||
import { join } from 'path'
|
||||
import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs'
|
||||
import { LogLevel } from '../../../../shared/models/server/log-level.type'
|
||||
import { CONFIG } from '../../../initializers/config'
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs'
|
||||
import { LogLevel } from '../../../../shared/models/server/log-level.type'
|
||||
import { UserRight } from '../../../../shared/models/users'
|
||||
import { CONFIG } from '../../../initializers/config'
|
||||
import { AUDIT_LOG_FILENAME, LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS } from '../../../initializers/constants'
|
||||
import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares'
|
||||
import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs'
|
||||
|
||||
const logsRouter = express.Router()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'multer'
|
|||
import * as express from 'express'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { AttributesOnly } from '@shared/core-utils'
|
||||
import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model'
|
||||
|
@ -31,7 +32,6 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
|
|||
import { UserModel } from '../../../models/user/user'
|
||||
import { VideoModel } from '../../../models/video/video'
|
||||
import { VideoImportModel } from '../../../models/video/video-import'
|
||||
import { AttributesOnly } from '@shared/core-utils'
|
||||
|
||||
const auditLogger = auditLoggerFactory('users')
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import * as express from 'express'
|
||||
import 'multer'
|
||||
import * as express from 'express'
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { UserNotificationModel } from '@server/models/user/user-notification'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
asyncRetryTransactionMiddleware,
|
||||
|
@ -18,11 +22,7 @@ import {
|
|||
unblockServerByAccountValidator
|
||||
} from '../../../middlewares/validators'
|
||||
import { AccountBlocklistModel } from '../../../models/account/account-blocklist'
|
||||
import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist'
|
||||
import { ServerBlocklistModel } from '../../../models/server/server-blocklist'
|
||||
import { UserNotificationModel } from '@server/models/user/user-notification'
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
|
||||
const myBlocklistRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import * as express from 'express'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
asyncRetryTransactionMiddleware,
|
||||
|
@ -8,10 +11,7 @@ import {
|
|||
userHistoryListValidator,
|
||||
userHistoryRemoveValidator
|
||||
} from '../../../middlewares'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
|
||||
const myVideosHistoryRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as express from 'express'
|
||||
import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
|
||||
import { asyncMiddleware, authenticate } from '../../../middlewares'
|
||||
import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists'
|
||||
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
|
||||
import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
|
||||
|
||||
const myVideoPlaylistsRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import * as express from 'express'
|
||||
import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist'
|
||||
import { UserRight, VideoBlacklistCreate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
|
@ -19,7 +20,6 @@ import {
|
|||
videosBlacklistUpdateValidator
|
||||
} from '../../../middlewares'
|
||||
import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
|
||||
const blacklistRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as express from 'express'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model'
|
||||
import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import * as express from 'express'
|
||||
import { MVideoFullLight } from '@server/types/models'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { sendUpdateVideo } from '../../../lib/activitypub/send'
|
||||
import { changeVideoChannelShare } from '../../../lib/activitypub/share'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
asyncRetryTransactionMiddleware,
|
||||
|
@ -11,15 +17,9 @@ import {
|
|||
videosChangeOwnershipValidator,
|
||||
videosTerminateChangeOwnershipValidator
|
||||
} from '../../../middlewares'
|
||||
import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership'
|
||||
import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
|
||||
import { VideoChannelModel } from '../../../models/video/video-channel'
|
||||
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/types/models'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership'
|
||||
import { VideoChannelModel } from '../../../models/video/video-channel'
|
||||
|
||||
const ownershipVideoRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import * as express from 'express'
|
||||
import { UserVideoRateUpdate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
|
||||
import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares'
|
||||
import { AccountModel } from '../../../models/account/account'
|
||||
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
|
||||
const rateVideoRouter = express.Router()
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as express from 'express'
|
||||
import { UserWatchingVideo } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
asyncRetryTransactionMiddleware,
|
||||
|
@ -8,7 +9,6 @@ import {
|
|||
videoWatchingValidator
|
||||
} from '../../../middlewares'
|
||||
import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
|
||||
const watchingRouter = express.Router()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue