aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/express
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
committerChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
commite030bfb59dd5ee65f20a64686ec9b22ca39f70ae (patch)
treec9a439159ef540291e3c030bcaf958b953442147 /server/typings/express
parent463206948d6a9d46e7e68d55c7b763e601ecc870 (diff)
downloadPeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.gz
PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.zst
PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.zip
Refactor server errors handler
Diffstat (limited to 'server/typings/express')
-rw-r--r--server/typings/express/index.d.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts
index f58436ce1..cbbf40a78 100644
--- a/server/typings/express/index.d.ts
+++ b/server/typings/express/index.d.ts
@@ -1,3 +1,4 @@
1
1import { RegisterServerAuthExternalOptions } from '@server/types' 2import { RegisterServerAuthExternalOptions } from '@server/types'
2import { 3import {
3 MAbuseMessage, 4 MAbuseMessage,
@@ -20,9 +21,8 @@ import { MVideoImportDefault } from '@server/types/models/video/video-import'
20import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' 21import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element'
21import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' 22import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate'
22import { HttpMethod } from '@shared/core-utils/miscs/http-methods' 23import { HttpMethod } from '@shared/core-utils/miscs/http-methods'
23import { VideoCreate } from '@shared/models' 24import { PeerTubeProblemDocumentData, ServerErrorCode, VideoCreate } from '@shared/models'
24import { File as UploadXFile, Metadata } from '@uploadx/core' 25import { File as UploadXFile, Metadata } from '@uploadx/core'
25import { ProblemDocumentOptions } from 'http-problem-details/dist/ProblemDocument'
26import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' 26import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
27import { 27import {
28 MAccountDefault, 28 MAccountDefault,
@@ -41,6 +41,7 @@ import {
41 MVideoThumbnail, 41 MVideoThumbnail,
42 MVideoWithRights 42 MVideoWithRights
43} from '../../types/models' 43} from '../../types/models'
44
44declare module 'express' { 45declare module 'express' {
45 export interface Request { 46 export interface Request {
46 query: any 47 query: any
@@ -86,14 +87,20 @@ declare module 'express' {
86 87
87 // Extends Response with added functions and potential variables passed by middlewares 88 // Extends Response with added functions and potential variables passed by middlewares
88 interface Response { 89 interface Response {
89 docs?: string
90 fail: (options: { 90 fail: (options: {
91 data?: Record<string, Object>
92 docs?: string
93 message: string 91 message: string
94 } & ProblemDocumentOptions) => void 92
93 title?: string
94 status?: number
95 type?: ServerErrorCode
96 instance?: string
97
98 data?: PeerTubeProblemDocumentData
99 }) => void
95 100
96 locals: { 101 locals: {
102 docUrl?: string
103
97 videoAll?: MVideoFullLight 104 videoAll?: MVideoFullLight
98 onlyImmutableVideo?: MVideoImmutable 105 onlyImmutableVideo?: MVideoImmutable
99 onlyVideo?: MVideoThumbnail 106 onlyVideo?: MVideoThumbnail