sharedb-access
Advanced tools
Comparing version 4.2.0 to 5.0.0
@@ -30,3 +30,3 @@ const _ = require('lodash') | ||
backend.use('doc', this.docHandler.bind(this)) | ||
backend.use('readSnapshots', this.readSnapshotsHandler.bind(this)) | ||
backend.use('apply', this.applyHandler.bind(this)) | ||
@@ -171,9 +171,18 @@ backend.use('commit', this.commitHandler.bind(this)) | ||
ShareDBAccess.prototype.docHandler = function (shareRequest, done){ | ||
this.docHandlerAsync(shareRequest) | ||
.then((res) => done(res)) | ||
.catch((err) => done(err)) | ||
ShareDBAccess.prototype.readSnapshotsHandler = function (shareRequest, done){ | ||
Promise.all(shareRequest.snapshots.map(snapshot => { | ||
return this.docHandlerAsync({ | ||
index: shareRequest.index, | ||
collection: shareRequest.collection, | ||
id: snapshot.id, | ||
snapshot: snapshot, | ||
agent: shareRequest.agent | ||
}) | ||
})) | ||
.then(reasons => { | ||
done(reasons.find(reason => reason)) | ||
}) | ||
.catch(err => done(err)) | ||
} | ||
ShareDBAccess.prototype.docHandlerAsync = async function (shareRequest){ | ||
@@ -180,0 +189,0 @@ // ++++++++++++++++++++++++++++++++ READ ++++++++++++++++++++++++++++++++++ |
{ | ||
"name": "sharedb-access", | ||
"version": "4.2.0", | ||
"version": "5.0.0", | ||
"description": "Sharedb access-control midleware", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
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
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
12421
235