@node-red/runtime 4.1.1 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,31 @@ var api = module.exports = {
22
22
  return runtime.plugins.getPlugin(opts.id);
23
23
  },
24
24
 
25
+ /**
26
+ * Gets the info of an individual plugin set
27
+ * @param {Object} opts
28
+ * @param {User} opts.user - the user calling the api
29
+ * @param {String} opts.id - the id of the plugin set to return
30
+ * @param {Object} opts.req - the request to log (optional)
31
+ * @return {Promise<PluginInfo>} - the plugin information
32
+ * @memberof @node-red/runtime_plugins
33
+ */
34
+ getPluginInfo: async function(opts) {
35
+ const id = opts.id;
36
+ const result = runtime.plugins.getPluginInfo(id);
37
+ if (result) {
38
+ runtime.log.audit({ event: "plugins.info.get", id: id }, opts.req);
39
+ delete result.loaded;
40
+ return result;
41
+ } else {
42
+ runtime.log.audit({ event: "plugins.info.get", id: id, error: "not_found" }, opts.req);
43
+ var err = new Error("Plugin not found");
44
+ err.code = "not_found";
45
+ err.status = 404;
46
+ throw err;
47
+ }
48
+ },
49
+
25
50
  /**
26
51
  * Gets all plugin definitions of a given type
27
52
  * @param {Object} opts
@@ -67,12 +92,12 @@ var api = module.exports = {
67
92
  },
68
93
 
69
94
  /**
70
- * Gets the editor content for one registered plugin
95
+ * Gets an individual plugin's html content
71
96
  * @param {Object} opts
72
97
  * @param {User} opts.user - the user calling the api
73
98
  * @param {User} opts.user - the user calling the api
74
99
  * @param {Object} opts.req - the request to log (optional)
75
- * @return {Promise<NodeInfo>} - the plugin information
100
+ * @return {Promise<string>} - the plugin html content
76
101
  * @memberof @node-red/runtime_plugins
77
102
  */
78
103
  getPluginConfig: async function(opts) {
@@ -81,7 +106,7 @@ var api = module.exports = {
81
106
  return;
82
107
  }
83
108
  runtime.log.audit({event: "plugins.configs.get"}, opts.req);
84
- return runtime.plugins.getPluginConfig(opts.module, opts.lang);
109
+ return runtime.plugins.getPluginConfig(opts.id, opts.lang);
85
110
  },
86
111
 
87
112
  /**
package/lib/plugins.js CHANGED
@@ -4,6 +4,7 @@ module.exports = {
4
4
  init: function() {},
5
5
  registerPlugin: registry.registerPlugin,
6
6
  getPlugin: registry.getPlugin,
7
+ getPluginInfo: registry.getPluginInfo,
7
8
  getPluginsByType: registry.getPluginsByType,
8
9
  getPluginList: registry.getPluginList,
9
10
  getPluginConfigs: registry.getPluginConfigs,
@@ -92,7 +92,7 @@ function init(_settings, _runtime) {
92
92
 
93
93
  if (projectsEnabled) {
94
94
  return sshTools.init(settings,runtime).then(function() {
95
- gitTools.init(_settings).then(function(gitConfig) {
95
+ return gitTools.init(_settings).then(function(gitConfig) {
96
96
  if (!gitConfig || /^1\./.test(gitConfig.version)) {
97
97
  if (!gitConfig) {
98
98
  projectLogMessages.push(log._("storage.localfilesystem.projects.git-not-found"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/runtime",
3
- "version": "4.1.1",
3
+ "version": "5.0.0-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -16,12 +16,12 @@
16
16
  }
17
17
  ],
18
18
  "dependencies": {
19
- "@node-red/registry": "4.1.1",
20
- "@node-red/util": "4.1.1",
19
+ "@node-red/registry": "5.0.0-beta.0",
20
+ "@node-red/util": "5.0.0-beta.0",
21
21
  "async-mutex": "0.5.0",
22
22
  "clone": "2.1.2",
23
23
  "cronosjs": "1.7.1",
24
- "express": "4.21.2",
24
+ "express": "4.22.1",
25
25
  "fs-extra": "11.3.0",
26
26
  "got": "12.6.1",
27
27
  "json-stringify-safe": "5.0.1",