add zn-CN translation for nodes: network, parsers, sequence

This commit is contained in:
JIYE YU
2020-01-31 11:10:04 +09:00
parent 6d3eb7bb4b
commit c03abdb5e7
16 changed files with 778 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="tls-config">
<p>TLS连接的配置选项</p>
</script>

View File

@@ -0,0 +1,22 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="http proxy">
<p>HTTP代理的配置选项</p>
<h3>详细</h3>
<p>访问代理例外列表中的主机时将不使用任何代理</p>
</script>

View File

@@ -0,0 +1,71 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="mqtt in">
<p>连接到MQTT代理并订阅来自指定主题的消息</p>
<h3>输出</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">字符串 | buffer</span></dt>
<dd>如果不是二进制buffer的话就是字符串</dd>
<dt>topic <span class="property-type">字符串</span></dt>
<dd>MQTT主题使用<code>/</code></dd>
<dt>qos <span class="property-type">数值</span> </dt>
<dd>QoS服务质量0, 最多一次 1, 最少一次 2, 只一次</dd>
<dt>retain <span class="property-type">布尔值</span></dt>
<dd>值为true时表示消息已保留且可能是旧的</dd>
</dl>
<h3>详细</h3>
<p>订阅主题可以包括MQTT通配符+一个级别多个级别</p>
<p>使用该节点您首先需要建立与MQTT代理的连接通过单击铅笔图标来进行配置</p>
<p>如有需要几个MQTT节点输入或输出可以共享相同的代理连接</p>
</script>
<script type="text/x-red" data-help-name="mqtt out">
<p>连接到MQTT代理并发布消息</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">字符串 | buffer</span></dt>
<dd>要发布的有效负载如果未设置此属性则不会发送任何消息要发送空白消息请将此属性设置为空字符串</dd>
<dt class="optional">topic <span class="property-type">字符串</span></dt>
<dd>要发布的MQTT主题</dd>
<dt class="optional">qos <span class="property-type">number</span></dt>
<dd>QoS服务质量0, 最多一次 1, 最少一次 2, 只一次默认值为0</dd>
<dt class="optional">retain <span class="property-type">布尔值</span></dt>
<dd>设置为<code>true</code><code>false</code></dd>
</dl>
<h3>详细</h3>
<p><code>msg.payload</code>ObjectJSONbuffer</p>
<p>可以在节点中配置所使用的主题或者如果留为空白则可以通过<code>msg.topic</code></p>
<p>同样可以在节点中配置QoS和保留值或者如果保留空白则分别由<code>msg.qos</code><code>msg.retain</code></p>
<p>该节点需要与要配置的MQTT代理的连接通过单击铅笔图标进行配置</p>
<p>如果需要几个MQTT节点输入或输出可以共享相同的代理连接</p>
</script>
<script type="text/x-red" data-help-name="mqtt-broker">
<p>与MQTT代理的连接设置</p>
<p>创建与代理的连接设置可以在<code>MQTT In</code><code>MQTT Out</code></p>
<p>如果未为该节点设置客户端ID并且设置了会话初始化则将生成一个随机客户端ID设置客户端ID时请确保它对于连接目标处的代理是唯一的</p>
<h4>Birth Message</h4>
<p>建立连接后发布在以配置主题中的消息</p>
<h4>Close Message</h4>
<p>在连接正常结束之前重新部署或者关闭了节点时发布在以配置主题中的消息</p>
<h4>Will Message</h4>
<p>当节点意外丢失连接时由代理发布的消息</p>
<h4>WebSockets</h4>
<p>可以将节点配置成使用WebSocket连接使用WebSocket时请在服务器字段中以完整格式描述连接目标的URI 例如</p>
<pre>ws://example.com:4000/mqtt</pre>
</script>

View File

