harcon-radiation
Advanced tools
Comparing version 0.6.1 to 0.6.5
@@ -6,3 +6,3 @@ var ES6 = require('./ES6Fixer'); | ||
var VERSION = exports.VERSION = '0.6.1'; | ||
var VERSION = exports.VERSION = '0.6.5'; | ||
function extend(obj, extension){ | ||
@@ -27,4 +27,2 @@ for(var key in extension){ | ||
this.inceptors = this.options.inceptors || {}; | ||
this.logger.radiationlog = function( err, message, obj, level ){ | ||
@@ -83,6 +81,2 @@ 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 ){ | ||
@@ -155,9 +149,11 @@ var parameters = [ id, division, event ].concat( params ); | ||
path.protector = security.protector; | ||
var interceptor = firestarter.object.inceptors || {}; | ||
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 || [], function(err, res){ | ||
var interceptor = self.inceptors[ path.context + path.path ]; | ||
if( interceptor ) | ||
interceptor( request, content, err, res, callback ); | ||
else | ||
callback( err, res ); | ||
var params = content.params || content.parameters || []; | ||
if( interceptor.parametrise ) | ||
params = interceptor.parametrise( params ); | ||
self.ignite( clerobee.generate(), { request: request, content: content }, firestarter.division, firestarter.context + '.' + service, params, function(err, res){ | ||
if( interceptor.endorse ) | ||
interceptor.endorse( request, content, err, res ); | ||
callback( err, res ); | ||
} ); | ||
@@ -164,0 +160,0 @@ }, null, security ); |
{ | ||
"name": "harcon-radiation", | ||
"version": "0.6.1", | ||
"version": "0.6.5", | ||
"description": "REST and Websocket plugin for harcon", | ||
@@ -54,3 +54,3 @@ "keywords": [ | ||
}, | ||
"_id": "harcon-radiation@0.6.1" | ||
"_id": "harcon-radiation@0.6.5" | ||
} |
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
28916
469