aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 14:27:30 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:19 +0200
commit4c7e60bc17ee5830399bac4aa273356903421b4c (patch)
tree9e67397cf49b229b5bc0f9747f1a7e387bba558a /server/middlewares/validators
parentc0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (diff)
downloadPeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.gz
PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.zst
PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.zip
Reorganize imports
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/activitypub/activity.ts4
-rw-r--r--server/middlewares/validators/bulk.ts3
-rw-r--r--server/middlewares/validators/feeds.ts1
-rw-r--r--server/middlewares/validators/shared/videos.ts3
-rw-r--r--server/middlewares/validators/videos/video-live.ts3
-rw-r--r--server/middlewares/validators/videos/video-ownership-changes.ts10
6 files changed, 13 insertions, 11 deletions
diff --git a/server/middlewares/validators/activitypub/activity.ts b/server/middlewares/validators/activitypub/activity.ts
index d65a8e455..d24e4427b 100644
--- a/server/middlewares/validators/activitypub/activity.ts
+++ b/server/middlewares/validators/activitypub/activity.ts
@@ -1,8 +1,8 @@
1import * as express from 'express' 1import * as express from 'express'
2import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub/activity'
3import { logger } from '../../../helpers/logger'
4import { getServerActor } from '@server/models/application/application' 2import { getServerActor } from '@server/models/application/application'
5import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' 3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub/activity'
5import { logger } from '../../../helpers/logger'
6 6
7async function activityPubValidator (req: express.Request, res: express.Response, next: express.NextFunction) { 7async function activityPubValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
8 logger.debug('Checking activity pub parameters') 8 logger.debug('Checking activity pub parameters')
diff --git a/server/middlewares/validators/bulk.ts b/server/middlewares/validators/bulk.ts
index 4057b1e01..6fec58149 100644
--- a/server/middlewares/validators/bulk.ts
+++ b/server/middlewares/validators/bulk.ts
@@ -1,8 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body } from 'express-validator' 2import { body } from 'express-validator'
3import { isBulkRemoveCommentsOfScopeValid } from '@server/helpers/custom-validators/bulk' 3import { isBulkRemoveCommentsOfScopeValid } from '@server/helpers/custom-validators/bulk'
4import { HttpStatusCode } from '@shared/models' 4import { HttpStatusCode, UserRight } from '@shared/models'
5import { UserRight } from '@shared/models'
6import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' 5import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
7import { logger } from '../../helpers/logger' 6import { logger } from '../../helpers/logger'
8import { areValidationErrors, doesAccountNameWithHostExist } from './shared' 7import { areValidationErrors, doesAccountNameWithHostExist } from './shared'
diff --git a/server/middlewares/validators/feeds.ts b/server/middlewares/validators/feeds.ts
index 1a5a8ffa0..d29bebf64 100644
--- a/server/middlewares/validators/feeds.ts
+++ b/server/middlewares/validators/feeds.ts
@@ -1,6 +1,5 @@
1import * as express from 'express' 1import * as express from 'express'
2import { param, query } from 'express-validator' 2import { param, query } from 'express-validator'
3
4import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' 3import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
5import { isValidRSSFeed } from '../../helpers/custom-validators/feeds' 4import { isValidRSSFeed } from '../../helpers/custom-validators/feeds'
6import { exists, isIdOrUUIDValid, isIdValid, toCompleteUUID } from '../../helpers/custom-validators/misc' 5import { exists, isIdOrUUIDValid, isIdValid, toCompleteUUID } from '../../helpers/custom-validators/misc'
diff --git a/server/middlewares/validators/shared/videos.ts b/server/middlewares/validators/shared/videos.ts
index 7f42a4893..71b81654f 100644
--- a/server/middlewares/validators/shared/videos.ts
+++ b/server/middlewares/validators/shared/videos.ts
@@ -12,8 +12,7 @@ import {
12 MVideoImmutable, 12 MVideoImmutable,
13 MVideoThumbnail 13 MVideoThumbnail
14} from '@server/types/models' 14} from '@server/types/models'
15import { HttpStatusCode } from '@shared/models' 15import { HttpStatusCode, UserRight } from '@shared/models'
16import { UserRight } from '@shared/models'
17 16
18async function doesVideoExist (id: number | string, res: Response, fetchType: VideoLoadType = 'all') { 17async function doesVideoExist (id: number | string, res: Response, fetchType: VideoLoadType = 'all') {
19 const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined 18 const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
diff --git a/server/middlewares/validators/videos/video-live.ts b/server/middlewares/validators/videos/video-live.ts
index 5c8a4269d..97e8b4510 100644
--- a/server/middlewares/validators/videos/video-live.ts
+++ b/server/middlewares/validators/videos/video-live.ts
@@ -5,8 +5,7 @@ import { isLocalLiveVideoAccepted } from '@server/lib/moderation'
5import { Hooks } from '@server/lib/plugins/hooks' 5import { Hooks } from '@server/lib/plugins/hooks'
6import { VideoModel } from '@server/models/video/video' 6import { VideoModel } from '@server/models/video/video'
7import { VideoLiveModel } from '@server/models/video/video-live' 7import { VideoLiveModel } from '@server/models/video/video-live'
8import { HttpStatusCode } from '@shared/models' 8import { HttpStatusCode, ServerErrorCode, UserRight, VideoState } from '@shared/models'
9import { ServerErrorCode, UserRight, VideoState } from '@shared/models'
10import { isBooleanValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc' 9import { isBooleanValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc'
11import { isVideoNameValid } from '../../../helpers/custom-validators/videos' 10import { isVideoNameValid } from '../../../helpers/custom-validators/videos'
12import { cleanUpReqFiles } from '../../../helpers/express-utils' 11import { cleanUpReqFiles } from '../../../helpers/express-utils'
diff --git a/server/middlewares/validators/videos/video-ownership-changes.ts b/server/middlewares/validators/videos/video-ownership-changes.ts
index 06f86a4c8..a7f0b72c3 100644
--- a/server/middlewares/validators/videos/video-ownership-changes.ts
+++ b/server/middlewares/validators/videos/video-ownership-changes.ts
@@ -6,8 +6,14 @@ import { logger } from '@server/helpers/logger'
6import { isAbleToUploadVideo } from '@server/lib/user' 6import { isAbleToUploadVideo } from '@server/lib/user'
7import { AccountModel } from '@server/models/account/account' 7import { AccountModel } from '@server/models/account/account'
8import { MVideoWithAllFiles } from '@server/types/models' 8import { MVideoWithAllFiles } from '@server/types/models'
9import { HttpStatusCode } from '@shared/models' 9import {
10import { ServerErrorCode, UserRight, VideoChangeOwnershipAccept, VideoChangeOwnershipStatus, VideoState } from '@shared/models' 10 HttpStatusCode,
11 ServerErrorCode,
12 UserRight,
13 VideoChangeOwnershipAccept,
14 VideoChangeOwnershipStatus,
15 VideoState
16} from '@shared/models'
11import { 17import {
12 areValidationErrors, 18 areValidationErrors,
13 checkUserCanManageVideo, 19 checkUserCanManageVideo,