diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-23 14:10:17 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-06-23 16:00:49 +0200 |
commit | 67ed6552b831df66713bac9e672738796128d33f (patch) | |
tree | 59c97d41e0b49d75a90aa3de987968ab9b1ff447 /server/types/plugins/register-server-option.model.ts | |
parent | 0c4bacbff53bc732f5a2677d62a6ead7752e2405 (diff) | |
download | PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.gz PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.zst PeerTube-67ed6552b831df66713bac9e672738796128d33f.zip |
Reorganize client shared modules
Diffstat (limited to 'server/types/plugins/register-server-option.model.ts')
-rw-r--r-- | server/types/plugins/register-server-option.model.ts | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/server/types/plugins/register-server-option.model.ts b/server/types/plugins/register-server-option.model.ts new file mode 100644 index 000000000..74303d383 --- /dev/null +++ b/server/types/plugins/register-server-option.model.ts | |||
@@ -0,0 +1,84 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import { Router } from 'express' | ||
3 | import { Logger } from 'winston' | ||
4 | import { ActorModel } from '@server/models/activitypub/actor' | ||
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' | ||
18 | import { | ||
19 | RegisterServerAuthExternalOptions, | ||
20 | RegisterServerAuthExternalResult, | ||
21 | RegisterServerAuthPassOptions | ||
22 | } from './register-server-auth.model' | ||
23 | |||
24 | export type PeerTubeHelpers = { | ||
25 | logger: Logger | ||
26 | |||
27 | database: { | ||
28 | query: Function | ||
29 | } | ||
30 | |||
31 | videos: { | ||
32 | loadByUrl: (url: string) => Bluebird<MVideoThumbnail> | ||
33 | |||
34 | removeVideo: (videoId: number) => Promise<void> | ||
35 | } | ||
36 | |||
37 | config: { | ||
38 | getWebserverUrl: () => string | ||
39 | } | ||
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 | } | ||
54 | } | ||
55 | |||
56 | export type RegisterServerOptions = { | ||
57 | registerHook: (options: RegisterServerHookOptions) => void | ||
58 | |||
59 | registerSetting: (options: RegisterServerSettingOptions) => void | ||
60 | |||
61 | settingsManager: PluginSettingsManager | ||
62 | |||
63 | storageManager: PluginStorageManager | ||
64 | |||
65 | videoCategoryManager: PluginVideoCategoryManager | ||
66 | videoLanguageManager: PluginVideoLanguageManager | ||
67 | videoLicenceManager: PluginVideoLicenceManager | ||
68 | |||
69 | videoPrivacyManager: PluginVideoPrivacyManager | ||
70 | playlistPrivacyManager: PluginPlaylistPrivacyManager | ||
71 | |||
72 | registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void | ||
73 | registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult | ||
74 | unregisterIdAndPassAuth: (authName: string) => void | ||
75 | unregisterExternalAuth: (authName: string) => void | ||
76 | |||
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 | |||
83 | peertubeHelpers: PeerTubeHelpers | ||
84 | } | ||