Skip to content

Commit

Permalink
Merge pull request #20 from fisuda/feature/forbidden_char
Browse files Browse the repository at this point in the history
Add feature for encoding and decoding forbidden chars
  • Loading branch information
fisuda authored May 9, 2023
2 parents 8c727b0 + c8b95fe commit aba7ee8
Show file tree
Hide file tree
Showing 25 changed files with 1,058 additions and 155 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## node-red-contrib-letsfiware-NGSI v0.3.0-next

- Add feature for encoding and decoding forbidden chars (#20)
- ADD encode / decode node (#19)
- Update Github Actions for E2E test (#17)

Expand Down
52 changes: 28 additions & 24 deletions docs/en/custom_nodes/batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ It allows to create NGSI-LD entities.

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

| Property | Description |
| ----------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `create` |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `create` |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Input

Expand Down Expand Up @@ -100,12 +101,13 @@ It allows to update NGSI-LD entities.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/batch-operations/batch-operations-03.png)

| Property | Description |
| ----------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `update` |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `update` |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Input

Expand Down Expand Up @@ -162,12 +164,13 @@ It allows to upsert NGSI-LD entities.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/batch-operations/batch-operations-04.png)

| Property | Description |
| ----------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `upsert` |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `upsert` |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Input

Expand Down Expand Up @@ -224,12 +227,13 @@ It allows to delete NGSI-LD entities.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/batch-operations/batch-operations-05.png)

| Property | Description |
| ----------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `delete` |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of NGSI-LD broker |
| Action type | `delete` |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Input

Expand Down
14 changes: 13 additions & 1 deletion docs/en/custom_nodes/decode.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# NGSI decode
# NGSI-LD decode

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

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/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-NGSI-LD/gh-pages/images/decode/decode-02.png)
Expand Down
14 changes: 13 additions & 1 deletion docs/en/custom_nodes/encode.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# NGSI encode
# NGSI-LD encode

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

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/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-NGSI-LD/gh-pages/images/encode/encode-02.png)
Expand Down
44 changes: 23 additions & 21 deletions docs/en/custom_nodes/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,28 @@ This custom node is a simple node that allows to obtain NGSI-LD entities.
![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/entities/entities-02.png)


| Property | Description |
| ----------------- | ----------------------------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a context broker |
| Representation | `normalized`, `concise` or `keyValues` |
| Entity id | Id of the entity to retrieve |
| Entity type | Types of the entity to retrieve |
| ID pattern | Regular expression that shall be matched by entity ids |
| Attributes | Comma separated list fo attribute names |
| System attrs | `true` or `false` |
| Query | Filter out entities by attribute values |
| CSF | Context source fileter |
| Geo relationship | Geo relationship of geoquery |
| Geometry | Geometry of geoquery |
| Coordinates | Coordinates of geoquery |
| Geo property | The name of the Property that contains the geospatial data |
| Geometry property | GeoProperty Name |
| Language | The preferred natural language of the response |
| Accept | `JSON-LD`, `JSON` or `GeoJSON` |
| @context | NGSI-LD @context |
| Buffering | `off` or `on` |
| Property | Description |
| ---------------------- | ----------------------------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a context broker |
| Representation | `normalized`, `concise` or `keyValues` |
| Entity id | Id of the entity to retrieve |
| Entity type | Types of the entity to retrieve |
| ID pattern | Regular expression that shall be matched by entity ids |
| Attributes | Comma separated list fo attribute names |
| System attrs | `true` or `false` |
| Query | Filter out entities by attribute values |
| CSF | Context source fileter |
| Geo relationship | Geo relationship of geoquery |
| Geometry | Geometry of geoquery |
| Coordinates | Coordinates of geoquery |
| Geo property | The name of the Property that contains the geospatial data |
| Geometry property | GeoProperty Name |
| Language | The preferred natural language of the response |
| Accept | `JSON-LD`, `JSON` or `GeoJSON` |
| @context | NGSI-LD @context |
| Buffering | `off` or `on` |
| Decode forbidden chars | `off` or `on` |

## Input

Expand All @@ -66,6 +67,7 @@ The values in the payload may overwrite properties.
| geometryProperty | string | GeoProperty Name |
| lang | string | The preferred natural language of the response |
| accept | string | `application/ld+json`, `application/json` or `application/geo+json` |
| forbidden | boolean | `true` or `false` |

