volos-connectors-common
Advanced tools
Comparing version 0.0.9 to 0.0.11
@@ -47,3 +47,9 @@ var serverBase = require('./serverBase'); | ||
var limit = this.getParameter(req.query, 'limit', this.defaults.limit); | ||
var limit; | ||
var id = req.params.id; | ||
if (id) { | ||
limit = 1; | ||
} else { | ||
limit = this.getParameter(req.query, 'limit', this.defaults.limit); | ||
} | ||
queryString += " LIMIT " + limit; | ||
@@ -157,16 +163,25 @@ | ||
var id = req.params.id; | ||
if (id) { | ||
queryString = this.addWhere(queryString, queryInfo.idName + '=\'' + id + '\''); | ||
for (var key in req.params) { | ||
if (key === 'id') { | ||
queryString = this.addWhere(queryString, queryInfo.idName + ' = \'' + req.params.id + '\''); | ||
} else if (queryInfo.templateParameters) { | ||
var whereFragment = queryInfo.templateParameters[key]; | ||
if (whereFragment) { | ||
var templatedWhereFragment = whereFragment.replace('{' + key + '}', req.params[key]); | ||
queryString = this.addWhere(queryString, templatedWhereFragment); | ||
} | ||
} | ||
} | ||
for (var key in nonstockQueryParameters) { | ||
if (queryInfo.queryParameters[key] != undefined) { | ||
var whereFragment = queryInfo.queryParameters[key]; | ||
var templatedWhereFragment = whereFragment.replace('{' + key + '}', nonstockQueryParameters[key]); | ||
queryString = this.addWhere(queryString, templatedWhereFragment); | ||
} | ||
if (queryInfo.queryParameters) { | ||
for (var key in nonstockQueryParameters) { | ||
var whereFragment = queryInfo.queryParameters[key]; | ||
if (whereFragment) { | ||
var templatedWhereFragment = whereFragment.replace('{' + key + '}', nonstockQueryParameters[key]); | ||
queryString = this.addWhere(queryString, templatedWhereFragment); | ||
} | ||
} | ||
} | ||
return(queryString); | ||
return queryString; | ||
} | ||
@@ -198,2 +213,2 @@ | ||
exports.SqlServerBase = SqlServerBase; | ||
exports.SqlServerBase = SqlServerBase; |
{ | ||
"name": "volos-connectors-common", | ||
"version": "0.0.9", | ||
"version": "0.0.11", | ||
"description": "Basic support library for Volos Connectors.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
30013
742
7
10