Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var HttpController = exports.HttpController = function(oConfiguration){
this.logger = require('log/loggers').get('arestme/HttpController');
var xss = require("utils/xss");
this._oConfiguration = oConfiguration || {};
var self =this;
var matchRequestUrl = function(requestPath, method, cfg){
var pathDefs = Object.keys(cfg);
var matches = [];
for(var i=0; i
var DAOHandlersProvider = exports.DAOHandlersProvider = function(dao, oHttpController, loggerName){
HandlersProvider.call(this, loggerName);
this.logger = require('log/loggers').get((loggerName||'Default DAO Provider'));
var _oHttpController = this.oHttpController = oHttpController;
this.dao = dao;
var self = this;
var parseIntStrict = function (value) {
if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value))
return Number(value);
return NaN;
};
var notify = function(event){
var func = this[event];
if(!this[event])
return;
if(typeof func !== 'function')
throw Error('Illegal argument. Not a function: ' + func);
var DataService = exports.DataService = function(dao, loggerName){
if(arguments[0]===undefined)
throw Error('Illegal argument exception: arguments[0] is undefined');
this.logger = require('log/loggers').get((loggerName||'Data Service'));
HttpController.call(this, {});
this.handlersProvider;
if(arguments[0] instanceof HandlersProvider){
this.handlersProvider = arguments[0];
this.handlersProvider.oHttpController = this;
} else {
this.handlersProvider = new DAOHandlersProvider(arguments[0], this);
}
this.handlers = this.handlersProvider.getHandlers();
if(this.handlers['query'])
HttpController.prototype.addResourceHandlers.call(this, {
"": {
"get": [{
produces: ['application/json'],
var DAO = exports.DAO = function(orm, logCtxName, ds){
if(orm === undefined)
throw Error('Illegal argument: orm['+ orm + ']');
this.$log = require('log/loggers').get(logCtxName || 'DAO');
this.datasource = ds || database.getDatasource();
this.orm = require("daoism/orm").get(orm);
this.ormstatements = require('daoism/ormstatements').forDatasource(this.orm, this.datasource);
};
var HandlersProvider = exports.HandlersProvider = function(loggerName){
this.logger = require('log/loggers').get((loggerName||'DAO Provider'));
};
HandlersProvider.prototype.getHandlers = function(){return {}};
var Statements = exports.Statements = function(){
this.$log = require('log/loggers').get('daoism/statements');
};
exports.get = function(){
var ORMStatements = function(orm, dialect){
Statements.call(this);
this.$log = require('log/loggers').get('daoism/ormstatements');
this.orm = orm;
this.dialect = dialect;
};