diff options
Diffstat (limited to 'server/models/server/plugin.ts')
-rw-r--r-- | server/models/server/plugin.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 95fb386b5..82387af6a 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import { FindAndCountOptions, json, QueryTypes } from 'sequelize' | 1 | import { FindAndCountOptions, json, QueryTypes } from 'sequelize' |
3 | import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
4 | import { MPlugin, MPluginFormattable } from '@server/types/models' | 3 | import { MPlugin, MPluginFormattable } from '@server/types/models' |
@@ -29,7 +28,7 @@ import { getSort, throwIfNotValid } from '../utils' | |||
29 | } | 28 | } |
30 | ] | 29 | ] |
31 | }) | 30 | }) |
32 | export class PluginModel extends Model<PluginModel> { | 31 | export class PluginModel extends Model { |
33 | 32 | ||
34 | @AllowNull(false) | 33 | @AllowNull(false) |
35 | @Is('PluginName', value => throwIfNotValid(value, isPluginNameValid, 'name')) | 34 | @Is('PluginName', value => throwIfNotValid(value, isPluginNameValid, 'name')) |
@@ -87,7 +86,7 @@ export class PluginModel extends Model<PluginModel> { | |||
87 | @UpdatedAt | 86 | @UpdatedAt |
88 | updatedAt: Date | 87 | updatedAt: Date |
89 | 88 | ||
90 | static listEnabledPluginsAndThemes (): Bluebird<MPlugin[]> { | 89 | static listEnabledPluginsAndThemes (): Promise<MPlugin[]> { |
91 | const query = { | 90 | const query = { |
92 | where: { | 91 | where: { |
93 | enabled: true, | 92 | enabled: true, |
@@ -98,7 +97,7 @@ export class PluginModel extends Model<PluginModel> { | |||
98 | return PluginModel.findAll(query) | 97 | return PluginModel.findAll(query) |
99 | } | 98 | } |
100 | 99 | ||
101 | static loadByNpmName (npmName: string): Bluebird<MPlugin> { | 100 | static loadByNpmName (npmName: string): Promise<MPlugin> { |
102 | const name = this.normalizePluginName(npmName) | 101 | const name = this.normalizePluginName(npmName) |
103 | const type = this.getTypeFromNpmName(npmName) | 102 | const type = this.getTypeFromNpmName(npmName) |
104 | 103 | ||
@@ -252,7 +251,7 @@ export class PluginModel extends Model<PluginModel> { | |||
252 | }) | 251 | }) |
253 | } | 252 | } |
254 | 253 | ||
255 | static listInstalled (): Bluebird<MPlugin[]> { | 254 | static listInstalled (): Promise<MPlugin[]> { |
256 | const query = { | 255 | const query = { |
257 | where: { | 256 | where: { |
258 | uninstalled: false | 257 | uninstalled: false |