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