X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fserver%2Fplugin.ts;h=a8de64dd4854b079d7d41d7d8a18a8807cff1975;hb=20213fbd2a366dffc35aa7dddad71323893f8d62;hp=80c8a6be5bd35d2c18d1c3e88fc65045f3cea7e7;hpb=8bb6e70be3c7199a0503aca302b4b32317520db3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 80c8a6be5..a8de64dd4 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts @@ -1,9 +1,8 @@ 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 { AttributesOnly } from '@shared/core-utils' +import { PeerTubePlugin, PluginType, RegisterServerSettingOptions } from '../../../shared/models' import { isPluginDescriptionValid, isPluginHomepage, @@ -28,7 +27,7 @@ import { getSort, throwIfNotValid } from '../utils' } ] }) -export class PluginModel extends Model { +export class PluginModel extends Model>> { @AllowNull(false) @Is('PluginName', value => throwIfNotValid(value, isPluginNameValid, 'name'))