diff --git a/.gitignore b/.gitignore index 3a62a37c..0f29e2f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ +vendor +.bundle .DS_Store _site +.jekyll-cache +Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..17fac573 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +# gem "rails" + +gem "jekyll-paginate", "~> 1.1" + +gem "jekyll-redirect-from", "~> 0.16.0" + +gem "webrick", "~> 1.7" diff --git a/README.md b/README.md index be5241ed..7cebd1ec 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ node-red.github.io ### Contributing / Fixes For simple typos and single line fixes please just raise an issue pointing out -our mistakes. For larger changes, please raise them on the [mailing list](https://groups.google.com/forum/#!forum/node-red), or [Slack team](http://nodered.org/slack/) #docs channel, and if necessary provide content for review on the [wiki](https://github.com/node-red/node-red.github.io/wiki). +our mistakes. For larger changes, please discuss them on the [forum](https://discourse.nodered.org) or [Slack team](http://nodered.org/slack/) #docs channel. If you need to raise a pull request please read our [contribution guidelines](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md) @@ -19,9 +19,10 @@ Fork the repository so you can make changes, commit them to your own repository git clone https://github.com/{your-github}/node-red.github.io -Then run jekyll: - +First time you run jeykll you need to do bundle install 1st for the dependencies, + cd node-red.github.io - jekyll serve -w + bundle install + bundle exec jekyll serve -w -Once the site is built and running you can preview it at [`http://127.0.0.1:4000/`](http://127.0.0.1:4000/). \ No newline at end of file +Once the site is built and running you can preview it at [`http://127.0.0.1:4000/`](http://127.0.0.1:4000/). diff --git a/_config.yml b/_config.yml index 1e3d8668..21e8fb6c 100644 --- a/_config.yml +++ b/_config.yml @@ -11,4 +11,4 @@ future: true authors: nick: display_name: Nick O'Leary - url: https://twitter.com/knolleary + url: https://github.com/knolleary diff --git a/_data/contributors.yml b/_data/contributors.yml new file mode 100644 index 00000000..a0c3d42e --- /dev/null +++ b/_data/contributors.yml @@ -0,0 +1,48 @@ +# Use https://caius.github.io/github_id/ to determine the githubId +- name: Project Leads + header: The creators of Node-RED, who continue to lead the project today. + people: + - name: Nick O'Leary + githubId: '51083' + links: + home: https://flowfuse.com + github: https://github.com/knolleary + - name: Dave Conway-Jones + githubId: '5375409' + links: + github: https://github.com/dceejay + +- name: Core Contributors + header: People who are regularly contributing to the core project or who have + made notable contributions in the project's history. + footer: Explore the full list here + + people: + - name: Ben Hardill + githubId: '1800845' + links: + home: https://flowfuse.com + github: https://github.com/hardillb + - name: Steve McLaughlin + githubId: '44235289' + links: + home: https://flowfuse.com + github: https://github.com/Steve-Mcl + - name: Gauthier Dandele + githubId: '92022724' + links: + github: https://github.com/GogoVega + - name: Kazuhito Yokoi + githubId: '20310935' + links: + home: https://www.hitachi-ac.co.jp/en/ + github: https://github.com/kazuhitoyokoi + - name: Hiroyasu Nishiyama + githubId: '30289092' + links: + home: https://www.hitachi.com + github: https://github.com/HiroyasuNishiyama + - name: Mauricio Bonani + githubId: '29807944' + links: + github: https://github.com/bonanitech diff --git a/_data/users.yml b/_data/users.yml new file mode 100644 index 00000000..08538f8d --- /dev/null +++ b/_data/users.yml @@ -0,0 +1,97 @@ +# Logo should be added under '/users/' +- name: All + users: + - url: https://www.echounify.com/ + logo: echo-unify-systems.png + - url: https://www.overview.ai/ + logo: overviewai.jpg + - url: https://www.ubos.tech/ + logo: ubos.jpg + - url: https://www.bitpool.com/ + logo: bitpool.png + - url: https://p4nr.com/ + logo: p4nr.png + - url: https://yoctoconnect.com/ + logo: connect.png + - url: https://www.umh.app/ + logo: united-manufacturing-hub.png + - url: https://www.simocowirelesssolutions.com/products/velocity/ + logo: simoco.jpg + - url: https://www.cosmonautasoftware.com/en-us/cosmo-psim-software-platform + logo: cosmo.png + - url: https://www.42flows.tech + logo: 42flows.jpeg + - url: https://www.broadsens.com/wireless-gateway/ + logo: broadsens.png + - url: http://chatbots.studio/ + logo: chatbots-studio.png + - url: https://www.plathome.co.jp/product/fw4/ + logo: plathome.png + - url: https://www.a4bee.com/ + logo: a4bee.png + - url: https://litmus.io/ + logo: litmus.png + - url: https://kontron-ais.com/en/ + logo: kontron.png + - url: https://tulip.co/ + logo: tulip.png + - url: https://iniationware.com/ + logo: iniationware.jpg + - url: https://www.cgignite.com + logo: cgignite.png + - url: https://www.prescientdevices.com/ + logo: pdi-logo.png + - url: https://handy.ai/ + logo: handyai.svg + - url: https://simplehw.eu/ + logo: simplehw.png + - url: https://openiap.io/ + logo: openiap.png + - url: https://smartlight.co.jp/node-red-lighting-iot/ + logo: smartlight.png + - url: https://www.hitachi.co.jp/products/it/oss/ + logo: hitachi.png + - url: https://www.dialog-semiconductor.com/ + logo: dialog.png + - url: https://zenzium.com + logo: zenzium.jpg + - url: https://www.vigilent.com + logo: vigilent.png + - url: https://entelligently.com + logo: entelligently.png + - url: https://st-one.io/ + logo: st-one.png + - url: https://www.aiomeet.com/ + logo: aiomeet.png + - url: https://www.thingtrack.com/ + logo: thingtrack.png + - url: https://www.enebular.com/ + logo: enebular.svg + - url: https://www.victronenergy.com/live/venus-os:large + logo: victron.png + - url: https://www.yellaumbrella.tv/ + logo: yellaUmbrella.svg + - url: https://www.veritone.com/ + logo: veritone.png + - url: https://www.flowake.com/ + logo: flowake.png + - url: https://sensetecnic.com/ + logo: sensetecnic.png + - url: https://agilite.io/ + logo: agilit-e.png + - url: http://dingo-iot.io/ + logo: go-iot.png + - url: https://www.spiritai.com/ + logo: spiritai.png + - url: https://www.multitech.com/ + logo: multitech.png + - url: https://www.opto22.com/ + logo: opto22.png + - url: https://www.iaconnects.co.uk/ + logo: iaconnects.png + - url: https://www.flowfuse.com/ + logo: flowfuse.svg + - url: https://www.qbee.io/ + logo: qbee.png.webp + - url: https://www.charge-unix.fr/ + logo: charge_unix.png \ No newline at end of file diff --git a/_includes/docs-content.html b/_includes/docs-content.html index 32fcc564..bf8ab7b6 100644 --- a/_includes/docs-content.html +++ b/_includes/docs-content.html @@ -1,7 +1,7 @@ {% include header.html %}
{% include breadcrumbs.html %} -
+
{% if page.toc %}
{% include {{ page.toc }} %} diff --git a/_includes/footer.html b/_includes/footer.html index e6c0adc1..1a97b717 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,10 +1,9 @@ + \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_editor-api_auth.html b/docs/api/modules/v/1.3/@node-red_editor-api_auth.html new file mode 100644 index 00000000..a4c1bd52 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_editor-api_auth.html @@ -0,0 +1,285 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/editor-api.auth +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + +
needsPermission ( permission )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

needsPermission(permission) → {function}

+ + + + + +
+

Returns an Express middleware function that ensures the user making a request +has the necessary permission.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
permission + + +String + + + + +

the permission required for the request, such as flows.write

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +function + + +
+
+ + +
+
    +
  • an Express middleware
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_registry.html b/docs/api/modules/v/1.3/@node-red_registry.html new file mode 100644 index 00000000..c3cdc721 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_registry.html @@ -0,0 +1,3604 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/registry +

+ +
+ +
+
+ + +

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.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

addModule(module) → {Promise.<Object>}

+ + + + + +
+

Loads a new module into the registry.

+

This will rescan the node module paths looking for this module.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the name of the module to add

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

if the module has already been added or the runtime settings are unavailable

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+

A promise that resolves with the module information once it has been added

+
+ + +
+ + + +
+ + + +
+ + + +

cleanModuleList()

+ + + + + +
+

Update to internal list of available modules based on what has been actually +loaded.

+

The externalModules.autoInstall (previously autoInstallModules) +runtime option means the runtime may try to install +missing modules after the initial load is complete. If that flag is not set +this function is used to remove the modules from the registry's saved list.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

disableNode(type) → {Promise}

+ + + + + +
+

Disables a node set, making it unavailable for use.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the node type or set identifier

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

if the identifier is not recognised or runtime settings are unavailable

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+

A promise that resolves when the node set has been disabled

+
+ + +
+ + + +
+ + + +
+ + + +

enableNode(type) → {Promise}

+ + + + + +
+

Enables a node set, making it available for use.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the node type or set identifier

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

if the identifier is not recognised or runtime settings are unavailable

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+

A promise that resolves when the node set has been enabled

+
+ + +
+ + + +
+ + + +
+ + + +

get(type) → {function}

+ + + + + +
+

Get a node constructor function.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the node type

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +function + + +
+
+ + +
+

the node constructor function

+
+ + +
+ + + +
+ + + +
+ + + +

getModuleInfo(type) → {Object}

