@cloudant/couchbackup 2.11.19-SNAPSHOT-439 → 2.11.19-SNAPSHOT-441

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.
Files changed (2) hide show
  1. package/app.js +13 -17
  2. package/package.json +3 -3
package/app.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright © 2017, 2024 IBM Corp. All rights reserved.
1
+ // Copyright © 2017, 2026 IBM Corp. All rights reserved.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ function isSafePositiveInteger(x) {
54
54
  * @param {boolean} isIAM - A flag if IAM authentication been used.
55
55
  * @returns Boolean true if all checks are passing.
56
56
  */
57
- async function validateURL(url, isIAM) {
57
+ function validateURL(url, isIAM) {
58
58
  if (typeof url !== 'string') {
59
59
  throw new OptionError('Invalid URL, must be type string');
60
60
  }
@@ -83,7 +83,7 @@ async function validateURL(url, isIAM) {
83
83
  * @param {object} opts - Options.
84
84
  * @returns Boolean true if all checks are passing.
85
85
  */
86
- async function validateOptions(opts) {
86
+ function validateOptions(opts) {
87
87
  // if we don't have opts then we'll be using defaults
88
88
  if (!opts) {
89
89
  return true;
@@ -139,7 +139,7 @@ async function validateOptions(opts) {
139
139
  *
140
140
  * @param {object} opts - Options.
141
141
  */
142
- async function shallowModeWarnings(opts) {
142
+ function shallowModeWarnings(opts) {
143
143
  if (!opts || opts.mode !== 'shallow') {
144
144
  return;
145
145
  }
@@ -161,7 +161,7 @@ async function shallowModeWarnings(opts) {
161
161
  * @returns Boolean true if all checks are passing.
162
162
  */
163
163
 
164
- async function validateLogOnResume(opts) {
164
+ function validateLogOnResume(opts) {
165
165
  const logFileExists = opts && opts.log && fs.existsSync(opts.log);
166
166
  if (!opts || opts.mode === 'shallow') {
167
167
  // No opts specified, defaults will be populated.
@@ -190,7 +190,7 @@ async function validateLogOnResume(opts) {
190
190
  return true;
191
191
  }
192
192
 
193
- async function attachmentWarnings(opts) {
193
+ function attachmentWarnings(opts) {
194
194
  if (opts && opts.attachments) {
195
195
  console.warn('WARNING: The "attachments" option is provided as-is and is not supported. ' +
196
196
  'This option is for Apache CouchDB only and is experimental. ' +
@@ -204,22 +204,18 @@ async function attachmentWarnings(opts) {
204
204
  * @param {string} url - URL of database.
205
205
  * @param {object} opts - Options.
206
206
  * @param {boolean} backup - true for backup, false for restore
207
- * @returns Boolean true if all checks are passing.
207
+ * @returns {Promise<boolean>} `true` if all checks are passing, otherwise rejected.
208
208
  */
209
209
  async function validateArgs(url, opts, isBackup = true) {
210
210
  const isIAM = opts && typeof opts.iamApiKey === 'string';
211
- const validations = [
212
- validateURL(url, isIAM),
213
- validateOptions(opts),
214
- attachmentWarnings(opts)
215
- ];
211
+ validateURL(url, isIAM);
212
+ validateOptions(opts);
213
+ attachmentWarnings(opts);
216
214
  if (isBackup) {
217
- validations.push(
218
- shallowModeWarnings(opts),
219
- validateLogOnResume(opts)
220
- );
215
+ shallowModeWarnings(opts);
216
+ validateLogOnResume(opts);
221
217
  }
222
- return Promise.all(validations);
218
+ return true;
223
219
  }
224
220
 
225
221
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudant/couchbackup",
3
- "version": "2.11.19-SNAPSHOT-439",
3
+ "version": "2.11.19-SNAPSHOT-441",
4
4
  "description": "CouchBackup - command-line backup utility for Cloudant/CouchDB",
5
5
  "homepage": "https://github.com/IBM/couchbackup",
6
6
  "repository": {
@@ -23,12 +23,12 @@
23
23
  "node": "^22 || ^24"
24
24
  },
25
25
  "dependencies": {
26
- "@ibm-cloud/cloudant": "0.12.22",
26
+ "@ibm-cloud/cloudant": "0.12.23",
27
27
  "commander": "15.0.0",
28
28
  "debug": "4.4.3"
29
29
  },
30
30
  "peerDependencies": {
31
- "ibm-cloud-sdk-core": "5.4.22",
31
+ "ibm-cloud-sdk-core": "5.5.0",
32
32
  "axios": "1.18.0"
33
33
  },
34
34
  "main": "app.js",