mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
WIP plugins: plugin settings on server side
This commit is contained in:
parent
ffb321bedc
commit
ad91e7006e
20 changed files with 419 additions and 61 deletions
3
shared/models/plugins/install-plugin.model.ts
Normal file
3
shared/models/plugins/install-plugin.model.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export interface InstallPlugin {
|
||||
npmName: string
|
||||
}
|
3
shared/models/plugins/manage-plugin.model.ts
Normal file
3
shared/models/plugins/manage-plugin.model.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export interface ManagePlugin {
|
||||
npmName: string
|
||||
}
|
12
shared/models/plugins/peertube-plugin.model.ts
Normal file
12
shared/models/plugins/peertube-plugin.model.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
export interface PeerTubePlugin {
|
||||
name: string
|
||||
type: number
|
||||
version: string
|
||||
enabled: boolean
|
||||
uninstalled: boolean
|
||||
peertubeEngine: string
|
||||
description: string
|
||||
settings: any
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
import { RegisterOptions } from './register-options.type'
|
||||
import { RegisterOptions } from './register-options.model'
|
||||
|
||||
export interface PluginLibrary {
|
||||
register: (options: RegisterOptions) => void
|
||||
|
||||
unregister: () => Promise<any>
|
||||
}
|
||||
|
|
7
shared/models/plugins/plugin-settings-manager.model.ts
Normal file
7
shared/models/plugins/plugin-settings-manager.model.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import * as Bluebird from 'bluebird'
|
||||
|
||||
export interface PluginSettingsManager {
|
||||
getSetting: (name: string) => Bluebird<string>
|
||||
|
||||
setSetting: (name: string, value: string) => Bluebird<any>
|
||||
}
|
11
shared/models/plugins/register-options.model.ts
Normal file
11
shared/models/plugins/register-options.model.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { RegisterHookOptions } from './register-hook.model'
|
||||
import { RegisterSettingOptions } from './register-setting.model'
|
||||
import { PluginSettingsManager } from './plugin-settings-manager.model'
|
||||
|
||||
export type RegisterOptions = {
|
||||
registerHook: (options: RegisterHookOptions) => void
|
||||
|
||||
registerSetting: (options: RegisterSettingOptions) => void
|
||||
|
||||
settingsManager: PluginSettingsManager
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import { RegisterHookOptions } from './register.model'
|
||||
|
||||
export type RegisterOptions = {
|
||||
registerHook: (options: RegisterHookOptions) => void
|
||||
}
|
6
shared/models/plugins/register-setting.model.ts
Normal file
6
shared/models/plugins/register-setting.model.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
export interface RegisterSettingOptions {
|
||||
name: string
|
||||
label: string
|
||||
type: 'input'
|
||||
default?: string
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue