]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/express/index.d.ts
refactor API errors to standard error format
[github/Chocobozzz/PeerTube.git] / server / typings / express / index.d.ts
index 55b6e00394ec20d45378e5e185efc469ba9f8a5e..f58436ce1e406d6db9d3ec152c9383a58bf0a781 100644 (file)
@@ -22,6 +22,7 @@ import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-
 import { HttpMethod } from '@shared/core-utils/miscs/http-methods'
 import { VideoCreate } from '@shared/models'
 import { File as UploadXFile, Metadata } from '@uploadx/core'
+import { ProblemDocumentOptions } from 'http-problem-details/dist/ProblemDocument'
 import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
 import {
   MAccountDefault,
@@ -83,8 +84,15 @@ declare module 'express' {
     filename: string
   }
 
-  // Extends locals property from Response
+  // Extends Response with added functions and potential variables passed by middlewares
   interface Response {
+    docs?: string
+    fail: (options: {
+      data?: Record<string, Object>
+      docs?: string
+      message: string
+    } & ProblemDocumentOptions) => void
+
     locals: {
       videoAll?: MVideoFullLight
       onlyImmutableVideo?: MVideoImmutable