dynamodb-recs
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,3 +5,13 @@ const { | ||
const App = require('../App'); | ||
const recs = require('./recs'); | ||
const recsFirehose = (argsOrEdge, options) => { | ||
if (argsOrEdge instanceof App) { | ||
argsOrEdge = argsOrEdge.models.recs.edge; | ||
} | ||
return linkFirehose(argsOrEdge, options); | ||
}; | ||
const recsLogsFirehose = require('./recsLogsFirehose'); | ||
@@ -13,3 +23,3 @@ const recsLogsHit = require('./recsLogsHit'); | ||
recs, | ||
recsFirehose: linkFirehose, | ||
recsFirehose, | ||
recsLogsFirehose, | ||
@@ -16,0 +26,0 @@ recsLogsHit, |
@@ -0,1 +1,2 @@ | ||
const _ = require('lodash'); | ||
const App = require('../App'); | ||
@@ -16,3 +17,3 @@ const { | ||
.subscribe(response => { | ||
callback(null, toResponse(response, 200, isApiGateway)); | ||
callback(null, toResponse(_.size(response), 200, isApiGateway)); | ||
}, err => { | ||
@@ -19,0 +20,0 @@ callback(null, toResponse(err.message, 500, isApiGateway)); |
@@ -17,3 +17,3 @@ const chai = require('chai'); | ||
sinon.stub(app.models.recsLogs, 'process') | ||
.returns(rx.of(null)); | ||
.returns(rx.of([])); | ||
}); | ||
@@ -35,3 +35,3 @@ | ||
}, | ||
body: null, | ||
body: 0, | ||
statusCode: 200 | ||
@@ -38,0 +38,0 @@ }); |
@@ -182,2 +182,5 @@ const _ = require('lodash'); | ||
.pipe( | ||
rxop.filter(args => { | ||
return _.size(args.collection) > 1 | ||
}), | ||
rxop.mergeMap(args => { | ||
@@ -184,0 +187,0 @@ const { |
@@ -78,2 +78,15 @@ const chai = require('chai'); | ||
}); | ||
it('should filter single collections', done => { | ||
app.models.recs.ingest({ | ||
collection: [ | ||
'0' | ||
], | ||
entity: 'entity', | ||
namespace | ||
}) | ||
.subscribe(() => { | ||
expect(app.models.recs.edge.allAll).to.not.have.been.called; | ||
}, null, done); | ||
}); | ||
}); | ||
@@ -80,0 +93,0 @@ |
{ | ||
"name": "dynamodb-recs", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
63008
1760