@cloudant/couchbackup 2.7.1-SNAPSHOT.31 → 2.7.1-SNAPSHOT.35

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.
package/CHANGES.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Unreleased
2
2
  - [FIXED] Corrected `user-agent` header on requests.
3
+ - [FIXED] Restore of shallow backups created with versions <=2.4.2.
3
4
 
4
5
  # 2.7.0 (2021-09-14)
5
6
  - [UPGRADED] Cloudant client dependency from `@cloudant/cloudant` to `@ibm-cloud/cloudant`.
@@ -32,6 +32,7 @@ module.exports = function(db, bufferSize, parallelism, ee) {
32
32
  // if we are restoring known revisions, we need to supply new_edits=false
33
33
  if (payload.docs && payload.docs[0] && payload.docs[0]._rev) {
34
34
  payload.new_edits = false;
35
+ debug('Using new_edits false mode.');
35
36
  }
36
37
 
37
38
  if (!didError) {
@@ -39,8 +40,9 @@ module.exports = function(db, bufferSize, parallelism, ee) {
39
40
  db: db.db,
40
41
  bulkDocs: payload
41
42
  }).then(response => {
42
- if (!response.result || response.result.length > 0) {
43
- throw new Error('Error writing batch.');
43
+ if (!response.result || (payload.new_edits === false && response.result.length > 0)) {
44
+ throw new Error(`Error writing batch with new_edits:${payload.new_edits !== false}` +
45
+ ` and ${response.result ? response.result.length : 'unavailable'} items`);
44
46
  }
45
47
  written += payload.docs.length;
46
48
  writer.emit('restored', { documents: payload.docs.length, total: written });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudant/couchbackup",
3
- "version": "2.7.1-SNAPSHOT.31",
3
+ "version": "2.7.1-SNAPSHOT.35",
4
4
  "description": "CouchBackup - command-line backup utility for Cloudant/CouchDB",
5
5
  "homepage": "https://github.com/cloudant/couchbackup",
6
6
  "repository": "https://github.com/cloudant/couchbackup.git",
@@ -20,7 +20,7 @@
20
20
  "node": ">=12"
21
21
  },
22
22
  "dependencies": {
23
- "@ibm-cloud/cloudant": "0.0.18",
23
+ "@ibm-cloud/cloudant": "0.0.21",
24
24
  "tough-cookie": "^4.0.0",
25
25
  "retry-axios": "^2.4.0",
26
26
  "async": "^3.1.0",