2020-12-17 15:35:01 +01:00
|
|
|
|
|
|
|
module.exports = function(RED) {
|
2021-01-22 12:20:28 +01:00
|
|
|
const PLUGIN_TYPE_ID = "node-red-library-filestore";
|
2020-12-17 15:35:01 +01:00
|
|
|
|
|
|
|
class FileStorePlugin {
|
|
|
|
constructor(config) {
|
2021-01-22 12:20:28 +01:00
|
|
|
this.type = PLUGIN_TYPE_ID;
|
2020-12-17 15:35:01 +01:00
|
|
|
this.id = config.id;
|
2021-01-22 12:20:28 +01:00
|
|
|
this.label = config.label;
|
|
|
|
this.config = config.config;
|
2020-12-17 15:35:01 +01:00
|
|
|
this.icon = config.icon;
|
2021-01-22 12:20:28 +01:00
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-22 12:20:28 +01:00
|
|
|
RED.plugins.registerPlugin(PLUGIN_TYPE_ID, {
|
2020-12-17 15:35:01 +01:00
|
|
|
type: "node-red-library-source",
|
2021-01-22 12:20:28 +01:00
|
|
|
class: FileStorePlugin,
|
|
|
|
defaults: {
|
|
|
|
"path": { value: "" },
|
|
|
|
// "secret": { type: "password" }
|
|
|
|
}
|
2020-12-17 15:35:01 +01:00
|
|
|
})
|
|
|
|
}
|