iotagent-node-lib 2.15.1 → 2.19.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.
- package/.github/workflows/ci.yml +17 -1
- package/.readthedocs.yml +7 -0
- package/CHANGES_NEXT_RELEASE +0 -1
- package/README.md +1 -0
- package/doc/Contribution.md +60 -1
- package/doc/advanced-topics.md +136 -14
- package/doc/api.md +38 -22
- package/doc/apiary/iotagent.apib +1 -3
- package/doc/architecture.md +2 -2
- package/doc/config-basic-example.js +0 -1
- package/doc/deprecated.md +2 -2
- package/doc/development.md +13 -6
- package/doc/expressionLanguage.md +519 -277
- package/doc/getting-started.md +0 -1
- package/doc/howto.md +13 -17
- package/doc/installationguide.md +67 -69
- package/doc/usermanual.md +48 -16
- package/docker/Mosquitto/Dockerfile +4 -9
- package/docker/Mosquitto/README.md +2 -0
- package/docker/Mosquitto/startMosquitto.sh +18 -1
- package/lib/command/commandLine.js +1 -1
- package/lib/commonConfig.js +5 -14
- package/lib/errors.js +0 -16
- package/lib/fiware-iotagent-lib.js +5 -0
- package/lib/jexlTranformsMap.js +71 -0
- package/lib/model/Command.js +1 -1
- package/lib/model/Device.js +5 -2
- package/lib/model/Group.js +20 -2
- package/lib/model/dbConn.js +7 -1
- package/lib/plugins/attributeAlias.js +6 -13
- package/lib/plugins/bidirectionalData.js +2 -27
- package/lib/plugins/expressionParser.js +41 -17
- package/lib/plugins/expressionPlugin.js +21 -27
- package/lib/plugins/jexlParser.js +71 -67
- package/lib/plugins/multiEntity.js +68 -147
- package/lib/plugins/pluginUtils.js +12 -48
- package/lib/plugins/timestampProcessPlugin.js +1 -46
- package/lib/request-shim.js +111 -0
- package/lib/services/common/domain.js +2 -2
- package/lib/services/common/genericMiddleware.js +6 -2
- package/lib/services/common/iotManagerService.js +1 -1
- package/lib/services/common/securityServiceKeystone.js +1 -1
- package/lib/services/common/securityServiceOAuth2.js +3 -2
- package/lib/services/devices/deviceRegistryMongoDB.js +29 -22
- package/lib/services/devices/deviceService.js +56 -33
- package/lib/services/devices/devices-NGSI-LD.js +42 -14
- package/lib/services/devices/devices-NGSI-mixed.js +3 -3
- package/lib/services/devices/devices-NGSI-v2.js +48 -24
- package/lib/services/devices/registrationUtils.js +1 -134
- package/lib/services/groups/groupRegistryMemory.js +2 -0
- package/lib/services/groups/groupRegistryMongoDB.js +58 -76
- package/lib/services/groups/groupService.js +1 -1
- package/lib/services/ngsi/entities-NGSI-LD.js +205 -124
- package/lib/services/ngsi/entities-NGSI-v2.js +142 -32
- package/lib/services/ngsi/ngsiService.js +4 -6
- package/lib/services/ngsi/ngsiUtils.js +0 -21
- package/lib/services/ngsi/subscription-NGSI-LD.js +14 -5
- package/lib/services/ngsi/subscriptionService.js +1 -4
- package/lib/services/northBound/contextServer-NGSI-LD.js +7 -2
- package/lib/services/northBound/contextServer-NGSI-v2.js +25 -13
- package/lib/services/northBound/contextServer.js +1 -4
- package/lib/services/northBound/contextServerUtils.js +0 -81
- package/lib/services/northBound/deviceProvisioningServer.js +36 -9
- package/lib/services/northBound/northboundServer.js +2 -0
- package/lib/services/northBound/restUtils.js +2 -39
- package/lib/templates/updateDevice.json +4 -0
- package/lib/templates/updateDeviceLax.json +4 -0
- package/package.json +13 -13
- package/test/tools/utils.js +2 -0
- package/test/unit/examples/deviceProvisioningRequests/provisionAnotherDevice.json +1 -1
- package/test/unit/examples/deviceProvisioningRequests/provisionDeviceMissingParameters.json +1 -1
- package/test/unit/examples/deviceProvisioningRequests/provisionDuplicatedDev.json +1 -1
- package/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json +1 -1
- package/test/unit/examples/deviceProvisioningRequests/provisionNewDeviceMalformed1.json +1 -1
- package/test/unit/examples/groupProvisioningRequests/multipleGroupsCreation.json +1 -1
- package/test/unit/examples/iotamRequests/registrationEmpty.json +1 -1
- package/test/unit/examples/iotamRequests/registrationWithGroups.json +2 -2
- package/test/unit/examples/iotamRequests/registrationWithGroupsWithoutCB.json +2 -2
- package/test/unit/examples/iotamRequests/registrationWithStaticGroups.json +2 -2
- package/test/unit/expressions/jexlExpression-test.js +119 -0
- package/test/unit/general/config-multi-core-test.js +1 -1
- package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +30 -77
- package/test/unit/general/deviceService-test.js +19 -35
- package/test/unit/general/loglevel-api_test.js +8 -13
- package/test/unit/general/migration-test.js +1 -0
- package/test/unit/general/startup-test.js +3 -2
- package/test/unit/general/statistics-persistence_test.js +2 -2
- package/test/unit/general/statistics-service_test.js +2 -2
- package/test/unit/lazyAndCommands/commandRegistry_test.js +18 -18
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +16 -24
- package/test/unit/mongodb/mongodb-connectionoptions-test.js +2 -2
- package/test/unit/mongodb/mongodb-group-registry-test.js +11 -11
- package/test/unit/mongodb/mongodb-registry-test.js +55 -131
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent1.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent2.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent4.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup3.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateCommands1.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent1.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent2.json +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent3.json +1 -1
- package/test/unit/ngsi-ld/examples/contextRequests/createMinimumProvisionedDevice.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDevice.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceMultientity.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json +0 -14
- package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic2.json +0 -14
- package/test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic3.json +1 -15
- package/test/unit/ngsi-ld/examples/contextRequests/createTimeInstantMinimumDevice.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAliasPlugin6.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast5.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin12a.json +7 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin13.json +13 -13
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin16.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin17.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin1a.json +18 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin29.json +18 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin31.json +15 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +17 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin33.json +18 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin34.json +17 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4a.json +36 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin5.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin7.json +16 -16
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin8a.json +18 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextGeoproperties3.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin15.json +25 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +6 -6
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +3 -3
- package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionActiveAttributes1.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionCommands1.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionDeviceStatic.json +0 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateProvisionMinimumDevice.json +0 -7
- package/test/unit/ngsi-ld/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +20 -17
- package/test/unit/ngsi-ld/examples/subscriptionRequests/simpleSubscriptionRequest.json +18 -15
- package/test/unit/ngsi-ld/examples/subscriptionRequests/simpleSubscriptionRequest2.json +18 -15
- package/test/unit/ngsi-ld/expressions/expressionBasedTransformations-test.js +21 -21
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1018 -0
- package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +2 -2
- package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +24 -24
- package/test/unit/ngsi-ld/general/deviceService-test.js +7 -7
- package/test/unit/ngsi-ld/general/https-support-test.js +14 -13
- package/test/unit/ngsi-ld/general/iotam-autoregistration-test.js +8 -7
- package/test/unit/ngsi-ld/general/startup-test.js +2 -1
- package/test/unit/ngsi-ld/lazyAndCommands/active-devices-attribute-update-test.js +10 -8
- package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +11 -12
- package/test/unit/ngsi-ld/lazyAndCommands/lazy-devices-test.js +25 -29
- package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +16 -15
- package/test/unit/ngsi-ld/ngsiService/active-devices-test.js +18 -17
- package/test/unit/ngsi-ld/ngsiService/autocast-test.js +13 -12
- package/test/unit/ngsi-ld/ngsiService/geoproperties-test.js +10 -9
- package/test/unit/ngsi-ld/ngsiService/staticAttributes-test.js +3 -3
- package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +25 -24
- package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +13 -12
- package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +27 -26
- package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +5 -5
- package/test/unit/ngsi-ld/plugins/event-plugin_test.js +3 -3
- package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +75 -14
- package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +3 -3
- package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +54 -53
- package/test/unit/ngsi-ld/provisioning/device-registration_test.js +20 -19
- package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +23 -22
- package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +58 -70
- package/test/unit/ngsi-ld/provisioning/provisionDeviceMultientity-test.js +8 -7
- package/test/unit/ngsi-ld/provisioning/removeProvisionedDevice-test.js +19 -19
- package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +18 -20
- package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +43 -49
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +16 -14
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent1.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent2.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent3.json +19 -0
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent4.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgent5.json +19 -0
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerProvisionedDevice.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup3.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/updateCommands1.json +3 -3
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/updateIoTAgent1.json +3 -3
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/updateIoTAgent2.json +1 -1
- package/test/unit/ngsiv2/examples/contextAvailabilityRequests/updateIoTAgent3.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json +17 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin12.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin15.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin16.json +14 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin17.json +14 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin18.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin19.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin2.json +13 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin20.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin21.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin22.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin23.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin24.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin25.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin26.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin27.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin28.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json +22 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin30.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin31.json +18 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +16 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin33.json +22 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin4.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin6.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin7.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin8.json +17 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMiddleware1.json +10 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMiddleware2.json +10 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin1.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin10.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +13 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin12.json +33 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin13.json +33 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin14.json +33 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin15.json +25 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin16.json +25 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin2.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin3.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin4.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin5.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin6.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin7.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin8.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin9.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +8 -8
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +4 -4
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin3.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin4.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateProvisionDevice.json +20 -0
- package/test/unit/ngsiv2/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +1 -1
- package/test/unit/ngsiv2/examples/subscriptionRequests/simpleSubscriptionRequest.json +1 -1
- package/test/unit/ngsiv2/examples/subscriptionRequests/simpleSubscriptionRequest2.json +1 -1
- package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +93 -60
- package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +16 -16
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +548 -164
- package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +34 -33
- package/test/unit/ngsiv2/general/deviceService-test.js +15 -14
- package/test/unit/ngsiv2/general/https-support-test.js +14 -13
- package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +8 -7
- package/test/unit/ngsiv2/general/startup-test.js +2 -1
- package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +9 -7
- package/test/unit/ngsiv2/lazyAndCommands/command-test.js +13 -12
- package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +323 -51
- package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +22 -20
- package/test/unit/ngsiv2/ngsiService/active-devices-test.js +114 -26
- package/test/unit/ngsiv2/ngsiService/autocast-test.js +16 -16
- package/test/unit/ngsiv2/ngsiService/geoproperties-test.js +39 -38
- package/test/unit/{ngsiService → ngsiv2/ngsiService}/queryDeviceInformationInCb-test.js +25 -54
- package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +5 -5
- package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +25 -24
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +22 -22
- package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +27 -26
- package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +7 -7
- package/test/unit/ngsiv2/plugins/event-plugin_test.js +4 -4
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +549 -24
- package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +4 -4
- package/test/unit/{plugins → ngsiv2/plugins}/translation-inPlugins_test.js +25 -25
- package/test/unit/{provisioning → ngsiv2/provisioning}/device-group-api-test.js +44 -75
- package/test/unit/{provisioning/device-group-utils_test.js → ngsiv2/provisioning/device-group-utils-test.js} +15 -14
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +74 -73
- package/test/unit/ngsiv2/provisioning/device-registration_test.js +20 -19
- package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +30 -29
- package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +58 -69
- package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +8 -7
- package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +19 -19
- package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +18 -19
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +49 -52
- package/test/unit/plugins/capture-configuration-inPlugins_test.js +6 -4
- package/test/unit/plugins/capture-provision-inPlugins_test.js +13 -23
- package/.nyc_output/016aca19-69bf-4681-9b41-2835c5131681.json +0 -1
- package/.nyc_output/processinfo/016aca19-69bf-4681-9b41-2835c5131681.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/lib/services/devices/devices-NGSI-v1.js +0 -293
- package/lib/services/devices/registrationUtils.js_avega +0 -589
- package/lib/services/ngsi/entities-NGSI-v1.js +0 -300
- package/lib/services/ngsi/subscription-NGSI-v1.js +0 -234
- package/lib/services/northBound/contextServer-NGSI-v1.js +0 -526
- package/lib/templates/notificationTemplateNgsi1.json +0 -75
- package/lib/templates/updateContextNgsi1.json +0 -50
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent1.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent2.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent3.json +0 -25
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgent4.json +0 -22
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgentAttributeUpdates.json +0 -16
- package/test/unit/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerNewDevice1.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerNewDevice2.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDevice.json +0 -25
- package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +0 -21
- package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +0 -33
- package/test/unit/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +0 -33
- package/test/unit/examples/contextAvailabilityRequests/unregisterDevice1.json +0 -22
- package/test/unit/examples/contextAvailabilityRequests/unregisterDevice3.json +0 -26
- package/test/unit/examples/contextAvailabilityRequests/unregisterProvisionedDevice.json +0 -26
- package/test/unit/examples/contextAvailabilityRequests/updateCommands1.json +0 -22
- package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent1.json +0 -22
- package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent2.json +0 -26
- package/test/unit/examples/contextAvailabilityRequests/updateIoTAgent3.json +0 -22
- package/test/unit/examples/contextAvailabilityResponses/registerIoTAgent1Failed.json +0 -8
- package/test/unit/examples/contextAvailabilityResponses/registerIoTAgent1Success.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/registerNewDevice1Success.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/registerNewDevice2Success.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/registerProvisionedDeviceSuccess.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/unregisterDevice1Failed.json +0 -8
- package/test/unit/examples/contextAvailabilityResponses/unregisterDevice1Success.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/updateCommands1Success.json +0 -4
- package/test/unit/examples/contextAvailabilityResponses/updateIoTAgent1Success.json +0 -6
- package/test/unit/examples/contextProviderResponses/queryInformationResponse.json +0 -22
- package/test/unit/examples/contextProviderResponses/queryInformationResponseEmptyAttributes.json +0 -22
- package/test/unit/examples/contextProviderResponses/queryInformationStaticAttributesResponse.json +0 -27
- package/test/unit/examples/contextProviderResponses/updateInformationResponse.json +0 -22
- package/test/unit/examples/contextProviderResponses/updateInformationResponse2.json +0 -22
- package/test/unit/examples/contextRequests/contextSubscriptionRequest.json +0 -20
- package/test/unit/examples/contextRequests/contextSubscriptionRequest2.json +0 -20
- package/test/unit/examples/contextRequests/createBidirectionalDevice.json +0 -17
- package/test/unit/examples/contextRequests/createDatetimeProvisionedDevice.json +0 -17
- package/test/unit/examples/contextRequests/createGeopointProvisionedDevice.json +0 -17
- package/test/unit/examples/contextRequests/createMinimumProvisionedDevice.json +0 -17
- package/test/unit/examples/contextRequests/createProvisionedDevice.json +0 -32
- package/test/unit/examples/contextRequests/createProvisionedDeviceMultientity.json +0 -32
- package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroup.json +0 -47
- package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json +0 -52
- package/test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic2.json +0 -52
- package/test/unit/examples/contextRequests/createTimeinstantDevice.json +0 -17
- package/test/unit/examples/contextRequests/queryContext1.json +0 -13
- package/test/unit/examples/contextRequests/queryContext2.json +0 -13
- package/test/unit/examples/contextRequests/queryContextAliasPlugin1.json +0 -10
- package/test/unit/examples/contextRequests/queryContextCompressTimestamp1.json +0 -13
- package/test/unit/examples/contextRequests/updateActiveAttributes.json +0 -11
- package/test/unit/examples/contextRequests/updateContext1.json +0 -22
- package/test/unit/examples/contextRequests/updateContext2.json +0 -22
- package/test/unit/examples/contextRequests/updateContext3.json +0 -17
- package/test/unit/examples/contextRequests/updateContext3WithStatic.json +0 -22
- package/test/unit/examples/contextRequests/updateContext4.json +0 -22
- package/test/unit/examples/contextRequests/updateContext5.json +0 -19
- package/test/unit/examples/contextRequests/updateContextAliasPlugin.json +0 -22
- package/test/unit/examples/contextRequests/updateContextAliasPlugin2.json +0 -17
- package/test/unit/examples/contextRequests/updateContextAppendMode.json +0 -22
- package/test/unit/examples/contextRequests/updateContextCommandError.json +0 -22
- package/test/unit/examples/contextRequests/updateContextCommandExpired.json +0 -22
- package/test/unit/examples/contextRequests/updateContextCommandFinish.json +0 -22
- package/test/unit/examples/contextRequests/updateContextCommandStatus.json +0 -17
- package/test/unit/examples/contextRequests/updateContextCompressTimestamp1.json +0 -22
- package/test/unit/examples/contextRequests/updateContextCompressTimestamp2.json +0 -29
- package/test/unit/examples/contextRequests/updateContextExpressionPlugin1.json +0 -17
- package/test/unit/examples/contextRequests/updateContextExpressionPlugin2.json +0 -27
- package/test/unit/examples/contextRequests/updateContextExpressionPlugin3.json +0 -17
- package/test/unit/examples/contextRequests/updateContextExpressionPlugin4.json +0 -17
- package/test/unit/examples/contextRequests/updateContextExpressionPlugin5.json +0 -27
- package/test/unit/examples/contextRequests/updateContextMiddleware1.json +0 -22
- package/test/unit/examples/contextRequests/updateContextMultiEntityPlugin3.json +0 -35
- package/test/unit/examples/contextRequests/updateContextMultientityPlugin1.json +0 -30
- package/test/unit/examples/contextRequests/updateContextMultientityPlugin2.json +0 -30
- package/test/unit/examples/contextRequests/updateContextProcessTimestamp1.json +0 -29
- package/test/unit/examples/contextRequests/updateContextStaticAttributes.json +0 -22
- package/test/unit/examples/contextRequests/updateContextTimestamp.json +0 -41
- package/test/unit/examples/contextRequests/updateContextTimestampOverride.json +0 -22
- package/test/unit/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +0 -22
- package/test/unit/examples/contextRequests/updateContextTimestampTimezone.json +0 -41
- package/test/unit/examples/contextRequests/updateProvisionActiveAttributes1.json +0 -17
- package/test/unit/examples/contextRequests/updateProvisionCommands1.json +0 -27
- package/test/unit/examples/contextRequests/updateProvisionDeviceStatic.json +0 -38
- package/test/unit/examples/contextRequests/updateProvisionMinimumDevice.json +0 -17
- package/test/unit/examples/contextResponses/contextSubscriptionRequest2Success.json +0 -7
- package/test/unit/examples/contextResponses/contextSubscriptionRequestSuccess.json +0 -7
- package/test/unit/examples/contextResponses/createBidirectionalDeviceSuccess.json +0 -22
- package/test/unit/examples/contextResponses/createDatetimeProvisionedDeviceSuccess.json +0 -22
- package/test/unit/examples/contextResponses/createGeopointProvisionedDeviceSuccess.json +0 -22
- package/test/unit/examples/contextResponses/createProvisionedDeviceSuccess.json +0 -22
- package/test/unit/examples/contextResponses/createTimeinstantSuccess.json +0 -22
- package/test/unit/examples/contextResponses/queryContext1Success.json +0 -27
- package/test/unit/examples/contextResponses/queryContext2Error.json +0 -7
- package/test/unit/examples/contextResponses/queryContext2UnknownError.json +0 -6
- package/test/unit/examples/contextResponses/queryContext3Error.json +0 -34
- package/test/unit/examples/contextResponses/queryContextAliasPlugin1Success.json +0 -27
- package/test/unit/examples/contextResponses/queryContextCompressTimestamp1Success.json +0 -27
- package/test/unit/examples/contextResponses/updateActiveAttributesSuccess.json +0 -16
- package/test/unit/examples/contextResponses/updateContext1Failed.json +0 -7
- package/test/unit/examples/contextResponses/updateContext1Success.json +0 -27
- package/test/unit/examples/contextResponses/updateContext2Failed.json +0 -35
- package/test/unit/examples/contextResponses/updateContextAliasPlugin2Success.json +0 -27
- package/test/unit/examples/contextResponses/updateContextAliasPluginSuccess.json +0 -27
- package/test/unit/examples/contextResponses/updateContextCommandFinishSuccess.json +0 -27
- package/test/unit/examples/contextResponses/updateContextCommandStatusSuccess.json +0 -22
- package/test/unit/examples/contextResponses/updateContextCompressTimestamp1Success.json +0 -27
- package/test/unit/examples/contextResponses/updateContextCompressTimestamp2Success.json +0 -34
- package/test/unit/examples/contextResponses/updateContextEvents1Success.json +0 -27
- package/test/unit/examples/contextResponses/updateContextExpressionPlugin1Success.json +0 -22
- package/test/unit/examples/contextResponses/updateContextExpressionPlugin2Success.json +0 -22
- package/test/unit/examples/contextResponses/updateContextExpressionPlugin3Success.json +0 -22
- package/test/unit/examples/contextResponses/updateContextExpressionPlugin5Success.json +0 -32
- package/test/unit/examples/contextResponses/updateContextMultientityPlugin1Success.json +0 -40
- package/test/unit/examples/contextResponses/updateContextMultientityPlugin2Success.json +0 -40
- package/test/unit/examples/contextResponses/updateContextMultientityPlugin3Success.json +0 -40
- package/test/unit/examples/contextResponses/updateContextProcessTimestamp1Success.json +0 -27
- package/test/unit/examples/contextResponses/updateProvisionActiveAttributes1Success.json +0 -22
- package/test/unit/examples/contextResponses/updateProvisionCommands1Success.json +0 -32
- package/test/unit/examples/contextResponses/updateProvisionMinimumDeviceSuccess.json +0 -22
- package/test/unit/examples/subscriptionRequests/bidirectionalNotification.json +0 -24
- package/test/unit/examples/subscriptionRequests/bidirectionalSubscriptionRemove.json +0 -3
- package/test/unit/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +0 -22
- package/test/unit/examples/subscriptionRequests/errorNotification.json +0 -24
- package/test/unit/examples/subscriptionRequests/simpleNotification.json +0 -24
- package/test/unit/examples/subscriptionRequests/simpleSubscriptionRemove.json +0 -3
- package/test/unit/examples/subscriptionRequests/simpleSubscriptionRequest.json +0 -19
- package/test/unit/examples/subscriptionRequests/simpleSubscriptionRequest1.json +0 -19
- package/test/unit/examples/subscriptionResponses/bidirectionalSubscriptionSuccess.json +0 -6
- package/test/unit/examples/subscriptionResponses/simpleSubscriptionSuccess.json +0 -6
- package/test/unit/expressions/expressionBasedTransformations-test.js +0 -328
- package/test/unit/expressions/expressionCombinedTransformations-test.js +0 -306
- package/test/unit/expressions/jexlBasedTransformations-test.js +0 -334
- package/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +0 -902
- package/test/unit/general/https-support-test.js +0 -286
- package/test/unit/general/iotam-autoregistration-test.js +0 -368
- package/test/unit/lazyAndCommands/active-devices-attribute-update-test.js +0 -168
- package/test/unit/lazyAndCommands/command-test.js +0 -341
- package/test/unit/lazyAndCommands/lazy-devices-test.js +0 -878
- package/test/unit/lazyAndCommands/polling-commands-test.js +0 -421
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin20.json +0 -25
- package/test/unit/ngsiService/active-devices-test.js +0 -692
- package/test/unit/ngsiService/staticAttributes-test.js +0 -148
- package/test/unit/ngsiService/subscriptions-test.js +0 -345
- package/test/unit/plugins/alias-plugin_test.js +0 -158
- package/test/unit/plugins/bidirectional-plugin_test.js +0 -564
- package/test/unit/plugins/compress-timestamp-plugin_test.js +0 -257
- package/test/unit/plugins/event-plugin_test.js +0 -119
- package/test/unit/plugins/multientity-plugin_test.js +0 -248
- package/test/unit/plugins/timestamp-processing-plugin_test.js +0 -119
- package/test/unit/provisioning/device-provisioning-api_test.js +0 -748
- package/test/unit/provisioning/device-registration_test.js +0 -432
- package/test/unit/provisioning/device-update-registration_test.js +0 -326
- package/test/unit/provisioning/listProvisionedDevices-test.js +0 -488
- package/test/unit/provisioning/provisionDeviceMultientity-test.js +0 -123
- package/test/unit/provisioning/removeProvisionedDevice-test.js +0 -244
- package/test/unit/provisioning/singleConfigurationMode-test.js +0 -346
- package/test/unit/provisioning/updateProvisionedDevices-test.js +0 -436
package/.github/workflows/ci.yml
CHANGED
|
@@ -6,6 +6,7 @@ name: CI
|
|
|
6
6
|
pull_request:
|
|
7
7
|
branches:
|
|
8
8
|
- master
|
|
9
|
+
workflow_dispatch:
|
|
9
10
|
jobs:
|
|
10
11
|
lint-markdown:
|
|
11
12
|
name: Lint Markdown
|
|
@@ -50,9 +51,9 @@ jobs:
|
|
|
50
51
|
strategy:
|
|
51
52
|
matrix:
|
|
52
53
|
node-version:
|
|
53
|
-
- 10.x
|
|
54
54
|
- 12.x
|
|
55
55
|
- 14.x
|
|
56
|
+
- 16.x
|
|
56
57
|
steps:
|
|
57
58
|
- name: Git checkout
|
|
58
59
|
uses: actions/checkout@v2
|
|
@@ -88,3 +89,18 @@ jobs:
|
|
|
88
89
|
uses: coverallsapp/github-action@master
|
|
89
90
|
with:
|
|
90
91
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
92
|
+
|
|
93
|
+
dispatch:
|
|
94
|
+
needs: unit-test
|
|
95
|
+
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
|
|
96
|
+
strategy:
|
|
97
|
+
matrix:
|
|
98
|
+
repo: ['telefonicaid/iotagent-ul', 'telefonicaid/sigfox-iotagent', 'telefonicaid/iotagent-json', 'telefonicaid/lightweightm2m-iotagent', 'telefonicaid/iotagent-manager']
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
steps:
|
|
101
|
+
- name: Repository Dispatch
|
|
102
|
+
uses: peter-evans/repository-dispatch@v1
|
|
103
|
+
with:
|
|
104
|
+
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
|
105
|
+
repository: ${{ matrix.repo }}
|
|
106
|
+
event-type: lib-update
|
package/.readthedocs.yml
ADDED
package/CHANGES_NEXT_RELEASE
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
[](https://github.com/telefonicaid/iotagent-node-lib/actions?query=workflow%3ACI)
|
|
9
9
|
[](https://coveralls.io/github/telefonicaid/iotagent-node-lib?branch=master)
|
|
10
10
|

|
|
11
|
+
[](https://bestpractices.coreinfrastructure.org/projects/4671)
|
|
11
12
|
|
|
12
13
|
This project aims to provide a Node.js module to enable IoT Agent developers to build custom agents for their devices
|
|
13
14
|
that can easily connect to NGSI Context Brokers (such as [Orion](https://github.com/telefonicaid/fiware-orion)).
|
package/doc/Contribution.md
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
# Contribution Guidelines
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Ground rules & expectations
|
|
4
|
+
|
|
5
|
+
Before we get started, here are a few things we expect from you (and that you should expect from others):
|
|
6
|
+
|
|
7
|
+
* Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and
|
|
8
|
+
projects, which means we likely have different perspectives on "how open source is done." Try to listen to others
|
|
9
|
+
rather than convince them that your way is correct.
|
|
10
|
+
* Please ensure that your contribution passes all tests. If there are test failures, you will need to address them
|
|
11
|
+
before we can merge your contribution.
|
|
12
|
+
* When adding content, please consider if it is widely valuable. Please don't add references or links to things you or
|
|
13
|
+
your employer have created as others will do so if they appreciate it.
|
|
14
|
+
* When reporting a vulnerability on the software, please, put in contact with IoT Agent Node Lib repository maintainers in order to discuss it
|
|
15
|
+
in a private way.
|
|
16
|
+
|
|
17
|
+
## How to contribute
|
|
18
|
+
|
|
19
|
+
If you'd like to contribute, start by searching through the [issues](https://github.com/telefonicaid/iotagent-node-lib/issues) and
|
|
20
|
+
[pull requests](https://github.com/telefonicaid/iotagent-node-lib/pulls) to see whether someone else has raised a similar idea or
|
|
21
|
+
question.
|
|
22
|
+
|
|
23
|
+
If you don't see your idea listed, and you think it fits into the goals of this guide, do one of the following:
|
|
24
|
+
|
|
25
|
+
- **If your contribution is minor,** such as a typo fix, open a pull request.
|
|
26
|
+
- **If your contribution is major,** such as a new guide, start by opening an issue first. That way, other people can
|
|
27
|
+
weigh in on the discussion before you do any work.
|
|
28
|
+
|
|
29
|
+
### Pull Request protocol
|
|
30
|
+
|
|
31
|
+
As explained in ([FIWARE Contribution Requirements](https://fiware-requirements.readthedocs.io/en/latest))
|
|
32
|
+
contributions are done using a pull request (PR). The detailed "protocol" used in such PR is described below:
|
|
33
|
+
|
|
34
|
+
* Direct commits to master branch (even single-line modifications) are not allowed. Every modification has to come as a PR
|
|
35
|
+
* In case the PR is implementing/fixing a numbered issue, the issue number has to be referenced in the body of the PR at creation time
|
|
36
|
+
* Anybody is welcome to provide comments to the PR (either direct comments or using the review feature offered by Github)
|
|
37
|
+
* Use *code line comments* instead of *general comments*, for traceability reasons (see comments lifecycle below)
|
|
38
|
+
* Comments lifecycle
|
|
39
|
+
* Comment is created, initiating a *comment thread*
|
|
40
|
+
* New comments can be added as responses to the original one, starting a discussion
|
|
41
|
+
* After discussion, the comment thread ends in one of the following ways:
|
|
42
|
+
* `Fixed in <commit hash>` in case the discussion involves a fix in the PR branch (which commit hash is
|
|
43
|
+
included as reference)
|
|
44
|
+
* `NTC`, if finally nothing needs to be done (NTC = Nothing To Change)
|
|
45
|
+
* PR can be merged when the following conditions are met:
|
|
46
|
+
* All comment threads are closed
|
|
47
|
+
* All the participants in the discussion have provided a `LGTM` general comment (LGTM = Looks good to me)
|
|
48
|
+
* Self-merging is not allowed (except in rare and justified circumstances)
|
|
49
|
+
|
|
50
|
+
Some additional remarks to take into account when contributing with new PRs:
|
|
51
|
+
|
|
52
|
+
* PR must include not only code contributions, but their corresponding pieces of documentation (new or modifications to existing one) and tests
|
|
53
|
+
* PR modifications must pass full regression based on existing test (unit, functional, memory, e2e) in addition to whichever new test added due to the new functionality
|
|
54
|
+
* PR should be of an appropriated size that makes review achievable. Too large PRs could be closed with a "please, redo the work in smaller pieces" without any further discussing
|
|
55
|
+
|
|
56
|
+
## Community
|
|
57
|
+
|
|
58
|
+
Discussions about the Open Source Guides take place on this repository's
|
|
59
|
+
[Issues](https://github.com/telefonicaid/iotagent-node-lib/issues) and [Pull Requests](https://github.com/telefonicaid/iotagent-node-lib/pulls)
|
|
60
|
+
sections. Anybody is welcome to join these conversations.
|
|
61
|
+
|
|
62
|
+
Wherever possible, do not take these conversations to private channels, including contacting the maintainers directly.
|
|
4
63
|
|
|
5
64
|
## Overview
|
|
6
65
|
|
package/doc/advanced-topics.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
## Advanced Topics
|
|
2
2
|
|
|
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)
|
|
24
|
+
- [Old IoTAgent data migration](#old-iotagent-data-migration)
|
|
25
|
+
|
|
3
26
|
### Secured access to the Context Broker
|
|
4
27
|
|
|
5
28
|
For access to instances of the Context Broker secured with a
|
|
6
29
|
[PEP Proxy](https://github.com/telefonicaid/fiware-orion-pep), an authentication mechanism based in Keystone Trust
|
|
7
|
-
tokens is provided. A
|
|
8
|
-
|
|
9
|
-
|
|
30
|
+
tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a
|
|
31
|
+
subservice. It is a long-term token that can be issued by any user to give another user permissions to impersonate him
|
|
32
|
+
with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term access
|
|
33
|
+
token.
|
|
10
34
|
|
|
11
35
|
For the authentication mechanisms to work, the `authentication` attribute in the configuration has to be fully
|
|
12
36
|
configured, and the `authentication.enabled` subattribute should have the value `true`.
|
|
@@ -46,12 +70,20 @@ curl http://${KEYSTONE_HOST}/v3/OS-TRUST/trusts \
|
|
|
46
70
|
Apart from the generation of the trust, the use of secured Context Brokers should be transparent to the user of the IoT
|
|
47
71
|
Agent.
|
|
48
72
|
|
|
49
|
-
|
|
73
|
+
Complete info on Keystone trust tokens could be found at:
|
|
74
|
+
|
|
75
|
+
- [Trusts concept](https://docs.openstack.org/keystone/stein/user/trusts)
|
|
76
|
+
- [Trusts API](https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts)
|
|
77
|
+
|
|
78
|
+
### NGSI-LD `GeoProperty` support
|
|
50
79
|
|
|
51
|
-
|
|
52
|
-
`geo:json`, `geo:point`). NGSI-LD formats such as `GeoProperty`, `Point` and `LineString` are also
|
|
53
|
-
values. If the latitude and longitude are received as separate measures, the
|
|
54
|
-
[expression language](expressionLanguage.md) can be used to concatenate them
|
|
80
|
+
For NGSI-LD only, the defined `type` of any GeoJSON attribute can be any set using any of the standard NGSI-v2 GeoJSON
|
|
81
|
+
types - (e.g. `geo:json`, `geo:point`). NGSI-LD formats such as `GeoProperty`, `Point` and `LineString` are also
|
|
82
|
+
accepted `type` values. If the latitude and longitude are received as separate measures, the JEXL or legacy
|
|
83
|
+
[expression language](expressionLanguage.md) can be used to concatenate them into GeoJSON objects an array of tuples or
|
|
84
|
+
a string as shown
|
|
85
|
+
|
|
86
|
+
#### Legacy - encode as String
|
|
55
87
|
|
|
56
88
|
```json
|
|
57
89
|
{
|
|
@@ -69,8 +101,30 @@ values. If the latitude and longitude are received as separate measures, the
|
|
|
69
101
|
}
|
|
70
102
|
```
|
|
71
103
|
|
|
72
|
-
|
|
73
|
-
|
|
104
|
+
#### JEXL - encode as GeoJSON
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"entity_type": "GPS",
|
|
109
|
+
"resource": "/iot/d",
|
|
110
|
+
"protocol": "PDI-IoTA-JSON",
|
|
111
|
+
"expressionLanguage": "jexl",
|
|
112
|
+
..etc
|
|
113
|
+
"attributes": [
|
|
114
|
+
{
|
|
115
|
+
"name": "location",
|
|
116
|
+
"type": "geo:json",
|
|
117
|
+
"expression": "{coordinates: [longitude,latitude], type: 'Point'}"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
JEXL can be used to create GeoJSON objects directly. The Legacy expression language does not support GeoJSON. However,
|
|
124
|
+
there is a workaround specifically for NGSI-LD Entities which always require `location` to be encoded as GeoJSON. For
|
|
125
|
+
`attributes` and `static_attributes` which need to be formatted as GeoJSON values, three separate input formats are
|
|
126
|
+
currently accepted. Provided the `type` is provisioned correctly, the `value` may be defined using any of the following
|
|
127
|
+
formats:
|
|
74
128
|
|
|
75
129
|
- a comma delimited string
|
|
76
130
|
|
|
@@ -237,6 +291,73 @@ updated as shown:
|
|
|
237
291
|
}
|
|
238
292
|
```
|
|
239
293
|
|
|
294
|
+
### Autoprovision configuration (autoprovision)
|
|
295
|
+
|
|
296
|
+
By default, when a measure arrives to the IoTAgent, if the `device_id` does not match with an existing one, then, the
|
|
297
|
+
IoTA creates a new device and a new entity according to the group config. Defining the field `autoprovision` to `false`
|
|
298
|
+
when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the data
|
|
299
|
+
to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is intended
|
|
300
|
+
to avoid provisioning devices (and for it to be effective, it would have to be provisional).
|
|
301
|
+
|
|
302
|
+
### Explicitly defined attributes (explicitAttrs)
|
|
303
|
+
|
|
304
|
+
If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is
|
|
305
|
+
stored in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure
|
|
306
|
+
element. By adding the field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the
|
|
307
|
+
measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in
|
|
308
|
+
the mappings of the provision. If `explicitAttrs` is provided both at device and group level, the device level takes
|
|
309
|
+
precedence. Additionally `explicitAttrs` can be used to define which meassures defined in JSON/JEXL array will be
|
|
310
|
+
propagated to NGSI interface.
|
|
311
|
+
|
|
312
|
+
The different possibilities are summarized below:
|
|
313
|
+
|
|
314
|
+
Case 1 (default):
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
"explicitAttrs": false
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
every measure will be propagated to NGSI interface.
|
|
321
|
+
|
|
322
|
+
Case 2:
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
"explicitAttrs": true
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
just measures defined in active, static (plus conditionally TimeInstant) will be propagated to NGSI interface.
|
|
329
|
+
|
|
330
|
+
Case 3:
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
"explicitAttrs": "['attr1','atrr2']"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
just measures defined in the array will be will be propagated to NGSI interface (note that in this case the value of
|
|
337
|
+
`explicitAttrs` is not a JSON but a string that looks likes a JSON).
|
|
338
|
+
|
|
339
|
+
Case 4:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
"explicitAtttr": "<JEXL expression resulting in bool or array>"
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
depending on the JEXL expression evaluation:
|
|
346
|
+
|
|
347
|
+
- If it evaluates to `true` every measure will be propagated to NGSI interface (as in case 1)
|
|
348
|
+
- If it evaluates to `false` just measures defined in active, static (plus conditionally TimeInstant) will be
|
|
349
|
+
propagated to NGSI interface (as in case 2)
|
|
350
|
+
- If it evaluates to an array just measures defined in the array will be will be propagated to NGSI interface (as in
|
|
351
|
+
case 3)
|
|
352
|
+
|
|
353
|
+
### Configuring operation to persist the data in Context Broker (appendMode)
|
|
354
|
+
|
|
355
|
+
This is a flag that can be enabled by activating the parameter `appendMode` in the configuration file or by using the
|
|
356
|
+
`IOTA_APPEND_MODE` environment variable (more info
|
|
357
|
+
[here](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md)). If this flag is
|
|
358
|
+
activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the default
|
|
359
|
+
UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care.
|
|
360
|
+
|
|
240
361
|
### Data mapping plugins
|
|
241
362
|
|
|
242
363
|
The IoT Agent Library provides a plugin mechanism in order to facilitate reusing code that makes small transformations
|
|
@@ -320,8 +441,8 @@ events in the IoT Agent with the configured type name will be marked as events.
|
|
|
320
441
|
|
|
321
442
|
##### Timestamp Processing Plugin (timestampProcess)
|
|
322
443
|
|
|
323
|
-
This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for
|
|
324
|
-
|
|
444
|
+
This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSIv2, the
|
|
445
|
+
plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
|
|
325
446
|
Standard `observedAt` property-of-a-property is used instead.
|
|
326
447
|
|
|
327
448
|
##### Expression Translation plugin (expressionTransformation)
|
|
@@ -385,14 +506,15 @@ When a device is provisioned with bidirectional attributes, the IoTAgent subscri
|
|
|
385
506
|
change notification for that attribute arrives to the IoTA, it applies the transformation defined in the device
|
|
386
507
|
provisioning payload to the notification, and calls the underlying notification handler with the transformed entity.
|
|
387
508
|
|
|
388
|
-
The following `attributes` section shows an example of the plugin configuration
|
|
509
|
+
The following `attributes` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid
|
|
510
|
+
translation from geo:point to geo:json)
|
|
389
511
|
|
|
390
512
|
```json
|
|
391
513
|
"attributes": [
|
|
392
514
|
{
|
|
393
515
|
"name":"location",
|
|
394
516
|
"type":"geo:point",
|
|
395
|
-
"expression": "${latitude}, ${longitude}",
|
|
517
|
+
"expression": "${@latitude}, ${@longitude}",
|
|
396
518
|
"reverse": [
|
|
397
519
|
{
|
|
398
520
|
"object_id":"longitude",
|
package/doc/api.md
CHANGED
|
@@ -75,25 +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
|
|
79
|
-
|
|
|
80
|
-
| `service`
|
|
81
|
-
| `subservice`
|
|
82
|
-
| `resource`
|
|
83
|
-
| `apikey`
|
|
84
|
-
| `timestamp`
|
|
85
|
-
| `entity_type`
|
|
86
|
-
| `trust`
|
|
87
|
-
| `cbHost`
|
|
88
|
-
| `lazy`
|
|
89
|
-
| `commands`
|
|
90
|
-
| `attributes`
|
|
91
|
-
| `static_attributes`
|
|
92
|
-
| `internal_attributes`
|
|
93
|
-
| `expressionLanguage`
|
|
94
|
-
| `explicitAttrs`
|
|
95
|
-
| `ngsiVersion`
|
|
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.
|
|
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`. |
|
|
97
98
|
|
|
98
99
|
### Service Group Endpoint
|
|
99
100
|
|
|
@@ -202,6 +203,21 @@ outgoing requests).
|
|
|
202
203
|
Note that there is a 1:1 correspondence between payload fields and DB fields (but using a different capitalization, e.g.
|
|
203
204
|
`service_path` vs. `servicePath`).
|
|
204
205
|
|
|
206
|
+
### Relationship between service groups and devices
|
|
207
|
+
|
|
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
|
+
|
|
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
|
+
|
|
205
221
|
### Device model
|
|
206
222
|
|
|
207
223
|
The table below shows the information held in the Device resource. The table also contains the correspondence between
|
|
@@ -226,8 +242,8 @@ the API resource fields and the same fields in the database model.
|
|
|
226
242
|
| `internal_attributes` | `internalAttributes` | List of internal attributes with free format for specific IoT Agent configuration | LWM2M mappings from object URIs to attributes |
|
|
227
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" } ]` |
|
|
228
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. |
|
|
229
|
-
| `explicitAttrs` | `explicitAttrs` |
|
|
230
|
-
| `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.
|
|
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` |
|
|
231
247
|
|
|
232
248
|
#### Attribute lists
|
|
233
249
|
|
|
@@ -250,7 +266,7 @@ Some transformation plugins also allow the use of the following optional attribu
|
|
|
250
266
|
be defined as expressions, using the [Expression Language definition](expressionLanguage.md).
|
|
251
267
|
- **entity_type**: configures the type of an alternative entity.
|
|
252
268
|
- **reverse**: add bidirectionality expressions to the attribute. See the **bidirectionality** transformation plugin
|
|
253
|
-
in the [Data Mapping Plugins section](#
|
|
269
|
+
in the [Data Mapping Plugins section](advanced-topics.md#bidirectionality-plugin-bidirectional) for details.
|
|
254
270
|
|
|
255
271
|
See the transformation plugins Section for more details.
|
|
256
272
|
|
package/doc/apiary/iotagent.apib
CHANGED
|
@@ -87,7 +87,7 @@ Fields in JSON object representing a configuration group are:
|
|
|
87
87
|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|
|
88
88
|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
|
|
89
89
|
| `timestamp`. |(optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.|
|
|
90
|
-
| `autoprovision`. |(optional, boolean): If
|
|
90
|
+
| `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`.|
|
|
91
91
|
|
|
92
92
|
Mandatory fields are identified in every operation.
|
|
93
93
|
|
|
@@ -260,7 +260,6 @@ A device is a resource that publish information to IoT Platform and it uses the
|
|
|
260
260
|
`type` (string, mandatory). It must be 'command'.
|
|
261
261
|
`value` (string, mandatory): command representation depends on protocol.
|
|
262
262
|
- `timestamp`. (optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.
|
|
263
|
-
- `autoprovision`. (optional, boolean): If true, APPEND is used upon measure arrival (thus effectively allowing autoprovisioned devices). If false, UPDATE is used open measure arrival (thus effectively avoiding autoprovisioned devices). This field is optional, so if it omitted then the global IoTAgent appendModel configuration is used.
|
|
264
263
|
|
|
265
264
|
Mandatory fields are identified in every operation.
|
|
266
265
|
|
|
@@ -444,4 +443,3 @@ If specific device is not found, we work as deleted.
|
|
|
444
443
|
|
|
445
444
|
|
|
446
445
|
|
|
447
|
-
|
package/doc/architecture.md
CHANGED
|
@@ -214,11 +214,11 @@ device to a command update to the device.
|
|
|
214
214
|
As part of the device to entity mapping process the IoT Agent creates and updates automatically a special timestamp.
|
|
215
215
|
This timestamp is represented as two different properties of the mapped entity::
|
|
216
216
|
|
|
217
|
-
- With
|
|
217
|
+
- With NGSI-v2, an attribute metadata named `TimeInstant` (per dynamic attribute mapped, which captures as an
|
|
218
218
|
ISO8601 timestamp when the associated measurement (represented as attribute value) was observed. With NGSI-LD, the
|
|
219
219
|
Standard `observedAt` property-of-a-property is used instead.
|
|
220
220
|
|
|
221
|
-
- For
|
|
221
|
+
- For NGSI-v2 only, an additional attribute `TimeInstant` is added to the entity which captures as an ISO8601
|
|
222
222
|
timestamp when the last measurement received from the device was observed.
|
|
223
223
|
|
|
224
224
|
If no information about the measurement timestamp is received by the IoT Agent, the arrival time of the measurement will
|
package/doc/deprecated.md
CHANGED
|
@@ -16,7 +16,7 @@ A list of deprecated features and the version in which they were deprecated foll
|
|
|
16
16
|
- Support to Node.js v4 in iotagent-node-lib 2.8.1 (finally removed in 2.9.0)
|
|
17
17
|
- Support to Node.js v6 in iotagent-node-lib 2.9.0 (finally removed in 2.10.0)
|
|
18
18
|
- Support to Node.js v8 in iotagent-node-lib 2.12.0 (finally removed in 2.13.0)
|
|
19
|
-
- Support to Node.js v10 in iotagent-node-lib 2.15.0.
|
|
19
|
+
- Support to Node.js v10 in iotagent-node-lib 2.15.0 (finally removed in 2.16.0)
|
|
20
20
|
|
|
21
21
|
The use of Node.js v12 is highly recommended.
|
|
22
22
|
|
|
@@ -42,4 +42,4 @@ The following table provides information about the last iotagent-node-lib versio
|
|
|
42
42
|
| Support to Node.js v4 | 2.8.1 | December 19th, 2018 |
|
|
43
43
|
| Support to Node.js v6 | 2.9.0 | May 22nd, 2019 |
|
|
44
44
|
| Support to Node.js v8 | 2.12.0 | April 7th, 2020 |
|
|
45
|
-
| Support to Node.js v10 |
|
|
45
|
+
| Support to Node.js v10 | 2.15.0 | February 18th, 2021 |
|
package/doc/development.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|