+ + + + + +
+

Get a modules's information.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the module identifier

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the module information

+
+ + +
+ + + +
+ + + +
+ + + +

getModuleList() → {Object}

+ + + + + +
+

Get a list of all moduless in the registry.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the module list

+
+ + +
+ + + +
+ + + +
+ + + +

getModuleResource(module, path) → {String}

+ + + + + +
+

Gets the full path to a module's resource file

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the name of the module providing the resource file

+ +
path + + +String + + + + +

the relative path of the resource file

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the full path to the resource file

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeConfig(id, lang) → {String}

+ + + + + +
+

Get the HTML config for a single node set.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + +

the node identifier

+ +
lang + + +String + + + + +

the language to return, default en-US

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the node config

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeConfigs(lang) → {String}

+ + + + + +
+

Get the HTML configs for all nodes in the registry.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lang + + +String + + + + +

the language to return, default en-US

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the node configs

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeExampleFlowPath(module, path) → {String}

+ + + + + +
+

Gets the full path to a node example

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the name of the module providing the example

+ +
path + + +String + + + + +

the relative path of the example

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the full path to the example

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeExampleFlows() → {Object}

+ + + + + +
+

Get a list of all example flows provided by nodes in the registry.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

an object, indexed by module, listing all example flows

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeIconPath(module, icon) → {String}

+ + + + + +
+

Get the local path to a node's icon file.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the module that provides the icon

+ +
icon + + +String + + + + +

the name of the icon

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the local path to the icon

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeIcons() → {String}

+ + + + + +
+

Get the full list of all icons available.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the icon list

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeInfo(type) → {Object}

+ + + + + +
+

Get a node's set information.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the node type or set identifier

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the node set information

+
+ + +
+ + + +
+ + + +
+ + + +

getNodeList() → {Object}

+ + + + + +
+

Get a list of all nodes in the registry.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the node list

+
+ + +
+ + + +
+ + + +
+ + + +

init(runtime)

+ + + + + +
+

Initialise the registry with a reference to a runtime object

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
runtime + + +Object + + + + +

a runtime object

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

installerEnabled() → {Boolean}

+ + + + + +
+

Check if the regisrty is able to install/remove modules.

+

This is based on whether it has found npm on the command-line.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Boolean + + +
+
+ + +
+

whether the installer is enabled

+
+ + +
+ + + +
+ + + +
+ + + +

installModule(module, version, url) → {Promise.<Array>}

+ + + + + +
+

Installs a new node module using npm and then add to the registry

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String +| + +Buffer + + + + +

the name of the module to install, or a Buffer containing a module tar file

+ +
version + + +String + + + + +

the version of the module to install, default: latest

+ +
url + + +String + + + + +

(optional) a url to install the module from

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Array> + + +
+
+ + +
+

A promise that resolves with the module information once it has been installed

+
+ + +
+ + + +
+ + + +
+ + + +

load() → {Promise}

+ + + + + +
+

Triggers the intial discovery and loading of all Node-RED node modules. +found on the node path.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when the registry has finised discovering node modules.
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

registerType(nodeSet, type, constructor)

+ + + + + +
+

Register a node constructor function.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nodeSet + + +Object + + + + +

the Node Set object the constructor is for

+ +
type + + +String + + + + +

the node type

+ +
constructor + + +function + + + + +

the node constructor function

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

removeModule(module) → {Promise.<Array>}

+ + + + + +
+

Removes a module from the registry.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the name of the module to remove

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

if the module is not found or the runtime settings are unavailable

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Array> + + +
+
+ + +
+

A promise that resolves with the list of removed node sets

+
+ + +
+ + + +
+ + + +
+ + + +

uninstallModule(module) → {Promise.<Array>}

+ + + + + +
+

Uninstalls a module using npm

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
module + + +String + + + + +

the name of the module to uninstall

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Array> + + +
+
+ + +
+

A promise that resolves when the module has been removed

+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime.html b/docs/api/modules/v/1.3/@node-red_runtime.html new file mode 100644 index 00000000..e9cb2713 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime.html @@ -0,0 +1,1682 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime +

+ +
+ +
+
+ + +

This module provides the core runtime component of Node-RED. +It does not include the Node-RED editor. All interaction with +this module is done using the api provided.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +
+ +

Members

+ + + + + + + + + + + + + + + + + + + + +
comms : { ... }
context : { ... }
flows : { ... }
library : { ... }
nodes : { ... }
plugins : { ... }
projects : { ... }
settings : { ... }
+ +
+
+
+ + + + +
+ +

comms

+ + + + + + +

This is the comms subsystem of the runtime.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

context

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

flows

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

library

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +

plugins

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ +

settings

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + +

init(settings, server, adminApi)

+ + + + + +
+

Initialise the runtime module.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
settings + + +Object + + + + +

the runtime settings object

+ +
server + + +HTTPServer + + + + +

the http server instance for the server to use

+ +
adminApi + + +AdminAPI + + + + +

an instance of @node-red/editor-api. TODO: This needs to be +better abstracted.

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

isStarted(opts) → {Promise.<Boolean>}

+ + + + + +
+

Returns whether the runtime is started

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Boolean> + + +
+
+ + +
+
    +
  • whether the runtime is started
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

start() → {Promise}

+ + + + + +
+

Start the runtime.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when the runtime is started. This does not mean the +flows will be running as they are started asynchronously.
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

stop() → {Promise}

+ + + + + +
+

Stops the runtime.

+

Once called, Node-RED should not be restarted until the Node.JS process is +restarted.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when the runtime is stopped.
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

version(opts) → {Promise.<String>}

+ + + + + +
+

Returns version number of the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the runtime version number
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_comms.html b/docs/api/modules/v/1.3/@node-red_runtime_comms.html new file mode 100644 index 00000000..66e72f35 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_comms.html @@ -0,0 +1,1128 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.comms +

+ +
+ +
+
+ + +

This is the comms subsystem of the runtime.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +
+ +
+
+
+ + + + + + +
+ + + +

addConnection(opts) → {Promise.<Object>}

+ + + + + +
+

Registers a new comms connection

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
client + + +CommsConnection + + + + +

the client connection

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

removeConnection(opts) → {Promise.<Object>}

+ + + + + +
+

Unregisters a comms connection

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
client + + +CommsConnection + + + + +

the client connection

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

subscribe(opts) → {Promise.<Object>}

+ + + + + +
+

Subscribes a comms connection to a given topic. Currently, all clients get +automatically subscribed to everything and cannot unsubscribe. Sending a subscribe +request will trigger retained messages to be sent.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
client + + +CommsConnection + + + + +

the client connection

+ +
topic + + +String + + + + +

the topic to subscribe to

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

unsubscribe(opts) → {Promise.<Object>}

+ + + + + +
+

TODO: Unsubscribes a comms connection from a given topic

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
client + + +CommsConnection + + + + +

the client connection

+ +
topic + + +String + + + + +

the topic to unsubscribe from

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_context.html b/docs/api/modules/v/1.3/@node-red_runtime_context.html new file mode 100644 index 00000000..1a702af1 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_context.html @@ -0,0 +1,806 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.context +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + +
delete ( opts )
getValue ( opts )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

delete(opts) → {Promise}

+ + + + + +
+

Gets the info of an individual node set

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
scope + + +String + + + + +

the scope of the context

+ +
id + + +String + + + + +

the id of the context

+ +
store + + +String + + + + +

the context store

+ +
key + + +String + + + + +

the context key

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • the node information
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getValue(opts) → {Promise}

+ + + + + +
+

Gets the info of an individual node set

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
scope + + +String + + + + +

the scope of the context

+ +
id + + +String + + + + +

the id of the context

+ +
store + + +String + + + + +

the context store

+ +
key + + +String + + + + +

the context key

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • the node information
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_flows.html b/docs/api/modules/v/1.3/@node-red_runtime_flows.html new file mode 100644 index 00000000..11a7bf1d --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_flows.html @@ -0,0 +1,2017 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.flows +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

addFlow(opts) → {Promise.<String>}

+ + + + + +
+

Adds a flow configuration

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
flow + + +Object + + + + +

the flow to add

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the id of the added flow
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

deleteFlow(opts) → {Promise}

+ + + + + +
+

Deletes a flow

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +Object + + + + +

the id of the flow to delete

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves if successful
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getFlow(opts) → {Promise.<Flow>}

+ + + + + +
+

Gets an individual flow configuration

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +Object + + + + +

the id of the flow to retrieve

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Flow> + + +
+
+ + +
+
    +
  • the active flow configuration
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getFlows(opts) → {Promise.<Flows>}

+ + + + + +
+

Gets the current flow configuration

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Flows> + + +
+
+ + +
+
    +
  • the active flow configuration
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getNodeCredentials(opts) → {Promise.<Object>}

+ + + + + +
+

Gets the safe credentials for a node

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
type + + +String + + + + +

the node type to return the credential information for

+ +
id + + +String + + + + +

the node id

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the safe credentials
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

setFlows(opts) → {Promise.<Flows>}

+ + + + + +
+

Sets the current flow configuration

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
flows + + +Object + + + + +

the flow configuration: {flows: [..], credentials: {}}

+ +
deploymentType + + +Object + + + + +

the type of deployment - "full", "nodes", "flows", "reload"

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Flows> + + +
+
+ + +
+
    +
  • the active flow configuration
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

updateFlow(opts) → {Promise.<String>}

+ + + + + +
+

Updates an existing flow configuration

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +Object + + + + +

the id of the flow to update

+ +
flow + + +Object + + + + +

