Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e78447b
refactor(cli): drop vm2 and use NodeJS vm module
relu91 Jan 24, 2025
abb813c
refactor(cli/default-serivent): use async await in run method
relu91 Jan 24, 2025
ee16e04
refactor(cli): better code organization and minor improvements logging
relu91 Jan 29, 2025
e493e36
refactor(cli): organize logging configuration
relu91 Jan 29, 2025
6f5953c
refactor(cli/parsers/config-file-parser): better error messages
relu91 Jan 30, 2025
861bcad
refactor(cli): improve configuration building and keep it sync with j…
relu91 Mar 5, 2025
7bb51f3
fix(mqtt): allow optional uri in MQTT Server configuration
relu91 Mar 5, 2025
f49662f
feat(cli): simplify CLI script execution
relu91 Jun 27, 2025
7269236
feat(cli): unify configuration parameters
relu91 Oct 24, 2025
1f1d88e
chore: remove testing files
relu91 Nov 28, 2025
28c8a6f
test(cli): cover new functionalities with basic tests
relu91 Nov 28, 2025
93cd428
chore: fix critical audit warnings
relu91 Nov 28, 2025
f116cbc
chore: fix eslint warnings
relu91 Nov 28, 2025
5718765
style: run format
relu91 Nov 28, 2025
e5ddb9b
test(cli): use tmp library for script files
relu91 Dec 18, 2025
ca12fe4
refactor(cli): basic error messages improvments
relu91 Jan 7, 2026
61768ae
chore(cli): rename import-json.js to import-json-to-ts.js
relu91 Jan 7, 2026
eed1f94
feat(cli): remove now unsupported inspect options
relu91 Jan 7, 2026
876bede
feat(cli): remove compiler option
relu91 Jan 7, 2026
9a2f461
docs(cli/README): allign the help message with the latest changes
relu91 Jan 7, 2026
c1597d6
docs(cli/README): add missing closing parentesis
relu91 Jan 7, 2026
341cef1
chore: remove .env file
relu91 Jan 9, 2026
24dcdf7
chore(cli): update license date
relu91 Jan 9, 2026
d823470
refactor(cli): move loglevel to log.level
relu91 Jan 9, 2026
c5a7a51
test(cli): remove temporaney resource folder
relu91 Jan 9, 2026
39877a7
feat(cli): rename cli commad from wot-servient to node-wot
relu91 Jan 9, 2026
afc3ccd
docs(binding-mqtt): fix typo
relu91 Jan 12, 2026
3440b23
Merge branch 'master' into cli-enachements
relu91 Feb 18, 2026
8771d96
Merge branch 'master' into cli-enachements
relu91 Feb 27, 2026
eb18a6a
chore: sync package-lock with master
relu91 Feb 27, 2026
f63f2f7
refactor: completely remove references to wot-servient and rename it …
relu91 Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ STOPSIGNAL SIGINT
ENTRYPOINT [ "node", "dist/cli.js" ]
CMD [ "-h" ]

## docker build -t wot-servient ./docker/Dockerfile
## docker build -t node-wot ./docker/Dockerfile
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ You can alternatively use node-wot via its command line interface (CLI). Please

#### As global tool

To make the `wot-servient` command available on your machine, install the CLI tool in the global scope:
To make the `node-wot` command available on your machine, install the CLI tool in the global scope:

```
npm i @node-wot/cli -g
Expand All @@ -140,16 +140,16 @@ Go into the repository:
cd node-wot
```

Build the Docker image named `wot-servient` from the `Dockerfile`:
Build the Docker image named `node-wot` from the `Dockerfile`:

```
npm run build:docker
```

Run the wot-servient as a container:
Run the `node-wot` as a container:

```
docker run --rm wot-servient -h
docker run --rm node-wot -h
```

## Examples
Expand Down Expand Up @@ -252,12 +252,12 @@ Can't find your preferred MediaType? More codecs can be easily added by implemen
Run all the steps above including "Link Packages" and then run this:

```
wot-servient -h
node-wot -h
cd examples/scripts
wot-servient
node-wot
```

Without the "Link Packages" step, the `wot-servient` command is not available and `node` needs to be used (e.g., Windows CMD shell):
Without the "Link Packages" step, the `node-wot` command is not available and `node` needs to be used (e.g., Windows CMD shell):

