rethinkdb-elasticsearch-stream
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -9,4 +9,6 @@ 'use strict'; | ||
var _through = require('through2'); | ||
var _rethinkdbChangefeedReconnect = require('rethinkdb-changefeed-reconnect'); | ||
var _rethinkdbChangefeedReconnect2 = _interopRequireDefault(_rethinkdbChangefeedReconnect); | ||
var _saveDocument = require('./save-document'); | ||
@@ -18,4 +20,2 @@ | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
@@ -33,26 +33,5 @@ | ||
const dataStream = r.db(db).table(table).changes().toStream(); | ||
return dataStream.pipe((0, _through.obj)((() => { | ||
var _ref2 = _asyncToGenerator(function* ({ new_val: chunk, old_val: oldDocument }, enc, cb) { | ||
try { | ||
yield (0, _saveDocument2.default)(_extends({ | ||
db, | ||
document: chunk, | ||
oldDocument, | ||
table | ||
}, properties)); | ||
} catch (e) { | ||
cb(e); | ||
} | ||
cb(); | ||
}); | ||
return function (_x, _x2, _x3) { | ||
return _ref2.apply(this, arguments); | ||
}; | ||
})())); | ||
(0, _rethinkdbChangefeedReconnect2.default)(() => r.db(db).table(table).changes(), ({ new_val: document, old_val: oldDocument }) => (0, _saveDocument2.default)(_extends({ db, document, oldDocument, table }, properties)), err => console.error(err.stack), { attemptDelay: 60000, maxAttempts: Infinity, silent: true }); | ||
} | ||
exports.default = watchTable; |
{ | ||
"name": "rethinkdb-elasticsearch-stream", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"main": "build/index.js", | ||
@@ -56,2 +56,4 @@ "repository": "https://github.com/gsandf/rethinkdb-elasticsearch-stream", | ||
"axios": "^0.17.0", | ||
"rethinkdb": "^2.3.3", | ||
"rethinkdb-changefeed-reconnect": "^0.3.2", | ||
"rethinkdbdash": "^2.3.31", | ||
@@ -58,0 +60,0 @@ "through2": "^2.0.3" |
Sorry, the diff of this file is not supported yet
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
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
187480
14
5
378
+ Addedrethinkdb@^2.3.3
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)
+ Addedrethinkdb@2.4.2(transitive)
+ Addedrethinkdb-changefeed-reconnect@0.3.2(transitive)