Reorganise nodes into new categories

This commit is contained in:
Nick O'Leary
2019-07-09 23:32:22 +01:00
parent 2b66723d42
commit da6db24f9e
148 changed files with 36 additions and 37 deletions

View File

@@ -0,0 +1,51 @@
<!--
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="function">
<p>수신 메시지에 대해서 처리를 실시하는 JavaScript코드(함수의 본체) 정의합니다.</p>
<p>입력 메시지는 <code>msg</code> JavaScript .</p>
<p><code>msg</code><code>msg.payload</code> .</p>
<p>보통 코드는 메시지 오브젝트(혹은 여러 메시지 객체) 반환합니다.후속 플로우의 실행을 정지하고 싶은 경우에는, 오브젝트를 반환하지 않아도 상관없습니다.</p>
<h3>상세</h3>
<p>코드 쓰는 방식에 대한 자세한 내용은, <a target="_blank" href="http://nodered.org/docs/writing-functions.html">공식 홈페이지</a> .</p>
<h4>메세지 송신</h4>
<p>플로우 내의 다음 노드에 메세지를 전달하기 위해서는, 메세지를 반환하거나, <code>node.send(messages)</code> .</p>
<p>반환/send 대상은 다음과 같습니다:</p>
<ul>
<li>단일 메세지 오브젝트 - 출력에 접속된 노드에 전해집니다</li>
<li>메세지 오브젝트의 배열 - 대응하는 출력에 접속된 노드에 전해집니다</li>
</ul>
<p>배열요소가 배열인 경우에는, 복수의 메세지에 대응하는 출력에 송출합니다.</p>
<p>반환방법이 단일값인지 배열오소인지 상관없이, 반환값이 null인 경우 메세지를 송출하지 않습니다.</p>
<h4>로그 출력과 에러처리</h4>
<p>로그 정보의 출력, 에러출력을 실행하려면 아래의 함수를 이용합니다:</p>
<ul>
<li><code>node.log("로그메세지")</code></li>
<li><code>node.warn("경고")</code></li>
<li><code>node.error("에러")</code></li>
</ul>
</p>
<p>catch노드를 이용하여 에러를 처리할 있습니다. catch노드로 처리하기 위해서는, <code>msg</code> <code>node.error</code> 2 :</p>
<pre>node.error("에러",msg);</pre>
<h4>노드 정보 참조</h4>
<p>코드안에서 노드의 ID및 이름을 아래의 프로퍼티로 참조할 있습니다:</p>
<ul>
<li><code>node.id</code> - ID</li>
<li><code>node.name</code> - </li>
</ul>
<h4>환경변수의 이용</h4>
<p>환경변수는 <code>env.get("MY_ENV_VAR")</code> .</p>
</script>

View File

@@ -0,0 +1,39 @@
<!--
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="switch">
<p>프로퍼티 값에 의해 메세지를 분류합니다.</p>
<h3>상세</h3>
<p>수신한 메세지에 대해, 지정된 룰을 순서대로 평가하여 매치된 룰에 대응하는 출력포트에 메세지를 송출합니다.</p>
<p>처음에 룰이 매치된 시점에서 평가를 멈추는 것도 가능합니다.</p>
<p>평가 룰에는, 메세지 프로퍼티, 플로우/글로벌 컨텍스트 프로퍼티, JSONata식의 평가결과를 이용할 있습니다.</p>
<h4></h4>
<p>분류 룰은 아래의 4개로 나뉩니다.</p>
<ol>
<li><b>(value)</b> - </li>
<li><b>(sequence)</b> - ( split )</li>
<li><b>JSONata식</b> - , true </li>
<li><b> </b> - </li>
</ol>
<h4>주석</h4>
<p><code>is true/false</code> <code>is null</code> , . .</p>
<p><code>is empty</code> , 0 /// . <code>null</code> <code>undefined</code> .</p>
<h4>메세지 열의 취급</h4>
<p>switch노드는 입력메세지 열에 관한 정보를 유지하는 <code>msg.parts</code> .</p>
<p>'<b>메세지 열의 보정</b>' 옵션을 지정하면, 매치한 룰에 대해 새로운 메세지를 생성합니다. 모드에서는, switch노드는 새로운 메세지열을 송신하기 전에, 입력메세지를 내부에 축적합니다. <b>settings.js</b> <code>nodeMessageBufferMaxLength</code> , .</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="change">
<p>메세지, 플로우컨텍스트, 글로벌컨텍스트의 프로퍼티를 변경, 삭제, 이동합니다.</p>
<p>룰을 여러개 지정한 경우, 정의된 순으로 적용됩니다.</p>
<h3>상세</h3>
<p>이용가능한 처리</p>
<dl class="message-properties">
<dt>대입</dt>
<dd>프로퍼티를 셋팅합니다. 설정값에는, 다양한 타입의 , 메세지나 컨텍스트의 기존 프로퍼티를 이용할 있습니다.<dd>
<dt>치환</dt>
<dd>프로퍼티에 대해 검색과 치환을 수행합니다. 정규표현을 지정한 경우, '치환 후의 문자열'에는 <code>$1</code> . , .</dd>
<dt>삭제</dt>
<dd>프로퍼티를 삭제합니다.</dd>
<dt>이동</dt>
<dd>프로퍼티의 이동 또는 이름변경을 수행합니다.</dd>
</dl>
<p>'JSONata식'에는 <a href="http://jsonata.org/" target="_new">JSONata</a> .</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="range">
<p>수치를 다른 범위 값으로 변환합니다.</p>
<h3>입력</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">수치</span></dt>
<dd>수치를 지정합니다. 수치이외를 지정한 경우에는, 수치로 변환합니다. 변환할 없는 경우에는 에러가 발생합니다.</dd>
</dl>
<h3>출력</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">수치</span></dt>
<dd>새로운 범위로 변환한 결과 .</dd>
</dl>
<h3>상세</h3>
<p> 노드는 받은 수치를 선형스케일링 합니다. 기본값으로는, 결과 값은 노드에 설정한 범위내로 한정하지 않습니다.</p>
<p>'<i>입력값의 범위외의 값을 최소값/최대값으로 확대/축소</i>' 지정하면, 값이 지정된 범위 밖의 값으로 변하지 않도록 합니다.</p>
<p>'<i>입력값의 범위외의 값을 범위폭으로 나눈 나머지로 해서 확대/축소</i>' 지정하면, 결과를 범위폭으로 나눕니다.</p>
</script>

