harcon-radiation
Advanced tools
Comparing version 0.5.6 to 0.6.0
@@ -6,3 +6,3 @@ var ES6 = require('./ES6Fixer'); | ||
var VERSION = exports.VERSION = '0.5.6'; | ||
var VERSION = exports.VERSION = '0.6.0'; | ||
function extend(obj, extension){ | ||
@@ -26,2 +26,5 @@ for(var key in extension){ | ||
this.logger = this.options.logger || inflicter.logger; | ||
this.inceptors = this.options.inceptors || {}; | ||
this.logger.radiationlog = function( err, message, obj, level ){ | ||
@@ -80,2 +83,6 @@ this.log( err ? 'error' : (level || 'debug'), err ? err.message : message, extend( obj || {}, { 'radiation': VERSION } ) ); | ||
radiation.intercept = function(path, interceptor){ | ||
this.inceptors[ path ] = interceptor; | ||
}; | ||
radiation.ignite = function( id, terms, division, event, params, callback ){ | ||
@@ -149,3 +156,7 @@ var parameters = [ id, division, event ].concat( params ); | ||
self.restify.post( path, function( request, content, callback ){ | ||
self.ignite( clerobee.generate(), { request: request, content: content }, firestarter.division, firestarter.context + '.' + service, content.params || content.parameters || [], callback ); | ||
self.ignite( clerobee.generate(), { request: request, content: content }, firestarter.division, firestarter.context + '.' + service, content.params || content.parameters || [], function(err, res){ | ||
if( self.inceptors[ path.context + path.path ] ) | ||
self.inceptors[ path.context + path.path ]( request, content, err, res ); | ||
callback( err, res ); | ||
} ); | ||
}, null, security ); | ||
@@ -152,0 +163,0 @@ return path; |
{ | ||
"name": "harcon-radiation", | ||
"version": "0.5.6", | ||
"version": "0.6.0", | ||
"description": "REST and Websocket plugin for harcon", | ||
@@ -54,3 +54,3 @@ "keywords": [ | ||
}, | ||
"_id": "harcon-radiation@0.5.6" | ||
"_id": "harcon-radiation@0.6.0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28944
469