2015-10-06 08:36:56 -05:00
|
|
|
/**
|
|
|
|
* Dependencies
|
|
|
|
*/
|
|
|
|
|
2016-03-01 23:42:01 -05:00
|
|
|
var _ = require('lodash'),
|
2015-10-06 08:36:56 -05:00
|
|
|
exports,
|
2014-07-13 06:17:18 -05:00
|
|
|
models;
|
2013-06-01 09:47:41 -05:00
|
|
|
|
2016-06-10 02:37:55 -05:00
|
|
|
// enable event listeners
|
|
|
|
require('./base/listeners');
|
2016-06-01 11:46:41 -05:00
|
|
|
|
2015-10-06 08:36:56 -05:00
|
|
|
/**
|
|
|
|
* Expose all models
|
|
|
|
*/
|
|
|
|
exports = module.exports;
|
|
|
|
|
|
|
|
models = [
|
|
|
|
'accesstoken',
|
|
|
|
'app-field',
|
|
|
|
'app-setting',
|
|
|
|
'app',
|
|
|
|
'client-trusted-domain',
|
|
|
|
'client',
|
|
|
|
'permission',
|
|
|
|
'post',
|
|
|
|
'refreshtoken',
|
|
|
|
'role',
|
|
|
|
'settings',
|
2016-04-14 15:44:05 -05:00
|
|
|
'subscriber',
|
2015-10-06 08:36:56 -05:00
|
|
|
'tag',
|
2016-09-21 09:48:14 -05:00
|
|
|
'user',
|
|
|
|
'invite'
|
2015-10-06 08:36:56 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
exports.Base = require('./base');
|
|
|
|
|
|
|
|
models.forEach(function (name) {
|
|
|
|
_.extend(exports, require('./' + name));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Expose `init`
|
|
|
|
*/
|
|
|
|
|
|
|
|
exports.init = init;
|