added plugins

This commit is contained in:
Jan Prochazka
2021-04-13 16:17:53 +02:00
parent 446e7c139f
commit 4d5cc119f2
115 changed files with 5519 additions and 24 deletions

View File

@@ -0,0 +1,26 @@
const xlsx = require('xlsx');
const reader = require('./reader');
const writer = require('./writer');
let dbgateApi;
module.exports = {
packageName: 'dbgate-plugin-excel',
shellApi: {
reader,
writer,
},
commands: {
analyse: async ({ fileName }) => {
const downloadedFile = await dbgateApi.download(fileName);
const workbook = xlsx.readFile(downloadedFile, { bookSheets: true });
return workbook.SheetNames;
},
},
initialize(dbgateEnv) {
dbgateApi = dbgateEnv.dbgateApi;
writer.initialize(dbgateEnv);
reader.initialize(dbgateEnv);
},
};