@@ -0,0 +1,81 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="http in">
<p>创建用于创建Web服务的HTTP端点</p>
<h3>输出</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>GET请求包含任何查询字符串参数的对象或者包含HTTP请求正文</dd>
<dt>req<span class="property-type">object</span></dt>
<dd>HTTP请求对象该对象包含有关请求信息的多个属性
<ul>
<li><code>body</code> - </li>
<li><code>headers</code> - HTTP</li>
<li><code>query</code> - </li>
<li><code>params</code> - </li>
<li><code>cookies</code> - cookie</li>
<li><code>files</code> - </li>
</ul>
</dd>
<dt>res<span class="property-type">object</span></dt>
<dd>HTTP响应对象此属性不应直接使用<code>HTTP Response</code></dd>
</dl>
<h3>详细</h3>
<p>节点将在配置的路径上监听特定类型的请求路径可以完全指定例如<code>/user</code><code>/user/:name</code> 使<code>msg.req.params</code>访</p>
<p>对于包含正文的请求例如POST或PUT请求的内容将作为<code>msg.payload</code></p>
<p>如果可以确定请求的内容类型则正文将被解析为任何适当的类型例如<code>application/json</code>JavaScript</p>
<p><b>注意</b>HTTP</p>
</script>
<script type="text/x-red" data-help-name="http response">
<p>将响应发送回从HTTP输入节点接收的请求</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>响应的正文</dd>
<dt class="optional">statusCode <span class="property-type">数值</span></dt>
<dd>如果设置则用作响应状态代码默认值200</dd>
<dt class="optional">headers <span class="property-type">object</span></dt>
<dd>如果设置则提供HTTP头以包含在响应中</dd>
<dt class="optional">cookies <span class="property-type">object</span></dt>
<dd>如果设置则可用于设置或删除cookie</dd>
</dl>
<h3>详细</h3>
<p>还可以在节点本身内设置<code>statusCode</code><code>headers</code>message</p>
<h4>Cookie处理</h4>
<p><code>cookies</code>/使cookieoptions<p>
<p>下面的示例设置两个cookie-一个名为<code>name</code><code>nick</code><code>session</code><code>1234</code>15</p>
<pre>
msg.cookies = {
name: 'nick',
session: {
value: '1234',
maxAge: 900000
}
}</pre>
<p>有效选项包括</p>
<ul>
<li><code>domain</code> - () Cookie</li>
<li><code>expires</code> - () GMT0cookie</li>
<li><code>maxAge</code> - () </li>
<li><code>path</code> - (字符串) Cookie的路径。默认为/</li>
<li><code>value</code> - () Cookie使</li>
</ul>
<p>要删除Cookie请将其<code>value</code><code>null</code></p>
</script>

View File

