Major changes around events, event log, etc.

* User event log is now functional & attached to various events
* Add additional missing system events
* Completely re-write last_callers to have new functionality, etc.
* Events.addListenerMultipleEvents()
* New 'moduleInitialize' export for module init vs Event specific registerEvents
* Add docs on last_callers mod
This commit is contained in:
Bryan Ashby 2018-07-21 14:32:06 -06:00
parent c1ae3d88ba
commit 52585c78f0
16 changed files with 392 additions and 171 deletions

View file

@ -179,7 +179,7 @@ module.exports = class User {
);
}
create(password, cb) {
create(createUserInfo , cb) {
assert(0 === this.userId);
const config = Config();
@ -219,7 +219,7 @@ module.exports = class User {
);
},
function genAuthCredentials(trans, callback) {
User.generatePasswordDerivedKeyAndSalt(password, (err, info) => {
User.generatePasswordDerivedKeyAndSalt(createUserInfo.password, (err, info) => {
if(err) {
return callback(err);
}
@ -244,7 +244,12 @@ module.exports = class User {
});
},
function sendEvent(trans, callback) {
Events.emit(Events.getSystemEvents().NewUser, { user : self });
Events.emit(
Events.getSystemEvents().NewUser,
{
user : Object.assign({}, self, { sessionId : createUserInfo.sessionId } )
}
);
return callback(null, trans);
}
],