1
0
Fork 0
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:
Chocobozzz 2019-07-10 16:59:53 +02:00 committed by Chocobozzz
parent ffb321bedc
commit ad91e7006e
20 changed files with 419 additions and 61 deletions

View file

@ -0,0 +1,3 @@
export interface InstallPlugin {
npmName: string
}

View file

@ -0,0 +1,3 @@
export interface ManagePlugin {
npmName: string
}

View 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
}

View file

@ -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>
}

View 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>
}

View 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
}

View file

@ -1,5 +0,0 @@
import { RegisterHookOptions } from './register.model'
export type RegisterOptions = {
registerHook: (options: RegisterHookOptions) => void
}

View file

@ -0,0 +1,6 @@
export interface RegisterSettingOptions {
name: string
label: string
type: 'input'
default?: string
}