the flow configuration

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the id of the updated flow
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_hooks.html b/docs/api/modules/v/1.3/@node-red_runtime_hooks.html new file mode 100644 index 00000000..9d77f896 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_hooks.html @@ -0,0 +1,429 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.hooks +

+ +
+ +
+
+ + +

Runtime hooks engine

+

The following hooks can be used:

+

Message sending

+
    +
  • onSend - passed an array of SendEvent objects. The messages inside these objects are exactly what the node has passed to node.send - meaning there could be duplicate references to the same message object.
  • +
  • preRoute - passed a SendEvent
  • +
  • preDeliver - passed a SendEvent. The local router has identified the node it is going to send to. At this point, the message has been cloned if needed.
  • +
  • postDeliver - passed a SendEvent. The message has been dispatched to be delivered asynchronously (unless the sync delivery flag is set, in which case it would be continue as synchronous delivery)
  • +
  • onReceive - passed a ReceiveEvent when a node is about to receive a message
  • +
  • postReceive - passed a ReceiveEvent when the message has been given to the node's input handler(s)
  • +
  • onComplete - passed a CompleteEvent when the node has completed with a message or logged an error
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + +
add ( hookId, callback )
remove ( hookId )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

add(hookId, callback)

+ + + + + +
+

Register a handler to a named hook

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hookId + + +String + + + + +

the name of the hook to attach to

+ +
callback + + +function + + + + +

the callback function for the hook

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

remove(hookId)

+ + + + + +
+

Remove a handled from a named hook

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hookId + + +String + + + + +

the name of the hook event to remove - must be name.label

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_library.html b/docs/api/modules/v/1.3/@node-red_runtime_library.html new file mode 100644 index 00000000..6052e92b --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_library.html @@ -0,0 +1,806 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.library +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + +
getEntry ( opts )
saveEntry ( opts )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

getEntry(opts) → {Promise.<(String|Object)>}

+ + + + + +
+

Gets an entry from the library.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
library + + +String + + + + +

the library

+ +
type + + +String + + + + +

the type of entry

+ +
path + + +String + + + + +

the path of the entry

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<(String|Object)> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

saveEntry(opts) → {Promise}

+ + + + + +
+

Saves an entry to the library

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
library + + +String + + + + +

the library

+ +
type + + +String + + + + +

the type of entry

+ +
path + + +String + + + + +

the path of the entry

+ +
meta + + +Object + + + + +

any meta data associated with the entry

+ +
body + + +String + + + + +

the body of the entry

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_nodes.html b/docs/api/modules/v/1.3/@node-red_runtime_nodes.html new file mode 100644 index 00000000..1ef309c4 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_nodes.html @@ -0,0 +1,3988 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.nodes +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

addModule(opts) → {Promise.<ModuleInfo>}

+ + + + + +
+

Install a new module into the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module to install

+ +
version + + +String + + + + +

(optional) the version of the module to install

+ +
tarball + + +Object + + + + +

(optional) a tarball file to install. Object has properties name, size and buffer.

+ +
url + + +String + + + + +

(optional) url to install

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<ModuleInfo> + + +
+
+ + +
+
    +
  • the node module info
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getIcon(opts) → {Promise.<Buffer>}

+ + + + + +
+

Gets a node icon

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module requesting the icon

+ +
icon + + +String + + + + +

the name of the icon

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Buffer> + + +
+
+ + +
+
    +
  • the icon file as a Buffer or null if no icon available
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getIconList(opts) → {Promise.<IconList>}

+ + + + + +
+

Gets the list of all icons available in the modules installed within the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<IconList> + + +
+
+ + +
+
    +
  • the list of all icons
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getModuleCatalog(opts) → {Promise.<Object>}

+ + + + + +
+

Gets a modules message catalog

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +User + + + + +

the module

+ +
lang + + +User + + + + +

the i18n language to return. If not set, uses runtime default (en-US)

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the message catalog
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getModuleCatalogs(opts) → {Promise.<Object>}

+ + + + + +
+

Gets all registered module message catalogs

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
lang + + +User + + + + +

the i18n language to return. If not set, uses runtime default (en-US)

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the message catalogs
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getModuleInfo(opts) → {Promise.<ModuleInfo>}

+ + + + + +
+

Gets the info of a node module

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<ModuleInfo> + + +
+
+ + +
+
    +
  • the node module info
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getModuleResource(opts) → {Promise.<Buffer>}

+ + + + + +
+

Gets a resource from a module

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module requesting the resource

+ +
path + + +String + + + + +

the path of the resource

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Buffer> + + +
+
+ + +
+
    +
  • the resource file as a Buffer or null if not found
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getNodeConfig(opts) → {Promise.<String>}

+ + + + + +
+

Gets an individual node's html content

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the node set to return

+ +
lang + + +String + + + + +

the locale language to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the node html content
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getNodeConfigs(opts) → {Promise.<String>}

+ + + + + +
+

Gets all node html content

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
lang + + +String + + + + +

the locale language to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the node html content
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getNodeInfo(opts) → {Promise.<NodeInfo>}

+ + + + + +
+

Gets the info of an individual node set

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the node set to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<NodeInfo> + + +
+
+ + +
+
    +
  • the node information
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getNodeList(opts) → {Promise.<NodeList>}

+ + + + + +
+

Gets the list of node modules installed in the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<NodeList> + + +
+
+ + +
+
    +
  • the list of node modules
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

removeModule(opts) → {Promise}

+ + + + + +
+

Removes a module from the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module to remove

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

setModuleState(opts) → {Promise.<ModuleInfo>}

+ + + + + +
+

Enables or disables a module in the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
module + + +String + + + + +

the id of the module to enable or disable

+ +
enabled + + +String + + + + +

whether the module should be enabled or disabled

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<ModuleInfo> + + +
+
+ + +
+
    +
  • the module info object
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

setNodeSetState(opts) → {Promise.<ModuleInfo>}

+ + + + + +
+

Enables or disables a n individual node-set in the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the node-set to enable or disable

+ +
enabled + + +String + + + + +

whether the module should be enabled or disabled

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<ModuleInfo> + + +
+
+ + +
+
    +
  • the module info object
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_plugins.html b/docs/api/modules/v/1.3/@node-red_runtime_plugins.html new file mode 100644 index 00000000..04a9272f --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_plugins.html @@ -0,0 +1,1388 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.plugins +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

getPlugin(opts) → {Promise.<PluginDefinition>}

+ + + + + +
+

Gets a plugin definition from the registry

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +String + + + + +

the id of the plugin to get

+ +
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<PluginDefinition> + + +
+
+ + +
+
    +
  • the plugin definition
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getPluginCatalogs(opts) → {Promise.<Object>}

+ + + + + +
+

Gets all registered module message catalogs

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
lang + + +User + + + + +

the i18n language to return. If not set, uses runtime default (en-US)

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the message catalogs
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getPluginConfigs(opts) → {Promise.<NodeInfo>}

+ + + + + +
+

Gets the editor content for all registered plugins

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<NodeInfo> + + +
+
+ + +
+
    +
  • the node information
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getPluginList() → {Promise.<NodeInfo>}

+ + + + + +
+

Gets the editor content for an individual plugin

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts.lang + + +String + + + + +

the locale language to return

+ +
opts.user + + +User + + + + +

the user calling the api

+ +
opts.req + + +Object + + + + +

the request to log (optional)

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<NodeInfo> + + +
+
+ + +
+
    +
  • the node information
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getPluginsByType(opts) → {Promise.<Array>}

+ + + + + +
+

Gets all plugin definitions of a given type

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + +

the type of the plugins to get

+ +
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Array> + + +
+
+ + +
+
    +
  • the plugin definitions
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_projects.html b/docs/api/modules/v/1.3/@node-red_runtime_projects.html new file mode 100644 index 00000000..e28e53a2 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_projects.html @@ -0,0 +1,8855 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.projects +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

abortMerge(opts) → {Promise.<Object>}

+ + + + + +
+

Abort an in-progress merge

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

addRemote(opts) → {Promise.<Object>}

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +Object + + + + +

the remote metadata

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + +

the name of the remote

+ +
url + + +String + + + + +

the url of the remote

+ +
+ + +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

commit(opts) → {Promise.<Object>}

+ + + + + +
+

Commits the current staged files

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
message + + +String + + + + +

the message to associate with the commit

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

createProject(opts) → {Promise.<Object>}

+ + + + + +
+

Create a new project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
project + + +Object + + + + +

the project information

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

deleteBranch(opts) → {Promise.<Object>}

+ + + + + +
+

Deletes a branch

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
branch + + +String + + + + +

the name of the branch

+ +
force + + +Boolean + + + + +

whether to force delete

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

deleteProject(opts) → {Promise.<Object>}

+ + + + + +
+

Deletes a project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project to update

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getActiveProject(opts) → {Promise.<Object>}

+ + + + + +
+

Gets the active project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the active project
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getBranches(opts) → {Promise.<Object>}

+ + + + + +
+

Get a list of local branches

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +Boolean + + + + +

whether to return remote branches (true) or local (false)

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • a list of the local branches
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getBranchStatus(opts) → {Promise.<Object>}

+ + + + + +
+

Gets the status of a branch

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
branch + + +String + + + + +

the name of the branch

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the status of the branch
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getCommit(opts) → {Promise.<Object>}

+ + + + + +
+

Gets the details of a single commit

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
sha + + +String + + + + +

the sha of the commit to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the commit details
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getCommits(opts) → {Promise.<Array>}

+ + + + + +
+

Gets the commit history of the project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
limit + + +String + + + + +

limit how many to return

+ +
before + + +String + + + + +

