iotagent-node-lib 2.24.0 → 2.25.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 +6 -7
- package/CHANGES_NEXT_RELEASE +1 -0
- package/doc/advanced-topics.md +23 -1
- package/doc/apiary/iotagent.apib +5 -5
- package/doc/deprecated.md +10 -7
- package/doc/expressionLanguage.md +44 -34
- package/doc/getting-started.md +1 -1
- package/examples/TTOpen-service.json +1 -1
- package/lib/fiware-iotagent-lib.js +2 -1
- package/lib/jexlTranformsMap.js +12 -1
- package/lib/plugins/jexlParser.js +2 -2
- package/lib/services/devices/deviceService.js +19 -1
- package/lib/services/devices/devices-NGSI-v2.js +3 -1
- package/lib/services/northBound/restUtils.js +3 -5
- package/lib/templates/deviceGroup.json +1 -1
- package/package.json +2 -2
- package/test/unit/examples/deviceProvisioningRequests/provisionNewDeviceEmpty.json +43 -0
- package/test/unit/examples/mongoCollections/configurations.json +3 -3
- package/test/unit/expressions/jexlExpression-test.js +29 -8
- package/test/unit/general/deviceService-test.js +31 -29
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +25 -24
- package/test/unit/mongodb/mongodb-group-registry-test.js +3 -3
- package/test/unit/mongodb/mongodb-registry-test.js +30 -21
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin30.json +11 -0
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +18 -4
- package/test/unit/ngsi-ld/general/deviceService-test.js +31 -29
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +0 -3
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityJexlExpressionPlugin1.json +22 -0
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +21 -6
- package/test/unit/ngsiv2/general/deviceService-test.js +25 -23
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +58 -0
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +25 -6
|
@@ -450,7 +450,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
450
450
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
451
451
|
/*jshint camelcase: false */
|
|
452
452
|
entity_type: 'MicroLights',
|
|
453
|
-
|
|
453
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
454
454
|
explicitAttrs: true
|
|
455
455
|
}
|
|
456
456
|
]
|
|
@@ -516,7 +516,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
516
516
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
517
517
|
/*jshint camelcase: false */
|
|
518
518
|
entity_type: 'MicroLights',
|
|
519
|
-
|
|
519
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
520
520
|
explicitAttrs: true,
|
|
521
521
|
static_attributes: [
|
|
522
522
|
{
|
|
@@ -589,7 +589,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
589
589
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
590
590
|
/*jshint camelcase: false */
|
|
591
591
|
entity_type: 'MicroLights',
|
|
592
|
-
|
|
592
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
593
593
|
explicitAttrs: true
|
|
594
594
|
}
|
|
595
595
|
]
|
|
@@ -656,7 +656,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
656
656
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
657
657
|
/*jshint camelcase: false */
|
|
658
658
|
entity_type: 'MicroLights',
|
|
659
|
-
|
|
659
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
660
660
|
explicitAttrs: true,
|
|
661
661
|
static_attributes: [
|
|
662
662
|
{
|
|
@@ -726,7 +726,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
726
726
|
/*jshint camelcase: false */
|
|
727
727
|
entity_type: 'MicroLights',
|
|
728
728
|
entityNameExp: 'EntityNameByExp',
|
|
729
|
-
|
|
729
|
+
cbHost: 'http://192.168.1.1:1026'
|
|
730
730
|
}
|
|
731
731
|
]
|
|
732
732
|
},
|
|
@@ -790,7 +790,7 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
790
790
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
791
791
|
/*jshint camelcase: false */
|
|
792
792
|
entity_type: 'MicroLights',
|
|
793
|
-
|
|
793
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
794
794
|
explicitAttrs: true,
|
|
795
795
|
static_attributes: [
|
|
796
796
|
{
|
|
@@ -1385,4 +1385,23 @@ describe('NGSI-v2 - Device provisioning API: Provision devices', function () {
|
|
|
1385
1385
|
});
|
|
1386
1386
|
});
|
|
1387
1387
|
});
|
|
1388
|
+
describe('When a device provisioning request arrives to the Agent without device_id', function () {
|
|
1389
|
+
const options = {
|
|
1390
|
+
url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices',
|
|
1391
|
+
headers: {
|
|
1392
|
+
'fiware-service': 'smartgondor',
|
|
1393
|
+
'fiware-servicepath': '/gardens'
|
|
1394
|
+
},
|
|
1395
|
+
method: 'POST',
|
|
1396
|
+
json: utils.readExampleFile('./test/unit/examples/deviceProvisioningRequests/provisionNewDeviceEmpty.json')
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
it('should return a 400 error', function (done) {
|
|
1400
|
+
request(options, function (error, response, body) {
|
|
1401
|
+
should.not.exist(error);
|
|
1402
|
+
response.statusCode.should.equal(400);
|
|
1403
|
+
done();
|
|
1404
|
+
});
|
|
1405
|
+
});
|
|
1406
|
+
});
|
|
1388
1407
|
});
|