Skip to content

Commit

Permalink
Merge pull request #2 from hidetak/move-server-termination-process
Browse files Browse the repository at this point in the history
Move server termination process
  • Loading branch information
hidetak authored Feb 29, 2024
2 parents a7cc2eb + 5930f4d commit 19e626b
Show file tree
Hide file tree
Showing 39 changed files with 10,149 additions and 2,077 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 8
},
"extends": ["eslint:recommended", "prettier"],
"ignorePatterns": ["dist", "node_modules", "bin"],
"rules":{
"no-constant-condition": ["error", { "checkLoops": false }]
}
}
4 changes: 2 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"trailingComma": "es5",
"printWidth": 120,
"singleQuote": true,
"tabWidth": 2,
"singleQuote": false,
"tabWidth": 4,
"semi": false,
"endOfLine": "lf"
}
5 changes: 4 additions & 1 deletion node-red-node-wot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
],
"license": "MIT",
"keywords": [
"internet-of-things",
"iot",
"web-of-things",
"wot",
"node-red"
],
Expand Down Expand Up @@ -67,4 +70,4 @@
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
}
}
}
71 changes: 35 additions & 36 deletions node-red-node-wot/src/locales/en-US/wot-server-action.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
<script type="text/html" data-help-name="wot-server-action">
<p>This node is used on the server side to implement WoT actions.</p>
<p>When a client calls an action, this node outputs an msg including arguments from its output terminal. Once the processing of the action is complete, input is made to the Server-End node (please input if there is a return value).</p>
<p>
When a client calls an action, this node outputs an msg including arguments from its output terminal. Once the
processing of the action is complete, input is made to the Server-End node (please input if there is a return
value).
</p>

<h3>Inputs</h3>
None

<h3>Outputs</h3>
<dl class="message-properties">
<dt>Action arguments <span class="property-type">any (depending on action definition)</span></dt>
<dd>These are the arguments of the action. The destination of argument output is specified on the node's property screen.</dd>
</dl>

<dl class="message-properties">
<dt>Action arguments <span class="property-type">any (depending on action definition)</span></dt>
<dd>
These are the arguments of the action. The destination of argument output is specified on the node's
property screen.
</dd>
</dl>

<h3>Details</h3>
<p>The following items are specified on the node's properties screen:</p>
<ul>
<li>
Name: Specifies the node name.
</li>
<li>
Server config: Specify the server to publish the action.
</li>
<li>
Thing config: Specifies the Thing to which the action belongs.
</li>
<li>
Action name: Specifies the action name.
</li>
<li>
Action description: Specifies the action description.
</li>
<li>
Argument data type: Specifies the data type of the action argument.
</li>
<li>
Return value data type: Specifies the data type of the action return value.
</li>
<li>
Argument destination: Specifies where to output the argument when the action call is received.
</li>
<li>Name: Specifies the node name.</li>
<li>Server config: Specify the server to publish the action.</li>
<li>Thing config: Specifies the Thing to which the action belongs.</li>
<li>Action name: Specifies the action name.</li>
<li>Action description: Specifies the action description.</li>
<li>Argument data type: Specifies the data type of the action argument.</li>
<li>Return value data type: Specifies the data type of the action return value.</li>
<li>Argument destination: Specifies where to output the argument when the action call is received.</li>
</ul>
<p>The Thing Description is stored in the thingDescriptions variable of the global context with the key of &lt;Server Name&gt;::&lt;Thing Title&gt;.</p>
<p>You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the latest Thing Description.</p>
<p>This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT implementation.</p>

</script>
<p>
The Thing Description is stored in the thingDescriptions variable of the global context with the key of
&lt;Server Name&gt;::&lt;Thing Title&gt;.
</p>
<p>
You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the
latest Thing Description.
</p>
<p>
This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT
implementation.
</p>
</script>
28 changes: 17 additions & 11 deletions node-red-node-wot/src/locales/en-US/wot-server-config.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<script type="text/html" data-help-name="wot-server-config">
<p>This is a Config node that holds the settings for the server that publishes WoT's Thing.</p>
<p>Specify this setting in Server-Property, Server-Action, and Server-Event nodes.</p>
<p>The Thing Description, which defines the functions of the Thing to be published, is stored in the thingDescriptions variable of the global context with the key of &lt;Server Name&gt;::&lt;Thing Title&gt;.</p>
<p>You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the latest Thing Description.</p>
<p>
The Thing Description, which defines the functions of the Thing to be published, is stored in the
thingDescriptions variable of the global context with the key of &lt;Server Name&gt;::&lt;Thing Title&gt;.
</p>
<p>
You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the
latest Thing Description.
</p>