```
{
Expand Down
54 changes: 29 additions & 25 deletions docs/en/custom_nodes/entity-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ It allows to update an attribute in NGSI-LD entity.

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

| Property | Description |
| -------------- | ----------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `update` |
| Entity id | Id of the concerned entity |
| Attribute name | Attribute name (Property or Relationship) |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `update` |
| Entity id | Id of the concerned entity |
| Attribute name | Attribute name (Property or Relationship) |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Example

Expand Down Expand Up @@ -61,6 +62,7 @@ The values in the payload may overwrite properties.
| entityId | string | Id of the concerned entity |
| attrName | string | Attribute name (Property or Relationship) |
| attribute | JSON Object | An object representing the attribute to update |
| forbidden | boolean | `true` or `false` |

```
{
Expand Down Expand Up @@ -94,16 +96,17 @@ It allows to delete an attribute in NGSI-LD entity.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/entity-attribute/entity-attribute-03.png)

| Property | Description |
| -------------- | ----------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `delete` |
| Entity id | Id of the concerned entity |
| Attribute name | Attribute name (Property or Relationship) |
| Delete all | `true` or `false` |
| Dataset id | datasetId of the dataset to be deleted |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ----------------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `delete` |
| Entity id | Id of the concerned entity |
| Attribute name | Attribute name (Property or Relationship) |
| Delete all | `true` or `false` |
| Dataset id | datasetId of the dataset to be deleted |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Example

Expand All @@ -124,12 +127,13 @@ payload *JSON Object*
A `msg.payload` should contain information related to the attribute to delete.
The values in the payload may overwrite properties.

| Name | Data type | Description |
| ---------- | --------- | ----------------------------------------- |
| entityId | string | Id of the concerned entity |
| attrName | string | Attribute name (Property or Relationship) |
| deleteAll | boolean | `true` or `false` |
| datasetid | string | datasetId of the dataset to be deleted |
| Name | Data type | Description |
| --------- | --------- | ----------------------------------------- |
| entityId | string | Id of the concerned entity |
| attrName | string | Attribute name (Property or Relationship) |
| deleteAll | boolean | `true` or `false` |
| datasetid | string | datasetId of the dataset to be deleted |
| forbidden | boolean | `true` or `false` |

```
{
Expand All @@ -146,4 +150,4 @@ A `msg.statusCode` contains a status code.

```
204
```
```
74 changes: 40 additions & 34 deletions docs/en/custom_nodes/entity-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ It allows to append attributes of NGSI-LD entity.

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

| Property | Description |
| -------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Example

Expand Down Expand Up @@ -60,10 +61,11 @@ payload *JSON Object*
A `msg.payload` should contain information related to the attributes to append.
The values in the payload may overwrite properties.

| Name | Data type | Description |
| -------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to append |
| Name | Data type | Description |
| --------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to append |
| forbidden | boolean | `true` or `false` |

```
{
Expand Down Expand Up @@ -100,13 +102,14 @@ It allows to update attributes of NGSI-LD entity.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/entity-attributes/entity-attributes-03.png)

| Property | Description |
| -------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Example

Expand Down Expand Up @@ -137,10 +140,11 @@ payload *JSON Object*
A `msg.payload` should contain information related to the attributes to update.
The values in the payload may overwrite properties.

| Name | Data type | Description |
| -------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to update |
| Name | Data type | Description |
| --------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to update |
| forbidden | boolean | `true` or `false` |

```
{
Expand Down Expand Up @@ -177,13 +181,14 @@ It allows to upsert attributes of NGSI-LD entity.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-NGSI-LD/gh-pages/images/entity-attributes/entity-attributes-04.png)

| Property | Description |
| -------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Property | Description |
| ---------------------- | ------------------------------- |
| Name | A name for a node instance |
| Broker | An endpoint of a NGSI-LD broker |
| Action type | `append` |
| Entity id | Id of the concerned entity |
| @context | NGSI-LD @context |
| Encode forbidden chars | `off` or `on` |

### Example

Expand Down Expand Up @@ -214,10 +219,11 @@ payload *JSON Object*
A `msg.payload` should contain information related to the attributes to upsert.
The values in the payload may overwrite properties.

| Name | Data type | Description |
| -------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to upsert |
| Name | Data type | Description |
| --------- | ----------- | -------------------------- |
| entityId | string | Id of the concerned entity |
| attrs | JSON Object | Attributes to upsert |
| forbidden | boolean | `true` or `false` |

```
{
Expand All @@ -244,4 +250,4 @@ A `msg.statusCode` contains a status code.

```
204
```
```
Loading

0 comments on commit aba7ee8

Please sign in to comment.