nayota-show-sdk 1.3.91 → 1.3.93

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.91",
3
+ "version": "1.3.93",
4
4
  "description": "nayota-show-server rest-api",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -148,6 +148,11 @@ function resolveAreaClassIdForWrite(data = {}, options = {}) {
148
148
  return resolveLegacyReference(value)
149
149
  }
150
150
 
151
+ function generateSpaceCode() {
152
+ const random = Math.random().toString(36).slice(2, 10)
153
+ return `SPACE_${Date.now().toString(36)}_${random}`
154
+ }
155
+
151
156
  function mapAreaToIotBody(data = {}, options = {}) {
152
157
  const isPartial = options.partial === true
153
158
  const metadata = mergeMetadata(data.metadata, {
@@ -167,7 +172,7 @@ function mapAreaToIotBody(data = {}, options = {}) {
167
172
  'relationInfo',
168
173
  'centerCoordinate'
169
174
  ]),
170
- code: data.code || (isPartial ? (hasOwn(data, 'code') && !data.code ? fallbackCode(data.name || data._id, 'SPACE') : undefined) : fallbackCode(data.name || data._id, 'SPACE')),
175
+ code: data.code || (isPartial ? (hasOwn(data, 'code') && !data.code ? generateSpaceCode() : undefined) : generateSpaceCode()),
171
176
  spaceType: data.spaceType || (isPartial ? undefined : 'zone'),
172
177
  hierarchyId: data.hierarchyId || data.depart,
173
178
  isVisible: data.isVisible != null ? data.isVisible : data.visible,