iotagent-node-lib 2.17.0 → 2.20.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 (347) hide show
  1. package/.github/workflows/ci.yml +17 -2
  2. package/.nyc_output/76bc24ff-5fac-4b5a-997d-de2799342eb0.json +1 -0
  3. package/.nyc_output/processinfo/76bc24ff-5fac-4b5a-997d-de2799342eb0.json +1 -0
  4. package/.nyc_output/processinfo/index.json +1 -1
  5. package/CHANGES_NEXT_RELEASE +1 -0
  6. package/README.md +3 -54
  7. package/doc/advanced-topics.md +121 -85
  8. package/doc/api.md +52 -52
  9. package/doc/development.md +13 -6
  10. package/doc/expressionLanguage.md +514 -312
  11. package/doc/installationguide.md +66 -64
  12. package/doc/usermanual.md +48 -16
  13. package/docker/Mosquitto/Dockerfile +1 -0
  14. package/docker/Mosquitto/README.md +1 -0
  15. package/docker/Mosquitto/startMosquitto.sh +9 -4
  16. package/lib/commonConfig.js +1 -14
  17. package/lib/errors.js +0 -16
  18. package/lib/fiware-iotagent-lib.js +4 -2
  19. package/lib/jexlTranformsMap.js +13 -2
  20. package/lib/model/Device.js +4 -1
  21. package/lib/model/Group.js +19 -1
  22. package/lib/plugins/attributeAlias.js +6 -13
  23. package/lib/plugins/bidirectionalData.js +1 -21
  24. package/lib/plugins/expressionParser.js +7 -6
  25. package/lib/plugins/expressionPlugin.js +11 -25
  26. package/lib/plugins/jexlParser.js +8 -4
  27. package/lib/plugins/multiEntity.js +54 -145
  28. package/lib/plugins/pluginUtils.js +12 -48
  29. package/lib/plugins/timestampProcessPlugin.js +1 -46
  30. package/lib/request-shim.js +111 -0
  31. package/lib/services/common/domain.js +6 -2
  32. package/lib/services/common/genericMiddleware.js +6 -2
  33. package/lib/services/common/iotManagerService.js +1 -1
  34. package/lib/services/common/securityServiceKeystone.js +1 -1
  35. package/lib/services/common/securityServiceOAuth2.js +3 -2
  36. package/lib/services/devices/deviceRegistryMongoDB.js +2 -0
  37. package/lib/services/devices/deviceService.js +2 -5
  38. package/lib/services/devices/devices-NGSI-LD.js +1 -1
  39. package/lib/services/devices/devices-NGSI-v2.js +4 -8
  40. package/lib/services/devices/registrationUtils.js +1 -134
  41. package/lib/services/ngsi/entities-NGSI-LD.js +205 -124
  42. package/lib/services/ngsi/entities-NGSI-v2.js +109 -15
  43. package/lib/services/ngsi/ngsiService.js +4 -6
  44. package/lib/services/ngsi/ngsiUtils.js +0 -36
  45. package/lib/services/ngsi/subscriptionService.js +1 -4
  46. package/lib/services/northBound/contextServer-NGSI-LD.js +7 -2
  47. package/lib/services/northBound/contextServer-NGSI-v2.js +24 -12
  48. package/lib/services/northBound/contextServer.js +1 -4
  49. package/lib/services/northBound/contextServerUtils.js +0 -81
  50. package/lib/services/northBound/deviceProvisioningServer.js +31 -7
  51. package/lib/services/northBound/northboundServer.js +2 -0
  52. package/lib/services/northBound/restUtils.js +1 -38
  53. package/lib/templates/updateDevice.json +4 -0
  54. package/lib/templates/updateDeviceLax.json +4 -0
  55. package/package.json +10 -16
  56. package/test/tools/utils.js +2 -0
  57. package/test/unit/examples/groupProvisioningRequests/multipleGroupsCreation.json +1 -1
  58. package/test/unit/expressions/jexlExpression-test.js +44 -5
  59. package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +19 -66
  60. package/test/unit/general/deviceService-test.js +11 -27
  61. package/test/unit/general/loglevel-api_test.js +6 -11
  62. package/test/unit/general/startup-test.js +2 -1
  63. package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +8 -16
  64. package/test/unit/mongodb/mongodb-group-registry-test.js +1 -1
  65. package/test/unit/mongodb/mongodb-registry-test.js +38 -114
  66. package/test/unit/ngsi-ld/examples/contextRequests/createMinimumProvisionedDevice.json +0 -7
  67. package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDevice.json +0 -7
  68. package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceMultientity.json +0 -7
  69. package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json +0 -14
  70. package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic2.json +0 -14
  71. package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic3.json +1 -15
  72. package/test/unit/ngsi-ld/examples/contextRequests/createTimeInstantMinimumDevice.json +0 -7
  73. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAliasPlugin6.json +0 -7
  74. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast5.json +0 -7
  75. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin12a.json +7 -0
  76. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin13.json +13 -13
  77. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin16.json +0 -7
  78. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin17.json +0 -7
  79. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin1a.json +18 -0
  80. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin29.json +18 -0
  81. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin31.json +15 -0
  82. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +17 -0
  83. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin33.json +18 -0
  84. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin34.json +17 -0
  85. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4a.json +36 -0
  86. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin5.json +0 -7
  87. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin7.json +16 -16
  88. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin8a.json +18 -0
  89. package/test/unit/ngsi-ld/examples/contextRequests/updateContextGeoproperties3.json +0 -7
  90. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin15.json +25 -0
  91. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +6 -6
  92. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +3 -3
  93. package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionActiveAttributes1.json +0 -7
  94. package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionCommands1.json +0 -7
  95. package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionDeviceStatic.json +0 -7
  96. package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionMinimumDevice.json +0 -7
  97. package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1018 -0
  98. package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +2 -2
  99. package/test/unit/ngsi-ld/general/deviceService-test.js +1 -1
  100. package/test/unit/ngsi-ld/general/https-support-test.js +2 -1
  101. package/test/unit/ngsi-ld/general/iotam-autoregistration-test.js +2 -1
  102. package/test/unit/ngsi-ld/general/startup-test.js +1 -0
  103. package/test/unit/ngsi-ld/lazyAndCommands/active-devices-attribute-update-test.js +3 -1
  104. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +2 -1
  105. package/test/unit/ngsi-ld/lazyAndCommands/lazy-devices-test.js +2 -6
  106. package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +2 -1
  107. package/test/unit/ngsi-ld/ngsiService/active-devices-test.js +1 -0
  108. package/test/unit/ngsi-ld/ngsiService/autocast-test.js +1 -0
  109. package/test/unit/ngsi-ld/ngsiService/geoproperties-test.js +1 -0
  110. package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +4 -3
  111. package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +1 -0
  112. package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +3 -2
  113. package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +61 -0
  114. package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +2 -1
  115. package/test/unit/ngsi-ld/provisioning/device-registration_test.js +3 -2
  116. package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +1 -0
  117. package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +42 -54
  118. package/test/unit/ngsi-ld/provisioning/provisionDeviceMultientity-test.js +2 -1
  119. package/test/unit/ngsi-ld/provisioning/removeProvisionedDevice-test.js +4 -4
  120. package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +3 -5
  121. package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +12 -18
  122. package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +3 -1
  123. package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent3.json +19 -0
  124. package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent5.json +19 -0
  125. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin17.json +1 -1
  126. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json +22 -0
  127. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin30.json +6 -0
  128. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin31.json +18 -0
  129. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +16 -0
  130. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin33.json +22 -0
  131. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json +12 -0
  132. package/test/unit/ngsiv2/examples/contextRequests/updateContextMiddleware1.json +10 -0
  133. package/test/unit/ngsiv2/examples/contextRequests/updateContextMiddleware2.json +10 -0
  134. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +13 -0
  135. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin12.json +33 -0
  136. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin13.json +33 -0
  137. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin14.json +33 -0
  138. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin15.json +25 -0
  139. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin16.json +25 -0
  140. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +6 -6
  141. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +3 -3
  142. package/test/unit/{examples → ngsiv2/examples}/contextRequests/updateProvisionDevice.json +0 -0
  143. package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +37 -4
  144. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +598 -0
  145. package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +3 -2
  146. package/test/unit/ngsiv2/general/deviceService-test.js +9 -8
  147. package/test/unit/ngsiv2/general/https-support-test.js +2 -1
  148. package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +2 -1
  149. package/test/unit/ngsiv2/general/startup-test.js +1 -0
  150. package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +3 -1
  151. package/test/unit/ngsiv2/lazyAndCommands/command-test.js +2 -1
  152. package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +287 -15
  153. package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +3 -1
  154. package/test/unit/ngsiv2/ngsiService/active-devices-test.js +88 -0
  155. package/test/unit/{ngsiService → ngsiv2/ngsiService}/queryDeviceInformationInCb-test.js +20 -49
  156. package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +4 -3
  157. package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +3 -2
  158. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +526 -0
  159. package/test/unit/{plugins → ngsiv2/plugins}/translation-inPlugins_test.js +21 -21
  160. package/test/unit/{provisioning → ngsiv2/provisioning}/device-group-api-test.js +19 -50
  161. package/test/unit/{provisioning/device-group-utils_test.js → ngsiv2/provisioning/device-group-utils-test.js} +5 -4
  162. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +2 -1
  163. package/test/unit/ngsiv2/provisioning/device-registration_test.js +3 -2
  164. package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +4 -3
  165. package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +42 -53
  166. package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +2 -1
  167. package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +4 -4
  168. package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +3 -4
  169. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +14 -20
  170. package/test/unit/plugins/capture-configuration-inPlugins_test.js +3 -1
  171. package/test/unit/plugins/capture-provision-inPlugins_test.js +8 -18
  172. package/.eslintcache +0 -1
  173. package/.nyc_output/dca24ca1-851e-490c-9d34-8d13b3330297.json +0 -1
  174. package/.nyc_output/processinfo/dca24ca1-851e-490c-9d34-8d13b3330297.json +0 -1
  175. package/bin/agentConsole.js +0 -257
  176. package/bin/iotAgentTester.js +0 -44
  177. package/lib/command/commandLine.js +0 -918
  178. package/lib/command/migration.js +0 -176
  179. package/lib/services/devices/devices-NGSI-v1.js +0 -310
  180. package/lib/services/ngsi/entities-NGSI-v1.js +0 -299
  181. package/lib/services/ngsi/subscription-NGSI-v1.js +0 -234
  182. package/lib/services/northBound/contextServer-NGSI-v1.js +0 -526
  183. package/lib/templates/notificationTemplateNgsi1.json +0 -75
  184. package/lib/templates/updateContextNgsi1.json +0 -50
  185. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent1.json +0 -21
  186. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent2.json +0 -21
  187. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent3.json +0 -25
  188. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent4.json +0 -22
  189. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgentAttributeUpdates.json +0 -16
  190. package/test/unit/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +0 -21
  191. package/test/unit/examples/contextAvailabilityRequests/registerNewDevice1.json +0 -21
  192. package/test/unit/examples/contextAvailabilityRequests/registerNewDevice2.json +0 -21
  193. package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDevice.json +0 -25
  194. package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +0 -21
  195. package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +0 -33
  196. package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +0 -33
  197. package/test/unit/examples/contextAvailabilityRequests/unregisterDevice1.json +0 -22
  198. package/test/unit/examples/contextAvailabilityRequests/unregisterDevice3.json +0 -26
  199. package/test/unit/examples/contextAvailabilityRequests/unregisterProvisionedDevice.json +0 -26
  200. package/test/unit/examples/contextAvailabilityRequests/updateCommands1.json +0 -22
  201. package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent1.json +0 -22
  202. package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent2.json +0 -26
  203. package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent3.json +0 -26
  204. package/test/unit/examples/contextAvailabilityResponses/registerIoTAgent1Failed.json +0 -8
  205. package/test/unit/examples/contextAvailabilityResponses/registerIoTAgent1Success.json +0 -4
  206. package/test/unit/examples/contextAvailabilityResponses/registerNewDevice1Success.json +0 -4
  207. package/test/unit/examples/contextAvailabilityResponses/registerNewDevice2Success.json +0 -4
  208. package/test/unit/examples/contextAvailabilityResponses/registerProvisionedDeviceSuccess.json +0 -4
  209. package/test/unit/examples/contextAvailabilityResponses/unregisterDevice1Failed.json +0 -8
  210. package/test/unit/examples/contextAvailabilityResponses/unregisterDevice1Success.json +0 -4
  211. package/test/unit/examples/contextAvailabilityResponses/updateCommands1Success.json +0 -4
  212. package/test/unit/examples/contextAvailabilityResponses/updateIoTAgent1Success.json +0 -6
  213. package/test/unit/examples/contextProviderResponses/queryInformationResponse.json +0 -22
  214. package/test/unit/examples/contextProviderResponses/queryInformationResponseEmptyAttributes.json +0 -22
  215. package/test/unit/examples/contextProviderResponses/queryInformationStaticAttributesResponse.json +0 -27
  216. package/test/unit/examples/contextProviderResponses/updateInformationResponse.json +0 -22
  217. package/test/unit/examples/contextProviderResponses/updateInformationResponse2.json +0 -22
  218. package/test/unit/examples/contextRequests/contextSubscriptionRequest.json +0 -20
  219. package/test/unit/examples/contextRequests/contextSubscriptionRequest2.json +0 -20
  220. package/test/unit/examples/contextRequests/createBidirectionalDevice.json +0 -17
  221. package/test/unit/examples/contextRequests/createDatetimeProvisionedDevice.json +0 -17
  222. package/test/unit/examples/contextRequests/createGeopointProvisionedDevice.json +0 -17
  223. package/test/unit/examples/contextRequests/createMinimumProvisionedDevice.json +0 -17
  224. package/test/unit/examples/contextRequests/createProvisionedDevice.json +0 -32
  225. package/test/unit/examples/contextRequests/createProvisionedDeviceMultientity.json +0 -32
  226. package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroup.json +0 -47
  227. package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json +0 -52
  228. package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic2.json +0 -52
  229. package/test/unit/examples/contextRequests/createTimeinstantDevice.json +0 -17
  230. package/test/unit/examples/contextRequests/queryContext1.json +0 -13
  231. package/test/unit/examples/contextRequests/queryContext2.json +0 -13
  232. package/test/unit/examples/contextRequests/queryContextAliasPlugin1.json +0 -10
  233. package/test/unit/examples/contextRequests/queryContextCompressTimestamp1.json +0 -13
  234. package/test/unit/examples/contextRequests/updateActiveAttributes.json +0 -32
  235. package/test/unit/examples/contextRequests/updateContext1.json +0 -22
  236. package/test/unit/examples/contextRequests/updateContext2.json +0 -22
  237. package/test/unit/examples/contextRequests/updateContext3.json +0 -17
  238. package/test/unit/examples/contextRequests/updateContext3WithStatic.json +0 -22
  239. package/test/unit/examples/contextRequests/updateContext4.json +0 -22
  240. package/test/unit/examples/contextRequests/updateContext5.json +0 -19
  241. package/test/unit/examples/contextRequests/updateContextAliasPlugin.json +0 -22
  242. package/test/unit/examples/contextRequests/updateContextAliasPlugin2.json +0 -17
  243. package/test/unit/examples/contextRequests/updateContextAppendMode.json +0 -22
  244. package/test/unit/examples/contextRequests/updateContextCommandError.json +0 -22
  245. package/test/unit/examples/contextRequests/updateContextCommandExpired.json +0 -22
  246. package/test/unit/examples/contextRequests/updateContextCommandFinish.json +0 -22
  247. package/test/unit/examples/contextRequests/updateContextCommandStatus.json +0 -17
  248. package/test/unit/examples/contextRequests/updateContextCompressTimestamp1.json +0 -22
  249. package/test/unit/examples/contextRequests/updateContextCompressTimestamp2.json +0 -29
  250. package/test/unit/examples/contextRequests/updateContextExpressionPlugin1.json +0 -17
  251. package/test/unit/examples/contextRequests/updateContextExpressionPlugin10.json +0 -17
  252. package/test/unit/examples/contextRequests/updateContextExpressionPlugin2.json +0 -27
  253. package/test/unit/examples/contextRequests/updateContextExpressionPlugin3.json +0 -17
  254. package/test/unit/examples/contextRequests/updateContextExpressionPlugin4.json +0 -17
  255. package/test/unit/examples/contextRequests/updateContextExpressionPlugin5.json +0 -27
  256. package/test/unit/examples/contextRequests/updateContextExpressionPlugin6.json +0 -17
  257. package/test/unit/examples/contextRequests/updateContextExpressionPlugin7.json +0 -27
  258. package/test/unit/examples/contextRequests/updateContextExpressionPlugin8.json +0 -22
  259. package/test/unit/examples/contextRequests/updateContextExpressionPlugin9.json +0 -27
  260. package/test/unit/examples/contextRequests/updateContextMiddleware1.json +0 -22
  261. package/test/unit/examples/contextRequests/updateContextMultiEntityPlugin3.json +0 -35
  262. package/test/unit/examples/contextRequests/updateContextMultientityPlugin1.json +0 -30
  263. package/test/unit/examples/contextRequests/updateContextMultientityPlugin2.json +0 -30
  264. package/test/unit/examples/contextRequests/updateContextProcessTimestamp1.json +0 -29
  265. package/test/unit/examples/contextRequests/updateContextStaticAttributes.json +0 -22
  266. package/test/unit/examples/contextRequests/updateContextTimestamp.json +0 -41
  267. package/test/unit/examples/contextRequests/updateContextTimestampOverride.json +0 -22
  268. package/test/unit/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +0 -22
  269. package/test/unit/examples/contextRequests/updateContextTimestampTimezone.json +0 -41
  270. package/test/unit/examples/contextRequests/updateProvisionActiveAttributes1.json +0 -17
  271. package/test/unit/examples/contextRequests/updateProvisionCommands1.json +0 -27
  272. package/test/unit/examples/contextRequests/updateProvisionDeviceStatic.json +0 -38
  273. package/test/unit/examples/contextRequests/updateProvisionMinimumDevice.json +0 -17
  274. package/test/unit/examples/contextResponses/contextSubscriptionRequest2Success.json +0 -7
  275. package/test/unit/examples/contextResponses/contextSubscriptionRequestSuccess.json +0 -7
  276. package/test/unit/examples/contextResponses/createBidirectionalDeviceSuccess.json +0 -22
  277. package/test/unit/examples/contextResponses/createDatetimeProvisionedDeviceSuccess.json +0 -22
  278. package/test/unit/examples/contextResponses/createGeopointProvisionedDeviceSuccess.json +0 -22
  279. package/test/unit/examples/contextResponses/createProvisionedDeviceSuccess.json +0 -22
  280. package/test/unit/examples/contextResponses/createTimeinstantSuccess.json +0 -22
  281. package/test/unit/examples/contextResponses/queryContext1Success.json +0 -27
  282. package/test/unit/examples/contextResponses/queryContext2Error.json +0 -7
  283. package/test/unit/examples/contextResponses/queryContext2UnknownError.json +0 -6
  284. package/test/unit/examples/contextResponses/queryContext3Error.json +0 -34
  285. package/test/unit/examples/contextResponses/queryContextAliasPlugin1Success.json +0 -27
  286. package/test/unit/examples/contextResponses/queryContextCompressTimestamp1Success.json +0 -27
  287. package/test/unit/examples/contextResponses/updateActiveAttributesSuccess.json +0 -42
  288. package/test/unit/examples/contextResponses/updateContext1Failed.json +0 -7
  289. package/test/unit/examples/contextResponses/updateContext1Success.json +0 -27
  290. package/test/unit/examples/contextResponses/updateContext2Failed.json +0 -35
  291. package/test/unit/examples/contextResponses/updateContextAliasPlugin2Success.json +0 -27
  292. package/test/unit/examples/contextResponses/updateContextAliasPluginSuccess.json +0 -27
  293. package/test/unit/examples/contextResponses/updateContextCommandFinishSuccess.json +0 -27
  294. package/test/unit/examples/contextResponses/updateContextCommandStatusSuccess.json +0 -22
  295. package/test/unit/examples/contextResponses/updateContextCompressTimestamp1Success.json +0 -27
  296. package/test/unit/examples/contextResponses/updateContextCompressTimestamp2Success.json +0 -34
  297. package/test/unit/examples/contextResponses/updateContextEvents1Success.json +0 -27
  298. package/test/unit/examples/contextResponses/updateContextExpressionPlugin1Success.json +0 -22
  299. package/test/unit/examples/contextResponses/updateContextExpressionPlugin2Success.json +0 -22
  300. package/test/unit/examples/contextResponses/updateContextExpressionPlugin3Success.json +0 -22
  301. package/test/unit/examples/contextResponses/updateContextExpressionPlugin5Success.json +0 -32
  302. package/test/unit/examples/contextResponses/updateContextMultientityPlugin1Success.json +0 -40
  303. package/test/unit/examples/contextResponses/updateContextMultientityPlugin2Success.json +0 -40
  304. package/test/unit/examples/contextResponses/updateContextMultientityPlugin3Success.json +0 -40
  305. package/test/unit/examples/contextResponses/updateContextProcessTimestamp1Success.json +0 -27
  306. package/test/unit/examples/contextResponses/updateProvisionActiveAttributes1Success.json +0 -22
  307. package/test/unit/examples/contextResponses/updateProvisionCommands1Success.json +0 -32
  308. package/test/unit/examples/contextResponses/updateProvisionMinimumDeviceSuccess.json +0 -22
  309. package/test/unit/examples/subscriptionRequests/bidirectionalNotification.json +0 -24
  310. package/test/unit/examples/subscriptionRequests/bidirectionalSubscriptionRemove.json +0 -3
  311. package/test/unit/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +0 -22
  312. package/test/unit/examples/subscriptionRequests/errorNotification.json +0 -24
  313. package/test/unit/examples/subscriptionRequests/simpleNotification.json +0 -24
  314. package/test/unit/examples/subscriptionRequests/simpleSubscriptionRemove.json +0 -3
  315. package/test/unit/examples/subscriptionRequests/simpleSubscriptionRequest.json +0 -19
  316. package/test/unit/examples/subscriptionRequests/simpleSubscriptionRequest1.json +0 -19
  317. package/test/unit/examples/subscriptionResponses/bidirectionalSubscriptionSuccess.json +0 -6
  318. package/test/unit/examples/subscriptionResponses/simpleSubscriptionSuccess.json +0 -6
  319. package/test/unit/expressions/expressionBasedTransformations-test.js +0 -328
  320. package/test/unit/expressions/expressionCombinedTransformations-test.js +0 -306
  321. package/test/unit/expressions/jexlBasedTransformations-test.js +0 -334
  322. package/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +0 -902
  323. package/test/unit/general/https-support-test.js +0 -286
  324. package/test/unit/general/iotam-autoregistration-test.js +0 -368
  325. package/test/unit/general/migration-test.js +0 -256
  326. package/test/unit/lazyAndCommands/active-devices-attribute-update-test.js +0 -168
  327. package/test/unit/lazyAndCommands/command-test.js +0 -341
  328. package/test/unit/lazyAndCommands/lazy-devices-test.js +0 -878
  329. package/test/unit/lazyAndCommands/polling-commands-test.js +0 -421
  330. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin20.json +0 -25
  331. package/test/unit/ngsiService/active-devices-test.js +0 -692
  332. package/test/unit/ngsiService/staticAttributes-test.js +0 -148
  333. package/test/unit/ngsiService/subscriptions-test.js +0 -345
  334. package/test/unit/plugins/alias-plugin_test.js +0 -158
  335. package/test/unit/plugins/bidirectional-plugin_test.js +0 -564
  336. package/test/unit/plugins/compress-timestamp-plugin_test.js +0 -257
  337. package/test/unit/plugins/event-plugin_test.js +0 -119
  338. package/test/unit/plugins/multientity-plugin_test.js +0 -248
  339. package/test/unit/plugins/timestamp-processing-plugin_test.js +0 -119
  340. package/test/unit/provisioning/device-provisioning-api_test.js +0 -748
  341. package/test/unit/provisioning/device-registration_test.js +0 -432
  342. package/test/unit/provisioning/device-update-registration_test.js +0 -326
  343. package/test/unit/provisioning/listProvisionedDevices-test.js +0 -488
  344. package/test/unit/provisioning/provisionDeviceMultientity-test.js +0 -123
  345. package/test/unit/provisioning/removeProvisionedDevice-test.js +0 -244
  346. package/test/unit/provisioning/singleConfigurationMode-test.js +0 -346
  347. package/test/unit/provisioning/updateProvisionedDevices-test.js +0 -436