<h3>Details</h3>
<p>The following items are specified on the node's properties screen:</p>
<ul>
<li>Server name: Specifies the server name.</li>
<li>Binding type: Specifies the method of communication between the server and client.</li>
<li>
Server name: Specifies the server name.
</li>
<li>
Binding type: Specifies the method of communication between the server and client.
</li>
<li>
Binding config: Specifies the settings of Binding. When you change the Binding Type, it displays the settings(JSON) of the template according to the changed Binding type. Please change those settings as needed.
Binding config: Specifies the settings of Binding. When you change the Binding Type, it displays the
settings(JSON) of the template according to the changed Binding type. Please change those settings as
needed.
</li>
</ul>
<p>This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT implementation.</p>

<p>
This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT
implementation.
</p>
</script>
39 changes: 22 additions & 17 deletions node-red-node-wot/src/locales/en-US/wot-server-end.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
<script type="text/html" data-help-name="wot-server-end">
<p>This node connects at the end of reading/writing WoT's properties and processing actions.</p>
<p>Be sure to connect to this node, as inputting into this node notifies the client side that the process is complete.</p>
<p>If there is a value to return to the client, store the value in the variable specified on the properties screen and then input it.</p>
<p>
Be sure to connect to this node, as inputting into this node notifies the client side that the process is
complete.
</p>
<p>
If there is a value to return to the client, store the value in the variable specified on the properties screen
and then input it.
</p>

<h3>Inputs</h3>
<dl class="message-properties">
<dt>Notification of completion of processing
<dl class="message-properties">
<dt>
Notification of completion of processing
<span class="property-type">any (depending on the definition of property or action)</span>
</dt>
<dd>Input is performed when the reading/writing of properties and the processing of actions are completed. If you want to return a value to the client, include the value in the msg member.</dd>
</dl>

</dt>
<dd>
Input is performed when the reading/writing of properties and the processing of actions are completed. If
you want to return a value to the client, include the value in the msg member.
</dd>
</dl>

<h3>Outputs</h3>
None

<h3>Details</h3>
<p>Specify the following items on the node properties screen:</p>
<ul>
<li>
Name: Specify the node name.
</li>
<li>
Return value source: Specify the source to input the value to return to the client.
</li>
<li>Name: Specify the node name.</li>
<li>Return value source: Specify the source to input the value to return to the client.</li>
</ul>
<p>To return a value to the client, use the information included in msg._wot. Please do not delete msg._wot.</p>

</script>
</script>
64 changes: 31 additions & 33 deletions node-red-node-wot/src/locales/en-US/wot-server-event.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,41 @@
<p>This node is used on the server side to emit WoT events.</p>

<h3>Inputs</h3>
<dl class="message-properties">
<dt>Event
<dl class="message-properties">
<dt>
Event
<span class="property-type">any (depending on the event definition)</span>
</dt>
<dd>When an event occurs on the server side, input the event value. The source of the event value input is specified on the node properties screen.</dd>
</dl>

</dt>
<dd>
When an event occurs on the server side, input the event value. The source of the event value input is
specified on the node properties screen.
</dd>
</dl>

<h3>Outputs</h3>
None

<h3>Details</h3>
<p>Specify the following items in the node's properties screen:</p>
<ul>
<li>
Name: Specify the node name.
</li>
<li>
Server config: Specify the server that will publish the action.
</li>
<li>
Thing config: Specify the Thing that the action belongs to.
</li>
<li>
Event name: Specify the event name.
</li>
<li>
Event description: Specify the event description.
</li>
<li>
Data type: Specify the data type of the event.
</li>
<li>
Event value source: Specify the source for entering the event value.
</li>
<li>Name: Specify the node name.</li>
<li>Server config: Specify the server that will publish the action.</li>
<li>Thing config: Specify the Thing that the action belongs to.</li>
<li>Event name: Specify the event name.</li>
<li>Event description: Specify the event description.</li>
<li>Data type: Specify the data type of the event.</li>
<li>Event value source: Specify the source for entering the event value.</li>
</ul>
<p>The Thing Description is stored in the thingDescriptions variable of the global context with the key of &lt;Server Name&gt;::&lt;Thing Title&gt;.</p>
<p>You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the latest Thing Description.</p>
<p>This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT implementation.</p>

</script>
<p>
The Thing Description is stored in the thingDescriptions variable of the global context with the key of
&lt;Server Name&gt;::&lt;Thing Title&gt;.
</p>
<p>
You can check this in the Context Data tab of the Node-RED editor. Press the refresh button to refer to the
latest Thing Description.
</p>
<p>
This node uses <a href="https://github.com/eclipse-thingweb/node-wot">eclipse-thingweb/node-wot</a> for WoT
implementation.
</p>
</script>
Loading

0 comments on commit 19e626b

Please sign in to comment.