```
# expose
Expand All @@ -277,9 +277,9 @@ First [build the docker image](#as-a-docker-image) and then run the counter exam

```
# expose
docker run -it --init -p 8080:8080/tcp -p 5683:5683/udp -v "$(pwd)"/examples:/srv/examples --rm wot-servient /srv/examples/scripts/counter.js
docker run -it --init -p 8080:8080/tcp -p 5683:5683/udp -v "$(pwd)"/examples:/srv/examples --rm node-wot /srv/examples/scripts/counter.js
# consume
docker run -it --init -v "$(pwd)"/examples:/srv/examples --rm --net=host wot-servient /srv/examples/scripts/counter-client.js --client-only
docker run -it --init -v "$(pwd)"/examples:/srv/examples --rm --net=host node-wot /srv/examples/scripts/counter-client.js --client-only
```

- The counter exposes the HTTP endpoint at 8080/tcp and the CoAP endpoint at 5683/udp and they are bound to the host machine (with `-p 8080:8080/tcp -p 5683:5683/udp`).
Expand Down
67 changes: 47 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
"scripts": {
"build": "tsc -b && npm run build -w packages/browser-bundle",
"build": "npm run build:transform -w packages/cli && tsc -b && npm run build -w packages/browser-bundle",
"pretest": "npm run build",
"start": "cd packages/cli && npm run start",
"debug": "cd packages/cli && npm run debug",
Expand All @@ -31,8 +31,8 @@
"prepare": "husky install",
"publish": "npm publish --workspaces",
"check:versions": "node utils/check_package_version_consistency.js",
"build:docker": "docker build -t wot-servient .",
"build:podman": "podman build -t wot-servient .",
"build:docker": "docker build -t node-wot .",
"build:podman": "podman build -t node-wot .",
"clean:dist": "npm exec --workspaces -- npx rimraf tsconfig.tsbuildinfo dist",
"update:wot-typescript-definitions": "npx npm-check-updates -u -f \"wot-typescript-definitions\" --deep",
"link": "npm link -ws",
Expand Down
6 changes: 3 additions & 3 deletions packages/binding-mqtt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Please setup node-wot as described at the [node-wot main page](https://github.co
- example-mqtt-publish.js: Shows when node-wot acts as a MQTT Client that publishes data (latest counter value) to a broker.
At the same time, another client can invoke an action, such as `resetCounter`, by sending a publication message to the topic of this action.
This other client does not have to be node-wot, any MQTT client can interact with this Thing.
For node-wot clients, make sure to provide MQTT broker details (`host`, `port`, `username`, `password`, `clientId`) in the wot-servient.conf.json:
For node-wot clients, make sure to provide MQTT broker details (`host`, `port`, `username`, `password`, `clientId`) in the `node-wot.conf.json`:

```js
{
Expand All @@ -315,11 +315,11 @@ Please setup node-wot as described at the [node-wot main page](https://github.co

```

Start the script by the command `wot-servient mqtt-publish.js` or `node ../../packages/cli/dist/cli.js mqtt-publish.js`.
Start the script by the command `node-wot mqtt-publish.js` or `node ../../packages/cli/dist/cli.js mqtt-publish.js`.

- example-mqtt-subscription.js: Shows how node-wot consumes a Thing Description to do MQTT subscription on the provided event (=latest counter value) as well as initiate the action (reset counter).

Start the script by the command `wot-servient -c mqtt-subscribe.js` or `node ../../packages/cli/dist/cli.js -c mqtt-subscribe.js`.
Start the script by the command `node-wot -c mqtt-subscribe.js` or `node ../../packages/cli/dist/cli.js -c mqtt-subscribe.js`.
Comment thread
danielpeintner marked this conversation as resolved.

### More Details

Expand Down
13 changes: 8 additions & 5 deletions packages/binding-mqtt/src/mqtt-broker-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class MqttBrokerServer implements ProtocolServer {
private port = -1;
private address?: string = undefined;

private brokerURI: string;
private brokerURI?: string;

private readonly things: Map<string, ExposedThing> = new Map();

Expand All @@ -77,15 +77,14 @@ export default class MqttBrokerServer implements ProtocolServer {
private hostedBroker?: net.Server;

constructor(config: MqttBrokerServerConfig) {
this.config = config ?? this.defaults;
this.config.uri = this.config.uri ?? this.defaults.uri;

// if there is a MQTT protocol indicator missing, add this
if (config.uri.indexOf("://") === -1) {
if (config.uri?.indexOf("://") === -1) {
config.uri = this.scheme + "://" + config.uri;
}

this.brokerURI = config.uri;
this.config = config ?? this.defaults;
this.config.uri = this.config.uri ?? this.defaults.uri;
}

public async expose(thing: ExposedThing): Promise<void> {
Expand Down Expand Up @@ -446,6 +445,10 @@ export default class MqttBrokerServer implements ProtocolServer {

private async startBroker() {
return new Promise<void>((resolve, reject) => {
if (this.brokerURI == null) {
throw new Error("Unexpected configuration state. Broker was started but brokerURI is null");
}

this.hostedServer = Server({});
let server: tls.Server | net.Server;
if (this.config.key) {
Expand Down
2 changes: 1 addition & 1 deletion packages/binding-mqtt/src/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface MqttClientConfig {
}

export interface MqttBrokerServerConfig {
uri: string;
uri?: string;
user?: string;
psw?: string;
clientId?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/binding-netconf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The Binding example in the `./examples` directory provides a TD (`netconf-thing.
Depending on which NETCONF server is used, the following might have to be changed:

- IP address and port in `examples/netconf-thing.jsonld`
- credentials for the NETCONF Thing (id `urn:dev:wot:org:eclipse:netconf-example`) have to be changed in `wot-servient.conf.json`.
- credentials for the NETCONF Thing (id `urn:dev:wot:org:eclipse:netconf-example`) have to be changed in `node-wot.conf.json`.

## New Form Fields for the NETCONF Binding

Expand All @@ -53,7 +53,7 @@ Depending on which NETCONF server is used, the following might have to be change
The href contains: URI schema + IP address + port + XPath

- URI schema: the schema for NETCONF is not registered with IANA; the Binding is using `netconf`.
- IP address and port: IP address and port of the NETCONF server. The credentials for the SSH connection to the server can be added into the `wot-servient.configuration.json`.
- IP address and port: IP address and port of the NETCONF server. The credentials for the SSH connection to the server can be added into the `node-wot.configuration.json`.
- XPath: the XPath of the YANG model node addressed by the given InteractionAffordance. The XPath is automatically converted into the corresponding XML needed by the RPC. If an attribute refers to a particular namespace, an alias can be used. The complete URN for the alias should be added to the **nc:NSs** field.

### nc:target
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-bundle/web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async function cleanup() {

function controlTestServient() {
return {
name: "wot-servient",
name: "node-wot",

async executeCommand({ command }) {
switch (command) {
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/generated
test/resources
Comment thread
danielpeintner marked this conversation as resolved.
Loading