import { PluginType } from '../../../shared/models/plugins/plugin.type'
import { PeerTubePlugin } from '../../../shared/models/plugins/peertube-plugin.model'
import { FindAndCountOptions, json } from 'sequelize'
+import { PeerTubePluginIndex } from '../../../shared/models/plugins/peertube-plugin-index.model'
@DefaultScope(() => ({
attributes: {
}
static listForApi (options: {
- type?: PluginType,
+ pluginType?: PluginType,
uninstalled?: boolean,
start: number,
count: number,
}
}
- if (options.type) query.where['type'] = options.type
+ if (options.pluginType) query.where['type'] = options.pluginType
return PluginModel
.findAndCountAll(query)
})
}
- static normalizePluginName (name: string) {
- return name.replace(/^peertube-((theme)|(plugin))-/, '')
+ static listInstalled () {
+ const query = {
+ where: {
+ uninstalled: false
+ }
+ }
+
+ return PluginModel.findAll(query)
+ }
+
+ static normalizePluginName (npmName: string) {
+ return npmName.replace(/^peertube-((theme)|(plugin))-/, '')
}
static getTypeFromNpmName (npmName: string) {