id of the commit to work back from

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Array> + + +
+
+ + +
+
    +
  • an array of commits
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getFile(opts) → {Promise.<String>}

+ + + + + +
+

Gets the contents of a file

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String + + + + +

the path of the file

+ +
tree + + +String + + + + +

the version control tree to use

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the content of the file
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getFileDiff(opts) → {Promise.<Object>}

+ + + + + +
+

Get the diff of a file

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String + + + + +

the path of the file

+ +
type + + +String + + + + +

the type of diff

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the requested diff
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getFiles(opts) → {Promise.<Object>}

+ + + + + +
+

Gets a listing of the files in the project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the file listing
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getProject(opts) → {Promise.<Object>}

+ + + + + +
+

Gets a projects metadata

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project to get

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the project metadata
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getRemotes(opts) → {Promise.<Object>}

+ + + + + +
+

Gets a list of the project remotes

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • a list of project remotes
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getStatus(opts) → {Promise.<Object>}

+ + + + + +
+

Gets current git status of a project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +Boolean + + + + +

whether to include status of remote repos

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the project status
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

initialiseProject(opts) → {Promise.<Object>}

+ + + + + +
+

Initialises an empty project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project to initialise

+ +
project + + +Object + + + + +

the project information

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

listProjects(opts) → {Promise.<Object>}

+ + + + + +
+

List projects known to the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

pull(opts) → {Promise.<Object>}

+ + + + + +
+

Pull changes from the remote

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
remote + + +String + + + + +

the remote to pull

+ +
track + + +Boolean + + + + +

whether to track this remote

+ +
allowUnrelatedHistories + + +Boolean + + + + +
    +
  • +
+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

push(opts) → {Promise.<Object>}

+ + + + + +
+

Push changes to a remote

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +String + + + + +

the name of the remote

+ +
track + + +String + + + + +

whether to set the remote as the upstream

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

removeRemote(opts) → {Promise.<Object>}

+ + + + + +
+

Remove a project remote

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +String + + + + +

the name of the remote

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

resolveMerge(opts) → {Promise.<Object>}

+ + + + + +
+

Resolves a merge conflict

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String + + + + +

the path of the file being merged

+ +
resolutions + + +String + + + + +

how to resolve the merge conflict

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

revertFile(opts) → {Promise.<Object>}

+ + + + + +
+

Reverts changes to a file back to its commited version

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String + + + + +

the path of the file

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

setActiveProject(opts) → {Promise.<Object>}

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project to activate

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

setBranch(opts) → {Promise.<Object>}

+ + + + + +
+

Sets the current local branch

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
branch + + +String + + + + +

the name of the branch

+ +
create + + +Boolean + + + + +

whether to create the branch if it doesn't exist

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

stageFile(opts) → {Promise.<Object>}

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String +| + +Array + + + + +

the path of the file, or an array of paths

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

unstageFile(opts) → {Promise.<Object>}

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
path + + +String + + + + +

the path of the file. If not set, all staged files are unstaged

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

updateProject(opts) → {Promise.<Object>}

+ + + + + +
+

Updates the metadata of an existing project

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project to update

+ +
project + + +Object + + + + +

the project information

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

updateRemote(opts) → {Promise.<Object>}

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +String + + + + +

the id of the project

+ +
remote + + +Object + + + + +

the remote metadata

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + +

the name of the remote

+ +
+ + +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_runtime_settings.html b/docs/api/modules/v/1.3/@node-red_runtime_settings.html new file mode 100644 index 00000000..50303e6a --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_runtime_settings.html @@ -0,0 +1,1965 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/runtime.settings +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

generateUserKey(opts) → {Promise.<String>}

+ + + + + +
+

Generates a new ssh key pair

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
name + + +User + + + + +

the id of the key to return

+ +
password + + +User + + + + +

(optional) the password for the key pair

+ +
comment + + +User + + + + +

(option) a comment to associate with the key pair

+ +
size + + +User + + + + +

(optional) the size of the key. Default: 2048

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the id of the generated key
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getRuntimeSettings(opts) → {Promise.<Object>}

+ + + + + +
+

Gets the runtime settings object

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the runtime settings
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getUserKey(opts) → {Promise.<String>}

+ + + + + +
+

Gets a user's ssh public key

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +User + + + + +

the id of the key to return

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<String> + + +
+
+ + +
+
    +
  • the user's ssh public key
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getUserKeys(opts) → {Promise.<Object>}

+ + + + + +
+

Gets a list of a user's ssh keys

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the user's ssh keys
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

getUserSettings(opts) → {Promise.<Object>}

+ + + + + +
+

Gets an individual user's settings object

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the user settings
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

removeUserKey(opts) → {Promise}

+ + + + + +
+

Deletes a user's ssh key pair

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
id + + +User + + + + +

the id of the key to delete

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when deleted
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

updateUserSettings(opts) → {Promise.<Object>}

+ + + + + +
+

Updates an individual user's settings object.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +Object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + + +

the user calling the api

+ +
settings + + +Object + + + + +

the updates to the user settings

+ +
req + + +Object + + + + +

the request to log (optional)

+ +
+ + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Object> + + +
+
+ + +
+
    +
  • the user settings
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util.html b/docs/api/modules/v/1.3/@node-red_util.html new file mode 100644 index 00000000..69ff735f --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util.html @@ -0,0 +1,692 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util +

+ +
+ +
+
+ + +

This module provides common utilities for the Node-RED runtime and editor

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + +
init ( settings )
+ +
+
+ +

Members

+ + + + + + + + + + + + + + +
events : { ... }
exec : { ... }
i18n : { ... }
log : { ... }
util : { ... }
+ +
+
+
+ + + + +
+ +

events

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

exec

+ + + + + + +

Run system commands with event-log integration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

i18n

+ + + + + + +

Internationalization utilities

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

log

+ + + + + + +

Logging utilities

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + +
+ + + +

init(settings)

+ + + + + +
+

Initialise the module with the runtime settings

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
settings + + +Object + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util_events.html b/docs/api/modules/v/1.3/@node-red_util_events.html new file mode 100644 index 00000000..d384ff1d --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util_events.html @@ -0,0 +1,911 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util.events +

+ +
+ +
+
+ + +

Runtime events emitter

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + +
emit ( eventName )
on ( eventName, listener )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

emit(eventName) → {Boolean}

+ + + + + +
+

Emit an event to all of its registered listeners

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +String + + + + +

the name of the event to emit

+ +
...args + + +any + + + + +

the arguments to pass in the event

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Boolean + + +
+
+ + +
+
    +
  • whether the event had listeners or not
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

on(eventName, listener)

+ + + + + +
+

Register an event listener for a runtime event

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +String + + + + +

the name of the event to listen to

+ +
listener + + +function + + + + +

the callback function for the event

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+

@node-red/util.events +

+ +
+ +
+
+ + +

Runtime events

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + +
emit ( eventName )
on ( eventName, listener )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

emit(eventName) → {Boolean}

+ + + + + +
+

Emit an event to all of its registered listeners

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +String + + + + +

the name of the event to emit

+ +
...args + + +any + + + + +

the arguments to pass in the event

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Boolean + + +
+
+ + +
+
    +
  • whether the event had listeners or not
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

on(eventName, listener)

+ + + + + +
+

Register an event listener for a runtime event

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +String + + + + +

the name of the event to listen to

+ +
listener + + +function + + + + +

the callback function for the event

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util_exec.html b/docs/api/modules/v/1.3/@node-red_util_exec.html new file mode 100644 index 00000000..5b55ff14 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util_exec.html @@ -0,0 +1,370 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util.exec +

+ +
+ +
+
+ + +

Run system commands with event-log integration

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + +
run ( command, args, options, emit )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

run(command, args, options, emit) → {Promise}

+ + + + + +
+

Run a system command with stdout/err being emitted as 'event-log' events +on the @node-red/util/events handler.

+

The main arguments to this function are the same as passed to child_process.spawn

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
command + + +String + + + + +

the command to run

+ +
args + + +Array + + + + +

arguments for the command

+ +
options + + +Object + + + + +

options to pass child_process.spawn

+ +
emit + + +Boolean + + + + +

whether to emit events to the event-log for each line of stdout/err

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+

A promise that resolves (rc=0) or rejects (rc!=0) when the command completes. The value +of the promise is an object of the form:

+
  {
+      code: <exit code>,
+      stdout: <standard output from the command>,
+      stderr: <standard error from the command>
+  }
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util_i18n.html b/docs/api/modules/v/1.3/@node-red_util_i18n.html new file mode 100644 index 00000000..f6c6149e --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util_i18n.html @@ -0,0 +1,531 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util.i18n +

+ +
+ +
+
+ + +

Internationalization utilities

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +
+ +
+
+
+ + + + + + +
+ + + +

_()

+ + + + + +
+

Perform a message catalog lookup.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

availableLanguages()

+ + + + + +
+

Gets a list of languages a given catalog is available in.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

catalog()

+ + + + + +
+

Gets a message catalog.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

registerMessageCatalog()

+ + + + + +
+

Register a message catalog with i18n.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

registerMessageCatalogs()

+ + + + + +
+

Register multiple message catalogs with i18n.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util_log.html b/docs/api/modules/v/1.3/@node-red_util_log.html new file mode 100644 index 00000000..c257c3dd --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util_log.html @@ -0,0 +1,1017 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util.log +

+ +
+ +
+
+ + +

Logging utilities

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
_ ( )
addHandler ( )
audit ( )
debug ( )
error ( )
info ( )
log ( )
metric ( )
removeHandler ( )
trace ( )
warn ( )
+ +
+
+ +
+
+
+ + + + + + +
+ + + +

_()

+ + + + + +
+

