add api.backupNow() to backend API, closes #4455

This commit is contained in:
zadam
2023-11-20 23:14:53 +01:00
parent f5018e9820
commit 88067c071c
18 changed files with 722 additions and 110 deletions

View File

@@ -19,7 +19,8 @@ const SpacedUpdate = require("./spaced_update");
const specialNotesService = require("./special_notes");
const branchService = require("./branches");
const exportService = require("./export/zip");
const syncMutex = require("./sync_mutex.js");
const syncMutex = require("./sync_mutex");
const backupService = require("./backup");
/**
* <p>This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
@@ -586,6 +587,13 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.runOutsideOfSync = syncMutex.doExclusively;
/**
* @method
* @param {string} backupName - If the backupName is e.g. "now", then the backup will be written to "backup-now.db" file
* @returns {Promise} - resolves once the backup is finished
*/
this.backupNow = backupService.backupNow;
/**
* This object contains "at your risk" and "no BC guarantees" objects for advanced use cases.
*