1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/test/resources/plugin/test-plugin/library-filestore.js

37 lines
996 B
JavaScript
Raw Normal View History

2020-12-17 15:35:01 +01:00
module.exports = function(RED) {
const PLUGIN_TYPE_ID = "node-red-library-filestore";
2020-12-17 15:35:01 +01:00
class FileStorePlugin {
constructor(config) {
this.type = PLUGIN_TYPE_ID;
2020-12-17 15:35:01 +01:00
this.id = config.id;
this.label = config.label;
this.config = config.config;
2020-12-17 15:35:01 +01:00
this.icon = config.icon;
2020-12-17 15:35:01 +01:00
console.log("FileStorePlugin",config)
}
async init() {
console.log("FileStorePlugin.init")
}
async getEntry(type,path) {
console.log("FileStorePlugin.getLibraryEntry",type,path)
return []
}
async saveEntry(type,path,meta,body) {
console.log("FileStorePlugin.saveLibraryEntry",type,path)
}
}
RED.plugins.registerPlugin(PLUGIN_TYPE_ID, {
2020-12-17 15:35:01 +01:00
type: "node-red-library-source",
class: FileStorePlugin,
defaults: {
"path": { value: "" },
// "secret": { type: "password" }
}
2020-12-17 15:35:01 +01:00
})
}