]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/types/express.d.ts
External auth can update user on login
[github/Chocobozzz/PeerTube.git] / server / types / express.d.ts
index 1a99b598aabacb6be95983d07e610c81ff5a726c..6fea4dac24bffc8a20d3fb6a7167d375c87ef54d 100644 (file)
@@ -1,4 +1,3 @@
-
 import { OutgoingHttpHeaders } from 'http'
 import { RegisterServerAuthExternalOptions } from '@server/types'
 import {
@@ -8,7 +7,9 @@ import {
   MActorFollowActorsDefault,
   MActorUrl,
   MChannelBannerAccountDefault,
+  MChannelSyncChannel,
   MStreamingPlaylist,
+  MUserAccountUrl,
   MVideoChangeOwnershipFull,
   MVideoFile,
   MVideoFormattableDetails,
@@ -40,8 +41,9 @@ import {
   MVideoRedundancyVideo,
   MVideoShareActor,
   MVideoThumbnail
-} from '../../types/models'
+} from './models'
 import { Writable } from 'stream'
+import { MVideoSource } from './models/video/video-source'
 
 declare module 'express' {
   export interface Request {
@@ -60,6 +62,7 @@ declare module 'express' {
   export type UploadFileForCheck = {
     originalname: string
     mimetype: string
+    size: number
   }
 
   export type UploadFilesForCheck = {
@@ -67,7 +70,7 @@ declare module 'express' {
   } | UploadFileForCheck[]
 
   // Upload file with a duration added by our middleware
-  export type VideoUploadFile = Pick<Express.Multer.File, 'path' | 'filename' | 'size'> & {
+  export type VideoUploadFile = Pick<Express.Multer.File, 'path' | 'filename' | 'size', 'originalname'> & {
     duration: number
   }
 
@@ -84,6 +87,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 +97,15 @@ declare module 'express' {
 
       title?: string
       status?: number
-      type?: ServerErrorCode
+      type?: ServerErrorCode | string
       instance?: string
 
       data?: PeerTubeProblemDocumentData
     }) => void
 
     locals: {
+      requestStart: number
+
       apicache: {
         content: string | Buffer
         write: Writable['write']
@@ -118,9 +124,12 @@ declare module 'express' {
       videoId?: MVideoId
 
       videoLive?: MVideoLive
+      videoLiveSession?: MVideoLiveSession
 
       videoShare?: MVideoShareActor
 
+      videoSource?: MVideoSource
+
       videoFile?: MVideoFile
 
       videoFileResumable?: EnhancedUploadXFile
@@ -137,6 +146,7 @@ declare module 'express' {
       videoStreamingPlaylist?: MStreamingPlaylist
 
       videoChannel?: MChannelBannerAccountDefault
+      videoChannelSync?: MChannelSyncChannel
 
       videoPlaylistFull?: MVideoPlaylistFull
       videoPlaylistSummary?: MVideoPlaylistFullSummary
@@ -177,6 +187,10 @@ declare module 'express' {
         actor: MActorAccountChannelId
       }
 
+      videoFileToken?: {
+        user: MUserAccountUrl
+      }
+
       authenticated?: boolean
 
       registeredPlugin?: RegisteredPlugin
@@ -184,6 +198,9 @@ declare module 'express' {
       externalAuth?: RegisterServerAuthExternalOptions
 
       plugin?: MPlugin
+
+      localViewerFull?: MLocalVideoViewerWithWatchSections
+
     }
   }
 }