1
0
Fork 0
peertube/server/typings/plugins/register-server-option.mode...

83 lines
3.3 KiB
TypeScript
Raw Normal View History

2020-05-07 08:58:24 -04:00
import * as Bluebird from 'bluebird'
import { Router } from 'express'
2020-05-07 08:58:24 -04:00
import { Logger } from 'winston'
import { ActorModel } from '@server/models/activitypub/actor'
import { VideoBlacklistCreate } from '@shared/models'
import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model'
2020-05-07 08:58:24 -04:00
import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model'
import {
RegisterServerAuthExternalOptions,
RegisterServerAuthExternalResult,
RegisterServerAuthPassOptions
} from '@shared/models/plugins/register-server-auth.model'
2020-05-07 08:58:24 -04:00
import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model'
import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model'
import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model'
import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model'
import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model'
import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model'
2020-06-18 04:45:25 -04:00
import { MVideoThumbnail } from '../../types/models'
2020-04-09 03:57:32 -04:00
export type PeerTubeHelpers = {
logger: Logger
2020-04-09 05:00:30 -04:00
database: {
query: Function
}
videos: {
2020-05-07 08:58:24 -04:00
loadByUrl: (url: string) => Bluebird<MVideoThumbnail>
removeVideo: (videoId: number) => Promise<void>
}
2020-04-30 02:46:40 -04:00
config: {
getWebserverUrl: () => string
}
2020-05-07 08:58:24 -04:00
moderation: {
blockServer: (options: { byAccountId: number, hostToBlock: string }) => Promise<void>
unblockServer: (options: { byAccountId: number, hostToUnblock: string }) => Promise<void>
blockAccount: (options: { byAccountId: number, handleToBlock: string }) => Promise<void>
unblockAccount: (options: { byAccountId: number, handleToUnblock: string }) => Promise<void>
blacklistVideo: (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => Promise<void>
unblacklistVideo: (options: { videoIdOrUUID: number | string }) => Promise<void>
}
server: {
getServerActor: () => Promise<ActorModel>
}
2020-04-09 03:57:32 -04:00
}
2019-07-18 10:43:41 -04:00
2019-07-24 05:17:42 -04:00
export type RegisterServerOptions = {
registerHook: (options: RegisterServerHookOptions) => void
2019-07-18 10:43:41 -04:00
2019-07-24 05:17:42 -04:00
registerSetting: (options: RegisterServerSettingOptions) => void
2019-07-18 10:43:41 -04:00
settingsManager: PluginSettingsManager
storageManager: PluginStorageManager
videoCategoryManager: PluginVideoCategoryManager
videoLanguageManager: PluginVideoLanguageManager
videoLicenceManager: PluginVideoLicenceManager
videoPrivacyManager: PluginVideoPrivacyManager
playlistPrivacyManager: PluginPlaylistPrivacyManager
2020-04-22 10:07:04 -04:00
registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void
registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult
2020-04-30 04:03:09 -04:00
unregisterIdAndPassAuth: (authName: string) => void
unregisterExternalAuth: (authName: string) => void
2020-04-22 10:07:04 -04:00
// Get plugin router to create custom routes
// Base routes of this router are
// * /plugins/:pluginName/:pluginVersion/router/...
// * /plugins/:pluginName/router/...
getRouter(): Router
2020-04-09 03:57:32 -04:00
peertubeHelpers: PeerTubeHelpers
2019-07-18 10:43:41 -04:00
}