iotagent-node-lib 3.4.2 → 3.4.3

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.
@@ -352,7 +352,8 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
352
352
  let url = '/v2/op/update';
353
353
 
354
354
  if (typeInformation && typeInformation.type) {
355
- payload.entities[0].type = typeInformation.type;
355
+ // CB entity type should be always a String
356
+ payload.entities[0].type = String(typeInformation.type);
356
357
  }
357
358
 
358
359
  payload.actionType = 'append';
@@ -833,10 +834,10 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
833
834
  payload
834
835
  );
835
836
  }
836
-
837
+ // CB entity id and type should be always a String
837
838
  let newEntity = {
838
- id: newEntityName ? newEntityName : payload.entities[0].id,
839
- type: attr.entity_type ? attr.entity_type : payload.entities[0].type
839
+ id: newEntityName ? String(newEntityName) : String(payload.entities[0].id),
840
+ type: attr.entity_type ? String(attr.entity_type) : String(payload.entities[0].type)
840
841
  };
841
842
  // Check if there is already a newEntity created
842
843
  const alreadyEntity = payload.entities.find((entity) => {
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.2",
5
+ "version": "3.4.3",
6
6
  "homepage": "https://github.com/telefonicaid/iotagent-node-lib",
7
7
  "keywords": [
8
8
  "fiware",