Reorganize client shared modules
[oweals/peertube.git] / server / typings / express / index.d.ts
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'
18 import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
19 import {
20   MAccountDefault,
21   MActorAccountChannelId,
22   MActorFollowActorsDefault,
23   MActorFollowActorsDefaultSubscription,
24   MActorFull,
25   MChannelAccountDefault,
26   MComment,
27   MCommentOwnerVideoReply,
28   MUserDefault,
29   MVideoAbuse,
30   MVideoBlacklist,
31   MVideoCaptionVideo,
32   MVideoFullLight,
33   MVideoIdThumbnail,
34   MVideoRedundancyVideo,
35   MVideoShareActor,
36   MVideoThumbnail,
37   MVideoWithRights
38 } from '../../types/models'
39
40 declare module 'express' {
41   export interface Request {
42     query: any
43   }
44
45   interface Response {
46
47     locals: {
48       bypassLogin?: {
49         bypass: boolean
50         pluginName: string
51         authName?: string
52         user: {
53           username: string
54           email: string
55           displayName: string
56           role: UserRole
57         }
58       }
59
60       refreshTokenAuthName?: string
61
62       explicitLogout: boolean
63
64       videoAll?: MVideoFullLight
65       onlyImmutableVideo?: MVideoImmutable
66       onlyVideo?: MVideoThumbnail
67       onlyVideoWithRights?: MVideoWithRights
68       videoId?: MVideoIdThumbnail
69
70       videoShare?: MVideoShareActor
71
72       videoFile?: MVideoFile
73
74       videoImport?: MVideoImportDefault
75
76       videoBlacklist?: MVideoBlacklist
77
78       videoCaption?: MVideoCaptionVideo
79
80       videoAbuse?: MVideoAbuse
81
82       videoStreamingPlaylist?: MStreamingPlaylist
83
84       videoChannel?: MChannelAccountDefault
85
86       videoPlaylistFull?: MVideoPlaylistFull
87       videoPlaylistSummary?: MVideoPlaylistFullSummary
88
89       videoPlaylistElement?: MVideoPlaylistElement
90       videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy
91
92       accountVideoRate?: MAccountVideoRateAccountVideo
93
94       videoCommentFull?: MCommentOwnerVideoReply
95       videoCommentThread?: MComment
96
97       follow?: MActorFollowActorsDefault
98       subscription?: MActorFollowActorsDefaultSubscription
99
100       nextOwner?: MAccountDefault
101       videoChangeOwnership?: MVideoChangeOwnershipFull
102
103       account?: MAccountDefault
104
105       actorUrl?: MActorUrl
106       actorFull?: MActorFull
107
108       user?: MUserDefault
109
110       server?: MServer
111
112       videoRedundancy?: MVideoRedundancyVideo
113
114       accountBlock?: MAccountBlocklist
115       serverBlock?: MServerBlocklist
116
117       oauth?: {
118         token: MOAuthTokenUser
119       }
120
121       signature?: {
122         actor: MActorAccountChannelId
123       }
124
125       authenticated?: boolean
126
127       registeredPlugin?: RegisteredPlugin
128
129       externalAuth?: RegisterServerAuthExternalOptions
130
131       plugin?: MPlugin
132     }
133   }
134 }