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