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