diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-23 14:10:17 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-06-23 16:00:49 +0200 |
commit | 67ed6552b831df66713bac9e672738796128d33f (patch) | |
tree | 59c97d41e0b49d75a90aa3de987968ab9b1ff447 /server/typings | |
parent | 0c4bacbff53bc732f5a2677d62a6ead7752e2405 (diff) | |
download | PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.gz PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.zst PeerTube-67ed6552b831df66713bac9e672738796128d33f.zip |
Reorganize client shared modules
Diffstat (limited to 'server/typings')
-rw-r--r-- | server/typings/express/index.d.ts | 28 | ||||
-rw-r--r-- | server/typings/plugins/index.d.ts | 2 | ||||
-rw-r--r-- | server/typings/plugins/plugin-library.model.ts | 7 | ||||
-rw-r--r-- | server/typings/plugins/register-server-option.model.ts | 82 |
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 @@ | |||
1 | import { RegisterServerAuthExternalOptions } from '@server/types' | ||
2 | import { | ||
3 | MAccountBlocklist, | ||
4 | MActorUrl, | ||
5 | MStreamingPlaylist, | ||
6 | MVideoChangeOwnershipFull, | ||
7 | MVideoFile, | ||
8 | MVideoImmutable, | ||
9 | MVideoPlaylistFull, | ||
10 | MVideoPlaylistFullSummary | ||
11 | } from '@server/types/models' | ||
12 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
13 | import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' | ||
14 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
15 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
16 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
17 | import { UserRole } from '@shared/models' | ||
1 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' | 18 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' |
2 | import { | 19 | import { |
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' |
22 | import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../../types/models/video/video-playlist' | ||
23 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
24 | import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models' | ||
25 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
26 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
27 | import { MVideoChangeOwnershipFull } from '../../types/models/video/video-change-ownership' | ||
28 | import { MPlugin, MServer } from '@server/types/models/server' | ||
29 | import { MServerBlocklist } from '../../types/models/server/server-blocklist' | ||
30 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
31 | import { UserRole } from '@shared/models' | ||
32 | import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' | ||
33 | 39 | ||
34 | declare module 'express' { | 40 | declare 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 @@ | |||
1 | export * from './register-server-option.model' | ||
2 | export * 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 @@ | |||
1 | import { RegisterServerOptions } from './register-server-option.model' | ||
2 | |||
3 | export 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 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import { Router } from 'express' | ||
3 | import { Logger } from 'winston' | ||
4 | import { ActorModel } from '@server/models/activitypub/actor' | ||
5 | import { VideoBlacklistCreate } from '@shared/models' | ||
6 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | ||
7 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | ||
8 | import { | ||
9 | RegisterServerAuthExternalOptions, | ||
10 | RegisterServerAuthExternalResult, | ||
11 | RegisterServerAuthPassOptions | ||
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 '../../types/models' | ||
21 | |||
22 | export 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 | |||
54 | export 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 | } | ||