diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-07 14:58:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-07 15:07:01 +0200 |
commit | 80fdaf064562aff968f4c9cea1cf220bc12a70da (patch) | |
tree | a0ec49f433b828660f741b394dfd87056cd2c6ef /server/typings/plugins | |
parent | 3cc665f48fd233d09f778d7e887488dde6f03ef6 (diff) | |
download | PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.tar.gz PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.tar.zst PeerTube-80fdaf064562aff968f4c9cea1cf220bc12a70da.zip |
Add moderation helpers to plugins
Diffstat (limited to 'server/typings/plugins')
-rw-r--r-- | server/typings/plugins/register-server-option.model.ts | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/server/typings/plugins/register-server-option.model.ts b/server/typings/plugins/register-server-option.model.ts index 7f933b43a..8f1d66007 100644 --- a/server/typings/plugins/register-server-option.model.ts +++ b/server/typings/plugins/register-server-option.model.ts | |||
@@ -1,19 +1,23 @@ | |||
1 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | 1 | import * as Bluebird from 'bluebird' |
2 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | ||
3 | import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model' | ||
4 | import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' | ||
5 | import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model' | ||
6 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' | ||
7 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' | ||
8 | import { Logger } from 'winston' | ||
9 | import { Router } from 'express' | 2 | import { Router } from 'express' |
10 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | 3 | import { Logger } from 'winston' |
4 | import { ActorModel } from '@server/models/activitypub/actor' | ||
5 | import { VideoBlacklistCreate } from '@shared/models' | ||
11 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | 6 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' |
7 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | ||
12 | import { | 8 | import { |
13 | RegisterServerAuthExternalOptions, | 9 | RegisterServerAuthExternalOptions, |
14 | RegisterServerAuthExternalResult, | 10 | RegisterServerAuthExternalResult, |
15 | RegisterServerAuthPassOptions | 11 | RegisterServerAuthPassOptions |
16 | } from '@shared/models/plugins/register-server-auth.model' | 12 | } from '@shared/models/plugins/register-server-auth.model' |
13 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | ||
14 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | ||
15 | import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model' | ||
16 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' | ||
17 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' | ||
18 | import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model' | ||
19 | import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' | ||
20 | import { MVideoThumbnail } from '../models' | ||
17 | 21 | ||
18 | export type PeerTubeHelpers = { | 22 | export type PeerTubeHelpers = { |
19 | logger: Logger | 23 | logger: Logger |
@@ -23,12 +27,28 @@ export type PeerTubeHelpers = { | |||
23 | } | 27 | } |
24 | 28 | ||
25 | videos: { | 29 | videos: { |
30 | loadByUrl: (url: string) => Bluebird<MVideoThumbnail> | ||
31 | |||
26 | removeVideo: (videoId: number) => Promise<void> | 32 | removeVideo: (videoId: number) => Promise<void> |
27 | } | 33 | } |
28 | 34 | ||
29 | config: { | 35 | config: { |
30 | getWebserverUrl: () => string | 36 | getWebserverUrl: () => string |
31 | } | 37 | } |
38 | |||
39 | moderation: { | ||
40 | blockServer: (options: { byAccountId: number, hostToBlock: string }) => Promise<void> | ||
41 | unblockServer: (options: { byAccountId: number, hostToUnblock: string }) => Promise<void> | ||
42 | blockAccount: (options: { byAccountId: number, handleToBlock: string }) => Promise<void> | ||
43 | unblockAccount: (options: { byAccountId: number, handleToUnblock: string }) => Promise<void> | ||
44 | |||
45 | blacklistVideo: (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => Promise<void> | ||
46 | unblacklistVideo: (options: { videoIdOrUUID: number | string }) => Promise<void> | ||
47 | } | ||
48 | |||
49 | server: { | ||
50 | getServerActor: () => Promise<ActorModel> | ||
51 | } | ||
32 | } | 52 | } |
33 | 53 | ||
34 | export type RegisterServerOptions = { | 54 | export type RegisterServerOptions = { |