Add backup download route if backend supports it
This commit is contained in:
@@ -5,6 +5,7 @@ exports = module.exports = {
|
||||
getAppBackupDetails: getAppBackupDetails,
|
||||
|
||||
getRestoreUrl: getRestoreUrl,
|
||||
getLocalFilePath: getLocalFilePath,
|
||||
|
||||
copyObject: copyObject
|
||||
};
|
||||
@@ -56,6 +57,16 @@ function getRestoreUrl(apiConfig, filename, callback) {
|
||||
callback(null, { url: restoreUrl });
|
||||
}
|
||||
|
||||
function getLocalFilePath(apiConfig, filename, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof filename, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var backupFolder = apiConfig.backupFolder || FALLBACK_BACKUP_FOLDER;
|
||||
|
||||
callback(null, { filePath: path.join(backupFolder, filename) });
|
||||
}
|
||||
|
||||
function copyObject(apiConfig, from, to, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof from, 'string');
|
||||
|
||||
Reference in New Issue
Block a user