@@ -0,0 +1 @@
1
+ {"parent":null,"pid":26617,"argv":["/home/fermin/.nvm/versions/node/v10.24.1/bin/node","/home/fermin/src/iotagent-node-lib/node_modules/.bin/mocha","--recursive","test/**/*.js","--reporter","spec","--timeout","8000","--ui","bdd","--exit","--color","true"],"execArgv":[],"cwd":"/home/fermin/src/iotagent-node-lib","time":1646066946112,"ppid":26606,"coverageFilename":"/home/fermin/src/iotagent-node-lib/.nyc_output/76bc24ff-5fac-4b5a-997d-de2799342eb0.json","externalId":"","uuid":"76bc24ff-5fac-4b5a-997d-de2799342eb0","files":["/home/fermin/src/iotagent-node-lib/lib/fiware-iotagent-lib.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiService.js","/home/fermin/src/iotagent-node-lib/lib/services/common/domain.js","/home/fermin/src/iotagent-node-lib/lib/constants.js","/home/fermin/src/iotagent-node-lib/lib/errors.js","/home/fermin/src/iotagent-node-lib/lib/commonConfig.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiUtils.js","/home/fermin/src/iotagent-node-lib/lib/services/common/genericMiddleware.js","/home/fermin/src/iotagent-node-lib/lib/model/dbConn.js","/home/fermin/src/iotagent-node-lib/lib/services/common/alarmManagement.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscriptionService.js","/home/fermin/src/iotagent-node-lib/lib/services/stats/statsRegistry.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceService.js","/home/fermin/src/iotagent-node-lib/lib/services/groups/groupService.js","/home/fermin/src/iotagent-node-lib/lib/services/common/iotManagerService.js","/home/fermin/src/iotagent-node-lib/lib/request-shim.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/registrationUtils.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/restUtils.js","/home/fermin/src/iotagent-node-lib/lib/services/commands/commandService.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/northboundServer.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServerUtils.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceProvisioningServer.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceGroupAdministrationServer.js","/home/fermin/src/iotagent-node-lib/lib/plugins/compressTimestamp.js","/home/fermin/src/iotagent-node-lib/lib/plugins/pluginUtils.js","/home/fermin/src/iotagent-node-lib/lib/plugins/attributeAlias.js","/home/fermin/src/iotagent-node-lib/lib/plugins/addEvent.js","/home/fermin/src/iotagent-node-lib/lib/plugins/timestampProcessPlugin.js","/home/fermin/src/iotagent-node-lib/lib/plugins/expressionPlugin.js","/home/fermin/src/iotagent-node-lib/lib/plugins/expressionParser.js","/home/fermin/src/iotagent-node-lib/lib/plugins/jexlParser.js","/home/fermin/src/iotagent-node-lib/lib/jexlTranformsMap.js","/home/fermin/src/iotagent-node-lib/lib/plugins/multiEntity.js","/home/fermin/src/iotagent-node-lib/lib/plugins/bidirectionalData.js","/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMemory.js","/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceKeystone.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMemory.js","/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMemory.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-v2.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-v2.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-v2.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-v2.js","/home/fermin/src/iotagent-node-lib/lib/model/Device.js","/home/fermin/src/iotagent-node-lib/lib/model/Group.js","/home/fermin/src/iotagent-node-lib/lib/model/Command.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMongoDB.js","/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMongoDB.js","/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMongoDB.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-LD.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-LD.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-LD.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-LD.js","/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceOAuth2.js","/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-mixed.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-mixed.js","/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-mixed.js","/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-mixed.js"]}
@@ -1 +1 @@
1
- {"processes":{"dca24ca1-851e-490c-9d34-8d13b3330297":{"parent":null,"children":[]}},"files":{},"externalIds":{}}
1
+ {"processes":{"76bc24ff-5fac-4b5a-997d-de2799342eb0":{"parent":null,"children":[]}},"files":{"/home/fermin/src/iotagent-node-lib/lib/fiware-iotagent-lib.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/domain.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/constants.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/errors.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/commonConfig.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/genericMiddleware.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/dbConn.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/alarmManagement.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscriptionService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/stats/statsRegistry.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/iotManagerService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/request-shim.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/registrationUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/restUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/northboundServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServerUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceProvisioningServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceGroupAdministrationServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/compressTimestamp.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/pluginUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/attributeAlias.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/addEvent.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/timestampProcessPlugin.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/expressionPlugin.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/expressionParser.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/jexlParser.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/jexlTranformsMap.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/multiEntity.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/bidirectionalData.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceKeystone.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Device.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Group.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Command.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceOAuth2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"]},"externalIds":{}}
@@ -0,0 +1 @@
1
+
package/README.md CHANGED
@@ -72,7 +72,7 @@ IoT Agent
72
72
  In order to use the library within your own IoT Agent, you must first you require it before use:
