})
}
+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 getPluginTranslations (parameters: {
+ url: string,
+ locale: string,
+ expectedStatus?: number
+}) {
+ const { url, locale, expectedStatus = 200 } = parameters
+ const path = '/plugins/translations/' + locale + '.json'
+
+ return makeGetRequest({
+ url,
+ path,
+ statusCodeExpected: expectedStatus
+ })
+}
+
function installPlugin (parameters: {
url: string,
accessToken: string,
return readJSON(path)
}
+function getPluginTestPath (suffix = '') {
+ return join(root(), 'server', 'tests', 'fixtures', 'peertube-plugin-test' + suffix)
+}
+
export {
listPlugins,
listAvailablePlugins,
installPlugin,
+ getPluginTranslations,
getPluginsCSS,
updatePlugin,
getPlugin,
getPluginRegisteredSettings,
getPackageJSONPath,
updatePluginPackageJSON,
- getPluginPackageJSON
+ getPluginPackageJSON,
+ getPluginTestPath,
+ getPublicSettings
}