mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'dev' into pr_2478
This commit is contained in:
@@ -15,12 +15,14 @@
|
||||
-->
|
||||
|
||||
<script type="text/html" data-help-name="function">
|
||||
<p>A JavaScript function block to run against the messages being received by the node.</p>
|
||||
<p>A JavaScript function to run against the messages being received by the node.</p>
|
||||
<p>The messages are passed in as a JavaScript object called <code>msg</code>.</p>
|
||||
<p>By convention it will have a <code>msg.payload</code> property containing
|
||||
the body of the message.</p>
|
||||
<p>The function is expected to return a message object (or multiple message objects), but can choose
|
||||
to return nothing in order to halt a flow.</p>
|
||||
<p>The <b>Setup</b> tab contains code that will be run whenever the node is started.
|
||||
The <b>Close</b> tab contains code that will be run when the node is stopped.</p>
|
||||
<h3>Details</h3>
|
||||
<p>See the <a target="_blank" href="http://nodered.org/docs/writing-functions.html">online documentation</a>
|
||||
for more information on writing functions.</p>
|
||||
|
@@ -40,6 +40,8 @@
|
||||
progress will be cleared and no message triggered.</p>
|
||||
<p>The node can be configured to resend a message at a regular interval until it
|
||||
is reset by a received message.</p>
|
||||
<p>Optionally, the node can be configured to treat messages with <code>msg.topic</code> as if they
|
||||
are separate streams.</p>
|
||||
<p>Optionally, the node can be configured to treat messages as if they are separate streams,
|
||||
using a msg property to identify each stream. Default <code>msg.topic</code>.</p>
|
||||
<p>The status indicates the node is currently active. If multiple streams are used the status
|
||||
indicates the number of streams being held.</p>
|
||||
</script>
|
||||
|
@@ -37,6 +37,7 @@
|
||||
"stopped": "stopped",
|
||||
"failed": "Inject failed: __error__",
|
||||
"label": {
|
||||
"properties": "Properties",
|
||||
"repeat": "Repeat",
|
||||
"flow": "flow context",
|
||||
"global": "global context",
|
||||
@@ -51,7 +52,7 @@
|
||||
"string": "string",
|
||||
"boolean": "boolean",
|
||||
"number": "number",
|
||||
"Array": "Array",
|
||||
"Array": "array",
|
||||
"invalid": "Invalid JSON Object"
|
||||
},
|
||||
"timestamp": "timestamp",
|
||||
@@ -79,11 +80,11 @@
|
||||
"on": "on",
|
||||
"onstart": "Inject once after",
|
||||
"onceDelay": "seconds, then",
|
||||
"tip": "<b>Note:</b> \"interval between times\" and \"at a specific time\" will use cron.<br/>\"interval\" should be 596 hours or less.<br/>See info box for details.",
|
||||
"success": "Successfully injected: __label__",
|
||||
"errors": {
|
||||
"failed": "inject failed, see log for details",
|
||||
"toolong": "Interval too large"
|
||||
"toolong": "Interval too large",
|
||||
"invalid-expr": "Invalid JSONata expression: __error__"
|
||||
}
|
||||
},
|
||||
"catch": {
|
||||
@@ -117,10 +118,12 @@
|
||||
},
|
||||
"debug": {
|
||||
"output": "Output",
|
||||
"status": "status",
|
||||
"none": "None",
|
||||
"invalid-exp": "Invalid JSONata expression: __error__",
|
||||
"msgprop": "message property",
|
||||
"msgobj": "complete msg object",
|
||||
"autostatus": "automatic",
|
||||
"to": "To",
|
||||
"debtab": "debug tab",
|
||||
"tabcon": "debug tab and console",
|
||||
@@ -207,8 +210,14 @@
|
||||
"function": "",
|
||||
"label": {
|
||||
"function": "Function",
|
||||
"initialize": "Setup",
|
||||
"finalize": "Close",
|
||||
"outputs": "Outputs"
|
||||
},
|
||||
"text": {
|
||||
"initialize": "// Code added here will be run once\n// whenever the node is deployed.\n",
|
||||
"finalize": "// Code added here will be run when the\n// node is being stopped or re-deployed.\n"
|
||||
},
|
||||
"error": {
|
||||
"inputListener":"Cannot add listener to 'input' event within Function",
|
||||
"non-message-returned":"Function tried to send a message of type __type__"
|
||||
@@ -302,7 +311,7 @@
|
||||
"wait-for": "wait for",
|
||||
"wait-loop": "resend it every",
|
||||
"for": "Handling",
|
||||
"bytopics": "each msg.topic independently",
|
||||
"bytopics": "each",
|
||||
"alltopics": "all messages",
|
||||
"duration": {
|
||||
"ms": "Milliseconds",
|
||||
@@ -311,6 +320,7 @@
|
||||
"h": "Hours"
|
||||
},
|
||||
"extend": " extend delay if new message arrives",
|
||||
"second": " send second message to separate output",
|
||||
"label": {
|
||||
"trigger": "trigger",
|
||||
"trigger-block": "trigger & block",
|
||||
@@ -459,7 +469,7 @@
|
||||
"message": "entire message",
|
||||
"tip": {
|
||||
"path1": "By default, <code>payload</code> will contain the data to be sent over, or received from a websocket. The listener can be configured to send or receive the entire message object as a JSON formatted string.",
|
||||
"path2": "This path will be relative to ",
|
||||
"path2": "This path will be relative to <code>__path__</code>.",
|
||||
"url1": "URL should use ws:// or wss:// scheme and point to an existing websocket listener.",
|
||||
"url2": "By default, <code>payload</code> will contain the data to be sent over, or received from a websocket. The client can be configured to send or receive the entire message object as a JSON formatted string."
|
||||
},
|
||||
@@ -702,7 +712,9 @@
|
||||
"output": "Output",
|
||||
"includerow": "include column name row",
|
||||
"newline": "Newline",
|
||||
"usestrings": "parse numerical values"
|
||||
"usestrings": "parse numerical values",
|
||||
"include_empty_strings": "include empty strings",
|
||||
"include_null_values": "include null values"
|
||||
},
|
||||
"placeholder": {
|
||||
"columns": "comma-separated column names"
|
||||
@@ -725,9 +737,15 @@
|
||||
"mac": "Mac (\\r)",
|
||||
"windows": "Windows (\\r\\n)"
|
||||
},
|
||||
"hdrout": {
|
||||
"none": "never send column headers",
|
||||
"all": "always send column headers",
|
||||
"once": "send headers once, until msg.reset"
|
||||
},
|
||||
"errors": {
|
||||
"csv_js": "This node only handles CSV strings or js objects.",
|
||||
"obj_csv": "No columns template specified for object -> CSV."
|
||||
"obj_csv": "No columns template specified for object -> CSV.",
|
||||
"bad_csv": "Malformed CSV data - output probably corrupt."
|
||||
}
|
||||
},
|
||||
"html": {
|
||||
@@ -898,7 +916,8 @@
|
||||
"fixup": "Fix-up exp"
|
||||
},
|
||||
"errors": {
|
||||
"invalid-expr": "Invalid JSONata expression: __error__"
|
||||
"invalid-expr": "Invalid JSONata expression: __error__",
|
||||
"invalid-type": "Cannot join __error__ to buffer"
|
||||
}
|
||||
},
|
||||
"sort" : {
|
||||
|
@@ -41,5 +41,5 @@
|
||||
wait a fixed timeout from first reply and then return, sit and wait for data, or send then close the connection
|
||||
immediately, without waiting for a reply.</p>
|
||||
<p>The response will be output in <code>msg.payload</code> as a buffer, so you may want to .toString() it.</p>
|
||||
<p>If you leave tcp host or port blank they must be set by using the <code>msg.host</code> and <code>msg.port</code> properties.</p>
|
||||
<p>If you leave tcp host or port blank they must be set by using the <code>msg.host</code> and <code>msg.port</code> properties in every message sent to the node.</p>
|
||||
</script>
|
||||
|
@@ -38,8 +38,13 @@
|
||||
<p>The column template can contain an ordered list of column names. When converting CSV to an object, the column names
|
||||
will be used as the property names. Alternatively, the column names can be taken from the first row of the CSV.</p>
|
||||
<p>When converting to CSV, the column template is used to identify which properties to extract from the object and in what order.</p>
|
||||
<p>If the template is blank then the node can use a simple comma separated list of properties supplied in <code>msg.columns</code> to
|
||||
determine what to extract. If that is not present then all the object properties are ouput in the order in which they are found.</p>
|
||||
<p>If the input is an array then the columns template is only used to optionally generate a row of column titles.</p>
|
||||
<p>The node can accept a multi-part input as long as the <code>parts</code> property is set correctly.</p>
|
||||
<p>If 'parse numerical values' option is checked, string numerical values will be returned as numbers, ie. middle value '1,"1.5",2'.</p>
|
||||
<p>If 'include empty strings' option is checked, empty strings will be returned in result, ie. middle value '"1","",3'.</p>
|
||||
<p>If 'include null values' option is checked, null values will be returned in result, ie. middle value '"1",,3'.</p>
|
||||
<p>The node can accept a multi-part input as long as the <code>parts</code> property is set correctly, for example from a file-in node or split node.</p>
|
||||
<p>If outputting multiple messages they will have their <code>parts</code> property set and form a complete message sequence.</p>
|
||||
<p><b>Note:</b> the column template must be comma separated - even if a different separator is chosen for the data.</p>
|
||||
</script>
|
||||
|
@@ -20,6 +20,10 @@
|
||||
<dl class="message-properties">
|
||||
<dt>payload<span class="property-type">object | string</span></dt>
|
||||
<dd>A JavaScript object or XML string.</dd>
|
||||
<dt class="optional">options <span class="property-type">object</span></dt>
|
||||
<dd>This optional property can be used to pass in any of the options supported by the underlying
|
||||
library used to convert to and from XML. See <a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options" target="_blank">the xml2js docs</a>
|
||||
for more information.</dd>
|
||||
</dl>
|
||||
<h3>Outputs</h3>
|
||||
<dl class="message-properties">
|
||||
@@ -30,10 +34,6 @@
|
||||
<li>If the input is a JavaScript object it tries to build an XML string.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="optional">options <span class="property-type">object</span></dt>
|
||||
<dd>This optional property can be used to pass in any of the options supported by the underlying
|
||||
library used to convert to and from XML. See <a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options" target="_blank">the xml2js docs</a>
|
||||
for more information.</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
<p>When converting between XML and an object, any XML attributes are added as a property named <code>$</code> by default.
|
||||
|
@@ -91,7 +91,8 @@
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="optional">complete</dt>
|
||||
<dd>If set, the node will send its output message in its current state.</dd>
|
||||
<dd>If set, the node will append the payload, and then send the output message in its current state.
|
||||
If you don't wish to append the payload, delete it from the msg.</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
|
||||
|
@@ -39,4 +39,5 @@
|
||||
<p>This node will buffer messages internally in order to work across sequences. The
|
||||
runtime setting <code>nodeMessageBufferMaxLength</code> can be used to limit how many messages nodes
|
||||
will buffer.</p>
|
||||
<p>If a message is received with the <b>msg.reset</b> property set, the buffered messages are deleted and not sent.</p>
|
||||
</script>
|
||||
|
@@ -49,12 +49,6 @@
|
||||
<dd>The contents of the file as either a string or binary buffer.</dd>
|
||||
<dt class="optional">filename <span class="property-type">string</span></dt>
|
||||
<dd>If not configured in the node, this optional property sets the name of the file to be read.</dd>
|
||||
<dt class="optional">error <span class="property-type">object</span></dt>
|
||||
<dd><i>deprecated</i>: If enabled in the node, when the node hits an error
|
||||
reading the file, it will send a message with no <code>payload</code>
|
||||
and this <code>error</code> property set to the error details. This
|
||||
mode of behaviour is deprecated and not enabled by default for new
|
||||
instances of the node. See below for more information.</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
<p>The filename should be an absolute path, otherwise it will be relative to
|
||||
@@ -65,11 +59,5 @@
|
||||
<p>When split into multiple messages, each message will have a <code>parts</code>
|
||||
property set, forming a complete message sequence.</p>
|
||||
<p>Encoding of input data can be specified from list of encodings if output format is string.</p>
|
||||
<h4>Legacy error handling</h4>
|
||||
<p>Before Node-RED 0.17, if this node hit an error whilst reading the file, it would
|
||||
send a message with no <code>msg.payload</code> and <code>msg.error</code> set to the
|
||||
details of the error. This is a deprecated mode of behaviour for the node that new
|
||||
instances will not do. If required, this mode can be re-enabled within the node
|
||||
configuration.</p>
|
||||
<p>Errors should be caught and handled using a Catch node.</p>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user