Fix shared imports
This commit is contained in:
parent
1e9c1b1b44
commit
d17c7b4e8c
41 changed files with 78 additions and 96 deletions
|
@ -1,6 +1,6 @@
|
|||
import express from 'express'
|
||||
import { InboxManager } from '@server/lib/activitypub/inbox-manager'
|
||||
import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared'
|
||||
import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '@shared/models'
|
||||
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
|
||||
import { isActivityValid } from '../../helpers/custom-validators/activitypub/activity'
|
||||
import { logger } from '../../helpers/logger'
|
||||
|
|
|
@ -6,8 +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/models'
|
||||
import { AbuseCreate, AbuseState, UserRight } from '../../../shared'
|
||||
import { AbuseCreate, AbuseState, HttpStatusCode, UserRight } from '@shared/models'
|
||||
import { getFormattedObjects } from '../../helpers/utils'
|
||||
import { sequelizeTypescript } from '../../initializers/database'
|
||||
import {
|
||||
|
|
|
@ -3,9 +3,7 @@ import { remove, writeJSON } from 'fs-extra'
|
|||
import { snakeCase } from 'lodash'
|
||||
import validator from 'validator'
|
||||
import { ServerConfigManager } from '@server/lib/server-config-manager'
|
||||
import { UserRight } from '../../../shared'
|
||||
import { About } from '../../../shared/models/server/about.model'
|
||||
import { CustomConfig } from '../../../shared/models/server/custom-config.model'
|
||||
import { About, CustomConfig, UserRight } from '@shared/models'
|
||||
import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger'
|
||||
import { objectConverter } from '../../helpers/core-utils'
|
||||
import { CONFIG, reloadConfig } from '../../initializers/config'
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import express from 'express'
|
||||
import { ResultList } from '../../../shared'
|
||||
import { Job, JobState, JobType } from '../../../shared/models'
|
||||
import { UserRight } from '../../../shared/models/users'
|
||||
import { Job, JobState, JobType, ResultList, UserRight } from '@shared/models'
|
||||
import { isArray } from '../../helpers/custom-validators/misc'
|
||||
import { JobQueue } from '../../lib/job-queue'
|
||||
import {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import express from 'express'
|
||||
import { OAuthClientLocal } from '../../../shared'
|
||||
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
|
||||
import { OAuthClientModel } from '@server/models/oauth/oauth-client'
|
||||
import { HttpStatusCode, OAuthClientLocal } from '@shared/models'
|
||||
import { logger } from '../../helpers/logger'
|
||||
import { CONFIG } from '../../initializers/config'
|
||||
import { asyncMiddleware, openapiOperationDoc } from '../../middlewares'
|
||||
import { OAuthClientModel } from '../../models/oauth/oauth-client'
|
||||
|
||||
const oauthClientsRouter = express.Router()
|
||||
|
||||
|
|
|
@ -4,10 +4,7 @@ import { tokensRouter } from '@server/controllers/api/users/token'
|
|||
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/models/http/http-error-codes'
|
||||
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
||||
import { UserRegister } from '../../../../shared/models/users/user-register.model'
|
||||
import { HttpStatusCode, UserAdminFlag, UserCreate, UserCreateResult, UserRegister, UserRight, UserRole, UserUpdate } from '@shared/models'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '../../../helpers/audit-logger'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { generateRandomString, getFormattedObjects } from '../../../helpers/utils'
|
||||
|
@ -210,7 +207,7 @@ async function createUser (req: express.Request, res: express.Response) {
|
|||
logger.info('Sending to user %s a create password email', body.username)
|
||||
const verificationString = await Redis.Instance.setCreatePasswordVerificationString(user.id)
|
||||
const url = WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString
|
||||
await Emailer.Instance.addPasswordCreateEmailJob(userToCreate.username, user.email, url)
|
||||
Emailer.Instance.addPasswordCreateEmailJob(userToCreate.username, user.email, url)
|
||||
}
|
||||
|
||||
Hooks.runAction('action:api.user.created', { body, user, account, videoChannel, req, res })
|
||||
|
|
|
@ -2,10 +2,8 @@ import 'multer'
|
|||
import express from 'express'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { ActorImageType, HttpStatusCode, UserUpdateMe, UserVideoQuota, UserVideoRate as FormattedUserVideoRate } from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model'
|
||||
import { createReqFiles } from '../../../helpers/express-utils'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { CONFIG } from '../../../initializers/config'
|
||||
|
|
|
@ -5,8 +5,7 @@ import { ActorFollowModel } from '@server/models/actor/actor-follow'
|
|||
import { getServerActor } from '@server/models/application/application'
|
||||
import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils'
|
||||
import { MChannelBannerAccountDefault } from '@server/types/models'
|
||||
import { ActorImageType, VideoChannelCreate, VideoChannelUpdate } from '../../../shared'
|
||||
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
|
||||
import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate } from '@shared/models'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger'
|
||||
import { resetSequelizeInstance } from '../../helpers/database-utils'
|
||||
import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import express from 'express'
|
||||
import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist'
|
||||
import { UserRight, VideoBlacklistCreate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, UserRight, VideoBlacklistCreate } from '@shared/models'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
|
|
|
@ -4,6 +4,7 @@ import { decode } from 'magnet-uri'
|
|||
import parseTorrent, { Instance } from 'parse-torrent'
|
||||
import { join } from 'path'
|
||||
import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
import { ServerConfigManager } from '@server/lib/server-config-manager'
|
||||
import { setVideoTags } from '@server/lib/video'
|
||||
import { FilteredModelAttributes } from '@server/types'
|
||||
|
@ -18,15 +19,14 @@ import {
|
|||
MVideoWithBlacklistLight
|
||||
} from '@server/types/models'
|
||||
import { MVideoImportFormattable } from '@server/types/models/video/video-import'
|
||||
import { ServerErrorCode, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared'
|
||||
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
|
||||
import { ServerErrorCode, ThumbnailType, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '@shared/models'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger'
|
||||
import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
|
||||
import { isArray } from '../../../helpers/custom-validators/misc'
|
||||
import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { getSecureTorrentName } from '../../../helpers/utils'
|
||||
import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl'
|
||||
import { YoutubeDLInfo, YoutubeDLWrapper } from '../../../helpers/youtube-dl'
|
||||
import { CONFIG } from '../../../initializers/config'
|
||||
import { MIMETYPES } from '../../../initializers/constants'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
|
@ -38,7 +38,6 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoIm
|
|||
import { VideoModel } from '../../../models/video/video'
|
||||
import { VideoCaptionModel } from '../../../models/video/video-caption'
|
||||
import { VideoImportModel } from '../../../models/video/video-import'
|
||||
import { Hooks } from '@server/lib/plugins/hooks'
|
||||
|
||||
const auditLogger = auditLoggerFactory('video-imports')
|
||||
const videoImportsRouter = express.Router()
|
||||
|
|
|
@ -10,8 +10,7 @@ import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator
|
|||
import { VideoLiveModel } from '@server/models/video/video-live'
|
||||
import { MVideoDetails, MVideoFullLight } from '@server/types/models'
|
||||
import { buildUUID, uuidToShort } from '@shared/core-utils'
|
||||
import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, LiveVideoCreate, LiveVideoUpdate, VideoState } from '@shared/models'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import express from 'express'
|
||||
import { UserVideoRateUpdate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, UserVideoRateUpdate } from '@shared/models'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
|
|
|
@ -6,8 +6,7 @@ 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/models'
|
||||
import { HttpStatusCode, VideoUpdate } from '@shared/models'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
|
||||
import { resetSequelizeInstance } from '../../../helpers/database-utils'
|
||||
import { createReqFiles } from '../../../helpers/express-utils'
|
||||
|
|
|
@ -20,8 +20,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc'
|
|||
import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
|
||||
import { getLowercaseExtension, uuidToShort } from '@shared/core-utils'
|
||||
import { isAudioFile } from '@shared/extra-utils'
|
||||
import { VideoCreate, VideoState } from '../../../../shared'
|
||||
import { HttpStatusCode, VideoResolution } from '../../../../shared/models'
|
||||
import { HttpStatusCode, VideoCreate, VideoResolution, VideoState } from '@shared/models'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { createReqFiles } from '../../../helpers/express-utils'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import express from 'express'
|
||||
import { UserWatchingVideo } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, UserWatchingVideo } from '@shared/models'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
asyncRetryTransactionMiddleware,
|
||||
|
|
|
@ -5,9 +5,7 @@ import { chain } from 'lodash'
|
|||
import { join } from 'path'
|
||||
import { addColors, config, createLogger, format, transports } from 'winston'
|
||||
import { AUDIT_LOG_FILENAME } from '@server/initializers/constants'
|
||||
import { AdminAbuse, User, VideoChannel, VideoDetails, VideoImport } from '../../shared'
|
||||
import { CustomConfig } from '../../shared/models/server/custom-config.model'
|
||||
import { VideoComment } from '../../shared/models/videos/comment/video-comment.model'
|
||||
import { AdminAbuse, CustomConfig, User, VideoChannel, VideoComment, VideoDetails, VideoImport } from '@shared/models'
|
||||
import { CONFIG } from '../initializers/config'
|
||||
import { jsonLoggerFormat, labelFormatter } from './logger'
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import validator from 'validator'
|
||||
import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object'
|
||||
import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
|
||||
import { PlaylistElementObject, PlaylistObject } from '@shared/models'
|
||||
import { exists, isDateValid, isUUIDValid } from '../misc'
|
||||
import { isVideoPlaylistNameValid } from '../video-playlists'
|
||||
import { isActivityPubUrlValid } from './misc'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { values } from 'lodash'
|
||||
import validator from 'validator'
|
||||
import { UserRole } from '../../../shared'
|
||||
import { UserRole } from '@shared/models'
|
||||
import { isEmailEnabled } from '../../initializers/config'
|
||||
import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers/constants'
|
||||
import { exists, isArray, isBooleanValid } from './misc'
|
||||
|
|
|
@ -2,8 +2,7 @@ import { UploadFilesForCheck } from 'express'
|
|||
import { values } from 'lodash'
|
||||
import magnetUtil from 'magnet-uri'
|
||||
import validator from 'validator'
|
||||
import { VideoInclude } from '@shared/models'
|
||||
import { VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared'
|
||||
import { VideoFilter, VideoInclude, VideoPrivacy, VideoRateType } from '@shared/models'
|
||||
import {
|
||||
CONSTRAINTS_FIELDS,
|
||||
MIMETYPES,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { remove } from 'fs-extra'
|
|||
import { Instance as ParseTorrent } from 'parse-torrent'
|
||||
import { join } from 'path'
|
||||
import { sha256 } from '@shared/extra-utils'
|
||||
import { ResultList } from '../../shared'
|
||||
import { ResultList } from '@shared/models'
|
||||
import { CONFIG } from '../initializers/config'
|
||||
import { execPromise, execPromise2, randomBytesPromise } from './core-utils'
|
||||
import { logger } from './logger'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ensureDir, remove } from 'fs-extra'
|
||||
import passwordGenerator from 'password-generator'
|
||||
import { UserRole } from '../../shared'
|
||||
import { UserRole } from '@shared/models'
|
||||
import { logger } from '../helpers/logger'
|
||||
import { createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user'
|
||||
import { ApplicationModel } from '../models/application/application'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Transaction } from 'sequelize'
|
||||
import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models'
|
||||
import { CacheFileObject } from '../../../shared/index'
|
||||
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
|
||||
import { CacheFileObject, VideoStreamingPlaylistType } from '@shared/models'
|
||||
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
|
||||
|
||||
async function createOrUpdateCacheFile (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId, t: Transaction) {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { isBlockedByServerOrAccount } from '@server/lib/blocklist'
|
||||
import { isRedundancyAccepted } from '@server/lib/redundancy'
|
||||
import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared'
|
||||
import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
|
||||
import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object'
|
||||
import { ActivityCreate, CacheFileObject, PlaylistObject, VideoCommentObject, VideoObject } from '@shared/models'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { ActivityCreate, ActivityDislike } from '../../../../shared'
|
||||
import { DislikeObject } from '../../../../shared/models/activitypub/objects'
|
||||
import { ActivityCreate, ActivityDislike, DislikeObject } from '@shared/models'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AccountModel } from '@server/models/account/account'
|
|||
import { VideoModel } from '@server/models/video/video'
|
||||
import { VideoCommentModel } from '@server/models/video/video-comment'
|
||||
import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse'
|
||||
import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '../../../../shared'
|
||||
import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '@shared/models'
|
||||
import { getAPId } from '../../../helpers/activitypub'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
|
|
|
@ -11,7 +11,7 @@ import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/l
|
|||
import { VideoModel } from '@server/models/video/video'
|
||||
import { VideoJobInfoModel } from '@server/models/video/video-job-info'
|
||||
import { MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoWithAllFiles } from '@server/types/models'
|
||||
import { MoveObjectStoragePayload, VideoStorage } from '../../../../shared'
|
||||
import { MoveObjectStoragePayload, VideoStorage } from '@shared/models'
|
||||
|
||||
export async function processMoveToObjectStorage (job: Job) {
|
||||
const payload = job.data as MoveObjectStoragePayload
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { Job } from 'bull'
|
||||
import { move, remove, stat } from 'fs-extra'
|
||||
import { getLowercaseExtension } from '@shared/core-utils'
|
||||
import { retryTransactionWrapper } from '@server/helpers/database-utils'
|
||||
import { YoutubeDLWrapper } from '@server/helpers/youtube-dl'
|
||||
import { isPostImportVideoAccepted } from '@server/lib/moderation'
|
||||
|
@ -13,16 +12,19 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
|
|||
import { buildNextVideoState } from '@server/lib/video-state'
|
||||
import { ThumbnailModel } from '@server/models/video/thumbnail'
|
||||
import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import'
|
||||
import { getLowercaseExtension } from '@shared/core-utils'
|
||||
import { isAudioFile } from '@shared/extra-utils'
|
||||
import {
|
||||
ThumbnailType,
|
||||
VideoImportPayload,
|
||||
VideoImportState,
|
||||
VideoImportTorrentPayload,
|
||||
VideoImportTorrentPayloadType,
|
||||
VideoImportYoutubeDLPayload,
|
||||
VideoImportYoutubeDLPayloadType,
|
||||
VideoResolution,
|
||||
VideoState
|
||||
} from '../../../../shared'
|
||||
import { VideoImportState, VideoResolution } from '../../../../shared/models/videos'
|
||||
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
|
||||
} from '@shared/models'
|
||||
import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { getSecureTorrentName } from '../../../helpers/utils'
|
||||
|
@ -36,7 +38,6 @@ import { MThumbnail } from '../../../types/models/video/thumbnail'
|
|||
import { federateVideoIfNeeded } from '../../activitypub/videos'
|
||||
import { Notifier } from '../../notifier'
|
||||
import { generateVideoMiniature } from '../../thumbnail'
|
||||
import { isAudioFile } from '@shared/extra-utils'
|
||||
|
||||
async function processVideoImport (job: Job) {
|
||||
const payload = job.data as VideoImportPayload
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
NewResolutionTranscodingPayload,
|
||||
OptimizeTranscodingPayload,
|
||||
VideoTranscodingPayload
|
||||
} from '../../../../shared'
|
||||
} from '@shared/models'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { computeLowerResolutionsToTranscode } from '../../../helpers/ffprobe-utils'
|
||||
import { logger, loggerTagsFactory } from '../../../helpers/logger'
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { NextFunction, Request, Response } from 'express'
|
||||
import { getAPId } from '@server/helpers/activitypub'
|
||||
import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor'
|
||||
import { ActivityDelete, ActivityPubSignature } from '../../shared'
|
||||
import { HttpStatusCode } from '../../shared/models/http/http-error-codes'
|
||||
import { ActivityDelete, ActivityPubSignature, HttpStatusCode } from '@shared/models'
|
||||
import { logger } from '../helpers/logger'
|
||||
import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto'
|
||||
import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import express from 'express'
|
||||
import { UserRight } from '../../shared'
|
||||
import { HttpStatusCode } from '../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, UserRight } from '@shared/models'
|
||||
import { logger } from '../helpers/logger'
|
||||
|
||||
function ensureUserHasRight (userRight: UserRight) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import express from 'express'
|
||||
import { body, param } from 'express-validator'
|
||||
import { UserRight } from '../../../../shared'
|
||||
import { UserRight } from '@shared/models'
|
||||
import { isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions'
|
||||
import { cleanUpReqFiles } from '../../../helpers/express-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import express from 'express'
|
||||
import { body, param, query } from 'express-validator'
|
||||
import { MUserAccountUrl } from '@server/types/models'
|
||||
import { UserRight } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, UserRight } from '@shared/models'
|
||||
import { exists, isBooleanValid, isIdValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc'
|
||||
import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import express from 'express'
|
||||
import { MVideo } from '@server/types/models'
|
||||
import { HttpStatusCode } from '../../../../shared'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared'
|
||||
|
||||
|
|
|
@ -2,10 +2,14 @@ import express from 'express'
|
|||
import { body, param, query, ValidationChain } from 'express-validator'
|
||||
import { ExpressPromiseHandler } from '@server/types/express'
|
||||
import { MUserAccountId } from '@server/types/models'
|
||||
import { UserRight, VideoPlaylistCreate, VideoPlaylistUpdate } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||
import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
|
||||
import {
|
||||
HttpStatusCode,
|
||||
UserRight,
|
||||
VideoPlaylistCreate,
|
||||
VideoPlaylistPrivacy,
|
||||
VideoPlaylistType,
|
||||
VideoPlaylistUpdate
|
||||
} from '@shared/models'
|
||||
import {
|
||||
isArrayOf,
|
||||
isIdOrUUIDValid,
|
||||
|
|
|
@ -8,9 +8,7 @@ import { getServerActor } from '@server/models/application/application'
|
|||
import { ExpressPromiseHandler } from '@server/types/express'
|
||||
import { MUserAccountId, MVideoFullLight } from '@server/types/models'
|
||||
import { getAllPrivacies } from '@shared/core-utils'
|
||||
import { VideoInclude } from '@shared/models'
|
||||
import { ServerErrorCode, UserRight, VideoPrivacy } from '../../../../shared'
|
||||
import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
|
||||
import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude, VideoPrivacy } from '@shared/models'
|
||||
import {
|
||||
exists,
|
||||
isBooleanValid,
|
||||
|
|
|
@ -6,10 +6,9 @@ import {
|
|||
MAccountVideoRateAccountUrl,
|
||||
MAccountVideoRateAccountVideo,
|
||||
MAccountVideoRateFormattable
|
||||
} from '@server/types/models/video/video-rate'
|
||||
} from '@server/types/models'
|
||||
import { AccountVideoRate, VideoRateType } from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { AccountVideoRate } from '../../../shared'
|
||||
import { VideoRateType } from '../../../shared/models/videos'
|
||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
|
||||
import { CONSTRAINTS_FIELDS, VIDEO_RATE_TYPES } from '../../initializers/constants'
|
||||
import { ActorModel } from '../actor/actor'
|
||||
|
|
|
@ -16,15 +16,17 @@ import {
|
|||
} from 'sequelize-typescript'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model'
|
||||
import {
|
||||
CacheFileObject,
|
||||
FileRedundancyInformation,
|
||||
StreamingPlaylistRedundancyInformation,
|
||||
VideoRedundancy
|
||||
} from '@shared/models/redundancy/video-redundancy.model'
|
||||
import { CacheFileObject, VideoPrivacy } from '../../../shared'
|
||||
import { VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '../../../shared/models/redundancy'
|
||||
VideoPrivacy,
|
||||
VideoRedundanciesTarget,
|
||||
VideoRedundancy,
|
||||
VideoRedundancyStrategy,
|
||||
VideoRedundancyStrategyWithManual
|
||||
} from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { isTestInstance } from '../../helpers/core-utils'
|
||||
import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc'
|
||||
import { logger } from '../../helpers/logger'
|
||||
|
|
|
@ -2,8 +2,8 @@ import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize'
|
|||
import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
|
||||
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'
|
||||
import { uuidToShort } from '@shared/core-utils'
|
||||
import { UserNotification, UserNotificationType } from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { UserNotification, UserNotificationType } from '../../../shared'
|
||||
import { isBooleanValid } from '../../helpers/custom-validators/misc'
|
||||
import { isUserNotificationTypeValid } from '../../helpers/custom-validators/user-notifications'
|
||||
import { AbuseModel } from '../abuse/abuse'
|
||||
|
|
|
@ -15,8 +15,8 @@ import {
|
|||
} from 'sequelize-typescript'
|
||||
import { afterCommitIfTransaction } from '@server/helpers/database-utils'
|
||||
import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import'
|
||||
import { VideoImport, VideoImportState } from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { VideoImport, VideoImportState } from '../../../shared'
|
||||
import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports'
|
||||
import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos'
|
||||
import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants'
|
||||
|
|
|
@ -33,13 +33,22 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
|
|||
import { getServerActor } from '@server/models/application/application'
|
||||
import { ModelCache } from '@server/models/model-cache'
|
||||
import { buildVideoEmbedPath, buildVideoWatchPath, pick, uuidToShort } from '@shared/core-utils'
|
||||
import { VideoFile, VideoInclude } from '@shared/models'
|
||||
import {
|
||||
ResultList,
|
||||
ThumbnailType,
|
||||
UserRight,
|
||||
Video,
|
||||
VideoDetails,
|
||||
VideoFile,
|
||||
VideoInclude,
|
||||
VideoObject,
|
||||
VideoPrivacy,
|
||||
VideoRateType,
|
||||
VideoState,
|
||||
VideoStorage,
|
||||
VideoStreamingPlaylistType
|
||||
} from '@shared/models'
|
||||
import { AttributesOnly } from '@shared/typescript-utils'
|
||||
import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared'
|
||||
import { VideoObject } from '../../../shared/models/activitypub/objects'
|
||||
import { Video, VideoDetails, VideoRateType, VideoStorage } from '../../../shared/models/videos'
|
||||
import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
|
||||
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
|
||||
import { peertubeTruncate } from '../../helpers/core-utils'
|
||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
|
||||
import { exists, isBooleanValid } from '../../helpers/custom-validators/misc'
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
export * from './models'
|
Loading…
Reference in a new issue