Files
FastGPT/packages/service/core/app/plugin/systemPluginSchema.ts
Archer 060492dbf7 feat: admin add custom plugin (#2582)
* feat: admin add custom plugin

* refresh plugins

* plugin input box ui

* fix: run plugin varialbes error

* perf: comment

* fix: ts
2024-08-30 22:45:35 +08:00

37 lines
743 B
TypeScript

import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
const { Schema } = connectionMongo;
import type { SystemPluginConfigSchemaType } from './type';
export const collectionName = 'app_system_plugins';
const SystemPluginSchema = new Schema({
pluginId: {
type: String,
required: true
},
isActive: {
type: Boolean,
required: true
},
inputConfig: {
type: Array,
default: []
},
originCost: {
type: Number,
default: 0
},
currentCost: {
type: Number,
default: 0
},
customConfig: Object
});
SystemPluginSchema.index({ pluginId: 1 });
export const MongoSystemPluginSchema = getMongoModel<SystemPluginConfigSchemaType>(
collectionName,
SystemPluginSchema
);