View File

@@ -0,0 +1,49 @@
<!--
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="template">
<p>템플릿에 기초하여 프로퍼티를 설정합니다.</p>
<h3>입력</h3>
<dl class="message-properties">
<dt>msg <span class="property-type">오브젝트</span></dt>
<dd>템플릿을 생성하기 위한 정보를 포함한 메세지 오브젝트</dd>
<dt class="optional">template <span class="property-type">문자열</span></dt>
<dd><code>msg.payload</code> 릿. 릿 , .</dd>
</dl>
<h3>출력</h3>
<dl class="message-properties">
<dt>msg <span class="property-type">오브젝트</span></dt>
<dd>지정한 템플릿과 입력메세지의 프로퍼티로 생성된 값을 설정한 메세지</dd>
</dl>
<h3>상세</h3>
<p> 노드는 <i><a href="http://mustache.github.io/mustache.5.html" target="_blank">mustache</a></i>형식을 기본값으로 이용하지만, 사용하지 않도록 설정할 수도 있습니다.</p>
<p>예를 들면,
<pre>안녕하세요, {{payload.name}}. 오늘은 {{date}}입니다.</pre>
<p>라는 템플릿에 대해,
<pre>{
date: "월요일"
payload: {
name: "홍길동",
}
}</pre>
<p>이라는 메세지를 수신한 경우,</p>
<pre>안녕하세요, 홍길동씨. 오늘은 월요일입니다.</pre>
<p>라는 프로퍼티가 생성됩니다.</p>
<p>플로우 컨텍스트 혹은 글로벌 컨텍스트의 프로퍼티값을 사용할 수도 있습니다. 각각, <code>{{flow.이름}}</code> <code>{{global.}}</code> . , (<code>store</code>) , <code>{{flow[store].}}</code>
<code>{{global[store].이름}}</code> .
</p>
<p><b>: </b>기본값으로는, <i>mustache</i>형식은 치환대상인 HTML요소를 이스케이프합니다. 이것을 방지하기 위해서는 <code>{{{3}}}</code> .</p>
</script>

View File

