mqtt-devices-parser 1.0.18 → 1.0.19

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/Changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.19
4
+ Removes adding project on launching process
5
+ models/models:
6
+ - seedCommonLwM2MObjects: avoids error on description property not defined on object
7
+ - changes lwm2m seed functions name
8
+
3
9
  ## 1.0.18
4
10
  Fix and improve Sensors, checks uid length
5
11
  Adds seedCommonLwM2MObjects and seedCommonLwM2MResources functions
package/config/index.js CHANGED
@@ -27,7 +27,7 @@ module.exports = {
27
27
  projects: {
28
28
  demo : process.env.demo || false,
29
29
  },
30
- demo : {
30
+ demo : { // not need anymore. Can be created on dashboard
31
31
  uidPrefix: 'uid:',
32
32
  uidLength: 16 // max len for uid
33
33
  }
package/index.js CHANGED
@@ -107,6 +107,7 @@ var self = module.exports = {
107
107
  // adds client with credentials admin@admin
108
108
  await $.models.insertClient("admin","admin",user_id); // dashboard login
109
109
 
110
+ /* Add projects using dashboard !!
110
111
  for(name of projects){
111
112
  project = $.config[name];
112
113
  if (project) {
@@ -115,6 +116,7 @@ var self = module.exports = {
115
116
  await $.models.insertProject(projectData);
116
117
  }
117
118
  }
119
+ */
118
120
  }
119
121
 
120
122
  // project tables
package/models/models.js CHANGED
@@ -253,7 +253,7 @@ var self = module.exports = {
253
253
  });
254
254
  },
255
255
 
256
- seedCommonLwM2MObjects: async(objects) => {
256
+ seedLwM2MObjects: async(objects) => {
257
257
  try {
258
258
  const results = await Promise.all(
259
259
  objects.map(async (object) => {
@@ -261,7 +261,7 @@ var self = module.exports = {
261
261
  {
262
262
  objectId: object.objectId,
263
263
  name: object.name,
264
- description: object.description,
264
+ description: object?.description,
265
265
  },
266
266
  {
267
267
  where: { objectId: object.objectId }, // Ensure the record exists based on objectId
@@ -317,7 +317,7 @@ var self = module.exports = {
317
317
  * @param {import('sequelize').Sequelize} sequelize - An initialized Sequelize instance.
318
318
  * @returns {Promise<Array<{ objectId:number, resourceId:number, created:boolean, updated:boolean }>>}
319
319
  */
320
- seedCommonLwM2MResources: async (resources) => {
320
+ seedLwM2MResources: async (resources) => {
321
321
  if (!sequelize || !sequelize.models || !sequelize.models['lwm2mResources']) {
322
322
  throw new Error("sequelize instance with model 'lwm2mResources' is required");
323
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mqtt-devices-parser",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {