iotagent-node-lib 3.0.0 → 3.1.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 (89) hide show
  1. package/.github/workflows/ci.yml +1 -0
  2. package/CHANGES_NEXT_RELEASE +2 -0
  3. package/docker-compose-dev.yml +1 -1
  4. package/lib/services/ngsi/entities-NGSI-LD.js +2 -16
  5. package/lib/services/ngsi/entities-NGSI-v2.js +4 -16
  6. package/package.json +2 -2
  7. package/test/unit/general/config-multi-core-test.js +2 -1
  8. package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +2 -1
  9. package/test/unit/general/deviceService-test.js +2 -1
  10. package/test/unit/general/loglevel-api_test.js +2 -1
  11. package/test/unit/general/startup-test.js +2 -1
  12. package/test/unit/general/statistics-persistence_test.js +1 -0
  13. package/test/unit/general/statistics-service_test.js +1 -0
  14. package/test/unit/lazyAndCommands/commandRegistry_test.js +1 -0
  15. package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +1 -0
  16. package/test/unit/mongodb/mongodb-connectionoptions-test.js +1 -0
  17. package/test/unit/mongodb/mongodb-group-registry-test.js +1 -0
  18. package/test/unit/mongodb/mongodb-registry-test.js +2 -1
  19. package/test/unit/ngsi-ld/expressions/expressionBasedTransformations-test.js +2 -1
  20. package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +2 -1
  21. package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
  22. package/test/unit/ngsi-ld/general/deviceService-test.js +2 -1
  23. package/test/unit/ngsi-ld/general/https-support-test.js +2 -1
  24. package/test/unit/ngsi-ld/general/iotam-autoregistration-test.js +2 -1
  25. package/test/unit/ngsi-ld/general/startup-test.js +3 -2
  26. package/test/unit/ngsi-ld/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
  27. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +5 -7
  28. package/test/unit/ngsi-ld/lazyAndCommands/lazy-devices-test.js +8 -6
  29. package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +18 -22
  30. package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +2 -1
  31. package/test/unit/ngsi-ld/ngsiService/active-devices-test.js +2 -1
  32. package/test/unit/ngsi-ld/ngsiService/autocast-test.js +2 -1
  33. package/test/unit/ngsi-ld/ngsiService/geoproperties-test.js +2 -1
  34. package/test/unit/ngsi-ld/ngsiService/languageProperties-test.js +32 -34
  35. package/test/unit/ngsi-ld/ngsiService/staticAttributes-test.js +2 -1
  36. package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +2 -1
  37. package/test/unit/ngsi-ld/ngsiService/unsupported-endpoints-test.js +11 -15
  38. package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +2 -1
  39. package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +2 -1
  40. package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +2 -1
  41. package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +2 -1
  42. package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +2 -1
  43. package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +1 -0
  44. package/test/unit/ngsi-ld/provisioning/device-registration_test.js +2 -1
  45. package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +15 -12
  46. package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +1 -0
  47. package/test/unit/ngsi-ld/provisioning/provisionDeviceMultientity-test.js +1 -0
  48. package/test/unit/ngsi-ld/provisioning/removeProvisionedDevice-test.js +1 -0
  49. package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +1 -0
  50. package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +1 -0
  51. package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +13 -7
  52. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +6 -0
  53. package/test/unit/ngsiv2/examples/contextRequests/updateContextProcessTimestamp.json +7 -1
  54. package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverride.json +7 -1
  55. package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +7 -1
  56. package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +2 -1
  57. package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +4 -2
  58. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +4 -2
  59. package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
  60. package/test/unit/ngsiv2/general/deviceService-test.js +2 -1
  61. package/test/unit/ngsiv2/general/https-support-test.js +2 -1
  62. package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +2 -1
  63. package/test/unit/ngsiv2/general/startup-test.js +2 -1
  64. package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
  65. package/test/unit/ngsiv2/lazyAndCommands/command-test.js +2 -1
  66. package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +8 -6
  67. package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +2 -1
  68. package/test/unit/ngsiv2/ngsiService/active-devices-test.js +3 -2
  69. package/test/unit/ngsiv2/ngsiService/autocast-test.js +2 -1
  70. package/test/unit/ngsiv2/ngsiService/queryDeviceInformationInCb-test.js +2 -1
  71. package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +2 -1
  72. package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +2 -1
  73. package/test/unit/ngsiv2/plugins/alias-plugin_test.js +2 -1
  74. package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +2 -1
  75. package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +2 -1
  76. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +2 -1
  77. package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +2 -1
  78. package/test/unit/ngsiv2/provisioning/device-group-api-test.js +1 -0
  79. package/test/unit/ngsiv2/provisioning/device-group-utils-test.js +1 -0
  80. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +1 -0
  81. package/test/unit/ngsiv2/provisioning/device-registration_test.js +2 -1
  82. package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +15 -12
  83. package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +1 -0
  84. package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -0
  85. package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +1 -0
  86. package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +1 -0
  87. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +1 -0
  88. package/test/unit/plugins/capture-configuration-inPlugins_test.js +2 -1
  89. package/test/unit/plugins/capture-provision-inPlugins_test.js +2 -1
