iotagent-node-lib 4.5.0 → 4.7.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 +0 -1
- package/Changelog +12 -0
- package/README.md +67 -272
- package/config.js +3 -1
- package/doc/README.md +1 -1
- package/doc/admin.md +40 -18
- package/doc/api.md +532 -136
- package/doc/deprecated.md +4 -0
- package/doc/devel/architecture.md +5 -135
- package/doc/devel/development.md +224 -12
- package/doc/getting-started.md +114 -53
- package/doc/requirements.txt +1 -1
- package/doc/roadmap.md +5 -5
- package/docker/Mosquitto/Dockerfile +2 -2
- package/docker/Mosquitto/README.md +14 -11
- package/lib/commonConfig.js +21 -2
- package/lib/constants.js +3 -0
- package/lib/fiware-iotagent-lib.js +12 -15
- package/lib/jexlTranformsMap.js +3 -1
- package/lib/model/Command.js +2 -2
- package/lib/model/Device.js +7 -3
- package/lib/model/Group.js +5 -3
- package/lib/model/dbConn.js +53 -115
- package/lib/services/commands/commandRegistryMongoDB.js +115 -75
- package/lib/services/common/alarmManagement.js +3 -0
- package/lib/services/common/iotManagerService.js +3 -1
- package/lib/services/devices/deviceRegistryMemory.js +36 -0
- package/lib/services/devices/deviceRegistryMongoDB.js +160 -87
- package/lib/services/devices/deviceService.js +33 -3
- package/lib/services/devices/devices-NGSI-v2.js +6 -1
- package/lib/services/groups/groupRegistryMongoDB.js +120 -83
- package/lib/services/groups/groupService.js +1 -1
- package/lib/services/ngsi/entities-NGSI-LD.js +320 -570
- package/lib/services/ngsi/entities-NGSI-v2.js +51 -3
- package/lib/services/ngsi/ngsiService.js +34 -1
- package/lib/services/northBound/deviceGroupAdministrationServer.js +42 -6
- package/lib/services/northBound/deviceProvisioningServer.js +12 -4
- package/lib/services/northBound/northboundServer.js +2 -0
- package/lib/services/stats/statsRegistry.js +128 -101
- package/lib/templates/createDevice.json +0 -24
- package/lib/templates/createDeviceLax.json +0 -23
- package/lib/templates/deviceGroup.json +1 -25
- package/lib/templates/updateDevice.json +12 -24
- package/lib/templates/updateDeviceLax.json +12 -23
- package/package.json +5 -5
- package/scripts/legacy_expression_tool/README.md +0 -1
- package/test/functional/README.md +22 -17
- package/test/functional/config-test.js +3 -2
- package/test/functional/functional-tests-runner.js +9 -4
- package/test/functional/functional-tests.js +4 -4
- package/test/functional/testCases.js +245 -4
- package/test/functional/testUtils.js +2 -2
- package/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json +1 -13
- package/test/unit/examples/groupProvisioningRequests/multipleConfigGroupsCreation.json +44 -0
- package/test/unit/examples/groupProvisioningRequests/provisionDuplicateConfigGroup.json +35 -0
- package/test/unit/examples/groupProvisioningRequests/provisionFullConfigGroup.json +36 -0
- package/test/unit/examples/groupProvisioningRequests/provisionFullConfigGroupAlternate.json +36 -0
- package/test/unit/examples/groupProvisioningRequests/provisionFullGroup.json +1 -0
- package/test/unit/general/config-multi-core-test.js +1 -2
- package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +5 -4
- package/test/unit/general/deviceService-test.js +106 -3
- package/test/unit/general/statistics-service_test.js +1 -74
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +6 -5
- package/test/unit/mongodb/mongodb-configGroup-registry-test.js +452 -0
- package/test/unit/mongodb/mongodb-connectionoptions-test.js +9 -42
- package/test/unit/mongodb/mongodb-group-registry-test.js +34 -33
- package/test/unit/mongodb/mongodb-service-registry-test.js +477 -0
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin1a.json +4 -4
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin2.json +22 -22
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin29.json +4 -4
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +14 -15
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin1.json +23 -23
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin15.json +0 -5
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin4.json +11 -16
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin5.json +23 -28
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin6.json +8 -13
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin7.json +0 -5
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin8.json +24 -29
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +12 -17
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextStaticLinkedAttributes.json +12 -10
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -104
- package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +1 -2
- package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +4 -5
- package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +0 -4
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +8 -5
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +42 -41
- package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +11 -10
- package/test/unit/ngsiv2/general/deviceService-test.js +98 -4
- package/test/unit/ngsiv2/general/https-support-test.js +1 -1
- package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +195 -0
- package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +4 -3
- package/test/unit/ngsiv2/lazyAndCommands/command-test.js +6 -5
- package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +17 -16
- package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +10 -18
- package/test/unit/ngsiv2/ngsiService/active-devices-test.js +21 -20
- package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +8 -7
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +12 -11
- package/test/unit/ngsiv2/plugins/custom-plugin_test.js +3 -2
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +28 -27
- package/test/unit/ngsiv2/provisioning/device-group-api-test.js +265 -4
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +12 -11
- package/test/unit/ngsiv2/provisioning/device-provisioning-configGroup-api_test.js +1190 -0
- package/test/unit/ngsiv2/provisioning/device-registration_test.js +5 -4
- package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +6 -9
- package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -1
- package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +5 -4
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +8 -7
- package/test/unit/statsRegistry/openmetrics-test.js +167 -0
- package/lib/templates/queryContext.json +0 -25
- package/test/unit/examples/deviceProvisioningRequests/provisionBidirectionalDevice.json +0 -35
- package/test/unit/examples/deviceProvisioningRequests/provisionDeviceBidirectionalGroup.json +0 -17
- package/test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json +0 -31
- package/test/unit/general/statistics-persistence_test.js +0 -121
- package/test/unit/ngsi-ld/examples/contextRequests/createBidirectionalDevice.json +0 -17
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextProcessTimestamp.json +0 -12
- package/test/unit/ngsi-ld/examples/subscriptionRequests/bidirectionalNotification.json +0 -13
- package/test/unit/ngsi-ld/examples/subscriptionRequests/bidirectionalNotificationWithDatasetId.json +0 -21
- package/test/unit/ngsi-ld/examples/subscriptionRequests/bidirectionalNotificationWithMetadata.json +0 -17
- package/test/unit/ngsi-ld/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +0 -23
- package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +0 -132
- package/test/unit/ngsiv2/examples/contextRequests/createBidirectionalDevice.json +0 -8
- package/test/unit/ngsiv2/examples/subscriptionRequests/bidirectionalNotification.json +0 -13
- package/test/unit/ngsiv2/examples/subscriptionRequests/bidirectionalNotificationWithMetadata.json +0 -19
- package/test/unit/ngsiv2/examples/subscriptionRequests/bidirectionalSubscriptionRequest.json +0 -24
|
@@ -49,7 +49,8 @@ const iotAgentConfig = {
|
|
|
49
49
|
service: 'smartgondor',
|
|
50
50
|
subservice: 'gardens',
|
|
51
51
|
providerUrl: 'http://smartgondor.com',
|
|
52
|
-
explicitAttrs: false
|
|
52
|
+
explicitAttrs: false,
|
|
53
|
+
useCBflowControl: true
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
@@ -74,7 +75,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
74
75
|
contextBrokerMock
|
|
75
76
|
.matchHeader('fiware-service', 'smartgondor')
|
|
76
77
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
77
|
-
.post('/v2/entities?options=upsert')
|
|
78
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
78
79
|
.reply(204);
|
|
79
80
|
|
|
80
81
|
iotAgentLib.clearAll(done);
|
|
@@ -419,7 +420,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
419
420
|
.matchHeader('fiware-service', 'smartgondor')
|
|
420
421
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
421
422
|
.post(
|
|
422
|
-
'/v2/entities?options=upsert',
|
|
423
|
+
'/v2/entities?options=upsert,flowControl',
|
|
423
424
|
utils.readExampleFile(
|
|
424
425
|
'./test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice.json'
|
|
425
426
|
)
|
|
@@ -491,7 +492,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
491
492
|
.matchHeader('fiware-service', 'smartgondor')
|
|
492
493
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
493
494
|
.post(
|
|
494
|
-
'/v2/entities?options=upsert',
|
|
495
|
+
'/v2/entities?options=upsert,flowControl',
|
|
495
496
|
utils.readExampleFile(
|
|
496
497
|
'./test/unit/ngsiv2/examples/' +
|
|
497
498
|
'contextRequests/createStaticAttributesProvisionDevice.json'
|
|
@@ -557,7 +558,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
557
558
|
.matchHeader('fiware-service', 'smartgondor')
|
|
558
559
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
559
560
|
.post(
|
|
560
|
-
'/v2/entities?options=upsert',
|
|
561
|
+
'/v2/entities?options=upsert,flowControl',
|
|
561
562
|
utils.readExampleFile(
|
|
562
563
|
'./test/unit/ngsiv2/examples/' +
|
|
563
564
|
'contextRequests/createStaticAttributesProvisionDevice.json'
|
|
@@ -631,7 +632,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
631
632
|
.matchHeader('fiware-service', 'smartgondor')
|
|
632
633
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
633
634
|
.post(
|
|
634
|
-
'/v2/entities?options=upsert',
|
|
635
|
+
'/v2/entities?options=upsert,flowControl',
|
|
635
636
|
utils.readExampleFile(
|
|
636
637
|
'./test/unit/ngsiv2/examples/' +
|
|
637
638
|
'contextRequests/createStaticAttributesProvisionDevice2.json'
|
|
@@ -700,7 +701,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
700
701
|
.matchHeader('fiware-service', 'smartgondor')
|
|
701
702
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
702
703
|
.post(
|
|
703
|
-
'/v2/entities?options=upsert',
|
|
704
|
+
'/v2/entities?options=upsert,flowControl',
|
|
704
705
|
utils.readExampleFile(
|
|
705
706
|
'./test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice4.json'
|
|
706
707
|
)
|
|
@@ -772,7 +773,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
772
773
|
.matchHeader('fiware-service', 'smartgondor')
|
|
773
774
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
774
775
|
.post(
|
|
775
|
-
'/v2/entities?options=upsert',
|
|
776
|
+
'/v2/entities?options=upsert,flowControl',
|
|
776
777
|
utils.readExampleFile(
|
|
777
778
|
'./test/unit/ngsiv2/examples/' +
|
|
778
779
|
'contextRequests/createStaticAttributesProvisionDevice3.json'
|
|
@@ -977,7 +978,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
977
978
|
nock.cleanAll();
|
|
978
979
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
979
980
|
.post(
|
|
980
|
-
'/v2/entities?options=upsert',
|
|
981
|
+
'/v2/entities?options=upsert,flowControl',
|
|
981
982
|
utils.readExampleFile(
|
|
982
983
|
'./test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice.json'
|
|
983
984
|
)
|
|
@@ -986,7 +987,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
986
987
|
|
|
987
988
|
contextBrokerMock
|
|
988
989
|
.post(
|
|
989
|
-
'/v2/entities?options=upsert',
|
|
990
|
+
'/v2/entities?options=upsert,flowControl',
|
|
990
991
|
utils.readExampleFile(
|
|
991
992
|
'./test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice.json'
|
|
992
993
|
)
|
|
@@ -1137,7 +1138,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
1137
1138
|
contextBrokerMock
|
|
1138
1139
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1139
1140
|
.matchHeader('fiware-servicepath', '/gardens')
|
|
1140
|
-
.post('/v2/entities?options=upsert')
|
|
1141
|
+
.post('/v2/entities?options=upsert,flowControl')
|
|
1141
1142
|
.reply(204);
|
|
1142
1143
|
|
|
1143
1144
|
done();
|