Refactor getAppBackupCredentials()
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
exports = module.exports = {
|
||||
getBackupDetails: getBackupDetails,
|
||||
getAppBackupDetails: getAppBackupDetails,
|
||||
|
||||
getAllPaged: getAllPaged,
|
||||
|
||||
getRestoreUrl: getRestoreUrl,
|
||||
@@ -25,6 +27,22 @@ function getBackupDetails(apiConfig, id, callback) {
|
||||
callback(null, details);
|
||||
}
|
||||
|
||||
function getAppBackupDetails(apiConfig, appId, dataId, configId, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof appId, 'string');
|
||||
assert.strictEqual(typeof dataId, 'string');
|
||||
assert.strictEqual(typeof configId, '');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var backupFolder = apiConfig.backupFolder || '/tmp/backups';
|
||||
|
||||
var details = {
|
||||
backupScriptArguments: [ 'filesystem', appId, backupFolder, configId, dataId, apiConfig.key ]
|
||||
};
|
||||
|
||||
callback(null, details);
|
||||
}
|
||||
|
||||
function getAllPaged(apiConfig, page, perPage, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof page, 'number');
|
||||
|
||||
Reference in New Issue
Block a user