'use strict'; // ------------------------------------------- // This file just describes the interface // // New backends can start from here // ------------------------------------------- exports = module.exports = { upload: upload, download: download, downloadDir: downloadDir, copy: copy, remove: remove, backupDone: backupDone, testConfig: testConfig }; var assert = require('assert'); function upload(apiConfig, backupFilePath, sourceStream, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof backupFilePath, 'string'); assert.strictEqual(typeof sourceStream, 'object'); assert.strictEqual(typeof callback, 'function'); // Result: none callback(new Error('not implemented')); } function download(apiConfig, backupFilePath, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof backupFilePath, 'string'); assert.strictEqual(typeof callback, 'function'); // Result: download stream callback(new Error('not implemented')); } function downloadDir(apiConfig, backupFilePath, destDir, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof backupFilePath, 'string'); assert.strictEqual(typeof destDir, 'string'); assert.strictEqual(typeof callback, 'function'); callback(new Error('not implemented')); } function copy(apiConfig, oldFilePath, newFilePath, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof oldFilePath, 'string'); assert.strictEqual(typeof newFilePath, 'string'); assert.strictEqual(typeof callback, 'function'); // Result: none callback(new Error('not implemented')); } function remove(apiConfig, pathPrefix, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof pathPrefix, 'string'); assert.strictEqual(typeof callback, 'function'); // Result: none callback(new Error('not implemented')); } function testConfig(apiConfig, callback) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof callback, 'function'); // Result: none - first callback argument error if config does not pass the test callback(new Error('not implemented')); } function backupDone(backupId, appBackupIds, callback) { assert.strictEqual(typeof backupId, 'string'); assert(Array.isArray(appBackupIds)); assert.strictEqual(typeof callback, 'function'); callback(new Error('not implemented')); }