Skip to content

Commit

Permalink
ADD encode / decode node
Browse files Browse the repository at this point in the history
  • Loading branch information
fisuda committed May 12, 2023
1 parent b172611 commit 6f509af
Show file tree
Hide file tree
Showing 22 changed files with 1,282 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
## node-red-contrib-letsfiware-NGSI v0.14.0-next

- ADD encode / decode node (#133)

## node-red-contrib-letsfiware-NGSI v0.14.0 - 02 May, 2023

- ADD tutorial (#129)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -30,6 +30,8 @@ Node-RED implementation for FIWARE Open APIs
- [NGSI Subscription](docs/en/custom_nodes/ngsi_subscription.md)
- [NGSI Registration](docs/en/custom_nodes/ngsi_registration.md)
- [NGSI Types](docs/en/custom_nodes/ngsi_types.md)
- [NGSI Encode](docs/en/custom_nodes/ngsi_encode.md)
- [NGSI Decode](docs/en/custom_nodes/ngsi_decode.md)
- [Historical context](docs/en/custom_nodes/historical_context.md) (STH-Comet)
- [NGSI Timeseries](docs/en/custom_nodes/ngsi_timeseries.md) (QuantumLeap)
- [NGSI to Worldmap](docs/en/custom_nodes/ngsi_to_worldmap.md)
Expand Down
2 changes: 2 additions & 0 deletions README_ja.md
Expand Up @@ -26,6 +26,8 @@ FIWARE Open APIs の Node-RED 実装
- [NGSI Subscription](docs/ja/custom_nodes/ngsi_subscription.md)
- [NGSI Registration](docs/en/custom_nodes/ngsi_registration.md)
- [NGSI Types](docs/ja/custom_nodes/ngsi_types.md)
- [NGSI Encode](docs/ja/custom_nodes/ngsi_encode.md)
- [NGSI Decode](docs/ja/custom_nodes/ngsi_decode.md)
- [Historical context](docs/ja/custom_nodes/historical_context.md) (STH-Comet)
- [NGSI Timeseries](docs/en/custom_nodes/ngsi_timeseries.md) (QuantumLeap)
- [NGSI to Worldmap](docs/ja/custom_nodes/ngsi_to_worldmap.md)
Expand Down
129 changes: 129 additions & 0 deletions docs/en/custom_nodes/ngsi_decode.md
@@ -0,0 +1,129 @@
# NGSI decode

This custom node is a simple node that decodes forbidden characters.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/decode/decode-01.png)

| Characters | Decoded character |
| ---------- | ----------------- |
| %22 | " |
| %25 | % |
| %27 | ' |
| %28 | ( |
| %29 | ) |
| %3B | ; |
| %3C | < |
| %3D | = |
| %3E | > |

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/decode/decode-02.png)

| Property | Description |
| ----------- | ------------------------------- |
| Name | A name for a node instance |

### Input (string)

payload *string*

A `msg.payload` should contain a string.

```text
%3CSensor%3E
```

#### Output (string)

payload *string*

A `msg.payload` contains a string.

```text
<Sensor>
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```

### Input (JSON Object)

payload *JSON Object*

A `msg.payload` should contain a NGSI data.

```json
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "%3CSensor%3E"
}
```

#### Output (JSON Object)

payload *JSON Object*

A `msg.payload` contains a NGSI data.

```json
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "<Sensor>"
}
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```

### Input (JSON Array)

payload *JSON Array*

A `msg.payload` should contain a NGSI data.

```json
[
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "%3CSensor%3E"
}
]
```

#### Output (JSON Array)

payload *JSON Array*

A `msg.payload` contains a NGSI data.

```json
[
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "<Sensor>"
}
]
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```
129 changes: 129 additions & 0 deletions docs/en/custom_nodes/ngsi_encode.md
@@ -0,0 +1,129 @@
# NGSI encode

This custom node is a simple node that encodes forbidden characters.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/encode/encode-01.png)

| Character | Encoded characters |
| --------- | ------------------ |
| " | %22 |
| % | %25 |
| ' | %27 |
| ( | %28 |
| ) | %29 |
| ; | %3B |
| < | %3C |
| = | %3D |
| > | %3E |

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/encode/encode-02.png)

| Property | Description |
| ----------- | ------------------------------- |
| Name | A name for a node instance |

### Input (string)

payload *string*

A `msg.payload` should contain a string.

```text
<Sensor>
```

#### Output (string)

payload *string*

A `msg.payload` contains a string.

```text
%3CSensor%3E
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```

### Input (JSON Object)

payload *JSON Object*

A `msg.payload` should contain a NGSI data.

```json
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "<Sensor>"
}
```

#### Output (JSON Object)

payload *JSON Object*

A `msg.payload` contains a NGSI data.

```json
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "%3CSensor%3E"
}
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```

### Input (JSON Array)

payload *JSON Array*

A `msg.payload` should contain a NGSI data.

```json
[
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "<Sensor>"
}
]
```

#### Output (JSON Array)

payload *JSON Array*

A `msg.payload` contains a NGSI data.

```json
[
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"name": "%3CSensor%3E"
}
]
```

statusCode *Number*

A `msg.statusCode` contains a status code.

```text
200
```
2 changes: 2 additions & 0 deletions docs/en/index.md
Expand Up @@ -20,6 +20,8 @@ Node-RED NGSI integration
- [NGSI Subscription](custom_nodes/ngsi_subscription.md)
- [NGSI Registration](custom_nodes/ngsi_registration.md)
- [NGSI Types](custom_nodes/ngsi_types.md)
- [NGSI Encode](custom_nodes/ngsi_encode.md)
- [NGSI Decode](custom_nodes/ngsi_decode.md)
- [Historical context](custom_nodes/historical_context.md) (STH-Comet)
- [NGSI Timeseries](custom_nodes/ngsi_timeseries.md) (QuantumLeap)
- [NGSI to Worldmap](custom_nodes/ngsi_to_worldmap.md)
Expand Down

0 comments on commit 6f509af

Please sign in to comment.