iotagent-node-lib 2.25.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGES_NEXT_RELEASE +0 -1
  2. package/config.js +6 -1
  3. package/doc/deprecated.md +4 -1
  4. package/doc/howto.md +8 -0
  5. package/doc/installationguide.md +18 -0
  6. package/doc/usermanual.md +77 -0
  7. package/lib/commonConfig.js +15 -1
  8. package/lib/constants.js +1 -0
  9. package/lib/fiware-iotagent-lib.js +1 -5
  10. package/lib/plugins/compressTimestamp.js +2 -7
  11. package/lib/plugins/expressionParser.js +0 -47
  12. package/lib/plugins/expressionPlugin.js +6 -78
  13. package/lib/plugins/jexlParser.js +0 -36
  14. package/lib/plugins/pluginUtils.js +0 -119
  15. package/lib/services/devices/deviceService.js +1 -0
  16. package/lib/services/devices/registrationUtils.js +21 -1
  17. package/lib/services/ngsi/entities-NGSI-LD.js +600 -199
  18. package/lib/services/ngsi/entities-NGSI-v2.js +620 -298
  19. package/lib/services/ngsi/ngsiUtils.js +15 -22
  20. package/lib/services/northBound/contextServer-NGSI-LD.js +221 -38
  21. package/lib/services/northBound/contextServer.js +14 -1
  22. package/lib/services/northBound/northboundServer.js +1 -0
  23. package/package.json +1 -1
  24. package/test/unit/general/loglevel-api_test.js +0 -2
  25. package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +1 -1
  26. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent1.json +24 -14
  27. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent2.json +25 -15
  28. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent4.json +15 -5
  29. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +9 -1
  30. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommandsAndLazy.json +32 -0
  31. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice.json +12 -1
  32. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +9 -1
  33. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +12 -1
  34. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +12 -1
  35. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup3.json +9 -1
  36. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateCommands1.json +10 -2
  37. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent1.json +11 -1
  38. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent2.json +12 -1
  39. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAliasPlugin1.json +0 -5
  40. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast10.json +1 -1
  41. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast8.json +1 -1
  42. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast9.json +1 -1
  43. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +16 -15
  44. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4.json +8 -8
  45. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4a.json +34 -34
  46. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin5.json +8 -8
  47. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin6.json +0 -20
  48. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin7.json +0 -5
  49. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin8.json +10 -10
  50. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +8 -7
  51. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +5 -4
  52. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin3.json +1 -1
  53. package/test/unit/ngsi-ld/examples/contextRequests/updateContextProcessTimestamp.json +4 -4
  54. package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverride.json +4 -3
  55. package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +4 -3
  56. package/test/unit/ngsi-ld/expressions/expressionBasedTransformations-test.js +2 -5
  57. package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -7
  58. package/test/unit/ngsi-ld/general/startup-test.js +17 -2
  59. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +1 -12
  60. package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +249 -0
  61. package/test/unit/ngsi-ld/ngsiService/autocast-test.js +15 -3
  62. package/test/unit/ngsi-ld/ngsiService/unsupported-endpoints-test.js +171 -0
  63. package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +0 -2
  64. package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +0 -31
  65. package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +18 -18
  66. package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +19 -6
  67. package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin1.json +2 -2
  68. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +5 -1
  69. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin5.json +4 -4
  70. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin6.json +0 -16
  71. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin7.json +0 -4
  72. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin8.json +8 -8
  73. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +42 -42
  74. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +7 -7
  75. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin4.json +0 -5
  76. package/test/unit/ngsiv2/examples/contextRequests/updateContextProcessTimestamp.json +1 -7
  77. package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +0 -3
  78. package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +0 -6
  79. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +1 -7
  80. package/test/unit/ngsiv2/plugins/alias-plugin_test.js +0 -2
  81. package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +0 -4
  82. package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +0 -32
  83. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +5 -15
  84. package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +1 -1
  85. package/lib/plugins/addEvent.js +0 -32
  86. package/lib/plugins/attributeAlias.js +0 -107
  87. package/lib/plugins/multiEntity.js +0 -255
  88. package/lib/plugins/timestampProcessPlugin.js +0 -95
  89. package/test/unit/ngsi-ld/plugins/event-plugin_test.js +0 -116
  90. package/test/unit/ngsiv2/plugins/event-plugin_test.js +0 -118
  91. package/test/unit/ngsiv2/plugins/translation-inPlugins_test.js +0 -262
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,10 +15,12 @@
9
15
  "type": "TheLightType"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "luminance"
14
20
  ]
15
21
  }
16
22
  ],
