load diagram file #278

This commit is contained in:
Jan Prochazka
2022-05-19 14:59:42 +02:00
parent 2a3b4fe4d8
commit 32e4e36258
3 changed files with 55 additions and 5 deletions

View File

@@ -99,6 +99,12 @@ module.exports = {
}
},
loadFrom_meta: true,
async loadFrom({ filePath, format }, req) {
const text = await fs.readFile(filePath, { encoding: 'utf-8' });
return deserialize(format, text);
},
save_meta: true,
async save({ folder, file, data, format }, req) {
if (folder.startsWith('archive:')) {