]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/server/plugins.ts
Add more attributes to about page
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / server / plugins.ts
index 2302208a8088e90c86cff0d9d7dae3d9244db9ef..5c0d1e511c1812daba288d9890850c0c842e3f65 100644 (file)
@@ -119,6 +119,36 @@ 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 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,
@@ -209,6 +239,7 @@ export {
   listPlugins,
   listAvailablePlugins,
   installPlugin,
+  getPluginTranslations,
   getPluginsCSS,
   updatePlugin,
   getPlugin,
@@ -218,5 +249,6 @@ export {
   getPackageJSONPath,
   updatePluginPackageJSON,
   getPluginPackageJSON,
-  getPluginTestPath
+  getPluginTestPath,
+  getPublicSettings
 }