From 8fe01fc6502bf5ce51a0dae8739da5aabcf42af1 Mon Sep 17 00:00:00 2001 From: David Charbonnier Date: Wed, 1 Aug 2018 09:45:50 +0200 Subject: [PATCH 1/3] send projection information to the readSnapshot middleware --- lib/backend.js | 30 +++++++++++++++--------------- lib/query-emitter.js | 7 ++++--- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/backend.js b/lib/backend.js index e654a4f4e..910cbc6ce 100644 --- a/lib/backend.js +++ b/lib/backend.js @@ -82,6 +82,9 @@ Backend.prototype._shimDocAction = function() { this.use(this.MIDDLEWARE_ACTIONS.readSnapshots, function(request, callback) { async.each(request.snapshots, function(snapshot, eachCb) { var docRequest = {collection: request.collection, id: snapshot.id, snapshot: snapshot}; + if(request.projection) { + docRequest.index = request.projection.index; + } backend.trigger(backend.MIDDLEWARE_ACTIONS.doc, request.agent, docRequest, eachCb); }, callback); }); @@ -166,6 +169,7 @@ Backend.prototype.addProjection = function(name, collection, fields) { } this.projections[name] = { + index: name, target: collection, fields: fields }; @@ -259,22 +263,18 @@ Backend.prototype._sanitizeOpsBulk = function(agent, projection, collection, ops }, callback); }; -Backend.prototype._sanitizeSnapshots = function(agent, projection, collection, snapshots, callback) { - if (projection) { +Backend.prototype._sanitizeSnapshots = function(agent, projectSnapshots, projection, collection, snapshots, callback) { + if (projectSnapshots && projection) { try { projections.projectSnapshots(projection.fields, snapshots); } catch (err) { return callback(err); } } - var request = {collection: collection, snapshots: snapshots}; + var request = {collection: collection, snapshots: snapshots, projection: projection}; this.trigger(this.MIDDLEWARE_ACTIONS.readSnapshots, agent, request, callback); }; -Backend.prototype._getSnapshotProjection = function(db, projection) { - return (db.projectsSnapshots) ? null : projection; -}; - Backend.prototype._getSnapshotsFromMap = function(ids, snapshotMap) { var snapshots = new Array(ids.length); for (var i = 0; i < ids.length; i++) { @@ -345,9 +345,9 @@ Backend.prototype.fetch = function(agent, index, id, callback) { }; backend.db.getSnapshot(collection, id, fields, null, function(err, snapshot) { if (err) return callback(err); - var snapshotProjection = backend._getSnapshotProjection(backend.db, projection); + var projectsSnapshots = backend.db.projectsSnapshots; var snapshots = [snapshot]; - backend._sanitizeSnapshots(agent, snapshotProjection, collection, snapshots, function(err) { + backend._sanitizeSnapshots(agent, projectsSnapshots, projection, collection, snapshots, function(err) { if (err) return callback(err); backend.emit('timing', 'fetch', Date.now() - start, request); callback(null, snapshot); @@ -369,9 +369,9 @@ Backend.prototype.fetchBulk = function(agent, index, ids, callback) { }; backend.db.getSnapshotBulk(collection, ids, fields, null, function(err, snapshotMap) { if (err) return callback(err); - var snapshotProjection = backend._getSnapshotProjection(backend.db, projection); + var projectsSnapshots = backend.db.projectsSnapshots; var snapshots = backend._getSnapshotsFromMap(ids, snapshotMap); - backend._sanitizeSnapshots(agent, snapshotProjection, collection, snapshots, function(err) { + backend._sanitizeSnapshots(agent, projectsSnapshots, projection, collection, snapshots, function(err) { if (err) return callback(err); backend.emit('timing', 'fetchBulk', Date.now() - start, request); callback(null, snapshotMap); @@ -541,7 +541,7 @@ Backend.prototype._triggerQuery = function(agent, index, query, options, callbac query: query, options: options, db: null, - snapshotProjection: null, + projectsSnapshots: false, }; var backend = this; backend.trigger(backend.MIDDLEWARE_ACTIONS.query, agent, request, function(err) { @@ -550,7 +550,7 @@ Backend.prototype._triggerQuery = function(agent, index, query, options, callbac // that the db option can be changed in middleware request.db = (options.db) ? backend.extraDbs[options.db] : backend.db; if (!request.db) return callback({code: 4003, message: 'DB not found'}); - request.snapshotProjection = backend._getSnapshotProjection(request.db, projection); + request.projectsSnapshots = backend.db.projectsSnapshots; callback(null, request); }); }; @@ -559,7 +559,7 @@ Backend.prototype._query = function(agent, request, callback) { var backend = this; request.db.query(request.collection, request.query, request.fields, request.options, function(err, snapshots, extra) { if (err) return callback(err); - backend._sanitizeSnapshots(agent, request.snapshotProjection, request.collection, snapshots, function(err) { + backend._sanitizeSnapshots(agent, request.projectsSnapshots, request.projection, request.collection, snapshots, function(err) { callback(err, snapshots, extra); }); }); @@ -591,4 +591,4 @@ function pluckIds(snapshots) { ids.push(snapshots[i].id); } return ids; -} +} \ No newline at end of file diff --git a/lib/query-emitter.js b/lib/query-emitter.js index 9599c71cf..da89c6077 100644 --- a/lib/query-emitter.js +++ b/lib/query-emitter.js @@ -12,7 +12,8 @@ function QueryEmitter(request, stream, ids, extra) { this.collection = request.collection; this.fields = request.fields; this.options = request.options; - this.snapshotProjection = request.snapshotProjection; + this.projectSnapshots = request.projectSnapshots; + this.projection = request.projection; this.stream = stream; this.ids = ids; this.extra = extra; @@ -186,7 +187,7 @@ QueryEmitter.prototype.queryPoll = function(callback) { emitter.db.getSnapshotBulk(emitter.collection, inserted, emitter.fields, null, function(err, snapshotMap) { if (err) return emitter._finishPoll(err, callback, pending); var snapshots = emitter.backend._getSnapshotsFromMap(inserted, snapshotMap); - emitter.backend._sanitizeSnapshots(emitter.agent, emitter.snapshotProjection, emitter.collection, snapshots, function(err) { + emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { if (err) return emitter._finishPoll(err, callback, pending); emitter._emitTiming('queryEmitter.pollGetSnapshotBulk', start); var diff = mapDiff(idsDiff, snapshotMap); @@ -234,7 +235,7 @@ QueryEmitter.prototype.queryPollDoc = function(id, callback) { emitter.db.getSnapshot(emitter.collection, id, emitter.fields, null, function(err, snapshot) { if (err) return callback(err); var snapshots = [snapshot]; - emitter.backend._sanitizeSnapshots(emitter.agent, emitter.snapshotProjection, emitter.collection, snapshots, function(err) { + emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { if (err) return callback(err); emitter.onDiff([new arraydiff.InsertDiff(index, snapshots)]); emitter._emitTiming('queryEmitter.pollDocGetSnapshot', start); From 051318655ecb996e2ea561ef0207ec5c4a876e48 Mon Sep 17 00:00:00 2001 From: David Charbonnier Date: Wed, 1 Aug 2018 10:31:30 +0200 Subject: [PATCH 2/3] fix projectsSnapshots condition --- lib/backend.js | 14 +- lib/projections.js | 4 +- lib/query-emitter.js | 8 +- package-lock.json | 332 +++++++++++++++++++++---------------------- 4 files changed, 180 insertions(+), 178 deletions(-) diff --git a/lib/backend.js b/lib/backend.js index 910cbc6ce..b474e521d 100644 --- a/lib/backend.js +++ b/lib/backend.js @@ -263,10 +263,10 @@ Backend.prototype._sanitizeOpsBulk = function(agent, projection, collection, ops }, callback); }; -Backend.prototype._sanitizeSnapshots = function(agent, projectSnapshots, projection, collection, snapshots, callback) { - if (projectSnapshots && projection) { +Backend.prototype._sanitizeSnapshots = function(agent, projectsSnapshots, projection, collection, snapshots, callback) { + if (projectsSnapshots && projection) { try { - projections.projectSnapshots(projection.fields, snapshots); + projections.projectsSnapshots(projection.fields, snapshots); } catch (err) { return callback(err); } @@ -338,6 +338,7 @@ Backend.prototype.fetch = function(agent, index, id, callback) { var fields = projection && projection.fields; var backend = this; var request = { + projection: projection, agent: agent, index: index, collection: collection, @@ -345,7 +346,7 @@ Backend.prototype.fetch = function(agent, index, id, callback) { }; backend.db.getSnapshot(collection, id, fields, null, function(err, snapshot) { if (err) return callback(err); - var projectsSnapshots = backend.db.projectsSnapshots; + var projectsSnapshots = !backend.db.projectsSnapshots; var snapshots = [snapshot]; backend._sanitizeSnapshots(agent, projectsSnapshots, projection, collection, snapshots, function(err) { if (err) return callback(err); @@ -362,6 +363,7 @@ Backend.prototype.fetchBulk = function(agent, index, ids, callback) { var fields = projection && projection.fields; var backend = this; var request = { + collection: collection, agent: agent, index: index, collection: collection, @@ -369,7 +371,7 @@ Backend.prototype.fetchBulk = function(agent, index, ids, callback) { }; backend.db.getSnapshotBulk(collection, ids, fields, null, function(err, snapshotMap) { if (err) return callback(err); - var projectsSnapshots = backend.db.projectsSnapshots; + var projectsSnapshots = !backend.db.projectsSnapshots; var snapshots = backend._getSnapshotsFromMap(ids, snapshotMap); backend._sanitizeSnapshots(agent, projectsSnapshots, projection, collection, snapshots, function(err) { if (err) return callback(err); @@ -550,7 +552,7 @@ Backend.prototype._triggerQuery = function(agent, index, query, options, callbac // that the db option can be changed in middleware request.db = (options.db) ? backend.extraDbs[options.db] : backend.db; if (!request.db) return callback({code: 4003, message: 'DB not found'}); - request.projectsSnapshots = backend.db.projectsSnapshots; + request.projectsSnapshots = !request.db.projectsSnapshots; callback(null, request); }); }; diff --git a/lib/projections.js b/lib/projections.js index 48baa5ae7..2a8d84449 100644 --- a/lib/projections.js +++ b/lib/projections.js @@ -1,7 +1,7 @@ var json0 = require('ot-json0').type; exports.projectSnapshot = projectSnapshot; -exports.projectSnapshots = projectSnapshots; +exports.projectsSnapshots = projectsSnapshots; exports.projectOp = projectOp; exports.isSnapshotAllowed = isSnapshotAllowed; exports.isOpAllowed = isOpAllowed; @@ -16,7 +16,7 @@ function projectSnapshot(fields, snapshot) { snapshot.data = projectData(fields, snapshot.data); } -function projectSnapshots(fields, snapshots) { +function projectsSnapshots(fields, snapshots) { for (var i = 0; i < snapshots.length; i++) { var snapshot = snapshots[i]; projectSnapshot(fields, snapshot); diff --git a/lib/query-emitter.js b/lib/query-emitter.js index da89c6077..f8687fde5 100644 --- a/lib/query-emitter.js +++ b/lib/query-emitter.js @@ -12,12 +12,12 @@ function QueryEmitter(request, stream, ids, extra) { this.collection = request.collection; this.fields = request.fields; this.options = request.options; - this.projectSnapshots = request.projectSnapshots; + this.projectsSnapshots = request.projectsSnapshots; this.projection = request.projection; this.stream = stream; this.ids = ids; this.extra = extra; - + this.skipPoll = this.options.skipPoll || util.doNothing; this.canPollDoc = this.db.canPollDoc(this.collection, this.query); this.pollDebounce = @@ -187,7 +187,7 @@ QueryEmitter.prototype.queryPoll = function(callback) { emitter.db.getSnapshotBulk(emitter.collection, inserted, emitter.fields, null, function(err, snapshotMap) { if (err) return emitter._finishPoll(err, callback, pending); var snapshots = emitter.backend._getSnapshotsFromMap(inserted, snapshotMap); - emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { + emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectsSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { if (err) return emitter._finishPoll(err, callback, pending); emitter._emitTiming('queryEmitter.pollGetSnapshotBulk', start); var diff = mapDiff(idsDiff, snapshotMap); @@ -235,7 +235,7 @@ QueryEmitter.prototype.queryPollDoc = function(id, callback) { emitter.db.getSnapshot(emitter.collection, id, emitter.fields, null, function(err, snapshot) { if (err) return callback(err); var snapshots = [snapshot]; - emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { + emitter.backend._sanitizeSnapshots(emitter.agent, emitter.projectsSnapshots, emitter.projection, emitter.collection, snapshots, function(err) { if (err) return callback(err); emitter.onDiff([new arraydiff.InsertDiff(index, snapshots)]); emitter._emitTiming('queryEmitter.pollDocGetSnapshot', start); diff --git a/package-lock.json b/package-lock.json index c5c09f5d2..83b3bcb5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "integrity": "sha512-cYHZPTRMY6N7GxJ3SENzHyGVtgLlDfMdtfRs1CG+6+6DzUkfP/VkEIoR+K5jp02DyI5yvMErkyJkv4BvM23sLg==", "dev": true, "requires": { - "fast-diff": "^1.1.2" + "fast-diff": "1.1.2" } }, "abbrev": { @@ -25,10 +25,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, "align-text": { @@ -37,9 +37,9 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" } }, "amdefine": { @@ -54,7 +54,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "sprintf-js": "1.0.3" } }, "arraydiff": { @@ -79,7 +79,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "requires": { - "lodash": "^4.17.10" + "lodash": "4.17.10" }, "dependencies": { "lodash": { @@ -120,7 +120,7 @@ "dev": true, "optional": true, "requires": { - "tweetnacl": "^0.14.3" + "tweetnacl": "0.14.5" } }, "brace-expansion": { @@ -129,7 +129,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -159,8 +159,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" + "align-text": "0.1.4", + "lazy-cache": "1.0.4" } }, "cli": { @@ -170,7 +170,7 @@ "dev": true, "requires": { "exit": "0.1.2", - "glob": "^7.1.1" + "glob": "7.1.2" }, "dependencies": { "glob": { @@ -179,12 +179,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } } } @@ -196,8 +196,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", + "center-align": "0.1.3", + "right-align": "0.1.3", "wordwrap": "0.0.2" }, "dependencies": { @@ -222,7 +222,7 @@ "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { - "delayed-stream": "~1.0.0" + "delayed-stream": "1.0.0" } }, "commander": { @@ -243,7 +243,7 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "^0.1.4" + "date-now": "0.1.4" } }, "core-util-is": { @@ -258,12 +258,12 @@ "integrity": "sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw==", "dev": true, "requires": { - "growl": "~> 1.10.0", - "js-yaml": "^3.11.0", - "lcov-parse": "^0.0.10", - "log-driver": "^1.2.7", - "minimist": "^1.2.0", - "request": "^2.85.0" + "growl": "1.10.5", + "js-yaml": "3.12.0", + "lcov-parse": "0.0.10", + "log-driver": "1.2.7", + "minimist": "1.2.0", + "request": "2.87.0" }, "dependencies": { "esprima": { @@ -278,8 +278,8 @@ "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "1.0.10", + "esprima": "4.0.1" } } } @@ -290,7 +290,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "date-now": { @@ -344,8 +344,8 @@ "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "1.1.3", + "entities": "1.1.1" }, "dependencies": { "domelementtype": { @@ -374,7 +374,7 @@ "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "dev": true, "requires": { - "domelementtype": "1" + "domelementtype": "1.3.0" } }, "domutils": { @@ -383,8 +383,8 @@ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "dom-serializer": "0", - "domelementtype": "1" + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" } }, "ecc-jsbn": { @@ -394,7 +394,7 @@ "dev": true, "optional": true, "requires": { - "jsbn": "~0.1.0" + "jsbn": "0.1.1" } }, "entities": { @@ -415,11 +415,11 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" } }, "esprima": { @@ -500,9 +500,9 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "dev": true, "requires": { - "asynckit": "^0.4.0", + "asynckit": "0.4.0", "combined-stream": "1.0.6", - "mime-types": "^2.1.12" + "mime-types": "2.1.19" } }, "fs.realpath": { @@ -517,7 +517,7 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "glob": { @@ -526,11 +526,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "growl": { @@ -545,10 +545,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" }, "dependencies": { "async": { @@ -563,7 +563,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": ">=0.0.4" + "amdefine": "1.0.1" } } } @@ -580,8 +580,8 @@ "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "dev": true, "requires": { - "ajv": "^5.1.0", - "har-schema": "^2.0.0" + "ajv": "5.5.2", + "har-schema": "2.0.0" } }, "has-flag": { @@ -607,11 +607,11 @@ "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { - "domelementtype": "1", - "domhandler": "2.3", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" } }, "http-signature": { @@ -620,9 +620,9 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.2" } }, "inflight": { @@ -631,8 +631,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -677,20 +677,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.6.1", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.1", + "wordwrap": "1.0.0" }, "dependencies": { "async": { @@ -705,7 +705,7 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "^1.0.0" + "has-flag": "1.0.0" } } } @@ -716,8 +716,8 @@ "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^2.6.0" + "argparse": "1.0.10", + "esprima": "2.7.3" } }, "jsbn": { @@ -733,14 +733,14 @@ "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", "dev": true, "requires": { - "cli": "~1.0.0", - "console-browserify": "1.1.x", - "exit": "0.1.x", - "htmlparser2": "3.8.x", - "lodash": "3.7.x", - "minimatch": "~3.0.2", - "shelljs": "0.3.x", - "strip-json-comments": "1.0.x" + "cli": "1.0.1", + "console-browserify": "1.1.0", + "exit": "0.1.2", + "htmlparser2": "3.8.3", + "lodash": "3.7.0", + "minimatch": "3.0.4", + "shelljs": "0.3.0", + "strip-json-comments": "1.0.4" } }, "json-schema": { @@ -779,7 +779,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } }, "lazy-cache": { @@ -801,8 +801,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "1.1.2", + "type-check": "0.3.2" } }, "lodash": { @@ -846,7 +846,7 @@ "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", "dev": true, "requires": { - "mime-db": "~1.35.0" + "mime-db": "1.35.0" } }, "minimatch": { @@ -855,7 +855,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -906,12 +906,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "has-flag": { @@ -926,7 +926,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" } } } @@ -943,7 +943,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1" + "abbrev": "1.0.9" } }, "oauth-sign": { @@ -958,7 +958,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "optimist": { @@ -967,8 +967,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "minimist": "0.0.10", + "wordwrap": "0.0.3" }, "dependencies": { "minimist": { @@ -991,12 +991,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" } }, "ot-json0": { @@ -1046,8 +1046,8 @@ "integrity": "sha512-grWEQq9woEidPDogtDNxQKmy2LFf9zBC0EU/YTSw6TwKmMjtihTxdnPtPRfrqazB2MSJ7YdCWxmsJ7aQKRSEgg==", "dev": true, "requires": { - "deep-equal": "^1.0.1", - "extend": "^3.0.1", + "deep-equal": "1.0.1", + "extend": "3.0.1", "fast-diff": "1.1.2" } }, @@ -1057,10 +1057,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", + "core-util-is": "1.0.2", + "inherits": "2.0.3", "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "string_decoder": "0.10.31" } }, "repeat-string": { @@ -1075,26 +1075,26 @@ "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "dev": true, "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" + "aws-sign2": "0.7.0", + "aws4": "1.7.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.19", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.1.2", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.3.2" } }, "resolve": { @@ -1109,7 +1109,7 @@ "integrity": "sha1-BMlx3tzo64IBDPrP9uegzjXHqCU=", "dev": true, "requires": { - "quill-delta": "^3.2.0" + "quill-delta": "3.6.2" } }, "right-align": { @@ -1119,7 +1119,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "^0.1.1" + "align-text": "0.1.4" } }, "safe-buffer": { @@ -1147,7 +1147,7 @@ "dev": true, "optional": true, "requires": { - "amdefine": ">=0.0.4" + "amdefine": "1.0.1" } }, "sprintf-js": { @@ -1162,15 +1162,15 @@ "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "dev": true, "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.2", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "safer-buffer": "2.1.2", + "tweetnacl": "0.14.5" } }, "string_decoder": { @@ -1191,7 +1191,7 @@ "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { - "punycode": "^1.4.1" + "punycode": "1.4.1" } }, "tunnel-agent": { @@ -1200,7 +1200,7 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.1.2" } }, "tweetnacl": { @@ -1216,7 +1216,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "1.1.2" } }, "uglify-js": { @@ -1226,9 +1226,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" }, "dependencies": { "source-map": { @@ -1259,9 +1259,9 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "^1.0.0", + "assert-plus": "1.0.0", "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "extsprintf": "1.3.0" } }, "which": { @@ -1270,7 +1270,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "^2.0.0" + "isexe": "2.0.0" } }, "window-size": { @@ -1299,9 +1299,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", "window-size": "0.1.0" } } From 3d0859cae2d7ccfad1b8fda2e13cd5ad6d5bc40a Mon Sep 17 00:00:00 2001 From: David Charbonnier Date: Wed, 1 Aug 2018 14:06:56 +0200 Subject: [PATCH 3/3] remove duplicate object key --- lib/backend.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/backend.js b/lib/backend.js index b474e521d..d642e9c65 100644 --- a/lib/backend.js +++ b/lib/backend.js @@ -363,7 +363,6 @@ Backend.prototype.fetchBulk = function(agent, index, ids, callback) { var fields = projection && projection.fields; var backend = this; var request = { - collection: collection, agent: agent, index: index, collection: collection,