diff options
Diffstat (limited to 'server')
39 files changed, 153 insertions, 132 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index 23890e20c..914c52e27 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts | |||
@@ -1,9 +1,15 @@ | |||
1 | import * as express from 'express' | ||
2 | import 'multer' | 1 | import 'multer' |
3 | import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' | 2 | import * as express from 'express' |
3 | import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate, VideoSortField } from '../../../../shared' | ||
4 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | ||
5 | import { createReqFiles } from '../../../helpers/express-utils' | ||
4 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { CONFIG } from '../../../initializers/config' | ||
5 | import { MIMETYPES } from '../../../initializers/constants' | 8 | import { MIMETYPES } from '../../../initializers/constants' |
9 | import { sequelizeTypescript } from '../../../initializers/database' | ||
6 | import { sendUpdateActor } from '../../../lib/activitypub/send' | 10 | import { sendUpdateActor } from '../../../lib/activitypub/send' |
11 | import { updateActorAvatarFile } from '../../../lib/avatar' | ||
12 | import { sendVerifyUserEmail } from '../../../lib/user' | ||
7 | import { | 13 | import { |
8 | asyncMiddleware, | 14 | asyncMiddleware, |
9 | asyncRetryTransactionMiddleware, | 15 | asyncRetryTransactionMiddleware, |
@@ -15,19 +21,12 @@ import { | |||
15 | usersVideoRatingValidator | 21 | usersVideoRatingValidator |
16 | } from '../../../middlewares' | 22 | } from '../../../middlewares' |
17 | import { deleteMeValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators' | 23 | import { deleteMeValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators' |
24 | import { updateAvatarValidator } from '../../../middlewares/validators/avatar' | ||
25 | import { AccountModel } from '../../../models/account/account' | ||
18 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 26 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
19 | import { UserModel } from '../../../models/account/user' | 27 | import { UserModel } from '../../../models/account/user' |
20 | import { VideoModel } from '../../../models/video/video' | 28 | import { VideoModel } from '../../../models/video/video' |
21 | import { VideoSortField } from '../../../../client/src/app/shared/video/sort-field.type' | ||
22 | import { createReqFiles } from '../../../helpers/express-utils' | ||
23 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | ||
24 | import { updateAvatarValidator } from '../../../middlewares/validators/avatar' | ||
25 | import { updateActorAvatarFile } from '../../../lib/avatar' | ||
26 | import { VideoImportModel } from '../../../models/video/video-import' | 29 | import { VideoImportModel } from '../../../models/video/video-import' |
27 | import { AccountModel } from '../../../models/account/account' | ||
28 | import { CONFIG } from '../../../initializers/config' | ||
29 | import { sequelizeTypescript } from '../../../initializers/database' | ||
30 | import { sendVerifyUserEmail } from '../../../lib/user' | ||
31 | 30 | ||
32 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) | 31 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) |
33 | 32 | ||
diff --git a/server/lib/auth.ts b/server/lib/auth.ts index 8579bdbb4..3f8e18633 100644 --- a/server/lib/auth.ts +++ b/server/lib/auth.ts | |||
@@ -10,7 +10,7 @@ import { | |||
10 | RegisterServerAuthenticatedResult, | 10 | RegisterServerAuthenticatedResult, |
11 | RegisterServerAuthPassOptions, | 11 | RegisterServerAuthPassOptions, |
12 | RegisterServerExternalAuthenticatedResult | 12 | RegisterServerExternalAuthenticatedResult |
13 | } from '@shared/models/plugins/register-server-auth.model' | 13 | } from '@server/types/plugins/register-server-auth.model' |
14 | import * as express from 'express' | 14 | import * as express from 'express' |
15 | import * as OAuthServer from 'express-oauth-server' | 15 | import * as OAuthServer from 'express-oauth-server' |
16 | 16 | ||
diff --git a/server/lib/plugins/plugin-helpers.ts b/server/lib/plugins/plugin-helpers.ts index de82b4918..39773f693 100644 --- a/server/lib/plugins/plugin-helpers.ts +++ b/server/lib/plugins/plugin-helpers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { PeerTubeHelpers } from '@server/typings/plugins' | 1 | import { PeerTubeHelpers } from '@server/types/plugins' |
2 | import { sequelizeTypescript } from '@server/initializers/database' | 2 | import { sequelizeTypescript } from '@server/initializers/database' |
3 | import { buildLogger } from '@server/helpers/logger' | 3 | import { buildLogger } from '@server/helpers/logger' |
4 | import { VideoModel } from '@server/models/video/video' | 4 | import { VideoModel } from '@server/models/video/video' |
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 7fda5d9a4..94b5ecc41 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -1,28 +1,26 @@ | |||
1 | import { PluginModel } from '../../models/server/plugin' | 1 | import { createReadStream, createWriteStream } from 'fs' |
2 | import { logger } from '../../helpers/logger' | 2 | import { outputFile, readJSON } from 'fs-extra' |
3 | import { basename, join } from 'path' | 3 | import { basename, join } from 'path' |
4 | import { CONFIG } from '../../initializers/config' | 4 | import { MOAuthTokenUser, MUser } from '@server/types/models' |
5 | import { isLibraryCodeValid, isPackageJSONValid } from '../../helpers/custom-validators/plugins' | 5 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' |
6 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' | ||
6 | import { | 7 | import { |
7 | ClientScript, | 8 | ClientScript, |
8 | PluginPackageJson, | 9 | PluginPackageJson, |
9 | PluginTranslationPaths as PackagePluginTranslations | 10 | PluginTranslationPaths as PackagePluginTranslations |
10 | } from '../../../shared/models/plugins/plugin-package-json.model' | 11 | } from '../../../shared/models/plugins/plugin-package-json.model' |
11 | import { createReadStream, createWriteStream } from 'fs' | 12 | import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model' |
12 | import { PLUGIN_GLOBAL_CSS_PATH } from '../../initializers/constants' | ||
13 | import { PluginType } from '../../../shared/models/plugins/plugin.type' | 13 | import { PluginType } from '../../../shared/models/plugins/plugin.type' |
14 | import { installNpmPlugin, installNpmPluginFromDisk, removeNpmPlugin } from './yarn' | ||
15 | import { outputFile, readJSON } from 'fs-extra' | ||
16 | import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' | 14 | import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' |
17 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' | 15 | import { isLibraryCodeValid, isPackageJSONValid } from '../../helpers/custom-validators/plugins' |
18 | import { RegisterServerOptions } from '../../typings/plugins/register-server-option.model' | 16 | import { logger } from '../../helpers/logger' |
19 | import { PluginLibrary } from '../../typings/plugins' | 17 | import { CONFIG } from '../../initializers/config' |
18 | import { PLUGIN_GLOBAL_CSS_PATH } from '../../initializers/constants' | ||
19 | import { PluginModel } from '../../models/server/plugin' | ||
20 | import { PluginLibrary, RegisterServerAuthExternalOptions, RegisterServerAuthPassOptions, RegisterServerOptions } from '../../types/plugins' | ||
20 | import { ClientHtml } from '../client-html' | 21 | import { ClientHtml } from '../client-html' |
21 | import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model' | ||
22 | import { RegisterHelpersStore } from './register-helpers-store' | 22 | import { RegisterHelpersStore } from './register-helpers-store' |
23 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' | 23 | import { installNpmPlugin, installNpmPluginFromDisk, removeNpmPlugin } from './yarn' |
24 | import { MOAuthTokenUser, MUser } from '@server/types/models' | ||
25 | import { RegisterServerAuthPassOptions, RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' | ||
26 | 24 | ||
27 | export interface RegisteredPlugin { | 25 | export interface RegisteredPlugin { |
28 | npmName: string | 26 | npmName: string |
diff --git a/server/lib/plugins/register-helpers-store.ts b/server/lib/plugins/register-helpers-store.ts index e337b1cb0..c73079302 100644 --- a/server/lib/plugins/register-helpers-store.ts +++ b/server/lib/plugins/register-helpers-store.ts | |||
@@ -9,22 +9,24 @@ import { | |||
9 | } from '@server/initializers/constants' | 9 | } from '@server/initializers/constants' |
10 | import { onExternalUserAuthenticated } from '@server/lib/auth' | 10 | import { onExternalUserAuthenticated } from '@server/lib/auth' |
11 | import { PluginModel } from '@server/models/server/plugin' | 11 | import { PluginModel } from '@server/models/server/plugin' |
12 | import { RegisterServerOptions } from '@server/typings/plugins' | ||
13 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | ||
14 | import { PluginSettingsManager } from '@shared/models/plugins/plugin-settings-manager.model' | ||
15 | import { PluginStorageManager } from '@shared/models/plugins/plugin-storage-manager.model' | ||
16 | import { PluginVideoCategoryManager } from '@shared/models/plugins/plugin-video-category-manager.model' | ||
17 | import { PluginVideoLanguageManager } from '@shared/models/plugins/plugin-video-language-manager.model' | ||
18 | import { PluginVideoLicenceManager } from '@shared/models/plugins/plugin-video-licence-manager.model' | ||
19 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | ||
20 | import { | 12 | import { |
21 | RegisterServerAuthExternalOptions, | 13 | RegisterServerAuthExternalOptions, |
22 | RegisterServerAuthExternalResult, | 14 | RegisterServerAuthExternalResult, |
23 | RegisterServerAuthPassOptions, | 15 | RegisterServerAuthPassOptions, |
24 | RegisterServerExternalAuthenticatedResult | 16 | RegisterServerExternalAuthenticatedResult, |
25 | } from '@shared/models/plugins/register-server-auth.model' | 17 | RegisterServerOptions |
26 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' | 18 | } from '@server/types/plugins' |
27 | import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' | 19 | import { |
20 | PluginPlaylistPrivacyManager, | ||
21 | PluginSettingsManager, | ||
22 | PluginStorageManager, | ||
23 | PluginVideoCategoryManager, | ||
24 | PluginVideoLanguageManager, | ||
25 | PluginVideoLicenceManager, | ||
26 | PluginVideoPrivacyManager, | ||
27 | RegisterServerHookOptions, | ||
28 | RegisterServerSettingOptions | ||
29 | } from '@shared/models' | ||
28 | import { serverHookObject } from '@shared/models/plugins/server-hook.model' | 30 | import { serverHookObject } from '@shared/models/plugins/server-hook.model' |
29 | import { buildPluginHelpers } from './plugin-helpers' | 31 | import { buildPluginHelpers } from './plugin-helpers' |
30 | 32 | ||
diff --git a/server/models/utils.ts b/server/models/utils.ts index 88c9b4adb..d706d9ea8 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -3,23 +3,6 @@ import validator from 'validator' | |||
3 | import { Col } from 'sequelize/types/lib/utils' | 3 | import { Col } from 'sequelize/types/lib/utils' |
4 | import { literal, OrderItem, Op } from 'sequelize' | 4 | import { literal, OrderItem, Op } from 'sequelize' |
5 | 5 | ||
6 | type Primitive = string | Function | number | boolean | Symbol | undefined | null | ||
7 | type DeepOmitHelper<T, K extends keyof T> = { | ||
8 | [P in K]: // extra level of indirection needed to trigger homomorhic behavior | ||
9 | T[P] extends infer TP // distribute over unions | ||
10 | ? TP extends Primitive | ||
11 | ? TP // leave primitives and functions alone | ||
12 | : TP extends any[] | ||
13 | ? DeepOmitArray<TP, K> // Array special handling | ||
14 | : DeepOmit<TP, K> | ||
15 | : never | ||
16 | } | ||
17 | type DeepOmit<T, K> = T extends Primitive ? T : DeepOmitHelper<T, Exclude<keyof T, K>> | ||
18 | |||
19 | type DeepOmitArray<T extends any[], K> = { | ||
20 | [P in keyof T]: DeepOmit<T[P], K> | ||
21 | } | ||
22 | |||
23 | type SortType = { sortModel: string, sortValue: string } | 6 | type SortType = { sortModel: string, sortValue: string } |
24 | 7 | ||
25 | // Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] | 8 | // Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] |
@@ -217,7 +200,6 @@ function searchAttribute (sourceField?: string, targetField?: string) { | |||
217 | // --------------------------------------------------------------------------- | 200 | // --------------------------------------------------------------------------- |
218 | 201 | ||
219 | export { | 202 | export { |
220 | DeepOmit, | ||
221 | buildBlockedAccountSQL, | 203 | buildBlockedAccountSQL, |
222 | buildLocalActorIdsIn, | 204 | buildLocalActorIdsIn, |
223 | SortType, | 205 | SortType, |
diff --git a/server/types/index.ts b/server/types/index.ts new file mode 100644 index 000000000..18d3827a5 --- /dev/null +++ b/server/types/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './plugins' | ||
2 | export * from './activitypub-processor.model' | ||
3 | export * from './sequelize' | ||
diff --git a/server/types/models/account/account-blocklist.ts b/server/types/models/account/account-blocklist.ts index 0d8bf11bd..3126fd0ab 100644 --- a/server/types/models/account/account-blocklist.ts +++ b/server/types/models/account/account-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' | 1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from './account' | 3 | import { MAccountDefault, MAccountFormattable } from './account' |
4 | 4 | ||
5 | type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M> | 5 | type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M> |
diff --git a/server/types/models/account/account.ts b/server/types/models/account/account.ts index 7b826ee04..d2add9810 100644 --- a/server/types/models/account/account.ts +++ b/server/types/models/account/account.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | MActorSummaryFormattable, | 13 | MActorSummaryFormattable, |
14 | MActorUrl | 14 | MActorUrl |
15 | } from './actor' | 15 | } from './actor' |
16 | import { FunctionProperties, PickWith } from '../../utils' | 16 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
17 | import { MAccountBlocklistId } from './account-blocklist' | 17 | import { MAccountBlocklistId } from './account-blocklist' |
18 | import { MChannelDefault } from '../video/video-channels' | 18 | import { MChannelDefault } from '../video/video-channels' |
19 | 19 | ||
diff --git a/server/types/models/account/actor-follow.ts b/server/types/models/account/actor-follow.ts index 5d0c03c8d..8c213d09c 100644 --- a/server/types/models/account/actor-follow.ts +++ b/server/types/models/account/actor-follow.ts | |||
@@ -8,7 +8,7 @@ import { | |||
8 | MActorHost, | 8 | MActorHost, |
9 | MActorUsername | 9 | MActorUsername |
10 | } from './actor' | 10 | } from './actor' |
11 | import { PickWith } from '../../utils' | 11 | import { PickWith } from '@shared/core-utils' |
12 | import { ActorModel } from '@server/models/activitypub/actor' | 12 | import { ActorModel } from '@server/models/activitypub/actor' |
13 | import { MChannelDefault } from '../video/video-channels' | 13 | import { MChannelDefault } from '../video/video-channels' |
14 | 14 | ||
diff --git a/server/types/models/account/actor.ts b/server/types/models/account/actor.ts index 1160e84cb..ee0d05f4e 100644 --- a/server/types/models/account/actor.ts +++ b/server/types/models/account/actor.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ActorModel } from '../../../models/activitypub/actor' | 1 | import { ActorModel } from '../../../models/activitypub/actor' |
2 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' | 2 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' | 3 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' |
4 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' | 4 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' |
5 | import { MAvatar, MAvatarFormattable } from './avatar' | 5 | import { MAvatar, MAvatarFormattable } from './avatar' |
diff --git a/server/types/models/account/avatar.ts b/server/types/models/account/avatar.ts index 6eba59ee4..0489a8599 100644 --- a/server/types/models/account/avatar.ts +++ b/server/types/models/account/avatar.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AvatarModel } from '../../../models/avatar/avatar' | 1 | import { AvatarModel } from '../../../models/avatar/avatar' |
2 | import { FunctionProperties } from '@server/types/utils' | 2 | import { FunctionProperties } from '@shared/core-utils' |
3 | 3 | ||
4 | export type MAvatar = AvatarModel | 4 | export type MAvatar = AvatarModel |
5 | 5 | ||
diff --git a/server/types/models/oauth/oauth-token.ts b/server/types/models/oauth/oauth-token.ts index 396cf6429..8399af8f1 100644 --- a/server/types/models/oauth/oauth-token.ts +++ b/server/types/models/oauth/oauth-token.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' | 1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MUserAccountUrl } from '../user/user' | 3 | import { MUserAccountUrl } from '../user/user' |
4 | 4 | ||
5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> | 5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> |
diff --git a/server/types/models/server/server-blocklist.ts b/server/types/models/server/server-blocklist.ts index cfbf3b73a..801f179fd 100644 --- a/server/types/models/server/server-blocklist.ts +++ b/server/types/models/server/server-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | 1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MServer, MServerFormattable } from './server' | 4 | import { MServer, MServerFormattable } from './server' |
5 | 5 | ||
diff --git a/server/types/models/server/server.ts b/server/types/models/server/server.ts index b35e55aeb..f8b053e3b 100644 --- a/server/types/models/server/server.ts +++ b/server/types/models/server/server.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ServerModel } from '../../../models/server/server' | 1 | import { ServerModel } from '../../../models/server/server' |
2 | import { FunctionProperties, PickWith } from '../../utils' | 2 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
3 | import { MAccountBlocklistId } from '../account' | 3 | import { MAccountBlocklistId } from '../account' |
4 | 4 | ||
5 | type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M> | 5 | type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M> |
diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.ts index 2080360e1..dd3de423b 100644 --- a/server/types/models/user/user-notification.ts +++ b/server/types/models/user/user-notification.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { UserNotificationModel } from '../../../models/account/user-notification' | 1 | import { UserNotificationModel } from '../../../models/account/user-notification' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { VideoModel } from '../../../models/video/video' | 3 | import { VideoModel } from '../../../models/video/video' |
4 | import { ActorModel } from '../../../models/activitypub/actor' | 4 | import { ActorModel } from '../../../models/activitypub/actor' |
5 | import { ServerModel } from '../../../models/server/server' | 5 | import { ServerModel } from '../../../models/server/server' |
diff --git a/server/types/models/user/user.ts b/server/types/models/user/user.ts index 7938ea288..12a68accf 100644 --- a/server/types/models/user/user.ts +++ b/server/types/models/user/user.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { UserModel } from '../../../models/account/user' | 1 | import { UserModel } from '../../../models/account/user' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { | 3 | import { |
4 | MAccount, | 4 | MAccount, |
5 | MAccountDefault, | 5 | MAccountDefault, |
diff --git a/server/types/models/video/schedule-video-update.ts b/server/types/models/video/schedule-video-update.ts index 6336fdabe..5d2936000 100644 --- a/server/types/models/video/schedule-video-update.ts +++ b/server/types/models/video/schedule-video-update.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | 1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' | 3 | import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof ScheduleVideoUpdateModel, M> = PickWith<ScheduleVideoUpdateModel, K, M> | 5 | type Use<K extends keyof ScheduleVideoUpdateModel, M> = PickWith<ScheduleVideoUpdateModel, K, M> |
diff --git a/server/types/models/video/video-abuse.ts b/server/types/models/video/video-abuse.ts index d60f05e4c..279a87cf3 100644 --- a/server/types/models/video/video-abuse.ts +++ b/server/types/models/video/video-abuse.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoAbuseModel } from '../../../models/video/video-abuse' | 1 | import { VideoAbuseModel } from '../../../models/video/video-abuse' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video' | 3 | import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video' |
4 | import { MAccountDefault, MAccountFormattable } from '../account' | 4 | import { MAccountDefault, MAccountFormattable } from '../account' |
5 | 5 | ||
diff --git a/server/types/models/video/video-blacklist.ts b/server/types/models/video/video-blacklist.ts index 08e59284a..2ac912405 100644 --- a/server/types/models/video/video-blacklist.ts +++ b/server/types/models/video/video-blacklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideo, MVideoFormattable } from './video' | 3 | import { MVideo, MVideoFormattable } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> | 5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> |
diff --git a/server/types/models/video/video-caption.ts b/server/types/models/video/video-caption.ts index 9bb067001..ab80ff830 100644 --- a/server/types/models/video/video-caption.ts +++ b/server/types/models/video/video-caption.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 1 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
2 | import { FunctionProperties, PickWith } from '@server/types/utils' | 2 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> | 5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> |
diff --git a/server/types/models/video/video-change-ownership.ts b/server/types/models/video/video-change-ownership.ts index 7421e081e..244d1a671 100644 --- a/server/types/models/video/video-change-ownership.ts +++ b/server/types/models/video/video-change-ownership.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' | 1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MVideo, MVideoWithAllFiles } from './video' | 4 | import { MVideo, MVideoWithAllFiles } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-channels.ts b/server/types/models/video/video-channels.ts index 50f7c2d8a..2e05d8753 100644 --- a/server/types/models/video/video-channels.ts +++ b/server/types/models/video/video-channels.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' | 1 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' |
2 | import { VideoChannelModel } from '../../../models/video/video-channel' | 2 | import { VideoChannelModel } from '../../../models/video/video-channel' |
3 | import { | 3 | import { |
4 | MAccountActor, | 4 | MAccountActor, |
diff --git a/server/types/models/video/video-comment.ts b/server/types/models/video/video-comment.ts index d6e0b66f5..f1c50c753 100644 --- a/server/types/models/video/video-comment.ts +++ b/server/types/models/video/video-comment.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoCommentModel } from '../../../models/video/video-comment' | 1 | import { VideoCommentModel } from '../../../models/video/video-comment' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' | 3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' |
4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' | 4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-file.ts b/server/types/models/video/video-file.ts index 3fcaca78f..327a148ce 100644 --- a/server/types/models/video/video-file.ts +++ b/server/types/models/video/video-file.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoFileModel } from '../../../models/video/video-file' | 1 | import { VideoFileModel } from '../../../models/video/video-file' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' | 4 | import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' |
5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' | 5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' |
diff --git a/server/types/models/video/video-import.ts b/server/types/models/video/video-import.ts index f1385877e..759b13c6e 100644 --- a/server/types/models/video/video-import.ts +++ b/server/types/models/video/video-import.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoImportModel } from '@server/models/video/video-import' | 1 | import { VideoImportModel } from '@server/models/video/video-import' |
2 | import { PickWith, PickWithOpt } from '@server/types/utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' | 3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' |
4 | import { MUser } from '../user/user' | 4 | import { MUser } from '../user/user' |
5 | 5 | ||
diff --git a/server/types/models/video/video-playlist-element.ts b/server/types/models/video/video-playlist-element.ts index c50992da7..f46ff4d49 100644 --- a/server/types/models/video/video-playlist-element.ts +++ b/server/types/models/video/video-playlist-element.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' | 1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' | 3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' |
4 | import { MVideoPlaylistPrivacy } from './video-playlist' | 4 | import { MVideoPlaylistPrivacy } from './video-playlist' |
5 | 5 | ||
diff --git a/server/types/models/video/video-playlist.ts b/server/types/models/video/video-playlist.ts index b504d1664..79e2daebf 100644 --- a/server/types/models/video/video-playlist.ts +++ b/server/types/models/video/video-playlist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 1 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' | 3 | import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' |
4 | import { MThumbnail } from './thumbnail' | 4 | import { MThumbnail } from './thumbnail' |
5 | import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' | 5 | import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' |
diff --git a/server/types/models/video/video-rate.ts b/server/types/models/video/video-rate.ts index a7682ef31..7bd54f7b0 100644 --- a/server/types/models/video/video-rate.ts +++ b/server/types/models/video/video-rate.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' | 1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountAudience, MAccountUrl } from '../account/account' | 3 | import { MAccountAudience, MAccountUrl } from '../account/account' |
4 | import { MVideo, MVideoFormattable } from './video' | 4 | import { MVideo, MVideoFormattable } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.ts index 7c7d52035..411375c81 100644 --- a/server/types/models/video/video-redundancy.ts +++ b/server/types/models/video/video-redundancy.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' | 1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' |
2 | import { PickWith, PickWithOpt } from '@server/types/utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
4 | import { VideoFileModel } from '@server/models/video/video-file' | 4 | import { VideoFileModel } from '@server/models/video/video-file' |
5 | import { MVideoFile, MVideoFileVideo } from './video-file' | 5 | import { MVideoFile, MVideoFileVideo } from './video-file' |
diff --git a/server/types/models/video/video-share.ts b/server/types/models/video/video-share.ts index 50ca75d26..b7a783bb6 100644 --- a/server/types/models/video/video-share.ts +++ b/server/types/models/video/video-share.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoShareModel } from '../../../models/video/video-share' | 1 | import { VideoShareModel } from '../../../models/video/video-share' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MActorDefault } from '../account' | 3 | import { MActorDefault } from '../account' |
4 | import { MVideo } from './video' | 4 | import { MVideo } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-streaming-playlist.ts b/server/types/models/video/video-streaming-playlist.ts index 3f54aa560..8b3ef51fc 100644 --- a/server/types/models/video/video-streaming-playlist.ts +++ b/server/types/models/video/video-streaming-playlist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' | 1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' | 3 | import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' |
4 | import { MVideo } from './video' | 4 | import { MVideo } from './video' |
5 | import { MVideoFile } from './video-file' | 5 | import { MVideoFile } from './video-file' |
diff --git a/server/types/models/video/video.ts b/server/types/models/video/video.ts index 022a9566d..3d8f85b3d 100644 --- a/server/types/models/video/video.ts +++ b/server/types/models/video/video.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoModel } from '../../../models/video/video' | 1 | import { VideoModel } from '../../../models/video/video' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { | 3 | import { |
4 | MChannelAccountDefault, | 4 | MChannelAccountDefault, |
5 | MChannelAccountLight, | 5 | MChannelAccountLight, |
diff --git a/server/typings/plugins/index.d.ts b/server/types/plugins/index.ts index 9570579ef..de30ff2ab 100644 --- a/server/typings/plugins/index.d.ts +++ b/server/types/plugins/index.ts | |||
@@ -1,2 +1,3 @@ | |||
1 | export * from './register-server-option.model' | ||
2 | export * from './plugin-library.model' | 1 | export * from './plugin-library.model' |
2 | export * from './register-server-auth.model' | ||
3 | export * from './register-server-option.model' | ||
diff --git a/server/typings/plugins/plugin-library.model.ts b/server/types/plugins/plugin-library.model.ts index 5b517ee9f..5b517ee9f 100644 --- a/server/typings/plugins/plugin-library.model.ts +++ b/server/types/plugins/plugin-library.model.ts | |||
diff --git a/server/types/plugins/register-server-auth.model.ts b/server/types/plugins/register-server-auth.model.ts new file mode 100644 index 000000000..31c71b0d0 --- /dev/null +++ b/server/types/plugins/register-server-auth.model.ts | |||
@@ -0,0 +1,52 @@ | |||
1 | import * as express from 'express' | ||
2 | import { UserRole } from '@shared/models' | ||
3 | import { MOAuthToken, MUser } from '../models' | ||
4 | |||
5 | export type RegisterServerAuthOptions = RegisterServerAuthPassOptions | RegisterServerAuthExternalOptions | ||
6 | |||
7 | export interface RegisterServerAuthenticatedResult { | ||
8 | username: string | ||
9 | email: string | ||
10 | role?: UserRole | ||
11 | displayName?: string | ||
12 | } | ||
13 | |||
14 | export interface RegisterServerExternalAuthenticatedResult extends RegisterServerAuthenticatedResult { | ||
15 | req: express.Request | ||
16 | res: express.Response | ||
17 | } | ||
18 | |||
19 | interface RegisterServerAuthBase { | ||
20 | // Authentication name (a plugin can register multiple auth strategies) | ||
21 | authName: string | ||
22 | |||
23 | // Called by PeerTube when a user from your plugin logged out | ||
24 | onLogout?(user: MUser): void | ||
25 | |||
26 | // Your plugin can hook PeerTube access/refresh token validity | ||
27 | // So you can control for your plugin the user session lifetime | ||
28 | hookTokenValidity?(options: { token: MOAuthToken, type: 'access' | 'refresh' }): Promise<{ valid: boolean }> | ||
29 | } | ||
30 | |||
31 | export interface RegisterServerAuthPassOptions extends RegisterServerAuthBase { | ||
32 | // Weight of this authentication so PeerTube tries the auth methods in DESC weight order | ||
33 | getWeight(): number | ||
34 | |||
35 | // Used by PeerTube to login a user | ||
36 | // Returns null if the login failed, or { username, email } on success | ||
37 | login(body: { | ||
38 | id: string | ||
39 | password: string | ||
40 | }): Promise<RegisterServerAuthenticatedResult | null> | ||
41 | } | ||
42 | |||
43 | export interface RegisterServerAuthExternalOptions extends RegisterServerAuthBase { | ||
44 | // Will be displayed in a block next to the login form | ||
45 | authDisplayName: () => string | ||
46 | |||
47 | onAuthRequest: (req: express.Request, res: express.Response) => void | ||
48 | } | ||
49 | |||
50 | export interface RegisterServerAuthExternalResult { | ||
51 | userAuthenticated (options: RegisterServerExternalAuthenticatedResult): void | ||
52 | } | ||
diff --git a/server/typings/plugins/register-server-option.model.ts b/server/types/plugins/register-server-option.model.ts index b4594c6cd..74303d383 100644 --- a/server/typings/plugins/register-server-option.model.ts +++ b/server/types/plugins/register-server-option.model.ts | |||
@@ -2,22 +2,24 @@ import * as Bluebird from 'bluebird' | |||
2 | import { Router } from 'express' | 2 | import { Router } from 'express' |
3 | import { Logger } from 'winston' | 3 | import { Logger } from 'winston' |
4 | import { ActorModel } from '@server/models/activitypub/actor' | 4 | import { ActorModel } from '@server/models/activitypub/actor' |
5 | import { VideoBlacklistCreate } from '@shared/models' | 5 | import { |
6 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | 6 | PluginPlaylistPrivacyManager, |
7 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | 7 | PluginSettingsManager, |
8 | PluginStorageManager, | ||
9 | PluginVideoCategoryManager, | ||
10 | PluginVideoLanguageManager, | ||
11 | PluginVideoLicenceManager, | ||
12 | PluginVideoPrivacyManager, | ||
13 | RegisterServerHookOptions, | ||
14 | RegisterServerSettingOptions, | ||
15 | VideoBlacklistCreate | ||
16 | } from '@shared/models' | ||
17 | import { MVideoThumbnail } from '../models' | ||
8 | import { | 18 | import { |
9 | RegisterServerAuthExternalOptions, | 19 | RegisterServerAuthExternalOptions, |
10 | RegisterServerAuthExternalResult, | 20 | RegisterServerAuthExternalResult, |
11 | RegisterServerAuthPassOptions | 21 | RegisterServerAuthPassOptions |
12 | } from '@shared/models/plugins/register-server-auth.model' | 22 | } from './register-server-auth.model' |
13 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | ||
14 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | ||
15 | import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model' | ||
16 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' | ||
17 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' | ||
18 | import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model' | ||
19 | import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' | ||
20 | import { MVideoThumbnail } from '../../types/models' | ||
21 | 23 | ||
22 | export type PeerTubeHelpers = { | 24 | export type PeerTubeHelpers = { |
23 | logger: Logger | 25 | logger: Logger |
diff --git a/server/types/utils.ts b/server/types/utils.ts deleted file mode 100644 index 55500d8c4..000000000 --- a/server/types/utils.ts +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* eslint-disable @typescript-eslint/array-type */ | ||
2 | |||
3 | export type FunctionPropertyNames<T> = { | ||
4 | [K in keyof T]: T[K] extends Function ? K : never | ||
5 | }[keyof T] | ||
6 | |||
7 | export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> | ||
8 | |||
9 | export type PickWith<T, KT extends keyof T, V> = { | ||
10 | [P in KT]: T[P] extends V ? V : never | ||
11 | } | ||
12 | |||
13 | export type PickWithOpt<T, KT extends keyof T, V> = { | ||
14 | [P in KT]?: T[P] extends V ? V : never | ||
15 | } | ||
16 | |||
17 | // https://github.com/krzkaczor/ts-essentials Rocks! | ||
18 | export type DeepPartial<T> = { | ||
19 | [P in keyof T]?: T[P] extends Array<infer U> | ||
20 | ? Array<DeepPartial<U>> | ||
21 | : T[P] extends ReadonlyArray<infer U> | ||
22 | ? ReadonlyArray<DeepPartial<U>> | ||
23 | : DeepPartial<T[P]> | ||
24 | } | ||
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts index ad3212340..cac801e55 100644 --- a/server/typings/express/index.d.ts +++ b/server/typings/express/index.d.ts | |||
@@ -1,3 +1,20 @@ | |||
1 | import { RegisterServerAuthExternalOptions } from '@server/types' | ||
2 | import { | ||
3 | MAccountBlocklist, | ||
4 | MActorUrl, | ||
5 | MStreamingPlaylist, | ||
6 | MVideoChangeOwnershipFull, | ||
7 | MVideoFile, | ||
8 | MVideoImmutable, | ||
9 | MVideoPlaylistFull, | ||
10 | MVideoPlaylistFullSummary | ||
11 | } from '@server/types/models' | ||
12 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
13 | import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' | ||
14 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
15 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
16 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
17 | import { UserRole } from '@shared/models' | ||
1 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' | 18 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' |
2 | import { | 19 | import { |
3 | MAccountDefault, | 20 | MAccountDefault, |
@@ -19,17 +36,6 @@ import { | |||
19 | MVideoThumbnail, | 36 | MVideoThumbnail, |
20 | MVideoWithRights | 37 | MVideoWithRights |
21 | } from '../../types/models' | 38 | } from '../../types/models' |
22 | import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../../types/models/video/video-playlist' | ||
23 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
24 | import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models' | ||
25 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
26 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
27 | import { MVideoChangeOwnershipFull } from '../../types/models/video/video-change-ownership' | ||
28 | import { MPlugin, MServer } from '@server/types/models/server' | ||
29 | import { MServerBlocklist } from '../../types/models/server/server-blocklist' | ||
30 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
31 | import { UserRole } from '@shared/models' | ||
32 | import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' | ||
33 | 39 | ||
34 | declare module 'express' { | 40 | declare module 'express' { |
35 | export interface Request { | 41 | export interface Request { |