Perform a message catalog lookup.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

addHandler()

+ + + + + +
+

Add a log handler function

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

audit()

+ + + + + +
+

Log an audit event.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

debug()

+ + + + + +
+

Log a message at DEBUG level

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

error()

+ + + + + +
+

Log a message at ERROR level

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

info()

+ + + + + +
+

Log a message at INFO level

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

log()

+ + + + + +
+

Log a message object

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

metric()

+ + + + + +
+

Check if metrics are enabled

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

removeHandler()

+ + + + + +
+

Remove a log handler function

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

trace()

+ + + + + +
+

Log a message at TRACE level

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +

warn()

+ + + + + +
+

Log a message at WARN level

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/@node-red_util_util.html b/docs/api/modules/v/1.3/@node-red_util_util.html new file mode 100644 index 00000000..e7290065 --- /dev/null +++ b/docs/api/modules/v/1.3/@node-red_util_util.html @@ -0,0 +1,3244 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

@node-red/util.util +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + +

cloneMessage(msg) → {Object}

+ + + + + +
+

Safely clones a message object. This handles msg.req/msg.res objects that must +not be cloned.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +any + + + + +

the message object to clone

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the cloned message

+
+ + +
+ + + +
+ + + +
+ + + +

compareObjects(obj1, obj2) → {boolean}

+ + + + + +
+

Compares two objects, handling various JavaScript types.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
obj1 + + +any + + + + + + +
obj2 + + +any + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether the two objects are the same

+
+ + +
+ + + +
+ + + +
+ + + +

encodeObject(msg, opts) → {Object}

+ + + + + +
+

Encode an object to JSON without losing information about non-JSON types +such as Buffer and Function.

+

This function is closely tied to its reverse within the editor

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + + + + +
opts + + +Object + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

the encoded object

+
+ + +
+ + + +
+ + + +
+ + + +

ensureBuffer(o) → {String}

+ + + + + +
+

Converts the provided argument to a Buffer, using type-dependent +methods.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
o + + +any + + + + +

the property to convert to a Buffer

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the Buffer version

+
+ + +
+ + + +
+ + + +
+ + + +

ensureString(o) → {String}

+ + + + + +
+

Converts the provided argument to a String, using type-dependent +methods.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
o + + +any + + + + +

the property to convert to a String

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

the stringified version

+
+ + +
+ + + +
+ + + +
+ + + +

evaluateEnvProperty(value, node) → {String}

+ + + + + +
+

Checks if a String contains any Environment Variable specifiers and returns +it with their values substituted in place.

+

For example, if the env var WHO is set to Joe, the string Hello ${WHO}! +will return Hello Joe!.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + +

the string to parse

+ +
node + + +Node + + + + +

the node evaluating the property

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

The parsed string

+
+ + +
+ + + +
+ + + +
+ + + +

evaluateJSONataExpression(expr, msg, callback) → {any}

+ + + + + +
+

Evaluates a JSONata expression. +The expression must have been prepared with @node-red/util-util.prepareJSONataExpression +before passing to this function.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
expr + + +Object + + + + +

the prepared JSONata expression

+ +
msg + + +Object + + + + +

the message object to evaluate against

+ +
callback + + +function + + + + +

(optional) called when the expression is evaluated

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +any + + +
+
+ + +
+

If no callback was provided, the result of the expression

+
+ + +
+ + + +
+ + + +
+ + + +

evaluateNodeProperty(value, type, node, msg, callback) → {any}

+ + + + + +
+

Evaluates a property value according to its type.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + +

the raw value

+ +
type + + +String + + + + +

the type of the value

+ +
node + + +Node + + + + +

the node evaluating the property

+ +
msg + + +Object + + + + +

the message object to evaluate against

+ +
callback + + +function + + + + +

(optional) called when the property is evaluated

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +any + + +
+
+ + +
+

The evaluted property, if no callback is provided

+
+ + +
+ + + +
+ + + +
+ + + +

generateId() → {String}

+ + + + + +
+

Generates a psuedo-unique-random id.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

a random-ish id

+
+ + +
+ + + +
+ + + +
+ + + +

getMessageProperty(msg, expr) → {any}

+ + + + + +
+

Gets a property of a message object.

+

Unlike @node-red/util-util.getObjectProperty, this function will strip msg. from the +front of the property expression if present.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + + +

the message object

+ +
expr + + +String + + + + +

the property expression

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

Will throw an error if the parent of the property does not exist

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +any + + +
+
+ + +
+

the message property, or undefined if it does not exist

+
+ + +
+ + + +
+ + + +
+ + + +

getObjectProperty(msg, expr) → {any}

+ + + + + +
+

Gets a property of an object.

+

Given the object:

+
{
+  "pet": {
+      "type": "cat"
+  }
+}
+
+
    +
  • pet.type will return "cat".
  • +
  • pet.name will return undefined
  • +
  • car will return undefined
  • +
  • car.type will throw an Error (as car does not exist)
  • +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + + +

the object

+ +
expr + + +String + + + + +

the property expression

+ +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+ +

Will throw an error if the parent of the property does not exist

+ +
+ + + +
+ + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +any + + +
+
+ + +
+

the object property, or undefined if it does not exist

+
+ + +
+ + + +
+ + + +
+ + + +

normaliseNodeTypeName(name) → {String}

+ + + + + +
+

Normalise a node type name to camel case.

+

For example: a-random node type will normalise to aRandomNodeType

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + +

the node type

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+

The normalised name

+
+ + +
+ + + +
+ + + +
+ + + +

normalisePropertyExpression(str) → {Array}

+ + + + + +
+

Parses a property expression, such as msg.foo.bar[3] to validate it +and convert it to a canonical version expressed as an Array of property +names.

+

For example, a["b"].c returns ['a','b','c']

+

If msg is provided, any internal cross-references will be evaluated against that +object. Otherwise, it will return a nested set of properties

+

For example, without msg set, 'a[msg.foo]' returns ['a', [ 'msg', 'foo'] ] +But if msg is set to '{"foo": "bar"}', 'a[msg.foo]' returns ['a', 'bar' ]

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + +

the property expression

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Array + + +
+
+ + +
+

the normalised expression

+
+ + +
+ + + +
+ + + +
+ + + +

parseContextStore(key) → {Object}

+ + + + + +
+

Parses a context property string, as generated by the TypedInput, to extract +the store name if present.

+

For example, #:(file)::foo results in { store: "file", key: "foo" }.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + + +

the context property string to parse

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

The parsed property

+
+ + +
+ + + +
+ + + +
+ + + +

prepareJSONataExpression(value, node) → {Object}

+ + + + + +
+

Prepares a JSONata expression for evaluation. +This attaches Node-RED specific functions to the expression.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + +

the JSONata expression

+ +
node + + +Node + + + + +

the node evaluating the property

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Object + + +
+
+ + +
+

The JSONata expression that can be evaluated

+
+ + +
+ + + +
+ + + +
+ + + +

setMessageProperty(msg, prop, value, createMissing)

+ + + + + +
+

Sets a property of a message object.

+

Unlike @node-red/util-util.setObjectProperty, this function will strip msg. from the +front of the property expression if present.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + + +

the message object

+ +
prop + + +String + + + + +

the property expression

+ +
value + + +any + + + + +

the value to set

+ +
createMissing + + +boolean + + + + +

whether to create missing parent properties

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

setObjectProperty(msg, prop, value, createMissing)

+ + + + + +
+

Sets a property of an object.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + + +

the object

+ +
prop + + +String + + + + +

the property expression

+ +
value + + +any + + + + +

the value to set

+ +
createMissing + + +boolean + + + + +

