leo-connector-common 4.0.10-beta → 4.0.10-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ const async = require('async');
9
9
  const validate = require('./../utils/validation');
10
10
  let errorStream;
11
11
 
12
- module.exports = function(ID, source, client, tableConfig, stream, callback) {
12
+ module.exports = function (ID, source, client, tableConfig, stream, callback) {
13
13
 
14
14
  // adding backwards compatibility for ID and source
15
15
  if (!callback) {
@@ -39,7 +39,7 @@ module.exports = function(ID, source, client, tableConfig, stream, callback) {
39
39
  });
40
40
  });
41
41
 
42
- let checkforDelete = ls.through(function(obj, done) {
42
+ let checkforDelete = ls.through(function (obj, done) {
43
43
  if (obj.payload.type === 'delete') {
44
44
  let data = obj.payload.data || {};
45
45
  let ids = data.in || [];
@@ -68,7 +68,7 @@ module.exports = function(ID, source, client, tableConfig, stream, callback) {
68
68
  }
69
69
  });
70
70
 
71
- let validateData = ls.through(function(obj, done) {
71
+ let validateData = ls.through(function (obj, done) {
72
72
  let eventObj = obj.payload.data;
73
73
  let invalid = false;
74
74
 
@@ -336,7 +336,7 @@ module.exports = function(ID, source, client, tableConfig, stream, callback) {
336
336
  * @param eventObj {Object}
337
337
  * @param error {string}
338
338
  */
339
- function handleFailedValidation(ID, source, eventObj, error) {
339
+ function handleFailedValidation (ID, source, eventObj, error) {
340
340
  if (!errorStream || !errorStream.Writable) {
341
341
  errorStream = streams.passthrough({
342
342
  objectMode: true
@@ -345,9 +345,8 @@ function handleFailedValidation(ID, source, eventObj, error) {
345
345
  streams.pipe(
346
346
  errorStream,
347
347
 
348
- ls.process(ID, function(obj) {
349
- this.push(obj, { partial: true });
350
- done();
348
+ ls.process(ID, obj => {
349
+ return obj;
351
350
  }),
352
351
 
353
352
  leo.load(ID, `${source}_error`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leo-connector-common",
3
- "version": "4.0.10-beta",
3
+ "version": "4.0.10-rc",
4
4
  "description": "Common package for all Leo Platform database connectors",
5
5
  "main": "index.js",
6
6
  "directories": {},
@@ -20,13 +20,16 @@
20
20
  "devDependencies": {
21
21
  "chai": "^4.1.2",
22
22
  "eslint": "^4.17.0",
23
- "mocha": "^5.0.0"
23
+ "mocha": "^5.0.0",
24
+ "leo-sdk": "5.0.32-latest-v5"
25
+ },
26
+ "peerDependencies": {
27
+ "leo-sdk": ">=5.0.27-latest-v5"
24
28
  },
25
29
  "dependencies": {
26
30
  "async": "2.6.3",
27
- "leo-aws": "2.0.1",
31
+ "leo-aws": "2.0.2",
28
32
  "leo-logger": "1.0.1",
29
- "leo-sdk": "5.0.16",
30
33
  "leo-streams": "2.0.0",
31
34
  "moment": "2.24.0",
32
35
  "sqlstring": "2.3.1"