From c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 10:42:24 +0200 Subject: Refactor requests --- server/controllers/activitypub/inbox.ts | 2 +- server/controllers/api/abuse.ts | 2 +- server/controllers/api/bulk.ts | 2 +- server/controllers/api/custom-page.ts | 2 +- server/controllers/api/index.ts | 2 +- server/controllers/api/oauth-clients.ts | 2 +- server/controllers/api/plugins.ts | 2 +- server/controllers/api/search/search-video-channels.ts | 2 +- server/controllers/api/search/search-video-playlists.ts | 2 +- server/controllers/api/search/search-videos.ts | 2 +- server/controllers/api/server/contact.ts | 4 ++-- server/controllers/api/server/debug.ts | 2 +- server/controllers/api/server/follows.ts | 2 +- server/controllers/api/server/redundancy.ts | 16 ++++++++-------- server/controllers/api/server/server-blocklist.ts | 4 ++-- server/controllers/api/users/index.ts | 2 +- server/controllers/api/users/me.ts | 2 +- server/controllers/api/users/my-blocklist.ts | 2 +- server/controllers/api/users/my-history.ts | 2 +- server/controllers/api/users/my-notifications.ts | 2 +- server/controllers/api/users/my-subscriptions.ts | 2 +- server/controllers/api/video-channel.ts | 2 +- server/controllers/api/video-playlist.ts | 2 +- server/controllers/api/videos/blacklist.ts | 2 +- server/controllers/api/videos/captions.ts | 2 +- server/controllers/api/videos/comment.ts | 2 +- server/controllers/api/videos/index.ts | 2 +- server/controllers/api/videos/live.ts | 2 +- server/controllers/api/videos/ownership.ts | 2 +- server/controllers/api/videos/rate.ts | 2 +- server/controllers/api/videos/update.ts | 4 ++-- server/controllers/api/videos/upload.ts | 2 +- server/controllers/api/videos/watching.ts | 2 +- server/controllers/client.ts | 2 +- server/controllers/download.ts | 2 +- server/controllers/lazy-static.ts | 2 +- server/controllers/live.ts | 2 +- server/controllers/plugins.ts | 2 +- server/controllers/static.ts | 2 +- 39 files changed, 49 insertions(+), 49 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 14f301ab7..30662990a 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -1,7 +1,7 @@ import * as express from 'express' import { InboxManager } from '@server/lib/activitypub/inbox-manager' import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' import { isActivityValid } from '../../helpers/custom-validators/activitypub/activity' import { logger } from '../../helpers/logger' import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares' diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts index ba5b94840..e851365e9 100644 --- a/server/controllers/api/abuse.ts +++ b/server/controllers/api/abuse.ts @@ -6,7 +6,7 @@ import { AbuseModel } from '@server/models/abuse/abuse' import { AbuseMessageModel } from '@server/models/abuse/abuse-message' import { getServerActor } from '@server/models/application/application' import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' import { AbuseCreate, AbuseState, UserRight } from '../../../shared' import { getFormattedObjects } from '../../helpers/utils' import { sequelizeTypescript } from '../../initializers/database' diff --git a/server/controllers/api/bulk.ts b/server/controllers/api/bulk.ts index 192daccde..10d83571d 100644 --- a/server/controllers/api/bulk.ts +++ b/server/controllers/api/bulk.ts @@ -4,7 +4,7 @@ import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bu 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/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' const bulkRouter = express.Router() diff --git a/server/controllers/api/custom-page.ts b/server/controllers/api/custom-page.ts index c19f03c56..cc1aa8427 100644 --- a/server/controllers/api/custom-page.ts +++ b/server/controllers/api/custom-page.ts @@ -1,7 +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/core-utils' +import { HttpStatusCode } from '@shared/models' import { UserRight } from '@shared/models' import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts index 28378654a..93b14dadb 100644 --- a/server/controllers/api/index.ts +++ b/server/controllers/api/index.ts @@ -1,7 +1,7 @@ import * as cors from 'cors' import * as express from 'express' import * as RateLimit from 'express-rate-limit' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../shared/models' import { badRequest } from '../../helpers/express-utils' import { CONFIG } from '../../initializers/config' import { abuseRouter } from './abuse' diff --git a/server/controllers/api/oauth-clients.ts b/server/controllers/api/oauth-clients.ts index 15bbf5c4d..f95f06864 100644 --- a/server/controllers/api/oauth-clients.ts +++ b/server/controllers/api/oauth-clients.ts @@ -1,6 +1,6 @@ import * as express from 'express' import { OAuthClientLocal } from '../../../shared' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/config' import { asyncMiddleware, openapiOperationDoc } from '../../middlewares' diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index 1e6a02c49..4b213c246 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts @@ -23,7 +23,7 @@ import { updatePluginSettingsValidator } from '@server/middlewares/validators/plugins' import { PluginModel } from '@server/models/server/plugin' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { InstallOrUpdatePlugin, ManagePlugin, diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index 16beeed60..fe9178e69 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts @@ -6,7 +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/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' import { ResultList, VideoChannel } from '@shared/models' import { VideoChannelsSearchQuery } from '../../../../shared/models/search' import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' diff --git a/server/controllers/api/search/search-video-playlists.ts b/server/controllers/api/search/search-video-playlists.ts index b231ff1e2..a0e2c1747 100644 --- a/server/controllers/api/search/search-video-playlists.ts +++ b/server/controllers/api/search/search-video-playlists.ts @@ -11,7 +11,7 @@ import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@ser 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/core-utils' +import { HttpStatusCode } from '@shared/models' import { ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models' import { asyncMiddleware, diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts index b626baa28..0e6fd9c72 100644 --- a/server/controllers/api/search/search-videos.ts +++ b/server/controllers/api/search/search-videos.ts @@ -6,7 +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/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' import { ResultList, Video } from '@shared/models' import { VideosSearchQuery } from '../../../../shared/models/search' import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' diff --git a/server/controllers/api/server/contact.ts b/server/controllers/api/server/contact.ts index caddc0909..ae36dd599 100644 --- a/server/controllers/api/server/contact.ts +++ b/server/controllers/api/server/contact.ts @@ -3,7 +3,7 @@ import { asyncMiddleware, contactAdministratorValidator } from '../../../middlew import { Redis } from '../../../lib/redis' import { Emailer } from '../../../lib/emailer' import { ContactForm } from '../../../../shared/models/server' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const contactRouter = express.Router() @@ -15,7 +15,7 @@ contactRouter.post('/contact', async function contactAdministrator (req: express.Request, res: express.Response) { const data = req.body as ContactForm - await Emailer.Instance.addContactFormJob(data.fromEmail, data.fromName, data.subject, data.body) + Emailer.Instance.addContactFormJob(data.fromEmail, data.fromName, data.subject, data.body) await Redis.Instance.setContactFormIp(req.ip) diff --git a/server/controllers/api/server/debug.ts b/server/controllers/api/server/debug.ts index 31888e963..0601b89ce 100644 --- a/server/controllers/api/server/debug.ts +++ b/server/controllers/api/server/debug.ts @@ -2,7 +2,7 @@ import * as express from 'express' import { InboxManager } from '@server/lib/activitypub/inbox-manager' import { RemoveDanglingResumableUploadsScheduler } from '@server/lib/schedulers/remove-dangling-resumable-uploads-scheduler' import { Debug, SendDebugCommand } from '@shared/models' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserRight } from '../../../../shared/models/users' import { authenticate, ensureUserHasRight } from '../../../middlewares' diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index 12357a2ca..e6f4f6b92 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts @@ -1,6 +1,6 @@ import * as express from 'express' import { getServerActor } from '@server/models/application/application' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserRight } from '../../../../shared/models/users' import { logger } from '../../../helpers/logger' import { getFormattedObjects } from '../../../helpers/utils' diff --git a/server/controllers/api/server/redundancy.ts b/server/controllers/api/server/redundancy.ts index bc593ad43..99d1c762b 100644 --- a/server/controllers/api/server/redundancy.ts +++ b/server/controllers/api/server/redundancy.ts @@ -1,5 +1,10 @@ import * as express from 'express' +import { JobQueue } from '@server/lib/job-queue' +import { VideoRedundancyModel } from '@server/models/redundancy/video-redundancy' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserRight } from '../../../../shared/models/users' +import { logger } from '../../../helpers/logger' +import { removeRedundanciesOfServer, removeVideoRedundancy } from '../../../lib/redundancy' import { asyncMiddleware, authenticate, @@ -10,16 +15,11 @@ import { videoRedundanciesSortValidator } from '../../../middlewares' import { - listVideoRedundanciesValidator, - updateServerRedundancyValidator, addVideoRedundancyValidator, - removeVideoRedundancyValidator + listVideoRedundanciesValidator, + removeVideoRedundancyValidator, + updateServerRedundancyValidator } from '../../../middlewares/validators/redundancy' -import { removeRedundanciesOfServer, removeVideoRedundancy } from '../../../lib/redundancy' -import { logger } from '../../../helpers/logger' -import { VideoRedundancyModel } from '@server/models/redundancy/video-redundancy' -import { JobQueue } from '@server/lib/job-queue' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const serverRedundancyRouter = express.Router() diff --git a/server/controllers/api/server/server-blocklist.ts b/server/controllers/api/server/server-blocklist.ts index a86bc7d19..b3ee50d85 100644 --- a/server/controllers/api/server/server-blocklist.ts +++ b/server/controllers/api/server/server-blocklist.ts @@ -1,8 +1,9 @@ import 'multer' import * as express from 'express' import { logger } from '@server/helpers/logger' -import { UserNotificationModel } from '@server/models/user/user-notification' import { getServerActor } from '@server/models/application/application' +import { UserNotificationModel } from '@server/models/user/user-notification' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserRight } from '../../../../shared/models/users' import { getFormattedObjects } from '../../../helpers/utils' import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist' @@ -25,7 +26,6 @@ import { } from '../../../middlewares/validators' import { AccountBlocklistModel } from '../../../models/account/account-blocklist' import { ServerBlocklistModel } from '../../../models/server/server-blocklist' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const serverBlocklistRouter = express.Router() diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index b86fc94ef..be800e8b5 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -5,7 +5,7 @@ import { Hooks } from '@server/lib/plugins/hooks' import { OAuthTokenModel } from '@server/models/oauth/oauth-token' import { MUser, MUserAccountDefault } from '@server/types/models' import { UserCreate, UserCreateResult, UserRight, UserRole, UserUpdate } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' import { UserRegister } from '../../../../shared/models/users/user-register.model' import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '../../../helpers/audit-logger' diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index 1f2b2f9dd..c9610c59f 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts @@ -3,7 +3,7 @@ import * as express from 'express' import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' import { Hooks } from '@server/lib/plugins/hooks' import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' import { createReqFiles } from '../../../helpers/express-utils' import { getFormattedObjects } from '../../../helpers/utils' diff --git a/server/controllers/api/users/my-blocklist.ts b/server/controllers/api/users/my-blocklist.ts index a1561b751..fe11b6e77 100644 --- a/server/controllers/api/users/my-blocklist.ts +++ b/server/controllers/api/users/my-blocklist.ts @@ -22,7 +22,7 @@ import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist 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/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const myBlocklistRouter = express.Router() diff --git a/server/controllers/api/users/my-history.ts b/server/controllers/api/users/my-history.ts index cff1697ab..85e04925e 100644 --- a/server/controllers/api/users/my-history.ts +++ b/server/controllers/api/users/my-history.ts @@ -11,7 +11,7 @@ import { import { getFormattedObjects } from '../../../helpers/utils' import { UserVideoHistoryModel } from '../../../models/user/user-video-history' import { sequelizeTypescript } from '../../../initializers/database' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const myVideosHistoryRouter = express.Router() diff --git a/server/controllers/api/users/my-notifications.ts b/server/controllers/api/users/my-notifications.ts index 2909770da..3beee07c0 100644 --- a/server/controllers/api/users/my-notifications.ts +++ b/server/controllers/api/users/my-notifications.ts @@ -1,7 +1,7 @@ import 'multer' import * as express from 'express' import { UserNotificationModel } from '@server/models/user/user-notification' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { UserNotificationSetting } from '../../../../shared/models/users' import { getFormattedObjects } from '../../../helpers/utils' import { diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts index 46a73d49e..84f519926 100644 --- a/server/controllers/api/users/my-subscriptions.ts +++ b/server/controllers/api/users/my-subscriptions.ts @@ -3,7 +3,7 @@ import * as express from 'express' import { sendUndoFollow } from '@server/lib/activitypub/send' import { VideoChannelModel } from '@server/models/video/video-channel' import { VideosCommonQuery } from '@shared/models' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' import { getFormattedObjects } from '../../../helpers/utils' import { WEBSERVER } from '../../../initializers/constants' diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index bc8d203b0..784f97b1e 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts @@ -3,7 +3,7 @@ import { Hooks } from '@server/lib/plugins/hooks' import { getServerActor } from '@server/models/application/application' import { MChannelBannerAccountDefault } from '@server/types/models' import { ActorImageType, VideoChannelCreate, VideoChannelUpdate, VideosCommonQuery } from '../../../shared' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' import { resetSequelizeInstance } from '../../helpers/database-utils' import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 78cbd9cff..4971d0a77 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts @@ -6,7 +6,7 @@ import { Hooks } from '@server/lib/plugins/hooks' import { getServerActor } from '@server/models/application/application' import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' import { VideoPlaylistCreate } from '../../../shared/models/videos/playlist/video-playlist-create.model' import { VideoPlaylistElementCreate } from '../../../shared/models/videos/playlist/video-playlist-element-create.model' import { VideoPlaylistElementUpdate } from '../../../shared/models/videos/playlist/video-playlist-element-update.model' diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index 530e17965..a7f5f53d8 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts @@ -19,7 +19,7 @@ import { videosBlacklistUpdateValidator } from '../../../middlewares' import { VideoBlacklistModel } from '../../../models/video/video-blacklist' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const blacklistRouter = express.Router() diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts index ad7423a31..4008de60f 100644 --- a/server/controllers/api/videos/captions.ts +++ b/server/controllers/api/videos/captions.ts @@ -1,6 +1,6 @@ import * as express from 'express' import { MVideoCaption } from '@server/types/models' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' import { createReqFiles } from '../../../helpers/express-utils' import { logger } from '../../../helpers/logger' diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index 6a25511e5..90b633bb5 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts @@ -1,5 +1,5 @@ import * as express from 'express' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 74b100e59..5a2ff81dc 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -6,7 +6,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc' import { getServerActor } from '@server/models/application/application' import { MVideoAccountLight } from '@server/types/models' import { VideosCommonQuery } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs' +import { HttpStatusCode } from '../../../../shared/models' import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' import { logger } from '../../../helpers/logger' diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index d8c51c2d4..ed4da8f47 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts @@ -11,7 +11,7 @@ import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator import { VideoLiveModel } from '@server/models/video/video-live' import { MVideoDetails, MVideoFullLight } from '@server/types/models' import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { logger } from '../../../helpers/logger' import { sequelizeTypescript } from '../../../initializers/database' import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts index 1bb96e046..e6c94a45a 100644 --- a/server/controllers/api/videos/ownership.ts +++ b/server/controllers/api/videos/ownership.ts @@ -19,7 +19,7 @@ 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/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const ownershipVideoRouter = express.Router() diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 84f42633e..134c9e5ca 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts @@ -7,7 +7,7 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUp import { AccountModel } from '../../../models/account/account' import { AccountVideoRateModel } from '../../../models/account/account-video-rate' import { sequelizeTypescript } from '../../../initializers/database' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const rateVideoRouter = express.Router() diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index 8affe71c6..49639060b 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts @@ -2,10 +2,11 @@ import * as express from 'express' import { Transaction } from 'sequelize/types' import { changeVideoChannelShare } from '@server/lib/activitypub/share' import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' +import { openapiOperationDoc } from '@server/middlewares/doc' import { FilteredModelAttributes } from '@server/types' import { MVideoFullLight } from '@server/types/models' import { VideoUpdate } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs' +import { HttpStatusCode } from '../../../../shared/models' import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' import { resetSequelizeInstance } from '../../../helpers/database-utils' import { createReqFiles } from '../../../helpers/express-utils' @@ -20,7 +21,6 @@ import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares' import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' import { VideoModel } from '../../../models/video/video' -import { openapiOperationDoc } from '@server/middlewares/doc' const lTags = loggerTagsFactory('api', 'video') const auditLogger = auditLoggerFactory('videos') diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index bcd21ac99..1603ef127 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts @@ -11,7 +11,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc' import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' import { uploadx } from '@uploadx/core' import { VideoCreate, VideoState } from '../../../../shared' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs' +import { HttpStatusCode } from '../../../../shared/models' import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' import { retryTransactionWrapper } from '../../../helpers/database-utils' import { createReqFiles } from '../../../helpers/express-utils' diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts index 8b15525aa..2899dbd9c 100644 --- a/server/controllers/api/videos/watching.ts +++ b/server/controllers/api/videos/watching.ts @@ -8,7 +8,7 @@ import { videoWatchingValidator } from '../../../middlewares' import { UserVideoHistoryModel } from '../../../models/user/user-video-history' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' const watchingRouter = express.Router() diff --git a/server/controllers/client.ts b/server/controllers/client.ts index eb1ee6cbd..ba3c54440 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -5,7 +5,7 @@ import { join } from 'path' import { logger } from '@server/helpers/logger' import { CONFIG } from '@server/initializers/config' import { Hooks } from '@server/lib/plugins/hooks' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { buildFileLocale, getCompleteLocale, is18nLocale, LOCALE_FILES } from '@shared/core-utils/i18n' import { root } from '../helpers/core-utils' import { STATIC_MAX_AGE } from '../initializers/constants' diff --git a/server/controllers/download.ts b/server/controllers/download.ts index 4293a32e2..13bc66900 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts @@ -5,7 +5,7 @@ import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache import { Hooks } from '@server/lib/plugins/hooks' import { getVideoFilePath } from '@server/lib/video-paths' import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' import { VideoStreamingPlaylistType } from '@shared/models' import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' import { asyncMiddleware, videosDownloadValidator } from '../middlewares' diff --git a/server/controllers/lazy-static.ts b/server/controllers/lazy-static.ts index 9a7dacba0..632e4dcd8 100644 --- a/server/controllers/lazy-static.ts +++ b/server/controllers/lazy-static.ts @@ -1,7 +1,7 @@ import * as cors from 'cors' import * as express from 'express' import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' -import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../shared/models/http/http-error-codes' import { logger } from '../helpers/logger' import { LAZY_STATIC_PATHS, STATIC_MAX_AGE } from '../initializers/constants' import { VideosCaptionCache, VideosPreviewCache } from '../lib/files-cache' diff --git a/server/controllers/live.ts b/server/controllers/live.ts index f2686fb23..95d5c0135 100644 --- a/server/controllers/live.ts +++ b/server/controllers/live.ts @@ -2,7 +2,7 @@ import * as cors from 'cors' import * as express from 'express' import { mapToJSON } from '@server/helpers/core-utils' import { LiveSegmentShaStore } from '@server/lib/live' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' const liveRouter = express.Router() diff --git a/server/controllers/plugins.ts b/server/controllers/plugins.ts index 7213e3f15..11ab3f10a 100644 --- a/server/controllers/plugins.ts +++ b/server/controllers/plugins.ts @@ -3,7 +3,7 @@ import { join } from 'path' import { logger } from '@server/helpers/logger' import { optionalAuthenticate } from '@server/middlewares/auth' import { getCompleteLocale, is18nLocale } from '../../shared/core-utils/i18n' -import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '../../shared/models/http/http-error-codes' import { PluginType } from '../../shared/models/plugins/plugin.type' import { isTestInstance } from '../helpers/core-utils' import { PLUGIN_GLOBAL_CSS_PATH } from '../initializers/constants' diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 35e024dda..5900eaff3 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -3,7 +3,7 @@ import * as express from 'express' import { join } from 'path' import { serveIndexHTML } from '@server/lib/client-html' import { ServerConfigManager } from '@server/lib/server-config-manager' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/models' import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo/nodeinfo.model' import { root } from '../helpers/core-utils' import { CONFIG, isEmailEnabled } from '../initializers/config' -- cgit v1.2.3