23
+ "mode": "exclusive",
24
+ "operations" :["retrieveOps"],
17
25
  "type": "ContextSourceRegistration"
18
26
  }
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,7 +15,7 @@
9
15
  "type": "TheLightType"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "luminance",
14
20
  "luminescence",
15
21
  "commandAttr",
@@ -17,5 +23,10 @@
17
23
  ]
18
24
  }
19
25
  ],
26
+ "mode": "exclusive",
27
+ "operations": [
28
+ "retrieveOps",
29
+ "updateOps"
30
+ ],
20
31
  "type": "ContextSourceRegistration"
21
32
  }
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,7 +15,7 @@
9
15
  "type": "SensorMachine"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "luminance",
14
20
  "luminescence",
15
21
  "commandAttr",
@@ -17,5 +23,10 @@
17
23
  ]
18
24
  }
19
25
  ],
26
+ "mode": "exclusive",
27
+ "operations" : [
28
+ "retrieveOps",
29
+ "updateOps"
30
+ ],
20
31
  "type": "ContextSourceRegistration"
21
32
  }
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,10 +15,12 @@
9
15
  "type": "Light"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "temperature"
14
20
  ]
15
21
  }
16
22
  ],
23
+ "mode": "exclusive",
24
+ "operations" :["retrieveOps"],
17
25
  "type": "ContextSourceRegistration"
18
26
  }
@@ -1,5 +1,11 @@
1
1
  {
2
2
  "type":"ContextSourceRegistration",
3
+ "contextSourceInfo":[
4
+ {
5
+ "key": "jsonldContext",
6
+ "value": "http://context.json-ld"
7
+ }
8
+ ],
3
9
  "information":[
4
10
  {
5
11
  "entities":[
@@ -8,11 +14,13 @@
8
14
  "id":"urn:ngsi-ld:Light:light1"
9
15
  }
10
16
  ],
11
- "properties":[
17
+ "propertyNames":[
12
18
  "move"
13
19
  ]
14
20
  }
15
21
  ],
22
+ "mode": "exclusive",
23
+ "operations":["updateOps"],
16
24
  "endpoint":"http://smartgondor.com",
17
25
  "@context": "http://context.json-ld"
18
- }
26
+ }
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,10 +15,14 @@
9
15
  "type": "Light"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "pressure"
14
20
  ]
15
21
  }
16
22
  ],
23
+ "mode": "exclusive",
24
+ "operations": [
25
+ "retrieveOps"
26
+ ],
17
27
  "type": "ContextSourceRegistration"
18
28
  }
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "@context": "http://context.json-ld",
3
3
  "endpoint": "http://smartgondor.com",
4
+ "contextSourceInfo":[
5
+ {
6
+ "key": "jsonldContext",
7
+ "value": "http://context.json-ld"
8
+ }
9
+ ],
4
10
  "information": [
5
11
  {
6
12
  "entities": [
@@ -9,11 +15,16 @@
9
15
  "type": "TheLightType"
10
16
  }
11
17
  ],
12
- "properties": [
18
+ "propertyNames": [
13
19
  "luminance",
14
20
  "commandAttr"
15
21
  ]
16
22
  }
17
23
  ],
24
+ "mode": "exclusive",
25
+ "operations" : [
26
+ "retrieveOps",
27
+ "updateOps"
28
+ ],
18
29
  "type": "ContextSourceRegistration"
19
30
  }
