presentation-service-server
Advanced tools
Comparing version 2.0.16 to 2.1.0
@@ -7,3 +7,2 @@ "use strict"; | ||
var logger = require('winston').loggers.get('elasticsearch'); | ||
var hydrateString = require("./hydrateString"); | ||
@@ -37,3 +36,3 @@ logger.transports.console.timestamp = true; | ||
const key = decodeURIComponent(req.path()); | ||
hydrateString(db, {}, "${" + key + "}") | ||
db.get(key) | ||
.errors(logStreamExceptions(req)) | ||
@@ -74,5 +73,5 @@ .stopOnError(e => { | ||
if (R.isNil(score)) { | ||
return db.setKey(key, value); | ||
return db.put(key, value); | ||
} else if (!isNaN(score)) { | ||
return db.addToKey(key, score, value); | ||
return db.add(key, score, value); | ||
} else { | ||
@@ -93,8 +92,3 @@ throw new restify.BadRequestError('score must be a number'); | ||
const key = decodeURIComponent(req.path()); | ||
const stream = req.query.value == null ? db.delKey(key) | ||
: isNaN(req.query.value) ? db.delFromKey(key, req.query.value) | ||
: db.delFromKeyByScore(key, Number(req.query.value)); | ||
stream | ||
db.rem(key, req.query.value) | ||
.errors(logStreamExceptions(req)) | ||
@@ -101,0 +95,0 @@ .stopOnError(next) |
{ | ||
"name": "presentation-service-server", | ||
"version": "2.0.16", | ||
"version": "2.1.0", | ||
"description": "Server component for the presentation service", | ||
@@ -16,7 +16,6 @@ "main": "server.js", | ||
"config": "1.20.1", | ||
"fakeredis": "1.0.3", | ||
"highland": "2.7.4", | ||
"morgan": "1.7.0", | ||
"ps-direct-sdk": "2.1.0", | ||
"ramda": "0.21.0", | ||
"redis": "2.5.3", | ||
"restify": "4.0.4", | ||
@@ -34,3 +33,2 @@ "winston": "2.2.0" | ||
} | ||
} |
@@ -17,6 +17,6 @@ "use strict"; | ||
var redisClient = require('./lib/db')(config); | ||
var db = require("ps-direct-sdk")(config.redis); | ||
function useAPI(prefix, server) { | ||
var api = require('./lib/' + prefix)(redisClient); | ||
var api = require('./lib/' + prefix)(db); | ||
for (var method in api) { | ||
@@ -23,0 +23,0 @@ if (api.hasOwnProperty(method) && R.contains(translateAPIMethodName(method), config.allowedMethods)) { |
@@ -10,11 +10,10 @@ "use strict"; | ||
var config = { | ||
"redis": { | ||
"redis": process.env.USE_REDIS === 'true' ? { | ||
"host": "127.0.0.1", | ||
"port": 6379 | ||
}, | ||
} : void 0, | ||
"server": { | ||
"port": 8080 | ||
}, | ||
"allowedMethods": ["GET", "PUT", "DELETE"], | ||
"database": process.env.USE_REDIS === 'true' ? "redis" : "fakeRedis" | ||
"allowedMethods": ["GET", "PUT", "DELETE"] | ||
}; | ||
@@ -40,3 +39,2 @@ | ||
}); | ||
var del = hl.wrapCallback((key, cb) => { | ||
@@ -43,0 +41,0 @@ request.del(key).end(cb); |
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
7
3
13492
8
311
+ Addedps-direct-sdk@2.1.0
+ Addedps-direct-sdk@2.1.0(transitive)
+ Addedredis@2.8.0(transitive)
+ Addedredis-parser@2.6.0(transitive)
+ Addedrewire@2.5.2(transitive)
- Removedfakeredis@1.0.3
- Removedredis@2.5.3
- Removedredis@2.5.3(transitive)