whether to create missing parent properties

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/api-docs.css b/docs/api/modules/v/1.3/api-docs.css new file mode 100644 index 00000000..89e83d6c --- /dev/null +++ b/docs/api/modules/v/1.3/api-docs.css @@ -0,0 +1,16 @@ + +.nav-item { font-size: 0.9em; display: none } +td:first-child span { + font-family: 'Open Sans', sans-serif; + font-size: 0.9em; + background: none; + border: none; + width: auto; + text-align: left; + display: inline-block; + margin-right: 10px; +} + +.type-signature { + color: #999; +} diff --git a/docs/api/modules/v/1.3/global.html b/docs/api/modules/v/1.3/global.html new file mode 100644 index 00000000..f80a8c6c --- /dev/null +++ b/docs/api/modules/v/1.3/global.html @@ -0,0 +1,686 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

+

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +
+
+ +
+
+
+ + + + + + +

Type Definitions

+ + + +
+ +

CommsConnection

+ + + + + + +
+

A WebSocket connection between the runtime and the editor.

+
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
session + + +string + + + +

a unique session identifier

user + + +Object + + + +

the user associated with the connection

send + + +function + + + +

publish a message to the connection

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

Flow

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +string + + + +

the flow identifier

label + + +string + + + +

a label for the flow

nodes + + +Array + + + +

an array of node configuration objects

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

Flows

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
rev + + +string + + + +

the flow revision identifier

flows + + +Array + + + +

the flow configuration, an array of node configuration objects

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

User

+ + + + + + +
+

A user accessing the API

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/index.html b/docs/api/modules/v/1.3/index.html new file mode 100644 index 00000000..2072de81 --- /dev/null +++ b/docs/api/modules/v/1.3/index.html @@ -0,0 +1,95 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + + + + + + + + + + + + + +
+

Node-RED Modules

+

Node-RED provides a set of node modules that implement different parts of the +application.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ModuleDescription
node-redthe main module that pulls together all of the internal modules and provides the executable version of Node-RED
@node-red/editor-apian Express application that serves the Node-RED editor and provides the Admin HTTP API
@node-red/runtimethe core runtime of Node-RED
@node-red/utilcommon utilities for the Node-RED runtime and editor modules
@node-red/registrythe internal node registry
@node-red/nodesthe default set of core nodes
@node-red/editor-clientthe client-side resources of the Node-RED editor application
+
+ + + + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/modules/v/1.3/node-red.html b/docs/api/modules/v/1.3/node-red.html new file mode 100644 index 00000000..9d0e6090 --- /dev/null +++ b/docs/api/modules/v/1.3/node-red.html @@ -0,0 +1,1404 @@ +--- +layout: barebones +slug: + - url: /docs/api/modules + label: modules + - 1.3.2 +--- +{% assign parent_url = '/docs/api' %} +{% assign parent_slug = 'api' %} + +
+ {% include breadcrumbs.html %} +
+ +
+
+ + + + + +
+ +
+

node-red +

+ +
+ +
+
+ + +

This module provides the full Node-RED application, with both the runtime +and editor components built in.

+

The API this module exposes allows it to be embedded within another Node.js +application.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +

Functions

+ + + + + + + + + + + + +
init ( httpServer, userSettings )
start ( )
stop ( )
version ( )
+ +
+
+ +

Members

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
httpAdmin : ExpressApplication
httpNode : ExpressApplication
nodes
server : HTTPServer
settings
auth : { ... }
events : { ... }
hooks : { ... }
log : { ... }
runtime : { ... }
util : { ... }
+ +
+
+
+ + + + +
+ +

httpAdmin : ExpressApplication

+ + + + + + +
+

The express application for the Editor Admin API

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

httpNode : ExpressApplication

+ + + + + + +
+

The express application for HTTP Nodes

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

nodes

+ + + + + + +
+

This provides access to the internal nodes module of the +runtime. The details of this API remain undocumented as they should not +be used directly.

+

Most administrative actions should be performed use the runtime api +under node-red.runtime.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

server : HTTPServer

+ + + + + + +
+

The HTTP Server used by the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

settings

+ + + + + + +
+

This provides access to the internal settings module of the +runtime.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ +

auth

+ + + + + + +
+

The editor authentication api.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + +
+ +

events

+ + + + + + +
+

Runtime events emitter

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + +
+ +

hooks

+ + + + + + +
+

Runtime hooks engine

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + +
+ +

log

+ + + + + + +
+

Logging utilities

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + +
+ +

runtime

+ + + + + + +
+

The runtime api

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + +
+ +

util

+ + + + + + +
+

General utilities

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + + + +
+ + + + + + + +
+ + + +

init(httpServer, userSettings)

+ + + + + +
+

Initialise the Node-RED application.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
httpServer + + +server + + + + +

the HTTP server object to use

+ +
userSettings + + +Object + + + + +

an object containing the runtime settings

+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +

start() → {Promise}

+ + + + + +
+

Start the Node-RED application.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

stop() → {Promise}

+ + + + + +
+

Stop the Node-RED application.

+

Once called, Node-RED should not be restarted until the Node.JS process is +restarted.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise + + +
+
+ + +
+
    +
  • resolves when complete
  • +
+
+ + +
+ + + +
+ + + +
+ + + +

version() → {String}

+ + + + + +
+

Get the version of the runtime

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +String + + +
+
+ + +
+
    +
  • the runtime version
  • +
+
+ + +
+ + + +
+ + + + + + + +
+ +
+ + + + +
+
+
+
+ \ No newline at end of file diff --git a/docs/api/ui/actions/index.md b/docs/api/ui/actions/index.md new file mode 100644 index 00000000..1c4746a3 --- /dev/null +++ b/docs/api/ui/actions/index.md @@ -0,0 +1,53 @@ +--- +layout: docs-api +toc: toc-api-ui.html +title: RED.events +slug: + - url: "/docs/api/ui" + label: "ui" + - 'actions' +--- + + +This API can be used to register and invoke Actions in the editor. Actions are +individual pieces of functionality that a user may want to trigger and can be +bound to keyboard shortcuts. + + - [`RED.actions` API](#redactions-api) + - [`RED.actions.add( name, handler )`](#methods-add) + - [`RED.actions.remove( name )`](#methods-remove) + - [`RED.actions.invoke( name, [args...] )`](#methods-invoke) + + +### `RED.actions` API + +#### RED.actions.add( name, handler ) + +Register a new action. + +The name should follow the pattern `[provider]:[name-of-action]`. For example `core:show-debug-tab`. + +```javascript +RED.actions.add("my-custom-tab:show-custom-tab",function() { + RED.sidebar.show("my-custom-tab"); +}); +``` + +#### RED.actions.remove( name ) + +Remove a previously registered action. + +```javascript +RED.actions.remove("my-custom-tab:show-custom-tab") +``` + +#### RED.actions.invoke( name, [args...]) + +Invoke an action by name. + +When bound to a keyboard shortcut, the handler will be invoked without any arguments. But when +invoked using this API, it is possible to pass in arguments. + +```javascript +RED.actions.invoke("my-custom-tab:show-custom-tab") +``` diff --git a/docs/api/ui/autoComplete/index.md b/docs/api/ui/autoComplete/index.md new file mode 100644 index 00000000..f31f14fa --- /dev/null +++ b/docs/api/ui/autoComplete/index.md @@ -0,0 +1,315 @@ +--- +layout: docs-api +toc: toc-api-ui.html +title: AutoComplete +slug: + - url: "/docs/api/ui" + label: "ui" + - 'autocomplete' +--- + +__Since 2.1.0__ + +Adds auto-complete functionality to an `` element. + + - [Options](#options) + - [Methods](#methods) + - [Examples](#examples) + +
+
+
+

Options

+ + +
search
+
+
+

Methods

+ + +
destroy
+
+
+
+

Events

+

Types

+
+
+ +### Options + +#### search( value, [done]) + +Type: function + +A function that is called when the input value changes that should return a list +of possible completions. + +The function can take one or two arguments: + + - `value` - the current value of the ``. + - `done` - an optional callback function that will be called with the completions. + +If the function has two arguments, it *must* call `done` with the results rather +than return them. This allows the function to do asynchronous work to generate the +completions. + +The returns list of completions must be an array of objects of the form: + +```javascript + { + value: "", // The value to insert if selected + label: ""|DOMElement // The label to display in the dropdown + } +``` + +The `label` can be a DOMElement. This can be used to provide a customised display +of the completion - for example, including more contextual information. + + +### Methods + +#### destroy( ) + +Remove auto-complete functionality from an ``. + +```javascript +$(".input").autoComplete('destroy'); +``` + + +### Examples + +#### Auto-complete on plain `` + +```html + +``` + +```javascript +// View the page source to see the full list of animals used in +// this example +let animals = ["Aardvark","Alligator","Alpaca","Anaconda","Ant","Antelope", + "Carp","Cat","Caterpillar","Catfish","Cheetah","Chicken", + "Deer","Dinosaur","Dog","Dolphin","Donkey","Dove" ]; + +$("#node-input-example1").autoComplete({ + search: function(val) { + var matches = []; + animals.forEach(v => { + var i = v.toLowerCase().indexOf(val.toLowerCase()); + if (i > -1) { + matches.push({ + value: v, + label: v, + i: i + }) + } + }); + matches.sort(function(A,B){return A.i-B.i}) + return matches + } +}) +``` + +
+

Pick an animal

+ +
+ +#### Asynchronous search + +```html + +``` + +```javascript +// View the page source to see the full list of animals used in +// this example +let animals = ["Aardvark","Alligator","Alpaca","Anaconda","Ant","Antelope", + "Carp","Cat","Caterpillar","Catfish","Cheetah","Chicken", + "Deer","Dinosaur","Dog","Dolphin","Donkey","Dove" ]; + +$("#node-input-example2").autoComplete({ + search: function(val, done) { + var matches = []; + animals.forEach(v => { + var i = v.toLowerCase().indexOf(val.toLowerCase()); + if (i > -1) { + matches.push({ + value: v, + label: v, + i: i + }) + } + }); + matches.sort(function(A,B){return A.i-B.i}) + // Simulate asynchronous work by using setTimout + // to delay response by 1 second + setTimeout(function() { + done(matches); + },1000) + } +}) +``` + + +
+

Pick an animal

+ +
+ +#### Custom result labels + +```html + +``` + +```javascript +// View the page source to see the full list of animals used in +// this example +let animals = ["Aardvark","Alligator","Alpaca","Anaconda","Ant","Antelope", + "Carp","Cat","Caterpillar","Catfish","Cheetah","Chicken", + "Deer","Dinosaur","Dog","Dolphin","Donkey","Dove" ]; + +$("#node-input-example3").autoComplete({ + search: function(val) { + var matches = []; + animals.forEach(v => { + var i = v.toLowerCase().indexOf(val.toLowerCase()); + if (i > -1) { + var pre = v.substring(0,i); + var matchedVal = v.substring(i,i+val.length); + var post = v.substring(i+val.length) + + var el = $('
',{style:"white-space:nowrap"}); + $('').text(pre).appendTo(el); + $('',{style:"font-weight: bold; color:red"}).text(matchedVal).appendTo(el); + $('').text(post).appendTo(el); + + matches.push({ + value: v, + label: el, + i:i + }) + } + }) + matches.sort(function(A,B){return A.i-B.i}) + return matches + } +}) +``` + +
+

Pick an animal

+ +
+ + + + + + + + + + diff --git a/docs/api/ui/editableList/index.md b/docs/api/ui/editableList/index.md index 225f322b..b963c0a8 100644 --- a/docs/api/ui/editableList/index.md +++ b/docs/api/ui/editableList/index.md @@ -4,7 +4,7 @@ toc: toc-api-ui.html title: EditableList Widget slug: - url: "/docs/api/ui" - label: "ui widgets" + label: "ui" - 'editablelist' --- @@ -12,45 +12,52 @@ slug: A replacement for a `
    ` element where the items can be complex elements in their own right. Used by the core `Switch` and `Change` nodes. +- [Options](#options) +- [Methods](#methods) +
    - -
    -

    Methods

    - - - - - - - - - - - - -
    addItem
    addItems
    removeItem
    width
    height
    items
    empty
    filter
    show
    sort
    length
    + -
    -

    Events

    -

    Types

    +
    +

    Events

    +

    Types

    @@ -97,6 +104,36 @@ $("ol.list").editableList({ }); ``` +#### buttons( array ) + +Type: Array + +An array of button objects, that need to be added at the bottom of the editableList. +Each button object can have the following properties: + + - `label` - the (optional) button label + - `icon` - the (optional) button icon + - `title` - the (optional) button tooltip text + - `click` - the callback function that will be executed when the button is clicked + +Note that the 'add button' is added implicit to this array, when the `addButton` is activated. + +```javascript +$("ol.list").editableList({ + addItem: function(row, index, data) { + $(row).html("Item "+index); + } + buttons: [{ + label: "with icon", + icon: "fa fa-star", + title: "my custom button", + click: function(evt) { + alert("button clicked"); + } + }] +}); +``` + #### connectWith Type: CSS Selector @@ -186,7 +223,7 @@ This callback is invoked after the main [`resize`](#options-resize) callback is $("ol.list").editableList({ resizeItem: function(row,index) { var originalData = $(row).data('data'); - consol.log("Resize the row for item:", originalData) + console.log("Resize the row for item:", originalData) } }); ``` @@ -258,7 +295,7 @@ A function that is called after an item in the list is moved. - `items` - an Array of the jQuery DOM elements for each row, in order. -Each row element stores the original data for the item under property called `data`. +Each row element stores the original data for the item under the property called `data`. ```javascript $("ol.list").editableList({ @@ -357,7 +394,7 @@ $("ol.input").editableList('height', '200px'); Gets an Array of all list items. Each item is the jQuery DOM element for the item. -Each element stores the original data for the item under property called `data`. +Each element stores the original data for the item under the property called `data`. ```javascript var items = $("ol.list").editableList('items'); @@ -381,7 +418,7 @@ the number of visible items. See filter for details of the filter function. -If `filter` is not provided, the list is filtered using the current active filter +If `filter` is not provided, the list is filtered using the currently active filter function. If `filter` is `null`, the filter is removed. @@ -434,6 +471,16 @@ Gets the number of list items. var length = $("ol.list").editableList('length'); ``` +#### cancel() + +*Since 3.1.0* + +Cancels an item sort operation on the list. + +```javascript +$("ol.list").editableList('cancel'); +``` + + + diff --git a/docs/api/ui/typedInput/red/images/typedInput/09.svg b/docs/api/ui/typedInput/red/images/typedInput/09.svg new file mode 100644 index 00000000..8e91ec38 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/09.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/az.svg b/docs/api/ui/typedInput/red/images/typedInput/az.svg new file mode 100644 index 00000000..90105811 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/az.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/bin.svg b/docs/api/ui/typedInput/red/images/typedInput/bin.svg new file mode 100644 index 00000000..efc427ac --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/bin.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/bool.svg b/docs/api/ui/typedInput/red/images/typedInput/bool.svg new file mode 100644 index 00000000..8eee3840 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/bool.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/env.svg b/docs/api/ui/typedInput/red/images/typedInput/env.svg new file mode 100644 index 00000000..a24515f3 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/env.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/expr.svg b/docs/api/ui/typedInput/red/images/typedInput/expr.svg new file mode 100644 index 00000000..500ca392 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/expr.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/json.svg b/docs/api/ui/typedInput/red/images/typedInput/json.svg new file mode 100644 index 00000000..978c8914 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/json.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/re.svg b/docs/api/ui/typedInput/red/images/typedInput/re.svg new file mode 100644 index 00000000..b44c5921 --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/re.svg @@ -0,0 +1 @@ + diff --git a/docs/api/ui/typedInput/red/images/typedInput/target.svg b/docs/api/ui/typedInput/red/images/typedInput/target.svg new file mode 100644 index 00000000..41ed2e3a --- /dev/null +++ b/docs/api/ui/typedInput/red/images/typedInput/target.svg @@ -0,0 +1 @@ + diff --git a/docs/creating-nodes/appearance.md b/docs/creating-nodes/appearance.md index 9c5523dc..c3b3ece6 100644 --- a/docs/creating-nodes/appearance.md +++ b/docs/creating-nodes/appearance.md @@ -27,7 +27,7 @@ a node instance, as well as for the node's entry in the palette. In this latter {% highlight javascript %} ... -icon: "file.png", +icon: "file.svg", ... {% endhighlight %} @@ -58,26 +58,26 @@ The icon can be either:
      -
    • alert.png
    • -
    • arrow-in.png
    • -
    • bridge-dash.png
    • -
    • bridge.png
    • -
    • db.png
    • -
    • debug.png
    • -
    • envelope.png
    • -
    • feed.png
    • -
    • file.png
    • -
    • function.png
    • -
    • hash.png
    • -
    • inject.png
    • -
    • light.png
    • -
    • serial.png
    • -
    • template.png
    • -
    • white-globe.png
    • +
    • alert.svg
    • +
    • arrow-in.svg
    • +
    • bridge-dash.svg
    • +
    • bridge.svg
    • +
    • db.svg
    • +
    • debug.svg
    • +
    • envelope.svg
    • +
    • feed.svg
    • +
    • file.svg
    • +
    • function.svg
    • +
    • hash.svg
    • +
    • inject.svg
    • +
    • light.svg
    • +
    • serial.svg
    • +
    • template.svg
    • +
    • white-globe.svg
    **Note**: In Node-RED 1.0, all of these icons have been replaced with SVG alternatives -for a better appearance. For ensure backwards compatibility, the editor will automatically +for a better appearance. To ensure backward compatibility, the editor will automatically swap any request for the png version for the SVG version if it is available. #### Custom icon @@ -86,7 +86,7 @@ A node can provide its own icon in a directory called `icons` alongside its `.js and `.html` files. These directories get added to the search path when the editor looks for a given icon filename. Because of this, the icon filename must be unique. -The icon should be white on a transparent background, 40 x 60 in size. +The icon should be white on a transparent background, with a 2:3 aspect ratio, with a minimum of 40 x 60 in size. #### Font Awesome icon @@ -175,7 +175,7 @@ There are four label properties of a node; `label`, `paletteLabel`, `outputLabel #### Node label The `label` of a node in the workspace can either be a static piece of text, or -it can be set dynamically on a per-node basis according to the nodes properties. +it can be set dynamically on a per-node basis according to the properties of the node. The value of the property can be either a string or a function. @@ -297,7 +297,7 @@ A key principle is the editor is not a dashboard for controlling your flows. So in general, nodes should not have buttons on them. The Inject and Debug nodes are special cases as the buttons play a role in the development of flows. -The `button` property in its definition is used to describe the behaviour of the +The `button` property in its definition is used to describe the behavior of the button. It must provide, as a minimum, an `onclick` function that will be called when the button is clicked. diff --git a/docs/creating-nodes/config-nodes.md b/docs/creating-nodes/config-nodes.md index 9adf5bcf..2e069bfd 100644 --- a/docs/creating-nodes/config-nodes.md +++ b/docs/creating-nodes/config-nodes.md @@ -34,13 +34,13 @@ key differences: }); - @@ -86,7 +86,7 @@ available instances of the config node, along with a button to open the config node edit dialog.
    - +
    diff --git a/docs/creating-nodes/credentials.md b/docs/creating-nodes/credentials.md index 2b9e1b7e..26e53b53 100644 --- a/docs/creating-nodes/credentials.md +++ b/docs/creating-nodes/credentials.md @@ -12,38 +12,39 @@ flows are exported from the editor. To add credentials to a node, the following steps are taken: 1. Add a new `credentials` entry to the node's definition: - - credentials: { - username: {type:"text"}, - password: {type:"password"} - }, - + ```javascript + credentials: { + username: {type:"text"}, + password: {type:"password"} + }, + ``` The entries take a single option - their `type` which can be either `text` or `password`. 2. Add suitable entries to the edit template for the node - -
    - - -
    -
    - - -
    - + ```html +
    + + +
    +
    + + +
    + ``` Note that the template uses the same element `id` conventions as regular node properties. 3. In the node's `.js` file, the call to `RED.nodes.registerType` must be updated to include the credentials: - - RED.nodes.registerType("my-node",MyNode,{ - credentials: { - username: {type:"text"}, - password: {type:"password"} - } - }); + ```javascript + RED.nodes.registerType("my-node",MyNode,{ + credentials: { + username: {type:"text"}, + password: {type:"password"} + } + }); + ``` ### Accessing credentials @@ -80,9 +81,9 @@ oneditprepare: function() { ### Advanced credential use Whilst the credential system outlined above is sufficient for most cases, in some -circumstances it is necessary to store more values in credentials then just those +circumstances it is necessary to store more values in credentials than just those that get provided by the user. For example, for a node to support an OAuth workflow, it must retain server-assigned -tokens that the user never sees. The Twitter node provides a good example of how +tokens that the user never sees. The [Twitter node](https://github.com/node-red/node-red-nodes/tree/master/social/twitter) provides a good example of how this can be achieved. diff --git a/docs/creating-nodes/edit-dialog.md b/docs/creating-nodes/edit-dialog.md new file mode 100644 index 00000000..a7457fbd --- /dev/null +++ b/docs/creating-nodes/edit-dialog.md @@ -0,0 +1,363 @@ +--- +layout: docs-creating-nodes +toc: toc-creating-nodes.html +title: Node edit dialog +slug: edit dialog +--- + + + + + + + + +The edit dialog for a node is the main way a user can configure the node to +do what they want. + +The dialog should be intuitive to use and be consistent in its design and appearance +when compared to other nodes. + +The edit dialog is provided in the [node's HTML file](node-html), inside a +` +``` + + - The ` + +### Multi-line Text Editor + +Node-RED includes a multi-line text editor based on the [Ace code editor](https://ace.c9.io/), or +if enabled via user settings, the [Monaco editor](https://microsoft.github.io/monaco-editor/) + +
    + Multi-line Text Editor +

    Multi-line Text Editor

    +
    + + +In the following example, the node property that we will edit is called `exampleText`. + +In your HTML, add a `
    ` placeholder for the editor. This must have the css class +`node-text-editor`. You will also need to set a `height` on the element. + +```html +
    +``` + +In the node's `oneditprepare` function, the text editor is initialised using the `RED.editor.createEditor` +function: + +```javascript +this.editor = RED.editor.createEditor({ + id: 'node-input-example-editor', + mode: 'ace/mode/text', + value: this.exampleText +}); +``` + +The `oneditsave` and `oneditcancel` functions are also needed to get the value +back from the editor when the dialog is closed, and ensure the editor is properly +removed from the page. + +```javascript +oneditsave: function() { + this.exampleText = this.editor.getValue(); + this.editor.destroy(); + delete this.editor; +}, +oneditcancel: function() { + this.editor.destroy(); + delete this.editor; +}, +``` + + + + diff --git a/docs/creating-nodes/first-node.md b/docs/creating-nodes/first-node.md index b1f4913e..ec60174d 100644 --- a/docs/creating-nodes/first-node.md +++ b/docs/creating-nodes/first-node.md @@ -43,7 +43,7 @@ This will ask a series of questions to help create the initial content for the file, using sensible defaults where it can. When prompted, give it the name `node-red-contrib-example-lower-case`. -Once generated, you must added a `node-red` section: +Once generated, you must add a `node-red` section: ```json { @@ -89,7 +89,7 @@ The node itself is defined by a function, `LowerCaseNode` that gets called whene a new instance of the node is created. It is passed an object containing the node-specific properties set in the flow editor. -The function calls the `RED.nodes.createNode` function to initialise the features +The function calls the `RED.nodes.createNode` function to initialize the features shared by all nodes. After that, the node-specific code lives. In this instance, the node registers a listener to the `input` event which gets @@ -116,23 +116,23 @@ For more information about the runtime part of the node, see [here](node-js). defaults: { name: {value:""} }, - inputs:1, - outputs:1, - icon: "file.png", + inputs: 1, + outputs: 1, + icon: "file.svg", label: function() { return this.name||"lower-case"; } }); - - ``` @@ -155,9 +155,9 @@ Once you have created a basic node module as described above, you can install it To test a node module locally the [`npm install `](https://docs.npmjs.com/cli/install) command can be used. This allows you to develop the node in a local directory and -have it linked into a local node-red install during development. +have it linked into a local Node-RED install during development. -In your node-red user directory, typically `~/.node-red`, run: +In your Node-RED user directory, typically `~/.node-red`, run: npm install @@ -190,8 +190,7 @@ Using this framework, you can create test flows, and then assert that your node

    test/lower-case_spec.js

    ```javascript -var should = require("should"); -var helper = require("node-red-test-helper"); +var helper = require("node-red-node-test-helper"); var lowerNode = require("../lower-case.js"); describe('lower-case Node', function () { diff --git a/docs/creating-nodes/help-style-guide.md b/docs/creating-nodes/help-style-guide.md index e8354ad3..fb1d152a 100644 --- a/docs/creating-nodes/help-style-guide.md +++ b/docs/creating-nodes/help-style-guide.md @@ -11,6 +11,10 @@ should provide the user with all the information they need in order to use the n The following style guide describes how the help should be structured to ensure a consistent appearance between nodes. +*Since 2.1.0* : The help text can be provided as markdown rather than HTML. In this +case the `type` attribute of the ` -~~~~~ +``` + +{:.code-tab-md} +```markdown + +``` #### Section headers Each section must be marked up with an `

    ` tag. If the `Details` section needs sub headings, they must use `

    ` tags. -~~~~~html +{:.code-tab-html} +```html

    Inputs

    ...

    Details

    ...

    A sub section

    ... -~~~~~ +``` + +{:.code-tab-md} +```markdown +### Inputs +... +### Details +... +#### A sub section +... +``` #### Message properties @@ -181,10 +234,10 @@ Each `
    ` contains the property name and an optional `
    payload string | buffer @@ -195,7 +248,13 @@ Each `
    ` contains the brief description of the property.
    the MQTT topic to publish to.
    -~~~~~ +``` + +{:.code-tab-md} +```markdown +: payload (string | buffer) : the payload of the message to publish. +: *topic* (string) : the MQTT topic to publish to. +``` #### Multiple outputs @@ -209,7 +268,8 @@ by a `
    ` message property list. Note: if the node has a single output, it should not be wrapped in such a list and just the `
    ` used. -~~~~~html +{:.code-tab-html} +```html
    1. Standard output
      @@ -224,7 +284,16 @@ just the `
      ` used.
    -~~~~~ +``` + +{:.code-tab-md} +```markdown +1. Standard output +: payload (string) : the standard output of the command. + +2. Standard error +: payload (string) : the standard error of the command. +``` #### General guidance @@ -233,11 +302,66 @@ When referencing a message property outside of a message property list described above, they should be prefixed with `msg.` to make it clear to the reader what it is. They should be wrapped in `` tags. -~~~~~html +{:.code-tab-html} +```html The interesting part is in msg.payload. -~~~~~ +``` + +{:.code-tab-md} +```markdown +The interesting part is in `msg.payload`. +``` No other styling markup (e.g. ``,``) should be used within the body of the help text. The help should not assume the reader is an experienced developer or deeply familiar with whatever the node exposes; above all, it needs to be helpful. + + + + diff --git a/docs/creating-nodes/i18n.md b/docs/creating-nodes/i18n.md index 342079f1..652ccee0 100644 --- a/docs/creating-nodes/i18n.md +++ b/docs/creating-nodes/i18n.md @@ -76,7 +76,7 @@ If a node sends [status messages](status) to the editor, it should set the this.status({fill:"green",shape:"dot",text:"myNode.status.ready"}); {% endhighlight %} -There are a number of commonly used status messages in the core node-red catalog. +There are a number of commonly used status messages in the core Node-RED catalog. These can be used by including the namespace in the message identified: {% highlight javascript %} @@ -100,7 +100,7 @@ of an ``: {% endhighlight %} -It is possible to combine these to specifiy multiple substitutions For example, +It is possible to combine these to specify multiple substitutions. For example, to set both the title attribute and the displayed text: {% highlight javascript %} diff --git a/docs/creating-nodes/images/ace-editor.png b/docs/creating-nodes/images/ace-editor.png new file mode 100644 index 00000000..074d85e5 Binary files /dev/null and b/docs/creating-nodes/images/ace-editor.png differ diff --git a/docs/creating-nodes/images/node_config_dialog.png b/docs/creating-nodes/images/node_config_dialog.png index f79e5cd2..a8f4b3ae 100644 Binary files a/docs/creating-nodes/images/node_config_dialog.png and b/docs/creating-nodes/images/node_config_dialog.png differ diff --git a/docs/creating-nodes/index.md b/docs/creating-nodes/index.md index 505ab7ee..59a92323 100644 --- a/docs/creating-nodes/index.md +++ b/docs/creating-nodes/index.md @@ -6,26 +6,29 @@ title: Creating Nodes The main way Node-RED can be extended is to add new nodes into its palette. -The following sections exist and are largely complete: +Nodes can be published as npm modules to the [public npm repository](https://www.npmjs.com/) +and added to the [Node-RED Flow Library](https://flows.nodered.org) to make them +available to the community. - [Creating your first node](first-node) - [JavaScript File](node-js) - [HTML File](node-html) - - [Node context](context) + - [Packaging](packaging) - [Node properties](properties) + - [Node credentials](credentials) - [Node appearance](appearance) + - [Node edit dialog](edit-dialog) + - [Storing context](context) - [Node status](status) - [Configuration nodes](config-nodes) - [Help style guide](help-style-guide) - - [Example flows](examples) - - [Packaging](packaging) + - [Adding examples](examples) - [Internationalisation](i18n) +*Since Node-RED 1.3* -To do: - -1. library -2. custom http endpoints + - [Loading extra resources in the editor](resources) + - [Packaging a Subflow as a module](subflow-modules) ### General guidance diff --git a/docs/creating-nodes/node-html.md b/docs/creating-nodes/node-html.md index 89546643..644895a1 100644 --- a/docs/creating-nodes/node-html.md +++ b/docs/creating-nodes/node-html.md @@ -5,7 +5,7 @@ title: HTML File slug: .html --- -The node `.html` file defines the how the node appears with the editor. It +The node `.html` file defines how the node appears with the editor. It contains three distinct part, each wrapped in its own ` - - -There are some simple conventions to follow: - - - a `
    ` with class `form-row` should be used to layout each row of the - dialog. - - a typical row will have a `