73
73
 
74
74
  ```javascript
75
- const iotagentLib = require("iotagent-node-lib");
75
+ const iotagentLib = require('iotagent-node-lib');
76
76
  ```
77
77
 
78
78
  Information about how to configure the Library can be found at the corresponding section of the
@@ -298,57 +298,6 @@ configuration is independent, and can be checked with the `showConfigCb` and `sh
298
298
  Their values can be changed with the `configCb` and `configIot` commands respectively. The new configurations will be
299
299
  deleted upon startup.
300
300
 
301
- #### Creating specialized testers
302
-
303
- The command-line testing tools make use of the
304
- [command-node Node.js library](https://github.com/telefonicaid/command-shell-lib) for command-line utils. In order to
305
- help creating testing tools for IoTAgents of specific protocols, all the commands of the library tester are offered as a
306
- array that can be directly imported into other Command-Line tools, using the following steps:
307
-
308
- - Require the `iotagent-node-lib` command-line module in your command-line tool:
309
-
310
- ```javascript
311
- var iotaCommands = require("iotagent-node-lib").commandLine;
312
- ```
313
-
314
- - Initialize the command-line utils (the initialization function takes two arguments, that will be explained in detail
315
- below:
316
-
317
- ```javascript
318
- iotaCommands.init(configCb, configIot);
319
- ```
320
-
321
- - Add the IOTA Lib commands to your array of commands
322
-
323
- ```javascript
324
- commands = commands.concat(commands, iotaCommands.commands);
325
- ```
326
-
327
- - Execute the command-line interpreter as usual:
328
-
329
- ```javascript
330
- clUtils.initialize(commandLine.commands, "IoT Agent tester> ");
331
- ```
332
-
333
- The command-line module makes use of two configuration objects. Both can be shown and edited in the command-line using
334
- the provided commands, but a default value must be present.
335
-
336
- The Context Broker configuration object holds all the information about the Context Broker where the IoT Agent to be
337
- tested is connected. It MUST contain the following attributes:
338
-
339
- - **host**: host where the Context Broker instance is located.
340
- - **port**: port where the Context Broker instance is listening.
341
- - **service**: service that will be used in all the NGSI operations.
342
- - **subservice**: service that will be used in all the NGSI operations.
343
-
344
- The IoT Agent configuration object holds information about the IoT Agent that is being tested. It MUST contain the
345
- following attributes:
346
-
347
- - **host**: host where the IoT Agent instance is located.
348
- - **port**: port where the IoT Agent instance is listening.
349
- - **service**: service that will be used to group devices and device information.
350
- - **subservice**: subservice that will be used to group devices and device information.
351
-
352
301
  ---
353
302
 
354
303
  ## Licence
@@ -364,8 +313,8 @@ related with the fact that different people assign different interpretations on
364
313
  used in these licenses. Due to this, some people believe that there is a risk in just _using_ software under GPL or AGPL
365
314
  licenses (even without _modifying_ it).
366
315
 
367
- For the avoidance of doubt, the owners of this software licensed under an AGPL-3.0 license
368
- wish to make a clarifying public statement as follows:
316
+ For the avoidance of doubt, the owners of this software licensed under an AGPL-3.0 license wish to make a clarifying
317
+ public statement as follows:
369
318
 
370
319
  > Please note that software derived as a result of modifying the source code of this software in order to fix a bug or
371
320
  > incorporate enhancements is considered a derivative work of the product. Software that merely uses or aggregates (i.e.
@@ -1,37 +1,35 @@
1
1
  ## Advanced Topics
2
2
 
3
- * [Secured access to the Context Broker](#secured-access-to-the-context-broker)
4
- * [GeoJSON support NGSI-LD only](#geojson-support-ngsi-ld-only)
5
- * [Metadata support](#metadata-support)
6
- * [NGSI LD data and metadata considerations](#ngsi-ld-data-and-metadata-considerations)
7
- * [NGSI-LD Linked Data support](#ngsi-ld-linked-data-support)
8
- * [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision)
9
- * [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs)
10
- * [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode)
11
- * [Data mapping plugins](#data-mapping-plugins)
12
- * [Development](#development)
13
- * [Provided plugins](#provided-plugins)
14
- * [Timestamp Compression plugin (compressTimestamp)](#timestamp-compression-plugin-compresstimestamp)
15
- * [Attribute Alias plugin (attributeAlias)](#attribute-alias-plugin-attributealias)
16
- * [Event plugin (addEvents)](#event-plugin-addevents)
17
- * [Timestamp Processing Plugin (timestampProcess)](#timestamp-processing-plugin-timestampprocess)
18
- * [Expression Translation plugin (expressionTransformation)](#expression-translation-plugin-expressiontransformation)
19
- * [Multientity plugin (multiEntity)](#multientity-plugin-multientity)
20
- * [Bidirectionality plugin (bidirectional)](#bidirectionality-plugin-bidirectional)
21
- * [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision)
22
- * [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs)
23
- * [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode)
24
- * [Old IoTAgent data migration](#old-iotagent-data-migration)
25
-
3
+ - [Secured access to the Context Broker](#secured-access-to-the-context-broker)
4
+ - [NGSI-LD `GeoProperty` support](#ngsi-ld-geoproperty-support)
5
+ - [Metadata support](#metadata-support)
6
+ - [NGSI LD data and metadata considerations](#ngsi-ld-data-and-metadata-considerations)
7
+ - [NGSI-LD Linked Data support](#ngsi-ld-linked-data-support)
8
+ - [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision)
9
+ - [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs)
10
+ - [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode)
11
+ - [Data mapping plugins](#data-mapping-plugins)
12
+ - [Development](#development)
13
+ - [Provided plugins](#provided-plugins)
14
+ - [Timestamp Compression plugin (compressTimestamp)](#timestamp-compression-plugin-compresstimestamp)
15
+ - [Attribute Alias plugin (attributeAlias)](#attribute-alias-plugin-attributealias)
16
+ - [Event plugin (addEvents)](#event-plugin-addevents)
17
+ - [Timestamp Processing Plugin (timestampProcess)](#timestamp-processing-plugin-timestampprocess)
18
+ - [Expression Translation plugin (expressionTransformation)](#expression-translation-plugin-expressiontransformation)
19
+ - [Multientity plugin (multiEntity)](#multientity-plugin-multientity)
20
+ - [Bidirectionality plugin (bidirectional)](#bidirectionality-plugin-bidirectional)
21
+ - [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision)
22
+ - [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs)
23
+ - [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode)
26
24
 
27
25
  ### Secured access to the Context Broker
28
26
 
29
27
  For access to instances of the Context Broker secured with a
30
28
  [PEP Proxy](https://github.com/telefonicaid/fiware-orion-pep), an authentication mechanism based in Keystone Trust
31
- tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a subservice.
32
- It is a long-term token that can be issued by any user to give another user permissions
33
- to impersonate him with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term
34
- access token.
29
+ tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a
30
+ subservice. It is a long-term token that can be issued by any user to give another user permissions to impersonate him
31
+ with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term access
32
+ token.
35
33
 
36
34
  For the authentication mechanisms to work, the `authentication` attribute in the configuration has to be fully
37
35
  configured, and the `authentication.enabled` subattribute should have the value `true`.
@@ -73,15 +71,18 @@ Agent.
73
71
 
74
72
  Complete info on Keystone trust tokens could be found at:
75
73
 
76
- - https://docs.openstack.org/keystone/stein/user/trusts
77
- - https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts
74
+ - [Trusts concept](https://docs.openstack.org/keystone/stein/user/trusts)
75
+ - [Trusts API](https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts)
76
+
77
+ ### NGSI-LD `GeoProperty` support
78
78
 
79
- ### GeoJSON support NGSI-LD only
79
+ For NGSI-LD only, the defined `type` of any GeoJSON attribute can be any set using any of the standard NGSI-v2 GeoJSON
80
+ types - (e.g. `geo:json`, `geo:point`). NGSI-LD formats such as `GeoProperty`, `Point` and `LineString` are also
81
+ accepted `type` values. If the latitude and longitude are received as separate measures, the JEXL or legacy
82
+ [expression language](expressionLanguage.md) can be used to concatenate them into GeoJSON objects an array of tuples or
83
+ a string as shown
80
84
 
81
- The defined `type` of any GeoJSON attribute can be any set to any of the standard NGSI-v2 GeoJSON types - (e.g.
82
- `geo:json`, `geo:point`). NGSI-LD formats such as `GeoProperty`, `Point` and `LineString` are also accepted `type`
83
- values. If the latitude and longitude are received as separate measures, the
84
- [expression language](expressionLanguage.md) can be used to concatenate them.
85
+ #### Legacy - encode as String
85
86
 
86
87
  ```json
