pouchdb-checkpointer
Advanced tools
Comparing version 6.2.0 to 6.2.1-prerelease
@@ -76,3 +76,3 @@ import Promise from 'pouchdb-promise'; | ||
function Checkpointer(src, target, id, returnValue) { | ||
function Checkpointer(src, target, id, returnValue, opts) { | ||
this.src = src; | ||
@@ -82,2 +82,3 @@ this.target = target; | ||
this.returnValue = returnValue; | ||
this.opts = opts; | ||
} | ||
@@ -93,20 +94,28 @@ | ||
Checkpointer.prototype.updateTarget = function (checkpoint, session) { | ||
return updateCheckpoint(this.target, this.id, checkpoint, | ||
session, this.returnValue); | ||
if (this.opts.writeTargetCheckpoint) { | ||
return updateCheckpoint(this.target, this.id, checkpoint, | ||
session, this.returnValue); | ||
} else { | ||
return Promise.resolve(true); | ||
} | ||
}; | ||
Checkpointer.prototype.updateSource = function (checkpoint, session) { | ||
var self = this; | ||
if (this.readOnlySource) { | ||
if (this.opts.writeSourceCheckpoint) { | ||
var self = this; | ||
if (this.readOnlySource) { | ||
return Promise.resolve(true); | ||
} | ||
return updateCheckpoint(this.src, this.id, checkpoint, | ||
session, this.returnValue) | ||
.catch(function (err) { | ||
if (isForbiddenError(err)) { | ||
self.readOnlySource = true; | ||
return true; | ||
} | ||
throw err; | ||
}); | ||
} else { | ||
return Promise.resolve(true); | ||
} | ||
return updateCheckpoint(this.src, this.id, checkpoint, | ||
session, this.returnValue) | ||
.catch(function (err) { | ||
if (isForbiddenError(err)) { | ||
self.readOnlySource = true; | ||
return true; | ||
} | ||
throw err; | ||
}); | ||
}; | ||
@@ -113,0 +122,0 @@ |
@@ -80,3 +80,3 @@ 'use strict'; | ||
function Checkpointer(src, target, id, returnValue) { | ||
function Checkpointer(src, target, id, returnValue, opts) { | ||
this.src = src; | ||
@@ -86,2 +86,3 @@ this.target = target; | ||
this.returnValue = returnValue; | ||
this.opts = opts; | ||
} | ||
@@ -97,20 +98,28 @@ | ||
Checkpointer.prototype.updateTarget = function (checkpoint, session) { | ||
return updateCheckpoint(this.target, this.id, checkpoint, | ||
session, this.returnValue); | ||
if (this.opts.writeTargetCheckpoint) { | ||
return updateCheckpoint(this.target, this.id, checkpoint, | ||
session, this.returnValue); | ||
} else { | ||
return Promise.resolve(true); | ||
} | ||
}; | ||
Checkpointer.prototype.updateSource = function (checkpoint, session) { | ||
var self = this; | ||
if (this.readOnlySource) { | ||
if (this.opts.writeSourceCheckpoint) { | ||
var self = this; | ||
if (this.readOnlySource) { | ||
return Promise.resolve(true); | ||
} | ||
return updateCheckpoint(this.src, this.id, checkpoint, | ||
session, this.returnValue) | ||
.catch(function (err) { | ||
if (isForbiddenError(err)) { | ||
self.readOnlySource = true; | ||
return true; | ||
} | ||
throw err; | ||
}); | ||
} else { | ||
return Promise.resolve(true); | ||
} | ||
return updateCheckpoint(this.src, this.id, checkpoint, | ||
session, this.returnValue) | ||
.catch(function (err) { | ||
if (isForbiddenError(err)) { | ||
self.readOnlySource = true; | ||
return true; | ||
} | ||
throw err; | ||
}); | ||
}; | ||
@@ -117,0 +126,0 @@ |
{ | ||
"name": "pouchdb-checkpointer", | ||
"version": "6.2.0", | ||
"version": "6.2.1-prerelease", | ||
"description": "PouchDB tool to write a checkpoint, e.g. during replication.", | ||
@@ -10,13 +10,3 @@ "main": "./lib/index.js", | ||
"repository": "https://github.com/pouchdb/pouchdb", | ||
"jsnext:main": "./lib/index.es.js", | ||
"dependencies": { | ||
"pouchdb-collate": "6.2.0", | ||
"pouchdb-promise": "6.2.0", | ||
"pouchdb-utils": "6.2.0" | ||
}, | ||
"files": [ | ||
"lib", | ||
"dist", | ||
"tonic-example.js" | ||
] | ||
"jsnext:main": "./src/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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
33660
0
6
676
2
- Removedpouchdb-collate@6.2.0
- Removedpouchdb-promise@6.2.0
- Removedpouchdb-utils@6.2.0
- Removedargsarray@0.0.1(transitive)
- Removedclone-buffer@1.0.0(transitive)
- Removedimmediate@3.0.6(transitive)
- Removedinherits@2.0.3(transitive)
- Removedlie@3.1.1(transitive)
- Removedpouchdb-collate@6.2.0(transitive)
- Removedpouchdb-collections@6.2.0(transitive)
- Removedpouchdb-errors@6.2.0(transitive)
- Removedpouchdb-promise@6.2.0(transitive)
- Removedpouchdb-utils@6.2.0(transitive)