]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/server/plugin.ts
add response content for createVideoChannel endpoint in openapi spec
[github/Chocobozzz/PeerTube.git] / server / models / server / plugin.ts
index 95fb386b557b54ad54cdbbf4f9ae13ccc83ee4cf..94c9b04bf130790554030fb8c289823853a3a41f 100644 (file)
@@ -1,10 +1,7 @@
-import * as Bluebird from 'bluebird'
 import { FindAndCountOptions, json, QueryTypes } from 'sequelize'
 import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
 import { MPlugin, MPluginFormattable } from '@server/types/models'
-import { PeerTubePlugin } from '../../../shared/models/plugins/peertube-plugin.model'
-import { PluginType } from '../../../shared/models/plugins/plugin.type'
-import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model'
+import { PeerTubePlugin, PluginType, RegisterServerSettingOptions } from '../../../shared/models'
 import {
   isPluginDescriptionValid,
   isPluginHomepage,
@@ -29,7 +26,7 @@ import { getSort, throwIfNotValid } from '../utils'
     }
   ]
 })
-export class PluginModel extends Model<PluginModel> {
+export class PluginModel extends Model {
 
   @AllowNull(false)
   @Is('PluginName', value => throwIfNotValid(value, isPluginNameValid, 'name'))
@@ -87,7 +84,7 @@ export class PluginModel extends Model<PluginModel> {
   @UpdatedAt
   updatedAt: Date
 
-  static listEnabledPluginsAndThemes (): Bluebird<MPlugin[]> {
+  static listEnabledPluginsAndThemes (): Promise<MPlugin[]> {
     const query = {
       where: {
         enabled: true,
@@ -98,7 +95,7 @@ export class PluginModel extends Model<PluginModel> {
     return PluginModel.findAll(query)
   }
 
-  static loadByNpmName (npmName: string): Bluebird<MPlugin> {
+  static loadByNpmName (npmName: string): Promise<MPlugin> {
     const name = this.normalizePluginName(npmName)
     const type = this.getTypeFromNpmName(npmName)
 
@@ -252,7 +249,7 @@ export class PluginModel extends Model<PluginModel> {
       })
   }
 
-  static listInstalled (): Bluebird<MPlugin[]> {
+  static listInstalled (): Promise<MPlugin[]> {
     const query = {
       where: {
         uninstalled: false