aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-06-01 01:36:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-06-02 16:57:07 +0200
commit76148b27f7501bac061992136852be4303370c8d (patch)
treefc0559253e833c9252fa14ebaec5321d88bfb4e8 /server/typings
parent5ed25fb76e920dac364cb9ef46f14ec4bd372949 (diff)
downloadPeerTube-76148b27f7501bac061992136852be4303370c8d.tar.gz
PeerTube-76148b27f7501bac061992136852be4303370c8d.tar.zst
PeerTube-76148b27f7501bac061992136852be4303370c8d.zip
refactor API errors to standard error format
Diffstat (limited to 'server/typings')
-rw-r--r--server/typings/express/index.d.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts
index 55b6e0039..f58436ce1 100644
--- a/server/typings/express/index.d.ts
+++ b/server/typings/express/index.d.ts
@@ -22,6 +22,7 @@ import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-
22import { HttpMethod } from '@shared/core-utils/miscs/http-methods' 22import { HttpMethod } from '@shared/core-utils/miscs/http-methods'
23import { VideoCreate } from '@shared/models' 23import { VideoCreate } from '@shared/models'
24import { File as UploadXFile, Metadata } from '@uploadx/core' 24import { File as UploadXFile, Metadata } from '@uploadx/core'
25import { ProblemDocumentOptions } from 'http-problem-details/dist/ProblemDocument'
25import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' 26import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
26import { 27import {
27 MAccountDefault, 28 MAccountDefault,
@@ -83,8 +84,15 @@ declare module 'express' {
83 filename: string 84 filename: string
84 } 85 }
85 86
86 // Extends locals property from Response 87 // Extends Response with added functions and potential variables passed by middlewares
87 interface Response { 88 interface Response {
89 docs?: string
90 fail: (options: {
91 data?: Record<string, Object>
92 docs?: string
93 message: string
94 } & ProblemDocumentOptions) => void
95
88 locals: { 96 locals: {
89 videoAll?: MVideoFullLight 97 videoAll?: MVideoFullLight
90 onlyImmutableVideo?: MVideoImmutable 98 onlyImmutableVideo?: MVideoImmutable