+ return res.json(data)
+}
+
+function getRegisteredThemes () {
+ return PluginManager.Instance.getRegisteredThemes()
+ .map(t => ({
+ name: t.name,
+ version: t.version,
+ description: t.description,
+ css: t.css,
+ clientScripts: t.clientScripts
+ }))
+}
+
+function getRegisteredPlugins () {
+ return PluginManager.Instance.getRegisteredPlugins()
+ .map(p => ({
+ name: p.name,
+ version: p.version,
+ description: p.description,
+ clientScripts: p.clientScripts
+ }))
+}
+
+function getIdAndPassAuthPlugins () {
+ const result: RegisteredIdAndPassAuthConfig[] = []
+
+ for (const p of PluginManager.Instance.getIdAndPassAuths()) {
+ for (const auth of p.idAndPassAuths) {
+ result.push({
+ npmName: p.npmName,
+ name: p.name,
+ version: p.version,
+ authName: auth.authName,
+ weight: auth.getWeight()
+ })
+ }
+ }
+
+ return result
+}
+
+function getExternalAuthsPlugins () {
+ const result: RegisteredExternalAuthConfig[] = []
+
+ for (const p of PluginManager.Instance.getExternalAuths()) {
+ for (const auth of p.externalAuths) {
+ result.push({
+ npmName: p.npmName,
+ name: p.name,
+ version: p.version,
+ authName: auth.authName,
+ authDisplayName: auth.authDisplayName()
+ })
+ }
+ }
+
+ return result