storage: rework listDir api to be a generator (like) function

This commit is contained in:
Girish Ramakrishnan
2025-02-12 18:46:54 +01:00
parent da0dcf65b3
commit 9888aa8c08
9 changed files with 143 additions and 180 deletions
+4 -4
View File
@@ -82,14 +82,14 @@ async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'copy is not implemented');
}
function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
async function listDir(apiConfig, dir, batchSize, marker) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof dir, 'string');
assert.strictEqual(typeof batchSize, 'number');
assert.strictEqual(typeof iteratorCallback, 'function');
assert.strictEqual(typeof callback, 'function');
assert(typeof marker !== 'undefined');
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented'));
// Result: array of { fullPath, size }
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented');
}
async function remove(apiConfig, filename) {