aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-07 14:58:24 +0200
committerChocobozzz <me@florianbigard.com>2020-05-07 15:07:01 +0200
commit80fdaf064562aff968f4c9cea1cf220bc12a70da (patch)
treea0ec49f433b828660f741b394dfd87056cd2c6ef /server/typings/plugins
parent3cc665f48fd233d09f778d7e887488dde6f03ef6 (diff)
downloadPeerTube-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.ts38
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 @@
1import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' 1import * as Bluebird from 'bluebird'
2import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
3import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model'
4import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model'
5import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model'
6import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model'
7import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model'
8import { Logger } from 'winston'
9import { Router } from 'express' 2import { Router } from 'express'
10import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' 3import { Logger } from 'winston'
4import { ActorModel } from '@server/models/activitypub/actor'
5import { VideoBlacklistCreate } from '@shared/models'
11import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' 6import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model'
7import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model'
12import { 8import {
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'
13import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model'
14import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
15import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model'
16import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model'
17import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model'
18import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model'
19import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model'
20import { MVideoThumbnail } from '../models'
17 21
18export type PeerTubeHelpers = { 22export 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
34export type RegisterServerOptions = { 54export type RegisterServerOptions = {