aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings')
-rw-r--r--server/typings/express/index.d.ts28
-rw-r--r--server/typings/plugins/index.d.ts2
-rw-r--r--server/typings/plugins/plugin-library.model.ts7
-rw-r--r--server/typings/plugins/register-server-option.model.ts82
4 files changed, 17 insertions, 102 deletions
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts
index ad3212340..cac801e55 100644
--- a/server/typings/express/index.d.ts
+++ b/server/typings/express/index.d.ts
@@ -1,3 +1,20 @@
1import { RegisterServerAuthExternalOptions } from '@server/types'
2import {
3 MAccountBlocklist,
4 MActorUrl,
5 MStreamingPlaylist,
6 MVideoChangeOwnershipFull,
7 MVideoFile,
8 MVideoImmutable,
9 MVideoPlaylistFull,
10 MVideoPlaylistFullSummary
11} from '@server/types/models'
12import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
13import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server'
14import { MVideoImportDefault } from '@server/types/models/video/video-import'
15import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element'
16import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate'
17import { UserRole } from '@shared/models'
1import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' 18import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
2import { 19import {
3 MAccountDefault, 20 MAccountDefault,
@@ -19,17 +36,6 @@ import {
19 MVideoThumbnail, 36 MVideoThumbnail,
20 MVideoWithRights 37 MVideoWithRights
21} from '../../types/models' 38} from '../../types/models'
22import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../../types/models/video/video-playlist'
23import { MVideoImportDefault } from '@server/types/models/video/video-import'
24import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models'
25import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element'
26import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate'
27import { MVideoChangeOwnershipFull } from '../../types/models/video/video-change-ownership'
28import { MPlugin, MServer } from '@server/types/models/server'
29import { MServerBlocklist } from '../../types/models/server/server-blocklist'
30import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
31import { UserRole } from '@shared/models'
32import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
33 39
34declare module 'express' { 40declare module 'express' {
35 export interface Request { 41 export interface Request {
diff --git a/server/typings/plugins/index.d.ts b/server/typings/plugins/index.d.ts
deleted file mode 100644
index 9570579ef..000000000
--- a/server/typings/plugins/index.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './register-server-option.model'
2export * from './plugin-library.model'
diff --git a/server/typings/plugins/plugin-library.model.ts b/server/typings/plugins/plugin-library.model.ts
deleted file mode 100644
index 5b517ee9f..000000000
--- a/server/typings/plugins/plugin-library.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { RegisterServerOptions } from './register-server-option.model'
2
3export interface PluginLibrary {
4 register: (options: RegisterServerOptions) => Promise<any>
5
6 unregister: () => Promise<any>
7}
diff --git a/server/typings/plugins/register-server-option.model.ts b/server/typings/plugins/register-server-option.model.ts
deleted file mode 100644
index b4594c6cd..000000000
--- a/server/typings/plugins/register-server-option.model.ts
+++ /dev/null
@@ -1,82 +0,0 @@
1import * as Bluebird from 'bluebird'
2import { Router } from 'express'
3import { Logger } from 'winston'
4import { ActorModel } from '@server/models/activitypub/actor'
5import { VideoBlacklistCreate } from '@shared/models'
6import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model'
7import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model'
8import {
9 RegisterServerAuthExternalOptions,
10 RegisterServerAuthExternalResult,
11 RegisterServerAuthPassOptions
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 '../../types/models'
21
22export type PeerTubeHelpers = {
23 logger: Logger
24
25 database: {
26 query: Function
27 }
28
29 videos: {
30 loadByUrl: (url: string) => Bluebird<MVideoThumbnail>
31
32 removeVideo: (videoId: number) => Promise<void>
33 }
34
35 config: {
36 getWebserverUrl: () => string
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 }
52}
53
54export type RegisterServerOptions = {
55 registerHook: (options: RegisterServerHookOptions) => void
56
57 registerSetting: (options: RegisterServerSettingOptions) => void
58
59 settingsManager: PluginSettingsManager
60
61 storageManager: PluginStorageManager
62
63 videoCategoryManager: PluginVideoCategoryManager
64 videoLanguageManager: PluginVideoLanguageManager
65 videoLicenceManager: PluginVideoLicenceManager
66
67 videoPrivacyManager: PluginVideoPrivacyManager
68 playlistPrivacyManager: PluginPlaylistPrivacyManager
69
70 registerIdAndPassAuth: (options: RegisterServerAuthPassOptions) => void
71 registerExternalAuth: (options: RegisterServerAuthExternalOptions) => RegisterServerAuthExternalResult
72 unregisterIdAndPassAuth: (authName: string) => void
73 unregisterExternalAuth: (authName: string) => void
74
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
81 peertubeHelpers: PeerTubeHelpers
82}