@node-red/editor-api
Advanced tools
Comparing version 0.20.0-beta.3 to 0.20.0-beta.4
@@ -17,2 +17,7 @@ /** | ||
/** | ||
* @mixin @node-red/editor-api_auth | ||
*/ | ||
var passport = require("passport"); | ||
@@ -48,3 +53,10 @@ var oauth2orize = require("oauth2orize"); | ||
} | ||
/** | ||
* Returns an Express middleware function that ensures the user making a request | ||
* has the necessary permission. | ||
* | ||
* @param {String} permission - the permission required for the request, such as `flows.write` | ||
* @return {Function} - an Express middleware | ||
* @memberof @node-red/editor-api_auth | ||
*/ | ||
function needsPermission(permission) { | ||
@@ -51,0 +63,0 @@ return function(req,res,next) { |
@@ -17,2 +17,12 @@ /** | ||
/** | ||
* This module provides an Express application to serve the Node-RED editor. | ||
* | ||
* It implements the Node-RED HTTP Admin API the Editor uses to interact | ||
* with the Node-RED runtime. | ||
* | ||
* @namespace @node-red/editor-api | ||
*/ | ||
var express = require("express"); | ||
@@ -32,2 +42,11 @@ var bodyParser = require("body-parser"); | ||
/** | ||
* Initialise the module. | ||
* @param {Object} settings The runtime settings | ||
* @param {HTTPServer} server An instance of HTTP Server | ||
* @param {Storage} storage An instance of Node-RED Storage | ||
* @param {Runtime} runtimeAPI An instance of Node-RED Runtime | ||
* @memberof @node-red/editor-api | ||
*/ | ||
function init(settings,_server,storage,runtimeAPI) { | ||
@@ -85,2 +104,8 @@ server = _server; | ||
} | ||
/** | ||
* Start the module. | ||
* @return {Promise} resolves when the application is ready to handle requests | ||
* @memberof @node-red/editor-api | ||
*/ | ||
function start() { | ||
@@ -93,2 +118,8 @@ if (editor) { | ||
} | ||
/** | ||
* Stop the module. | ||
* @return {Promise} resolves when the application is stopped | ||
* @memberof @node-red/editor-api | ||
*/ | ||
function stop() { | ||
@@ -104,6 +135,16 @@ if (editor) { | ||
stop: stop, | ||
/** | ||
* @memberof @node-red/editor-api | ||
* @mixes @node-red/editor-api_auth | ||
*/ | ||
auth: { | ||
needsPermission: auth.needsPermission | ||
}, | ||
/** | ||
* The Express app used to serve the Node-RED Editor | ||
* @type ExpressApplication | ||
* @memberof @node-red/editor-api | ||
*/ | ||
get httpAdmin() { return adminApp; } | ||
}; |
{ | ||
"name": "@node-red/editor-api", | ||
"version": "0.20.0-beta.3", | ||
"version": "0.20.0-beta.4", | ||
"license": "Apache-2.0", | ||
@@ -19,4 +19,4 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@node-red/util": "0.20.0-beta.3", | ||
"@node-red/editor-client": "0.20.0-beta.3", | ||
"@node-red/util": "0.20.0-beta.4", | ||
"@node-red/editor-client": "0.20.0-beta.4", | ||
"bcryptjs": "2.4.3", | ||
@@ -36,4 +36,4 @@ "body-parser": "1.18.3", | ||
"when": "3.7.8", | ||
"ws": "6.1.2" | ||
"ws": "6.1.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107356
2631
+ Added@node-red/editor-client@0.20.0-beta.4(transitive)
+ Added@node-red/util@0.20.0-beta.4(transitive)
+ Addedjsonata@1.6.4(transitive)
+ Addedws@6.1.3(transitive)
- Removed@node-red/editor-client@0.20.0-beta.3(transitive)
- Removed@node-red/util@0.20.0-beta.3(transitive)
- Removedjsonata@1.6.3(transitive)
- Removedws@6.1.2(transitive)
Updated@node-red/util@0.20.0-beta.4
Updatedws@6.1.3