iotagent-node-lib 3.4.0 → 3.4.2

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.
@@ -0,0 +1 @@
1
+ - Fix: ensure entity_id is a stirng when is result of entityNameExp (#1476)
@@ -343,7 +343,8 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
343
343
  const payload = {
344
344
  entities: [
345
345
  {
346
- id: entityName
346
+ // CB entity id should be always a String
347
+ id: String(entityName)
347
348
  }
348
349
  ]
349
350
  };
@@ -676,6 +677,8 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
676
677
  try {
677
678
  logger.debug(context, 'sendUpdateValueNgsi2 entityNameExp %j ', typeInformation.entityNameExp);
678
679
  entityName = expressionPlugin.applyExpression(typeInformation.entityNameExp, ctxt, typeInformation);
680
+ // CB entity id should be always a String
681
+ entityName = String(entityName);
679
682
  payload.entities[0].id = entityName;
680
683
  ctxt['entity_name'] = entityName;
681
684
  } catch (e) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "iotagent-node-lib",
3
3
  "license": "AGPL-3.0-only",
4
4
  "description": "IoT Agent library to interface with NGSI Context Broker",
5
- "version": "3.4.0",
5
+ "version": "3.4.2",
6
6
  "homepage": "https://github.com/telefonicaid/iotagent-node-lib",
7
7
  "keywords": [
8
8
  "fiware",