diff options
41 files changed, 78 insertions, 96 deletions
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 5995b8f3a..66a38e055 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' | 2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' |
3 | import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared' | 3 | import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '@shared/models' |
4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
5 | import { isActivityValid } from '../../helpers/custom-validators/activitypub/activity' | 5 | import { isActivityValid } from '../../helpers/custom-validators/activitypub/activity' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts index a6d0b0512..d6211cc83 100644 --- a/server/controllers/api/abuse.ts +++ b/server/controllers/api/abuse.ts | |||
@@ -6,8 +6,7 @@ import { AbuseModel } from '@server/models/abuse/abuse' | |||
6 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' | 6 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' |
7 | import { getServerActor } from '@server/models/application/application' | 7 | import { getServerActor } from '@server/models/application/application' |
8 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' | 8 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' |
9 | import { HttpStatusCode } from '@shared/models' | 9 | import { AbuseCreate, AbuseState, HttpStatusCode, UserRight } from '@shared/models' |
10 | import { AbuseCreate, AbuseState, UserRight } from '../../../shared' | ||
11 | import { getFormattedObjects } from '../../helpers/utils' | 10 | import { getFormattedObjects } from '../../helpers/utils' |
12 | import { sequelizeTypescript } from '../../initializers/database' | 11 | import { sequelizeTypescript } from '../../initializers/database' |
13 | import { | 12 | import { |
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index b253db397..4e3dd4d80 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -3,9 +3,7 @@ import { remove, writeJSON } from 'fs-extra' | |||
3 | import { snakeCase } from 'lodash' | 3 | import { snakeCase } from 'lodash' |
4 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 5 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
6 | import { UserRight } from '../../../shared' | 6 | import { About, CustomConfig, UserRight } from '@shared/models' |
7 | import { About } from '../../../shared/models/server/about.model' | ||
8 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | ||
9 | import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger' | 7 | import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger' |
10 | import { objectConverter } from '../../helpers/core-utils' | 8 | import { objectConverter } from '../../helpers/core-utils' |
11 | import { CONFIG, reloadConfig } from '../../initializers/config' | 9 | import { CONFIG, reloadConfig } from '../../initializers/config' |
diff --git a/server/controllers/api/jobs.ts b/server/controllers/api/jobs.ts index 7001674bb..eebd195b0 100644 --- a/server/controllers/api/jobs.ts +++ b/server/controllers/api/jobs.ts | |||
@@ -1,7 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { ResultList } from '../../../shared' | 2 | import { Job, JobState, JobType, ResultList, UserRight } from '@shared/models' |
3 | import { Job, JobState, JobType } from '../../../shared/models' | ||
4 | import { UserRight } from '../../../shared/models/users' | ||
5 | import { isArray } from '../../helpers/custom-validators/misc' | 3 | import { isArray } from '../../helpers/custom-validators/misc' |
6 | import { JobQueue } from '../../lib/job-queue' | 4 | import { JobQueue } from '../../lib/job-queue' |
7 | import { | 5 | import { |
diff --git a/server/controllers/api/oauth-clients.ts b/server/controllers/api/oauth-clients.ts index 4990fb0df..2d847bdc1 100644 --- a/server/controllers/api/oauth-clients.ts +++ b/server/controllers/api/oauth-clients.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { OAuthClientLocal } from '../../../shared' | 2 | import { OAuthClientModel } from '@server/models/oauth/oauth-client' |
3 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode, OAuthClientLocal } from '@shared/models' |
4 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
5 | import { CONFIG } from '../../initializers/config' | 5 | import { CONFIG } from '../../initializers/config' |
6 | import { asyncMiddleware, openapiOperationDoc } from '../../middlewares' | 6 | import { asyncMiddleware, openapiOperationDoc } from '../../middlewares' |
7 | import { OAuthClientModel } from '../../models/oauth/oauth-client' | ||
8 | 7 | ||
9 | const oauthClientsRouter = express.Router() | 8 | const oauthClientsRouter = express.Router() |
10 | 9 | ||
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index fcee58f6b..7efc3a137 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -4,10 +4,7 @@ import { tokensRouter } from '@server/controllers/api/users/token' | |||
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' | 5 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' |
6 | import { MUser, MUserAccountDefault } from '@server/types/models' | 6 | import { MUser, MUserAccountDefault } from '@server/types/models' |
7 | import { UserCreate, UserCreateResult, UserRight, UserRole, UserUpdate } from '../../../../shared' | 7 | import { HttpStatusCode, UserAdminFlag, UserCreate, UserCreateResult, UserRegister, UserRight, UserRole, UserUpdate } from '@shared/models' |
8 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
9 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' | ||
10 | import { UserRegister } from '../../../../shared/models/users/user-register.model' | ||
11 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '../../../helpers/audit-logger' | 8 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '../../../helpers/audit-logger' |
12 | import { logger } from '../../../helpers/logger' | 9 | import { logger } from '../../../helpers/logger' |
13 | import { generateRandomString, getFormattedObjects } from '../../../helpers/utils' | 10 | import { generateRandomString, getFormattedObjects } from '../../../helpers/utils' |
@@ -210,7 +207,7 @@ async function createUser (req: express.Request, res: express.Response) { | |||
210 | logger.info('Sending to user %s a create password email', body.username) | 207 | logger.info('Sending to user %s a create password email', body.username) |
211 | const verificationString = await Redis.Instance.setCreatePasswordVerificationString(user.id) | 208 | const verificationString = await Redis.Instance.setCreatePasswordVerificationString(user.id) |
212 | const url = WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString | 209 | const url = WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString |
213 | await Emailer.Instance.addPasswordCreateEmailJob(userToCreate.username, user.email, url) | 210 | Emailer.Instance.addPasswordCreateEmailJob(userToCreate.username, user.email, url) |
214 | } | 211 | } |
215 | 212 | ||
216 | Hooks.runAction('action:api.user.created', { body, user, account, videoChannel, req, res }) | 213 | Hooks.runAction('action:api.user.created', { body, user, account, videoChannel, req, res }) |
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index 127b7ca5d..878dd5a84 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts | |||
@@ -2,10 +2,8 @@ import 'multer' | |||
2 | import express from 'express' | 2 | import express from 'express' |
3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' | 3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { ActorImageType, HttpStatusCode, UserUpdateMe, UserVideoQuota, UserVideoRate as FormattedUserVideoRate } from '@shared/models' | ||
5 | import { AttributesOnly } from '@shared/typescript-utils' | 6 | import { AttributesOnly } from '@shared/typescript-utils' |
6 | import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' | ||
7 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
8 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | ||
9 | import { createReqFiles } from '../../../helpers/express-utils' | 7 | import { createReqFiles } from '../../../helpers/express-utils' |
10 | import { getFormattedObjects } from '../../../helpers/utils' | 8 | import { getFormattedObjects } from '../../../helpers/utils' |
11 | import { CONFIG } from '../../../initializers/config' | 9 | import { CONFIG } from '../../../initializers/config' |
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index abb777e08..e65550a22 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -5,8 +5,7 @@ import { ActorFollowModel } from '@server/models/actor/actor-follow' | |||
5 | import { getServerActor } from '@server/models/application/application' | 5 | import { getServerActor } from '@server/models/application/application' |
6 | import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' | 6 | import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' |
7 | import { MChannelBannerAccountDefault } from '@server/types/models' | 7 | import { MChannelBannerAccountDefault } from '@server/types/models' |
8 | import { ActorImageType, VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 8 | import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' |
9 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | ||
10 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' | 9 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' |
11 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 10 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
12 | import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 11 | import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' |
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index de65c74f1..4103bb063 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' | 2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' |
3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' | 3 | import { HttpStatusCode, UserRight, VideoBlacklistCreate } from '@shared/models' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
5 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | 5 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { sequelizeTypescript } from '../../../initializers/database' | 6 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 3c445efce..08d69827b 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -4,6 +4,7 @@ import { decode } from 'magnet-uri' | |||
4 | import parseTorrent, { Instance } from 'parse-torrent' | 4 | import parseTorrent, { Instance } from 'parse-torrent' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos' | 6 | import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos' |
7 | import { Hooks } from '@server/lib/plugins/hooks' | ||
7 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 8 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
8 | import { setVideoTags } from '@server/lib/video' | 9 | import { setVideoTags } from '@server/lib/video' |
9 | import { FilteredModelAttributes } from '@server/types' | 10 | import { FilteredModelAttributes } from '@server/types' |
@@ -18,15 +19,14 @@ import { | |||
18 | MVideoWithBlacklistLight | 19 | MVideoWithBlacklistLight |
19 | } from '@server/types/models' | 20 | } from '@server/types/models' |
20 | import { MVideoImportFormattable } from '@server/types/models/video/video-import' | 21 | import { MVideoImportFormattable } from '@server/types/models/video/video-import' |
21 | import { ServerErrorCode, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared' | 22 | import { ServerErrorCode, ThumbnailType, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '@shared/models' |
22 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' | ||
23 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' | 23 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' |
24 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 24 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
25 | import { isArray } from '../../../helpers/custom-validators/misc' | 25 | import { isArray } from '../../../helpers/custom-validators/misc' |
26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' | 26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' |
27 | import { logger } from '../../../helpers/logger' | 27 | import { logger } from '../../../helpers/logger' |
28 | import { getSecureTorrentName } from '../../../helpers/utils' | 28 | import { getSecureTorrentName } from '../../../helpers/utils' |
29 | import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl' | 29 | import { YoutubeDLInfo, YoutubeDLWrapper } from '../../../helpers/youtube-dl' |
30 | import { CONFIG } from '../../../initializers/config' | 30 | import { CONFIG } from '../../../initializers/config' |
31 | import { MIMETYPES } from '../../../initializers/constants' | 31 | import { MIMETYPES } from '../../../initializers/constants' |
32 | import { sequelizeTypescript } from '../../../initializers/database' | 32 | import { sequelizeTypescript } from '../../../initializers/database' |
@@ -38,7 +38,6 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoIm | |||
38 | import { VideoModel } from '../../../models/video/video' | 38 | import { VideoModel } from '../../../models/video/video' |
39 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 39 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
40 | import { VideoImportModel } from '../../../models/video/video-import' | 40 | import { VideoImportModel } from '../../../models/video/video-import' |
41 | import { Hooks } from '@server/lib/plugins/hooks' | ||
42 | 41 | ||
43 | const auditLogger = auditLoggerFactory('video-imports') | 42 | const auditLogger = auditLoggerFactory('video-imports') |
44 | const videoImportsRouter = express.Router() | 43 | const videoImportsRouter = express.Router() |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index 4ee39aa4f..80ecbfef1 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -10,8 +10,7 @@ import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator | |||
10 | import { VideoLiveModel } from '@server/models/video/video-live' | 10 | import { VideoLiveModel } from '@server/models/video/video-live' |
11 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' | 11 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' |
12 | import { buildUUID, uuidToShort } from '@shared/core-utils' | 12 | import { buildUUID, uuidToShort } from '@shared/core-utils' |
13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' | 13 | import { HttpStatusCode, LiveVideoCreate, LiveVideoUpdate, VideoState } from '@shared/models' |
14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
15 | import { logger } from '../../../helpers/logger' | 14 | import { logger } from '../../../helpers/logger' |
16 | import { sequelizeTypescript } from '../../../initializers/database' | 15 | import { sequelizeTypescript } from '../../../initializers/database' |
17 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' | 16 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index c9cc16644..6b26a8eee 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { HttpStatusCode, UserVideoRateUpdate } from '@shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
5 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' | 4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | 5 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index 589556f47..f600847d4 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts | |||
@@ -6,8 +6,7 @@ import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | |||
6 | import { openapiOperationDoc } from '@server/middlewares/doc' | 6 | import { openapiOperationDoc } from '@server/middlewares/doc' |
7 | import { FilteredModelAttributes } from '@server/types' | 7 | import { FilteredModelAttributes } from '@server/types' |
8 | import { MVideoFullLight } from '@server/types/models' | 8 | import { MVideoFullLight } from '@server/types/models' |
9 | import { VideoUpdate } from '../../../../shared' | 9 | import { HttpStatusCode, VideoUpdate } from '@shared/models' |
10 | import { HttpStatusCode } from '../../../../shared/models' | ||
11 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 10 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
12 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | 11 | import { resetSequelizeInstance } from '../../../helpers/database-utils' |
13 | import { createReqFiles } from '../../../helpers/express-utils' | 12 | import { createReqFiles } from '../../../helpers/express-utils' |
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index ecc4dfa37..e8f400cff 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts | |||
@@ -20,8 +20,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc' | |||
20 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 20 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
21 | import { getLowercaseExtension, uuidToShort } from '@shared/core-utils' | 21 | import { getLowercaseExtension, uuidToShort } from '@shared/core-utils' |
22 | import { isAudioFile } from '@shared/extra-utils' | 22 | import { isAudioFile } from '@shared/extra-utils' |
23 | import { VideoCreate, VideoState } from '../../../../shared' | 23 | import { HttpStatusCode, VideoCreate, VideoResolution, VideoState } from '@shared/models' |
24 | import { HttpStatusCode, VideoResolution } from '../../../../shared/models' | ||
25 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 24 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
26 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 25 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
27 | import { createReqFiles } from '../../../helpers/express-utils' | 26 | import { createReqFiles } from '../../../helpers/express-utils' |
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts index e8c28b613..3fd22caac 100644 --- a/server/controllers/api/videos/watching.ts +++ b/server/controllers/api/videos/watching.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { HttpStatusCode, UserWatchingVideo } from '@shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { | 3 | import { |
5 | asyncMiddleware, | 4 | asyncMiddleware, |
6 | asyncRetryTransactionMiddleware, | 5 | asyncRetryTransactionMiddleware, |
diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts index 5f2e870e3..79ef44be1 100644 --- a/server/helpers/audit-logger.ts +++ b/server/helpers/audit-logger.ts | |||
@@ -5,9 +5,7 @@ import { chain } from 'lodash' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { addColors, config, createLogger, format, transports } from 'winston' | 6 | import { addColors, config, createLogger, format, transports } from 'winston' |
7 | import { AUDIT_LOG_FILENAME } from '@server/initializers/constants' | 7 | import { AUDIT_LOG_FILENAME } from '@server/initializers/constants' |
8 | import { AdminAbuse, User, VideoChannel, VideoDetails, VideoImport } from '../../shared' | 8 | import { AdminAbuse, CustomConfig, User, VideoChannel, VideoComment, VideoDetails, VideoImport } from '@shared/models' |
9 | import { CustomConfig } from '../../shared/models/server/custom-config.model' | ||
10 | import { VideoComment } from '../../shared/models/videos/comment/video-comment.model' | ||
11 | import { CONFIG } from '../initializers/config' | 9 | import { CONFIG } from '../initializers/config' |
12 | import { jsonLoggerFormat, labelFormatter } from './logger' | 10 | import { jsonLoggerFormat, labelFormatter } from './logger' |
13 | 11 | ||
diff --git a/server/helpers/custom-validators/activitypub/playlist.ts b/server/helpers/custom-validators/activitypub/playlist.ts index 72c5b80e9..49bcadcfd 100644 --- a/server/helpers/custom-validators/activitypub/playlist.ts +++ b/server/helpers/custom-validators/activitypub/playlist.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import validator from 'validator' | 1 | import validator from 'validator' |
2 | import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object' | 2 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' |
3 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | ||
4 | import { exists, isDateValid, isUUIDValid } from '../misc' | 3 | import { exists, isDateValid, isUUIDValid } from '../misc' |
5 | import { isVideoPlaylistNameValid } from '../video-playlists' | 4 | import { isVideoPlaylistNameValid } from '../video-playlists' |
6 | import { isActivityPubUrlValid } from './misc' | 5 | import { isActivityPubUrlValid } from './misc' |
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index badf171d2..105c36600 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { values } from 'lodash' | 1 | import { values } from 'lodash' |
2 | import validator from 'validator' | 2 | import validator from 'validator' |
3 | import { UserRole } from '../../../shared' | 3 | import { UserRole } from '@shared/models' |
4 | import { isEmailEnabled } from '../../initializers/config' | 4 | import { isEmailEnabled } from '../../initializers/config' |
5 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers/constants' | 5 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers/constants' |
6 | import { exists, isArray, isBooleanValid } from './misc' | 6 | import { exists, isArray, isBooleanValid } from './misc' |
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 1d56ade6f..e526c4284 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -2,8 +2,7 @@ import { UploadFilesForCheck } from 'express' | |||
2 | import { values } from 'lodash' | 2 | import { values } from 'lodash' |
3 | import magnetUtil from 'magnet-uri' | 3 | import magnetUtil from 'magnet-uri' |
4 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { VideoInclude } from '@shared/models' | 5 | import { VideoFilter, VideoInclude, VideoPrivacy, VideoRateType } from '@shared/models' |
6 | import { VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared' | ||
7 | import { | 6 | import { |
8 | CONSTRAINTS_FIELDS, | 7 | CONSTRAINTS_FIELDS, |
9 | MIMETYPES, | 8 | MIMETYPES, |
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts index bd85eaa56..6b9333b53 100644 --- a/server/helpers/utils.ts +++ b/server/helpers/utils.ts | |||
@@ -2,7 +2,7 @@ import { remove } from 'fs-extra' | |||
2 | import { Instance as ParseTorrent } from 'parse-torrent' | 2 | import { Instance as ParseTorrent } from 'parse-torrent' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { sha256 } from '@shared/extra-utils' | 4 | import { sha256 } from '@shared/extra-utils' |
5 | import { ResultList } from '../../shared' | 5 | import { ResultList } from '@shared/models' |
6 | import { CONFIG } from '../initializers/config' | 6 | import { CONFIG } from '../initializers/config' |
7 | import { execPromise, execPromise2, randomBytesPromise } from './core-utils' | 7 | import { execPromise, execPromise2, randomBytesPromise } from './core-utils' |
8 | import { logger } from './logger' | 8 | import { logger } from './logger' |
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 7c29a42e1..7e321fb76 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { ensureDir, remove } from 'fs-extra' | 1 | import { ensureDir, remove } from 'fs-extra' |
2 | import passwordGenerator from 'password-generator' | 2 | import passwordGenerator from 'password-generator' |
3 | import { UserRole } from '../../shared' | 3 | import { UserRole } from '@shared/models' |
4 | import { logger } from '../helpers/logger' | 4 | import { logger } from '../helpers/logger' |
5 | import { createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' | 5 | import { createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' |
6 | import { ApplicationModel } from '../models/application/application' | 6 | import { ApplicationModel } from '../models/application/application' |
diff --git a/server/lib/activitypub/cache-file.ts b/server/lib/activitypub/cache-file.ts index a16d2cd93..c3acd7112 100644 --- a/server/lib/activitypub/cache-file.ts +++ b/server/lib/activitypub/cache-file.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models' | 2 | import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models' |
3 | import { CacheFileObject } from '../../../shared/index' | 3 | import { CacheFileObject, VideoStreamingPlaylistType } from '@shared/models' |
4 | import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type' | ||
5 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' | 4 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' |
6 | 5 | ||
7 | async function createOrUpdateCacheFile (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId, t: Transaction) { | 6 | async function createOrUpdateCacheFile (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId, t: Transaction) { |
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 93f1d1c59..3e8ad184c 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { isBlockedByServerOrAccount } from '@server/lib/blocklist' | 1 | import { isBlockedByServerOrAccount } from '@server/lib/blocklist' |
2 | import { isRedundancyAccepted } from '@server/lib/redundancy' | 2 | import { isRedundancyAccepted } from '@server/lib/redundancy' |
3 | import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared' | 3 | import { ActivityCreate, CacheFileObject, PlaylistObject, VideoCommentObject, VideoObject } from '@shared/models' |
4 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | ||
5 | import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' | ||
6 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 4 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
7 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
8 | import { sequelizeTypescript } from '../../../initializers/database' | 6 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/lib/activitypub/process/process-dislike.ts b/server/lib/activitypub/process/process-dislike.ts index ecc57cd10..2f46b83d1 100644 --- a/server/lib/activitypub/process/process-dislike.ts +++ b/server/lib/activitypub/process/process-dislike.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { ActivityCreate, ActivityDislike } from '../../../../shared' | 1 | import { ActivityCreate, ActivityDislike, DislikeObject } from '@shared/models' |
2 | import { DislikeObject } from '../../../../shared/models/activitypub/objects' | ||
3 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 2 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
4 | import { sequelizeTypescript } from '../../../initializers/database' | 3 | import { sequelizeTypescript } from '../../../initializers/database' |
5 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 4 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
diff --git a/server/lib/activitypub/process/process-flag.ts b/server/lib/activitypub/process/process-flag.ts index fd3e46e2b..a15d07a62 100644 --- a/server/lib/activitypub/process/process-flag.ts +++ b/server/lib/activitypub/process/process-flag.ts | |||
@@ -3,7 +3,7 @@ import { AccountModel } from '@server/models/account/account' | |||
3 | import { VideoModel } from '@server/models/video/video' | 3 | import { VideoModel } from '@server/models/video/video' |
4 | import { VideoCommentModel } from '@server/models/video/video-comment' | 4 | import { VideoCommentModel } from '@server/models/video/video-comment' |
5 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' | 5 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' |
6 | import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '../../../../shared' | 6 | import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '@shared/models' |
7 | import { getAPId } from '../../../helpers/activitypub' | 7 | import { getAPId } from '../../../helpers/activitypub' |
8 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 8 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
9 | import { logger } from '../../../helpers/logger' | 9 | import { logger } from '../../../helpers/logger' |
diff --git a/server/lib/job-queue/handlers/move-to-object-storage.ts b/server/lib/job-queue/handlers/move-to-object-storage.ts index d9c415b2d..9e39322a8 100644 --- a/server/lib/job-queue/handlers/move-to-object-storage.ts +++ b/server/lib/job-queue/handlers/move-to-object-storage.ts | |||
@@ -11,7 +11,7 @@ import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/l | |||
11 | import { VideoModel } from '@server/models/video/video' | 11 | import { VideoModel } from '@server/models/video/video' |
12 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' | 12 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' |
13 | import { MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoWithAllFiles } from '@server/types/models' | 13 | import { MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoWithAllFiles } from '@server/types/models' |
14 | import { MoveObjectStoragePayload, VideoStorage } from '../../../../shared' | 14 | import { MoveObjectStoragePayload, VideoStorage } from '@shared/models' |
15 | 15 | ||
16 | export async function processMoveToObjectStorage (job: Job) { | 16 | export async function processMoveToObjectStorage (job: Job) { |
17 | const payload = job.data as MoveObjectStoragePayload | 17 | const payload = job.data as MoveObjectStoragePayload |
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index beb78b4a6..2f74e9fbd 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Job } from 'bull' | 1 | import { Job } from 'bull' |
2 | import { move, remove, stat } from 'fs-extra' | 2 | import { move, remove, stat } from 'fs-extra' |
3 | import { getLowercaseExtension } from '@shared/core-utils' | ||
4 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | 3 | import { retryTransactionWrapper } from '@server/helpers/database-utils' |
5 | import { YoutubeDLWrapper } from '@server/helpers/youtube-dl' | 4 | import { YoutubeDLWrapper } from '@server/helpers/youtube-dl' |
6 | import { isPostImportVideoAccepted } from '@server/lib/moderation' | 5 | import { isPostImportVideoAccepted } from '@server/lib/moderation' |
@@ -13,16 +12,19 @@ import { VideoPathManager } from '@server/lib/video-path-manager' | |||
13 | import { buildNextVideoState } from '@server/lib/video-state' | 12 | import { buildNextVideoState } from '@server/lib/video-state' |
14 | import { ThumbnailModel } from '@server/models/video/thumbnail' | 13 | import { ThumbnailModel } from '@server/models/video/thumbnail' |
15 | import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' | 14 | import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' |
15 | import { getLowercaseExtension } from '@shared/core-utils' | ||
16 | import { isAudioFile } from '@shared/extra-utils' | ||
16 | import { | 17 | import { |
18 | ThumbnailType, | ||
17 | VideoImportPayload, | 19 | VideoImportPayload, |
20 | VideoImportState, | ||
18 | VideoImportTorrentPayload, | 21 | VideoImportTorrentPayload, |
19 | VideoImportTorrentPayloadType, | 22 | VideoImportTorrentPayloadType, |
20 | VideoImportYoutubeDLPayload, | 23 | VideoImportYoutubeDLPayload, |
21 | VideoImportYoutubeDLPayloadType, | 24 | VideoImportYoutubeDLPayloadType, |
25 | VideoResolution, | ||
22 | VideoState | 26 | VideoState |
23 | } from '../../../../shared' | 27 | } from '@shared/models' |
24 | import { VideoImportState, VideoResolution } from '../../../../shared/models/videos' | ||
25 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' | ||
26 | import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' | 28 | import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' |
27 | import { logger } from '../../../helpers/logger' | 29 | import { logger } from '../../../helpers/logger' |
28 | import { getSecureTorrentName } from '../../../helpers/utils' | 30 | import { getSecureTorrentName } from '../../../helpers/utils' |
@@ -36,7 +38,6 @@ import { MThumbnail } from '../../../types/models/video/thumbnail' | |||
36 | import { federateVideoIfNeeded } from '../../activitypub/videos' | 38 | import { federateVideoIfNeeded } from '../../activitypub/videos' |
37 | import { Notifier } from '../../notifier' | 39 | import { Notifier } from '../../notifier' |
38 | import { generateVideoMiniature } from '../../thumbnail' | 40 | import { generateVideoMiniature } from '../../thumbnail' |
39 | import { isAudioFile } from '@shared/extra-utils' | ||
40 | 41 | ||
41 | async function processVideoImport (job: Job) { | 42 | async function processVideoImport (job: Job) { |
42 | const payload = job.data as VideoImportPayload | 43 | const payload = job.data as VideoImportPayload |
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 0edcdcba3..ef3abcbcd 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -12,7 +12,7 @@ import { | |||
12 | NewResolutionTranscodingPayload, | 12 | NewResolutionTranscodingPayload, |
13 | OptimizeTranscodingPayload, | 13 | OptimizeTranscodingPayload, |
14 | VideoTranscodingPayload | 14 | VideoTranscodingPayload |
15 | } from '../../../../shared' | 15 | } from '@shared/models' |
16 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 16 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
17 | import { computeLowerResolutionsToTranscode } from '../../../helpers/ffprobe-utils' | 17 | import { computeLowerResolutionsToTranscode } from '../../../helpers/ffprobe-utils' |
18 | import { logger, loggerTagsFactory } from '../../../helpers/logger' | 18 | import { logger, loggerTagsFactory } from '../../../helpers/logger' |
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index 6ef90b275..86d3c1d6c 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { NextFunction, Request, Response } from 'express' | 1 | import { NextFunction, Request, Response } from 'express' |
2 | import { getAPId } from '@server/helpers/activitypub' | 2 | import { getAPId } from '@server/helpers/activitypub' |
3 | import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor' | 3 | import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor' |
4 | import { ActivityDelete, ActivityPubSignature } from '../../shared' | 4 | import { ActivityDelete, ActivityPubSignature, HttpStatusCode } from '@shared/models' |
5 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | ||
6 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
7 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' | 6 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' |
8 | import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' | 7 | import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' |
diff --git a/server/middlewares/user-right.ts b/server/middlewares/user-right.ts index ea95b16c2..7d53e8341 100644 --- a/server/middlewares/user-right.ts +++ b/server/middlewares/user-right.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { UserRight } from '../../shared' | 2 | import { HttpStatusCode, UserRight } from '@shared/models' |
3 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | ||
4 | import { logger } from '../helpers/logger' | 3 | import { logger } from '../helpers/logger' |
5 | 4 | ||
6 | function ensureUserHasRight (userRight: UserRight) { | 5 | function ensureUserHasRight (userRight: UserRight) { |
diff --git a/server/middlewares/validators/videos/video-captions.ts b/server/middlewares/validators/videos/video-captions.ts index 38321ccf9..47c491b4c 100644 --- a/server/middlewares/validators/videos/video-captions.ts +++ b/server/middlewares/validators/videos/video-captions.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { body, param } from 'express-validator' | 2 | import { body, param } from 'express-validator' |
3 | import { UserRight } from '../../../../shared' | 3 | import { UserRight } from '@shared/models' |
4 | import { isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions' | 4 | import { isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions' |
5 | import { cleanUpReqFiles } from '../../../helpers/express-utils' | 5 | import { cleanUpReqFiles } from '../../../helpers/express-utils' |
6 | import { logger } from '../../../helpers/logger' | 6 | import { logger } from '../../../helpers/logger' |
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts index 3ea8bdcbb..665fb04c8 100644 --- a/server/middlewares/validators/videos/video-comments.ts +++ b/server/middlewares/validators/videos/video-comments.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { MUserAccountUrl } from '@server/types/models' | 3 | import { MUserAccountUrl } from '@server/types/models' |
4 | import { UserRight } from '../../../../shared' | 4 | import { HttpStatusCode, UserRight } from '@shared/models' |
5 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
6 | import { exists, isBooleanValid, isIdValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc' | 5 | import { exists, isBooleanValid, isIdValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc' |
7 | import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments' | 6 | import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments' |
8 | import { logger } from '../../../helpers/logger' | 7 | import { logger } from '../../../helpers/logger' |
diff --git a/server/middlewares/validators/videos/video-files.ts b/server/middlewares/validators/videos/video-files.ts index c1fa77502..35b0ac757 100644 --- a/server/middlewares/validators/videos/video-files.ts +++ b/server/middlewares/validators/videos/video-files.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { MVideo } from '@server/types/models' | 2 | import { MVideo } from '@server/types/models' |
3 | import { HttpStatusCode } from '../../../../shared' | 3 | import { HttpStatusCode } from '@shared/models' |
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
5 | import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared' | 5 | import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared' |
6 | 6 | ||
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 8f5c75fd5..ec5a3a9c8 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts | |||
@@ -2,10 +2,14 @@ import express from 'express' | |||
2 | import { body, param, query, ValidationChain } from 'express-validator' | 2 | import { body, param, query, ValidationChain } from 'express-validator' |
3 | import { ExpressPromiseHandler } from '@server/types/express' | 3 | import { ExpressPromiseHandler } from '@server/types/express' |
4 | import { MUserAccountId } from '@server/types/models' | 4 | import { MUserAccountId } from '@server/types/models' |
5 | import { UserRight, VideoPlaylistCreate, VideoPlaylistUpdate } from '../../../../shared' | 5 | import { |
6 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 6 | HttpStatusCode, |
7 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | 7 | UserRight, |
8 | import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' | 8 | VideoPlaylistCreate, |
9 | VideoPlaylistPrivacy, | ||
10 | VideoPlaylistType, | ||
11 | VideoPlaylistUpdate | ||
12 | } from '@shared/models' | ||
9 | import { | 13 | import { |
10 | isArrayOf, | 14 | isArrayOf, |
11 | isIdOrUUIDValid, | 15 | isIdOrUUIDValid, |
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 3ebdbc33d..1e727533b 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -8,9 +8,7 @@ import { getServerActor } from '@server/models/application/application' | |||
8 | import { ExpressPromiseHandler } from '@server/types/express' | 8 | import { ExpressPromiseHandler } from '@server/types/express' |
9 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' | 9 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' |
10 | import { getAllPrivacies } from '@shared/core-utils' | 10 | import { getAllPrivacies } from '@shared/core-utils' |
11 | import { VideoInclude } from '@shared/models' | 11 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude, VideoPrivacy } from '@shared/models' |
12 | import { ServerErrorCode, UserRight, VideoPrivacy } from '../../../../shared' | ||
13 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
14 | import { | 12 | import { |
15 | exists, | 13 | exists, |
16 | isBooleanValid, | 14 | isBooleanValid, |
diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.ts index 218561952..e89d31adf 100644 --- a/server/models/account/account-video-rate.ts +++ b/server/models/account/account-video-rate.ts | |||
@@ -6,10 +6,9 @@ import { | |||
6 | MAccountVideoRateAccountUrl, | 6 | MAccountVideoRateAccountUrl, |
7 | MAccountVideoRateAccountVideo, | 7 | MAccountVideoRateAccountVideo, |
8 | MAccountVideoRateFormattable | 8 | MAccountVideoRateFormattable |
9 | } from '@server/types/models/video/video-rate' | 9 | } from '@server/types/models' |
10 | import { AccountVideoRate, VideoRateType } from '@shared/models' | ||
10 | import { AttributesOnly } from '@shared/typescript-utils' | 11 | import { AttributesOnly } from '@shared/typescript-utils' |
11 | import { AccountVideoRate } from '../../../shared' | ||
12 | import { VideoRateType } from '../../../shared/models/videos' | ||
13 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 12 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
14 | import { CONSTRAINTS_FIELDS, VIDEO_RATE_TYPES } from '../../initializers/constants' | 13 | import { CONSTRAINTS_FIELDS, VIDEO_RATE_TYPES } from '../../initializers/constants' |
15 | import { ActorModel } from '../actor/actor' | 14 | import { ActorModel } from '../actor/actor' |
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 7e4c7ddf2..6f84747da 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts | |||
@@ -16,15 +16,17 @@ import { | |||
16 | } from 'sequelize-typescript' | 16 | } from 'sequelize-typescript' |
17 | import { getServerActor } from '@server/models/application/application' | 17 | import { getServerActor } from '@server/models/application/application' |
18 | import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models' | 18 | import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models' |
19 | import { AttributesOnly } from '@shared/typescript-utils' | ||
20 | import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model' | ||
21 | import { | 19 | import { |
20 | CacheFileObject, | ||
22 | FileRedundancyInformation, | 21 | FileRedundancyInformation, |
23 | StreamingPlaylistRedundancyInformation, | 22 | StreamingPlaylistRedundancyInformation, |
24 | VideoRedundancy | 23 | VideoPrivacy, |
25 | } from '@shared/models/redundancy/video-redundancy.model' | 24 | VideoRedundanciesTarget, |
26 | import { CacheFileObject, VideoPrivacy } from '../../../shared' | 25 | VideoRedundancy, |
27 | import { VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '../../../shared/models/redundancy' | 26 | VideoRedundancyStrategy, |
27 | VideoRedundancyStrategyWithManual | ||
28 | } from '@shared/models' | ||
29 | import { AttributesOnly } from '@shared/typescript-utils' | ||
28 | import { isTestInstance } from '../../helpers/core-utils' | 30 | import { isTestInstance } from '../../helpers/core-utils' |
29 | import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 31 | import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
30 | import { logger } from '../../helpers/logger' | 32 | import { logger } from '../../helpers/logger' |
diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.ts index d71bb4d56..8450ad49e 100644 --- a/server/models/user/user-notification.ts +++ b/server/models/user/user-notification.ts | |||
@@ -2,8 +2,8 @@ import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize' | |||
2 | import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user' | 3 | import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user' |
4 | import { uuidToShort } from '@shared/core-utils' | 4 | import { uuidToShort } from '@shared/core-utils' |
5 | import { UserNotification, UserNotificationType } from '@shared/models' | ||
5 | import { AttributesOnly } from '@shared/typescript-utils' | 6 | import { AttributesOnly } from '@shared/typescript-utils' |
6 | import { UserNotification, UserNotificationType } from '../../../shared' | ||
7 | import { isBooleanValid } from '../../helpers/custom-validators/misc' | 7 | import { isBooleanValid } from '../../helpers/custom-validators/misc' |
8 | import { isUserNotificationTypeValid } from '../../helpers/custom-validators/user-notifications' | 8 | import { isUserNotificationTypeValid } from '../../helpers/custom-validators/user-notifications' |
9 | import { AbuseModel } from '../abuse/abuse' | 9 | import { AbuseModel } from '../abuse/abuse' |
diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts index c41085ef9..c5c1a10f4 100644 --- a/server/models/video/video-import.ts +++ b/server/models/video/video-import.ts | |||
@@ -15,8 +15,8 @@ import { | |||
15 | } from 'sequelize-typescript' | 15 | } from 'sequelize-typescript' |
16 | import { afterCommitIfTransaction } from '@server/helpers/database-utils' | 16 | import { afterCommitIfTransaction } from '@server/helpers/database-utils' |
17 | import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' | 17 | import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' |
18 | import { VideoImport, VideoImportState } from '@shared/models' | ||
18 | import { AttributesOnly } from '@shared/typescript-utils' | 19 | import { AttributesOnly } from '@shared/typescript-utils' |
19 | import { VideoImport, VideoImportState } from '../../../shared' | ||
20 | import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports' | 20 | import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports' |
21 | import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' | 21 | import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' |
22 | import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants' | 22 | import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants' |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 66a9a28fa..1f103f930 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -33,13 +33,22 @@ import { VideoPathManager } from '@server/lib/video-path-manager' | |||
33 | import { getServerActor } from '@server/models/application/application' | 33 | import { getServerActor } from '@server/models/application/application' |
34 | import { ModelCache } from '@server/models/model-cache' | 34 | import { ModelCache } from '@server/models/model-cache' |
35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick, uuidToShort } from '@shared/core-utils' | 35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick, uuidToShort } from '@shared/core-utils' |
36 | import { VideoFile, VideoInclude } from '@shared/models' | 36 | import { |
37 | ResultList, | ||
38 | ThumbnailType, | ||
39 | UserRight, | ||
40 | Video, | ||
41 | VideoDetails, | ||
42 | VideoFile, | ||
43 | VideoInclude, | ||
44 | VideoObject, | ||
45 | VideoPrivacy, | ||
46 | VideoRateType, | ||
47 | VideoState, | ||
48 | VideoStorage, | ||
49 | VideoStreamingPlaylistType | ||
50 | } from '@shared/models' | ||
37 | import { AttributesOnly } from '@shared/typescript-utils' | 51 | import { AttributesOnly } from '@shared/typescript-utils' |
38 | import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared' | ||
39 | import { VideoObject } from '../../../shared/models/activitypub/objects' | ||
40 | import { Video, VideoDetails, VideoRateType, VideoStorage } from '../../../shared/models/videos' | ||
41 | import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' | ||
42 | import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type' | ||
43 | import { peertubeTruncate } from '../../helpers/core-utils' | 52 | import { peertubeTruncate } from '../../helpers/core-utils' |
44 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 53 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
45 | import { exists, isBooleanValid } from '../../helpers/custom-validators/misc' | 54 | import { exists, isBooleanValid } from '../../helpers/custom-validators/misc' |
diff --git a/shared/index.ts b/shared/index.ts deleted file mode 100644 index ad200c539..000000000 --- a/shared/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './models' | ||