X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftypes%2Fexpress.d.ts;h=510b9f94ea27d3c6ec0f6c0451254a54465378d7;hb=cb0eda5602a21d1626a7face32de6153ed07b5f9;hp=1a99b598aabacb6be95983d07e610c81ff5a726c;hpb=c3edc5b074aa4bb1861ed0a94d3713808e87170f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/types/express.d.ts b/server/types/express.d.ts index 1a99b598a..510b9f94e 100644 --- a/server/types/express.d.ts +++ b/server/types/express.d.ts @@ -1,5 +1,5 @@ - import { OutgoingHttpHeaders } from 'http' +import { Writable } from 'stream' import { RegisterServerAuthExternalOptions } from '@server/types' import { MAbuseMessage, @@ -8,13 +8,16 @@ import { MActorFollowActorsDefault, MActorUrl, MChannelBannerAccountDefault, + MChannelSyncChannel, + MRegistration, MStreamingPlaylist, + MUserAccountUrl, MVideoChangeOwnershipFull, MVideoFile, MVideoFormattableDetails, MVideoId, MVideoImmutable, - MVideoLive, + MVideoLiveFormattable, MVideoPlaylistFull, MVideoPlaylistFullSummary } from '@server/types/models' @@ -40,8 +43,9 @@ import { MVideoRedundancyVideo, MVideoShareActor, MVideoThumbnail -} from '../../types/models' -import { Writable } from 'stream' +} from './models' +import { MRunner, MRunnerJobRunner, MRunnerRegistrationToken } from './models/runners' +import { MVideoSource } from './models/video/video-source' declare module 'express' { export interface Request { @@ -60,6 +64,7 @@ declare module 'express' { export type UploadFileForCheck = { originalname: string mimetype: string + size: number } export type UploadFilesForCheck = { @@ -67,7 +72,7 @@ declare module 'express' { } | UploadFileForCheck[] // Upload file with a duration added by our middleware - export type VideoUploadFile = Pick & { + export type VideoUploadFile = Pick & { duration: number } @@ -84,6 +89,7 @@ declare module 'express' { duration: number path: string filename: string + originalname: string } // Extends Response with added functions and potential variables passed by middlewares @@ -93,13 +99,19 @@ declare module 'express' { title?: string status?: number - type?: ServerErrorCode + type?: ServerErrorCode | string instance?: string data?: PeerTubeProblemDocumentData + + tags?: string[] }) => void locals: { + requestStart: number + + apicacheGroups: string[] + apicache: { content: string | Buffer write: Writable['write'] @@ -117,10 +129,13 @@ declare module 'express' { onlyVideo?: MVideoThumbnail videoId?: MVideoId - videoLive?: MVideoLive + videoLive?: MVideoLiveFormattable + videoLiveSession?: MVideoLiveSession videoShare?: MVideoShareActor + videoSource?: MVideoSource + videoFile?: MVideoFile videoFileResumable?: EnhancedUploadXFile @@ -137,6 +152,7 @@ declare module 'express' { videoStreamingPlaylist?: MStreamingPlaylist videoChannel?: MChannelBannerAccountDefault + videoChannelSync?: MChannelSyncChannel videoPlaylistFull?: MVideoPlaylistFull videoPlaylistSummary?: MVideoPlaylistFullSummary @@ -161,6 +177,7 @@ declare module 'express' { actorFull?: MActorFull user?: MUserDefault + userRegistration?: MRegistration server?: MServer @@ -177,6 +194,10 @@ declare module 'express' { actor: MActorAccountChannelId } + videoFileToken?: { + user: MUserAccountUrl + } + authenticated?: boolean registeredPlugin?: RegisteredPlugin @@ -184,6 +205,12 @@ declare module 'express' { externalAuth?: RegisterServerAuthExternalOptions plugin?: MPlugin + + localViewerFull?: MLocalVideoViewerWithWatchSections + + runner?: MRunner + runnerRegistrationToken?: MRunnerRegistrationToken + runnerJob?: MRunnerJobRunner } } }