mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
More api documentation updates
This commit is contained in:
parent
2e063f91bc
commit
e0bb03a53f
26
CHANGELOG.md
26
CHANGELOG.md
@ -2,7 +2,31 @@
|
|||||||
|
|
||||||
Runtime
|
Runtime
|
||||||
|
|
||||||
- Bump JSONata to 1.6.5
|
- Bump JSONata to 1.6.4
|
||||||
|
- Add Flow.getSetting for resolving env-var properties
|
||||||
|
- Refactor Subflow logic into own class
|
||||||
|
- Restore RED.auth to node-red module api
|
||||||
|
- Tidy up when usage in Flow and Node
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- German translation
|
||||||
|
- Change default dropdown appearance and sidebar tab menu handling
|
||||||
|
- Handle multiple-select box when nothing selected Fixes #2021
|
||||||
|
- Handle i18n properly when key is a valid sub-identifier Fixes #2028
|
||||||
|
- Avoid duplicate links when missing node type installed Fixes #2032
|
||||||
|
- Add View Tools
|
||||||
|
- Don't collapse version control header when clicking refresh
|
||||||
|
- Add fast entry via keyboard for string of nodes
|
||||||
|
- Check for undeployed change before showing open project dialog
|
||||||
|
- Add placeholder node when in quick-add mode
|
||||||
|
- Move nodes to top-left corner when converting to subflow
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- Debug: Allow debug edit expression to be sent to status
|
||||||
|
- WebSocket: Fix missing translated help
|
||||||
|
|
||||||
|
|
||||||
#### 0.20.0-beta.3: Beta Release
|
#### 0.20.0-beta.3: Beta Release
|
||||||
|
|
||||||
|
@ -443,6 +443,8 @@ module.exports = function(grunt) {
|
|||||||
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||||
'packages/node_modules/@node-red/runtime/lib/events.js',
|
'packages/node_modules/@node-red/runtime/lib/events.js',
|
||||||
'packages/node_modules/@node-red/util/**/*.js',
|
'packages/node_modules/@node-red/util/**/*.js',
|
||||||
|
'packages/node_modules/@node-red/editor-api/lib/index.js',
|
||||||
|
'packages/node_modules/@node-red/editor-api/lib/auth/index.js'
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
destination: 'docs',
|
destination: 'docs',
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
},
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
"systemName": "Node-RED Runtime API",
|
"systemName": "Node-RED Runtime API",
|
||||||
"theme":"yeti",
|
|
||||||
"footer": "",
|
"footer": "",
|
||||||
"copyright": "Released under the Apache License v2.0",
|
"copyright": "Released under the Apache License v2.0",
|
||||||
"default": {
|
"default": {
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin @node-red/editor-api_auth
|
||||||
|
*/
|
||||||
|
|
||||||
var passport = require("passport");
|
var passport = require("passport");
|
||||||
var oauth2orize = require("oauth2orize");
|
var oauth2orize = require("oauth2orize");
|
||||||
|
|
||||||
@ -44,7 +49,14 @@ function init(_settings,storage) {
|
|||||||
Tokens.init(mergedAdminAuth,storage);
|
Tokens.init(mergedAdminAuth,storage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 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) {
|
function needsPermission(permission) {
|
||||||
return function(req,res,next) {
|
return function(req,res,next) {
|
||||||
if (settings && settings.adminAuth) {
|
if (settings && settings.adminAuth) {
|
||||||
|
@ -14,6 +14,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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");
|
var express = require("express");
|
||||||
var bodyParser = require("body-parser");
|
var bodyParser = require("body-parser");
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
@ -28,6 +38,15 @@ var adminApp;
|
|||||||
var server;
|
var server;
|
||||||
var editor;
|
var editor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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) {
|
function init(settings,_server,storage,runtimeAPI) {
|
||||||
server = _server;
|
server = _server;
|
||||||
if (settings.httpAdminRoot !== false) {
|
if (settings.httpAdminRoot !== false) {
|
||||||
@ -80,6 +99,12 @@ function init(settings,_server,storage,runtimeAPI) {
|
|||||||
adminApp = null;
|
adminApp = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start the module.
|
||||||
|
* @return {Promise} resolves when the application is ready to handle requests
|
||||||
|
* @memberof @node-red/editor-api
|
||||||
|
*/
|
||||||
function start() {
|
function start() {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
return editor.start();
|
return editor.start();
|
||||||
@ -87,6 +112,12 @@ function start() {
|
|||||||
return when.resolve();
|
return when.resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop the module.
|
||||||
|
* @return {Promise} resolves when the application is stopped
|
||||||
|
* @memberof @node-red/editor-api
|
||||||
|
*/
|
||||||
function stop() {
|
function stop() {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
editor.stop();
|
editor.stop();
|
||||||
@ -97,8 +128,18 @@ module.exports = {
|
|||||||
init: init,
|
init: init,
|
||||||
start: start,
|
start: start,
|
||||||
stop: stop,
|
stop: stop,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @memberof @node-red/editor-api
|
||||||
|
* @mixes @node-red/editor-api_auth
|
||||||
|
*/
|
||||||
auth: {
|
auth: {
|
||||||
needsPermission: auth.needsPermission
|
needsPermission: auth.needsPermission
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* The Express app used to serve the Node-RED Editor
|
||||||
|
* @type ExpressApplication
|
||||||
|
* @memberof @node-red/editor-api
|
||||||
|
*/
|
||||||
get httpAdmin() { return adminApp; }
|
get httpAdmin() { return adminApp; }
|
||||||
};
|
};
|
||||||
|
@ -14,6 +14,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This module provides the node registry for the Node-RED runtime.
|
||||||
|
*
|
||||||
|
* It is responsible for loading node modules and making them available
|
||||||
|
* to the runtime.
|
||||||
|
*
|
||||||
|
* @namespace @node-red/registry
|
||||||
|
*/
|
||||||
|
|
||||||
var registry = require("./registry");
|
var registry = require("./registry");
|
||||||
var loader = require("./loader");
|
var loader = require("./loader");
|
||||||
var installer = require("./installer");
|
var installer = require("./installer");
|
||||||
|
17
packages/node_modules/node-red/lib/red.js
vendored
17
packages/node_modules/node-red/lib/red.js
vendored
@ -122,6 +122,13 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
util: redUtil.util,
|
util: redUtil.util,
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This provides access to the internal nodes module of the
|
||||||
|
* runtime.
|
||||||
|
*
|
||||||
|
* @memberof node-red
|
||||||
|
*/
|
||||||
get nodes() { return runtime._.nodes },
|
get nodes() { return runtime._.nodes },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,6 +138,12 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
events: runtime.events,
|
events: runtime.events,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This provides access to the internal settings module of the
|
||||||
|
* runtime.
|
||||||
|
*
|
||||||
|
* @memberof node-red
|
||||||
|
*/
|
||||||
get settings() { return runtime._.settings },
|
get settings() { return runtime._.settings },
|
||||||
|
|
||||||
|
|
||||||
@ -145,18 +158,21 @@ module.exports = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The express application for the Editor Admin API
|
* The express application for the Editor Admin API
|
||||||
|
* @type ExpressApplication
|
||||||
* @memberof node-red
|
* @memberof node-red
|
||||||
*/
|
*/
|
||||||
get httpAdmin() { return api.httpAdmin },
|
get httpAdmin() { return api.httpAdmin },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The express application for HTTP Nodes
|
* The express application for HTTP Nodes
|
||||||
|
* @type ExpressApplication
|
||||||
* @memberof node-red
|
* @memberof node-red
|
||||||
*/
|
*/
|
||||||
get httpNode() { return runtime.httpNode },
|
get httpNode() { return runtime.httpNode },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The HTTP Server used by the runtime
|
* The HTTP Server used by the runtime
|
||||||
|
* @type HTTPServer
|
||||||
* @memberof node-red
|
* @memberof node-red
|
||||||
*/
|
*/
|
||||||
get server() { return server },
|
get server() { return server },
|
||||||
@ -170,6 +186,7 @@ module.exports = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The editor authentication api.
|
* The editor authentication api.
|
||||||
|
* @see @node-red/editor-api_auth
|
||||||
* @memberof node-red
|
* @memberof node-red
|
||||||
*/
|
*/
|
||||||
auth: api.auth
|
auth: api.auth
|
||||||
|
Loading…
Reference in New Issue
Block a user