@@ -2,11 +2,6 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
- "pressure": {
6
- "type": "Property",
7
- "unitCode": "Hgmm",
8
- "value": 20071103
9
- },
10
5
  "temperature": {
11
6
  "type": "Property",
12
7
  "unitCode": "CEL",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "date": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "Date",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "time": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "Time",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "dateTime": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "DateTime",
@@ -1,17 +1,18 @@
1
1
  [
2
- {
3
- "@context": "http://context.json-ld",
4
- "location": {
5
- "type": "GeoProperty",
6
- "value": {
7
- "coordinates": [
8
- 13,
9
- 52
10
- ],
11
- "type": "Point"
12
- }
13
- },
14
- "id": "urn:ngsi-ld:GPS:gps1",
15
- "type": "GPS"
16
- }
2
+ {
3
+ "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:GPS:gps1",
5
+ "type": "GPS",
6
+ "location": {
7
+ "type": "GeoProperty",
8
+ "value": {
9
+ "coordinates": [
10
+ 13,
11
+ 52
12
+ ],
13
+ "type": "Point"
14
+ },
15
+ "observedAt": "1970-01-01T00:00:00.001Z"
16
+ }
17
+ }
17
18
  ]
@@ -1,24 +1,24 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "humidity12": {
4
+ "id": "urn:ngsi-ld:WeatherStation:ws1",
5
+ "type": "WeatherStation",
6
+ "weather": {
5
7
  "type": "Property",
6
8
  "value": {
7
- "@type": "Percentage",
8
- "@value": "12"
9
+ "@type": "Summary",
10
+ "@value": "Humidity 6 and pressure 1040"
9
11
  }
10
12
  },
11
- "id": "urn:ngsi-ld:WeatherStation:ws1",
12
13
  "pressure25": {
13
14
  "type": "Property",
14
15
  "value": 52
15
16
  },
16
- "type": "WeatherStation",
17
- "weather": {
17
+ "humidity12": {
18
18
  "type": "Property",
19
19
  "value": {
20
- "@type": "Summary",
21
- "@value": "Humidity 6 and pressure 1040"
20
+ "@type": "Percentage",
21
+ "@value": "12"
22
22
  }
23
23
  }
24
24
  }
@@ -1,36 +1,36 @@
1
1
  [
2
- {
3
- "@context": "http://context.json-ld",
4
- "pressure25": {
5
- "type": "Property",
6
- "value": 52
7
- },
8
- "humidity12": {
9
- "type": "Property",
10
- "value": {
11
- "@type": "Percentage",
12
- "@value": "12"
13
- }
14
- },
15
- "weather": {
16
- "type": "Property",
17
- "value": {
18
- "@type": "Summary",
19
- "@value": "Humidity 6 and pressure 1040"
20
- }
21
- },
22
- "alive": {
23
- "type": "Property",
24
- "value": {
25
- "@type": "None",
26
- "@value": "undefined"
27
- }
28
- },
29
- "updated": {
30
- "type": "Property",
31
- "value": true
32
- },
33
- "id": "urn:ngsi-ld:WeatherStation:ws1",
34
- "type": "WeatherStation"
2
+ {
3
+ "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:WeatherStation:ws1",
5
+ "type": "WeatherStation",
6
+ "weather": {
7
+ "type": "Property",
8
+ "value": {
9
+ "@type": "Summary",
10
+ "@value": "Humidity 6 and pressure 1040"
11
+ }
12
+ },
13
+ "pressure25": {
14
+ "type": "Property",
15
+ "value": 52
16
+ },
17
+ "humidity12": {
18
+ "type": "Property",
19
+ "value": {
20
+ "@type": "Percentage",
21
+ "@value": "12"
22
+ }
23
+ },
24
+ "alive": {
25
+ "type": "Property",
26
+ "value": {
27
+ "@type": "None",
28
+ "@value": "undefined"
29
+ }
30
+ },
31
+ "updated": {
32
+ "type": "Property",
33
+ "value": true
35
34
  }
36
- ]
35
+ }
36
+ ]
@@ -6,26 +6,26 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
- "id": "urn:ngsi-ld:Higrometer:Higro2002",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
10
11
  "pressure": {
11
12
  "type": "Property",
12
13
  "value": {
13
14
  "@type": "Hgmm",
14
- "@value": "17"
15
+ "@value": "16"
15
16
  }
16
- },
17
- "type": "Higrometer"
17
+ }
18
18
  },
19
19
  {
20
20
  "@context": "http://context.json-ld",
21
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
21
+ "id": "urn:ngsi-ld:Higrometer:Higro2002",
22
+ "type": "Higrometer",
22
23
  "pressure": {
23
24
  "type": "Property",
24
25
  "value": {
25
26
  "@type": "Hgmm",
26
- "@value": "16"
27
+ "@value": "17"
27
28
  }
28
- },
29
- "type": "Higrometer"
29
+ }
30
30
  }
31
31
  ]
@@ -12,25 +12,5 @@
12
12
  "type": "Property",
13
13
  "value": 38
14
14
  }
15
- },
16
- {
17
- "@context": "http://context.json-ld",
18
- "id": "urn:ngsi-ld:WM:SO2",
19
- "type": "WM"
20
- },
21
- {
22
- "@context": "http://context.json-ld",
23
- "id": "urn:ngsi-ld:WM:SO3",
24
- "type": "WM"
25
- },
26
- {
27
- "@context": "http://context.json-ld",
28
- "id": "urn:ngsi-ld:WM:SO4",
29
- "type": "WM"
30
- },
31
- {
32
- "@context": "http://context.json-ld",
33
- "id": "urn:ngsi-ld:WM:SO5",
34
- "type": "WM"
35
15
  }
36
16
  ]
@@ -31,11 +31,6 @@
31
31
  "value": 40
32
32
  }
33
33
  },