87
88
  {
@@ -99,8 +100,30 @@ values. If the latitude and longitude are received as separate measures, the
99
100
  }
100
101
  ```
101
102
 
102
- For `attributes` and `static_attributes` which need to be formatted as GeoJSON values, three separate input formats are
103
- accepted. Provided the `type` is provisioned correctly, the `value` may be defined using any of the following formats:
103
+ #### JEXL - encode as GeoJSON
104
+
105
+ ```json
106
+ {
107
+ "entity_type": "GPS",
108
+ "resource": "/iot/d",
109
+ "protocol": "PDI-IoTA-JSON",
110
+ "expressionLanguage": "jexl",
111
+ ..etc
112
+ "attributes": [
113
+ {
114
+ "name": "location",
115
+ "type": "geo:json",
116
+ "expression": "{coordinates: [longitude,latitude], type: 'Point'}"
117
+ }
118
+ ]
119
+ }
120
+ ```
121
+
122
+ JEXL can be used to create GeoJSON objects directly. The Legacy expression language does not support GeoJSON. However,
123
+ there is a workaround specifically for NGSI-LD Entities which always require `location` to be encoded as GeoJSON. For
124
+ `attributes` and `static_attributes` which need to be formatted as GeoJSON values, three separate input formats are
125
+ currently accepted. Provided the `type` is provisioned correctly, the `value` may be defined using any of the following
126
+ formats:
104
127
 
105
128
  - a comma delimited string
106
129
 
@@ -269,26 +292,70 @@ updated as shown:
269
292
 
270
293
  ### Autoprovision configuration (autoprovision)
271
294
 
272
- By default, when a measure arrives to the IoTAgent, if the `device_id` does not match with an existing one, then, the IoTA
273
- creates a new device and a new entity according to the group config. Defining the field `autoprovision` to `false`
274
- when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the
275
- data to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is
276
- intended to avoid provisioning devices (and for it to be effective, it would have to be provisional).
295
+ By default, when a measure arrives to the IoTAgent, if the `device_id` does not match with an existing one, then, the
296
+ IoTA creates a new device and a new entity according to the group config. Defining the field `autoprovision` to `false`
297
+ when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the data
298
+ to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is intended
299
+ to avoid provisioning devices (and for it to be effective, it would have to be provisional).
277
300
 
278
301
  ### Explicitly defined attributes (explicitAttrs)
279
302
 
280
- If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is stored
281
- in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure element. By adding the
282
- field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the measure elements that are not defined
283
- in the mappings of device or group provision, persisting only the one defined in the mappings of the provision. If `explicitAttrs`
284
- is provided both at device and group level, the device level takes precedence.
303
+ If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is
304
+ stored in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure
305
+ element. By adding the field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the
306
+ measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in
307
+ the mappings of the provision. If `explicitAttrs` is provided both at device and group level, the device level takes
308
+ precedence. Additionally `explicitAttrs` can be used to define which meassures defined in JSON/JEXL array will be
309
+ propagated to NGSI interface.
310
+
311
+ The different possibilities are summarized below:
312
+
313
+ Case 1 (default):
314
+
315
+ ```
316
+ "explicitAttrs": false
317
+ ```
318
+
319
+ every measure will be propagated to NGSI interface.
320
+
321
+ Case 2:
322
+
323
+ ```
324
+ "explicitAttrs": true
325
+ ```
326
+
327
+ just measures defined in active, static (plus conditionally TimeInstant) will be propagated to NGSI interface.
328
+
329
+ Case 3:
330
+
331
+ ```
332
+ "explicitAttrs": "['attr1','atrr2']"
333
+ ```
334
+
335
+ just measures defined in the array will be will be propagated to NGSI interface (note that in this case the value of
336
+ `explicitAttrs` is not a JSON but a string that looks likes a JSON).
337
+
338
+ Case 4:
339
+
340
+ ```
341
+ "explicitAtttr": "<JEXL expression resulting in bool or array>"
342
+ ```
343
+
344
+ depending on the JEXL expression evaluation:
345
+
346
+ - If it evaluates to `true` every measure will be propagated to NGSI interface (as in case 1)
347
+ - If it evaluates to `false` just measures defined in active, static (plus conditionally TimeInstant) will be
348
+ propagated to NGSI interface (as in case 2)
349
+ - If it evaluates to an array just measures defined in the array will be will be propagated to NGSI interface (as in
350
+ case 3)
285
351
 
286
352
  ### Configuring operation to persist the data in Context Broker (appendMode)
287
353
 
288
- This is a flag that can be enabled by activating the parameter `appendMode` in the configuration file or by using the `IOTA_APPEND_MODE`
289
- environment variable (more info [here](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md)).
290
- If this flag is activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the
291
- default UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care.
354
+ This is a flag that can be enabled by activating the parameter `appendMode` in the configuration file or by using the
355
+ `IOTA_APPEND_MODE` environment variable (more info
356
+ [here](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md)). If this flag is
357
+ activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the default
358
+ UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care.
292
359
 
293
360
  ### Data mapping plugins
294
361
 
@@ -373,8 +440,8 @@ events in the IoT Agent with the configured type name will be marked as events.
373
440
 
374
441
  ##### Timestamp Processing Plugin (timestampProcess)
375
442
 
376
- This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSIv2,
377
- the plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
443
+ This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSIv2, the
444
+ plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
378
445
  Standard `observedAt` property-of-a-property is used instead.
379
446
 
380
447
  ##### Expression Translation plugin (expressionTransformation)
@@ -438,7 +505,8 @@ When a device is provisioned with bidirectional attributes, the IoTAgent subscri
438
505
  change notification for that attribute arrives to the IoTA, it applies the transformation defined in the device
439
506
  provisioning payload to the notification, and calls the underlying notification handler with the transformed entity.
440
507
 
441
- The following `attributes` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid translation from geo:point to geo:json)
508
+ The following `attributes` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid
509
+ translation from geo:point to geo:json)
442
510
 
443
511
  ```json
