mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add public settings endpoint
This commit is contained in:
@@ -119,6 +119,21 @@ function getPluginRegisteredSettings (parameters: {
|
||||
})
|
||||
}
|
||||
|
||||
function getPublicSettings (parameters: {
|
||||
url: string,
|
||||
npmName: string,
|
||||
expectedStatus?: number
|
||||
}) {
|
||||
const { url, npmName, expectedStatus = 200 } = parameters
|
||||
const path = '/api/v1/plugins/' + npmName + '/public-settings'
|
||||
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
statusCodeExpected: expectedStatus
|
||||
})
|
||||
}
|
||||
|
||||
function installPlugin (parameters: {
|
||||
url: string,
|
||||
accessToken: string,
|
||||
@@ -218,5 +233,6 @@ export {
|
||||
getPackageJSONPath,
|
||||
updatePluginPackageJSON,
|
||||
getPluginPackageJSON,
|
||||
getPluginTestPath
|
||||
getPluginTestPath,
|
||||
getPublicSettings
|
||||
}
|
||||
|
||||
3
shared/models/plugins/public-server.setting.ts
Normal file
3
shared/models/plugins/public-server.setting.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface PublicServerSetting {
|
||||
publicSettings: { [ name: string ]: string }
|
||||
}
|
||||
@@ -2,9 +2,15 @@ export interface RegisterServerSettingOptions {
|
||||
name: string
|
||||
label: string
|
||||
type: 'input'
|
||||
|
||||
// If the setting is not private, anyone can view its value
|
||||
// Mainly used by the PeerTube client to get admin config
|
||||
private: boolean
|
||||
|
||||
// Default setting value
|
||||
default?: string
|
||||
}
|
||||
|
||||
export interface RegisteredServerSettings {
|
||||
settings: RegisterServerSettingOptions[]
|
||||
registeredSettings: RegisterServerSettingOptions[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user