@@ -42,6 +42,7 @@ const iotAgentConfig = {
42
42
  },
43
43
  server: {
44
44
  port: 4041,
45
+ host: 'localhost',
45
46
  baseRoot: '/'
46
47
  },
47
48
  types: {},
@@ -40,7 +40,8 @@ const iotAgentConfig = {
40
40
  ngsiVersion: 'v2'
41
41
  },
42
42
  server: {
43
- port: 4041
43
+ port: 4041,
44
+ host: 'localhost'
44
45
  },
45
46
  types: {
46
47
  Light: {
@@ -39,7 +39,8 @@ const iotAgentConfig = {
39
39
  ngsiVersion: 'v2'
40
40
  },
41
41
  server: {
42
- port: 4041
42
+ port: 4041,
43
+ host: 'localhost'
43
44
  },
44
45
  types: {
45
46
  Light: {
@@ -268,17 +269,19 @@ describe('NGSI-v2 - IoT Agent Device Update Registration', function () {
268
269
  });
269
270
  it('should store the new values in the registry', function (done) {
270
271
  iotAgentLib.updateRegister(deviceCommandUpdated, false, function (error, data) {
271
- iotAgentLib.getDevice(deviceCommandUpdated.id, 'smartgondor', 'gardens', function (
272
- error,
273
- deviceResult
274
- ) {
275
- should.not.exist(error);
276
- should.exist(deviceResult);
277
- deviceResult.internalId.should.equal(deviceUpdated.internalId);
278
- deviceResult.commands[0].name.should.equal('move');
279
- deviceResult.active[0].name.should.equal('temperature');
280
- done();
281
- });
272
+ iotAgentLib.getDevice(
273
+ deviceCommandUpdated.id,
274
+ 'smartgondor',
275
+ 'gardens',
276
+ function (error, deviceResult) {
277
+ should.not.exist(error);
278
+ should.exist(deviceResult);
279
+ deviceResult.internalId.should.equal(deviceUpdated.internalId);
280
+ deviceResult.commands[0].name.should.equal('move');
281
+ deviceResult.active[0].name.should.equal('temperature');
282
+ done();
283
+ }
284
+ );
282
285
  });
283
286
  });
284
287
  });
@@ -42,6 +42,7 @@ const iotAgentConfig = {
42
42
  },
43
43
  server: {
44
44
  port: 4041,
45
+ host: 'localhost',
45
46
  baseRoot: '/'
46
47
  },
47
48
  types: {},
@@ -41,6 +41,7 @@ const iotAgentConfig = {
41
41
  },
42
42
  server: {
43
43
  port: 4041,
44
+ host: 'localhost',
44
45
  baseRoot: '/'
45
46
  },
46
47
  types: {},
@@ -42,6 +42,7 @@ const iotAgentConfig = {
42
42
  },
43
43
  server: {
44
44
  port: 4041,
45
+ host: 'localhost',
45
46
  baseRoot: '/'
46
47
  },
47
48
  types: {},
@@ -41,6 +41,7 @@ const iotAgentConfig = {
41
41
  },
42
42
  server: {
43
43
  port: 4041,
44
+ host: 'localhost',
44
45
  baseRoot: '/'
45
46
  },
46
47
  types: {},
@@ -42,6 +42,7 @@ const iotAgentConfig = {
42
42
  },
43
43
  server: {
44
44
  port: 4041,
45
+ host: 'localhost',
45
46
  baseRoot: '/'
46
47
  },
47
48
  types: {},
@@ -35,7 +35,8 @@ const iotAgentConfig = {
35
35
  port: '1026'
36
36
  },
37
37
  server: {
38
- port: 4041
38
+ port: 4041,
39
+ host: 'localhost'
39
40
  },
40
41
  types: {
41
42
  Light: {
@@ -37,7 +37,8 @@ const iotAgentConfig = {
37
37
  port: '1026'
38
38
  },
39
39
  server: {
40
- port: 4041
40
+ port: 4041,
41
+ host: 'localhost'
41
42
  },
42
43
  types: {
43
44
  Light: {