Ghost/core/server/models/index.js

53 lines
767 B
JavaScript
Raw Normal View History

/**
* Dependencies
*/
const _ = require('lodash');
2013-06-01 18:47:41 +04:00
// enable event listeners
require('./base/listeners');
/**
* Expose all models
*/
exports = module.exports;
const models = [
'permission',
'post',
'role',
'settings',
'session',
'tag',
'tag-public',
'user',
'author',
'invite',
'webhook',
'integration',
'api-key',
'mobiledoc-revision',
'member',
'action',
2019-10-08 15:58:08 +03:00
'posts-meta',
'member-stripe-customer',
2019-11-06 08:52:58 +03:00
'stripe-customer-subscription',
'email',
'label',
'single-use-token'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;