From 428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 May 2021 12:04:47 +0200 Subject: Reorganize plugin models --- shared/models/plugins/server/settings/index.ts | 2 ++ .../models/plugins/server/settings/public-server.setting.ts | 3 +++ .../plugins/server/settings/register-server-setting.model.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 shared/models/plugins/server/settings/index.ts create mode 100644 shared/models/plugins/server/settings/public-server.setting.ts create mode 100644 shared/models/plugins/server/settings/register-server-setting.model.ts (limited to 'shared/models/plugins/server/settings') diff --git a/shared/models/plugins/server/settings/index.ts b/shared/models/plugins/server/settings/index.ts new file mode 100644 index 000000000..b456de019 --- /dev/null +++ b/shared/models/plugins/server/settings/index.ts @@ -0,0 +1,2 @@ +export * from './public-server.setting' +export * from './register-server-setting.model' diff --git a/shared/models/plugins/server/settings/public-server.setting.ts b/shared/models/plugins/server/settings/public-server.setting.ts new file mode 100644 index 000000000..9802c4d7d --- /dev/null +++ b/shared/models/plugins/server/settings/public-server.setting.ts @@ -0,0 +1,3 @@ +export interface PublicServerSetting { + publicSettings: { [ name: string ]: string } +} diff --git a/shared/models/plugins/server/settings/register-server-setting.model.ts b/shared/models/plugins/server/settings/register-server-setting.model.ts new file mode 100644 index 000000000..d9a798cac --- /dev/null +++ b/shared/models/plugins/server/settings/register-server-setting.model.ts @@ -0,0 +1,12 @@ +import { RegisterClientFormFieldOptions } from '../../client' + +export type RegisterServerSettingOptions = RegisterClientFormFieldOptions & { + // If the setting is not private, anyone can view its value (client code included) + // If the setting is private, only server-side hooks can access it + // Mainly used by the PeerTube client to get admin config + private: boolean +} + +export interface RegisteredServerSettings { + registeredSettings: RegisterServerSettingOptions[] +} -- cgit v1.2.3