1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-21 23:17:42 +02:00

All: Add mechanism to lock and upgrade sync targets (#3524)

This commit is contained in:
Laurent
2020-08-02 12:28:50 +01:00
committed by GitHub
parent 88f22fabf7
commit 0c147236a3
138 changed files with 3686 additions and 647 deletions

View File

@ -78,6 +78,10 @@ class FileApiDriverOneDrive {
}
async list(path, options = null) {
options = Object.assign({}, {
context: null,
}, options);
let query = this.itemFilter_();
let url = `${this.makePath_(path)}:/children`;
@ -186,8 +190,23 @@ class FileApiDriverOneDrive {
return this.pathCache_[path];
}
clearRoot() {
throw new Error('Not implemented');
async clearRoot() {
const recurseItems = async (path) => {
const result = await this.list(this.fileApi_.fullPath_(path));
const output = [];
for (const item of result.items) {
const fullPath = `${path}/${item.path}`;
if (item.isDir) {
await recurseItems(fullPath);
}
await this.delete(this.fileApi_.fullPath_(fullPath));
}
return output;
};
await recurseItems('');
}
async delta(path, options = null) {