444
512
  "attributes": [
@@ -470,35 +538,3 @@ subscription payload.
470
538
  For each attribute in the `reverse` array, an expression must be defined to calculate its value based on the
471
539
  notification attributes. This value will be passed to the underlying protocol with the `object_id` name. Details about
472
540
  how the value is then progressed to the device are protocol-specific.
473
-
474
- ### Old IoTAgent data migration
475
-
476
- In order to ease the transition from the old IoTAgent implementation (formerly known as IDAS) to the new Node.js based
477
- implementations, a data migration tool has been developed. This data migration tool has been integrated as a command in
478
- the IoTAgent command-line tester.
479
-
480
- In order to perform a full migration, follow this steps:
481
-
482
- - From the project root, start the command-line tester:
483
-
484
- ```bash
485
- bin/iotAgentTester.js
486
- ```
487
-
488
- - Configure the MongoDB host and port, and the origin Database (that holds the data to be migrated):
489
-
490
- ```bash
491
- configMigration localhost 27017 originDB
492
- ```
493
-
494
- - Launch the migration, using the special value "\*" as service and subservice
495
-
496
- ```bash
497
- migrate targetDB * *
498
- ```
499
-
500
- Some warnings may appear with the "Attribute [_id] was not found for item translation" message during the migration.
501
- They show the values existing in the original DB that had no translation for the target DB.
502
-
503
- If you want to restrict the migration for certain services and subservices, just substitute the `*` value for the
504
- particular service and subservice you want to use.
package/doc/api.md CHANGED
@@ -75,26 +75,26 @@ information configured:
75
75
  The table below shows the information held in the service group provisioning resource. The table also contains the
76
76
  correspondence between the API resource fields and the same fields in the database model.
77
77
 
78
- | Payload Field | DB Field | Definition |
79
- | ------------------------------ | ------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80
- | `service` | `service` | Service of the devices of this type |
81
- | `subservice` | `subservice` | Subservice of the devices of this type. |
82
- | `resource` | `resource` | string representing the Southbound resource that will be used to assign a type to a device (e.g.: pathname in the southbound port). |
83
- | `apikey` | `apikey` | API Key string. |
84
- | `timestamp` | `timestamp` | Optional flag about whether or not to add the `TimeInstant` attribute to the device entity created, as well as a `TimeInstant` metadata to each attribute, with the current timestamp. With NGSI-LD, the Standard `observedAt` property-of-a-property is created instead. | true |
85
- | `entity_type` | `entity_type` | name of the Entity `type` to assign to the group. |
86
- | `trust` | `trust` | trust token to use for secured access to the Context Broker for this type of devices (optional; only needed for secured scenarios). |
87
- | `cbHost` | `cbHost` | Context Broker connection information. This options can be used to override the global ones for specific types of devices. |
88
- | `lazy` | `lazy` | list of common lazy attributes of the device. For each attribute, its `name` and `type` must be provided. |
89
- | `commands` | `commands` | list of common commands attributes of the device. For each attribute, its `name` and `type` must be provided, additional `metadata` is optional. |
90
- | `attributes` | `attributes` | list of common active attributes of the device. For each attribute, its `name` and `type` must be provided, additional `metadata` is optional. |
91
- | `static_attributes` | `staticAttributes` | this attributes will be added to all the entities of this group 'as is', additional `metadata` is optional. |
92
- | `internal_attributes` | `internalAttributes` | optional section with free format, to allow specific IoT Agents to store information along with the devices in the Device Registry. |
93
- | `expressionLanguage` | `expresionLanguage` | optional boolean value, to set expression language used to compute expressions, possible values are: legacy or jexl. When not set or wrongly set, `legacy` is used as default value. |
94
- | `explicitAttrs` | `explicitAttrs` | optional boolean value, to support selective ignore of measures so that IOTA doesn’t progress. If not specified default is `false`. |
95
- | `ngsiVersion` | `ngsiVersion` | optional string value used in mixed mode to switch between **NGSI-v2** and **NGSI-LD** payloads. Possible values are: `v2` or `ld`. The default is `v2`. When not running in mixed mode, this field is ignored. |
96
- | `defaultEntityNameConjunction` | `defaultEntityNameConjunction` | optional string value to set default conjunction string used to compose a default `entity_name` when is not provided at device provisioning time. |
97
- | `autoprovision` | `autoprovision` | optional boolean: If `false`, autoprovisioned devices (i.e. devices that are not created with an explicit provision operation but when the first measure arrives) are not allowed in this group. Default (in the case of omitting the field) is `true`. |
78
+ | Payload Field | DB Field | Definition |
79
+ | ------------------------------ | ------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80
+ | `service` | `service` | Service of the devices of this type |
81
+ | `subservice` | `subservice` | Subservice of the devices of this type. |
82
+ | `resource` | `resource` | string representing the Southbound resource that will be used to assign a type to a device (e.g.: pathname in the southbound port). |
83
+ | `apikey` | `apikey` | API Key string. |
84
+ | `timestamp` | `timestamp` | Optional flag about whether or not to add the `TimeInstant` attribute to the device entity created, as well as a `TimeInstant` metadata to each attribute, with the current timestamp. With NGSI-LD, the Standard `observedAt` property-of-a-property is created instead. | true |
85
+ | `entity_type` | `entity_type` | name of the Entity `type` to assign to the group. |
86
+ | `trust` | `trust` | trust token to use for secured access to the Context Broker for this type of devices (optional; only needed for secured scenarios). |
87
+ | `cbHost` | `cbHost` | Context Broker connection information. This options can be used to override the global ones for specific types of devices. |
88
+ | `lazy` | `lazy` | list of common lazy attributes of the device. For each attribute, its `name` and `type` must be provided. |
89
+ | `commands` | `commands` | list of common commands attributes of the device. For each attribute, its `name` and `type` must be provided, additional `metadata` is optional. |
90
+ | `attributes` | `attributes` | list of common active attributes of the device. For each attribute, its `name` and `type` must be provided, additional `metadata` is optional. |
91
+ | `static_attributes` | `staticAttributes` | this attributes will be added to all the entities of this group 'as is', additional `metadata` is optional. |
92
+ | `internal_attributes` | `internalAttributes` | optional section with free format, to allow specific IoT Agents to store information along with the devices in the Device Registry. |
93
+ | `expressionLanguage` | `expresionLanguage` | optional boolean value, to set expression language used to compute expressions, possible values are: legacy or jexl. When not set or wrongly set, `legacy` is used as default value. |
94
+ | `explicitAttrs` | `explicitAttrs` | optional field to support selective ignore of measures so that IOTA doesn’t progress. See details in [specific section](advanced-topics.md#explicitly-defined-attributes-explicitattrs) |
95
+ | `ngsiVersion` | `ngsiVersion` | optional string value used in mixed mode to switch between **NGSI-v2** and **NGSI-LD** payloads. Possible values are: `v2` or `ld`. The default is `v2`. When not running in mixed mode, this field is ignored. |
96
+ | `defaultEntityNameConjunction` | `defaultEntityNameConjunction` | optional string value to set default conjunction string used to compose a default `entity_name` when is not provided at device provisioning time. |
97
+ | `autoprovision` | `autoprovision` | optional boolean: If `false`, autoprovisioned devices (i.e. devices that are not created with an explicit provision operation but when the first measure arrives) are not allowed in this group. Default (in the case of omitting the field) is `true`. |
98
98
 
99
99
  ### Service Group Endpoint
100
100
 
@@ -205,45 +205,45 @@ Note that there is a 1:1 correspondence between payload fields and DB fields (bu
205
205
 
206
206
  ### Relationship between service groups and devices
207
207
 
208
- Devices may be associated to exisiting service groups (or not) based in `apiKey` matching or `type` matching (in the case `apiKey`
209
- matching fails). For instance, let's consider a situation in which a service group has been provisioned with `type=X`/`apiKey=111`
210
- and no other service group has been provisioned.
208
+ Devices may be associated to exisiting service groups (or not) based in `apiKey` matching or `type` matching (in the
209
+ case `apiKey` matching fails). For instance, let's consider a situation in which a service group has been provisioned
210
+ with `type=X`/`apiKey=111` and no other service group has been provisioned.
211
211
 
212
- * IoT Agent receives an anonymous measure with `apiKey=111`. The matching `apiKey` means the entity inherits from service group.
213
- Device entity has `type=X` and `apiKey=111`
214
- * IoT Agent receives a provisioning request for an explicit device of `type=Y`/`apiKey=111`. The matching `apiKey` means the entity
215
- inherits from service group but type is overridden. Device entity has `type=Y` and `apiKey=111`
216
- * IoT Agent receives a provisioning request for an explicit device of `type=X`/`apiKey=222`. The matching `type` means the entity
217
- inherits from service group but `apiKey` is overridden. Device entity has `type=X` and `apiKey=222`.
218
- * IoT Agent receives a provisioning request for an explicit device of `type=Y`/`apiKey=222`. No matching. Device entity has `type=Y`
219
- and `apiKey=222` and no service group.
212
+ - IoT Agent receives an anonymous measure with `apiKey=111`. The matching `apiKey` means the entity inherits from
213
+ service group. Device entity has `type=X` and `apiKey=111`
214
+ - IoT Agent receives a provisioning request for an explicit device of `type=Y`/`apiKey=111`. The matching `apiKey`
215
+ means the entity inherits from service group but type is overridden. Device entity has `type=Y` and `apiKey=111`
216
+ - IoT Agent receives a provisioning request for an explicit device of `type=X`/`apiKey=222`. The matching `type` means
217
+ the entity inherits from service group but `apiKey` is overridden. Device entity has `type=X` and `apiKey=222`.
218
+ - IoT Agent receives a provisioning request for an explicit device of `type=Y`/`apiKey=222`. No matching. Device
219
+ entity has `type=Y` and `apiKey=222` and no service group.
220
220
 
221
221
  ### Device model
222
222
 
223
223
  The table below shows the information held in the Device resource. The table also contains the correspondence between
224
224
  the API resource fields and the same fields in the database model.
225
225
 
226
- | Payload Field | DB Field | Definition | Example of value |
227
- | --------------------- | -------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------- |
228
- | `device_id` | `id` | Device ID that will be used to identify the device. | UO834IO |
229
- | `service` | `service` | Name of the service the device belongs to (will be used in the fiware-service header). | smartGondor |
230
- | `service_path` | `subservice` | Name of the subservice the device belongs to (used in the fiware-servicepath header). | /gardens |
231
- | `entity_name` | `name` | Name of the entity representing the device in the Context Broker | ParkLamplight12 |
232
- | `entity_type` | `type` | Type of the entity in the Context Broker | Lamplights |
233
- | `timezone` | `timezone` | Time zone of the sensor if it has any | America/Santiago |
234
- | `timestamp` | `timestamp` | Optional flag about whether or not to add the `TimeInstant` attribute to the device entity created, as well as a `TimeInstant` metadata to each attribute, with the current timestamp. With NGSI-LD, the Standard `observedAt` property-of-a-property is created instead. | true |
235
- | `apikey` | `apikey` | Optional Apikey key string to use instead of group apikey | 9n4hb1vpwbjozzmw9f0flf9c2 |
236
- | `endpoint` | `endpoint` | Endpoint where the device is going to receive commands, if any. | http://theDeviceUrl:1234/commands |
237
- | `protocol` | `protocol` | Name of the device protocol, for its use with an IoT Manager. | IoTA-UL |
238
- | `transport` | `transport` | Name of the device transport protocol, for the IoT Agents with multiple transport protocols. | MQTT |
239
- | `attributes` | `active` | List of active attributes of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
240
- | `lazy` | `lazy` | List of lazy attributes of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
241
- | `commands` | `commands` | List of commands of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
242
- | `internal_attributes` | `internalAttributes` | List of internal attributes with free format for specific IoT Agent configuration | LWM2M mappings from object URIs to attributes |
243
- | `static_attributes` | `staticAttributes` | List of static attributes to append to the entity. All the updateContext requests to the CB will have this set of attributes appended. | `[ { "name": "attr_name", "type": "Text" } ]` |
244
- | `expressionLanguage` | `expresionLanguage` | optional boolean value, to set expression language used to compute expressions, possible values are: legacy or jexl. When not set or wrongly set, legacy is used as default value. |
245
- | `explicitAttrs` | `explicitAttrs` | Boolean value to support selective ignore of measures for device so that IOTA doesn’t progress. If not specified default is `false`. | `true/false` |
246
- | `ngsiVersion` | `ngsiVersion` | optional string value used in mixed mode to switch between **NGSI-v2** and **NGSI-LD** payloads. The default is `v2`. When not running in mixed mode, this field is ignored. | `v2/ld` |
226
+ | Payload Field | DB Field | Definition | Example of value |
227
+ | --------------------- | -------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------- |
228
+ | `device_id` | `id` | Device ID that will be used to identify the device. | UO834IO |
229
+ | `service` | `service` | Name of the service the device belongs to (will be used in the fiware-service header). | smartGondor |
230
+ | `service_path` | `subservice` | Name of the subservice the device belongs to (used in the fiware-servicepath header). | /gardens |
231
+ | `entity_name` | `name` | Name of the entity representing the device in the Context Broker | ParkLamplight12 |
232
+ | `entity_type` | `type` | Type of the entity in the Context Broker | Lamplights |
233
+ | `timezone` | `timezone` | Time zone of the sensor if it has any | America/Santiago |
234
+ | `timestamp` | `timestamp` | Optional flag about whether or not to add the `TimeInstant` attribute to the device entity created, as well as a `TimeInstant` metadata to each attribute, with the current timestamp. With NGSI-LD, the Standard `observedAt` property-of-a-property is created instead. | true |
235
+ | `apikey` | `apikey` | Optional Apikey key string to use instead of group apikey | 9n4hb1vpwbjozzmw9f0flf9c2 |
236
+ | `endpoint` | `endpoint` | Endpoint where the device is going to receive commands, if any. | http://theDeviceUrl:1234/commands |
237
+ | `protocol` | `protocol` | Name of the device protocol, for its use with an IoT Manager. | IoTA-UL |
238
+ | `transport` | `transport` | Name of the device transport protocol, for the IoT Agents with multiple transport protocols. | MQTT |
239
+ | `attributes` | `active` | List of active attributes of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
240
+ | `lazy` | `lazy` | List of lazy attributes of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
241
+ | `commands` | `commands` | List of commands of the device | `[ { "name": "attr_name", "type": "Text" } ]` |
242
+ | `internal_attributes` | `internalAttributes` | List of internal attributes with free format for specific IoT Agent configuration | LWM2M mappings from object URIs to attributes |
243
+ | `static_attributes` | `staticAttributes` | List of static attributes to append to the entity. All the updateContext requests to the CB will have this set of attributes appended. | `[ { "name": "attr_name", "type": "Text" } ]` |
244
+ | `expressionLanguage` | `expresionLanguage` | optional boolean value, to set expression language used to compute expressions, possible values are: legacy or jexl. When not set or wrongly set, legacy is used as default value. |
245
+ | `explicitAttrs` | `explicitAttrs` | optional field to support selective ignore of measures so that IOTA doesn’t progress. See details in [specific section](advanced-topics.md#explicitly-defined-attributes-explicitattrs) | (see details in specific section) |
246
+ | `ngsiVersion` | `ngsiVersion` | optional string value used in mixed mode to switch between **NGSI-v2** and **NGSI-LD** payloads. The default is `v2`. When not running in mixed mode, this field is ignored. | `v2/ld` |
247
247
 
248
248
  #### Attribute lists
249
249
 
@@ -27,15 +27,15 @@ The following sections show the available options in detail.
27
27
 
28
28
  ### Environment requirements
29
29
 
30
- A [MongoDB](https://www.mongodb.com/) 3.2+ instance is required to run tests.
31
- You can deploy one by using the commodity `docker-compose-dev.yml`:
30
+ A [MongoDB](https://www.mongodb.com/) 3.2+ instance is required to run tests. You can deploy one by using the commodity
31
+ `docker-compose-dev.yml`:
32
32
 
33
33
  ```
34
34
  docker-compose -f docker-compose-dev.yml up -d
35
35
  ```
36
36
 
37
- To run docker compose you will need [docker](https://docs.docker.com/get-docker/)
38
- and [docker-compose](https://docs.docker.com/compose/install/).
37
+ To run docker compose you will need [docker](https://docs.docker.com/get-docker/) and
38
+ [docker-compose](https://docs.docker.com/compose/install/).
39
39
 
40
40
  ### Testing
41
41
 
@@ -51,6 +51,13 @@ To run tests, type
51
51
  npm test
52
52
  ```
53
53
 
54
+ There are additional targets starting with `test:` prefix to run specific test subsets isolatedly. For instance, the
55
+ `test:expressions` target runs the subset of tests related with expression language feature:
56
+
57
+ ```bash
58
+ npm run test:expressions
59
+ ```
60
+
54
61
  ### Debug Test
55
62
 
56
63
  To debug the code while running run tests, type
@@ -59,8 +66,8 @@ To debug the code while running run tests, type
59
66
  npm run test:debug
60
67
  ```
61
68
 
62
- In the console the link to the debugger will be provided. You can connect
63
- to it via Chrome, for example, by opening the following url: ```chrome://inspect```.
69
+ In the console the link to the debugger will be provided. You can connect to it via Chrome, for example, by opening the
70
+ following url: `chrome://inspect`.
64
71
 
65
72
  Additional debug clients are listed on [node.js](https://nodejs.org/en/docs/guides/debugging-getting-started/).
66
73