openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
65 lines (55 loc) • 1.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MediatorModel = exports.MediatorModelAPI = exports.configDef = exports.configParamTypes = void 0;
var _mongoose = require("mongoose");
var _config = require("../config");
var _channels = require("./channels");
const configParamTypes = ['string', 'bool', 'number', 'option', 'bigstring', 'map', 'struct', 'password'];
exports.configParamTypes = configParamTypes;
const configDef = {
param: String,
displayName: String,
description: String,
type: {
type: String,
enum: exports.configParamTypes
},
values: [{
type: String
}],
template: {
type: Array
},
array: Boolean
}; // The properties prefixed with an '_' are internally used properties and shouldn't be set by the user
exports.configDef = configDef;
const MediatorSchema = new _mongoose.Schema({
urn: {
type: String,
required: true,
unique: true
},
version: {
type: String,
required: true
},
name: {
type: String,
required: true
},
description: String,
endpoints: [_channels.RouteDef],
defaultChannelConfig: [_channels.ChannelDef],
configDefs: [configDef],
config: Object,
_configModifiedTS: Date,
_uptime: Number,
_lastHeartbeat: Date
}); // Model for describing a collection of mediators that have registered themselves with core
const MediatorModelAPI = _config.connectionAPI.model('Mediator', MediatorSchema);
exports.MediatorModelAPI = MediatorModelAPI;
const MediatorModel = _config.connectionDefault.model('Mediator', MediatorSchema);
exports.MediatorModel = MediatorModel;
//# sourceMappingURL=mediators.js.map