openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
51 lines (43 loc) • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MediatorModel = exports.MediatorModelAPI = exports.configDef = exports.configParamTypes = undefined;
var _mongoose = require('mongoose');
var _config = require('../config');
var _channels = require('./channels');
const configParamTypes = exports.configParamTypes = ['string', 'bool', 'number', 'option', 'bigstring', 'map', 'struct', 'password'];
const configDef = exports.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
};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 = exports.MediatorModelAPI = _config.connectionAPI.model('Mediator', MediatorSchema);
const MediatorModel = exports.MediatorModel = _config.connectionDefault.model('Mediator', MediatorSchema);
//# sourceMappingURL=mediators.js.map