]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/types/plugins/register-server-option.model.ts
Use a profile manager for transcoding
[github/Chocobozzz/PeerTube.git] / server / types / plugins / register-server-option.model.ts
1 import { Router } from 'express'
2 import { Logger } from 'winston'
3 import { ActorModel } from '@server/models/activitypub/actor'
4 import {
5 PluginPlaylistPrivacyManager,
6 PluginSettingsManager,
7 PluginStorageManager,
8 PluginVideoCategoryManager,
9 PluginVideoLanguageManager,
10 PluginVideoLicenceManager,
11 PluginVideoPrivacyManager,
12 RegisterServerHookOptions,
13 RegisterServerSettingOptions,
14 VideoBlacklistCreate
15 } from '@shared/models'
16 import { MVideoThumbnail } from '../models'
17 import {
18 RegisterServerAuthExternalOptions,
19 RegisterServerAuthExternalResult,
20 RegisterServerAuthPassOptions
21 } from './register-server-auth.model'
22
23 export type PeerTubeHelpers = {
24 logger: Logger
25
26 database: {
27 query: Function
28 }
29
30 videos: {
31 loadByUrl: (url: string) => Promise<MVideoThumbnail>
32
33 removeVideo: (videoId: number) => Promise<void>
34 }
35
36 config: {
37 getWebserverUrl: () => string
38 }
39
40 moderation: {
41 blockServer: (options: { byAccountId: number, hostToBlock: string }) => Promise<void>
42 unblockServer: (options: { byAccountId: number, hostToUnblock: string }) => Promise<void>
43 blockAccount: (options: { byAccountId: number, handleToBlock: string }) => Promise<void>
44 unblockAccount: (options: { byAccountId: number, handleToUnblock: string }) => Promise<void>
45
46 blacklistVideo: (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => Promise<void>
47 unblacklistVideo: (options: { videoIdOrUUID: number | string }) => Promise<void>
48 }
49
50 server: {
51 getServerActor: () => Promise<ActorModel>
52 }
53 }
54
55 export type RegisterServerOptions = {
56 registerHook: (options: RegisterServerHookOptions) => void
57
58 registerSetting: (options: RegisterServerSettingOptions) => void
59
60 settingsManager: PluginSettingsManager
61
62 storageManager: PluginStorageManager
63
64 videoCategoryManager: PluginVideoCategoryManager
65 videoLanguageManager: PluginVideoLanguageManager
66 videoLicenceManager: PluginVideoLicenceManager
67
68 videoPrivacyManager: PluginVideoPrivacyManager
69 playlistPrivacyManager: PluginPlaylistPrivacyManager
70
71 registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void
72 registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult
73 unregisterIdAndPassAuth: (authName: string) => void
74 unregisterExternalAuth: (authName: string) => void
75
76 // Get plugin router to create custom routes
77 // Base routes of this router are
78 // * /plugins/:pluginName/:pluginVersion/router/...
79 // * /plugins/:pluginName/router/...
80 getRouter(): Router
81
82 peertubeHelpers: PeerTubeHelpers
83 }