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 { AttributesOnly } from '@shared/core-utils'
import { PeerTubePlugin, PluginType, RegisterServerSettingOptions } from '../../../shared/models'
import {
isPluginDescriptionValid,
}
]
})
-export class PluginModel extends Model {
+export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> {
@AllowNull(false)
@Is('PluginName', value => throwIfNotValid(value, isPluginNameValid, 'name'))
for (const r of registeredSettings) {
if (r.private !== false) continue
- result[r.name] = settings[r.name] || r.default || null
+ result[r.name] = settings[r.name] ?? r.default ?? null
}
return result