ps-direct-sdk
Advanced tools
Comparing version 2.1.1 to 2.1.2
19
db.js
@@ -7,2 +7,6 @@ "use strict"; | ||
const logKey = (msg, key) => () => logger.info(msg, { key }); | ||
const logKeyScore = (msg, key, score) => () => logger.info(msg, { score, key }); | ||
module.exports = function (config) { | ||
@@ -14,3 +18,4 @@ var client = R.isNil(config) ? initFakeRedis() : initRealRedis(config); | ||
getKey: (key) => { | ||
return client.getStream(key); | ||
logger.info('Retrieving key', { key }); | ||
return client.getStream(key).tap(logKey('Key retrieved', key)); | ||
}, | ||
@@ -27,9 +32,12 @@ listKey: function listKey(key, before, after, limit) { | ||
setKey: function (key, value) { | ||
return client.setStream(key, value); | ||
logger.info('Setting key', { key }); | ||
return client.setStream(key, value).tap(logKey('Key set', key)); | ||
}, | ||
delKey: function delKey(key) { | ||
return client.delStream(key); | ||
logger.info('Deleting key', { key }); | ||
return client.delStream(key).tap(logKey('Key deleted', key)); | ||
}, | ||
addToKey: function addToKey(key, score, value) { | ||
return client.zaddStream(key, score, value); | ||
logger.info('Appending to list', { score, key }); | ||
return client.zaddStream(key, score, value).tap(logKeyScore('Appended to list', key, score)); | ||
}, | ||
@@ -40,3 +48,4 @@ delFromKey: function delFromKey(key, value) { | ||
delFromKeyByScore: function (key, score) { | ||
return client.zremrangebyscoreStream(key, score, score); | ||
logger.info('Removing from list', { score, key }); | ||
return client.zremrangebyscoreStream(key, score, score).tap(logKeyScore('Removed from list', key, score)); | ||
} | ||
@@ -43,0 +52,0 @@ }; |
{ | ||
"name": "ps-direct-sdk", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Directly ", | ||
@@ -15,3 +15,2 @@ "main": "index.js", | ||
"redis": "^2.5.3", | ||
"rewire": "^2.5.1", | ||
"winston": "^2.2.0" | ||
@@ -21,2 +20,3 @@ }, | ||
"chai": "^3.5.0", | ||
"mocha": "^2.4.5", | ||
"sinon": "^1.17.4" | ||
@@ -23,0 +23,0 @@ }, |
"use strict"; | ||
var assert = require("chai").assert; | ||
var presentationService = require('../index'); | ||
var config = process.env.USE_REDIS === 'true' ? { | ||
const presentationService = require('../index'); | ||
const config = process.env.USE_REDIS === 'true' ? { | ||
"host": "127.0.0.1", | ||
"port": 6379 | ||
} : void 0; | ||
var ps = presentationService(config); | ||
var chai = require('chai'); | ||
var R = require('ramda'); | ||
var hl = require('highland'); | ||
var assertEquals = function (obj1) { | ||
const ps = presentationService(config); | ||
const assert = require("chai").assert; | ||
const R = require('ramda'); | ||
const hl = require('highland'); | ||
const assertEquals = function (obj1) { | ||
return function (obj2) { | ||
@@ -66,3 +64,3 @@ assert(R.equals(obj1, obj2)); | ||
it('can put and get an object using the putObject method', (done)=> { | ||
var obj = {"data": {"type": "un-stringified data"}}; | ||
const obj = {"data": {"type": "un-stringified data"}}; | ||
ps.putObject('/v1/putObjectTest', obj) | ||
@@ -69,0 +67,0 @@ .flatMap(() => ps.get('/v1/putObjectTest')) |
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
31838
5
729
3
- Removedrewire@^2.5.1
- Removedrewire@2.5.2(transitive)