]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/plugins/register-server-option.model.ts
provide specific engine boundaries for nodejs and yarn
[github/Chocobozzz/PeerTube.git] / server / typings / plugins / register-server-option.model.ts
CommitLineData
80fdaf06 1import * as Bluebird from 'bluebird'
5e2b2e27 2import { Router } from 'express'
80fdaf06
C
3import { Logger } from 'winston'
4import { ActorModel } from '@server/models/activitypub/actor'
5import { VideoBlacklistCreate } from '@shared/models'
b3af2601 6import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model'
80fdaf06 7import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model'
e1c55031
C
8import {
9 RegisterServerAuthExternalOptions,
10 RegisterServerAuthExternalResult,
11 RegisterServerAuthPassOptions
12} from '@shared/models/plugins/register-server-auth.model'
80fdaf06
C
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'
26d6bf65 20import { MVideoThumbnail } from '../../types/models'
bc0d801b
C
21
22export type PeerTubeHelpers = {
23 logger: Logger
1b05d82d
C
24
25 database: {
26 query: Function
27 }
ab3ead3a
C
28
29 videos: {
80fdaf06
C
30 loadByUrl: (url: string) => Bluebird<MVideoThumbnail>
31
ab3ead3a
C
32 removeVideo: (videoId: number) => Promise<void>
33 }
5a7eecdd
C
34
35 config: {
36 getWebserverUrl: () => string
37 }
80fdaf06
C
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 }
bc0d801b 52}
32fe0013 53
9ae88819
C
54export type RegisterServerOptions = {
55 registerHook: (options: RegisterServerHookOptions) => void
32fe0013 56
9ae88819 57 registerSetting: (options: RegisterServerSettingOptions) => void
32fe0013
C
58
59 settingsManager: PluginSettingsManager
60
61 storageManager: PluginStorageManager
62
ee286591
C
63 videoCategoryManager: PluginVideoCategoryManager
64 videoLanguageManager: PluginVideoLanguageManager
65 videoLicenceManager: PluginVideoLicenceManager
66
b3af2601
C
67 videoPrivacyManager: PluginVideoPrivacyManager
68 playlistPrivacyManager: PluginPlaylistPrivacyManager
69
7fed6375
C
70 registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void
71 registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult
a4995eb7
C
72 unregisterIdAndPassAuth: (authName: string) => void
73 unregisterExternalAuth: (authName: string) => void
7fed6375 74
5e2b2e27
C
75 // Get plugin router to create custom routes
76 // Base routes of this router are
77 // * /plugins/:pluginName/:pluginVersion/router/...
78 // * /plugins/:pluginName/router/...
79 getRouter(): Router
80
bc0d801b 81 peertubeHelpers: PeerTubeHelpers
32fe0013 82}