X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftypings%2Fexpress.ts;h=e6e120403963466422d164a27d6916cc96b6b942;hb=e307e4fce39853d445d086f92b8c556c363ee15d;hp=f7da55ab0e8ed5e1c738f3717c5c7f69cf65f799;hpb=5224c394b3bbac6ec1543e41fa0ec6db436e84fa;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/typings/express.ts b/server/typings/express.ts index f7da55ab0..e6e120403 100644 --- a/server/typings/express.ts +++ b/server/typings/express.ts @@ -1,89 +1,121 @@ -import { VideoChannelModel } from '../models/video/video-channel' -import { VideoPlaylistModel } from '../models/video/video-playlist' -import { VideoPlaylistElementModel } from '../models/video/video-playlist-element' -import { UserModel } from '../models/account/user' -import { VideoModel } from '../models/video/video' -import { AccountModel } from '../models/account/account' -import { VideoChangeOwnershipModel } from '../models/video/video-change-ownership' -import { ActorModel } from '../models/activitypub/actor' -import { VideoCommentModel } from '../models/video/video-comment' -import { VideoShareModel } from '../models/video/video-share' -import { AccountVideoRateModel } from '../models/account/account-video-rate' -import { ActorFollowModel } from '../models/activitypub/actor-follow' -import { ServerModel } from '../models/server/server' -import { VideoFileModel } from '../models/video/video-file' -import { VideoRedundancyModel } from '../models/redundancy/video-redundancy' -import { ServerBlocklistModel } from '../models/server/server-blocklist' -import { AccountBlocklistModel } from '../models/account/account-blocklist' -import { VideoImportModel } from '../models/video/video-import' -import { VideoAbuseModel } from '../models/video/video-abuse' -import { VideoBlacklistModel } from '../models/video/video-blacklist' -import { VideoCaptionModel } from '../models/video/video-caption' -import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' import { RegisteredPlugin } from '../lib/plugins/plugin-manager' -import { PluginModel } from '../models/server/plugin' -import { SignatureActorModel } from './models' +import { + MAccountDefault, + MActorAccountChannelId, + MActorFollowActorsDefault, + MActorFollowActorsDefaultSubscription, + MActorFull, + MChannelAccountDefault, + MComment, + MCommentOwnerVideoReply, + MUserDefault, + MVideoAbuse, + MVideoBlacklist, + MVideoCaptionVideo, + MVideoFullLight, + MVideoIdThumbnail, + MVideoRedundancyVideo, + MVideoShareActor, + MVideoThumbnail, + MVideoWithRights +} from './models' +import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from './models/video/video-playlist' +import { MVideoImportDefault } from '@server/typings/models/video/video-import' +import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/typings/models' +import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/typings/models/video/video-playlist-element' +import { MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' +import { MVideoChangeOwnershipFull } from './models/video/video-change-ownership' +import { MPlugin, MServer } from '@server/typings/models/server' +import { MServerBlocklist } from './models/server/server-blocklist' +import { MOAuthTokenUser } from '@server/typings/models/oauth/oauth-token' +import { UserRole } from '@shared/models' declare module 'express' { - interface Response { + locals: { - video?: VideoModel - videoShare?: VideoShareModel - videoFile?: VideoFileModel + bypassLogin?: { + bypass: boolean + pluginName: string + authName?: string + user: { + username: string + email: string + displayName: string + role: UserRole + } + } + + refreshTokenAuthName?: string + + explicitLogout: boolean + + videoAll?: MVideoFullLight + onlyImmutableVideo?: MVideoImmutable + onlyVideo?: MVideoThumbnail + onlyVideoWithRights?: MVideoWithRights + videoId?: MVideoIdThumbnail - videoImport?: VideoImportModel + videoShare?: MVideoShareActor - videoBlacklist?: VideoBlacklistModel + videoFile?: MVideoFile - videoCaption?: VideoCaptionModel + videoImport?: MVideoImportDefault - videoAbuse?: VideoAbuseModel + videoBlacklist?: MVideoBlacklist - videoStreamingPlaylist?: VideoStreamingPlaylistModel + videoCaption?: MVideoCaptionVideo - videoChannel?: VideoChannelModel + videoAbuse?: MVideoAbuse - videoPlaylist?: VideoPlaylistModel - videoPlaylistElement?: VideoPlaylistElementModel + videoStreamingPlaylist?: MStreamingPlaylist - accountVideoRate?: AccountVideoRateModel + videoChannel?: MChannelAccountDefault - videoComment?: VideoCommentModel - videoCommentThread?: VideoCommentModel + videoPlaylistFull?: MVideoPlaylistFull + videoPlaylistSummary?: MVideoPlaylistFullSummary - follow?: ActorFollowModel - subscription?: ActorFollowModel + videoPlaylistElement?: MVideoPlaylistElement + videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy - nextOwner?: AccountModel - videoChangeOwnership?: VideoChangeOwnershipModel - account?: AccountModel - actor?: ActorModel - user?: UserModel + accountVideoRate?: MAccountVideoRateAccountVideo - server?: ServerModel + videoCommentFull?: MCommentOwnerVideoReply + videoCommentThread?: MComment - videoRedundancy?: VideoRedundancyModel + follow?: MActorFollowActorsDefault + subscription?: MActorFollowActorsDefaultSubscription - accountBlock?: AccountBlocklistModel - serverBlock?: ServerBlocklistModel + nextOwner?: MAccountDefault + videoChangeOwnership?: MVideoChangeOwnershipFull + + account?: MAccountDefault + + actorUrl?: MActorUrl + actorFull?: MActorFull + + user?: MUserDefault + + server?: MServer + + videoRedundancy?: MVideoRedundancyVideo + + accountBlock?: MAccountBlocklist + serverBlock?: MServerBlocklist oauth?: { - token: { - User: UserModel - user: UserModel - } + token: MOAuthTokenUser } signature?: { - actor: SignatureActorModel + actor: MActorAccountChannelId } authenticated?: boolean registeredPlugin?: RegisteredPlugin - plugin?: PluginModel + plugin?: MPlugin } } }