aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-10 16:59:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commitad91e7006e41f8ee5b8dcefee30f99e8ca44133a (patch)
treed860f20e05b036fa1a96e049c74deffd7f5d2b00 /shared
parentffb321bedca46d6987c7b31dd58e5dea96ea2ea2 (diff)
downloadPeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.tar.gz
PeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.tar.zst
PeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.zip
WIP plugins: plugin settings on server side
Diffstat (limited to 'shared')
-rw-r--r--shared/models/plugins/install-plugin.model.ts3
-rw-r--r--shared/models/plugins/manage-plugin.model.ts3
-rw-r--r--shared/models/plugins/peertube-plugin.model.ts12
-rw-r--r--shared/models/plugins/plugin-library.model.ts3
-rw-r--r--shared/models/plugins/plugin-settings-manager.model.ts7
-rw-r--r--shared/models/plugins/register-hook.model.ts (renamed from shared/models/plugins/register.model.ts)0
-rw-r--r--shared/models/plugins/register-options.model.ts11
-rw-r--r--shared/models/plugins/register-options.type.ts5
-rw-r--r--shared/models/plugins/register-setting.model.ts6
-rw-r--r--shared/models/users/user-right.enum.ts4
10 files changed, 47 insertions, 7 deletions
diff --git a/shared/models/plugins/install-plugin.model.ts b/shared/models/plugins/install-plugin.model.ts
new file mode 100644
index 000000000..03d87fe57
--- /dev/null
+++ b/shared/models/plugins/install-plugin.model.ts
@@ -0,0 +1,3 @@
1export interface InstallPlugin {
2 npmName: string
3}
diff --git a/shared/models/plugins/manage-plugin.model.ts b/shared/models/plugins/manage-plugin.model.ts
new file mode 100644
index 000000000..612b3056c
--- /dev/null
+++ b/shared/models/plugins/manage-plugin.model.ts
@@ -0,0 +1,3 @@
1export interface ManagePlugin {
2 npmName: string
3}
diff --git a/shared/models/plugins/peertube-plugin.model.ts b/shared/models/plugins/peertube-plugin.model.ts
new file mode 100644
index 000000000..2a1dfb3a7
--- /dev/null
+++ b/shared/models/plugins/peertube-plugin.model.ts
@@ -0,0 +1,12 @@
1export interface PeerTubePlugin {
2 name: string
3 type: number
4 version: string
5 enabled: boolean
6 uninstalled: boolean
7 peertubeEngine: string
8 description: string
9 settings: any
10 createdAt: Date
11 updatedAt: Date
12}
diff --git a/shared/models/plugins/plugin-library.model.ts b/shared/models/plugins/plugin-library.model.ts
index 8eb18d720..df6499b6b 100644
--- a/shared/models/plugins/plugin-library.model.ts
+++ b/shared/models/plugins/plugin-library.model.ts
@@ -1,6 +1,7 @@
1import { RegisterOptions } from './register-options.type' 1import { RegisterOptions } from './register-options.model'
2 2
3export interface PluginLibrary { 3export interface PluginLibrary {
4 register: (options: RegisterOptions) => void 4 register: (options: RegisterOptions) => void
5
5 unregister: () => Promise<any> 6 unregister: () => Promise<any>
6} 7}
diff --git a/shared/models/plugins/plugin-settings-manager.model.ts b/shared/models/plugins/plugin-settings-manager.model.ts
new file mode 100644
index 000000000..63390a190
--- /dev/null
+++ b/shared/models/plugins/plugin-settings-manager.model.ts
@@ -0,0 +1,7 @@
1import * as Bluebird from 'bluebird'
2
3export interface PluginSettingsManager {
4 getSetting: (name: string) => Bluebird<string>
5
6 setSetting: (name: string, value: string) => Bluebird<any>
7}
diff --git a/shared/models/plugins/register.model.ts b/shared/models/plugins/register-hook.model.ts
index 0ed2157bd..0ed2157bd 100644
--- a/shared/models/plugins/register.model.ts
+++ b/shared/models/plugins/register-hook.model.ts
diff --git a/shared/models/plugins/register-options.model.ts b/shared/models/plugins/register-options.model.ts
new file mode 100644
index 000000000..e60ce3fe0
--- /dev/null
+++ b/shared/models/plugins/register-options.model.ts
@@ -0,0 +1,11 @@
1import { RegisterHookOptions } from './register-hook.model'
2import { RegisterSettingOptions } from './register-setting.model'
3import { PluginSettingsManager } from './plugin-settings-manager.model'
4
5export type RegisterOptions = {
6 registerHook: (options: RegisterHookOptions) => void
7
8 registerSetting: (options: RegisterSettingOptions) => void
9
10 settingsManager: PluginSettingsManager
11}
diff --git a/shared/models/plugins/register-options.type.ts b/shared/models/plugins/register-options.type.ts
deleted file mode 100644
index a074f3931..000000000
--- a/shared/models/plugins/register-options.type.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1import { RegisterHookOptions } from './register.model'
2
3export type RegisterOptions = {
4 registerHook: (options: RegisterHookOptions) => void
5}
diff --git a/shared/models/plugins/register-setting.model.ts b/shared/models/plugins/register-setting.model.ts
new file mode 100644
index 000000000..e7af75dca
--- /dev/null
+++ b/shared/models/plugins/register-setting.model.ts
@@ -0,0 +1,6 @@
1export interface RegisterSettingOptions {
2 name: string
3 label: string
4 type: 'input'
5 default?: string
6}
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts
index 71701bdb4..4a28a229d 100644
--- a/shared/models/users/user-right.enum.ts
+++ b/shared/models/users/user-right.enum.ts
@@ -31,5 +31,7 @@ export enum UserRight {
31 UPDATE_ANY_VIDEO_PLAYLIST, 31 UPDATE_ANY_VIDEO_PLAYLIST,
32 32
33 SEE_ALL_VIDEOS, 33 SEE_ALL_VIDEOS,
34 CHANGE_VIDEO_OWNERSHIP 34 CHANGE_VIDEO_OWNERSHIP,
35
36 MANAGE_PLUGINS
35} 37}