@@ -0,0 +1,78 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="http request">
<p>发送HTTP请求并返回响应</p>
<h3>输入</h3>
<dl class="message-properties">
<dt class="optional">url <span class="property-type">字符串</span></dt>
<dd>如果未在节点中配置则此可选属性设置请求的url</dd>
<dt class="optional">method <span class="property-type">字符串</span></dt>
<dd>如果未在节点中配置则此可选属性设置请求的HTTP方法必须是<code>GET</code>,<code>PUT</code>,<code>POST</code>,<code>PATCH</code><code>DELETE</code></dd>
<dt class="optional">headers <span class="property-type">object</span></dt>
<dd>设置请求的HTTP头</dd>
<dt class="optional">cookies <span class="property-type">object</span></dt>
<dd>如果设置则可用于发送带有请求的cookie</dd>
<dt class="optional">payload</dt>
<dd>发送为请求的正文</dd>
<dt class="optional">rejectUnauthorized</dt>
<dd>如果设置为<code>false</code>使https</dd>
<dt class="optional">followRedirects</dt>
<dd>如果设置为<code>false</code>HTTP 301<code>true</code></dd>
<dt class="optional">requestTimeout</dt>
<dd>如果设置为正数毫秒将覆盖全局设置的<code>httpRequestTimeout</code></dd>
</dl>
<h3>输出</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">字符串 | object | buffer</span></dt>
<dd>响应的正文可以将节点配置为以字符串形式返回主体尝试将其解析为JSON字符串或将其保留为二进制buffer</dd>
<dt>statusCode <span class="property-type">数值</span></dt>
<dd>响应的状态码如果请求无法完成则返回错误码</dd>
<dt>headers <span class="property-type">object</span></dt>
<dd>包含响应头的对象</dd>
<dt>responseUrl <span class="property-type">字符串</span></dt>
<dd>如果在处理请求时发生任何重定向则此属性为最终重定向的URL否则则为原始请求的URL</dd>
<dt>responseCookies <span class="property-type">object</span></dt>
<dd>如果响应包含cookie则此属性是每个cookie的名称/键值对的对象</dd>
<dt>redirectList <span class="property-type">数组</span></dt>
<dd>如果请求被重定向了一次或多次则累积的信息将被添加到此属性location是下一个重定向目标cookie是从重定向源返回的cookie</dd>
</dl>
<h3>详细</h3>
<p>在节点内配置后URL属性可以包含<a href="http://mustache.github.io/mustache.5.html" target="_blank">mustache样式</a>标签。 这些标签允许使用传入消息的值来构造url。例如如果url设置为<code>example.com/{{{{topic}}}</code><code>msg.topic</code>使{{{...}}}mustache/ &</p>
<p>节点可以选择自动将<code>msg.payload</code>GET<code>msg.payload</code></p>
<p><b>注意</b>使<code>http_proxy=...</code>Node-RED使</p>
<h4>使用多个HTTP请求节点</h4>
<p>为了在一个流程中多次使用该节点必须要注意<code>msg.headers</code>使<code>msg.headers</code><code>msg.headers</code><code>{}</code></p>
<h4>Cookie处理</h4>
<p>传递给节点的<code>cookies</code>/cookie<code>value</code></p>
<p>请求返回的所有cookie都将在<code>responseCookies</code></p>
<h4>内容类型处理</h4>
<p>如果<code>msg.payload</code><code>application/json</code></p>
<p>要将请求编码为表单数据应将<code>msg.headers[content-type]</code><code>application/x-www-form-urlencoded</code></p>
<h4>文件上传</h4>
<p>要执行文件上传应将<code>msg.headers["content-type"]</code><code>multipart/form-data</code><code>msg.payload</code></p>
<pre><code>{
"KEY": {
"value": FILE_CONTENTS,
"options": {
"filename": "FILENAME"
}
}
}</code></pre>
<p><code>KEY</code>,<code>FILE_CONTENTS</code><code>FILENAME</code></p>
</script>

View File

@@ -0,0 +1,35 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="websocket in">
<p>WebSocket输入节点</p>
<p>默认情况下从WebSocket接收的数据将位于<code>msg.payload</code>JSONJSON</p>
</script>
<script type="text/x-red" data-help-name="websocket out">
<p>WebSocket输出节点</p>
<p>默认情况下<code>msg.payload</code>WebSocket<code>msg</code>JSONWebSocket</p>
<p>如果到达此节点的消息是从WebSocket In节点开始的则该消息将发送回触发流程的客户端否则消息将广播给所有连接的客户端</p>
<p>如果要广播从WebSocket输入节点开始的消息则可以应该删除流中的<code>msg._session</code></p>
</script>
<script type="text/x-red" data-help-name="websocket-listener">
<p>此配置节点使用指定的路径创建WebSocket服务器端点</p>
</script>
<script type="text/x-red" data-help-name="websocket-client">
<p>此配置节点将WebSocket客户端连接到指定的URL</p>
</script>

View File

@@ -0,0 +1,35 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="tcp in">
<p>提供TCP输入选择可以连接到远程TCP端口或接受传入连接</p>
<p><b>注意</b>root访1024</p>
</script>
<script type="text/x-red" data-help-name="tcp out">
<p>提供TCP输出的选择可以连接到远程TCP端口接受传入的连接或回复从TCP In节点收到的消息</p>
<p>仅发送<code>msg.payload</code></p>
<p>如果<code>msg.payload</code>Base64Base64</p>
<p>如果不存在<code>msg._session</code><b></b></p>
<p><b>注意</b>root访1024</p>
</script>
<script type="text/x-red" data-help-name="tcp request">
<p>一个简单的TCP请求节点<code>msg.payload</code>tcp</p>
<p>连接到服务器发送请求并接收响应 可以从固定数量的字符与指定字符匹配的字符中选择操作从第一个答复到达起等待指定的时间等待数据到达发送数据并立即取消连接而无需等待答复等操作中进行选择</p>
<p>响应将在<code>msg.payload</code>buffer<code>.toString()</code></p>
<p>如果将tcp主机或端口留空则必须使用<code>msg.host</code><code>msg.port</code></p>
</script>

View File

@@ -0,0 +1,28 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="udp in">
<p>UDP输入节点<code>msg.payload</code>BufferBase64</p>
<p><code>msg.ip</code><code>msg.port</code>IP</p>
<p><b>注意</b>root使1024广</p>
</script>
<script type="text/x-red" data-help-name="udp out">
<p>该节点将<code>msg.payload</code>UDP</p>
<p>您也可以使用<code>msg.ip</code><code>msg.port</code></p>
<p>如果选择广播则将地址设置为本地广播IP地址或者也可以尝试使用全局广播地址255.255.255.255</p>
<p><b>注意</b>root使1024广</p>
</script>

View File

@@ -0,0 +1,43 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="csv">
<p>在CSV格式的字符串及其JavaScript对象表示形式之间进行相互转换</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 数组 | 字符串</span></dt>
<dd>JavaScript对象数组或CSV字符串</dd>
</dl>
<h3>输出</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 数组 | 字符串</span></dt>
<dd>
<ul>
<li>如果输入是字符串它将尝试将其解析为CSV并为每行创建键/值对的JavaScript对象然后该节点将为每行发送一条消息或者发送一条包含对象数组的消息</li>
<li>如果输入是JavaScript对象它将尝试构建CSV字符串</li>
<li>如果输入是简单值的数组则将构建单行CSV字符串</li>
<li>如果输入是数组数组或对象数组则会创建多行CSV字符串</li>
</ul>
</dd>
</dl>
<h3>详细</h3>
<p>列模板可以包含列名称的有序列表将CSV转换为对象时列名将用作属性名称或者也可以从CSV的第一行中获取列名称</p>
<p>转换为CSV时列模板用于标识从对象中提取的属性以及提取的顺序</p>
<p>如果输入是数组则列模板仅用于有选择地生成一行列标题</p>
<p>只要正确设置<code>parts</code></p>
<p>如果输出多个消息则将设置其<code>parts</code></p>
<p><b>注意</b>使</p>
</script>

View File

@@ -0,0 +1,33 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="html">
<p>使用CSS选择器从<code>msg.payload</code>html</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">字符串</span></dt>
<dd>从中提取元素的html字符串</dd>
<dt class="optional">select <span class="property-type">字符串</span></dt>
<dd>如果未在编辑面板中配置则可以将选择器设置为msg的属性</dd>
</dl>
<h3>Output</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">数组 | 字符串</span></dt>
<dd>结果可以是有效载荷中包含匹配元素的数组的单个消息也可以是多条消息每条消息都包含匹配元素发送多条消息时需要为消息设置<code>parts</code></dd>
</dl>
<h3>详细</h3>
<p>该节点支持CSS和jQuery选择器的组合查看<a href="https://github.com/fb55/CSSselect#user-content-supported-selectors" target="_blank">css-select documentation</a> </p>
</script>

View File

@@ -0,0 +1,43 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="json">
<p>在JSON字符串及其JavaScript对象表示形式之间相互转换</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>JavaScript对象或JSON字符串</dd>
<dt>schema<span class="property-type">object</span></dt>
<dd>可选的JSON Schema对象用于验证有效负载在将<code>msg</code></dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>
<ul>
<li>如果输入是JSON字符串它将尝试将其解析为JavaScript对象</li>
<li>如果输入是JavaScript对象它将创建一个JSON字符串并可以选择对此JSON字符串进行整形</li>
</ul>
</dd>
<dt>schemaError<span class="property-type">数组</span></dt>
<dd>如果JSON模式验证失败则catch节点将具有包含错误数组的<code>schemaError</code></dd>
</dl>
<h3>详细</h3>
<p>默认的转换目标是<code>msg.payload</code></p>
<p>您可以将其设置为仅执行特定的转换而不是自动选择双向转换例如即使对<code>HTTP In</code>content-type使JSONJavaScript</p>
<p>如果指定了转换为JSON字符串则不会对收到的字符串进行进一步的检查也就是说即使指定了格式化选项它也不会检查字符串是否正确为JSON或对JSON执行整形</p>
<p>有关JSON模式的更多详细信息请查阅<a href="http://json-schema.org/latest/json-schema-validation.html">规范</a>.</p>
</script>

View File

@@ -0,0 +1,48 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="xml">
<p>在XML字符串及其JavaScript对象表示形式之间进行相互转换</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>JavaScript对象或XML字符串</dd>
</dl>
<h3>输出</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>
<ul>
<li>如果输入是字符串它将尝试将其解析为XML并创建一个JavaScript对象</li>
<li>如果输入是JavaScript对象它将尝试构建XML字符串</li>
</ul>
</dd>
<dt class="optional">options <span class="property-type">object</span></dt>
<dd>可以将选项传递给内部使用的XML转换库请参见<a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options" target="_blank"> xml2js文档</a> </dd>
</dl>
<h3>详细</h3>
<p>在XML和对象之间进行转换时默认情况下XML属性会添加到名为<code>$</code><code>_</code></p>
<p>例如将如下所示转换以下XML</p>
<pre>&lt;p class="tag"&gt;Hello World&lt;/p&gt;</pre>
<pre>{
"p": {
"$": {
"class": "tag"
},
"_": "Hello World"
}
}</pre>
</script>

View File

@@ -0,0 +1,34 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="yaml">
<p>在YAML格式的字符串及其JavaScript对象表示形式之间相互转换</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>JavaScript对象或YAML字符串</dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串</span></dt>
<dd>
<ul>
<li>如果输入是YAML字符串它将尝试将其解析为JavaScript对象</li>
<li>如果输入是JavaScript对象它将创建一个YAML字符串</li>
</ul>
</dd>
</dl>
</script>

View File

@@ -0,0 +1,133 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="split">
<p>将一条消息拆分为一系列消息</p>
<h3>输入</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object | 字符串 | 数组 | buffer</span></dt>
<dd>节点的行为由<code>msg.payload</code>:
<ul>
<li><b>字符串</b>/<b>buffer</b> - 使<code>\n</code></li>
<li><b>数组</b> - </li>
<li><b>object</b> - /</li>
</ul>
</dd>
</dl>
<h3>输出</h3>
<dl class="message-properties">
<dt>parts<span class="property-type">object</span></dt>
<dd>此属性包含有关如何将消息与原始消息分开的信息如果传递给<b>join</b>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
<li><code>type</code> - -///buffer</li>
<li><code>ch</code> - buffer</li>
<li><code>key</code> - <code>msg.topic</code></li>
<li><code>len</code> - 使</li>
</ul>
</dd>
</dl>
<h3>详细</h3>
<p>在使用<b>join</b>使</p>
<p>它使用<code>msg.parts</code></p>
<h4>流媒体模式</h4>
<p>该节点还可以用于重排消息流例如发送换行符终止命令的串行设备可能会传递一条消息并在其末尾带有部分命令 流模式此节点将拆分一条消息并发送每个完整的段如果末尾有部分片段则该节点将保留该片段并将其添加到收到的下一条消息之前</p>
<p>在此模式下运行时该节点将不会设置<code>msg.parts.count</code><b>join</b>使</p>
</script>
<script type="text/x-red" data-help-name="join">
<p>将消息序列合并为一条消息.</p>
<p>共有三种模式</p>
<dl>
<dt>自动模式</dt>
<dd><b>split</b></dd>
<dt>手动模式</dt>
<dd>手动地以各种方式合并消息序列</dd>
<dt>列聚合模式</dt>
<dd>对消息列中的所有消息应用表达式以将其简化为单个消息</dd>
</dl>
<h3>输入</h3>
<dl class="message-properties">
<dt class="optional">parts<span class="property-type">object</span></dt>
<dd>使用自动模式时所有的消息都应包含此属性<b>split</b>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
<li><code>type</code> - -///buffer</li>
<li><code>ch</code> - buffer</li>
<li><code>key</code> - <code>msg.topic</code>/li>
<li><code>len</code> - 使</li>
</ul>
</dd>
<dt class="optional">complete</dt>
<dd>如果设置则节点将以其当前状态发送其输出消息</dd>
</dl>
<h3>详细</h3>
<h4>自动模式</h4>
<p>自动模式使用传入消息的<code>parts</code>使<b>split</b></p>
<h4>手动模式</h4>
<p>设置为以手动模式时该节点能以各种不同的方法来处理消息</p>
<ul>
<li><b>字符串</b><b></b>-</li>
<li><b>数组</b> - </li>
<li><b>/值对象</b> - 使</li>
<li><b>merged object</b> - </li>
</ul>
<p>输出消息的其他属性都取自发送结果前的最后一条消息</p>
<p>可以用<i>计数</i></p>
<p>可以用<i>超时</i></p>
<p>如果收到设置了<b>msg.complete</b></p>
<p>如果收到设置了<b>msg.reset</b></p>
<h4>列聚合模式</h4>
<p>选择列聚合模式时将表达式应用于组成消息列的每条消息并使用聚合值组成一条消息</p>
<dl class="message-properties">
<dt>初始值</dt>
<dd>累积值的初始值(<code>$A</code>)</dd>
<dt>聚合表达式</dt>
<dd>序列中的每个消息调用的JSONata表达式结果将作为累加值传递到表达式的下一个调用在表达式中可以使用以下特殊变量
<ul>
<li><code>$A</code>: </li>
<li><code>$I</code>: </li>
<li><code>$N</code>: </li>
</ul>
</dd>
<dt>最终调整式子</dt>
<dd>可选的JSONata表达式在将聚合表达式应用于序列中的所有消息之后应用在表达式中可以使用以下特殊变量
<ul>
<li><code>$A</code>: </li>
<li><code>$N</code>: </li>
</ul>
</dd>
<p>默认情况下按顺序从序列的第一条消息到最后一条消息应用聚合表达式也可以选择以相反的顺序应用聚合表达式</p>
</dl>
<p><b>例子</b>
<ul>
<li><b>聚合表达式</b>: <code>$A+payload</code></li>
<li><b>初始值</b>: <code>0</code></li>
<li><b>最终调整式</b>: <code>$A/$N</code></li>
</ul>
</p>
<h4>储存讯息</h4>
<p>该节点将在内部缓存消息以便跨序列工作运行时设置<code>nodeMessageBufferMaxLength</code></p>
</script>

View File

@@ -0,0 +1,41 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="sort">
<p>对消息属性或消息序列进行排序的函数</p>
<p>当配置为对消息属性进行排序时节点将对指定消息属性所指向的数组数据进行排序</p>
<p>当配置为对消息序列排序时它将对消息重新排序</p>
<p>排序顺序可以是</p>
<ul>
<li><b>升序</b></li>
<li><b>降序</b></li>
</ul>
<p>对于数字可以通过复选框指定数字顺序</p>
<p>排序键可以是元素值也可以是JSONata表达式来对属性值进行排序还可以是message属性或JSONata表达式来对消息序列进行排序<p>
<p>在对消息序列进行排序时排序节点依赖于接收到的消息来设置<code>msg.parts</code></p>
<p>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
</ul>
</p>
<p><b>注意</b>使
<ul>
<li><code>nodeMessageBufferMaxLength</code><b>settings.js</b></li>
</ul>
</p>
</script>

View File

@@ -0,0 +1,34 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="batch">
<p>根据各种规则创建消息序列</p>
<h3>详细</h3>
<p>有三种创建消息序列的模式</p>
<dl>
<dt>讯息数</dt>
<dd>将消息分组为给定长度的序列 <b>overlap</b></dd>
<dt>时间间隔</dt>
<dd>对在指定时间间隔内到达的邮件进行分组如果在该时间间隔内没有消息到达则该节点可以选择发送空消息</dd>
<dt>串联序列</dt>
<dd>通过串联输入序列来创建消息序列每条消息必须具有<code>msg.topic</code><code>msg.parts</code><code>topic</code>
</dd>
</dl>
<h4>储存讯息</h4>
<p>该节点将在内部缓冲消息以便跨序列工作运行时设置<code>nodeMessageBufferMaxLength</code></p>
</script>