34
- {
35
- "@context": "http://context.json-ld",
36
- "id": "urn:ngsi-ld:WM:SO4",
37
- "type": "WM"
38
- },
39
34
  {
40
35
  "@context": "http://context.json-ld",
41
36
  "id": "urn:ngsi-ld:WM:SO5",
@@ -6,27 +6,27 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
- "id": "urn:ngsi-ld:Higrometer:Higro2002",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
10
11
  "pressure": {
11
12
  "type": "Property",
12
- "unitCode": "Hgmm",
13
13
  "value": {
14
14
  "@type": "Hgmm",
15
- "@value": "17"
15
+ "@value": "16"
16
16
  }
17
- },
18
- "type": "Higrometer"
17
+ }
19
18
  },
20
19
  {
21
20
  "@context": "http://context.json-ld",
22
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
21
+ "id": "urn:ngsi-ld:Higrometer:Higro2002",
22
+ "type": "Higrometer",
23
23
  "pressure": {
24
24
  "type": "Property",
25
25
  "value": {
26
26
  "@type": "Hgmm",
27
- "@value": "16"
28
- }
29
- },
30
- "type": "Higrometer"
27
+ "@value": "17"
28
+ },
29
+ "unitCode": "Hgmm"
30
+ }
31
31
  }
32
32
  ]
@@ -1,6 +1,8 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:WeatherStation:ws4",
5
+ "type": "WeatherStation",
4
6
  "pressure": {
5
7
  "type": "Property",
6
8
  "value": {
@@ -8,20 +10,19 @@
8
10
  "@value": "52"
9
11
  },
10
12
  "observedAt": "2016-05-30T16:25:22.304Z"
11
- },
12
- "id": "urn:ngsi-ld:WeatherStation:ws4",
13
- "type": "WeatherStation"
13
+ }
14
14
  },
15
15
  {
16
16
  "@context": "http://context.json-ld",
17
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
18
+ "type": "Higrometer",
17
19
  "humidity": {
18
20
  "type": "Property",
19
21
  "value": {
20
22
  "@type": "Percentage",
21
23
  "@value": "12"
22
- }
23
- },
24
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
25
- "type": "Higrometer"
24
+ },
25
+ "observedAt": "2023-03-21T18:30:30.948Z"
26
+ }
26
27
  }
27
28
  ]
@@ -6,14 +6,15 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
9
11
  "humidity": {
10
12
  "type": "Property",
11
13
  "value": {
12
14
  "@type": "Percentage",
13
15
  "@value": "12"
14
- }
15
- },
16
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
17
- "type": "Higrometer"
16
+ },
17
+ "observedAt": "2023-03-21T16:54:11.464Z"
18
+ }
18
19
  }
19
20
  ]
@@ -14,7 +14,7 @@
14
14
  "@type": "Percentage",
15
15
  "@value": "16"
16
16
  },
17
- "observedAt": "2018-06-13T13:28:34.611Z"
17
+ "observedAt": "2023-03-21T16:57:54.046Z"
18
18
  }
19
19
  }
20
20
  ]
@@ -2,11 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
- "observedAt": "2016-05-30T16:25:22.304Z",
7
7
  "type": "Property",
8
- "value": true
9
- },
10
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2016-05-30T16:25:22.304Z"
10
+ }
11
11
  }
12
12
  ]
@@ -2,10 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
7
  "type": "Property",
7
- "value": true
8
- },
9
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2015-12-14T08:06:01.468Z"
10
+ }
10
11
  }
11
12
  ]
@@ -2,10 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
7
  "type": "Property",
7
- "value": true
8
- },
9
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2022-10-22T22:22:22.000Z"
10
+ }
10
11
  }
11
12
  ]
@@ -198,9 +198,6 @@ describe('NGSI-LD - Expression-based transformations plugin', function () {
198
198
 
199
199
  iotAgentLib.activate(iotAgentConfig, function () {
200
200
  iotAgentLib.clearAll(function () {
201
- iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
202
- iotAgentLib.addQueryMiddleware(iotAgentLib.dataPlugins.attributeAlias.query);
203
- iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
204
201
  done();
205
202
  });
206
203
  });
@@ -746,13 +743,13 @@ describe('NGSI-LD - Expression-based transformations plugin', function () {
746
743
  });
747
744
  });
748
745
 
749
- describe('When an update comes for attributes without expressions and Object type', function () {
746
+ describe('When an update comes for attributes without expressions and Array type', function () {
750
747
  // Case: Update for a JSON array attribute without expression
751
748
 
752
749
  const values = [
753
750
  {
754
751
  name: 'r',
755
- type: 'Object',
752
+ type: 'Array',
756
753
  value: ['v0.1', 'v0.2', 'v0.3']
757
754
  }
758
755
  ];