storage: apiConfig -> config
to keep this in sync with site.config
This commit is contained in:
+28
-28
@@ -39,9 +39,9 @@ exports = module.exports = {
|
||||
const assert = require('node:assert'),
|
||||
BoxError = require('../boxerror.js');
|
||||
|
||||
function removePrivateFields(apiConfig) {
|
||||
function removePrivateFields(config) {
|
||||
// in-place removal of tokens and api keys
|
||||
return apiConfig;
|
||||
return config;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
@@ -49,45 +49,45 @@ function injectPrivateFields(newConfig, currentConfig) {
|
||||
// in-place injection of tokens and api keys
|
||||
}
|
||||
|
||||
async function getAvailableSize(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function getAvailableSize(config) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
async function getStatus(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function getStatus(config) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
// Result: { state, message } . state is 'active' or 'inactive'
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'getStatus is not implemented');
|
||||
}
|
||||
|
||||
async function upload(apiConfig, backupFilePath) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function upload(config, backupFilePath) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
|
||||
// Result: { stream, finish() callback }
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'upload is not implemented');
|
||||
}
|
||||
|
||||
async function exists(apiConfig, backupFilePath) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function exists(config, backupFilePath) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
|
||||
// Result: boolean if exists or not
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'exists is not implemented');
|
||||
}
|
||||
|
||||
async function download(apiConfig, backupFilePath) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function download(config, backupFilePath) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
|
||||
// Result: download stream
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'download is not implemented');
|
||||
}
|
||||
|
||||
async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function copy(config, oldFilePath, newFilePath, progressCallback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof oldFilePath, 'string');
|
||||
assert.strictEqual(typeof newFilePath, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
@@ -95,8 +95,8 @@ async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'copy is not implemented');
|
||||
}
|
||||
|
||||
async function copyDir(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function copyDir(config, oldFilePath, newFilePath, progressCallback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof oldFilePath, 'string');
|
||||
assert.strictEqual(typeof newFilePath, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
@@ -104,8 +104,8 @@ async function copyDir(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'copy is not implemented');
|
||||
}
|
||||
|
||||
async function listDir(apiConfig, dir, batchSize, marker) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function listDir(config, dir, batchSize, marker) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof dir, 'string');
|
||||
assert.strictEqual(typeof batchSize, 'number');
|
||||
assert(typeof marker !== 'undefined');
|
||||
@@ -115,16 +115,16 @@ async function listDir(apiConfig, dir, batchSize, marker) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented');
|
||||
}
|
||||
|
||||
async function remove(apiConfig, filename) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function remove(config, filename) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof filename, 'string');
|
||||
|
||||
// Result: none
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented');
|
||||
}
|
||||
|
||||
async function removeDir(apiConfig, pathPrefix, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function removeDir(config, pathPrefix, progressCallback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof pathPrefix, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
@@ -132,8 +132,8 @@ async function removeDir(apiConfig, pathPrefix, progressCallback) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented');
|
||||
}
|
||||
|
||||
async function cleanup(apiConfig, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function cleanup(config, progressCallback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
// Result: none
|
||||
@@ -150,16 +150,16 @@ async function verifyConfig({ id, provider, config }) {
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'testConfig is not implemented');
|
||||
}
|
||||
|
||||
async function setup(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function setup(config) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
// Result: none - first callback argument error if config does not pass the test
|
||||
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'setup is not implemented');
|
||||
}
|
||||
|
||||
async function teardown(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function teardown(config) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
// Result: none - first callback argument error if config does not pass the test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user