nayota-show-sdk 1.3.90 → 1.3.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nayota-show-sdk",
3
- "version": "1.3.90",
3
+ "version": "1.3.91",
4
4
  "description": "nayota-show-server rest-api",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -290,5 +290,6 @@ export function fallbackCode(value, prefix) {
290
290
  return candidate.replace(/\//g, '_').slice(0, 100)
291
291
  }
292
292
 
293
- return `${prefix}_${Date.now()}`
293
+ const random = Math.random().toString(36).slice(2, 10)
294
+ return `${prefix}_${Date.now().toString(36)}_${random}`
294
295
  }
@@ -167,7 +167,7 @@ function mapAreaToIotBody(data = {}, options = {}) {
167
167
  'relationInfo',
168
168
  'centerCoordinate'
169
169
  ]),
170
- code: data.code || (isPartial ? undefined : fallbackCode(data.name || data._id, 'SPACE')),
170
+ code: data.code || (isPartial ? (hasOwn(data, 'code') && !data.code ? fallbackCode(data.name || data._id, 'SPACE') : undefined) : fallbackCode(data.name || data._id, 'SPACE')),
171
171
  spaceType: data.spaceType || (isPartial ? undefined : 'zone'),
172
172
  hierarchyId: data.hierarchyId || data.depart,
173
173
  isVisible: data.isVisible != null ? data.isVisible : data.visible,