diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
commit | 74dc3bca2b14f5fd3fe80c394dfc34177a46db77 (patch) | |
tree | e4b307beb6255420c9993a2aed470438317f100f /server/middlewares/validators | |
parent | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (diff) | |
download | PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.gz PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.zst PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.zip |
Don't expose constants directly in initializers/
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/avatar.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/follows.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/sort.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos/video-captions.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos/video-channels.ts | 3 | ||||
-rw-r--r-- | server/middlewares/validators/videos/video-imports.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos/video-playlists.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 2 |
8 files changed, 8 insertions, 9 deletions
diff --git a/server/middlewares/validators/avatar.ts b/server/middlewares/validators/avatar.ts index ddc14f531..bab3ed118 100644 --- a/server/middlewares/validators/avatar.ts +++ b/server/middlewares/validators/avatar.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import { body } from 'express-validator/check' | 2 | import { body } from 'express-validator/check' |
3 | import { isAvatarFile } from '../../helpers/custom-validators/users' | 3 | import { isAvatarFile } from '../../helpers/custom-validators/users' |
4 | import { areValidationErrors } from './utils' | 4 | import { areValidationErrors } from './utils' |
5 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 5 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
7 | import { cleanUpReqFiles } from '../../helpers/express-utils' | 7 | import { cleanUpReqFiles } from '../../helpers/express-utils' |
8 | 8 | ||
diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index 5623b4ba6..2e5a02307 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts | |||
@@ -4,7 +4,7 @@ import { isTestInstance } from '../../helpers/core-utils' | |||
4 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' | 4 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' |
5 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { getServerActor } from '../../helpers/utils' | 6 | import { getServerActor } from '../../helpers/utils' |
7 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers' | 7 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers/constants' |
8 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' | 8 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' |
9 | import { areValidationErrors } from './utils' | 9 | import { areValidationErrors } from './utils' |
10 | import { ActorModel } from '../../models/activitypub/actor' | 10 | import { ActorModel } from '../../models/activitypub/actor' |
diff --git a/server/middlewares/validators/sort.ts b/server/middlewares/validators/sort.ts index 44295c325..b497798d1 100644 --- a/server/middlewares/validators/sort.ts +++ b/server/middlewares/validators/sort.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { SORTABLE_COLUMNS } from '../../initializers' | 1 | import { SORTABLE_COLUMNS } from '../../initializers/constants' |
2 | import { checkSort, createSortableColumns } from './utils' | 2 | import { checkSort, createSortableColumns } from './utils' |
3 | 3 | ||
4 | // Initialize constants here for better performances | 4 | // Initialize constants here for better performances |
diff --git a/server/middlewares/validators/videos/video-captions.ts b/server/middlewares/validators/videos/video-captions.ts index b2b259aff..d857ac3ec 100644 --- a/server/middlewares/validators/videos/video-captions.ts +++ b/server/middlewares/validators/videos/video-captions.ts | |||
@@ -3,7 +3,7 @@ import { areValidationErrors } from '../utils' | |||
3 | import { checkUserCanManageVideo, doesVideoExist } from '../../../helpers/custom-validators/videos' | 3 | import { checkUserCanManageVideo, doesVideoExist } from '../../../helpers/custom-validators/videos' |
4 | import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' | 4 | import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' |
5 | import { body, param } from 'express-validator/check' | 5 | import { body, param } from 'express-validator/check' |
6 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 6 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
7 | import { UserRight } from '../../../../shared' | 7 | import { UserRight } from '../../../../shared' |
8 | import { logger } from '../../../helpers/logger' | 8 | import { logger } from '../../../helpers/logger' |
9 | import { doesVideoCaptionExist, isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions' | 9 | import { doesVideoCaptionExist, isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions' |
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index e2067c4d9..4b26f0bc4 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { body, param } from 'express-validator/check' | 2 | import { body, param } from 'express-validator/check' |
3 | import { UserRight } from '../../../../shared' | 3 | import { UserRight } from '../../../../shared' |
4 | import { doesAccountNameWithHostExist } from '../../../helpers/custom-validators/accounts' | ||
5 | import { | 4 | import { |
6 | doesLocalVideoChannelNameExist, | 5 | doesLocalVideoChannelNameExist, |
6 | doesVideoChannelNameWithHostExist, | ||
7 | isVideoChannelDescriptionValid, | 7 | isVideoChannelDescriptionValid, |
8 | isVideoChannelNameValid, | 8 | isVideoChannelNameValid, |
9 | doesVideoChannelNameWithHostExist, | ||
10 | isVideoChannelSupportValid | 9 | isVideoChannelSupportValid |
11 | } from '../../../helpers/custom-validators/video-channels' | 10 | } from '../../../helpers/custom-validators/video-channels' |
12 | import { logger } from '../../../helpers/logger' | 11 | import { logger } from '../../../helpers/logger' |
diff --git a/server/middlewares/validators/videos/video-imports.ts b/server/middlewares/validators/videos/video-imports.ts index fb13f3ceb..452084a7c 100644 --- a/server/middlewares/validators/videos/video-imports.ts +++ b/server/middlewares/validators/videos/video-imports.ts | |||
@@ -8,7 +8,7 @@ import { isVideoImportTargetUrlValid, isVideoImportTorrentFile } from '../../../ | |||
8 | import { cleanUpReqFiles } from '../../../helpers/express-utils' | 8 | import { cleanUpReqFiles } from '../../../helpers/express-utils' |
9 | import { doesVideoChannelOfAccountExist, isVideoMagnetUriValid, isVideoNameValid } from '../../../helpers/custom-validators/videos' | 9 | import { doesVideoChannelOfAccountExist, isVideoMagnetUriValid, isVideoNameValid } from '../../../helpers/custom-validators/videos' |
10 | import { CONFIG } from '../../../initializers/config' | 10 | import { CONFIG } from '../../../initializers/config' |
11 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 11 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
12 | 12 | ||
13 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ | 13 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ |
14 | body('channelId') | 14 | body('channelId') |
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 6ba30fac9..2c3f7e542 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts | |||
@@ -5,7 +5,7 @@ import { logger } from '../../../helpers/logger' | |||
5 | import { UserModel } from '../../../models/account/user' | 5 | import { UserModel } from '../../../models/account/user' |
6 | import { areValidationErrors } from '../utils' | 6 | import { areValidationErrors } from '../utils' |
7 | import { doesVideoExist, isVideoImage } from '../../../helpers/custom-validators/videos' | 7 | import { doesVideoExist, isVideoImage } from '../../../helpers/custom-validators/videos' |
8 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 8 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
9 | import { isArrayOf, isIdOrUUIDValid, isIdValid, isUUIDValid, toIntArray, toValueOrNull } from '../../../helpers/custom-validators/misc' | 9 | import { isArrayOf, isIdOrUUIDValid, isIdValid, isUUIDValid, toIntArray, toValueOrNull } from '../../../helpers/custom-validators/misc' |
10 | import { | 10 | import { |
11 | doesVideoPlaylistExist, | 11 | doesVideoPlaylistExist, |
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 7ce1a922f..e9b036a02 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -32,7 +32,7 @@ import { | |||
32 | } from '../../../helpers/custom-validators/videos' | 32 | } from '../../../helpers/custom-validators/videos' |
33 | import { getDurationFromVideoFile } from '../../../helpers/ffmpeg-utils' | 33 | import { getDurationFromVideoFile } from '../../../helpers/ffmpeg-utils' |
34 | import { logger } from '../../../helpers/logger' | 34 | import { logger } from '../../../helpers/logger' |
35 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 35 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
36 | import { authenticatePromiseIfNeeded } from '../../oauth' | 36 | import { authenticatePromiseIfNeeded } from '../../oauth' |
37 | import { areValidationErrors } from '../utils' | 37 | import { areValidationErrors } from '../utils' |
38 | import { cleanUpReqFiles } from '../../../helpers/express-utils' | 38 | import { cleanUpReqFiles } from '../../../helpers/express-utils' |