@@ -0,0 +1,30 @@
<!--
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="delay">
<p>노드를 통과하는 메세지를 지연, 혹은 유량을 제한합니다.</p>
<h3>입력</h3>
<dl class="message-properties">
<dt class="optional">delay <span class="property-type">수치</span></dt>
<dd>메세지의 지연시간을 밀리초 단위로 설정합니다. 이것은 노드 설정에서 기본값의 지연시간을 덮어쓸 있도록 노드를 설정한 경우에만 적용됩니다.</dd>
<dt class="optional">reset</dt>
<dd>수신메세지에서 프로퍼티를 임의의 값으로 설정하면, 노드가 유지하는 모든 미송신 메세지를 클리어합니다.</dd>
</dl>
<h3>상세</h3>
<p>메세지를 지연시키도록 설정한 경우, 지연시간은 고정값, 범위내의 난수값, 메세지 마다의 동적인 지정값 하나를 지정할 있습니다.</p>
<p>유량을 제한할 경우, 메세지는 지정된 시간간격내에 분산되어 송신합니다. 큐에 남은 메세지 수는 노드의 스테이터스에 표시됩니다. 받은 중간 메세지를 파기할 수도 있습니다.</p>
<p>유량제한은 모든 메세지에 적용할 수도, <code>msg.topic</code> . , . , .</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="trigger">
<p>메세지를 송신하면, 다른 메세지를 송신합니다. 지연 혹은 초기화가 지정되있지 않은 경우에는, 다음 2번째 메세지를 송신할 있습니다.</p>
<h3>입력</h3>
<dl class="message-properties">
<dt class="optional">reset</dt>
<dd> 프로퍼티를 갖는 메세지를 받으면, 준비중인 대기나 반복을 클리어하여 메세지 송신은 실행되지 않습니다.</dd>
</dl>
<h3>상세</h3>
<p>플로우 내에서 타임아웃을 작성하는데 이용합니다. 메세지를 받으면 기본값으로는 <code>payload</code> <code>1</code> . 250ms <code>payload</code> <code>0</code> 2 . , Raspberry Pi GPIO LED .</p>
<p> 송신메세지의 페이로드는 다양한 종류의 값으로 설정할 있습니다. 재송신 데이터없음으로 하는 것도 가능합니다. 예를 들면, 재송신 데이터를 '<i>없음</i>'으로 하고, 메세지를 받았을 때에 지연을 연장하는 것으로 선택한 경우, trigger노드는 감시타이머로써 작동합니다. , 지정한 간격내에 메세지를 수신하지 않은 경우에 메세지를 송신합니다.</p>
<p>페이로드에 <i>문자열</i> , mustache 릿 .</p>
<p><code>reset</code> , <code>payload</code> , .</p>
<p>수신메세지에서 리셋할 때까지 일정간격으로 메세지를 재송신하도록 지정할 수도 있습니다.</p>
<p><code>msg.topic</code> .</p>
</script>

View File

@@ -0,0 +1,74 @@
<!--
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="exec">
<p>시스템 커맨드를 실행하여 출력을 반환합니다.</p>
<p>커맨드 완료까지 기다릴지, 커맨드가 출력을 실행할 마다 메세지를 출력할지 지정할 있습니다.</p>
<p>실행대상의 커맨드는, 노드의 설정 혹은 수신메세지에서 지정합니다.</p>
<h3>입력</h3>
<dl class="message-properties">
<dt class="optional">payload <span class="property-type">문자열</span></dt>
<dd>실행할 커맨의 마지막에 추가하도록 설정할 있습니다</dd>
<dt class="optional">kill <span class="property-type">문자열</span></dt>
<dd>exec노드의 프로세스에 보낼 시그널 종류를 지정합니다</dd>
<dt class="optional">pid <span class="property-type">수치|문자열</span></dt>
<dd>시그널 송신대상의 exec노드의 프로세스 ID를 지정합니다</dd>
</dl>
<h3>출력</h3>
<ol class="node-ports">
<li>표준출력(stdout)
<dl class="message-properties">
<dt>payload <span class="property-type">문자열</span></dt>
<dd>커맨드의 표준출력</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">문자열</span></dt>
<dd>반환코드 문자열(3번째 단자에서도 취득가능) 복사(exec모드에서 )</dd>
</dl>
</li>
<li>표준에러 출력(stderr)
<dl class="message-properties">
<dt>payload <span class="property-type">문자열</span></dt>
<dd>커맨드의 표준에러 출력</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">문자열</span></dt>
<dd>반환코드 문자열(3번째 단자에서도 취득가능) 복사(exec모드에서 )</dd>
</dl>
</li>
<li>반환코드(return code)
<dl class="message-properties">
<dt>payload <span class="property-type">오브젝트</span></dt>
<dd>리턴코드, <code>message</code>, <code>signal</code> (<code>message</code>, <code>signal</code> )</dd>
</dl>
</li>
</ol>
<h3>상세</h3>
<p>기본값으로는, <code>exec</code> , . Ω , , <code>{ code: 0 }</code> .</p>
<p><code>spawn</code> , . , 1 . , 3 . , , <code>{ code: 0 }</code> .</p>
<p>에러 발생시에는, 3번째 단자의 <code>msg.payload</code> <code>message</code>, <code>signal</code> .</p>
<p>실행대상의 커맨드는 노드설정에서 정의합니다. <code>msg.payload</code> .</p>
<p>커맨드 혹은 파라미터가 공백을 포함하는 경우에는, 앞뒤에 인용부를 붙입니다. - <code>"이것은 하나의 파라미터 입니다"</code></p>
<p>반환할 <code>payload</code>는 보통 <i>문자열</i>이자만, UTF8문자가 아닌 문자가 존재하면<i>버퍼</i> .</p>
<p>노드가 실행중인 경우, 스테이터스 아이콘과 PID를 표시합니다. 상태변화는 <code>Status</code> .</p>
<h4>프로세스 정지</h4>
<p><code>msg.kill</code> , . <code>msg.kill</code> . , <code>SIGINT</code>, <code>SIGQUIT</code>, <code>SIGHUP</code> . , <code>SIGTERM</code> .</p>
<p>노드가 1개이상의 프로세스를 실행하고 있는 경우, <code>msg.pid</code> PID .</p>
<p><code>타임아웃</code> , , .</p>
<p>힌트: Python어플리케이션을 실행할 경우, <code>-u</code> .</p>
</script>