@greenpress/plugins
Version:
manage plugins system
42 lines (41 loc) • 1.01 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const mongoose_1 = __importDefault(require("mongoose"));
const PluginSchema = new mongoose_1.default.Schema({
tenant: {
type: String,
index: true,
required: true
},
name: {
type: String,
required: true
},
description: String,
apiPath: {
type: String,
required: true,
},
user: {
type: String,
required: true
},
token: {
type: String,
required: true
},
proxyUrl: {
type: String,
required: true
},
microFrontends: [{
name: String,
path: String,
url: String,
}]
});
PluginSchema.index({ tenant: 1, apiPath: 1 }, { unique: true });
exports.default = mongoose_1.default.model('Plugin', PluginSchema);