]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/types/plugins/register-server-option.model.ts
Fix live ending banner
[github/Chocobozzz/PeerTube.git] / server / types / plugins / register-server-option.model.ts
index 74303d38343773b803dc446a1db43951a210c1cf..2432b7ac4eab7a4727579b041bbea33cf275529a 100644 (file)
@@ -1,17 +1,19 @@
-import * as Bluebird from 'bluebird'
-import { Router } from 'express'
+import { Router, Response } from 'express'
 import { Logger } from 'winston'
 import { ActorModel } from '@server/models/activitypub/actor'
 import {
   PluginPlaylistPrivacyManager,
   PluginSettingsManager,
   PluginStorageManager,
+  PluginTranscodingManager,
   PluginVideoCategoryManager,
   PluginVideoLanguageManager,
   PluginVideoLicenceManager,
   PluginVideoPrivacyManager,
   RegisterServerHookOptions,
   RegisterServerSettingOptions,
+  ServerConfig,
+  UserRole,
   VideoBlacklistCreate
 } from '@shared/models'
 import { MVideoThumbnail } from '../models'
@@ -29,13 +31,16 @@ export type PeerTubeHelpers = {
   }
 
   videos: {
-    loadByUrl: (url: string) => Bluebird<MVideoThumbnail>
+    loadByUrl: (url: string) => Promise<MVideoThumbnail>
+    loadByIdOrUUID: (id: number | string) => Promise<MVideoThumbnail>
 
     removeVideo: (videoId: number) => Promise<void>
   }
 
   config: {
     getWebserverUrl: () => string
+
+    getServerConfig: () => Promise<ServerConfig>
   }
 
   moderation: {
@@ -51,6 +56,28 @@ export type PeerTubeHelpers = {
   server: {
     getServerActor: () => Promise<ActorModel>
   }
+
+  plugin: {
+    // PeerTube >= 3.2
+    getBaseStaticRoute: () => string
+
+    // PeerTube >= 3.2
+    getBaseRouterRoute: () => string
+
+    // PeerTube >= 3.2
+    getDataDirectoryPath: () => string
+  }
+
+  user: {
+    // PeerTube >= 3.2
+    getAuthUser: (response: Response) => Promise<{
+      id?: string
+      username: string
+      email: string
+      blocked: boolean
+      role: UserRole
+    } | undefined>
+  }
 }
 
 export type RegisterServerOptions = {
@@ -69,6 +96,8 @@ export type RegisterServerOptions = {
   videoPrivacyManager: PluginVideoPrivacyManager
   playlistPrivacyManager: PluginPlaylistPrivacyManager
 
+  transcodingManager: PluginTranscodingManager
+
   registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void
   registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult
   unregisterIdAndPassAuth: (authName: string) => void