Browse Source

Merge branch 'lts-4.2' into edge-rpc-v2-status-sync

pull/15913/head
Mazurenko Nikita 2 months ago
committed by GitHub
parent
commit
df31987e64
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      TEST_FAST.md
  2. 2
      application/pom.xml
  3. 59
      application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcService.java
  4. 6
      application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java
  5. 212
      application/src/main/java/org/thingsboard/server/service/solutions/DefaultSolutionService.java
  6. 30
      application/src/main/java/org/thingsboard/server/service/solutions/data/SolutionValidationResult.java
  7. 2
      application/src/main/resources/thingsboard.yml
  8. 208
      application/src/test/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcServiceTest.java
  9. 58
      application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java
  10. 86
      application/src/test/java/org/thingsboard/server/service/script/NashornJsInvokeServiceTest.java
  11. 294
      application/src/test/java/org/thingsboard/server/service/solutions/DefaultSolutionServiceTest.java
  12. 2
      common/actor/pom.xml
  13. 2
      common/cache/pom.xml
  14. 2
      common/cluster-api/pom.xml
  15. 2
      common/coap-server/pom.xml
  16. 2
      common/dao-api/pom.xml
  17. 2
      common/data/pom.xml
  18. 2
      common/discovery-api/pom.xml
  19. 2
      common/edge-api/pom.xml
  20. 1
      common/edge-api/src/main/proto/edge.proto
  21. 2
      common/edqs/pom.xml
  22. 2
      common/message/pom.xml
  23. 2
      common/pom.xml
  24. 2
      common/proto/pom.xml
  25. 2
      common/queue/pom.xml
  26. 2
      common/script/pom.xml
  27. 2
      common/script/remote-js-client/pom.xml
  28. 2
      common/script/script-api/pom.xml
  29. 26
      common/script/script-api/src/main/java/org/thingsboard/script/api/js/NashornJsInvokeService.java
  30. 109
      common/script/script-api/src/test/java/org/thingsboard/script/api/js/NashornJsInvokeServiceLifecycleTest.java
  31. 2
      common/stats/pom.xml
  32. 2
      common/transport/coap/pom.xml
  33. 2
      common/transport/http/pom.xml
  34. 2
      common/transport/lwm2m/pom.xml
  35. 2
      common/transport/mqtt/pom.xml
  36. 2
      common/transport/pom.xml
  37. 2
      common/transport/snmp/pom.xml
  38. 2
      common/transport/transport-api/pom.xml
  39. 2
      common/util/pom.xml
  40. 2
      common/version-control/pom.xml
  41. 2
      dao/pom.xml
  42. 2
      edqs/pom.xml
  43. 2
      monitoring/pom.xml
  44. 2
      msa/black-box-tests/pom.xml
  45. 2
      msa/edqs/pom.xml
  46. 2
      msa/js-executor/package.json
  47. 23
      msa/js-executor/pom.xml
  48. 12
      msa/js-executor/yarn.lock
  49. 2
      msa/monitoring/pom.xml
  50. 38
      msa/pom.xml
  51. 2
      msa/tb-node/pom.xml
  52. 2
      msa/tb/pom.xml
  53. 2
      msa/transport/coap/pom.xml
  54. 2
      msa/transport/http/pom.xml
  55. 2
      msa/transport/lwm2m/pom.xml
  56. 2
      msa/transport/mqtt/pom.xml
  57. 2
      msa/transport/pom.xml
  58. 2
      msa/transport/snmp/pom.xml
  59. 2
      msa/vc-executor-docker/pom.xml
  60. 2
      msa/vc-executor/pom.xml
  61. 4
      msa/web-ui/package.json
  62. 5
      msa/web-ui/pom.xml
  63. 26
      msa/web-ui/yarn.lock
  64. 4
      netty-mqtt/pom.xml
  65. 161
      pom.xml
  66. 2
      rest-client/pom.xml
  67. 2
      rule-engine/pom.xml
  68. 2
      rule-engine/rule-engine-api/pom.xml
  69. 2
      rule-engine/rule-engine-components/pom.xml
  70. 2
      tools/pom.xml
  71. 2
      transport/coap/pom.xml
  72. 2
      transport/http/pom.xml
  73. 2
      transport/lwm2m/pom.xml
  74. 2
      transport/mqtt/pom.xml
  75. 2
      transport/pom.xml
  76. 2
      transport/snmp/pom.xml
  77. 10
      ui-ngx/angular.json
  78. 8
      ui-ngx/package.json
  79. 13
      ui-ngx/pom.xml
  80. 9
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts
  81. 12
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts
  82. 14
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-install-dialog.component.html
  83. 21
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-install-dialog.component.ts
  84. 40
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.scss
  85. 6
      ui-ngx/src/app/modules/home/components/widget/lib/maps-legacy/map-models.ts
  86. 11
      ui-ngx/src/app/modules/home/components/widget/lib/maps-legacy/providers/here-map.ts
  87. 19
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet/leaflet-tb.ts
  88. 31
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map-layer.ts
  89. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-row.component.html
  90. 14
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-row.component.ts
  91. 18
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-settings-panel.component.html
  92. 18
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-settings-panel.component.ts
  93. 5
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layers.component.ts
  94. 23
      ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/here-map-provider-settings.component.html
  95. 34
      ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/here-map-provider-settings.component.ts
  96. 3
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.html
  97. 15
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts
  98. 72
      ui-ngx/src/app/shared/models/widget/maps/map.models.ts
  99. 17
      ui-ngx/src/assets/locale/locale.constant-en_US.json
  100. 297
      ui-ngx/yarn.lock

4
TEST_FAST.md

@ -42,10 +42,12 @@ Use `-Dpkg.skip=true` to skip all packaging at once (equivalent to all four flag
|----------------------------|-------------------------------------------|--------------------------------------------------------------|
| `-Dpkg.skip=true` | All of the below (bootjar + deb + rpm + zip) | Yes |
| `-Dpkg.skip.bootjar=true` | `spring-boot:repackage` (`*-boot.jar`) | Yes — tests use the regular `.jar`, not the fat boot jar |
| `-Dpkg.skip.deb=true` | Gradle `buildDeb` + Maven `attach-artifact` | Yes — MSA docker modules copy the DEB from `target/` directly |
| `-Dpkg.skip.deb=true` | Gradle `buildDeb` | Yes — MSA docker modules copy the DEB from `target/` directly |
| `-Dpkg.skip.rpm=true` | Gradle `buildRpm` | Yes — no test depends on the RPM |
| `-Dpkg.skip.zip=true` | `maven-assembly-plugin` Windows ZIP | Yes — no test depends on the ZIP |
`-Dskip.yarn=true` and `-Dskip.ui.build=true` imply `-Dpkg.skip=true`: packages built without the UI are incomplete.
## Testcontainers compatibility with the Docker API workaround
In case your tests failed to run testcontainers due to unsupported Docker API version

2
application/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>application</artifactId>

59
application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcService.java

@ -24,6 +24,7 @@ import org.thingsboard.common.util.ThingsBoardExecutors;
import org.thingsboard.rule.engine.api.AttributesSaveRequest;
import org.thingsboard.rule.engine.api.TimeseriesSaveRequest;
import org.thingsboard.server.cache.TbTransactionalCache;
import org.thingsboard.server.cache.TbCacheValueWrapper;
import org.thingsboard.server.cluster.TbClusterService;
import org.thingsboard.server.common.data.AttributeScope;
import org.thingsboard.server.common.data.DataConstants;
@ -45,11 +46,13 @@ import org.thingsboard.server.common.msg.edge.EdgeHighPriorityMsg;
import org.thingsboard.server.common.msg.edge.EdgeSessionMsg;
import org.thingsboard.server.common.msg.edge.FromEdgeSyncResponse;
import org.thingsboard.server.common.msg.edge.ToEdgeSyncRequest;
import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.gen.edge.v1.EdgeRpcServiceGrpc;
import org.thingsboard.server.gen.edge.v1.RequestMsg;
import org.thingsboard.server.gen.edge.v1.ResponseMsg;
import org.thingsboard.server.queue.discovery.TbServiceInfoProvider;
import org.thingsboard.server.queue.discovery.TopicService;
import org.thingsboard.server.queue.discovery.PartitionService;
import org.thingsboard.server.queue.kafka.KafkaAdmin;
import org.thingsboard.server.queue.provider.TbCoreQueueFactory;
import org.thingsboard.server.queue.util.AfterStartUp;
@ -139,6 +142,9 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
@Autowired
private TbTransactionalCache<EdgeId, String> edgeIdServiceIdCache;
@Autowired
private PartitionService partitionService;
@Autowired
private TopicService topicService;
@ -369,10 +375,13 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
} finally {
newEventLock.unlock();
}
// Claim ownership before writing the active state, not after: onEdgeDisconnect on the node this edge
// just left reads the cache to decide whether to clear the flag, so publishing the claim first keeps
// it from seeing a stale owner and clearing a state we have already set.
edgeIdServiceIdCache.put(edgeId, serviceInfoProvider.getServiceId());
save(tenantId, edgeId, ACTIVITY_STATE, true);
long lastConnectTs = System.currentTimeMillis();
save(tenantId, edgeId, LAST_CONNECT_TIME, lastConnectTs);
edgeIdServiceIdCache.put(edgeId, serviceInfoProvider.getServiceId());
pushRuleEngineMessage(tenantId, edge, lastConnectTs, TbMsgType.CONNECT_EVENT);
cancelScheduleEdgeEventsCheck(edgeId);
edgeEventsMigrationProcessed.putIfAbsent(edgeId, Boolean.FALSE);
@ -520,8 +529,12 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
EdgeId edgeId = edge.getId();
log.info("[{}][{}] edge disconnected!", edgeId, sessionId);
EdgeGrpcSession current = sessions.get(edgeId);
if (current != null && current.getSessionId().equals(sessionId)) {
EdgeGrpcSession toRemove = sessions.remove(edgeId);
// Claim-once removal: get() and remove() are not atomic, so a session that was replaced between the
// two would otherwise be dropped from the map, torn down and marked inactive by this stale callback
// even though it is the live one. Losing the race means this callback owns nothing - fall through to
// the stale-session branch below.
if (current != null && current.getSessionId().equals(sessionId) && sessions.remove(edgeId, current)) {
EdgeGrpcSession toRemove = current;
final Lock newEventLock = sessionNewEventsLocks.computeIfAbsent(edgeId, id -> new ReentrantLock());
newEventLock.lock();
try {
@ -532,7 +545,13 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
destroySession(toRemove);
sessionsById.remove(sessionId);
TenantId tenantId = toRemove.getEdge().getTenantId();
save(tenantId, edgeId, ACTIVITY_STATE, false);
// A newer session on another node may have already claimed this edge and set active=true.
// Clearing the flag here would leave the edge marked inactive while it is in fact connected,
// which silently drops every downlink event that is not queued for offline edges.
// When ownership is unknown (no cache entry) fall through and persist the inactive state.
if (!isOwnedByAnotherNode(edgeId)) {
save(tenantId, edgeId, ACTIVITY_STATE, false);
}
long lastDisconnectTs = System.currentTimeMillis();
save(tenantId, edgeId, LAST_DISCONNECT_TIME, lastDisconnectTs);
pushRuleEngineMessage(toRemove.getEdge().getTenantId(), edge, lastDisconnectTs, TbMsgType.DISCONNECT_EVENT);
@ -551,7 +570,37 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
log.debug("[{}] No session found by sessionId [{}] to destroy", edgeId, sessionId);
}
}
edgeIdServiceIdCache.evict(edgeId);
// Only evict if the cache still points at this node. If the edge already reconnected to another
// TB-Core node, that node has overwritten the entry and owns it - evicting here would wipe the live
// owner's claim and defeat the activity-state guard above.
if (isOwnedByThisNode(edgeId)) {
edgeIdServiceIdCache.evict(edgeId);
}
}
// The edge's service-id cache entry points at a different node that is still a live TB-Core service.
// Two cases deliberately do NOT count as "owned by another node", so that the caller falls through and
// persists the inactive state:
// - no cache entry: ownership is unknown, not claimed by someone else;
// - entry naming a node that is no longer in the cluster: the edge sessions cache has no TTL by default
// (CACHE_SPECS_EDGE_SESSIONS_TTL=0) and is only ever evicted by the owning node, so a node that died
// without evicting would otherwise keep the edge marked active forever, with no reconciler to correct it.
private boolean isOwnedByAnotherNode(EdgeId edgeId) {
TbCacheValueWrapper<String> wrapper = edgeIdServiceIdCache.get(edgeId);
if (wrapper == null) {
return false;
}
String ownerServiceId = wrapper.get();
if (ownerServiceId == null || serviceInfoProvider.getServiceId().equals(ownerServiceId)) {
return false;
}
return partitionService.getAllServiceIds(ServiceType.TB_CORE).contains(ownerServiceId);
}
// The edge's service-id cache entry still points at this node, i.e. this node is the recorded owner.
private boolean isOwnedByThisNode(EdgeId edgeId) {
TbCacheValueWrapper<String> wrapper = edgeIdServiceIdCache.get(edgeId);
return wrapper != null && serviceInfoProvider.getServiceId().equals(wrapper.get());
}
private void destroySession(EdgeGrpcSession session) {

6
application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java

@ -7,6 +7,7 @@ import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.thingsboard.common.util.ExceptionUtil;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.Dashboard;
@ -934,12 +935,13 @@ public class DefaultIotHubService implements IotHubService {
} catch (Exception e) {
log.error("[{}] Cascade install failed at entry {} ({}): {}", tenantId,
entry.getName(), entry.getVersionId(), e.getMessage(), e);
resultEntry.setErrorMessage(e.getMessage());
String failureMessage = ExceptionUtil.getMessage(e);
resultEntry.setErrorMessage(failureMessage);
resultEntries.add(resultEntry);
boolean rolledBack = rollbackInstalledItems(user, rollbackIds);
result.setSuccess(false);
result.setRolledBack(rolledBack);
result.setErrorMessage("Failed to install '" + entry.getName() + "': " + e.getMessage());
result.setErrorMessage(failureMessage);
result.setEntries(resultEntries);
result.setMissingItemIds(missingItemIds);
return result;

212
application/src/main/java/org/thingsboard/server/service/solutions/DefaultSolutionService.java

@ -19,7 +19,6 @@ import org.thingsboard.server.common.adaptor.JsonConverter;
import org.thingsboard.server.common.data.AttributeScope;
import org.thingsboard.server.common.data.Dashboard;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.DashboardInfo;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.HasName;
import org.thingsboard.server.common.data.alarm.AlarmInfo;
@ -29,7 +28,6 @@ import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.iot_hub.SolutionTemplateInstalledItemDescriptor;
import org.thingsboard.server.common.data.kv.BaseDeleteTsKvQuery;
import org.thingsboard.server.common.data.kv.DeleteTsKvQuery;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.StringUtils;
@ -100,6 +98,7 @@ import org.thingsboard.server.service.solutions.data.DashboardLinkInfo;
import org.thingsboard.server.service.solutions.data.DeviceCredentialsInfo;
import org.thingsboard.server.service.solutions.data.EdgeLinkInfo;
import org.thingsboard.server.service.solutions.data.SolutionInstallContext;
import org.thingsboard.server.service.solutions.data.SolutionValidationResult;
import org.thingsboard.server.service.solutions.data.UserCredentialsInfo;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.thingsboard.server.service.solutions.data.definition.AssetDefinition;
@ -113,6 +112,7 @@ import org.thingsboard.server.service.solutions.data.definition.UserDefinition;
import org.thingsboard.server.service.solutions.data.definition.DashboardDefinition;
import org.thingsboard.server.service.solutions.data.definition.DeviceProfileDefinition;
import org.thingsboard.server.service.solutions.data.definition.EdgeDefinition;
import org.thingsboard.server.service.solutions.data.definition.EntityDefinition;
import org.thingsboard.server.service.solutions.data.definition.RelationDefinition;
import org.thingsboard.server.service.solutions.data.definition.ReferenceableEntityDefinition;
import org.thingsboard.server.service.solutions.data.definition.TenantDefinition;
@ -142,8 +142,10 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ExecutorService;
@ -164,6 +166,14 @@ import java.util.zip.ZipInputStream;
@Slf4j
public class DefaultSolutionService implements SolutionService {
private static final String BLANK_LINE = System.lineSeparator() + System.lineSeparator();
private static final String CONFLICTS_INTRO =
"Some entities of the solution template already exist. Rename or delete them and install the template again:";
private static final String RANDOM_PLACEHOLDER = "$random";
private static final int MAX_LISTED_NAMES_PER_TYPE = 10;
private static final String TRUNCATION_NOTE = "Only the first " + MAX_LISTED_NAMES_PER_TYPE
+ " names of each type are listed. The rest are reported the next time the template is installed.";
@Value("${ui.solution_templates.docs_base_url:https://thingsboard.io/docs}")
private String docsBaseUrl;
@ -235,9 +245,9 @@ public class DefaultSolutionService implements SolutionService {
throw new IllegalArgumentException("Solution template is missing solution.json or its 'title' field");
}
SolutionInstallResponse validateResult = validateSolution(tenantId, tempDir);
if (validateResult != null && !validateResult.isSuccess()) {
return validateResult;
SolutionValidationResult validation = validateSolution(tenantId, tempDir);
if (!validation.isPassed()) {
return conflictResponse(validation.getConflictReport());
}
return doInstallSolution(user, tenantId, solutionId, tempDir, request);
} finally {
@ -278,73 +288,159 @@ public class DefaultSolutionService implements SolutionService {
}
}
private SolutionInstallResponse validateSolution(TenantId tenantId, Path tempDir) {
Map<EntityType, List<HasName>> alreadyExistingEntities = new HashMap<>();
//TODO: check other entities.
SolutionValidationResult validateSolution(TenantId tenantId, Path tempDir) {
//TODO: pre-validate what still only fails at provision time: customer users (unique by email),
// alarm rules and calculated fields.
List<ReferenceableEntityDefinition> ruleChains = loadListOfEntitiesIfFileExists(tempDir, "rule_chains.json", new TypeReference<>() {
});
if (!ruleChains.isEmpty()) {
for (ReferenceableEntityDefinition ruleChain : ruleChains) {
List<RuleChain> savedRuleChains = ruleChainService.findTenantRuleChainsByType(tenantId, RuleChainType.CORE, new PageLink(1, 0, ruleChain.getName())).getData();
if (savedRuleChains != null && !savedRuleChains.isEmpty()) {
alreadyExistingEntities.computeIfAbsent(EntityType.RULE_CHAIN, key -> new ArrayList<>()).add(savedRuleChains.get(0));
}
}
}
List<DeviceProfileDefinition> deviceProfiles = loadListOfEntitiesIfFileExists(tempDir, "device_profiles.json", new TypeReference<>() {
});
deviceProfiles.addAll(loadListOfEntitiesFromDirectory(tempDir, "device_profiles", DeviceProfileDefinition.class));
// Validate that entities with such name does not exist entities
if (!deviceProfiles.isEmpty()) {
for (DeviceProfile deviceProfile : deviceProfiles) {
DeviceProfile savedProfile = deviceProfileService.findDeviceProfileByName(tenantId, deviceProfile.getName());
if (savedProfile != null) {
alreadyExistingEntities.computeIfAbsent(EntityType.DEVICE_PROFILE, key -> new ArrayList<>()).add(savedProfile);
}
}
}
List<AssetProfileDefinition> assetProfiles = loadListOfEntitiesIfFileExists(tempDir, "asset_profiles.json", new TypeReference<>() {
});
assetProfiles.addAll(loadListOfEntitiesFromDirectory(tempDir, "asset_profiles", AssetProfileDefinition.class));
// Validate that entities with such name does not exist entities
if (!assetProfiles.isEmpty()) {
for (AssetProfile assetProfile : assetProfiles) {
AssetProfile savedProfile = assetProfileService.findAssetProfileByName(tenantId, assetProfile.getName());
if (savedProfile != null) {
alreadyExistingEntities.computeIfAbsent(EntityType.ASSET_PROFILE, key -> new ArrayList<>()).add(savedProfile);
}
List<CustomerDefinition> customers = loadListOfEntitiesIfFileExists(tempDir, "customers.json", new TypeReference<>() {
});
List<DashboardDefinition> dashboards = loadListOfEntitiesIfFileExists(tempDir, "dashboards.json", new TypeReference<>() {
});
List<AssetDefinition> assets = loadListOfEntitiesIfFileExists(tempDir, "assets.json", new TypeReference<>() {
});
List<DeviceDefinition> devices = loadListOfEntitiesIfFileExists(tempDir, "devices.json", new TypeReference<>() {
});
List<EdgeDefinition> edges = loadListOfEntitiesIfFileExists(tempDir, "edges.json", new TypeReference<>() {
});
// Insertion ordered, so that the reported sections keep the order the entities are provisioned in.
Map<EntityType, List<String>> conflicts = new LinkedHashMap<>();
collectRuleChainConflicts(conflicts, tenantId, tempDir, ruleChains);
collectConflicts(conflicts, EntityType.DEVICE_PROFILE, deviceProfiles, DeviceProfile::getName,
name -> deviceProfileService.findDeviceProfileByName(tenantId, name));
collectConflicts(conflicts, EntityType.ASSET_PROFILE, assetProfiles, AssetProfile::getName,
name -> assetProfileService.findAssetProfileByName(tenantId, name));
collectConflicts(conflicts, customers,
title -> isRandomizedCustomerTitle(title) ? null : customerService.findCustomerByTenantIdAndTitle(tenantId, title).orElse(null));
collectConflicts(conflicts, assets, name -> assetService.findAssetByTenantIdAndName(tenantId, name));
collectConflicts(conflicts, devices, name -> deviceService.findDeviceByTenantIdAndName(tenantId, name));
collectConflicts(conflicts, dashboards, title -> dashboardService.findFirstDashboardInfoByTenantIdAndName(tenantId, title));
collectConflicts(conflicts, edges, name -> edgeService.findEdgeByTenantIdAndName(tenantId, name));
if (conflicts.isEmpty()) {
return SolutionValidationResult.passed();
}
StringBuilder details = new StringBuilder(CONFLICTS_INTRO).append(BLANK_LINE);
conflicts.forEach((entityType, conflictDescriptions) -> appendConflicts(details, entityType, conflictDescriptions));
if (conflicts.values().stream().anyMatch(descriptions -> descriptions.size() > MAX_LISTED_NAMES_PER_TYPE)) {
details.append(System.lineSeparator()).append(TRUNCATION_NOTE);
}
return SolutionValidationResult.conflictsFound(details.toString());
}
private static SolutionInstallResponse conflictResponse(String conflictReport) {
SolutionInstallResponse response = new SolutionInstallResponse();
response.setSuccess(false);
response.setDetails(conflictReport);
return response;
}
/**
* The entity type and the name both come from the definition, so a list can not end up checked against the
* wrong type by mistake.
*/
private void collectConflicts(Map<EntityType, List<String>> conflicts, List<? extends EntityDefinition> definitions,
Function<String, ? extends HasName> lookup) {
Set<String> checked = new HashSet<>();
for (EntityDefinition definition : definitions) {
if (checked.add(definition.getName())) {
collectConflict(conflicts, definition.getEntityType(), definition.getName(), lookup);
}
}
}
List<DashboardDefinition> dashboards = loadListOfEntitiesIfFileExists(tempDir, "dashboards.json", new TypeReference<>() {
});
if (!dashboards.isEmpty()) {
for (DashboardDefinition dashboard : dashboards) {
List<DashboardInfo> savedDashboards = dashboardService.findDashboardsByTenantId(tenantId, new PageLink(1, 0, dashboard.getName())).getData();
if (savedDashboards != null && !savedDashboards.isEmpty()) {
alreadyExistingEntities.computeIfAbsent(EntityType.DASHBOARD, key -> new ArrayList<>()).add(savedDashboards.get(0));
}
private <T> void collectConflicts(Map<EntityType, List<String>> conflicts, EntityType entityType, List<T> definitions,
Function<T, String> nameExtractor, Function<String, ? extends HasName> lookup) {
Set<String> checked = new HashSet<>();
for (T definition : definitions) {
String name = nameExtractor.apply(definition);
if (checked.add(name)) {
collectConflict(conflicts, entityType, name, lookup);
}
}
if (!alreadyExistingEntities.isEmpty()) {
SolutionInstallResponse solutionInstallResponse = new SolutionInstallResponse();
StringBuilder detailsBuilder = new StringBuilder();
detailsBuilder.append("## Validation failed").append(System.lineSeparator()).append(System.lineSeparator());
alreadyExistingEntities.forEach((type, list) -> detailsBuilder.append("The following **").append(getTypeLabel(type)).append("** entities already exist: ")
.append(list.stream().map(HasName::getName).map(name -> "'" + name + "'").collect(Collectors.joining(","))).append(";")
.append(System.lineSeparator()).append(System.lineSeparator()));
solutionInstallResponse.setSuccess(false);
solutionInstallResponse.setDetails(detailsBuilder.toString());
return solutionInstallResponse;
} else {
return null;
}
private void collectConflict(Map<EntityType, List<String>> conflicts, EntityType entityType, String name,
Function<String, ? extends HasName> lookup) {
if (StringUtils.isEmpty(name)) {
return;
}
HasName existing = lookup.apply(name);
if (existing != null) {
conflicts.computeIfAbsent(entityType, key -> new ArrayList<>()).add(quoted(existing.getName()));
}
}
/**
* A rule chain is created from the rule chain file, so both the name and the type of the chain the install will
* produce live there - the name in rule_chains.json is only a reference and the type defaults to CORE.
*/
private void collectRuleChainConflicts(Map<EntityType, List<String>> conflicts, TenantId tenantId, Path tempDir,
List<ReferenceableEntityDefinition> definitions) {
Set<String> checked = new HashSet<>();
for (ReferenceableEntityDefinition definition : definitions) {
if (StringUtils.isEmpty(definition.getFile())) {
continue;
}
Path ruleChainPath = tempDir.resolve("rule_chains").resolve(definition.getFile());
if (!Files.exists(ruleChainPath)) {
// provisionRuleChains logs and skips such a definition, so there is nothing to validate
continue;
}
JsonNode ruleChain = JacksonUtil.toJsonNode(ruleChainPath).get("ruleChain");
if (ruleChain == null || !ruleChain.hasNonNull("name")) {
continue;
}
RuleChainType type = ruleChain.hasNonNull("type")
? RuleChainType.valueOf(ruleChain.get("type").asText()) : RuleChainType.CORE;
String name = ruleChain.get("name").asText();
if (!checked.add(type + name)) {
continue;
}
collectConflict(conflicts, EntityType.RULE_CHAIN, name,
ignored -> ruleChainService.findTenantRuleChainsByTypeAndName(tenantId, type, name)
.stream().findFirst().orElse(null));
}
}
/**
* Only customer titles, user names and attribute values go through {@link #randomize}, so a {@code $random}
* placeholder in a customer title is replaced at install time and there is nothing to check upfront. Names of
* every other entity are used as written, placeholder included, and must be looked up as is.
*/
private static boolean isRandomizedCustomerTitle(String title) {
return title.contains(RANDOM_PLACEHOLDER);
}
private static String quoted(String value) {
return "'" + value + "'";
}
/**
* One markdown list item per entity type, so that the names of the conflicting entities are what the user reads,
* instead of the same sentence repeated for every type. Only the first {@value #MAX_LISTED_NAMES_PER_TYPE}
* names of a type are listed, the rest are counted - {@link #TRUNCATION_NOTE} tells the user that the list of
* that type is not complete.
*/
private static void appendConflicts(StringBuilder details, EntityType entityType, List<String> conflictDescriptions) {
details.append("- **").append(entityType.getNormalName()).append("**: ")
.append(conflictDescriptions.stream().limit(MAX_LISTED_NAMES_PER_TYPE).collect(Collectors.joining(", ")));
if (conflictDescriptions.size() > MAX_LISTED_NAMES_PER_TYPE) {
details.append(" and ").append(conflictDescriptions.size() - MAX_LISTED_NAMES_PER_TYPE)
.append(" more (").append(conflictDescriptions.size()).append(" in total)");
}
details.append(System.lineSeparator());
}
private SolutionInstallResponse doInstallSolution(User user, TenantId tenantId, String solutionId, Path tempDir, HttpServletRequest request) {
SolutionInstallContext ctx = new SolutionInstallContext(tenantId, solutionId, tempDir, user, new TenantSolutionTemplateInstructions());
@ -1437,10 +1533,6 @@ public class DefaultSolutionService implements SolutionService {
return String.valueOf(now.toInstant().toEpochMilli());
}
private String getTypeLabel(EntityType type) {
return type.name().toLowerCase().replace('_', ' ');
}
private <T> T loadEntityIfFileExists(Path tempDir, String fileName, Class<T> clazz) {
Path filePath = tempDir.resolve("entities").resolve(fileName);
if (Files.exists(filePath)) {
@ -1454,7 +1546,7 @@ public class DefaultSolutionService implements SolutionService {
Path filePath = tempDir.resolve("entities").resolve(fileName);
if (Files.exists(filePath)) {
try {
return JacksonUtil.readValue(filePath.toFile(), typeReference);
return Objects.requireNonNullElseGet(JacksonUtil.readValue(filePath.toFile(), typeReference), ArrayList::new);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid json file " + fileName + " data structure", e);
}

30
application/src/main/java/org/thingsboard/server/service/solutions/data/SolutionValidationResult.java

@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
package org.thingsboard.server.service.solutions.data;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* The outcome of validating a solution template before anything is created: either the install can go ahead, or the
* entities of the tenant the template clashes with, reported as the markdown the install dialog renders.
*/
@Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class SolutionValidationResult {
private static final SolutionValidationResult PASSED = new SolutionValidationResult(true, "");
private final boolean passed;
private final String conflictReport;
public static SolutionValidationResult passed() {
return PASSED;
}
public static SolutionValidationResult conflictsFound(String conflictReport) {
return new SolutionValidationResult(false, conflictReport);
}
}

2
application/src/main/resources/thingsboard.yml

@ -1428,7 +1428,7 @@ transport:
# URL of gateways dashboard repository
repository_url: "${TB_GATEWAY_DASHBOARD_SYNC_REPOSITORY_URL:https://github.com/thingsboard/gateway-management-extensions-dist.git}"
# Branch of gateways dashboard repository to work with
branch: "${TB_GATEWAY_DASHBOARD_SYNC_BRANCH:release/4.0.0}"
branch: "${TB_GATEWAY_DASHBOARD_SYNC_BRANCH:release/4.2.0}"
# Fetch frequency in hours for gateways dashboard repository
fetch_frequency: "${TB_GATEWAY_DASHBOARD_SYNC_FETCH_FREQUENCY:24}"
ssl:

208
application/src/test/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcServiceTest.java

@ -0,0 +1,208 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
package org.thingsboard.server.service.edge.rpc;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentMatcher;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.test.util.ReflectionTestUtils;
import org.thingsboard.rule.engine.api.AttributesSaveRequest;
import org.thingsboard.server.cache.SimpleTbCacheValueWrapper;
import org.thingsboard.server.cache.TbTransactionalCache;
import org.thingsboard.server.cluster.TbClusterService;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.id.EdgeId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.queue.discovery.PartitionService;
import org.thingsboard.server.queue.discovery.TbServiceInfoProvider;
import org.thingsboard.server.service.edge.EdgeContextComponent;
import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.thingsboard.server.service.state.DefaultDeviceStateService.ACTIVITY_STATE;
@ExtendWith(MockitoExtension.class)
public class EdgeGrpcServiceTest {
private static final String THIS_NODE = "tb-core-1";
private static final String OTHER_NODE = "tb-core-2";
@Mock
private TbTransactionalCache<EdgeId, String> edgeIdServiceIdCache;
@Mock
private TbServiceInfoProvider serviceInfoProvider;
@Mock
private PartitionService partitionService;
@Mock
private TelemetrySubscriptionService tsSubService;
@Mock
private TbClusterService clusterService;
@Mock
private EdgeContextComponent ctx;
@InjectMocks
private EdgeGrpcService edgeGrpcService;
private EdgeId edgeId;
private Edge edge;
@BeforeEach
public void setUp() {
edgeId = new EdgeId(UUID.randomUUID());
edge = new Edge(edgeId);
edge.setTenantId(TenantId.fromUUID(UUID.randomUUID()));
edge.setName("test-edge");
}
// --- activity-state write guard on disconnect ---
@Test
public void givenEdgeReconnectedToAnotherNode_whenDisconnect_thenInactiveStateNotPersisted() {
// A newer session on another node already set active=true. This stale session's disconnect must not
// clobber it - otherwise the edge stays marked inactive while connected, and the server silently
// drops every assignment event for it.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE, OTHER_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, never()).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenEdgeOwnedByThisNode_whenDisconnect_thenInactiveStateIsPersisted() {
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenNoCacheEntry_whenDisconnect_thenInactiveStateIsPersisted() {
// Ownership unknown (entry absent or expired): keep the pre-guard behaviour, otherwise a genuinely
// disconnected edge would stay marked active forever.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(null);
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenOwnerNodeNoLongerInCluster_whenDisconnect_thenInactiveStateIsPersisted() {
// The recorded owner died without evicting its claim. The edge sessions cache has no TTL by default
// and only the owner ever evicts, so honouring a dead claim would leave the edge active forever.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenSessionReplacedDuringDisconnect_whenStaleCallbackRuns_thenLiveSessionKept() {
// Reproduces the get()/remove() interleaving on a single node: onEdgeConnect swaps in a new session
// right after the stale callback's id check passes. The stale callback must not evict or tear down
// the live session, nor clear the activity state.
UUID staleSessionId = UUID.randomUUID();
EdgeGrpcSession live = mock(EdgeGrpcSession.class);
EdgeGrpcSession stale = mock(EdgeGrpcSession.class);
when(stale.getSessionId()).thenAnswer(invocation -> {
sessions().put(edgeId, live);
return staleSessionId;
});
sessions().put(edgeId, stale);
onEdgeDisconnect(staleSessionId);
assertThat(sessions().get(edgeId)).isSameAs(live);
verify(tsSubService, never()).saveAttributes(argThat(inactiveStateWrite()));
}
// --- service-id cache eviction guard ---
@Test
public void givenCacheOwnedByThisNode_whenDisconnect_thenEntryIsEvicted() {
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(edgeIdServiceIdCache, times(1)).evict(edgeId);
}
@Test
public void givenCacheOwnedByAnotherNode_whenDisconnect_thenEntryIsKept() {
// The edge already reconnected elsewhere: wiping the live owner's claim would defeat the
// activity-state guard for any later disconnect callback.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE, OTHER_NODE));
onEdgeDisconnect(sessionId);
verify(edgeIdServiceIdCache, never()).evict(edgeId);
}
private void onEdgeDisconnect(UUID sessionId) {
ReflectionTestUtils.invokeMethod(edgeGrpcService, "onEdgeDisconnect", edge, sessionId);
}
private EdgeGrpcSession sessionFor(UUID sessionId) {
EdgeGrpcSession session = mock(EdgeGrpcSession.class);
when(session.getSessionId()).thenReturn(sessionId);
when(session.getEdge()).thenReturn(edge);
return session;
}
@SuppressWarnings("unchecked")
private ConcurrentMap<EdgeId, EdgeGrpcSession> sessions() {
return (ConcurrentMap<EdgeId, EdgeGrpcSession>) ReflectionTestUtils.getField(edgeGrpcService, "sessions");
}
private ArgumentMatcher<AttributesSaveRequest> inactiveStateWrite() {
return request -> request != null
&& edgeId.equals(request.getEntityId())
&& request.getEntries().stream().anyMatch(entry ->
ACTIVITY_STATE.equals(entry.getKey())
&& Boolean.FALSE.equals(entry.getBooleanValue().orElse(null)));
}
}

58
application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java

@ -331,6 +331,64 @@ class DefaultIotHubServiceTest {
inOrder.verify(service).deleteInstalledItem(user, dep1Item.getId());
}
@Test
void installPlan_errorMessageIsTheFailureItselfWithoutAnyPrefix() throws Exception {
mockTenant();
HttpServletRequest request = mock(HttpServletRequest.class);
String rootVersionId = UUID.randomUUID().toString();
InstallPlanEntry root = willInstall(rootVersionId, true);
when(iotHubInstalledItemService.findInstalledItemIdsByTenantIdAndItemIdIn(eq(tenantId), any())).thenReturn(List.of());
doThrow(new IllegalStateException("install failed")).when(service).doInstallVersion(eq(user), eq(rootVersionId), any(), any());
InstallPlanResult result = service.installPlan(user, new InstallPlan(rootVersionId, List.of(root)), null, request);
// the sentence around the failure belongs to the dialog, which localizes it
assertThat(result.getErrorMessage()).isEqualTo("install failed");
}
@Test
void installPlan_dependencyFails_failureIsReportedOnTheEntryAndAsTheResultMessage() throws Exception {
mockTenant();
HttpServletRequest request = mock(HttpServletRequest.class);
String depVersionId = UUID.randomUUID().toString();
String rootVersionId = UUID.randomUUID().toString();
InstallPlanEntry dep = willInstall(depVersionId, false);
InstallPlanEntry root = willInstall(rootVersionId, true);
when(iotHubInstalledItemService.findInstalledItemIdsByTenantIdAndItemIdIn(eq(tenantId), any())).thenReturn(List.of());
doThrow(new IllegalStateException("install failed")).when(service).doInstallVersion(eq(user), eq(depVersionId), any(), any());
InstallPlanResult result = service.installPlan(user, new InstallPlan(rootVersionId, List.of(dep, root)), null, request);
// the dialog names the failing dependency itself, from the entry it finds in the result
assertThat(result.getErrorMessage()).isEqualTo("install failed");
assertThat(result.getEntries()).anySatisfy(entry -> {
assertThat(entry.getName()).isEqualTo("Dep");
assertThat(entry.isRoot()).isFalse();
assertThat(entry.getErrorMessage()).isEqualTo("install failed");
});
verify(service, never()).doInstallVersion(eq(user), eq(rootVersionId), any(), any());
}
@Test
void installPlan_failureWithoutMessage_reportsTheExceptionType() throws Exception {
mockTenant();
HttpServletRequest request = mock(HttpServletRequest.class);
String rootVersionId = UUID.randomUUID().toString();
InstallPlanEntry root = willInstall(rootVersionId, true);
when(iotHubInstalledItemService.findInstalledItemIdsByTenantIdAndItemIdIn(eq(tenantId), any())).thenReturn(List.of());
doThrow(new NullPointerException()).when(service).doInstallVersion(eq(user), eq(rootVersionId), any(), any());
InstallPlanResult result = service.installPlan(user, new InstallPlan(rootVersionId, List.of(root)), null, request);
// the dialog looks the failing entry up by its error message, so it must never be blank
assertThat(result.getErrorMessage()).isEqualTo("NullPointerException");
assertThat(result.getEntries()).allSatisfy(entry ->
assertThat(entry.getErrorMessage()).isEqualTo("NullPointerException"));
}
@Test
void installPlan_rollbackFailure_reportsNotFullyRolledBack() throws Exception {
mockTenant();

86
application/src/test/java/org/thingsboard/server/service/script/NashornJsInvokeServiceTest.java

@ -4,13 +4,17 @@ package org.thingsboard.server.service.script;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import delight.nashornsandbox.NashornSandbox;
import delight.nashornsandbox.NashornSandboxes;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.util.ReflectionTestUtils;
import org.thingsboard.common.util.TbStopWatch;
import org.thingsboard.script.api.RuleNodeScriptFactory;
import org.thingsboard.script.api.ScriptType;
import org.thingsboard.script.api.TbScriptException;
import org.thingsboard.script.api.js.NashornJsInvokeService;
@ -18,6 +22,7 @@ import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.controller.AbstractControllerTest;
import org.thingsboard.server.dao.service.DaoSqlTest;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import java.util.ArrayList;
import java.util.List;
@ -209,6 +214,87 @@ class NashornJsInvokeServiceTest extends AbstractControllerTest {
});
}
@Test
void whenScriptIsReleased_thenGlobalPropertyIsRemoved() throws Exception {
UUID scriptId = evalScript("return msg;");
String functionName = "invokeInternal_" + scriptId.toString().replace('-', '_');
assertThat(evalInEngine("this.hasOwnProperty('" + functionName + "')")).isEqualTo(true);
invokeService.release(scriptId).get();
// the property must be deleted, not just set to undefined: an abandoned binding keeps
// its slot in the Global's PropertyMap forever
assertThat(evalInEngine("this.hasOwnProperty('" + functionName + "')")).isEqualTo(false);
}
@Test
void givenIifeWrappedEval_whenInvoking_thenResultIsUnchanged() throws Exception {
UUID scriptId = evalScript("return {doubled: msg.temperature * 2};");
assertThat(invokeScript(scriptId, "{\"temperature\":21}")).contains("\"doubled\":42");
}
@Test
void givenIifeWrappedEval_thenImplicitGlobalStateIsStillSharedBetweenScripts() throws Exception {
UUID writer = evalScript("compatSharedState = 777; return msg;");
UUID reader = evalScript("return {seen: (typeof compatSharedState === 'undefined') ? null : compatSharedState};");
invokeScript(writer, "{}");
assertThat(invokeScript(reader, "{}")).contains("\"seen\":777");
}
@Test
void givenIifeWrappedEval_thenCompilationErrorUnchanged() {
String badScript = "var a = 1;\nvar b = 2;\nreturn msg.temperature?.value;";
String legacyScript = RuleNodeScriptFactory.generateRuleNodeScript("invokeInternal_legacy", badScript,
"msg", "metadata", "msgType");
NashornSandbox legacySandbox = NashornSandboxes.create();
legacySandbox.allowNoBraces(false);
legacySandbox.allowLoadFunctions(true);
legacySandbox.setMaxPreparedStatements(30);
int legacyErrorLine = -1;
try {
legacySandbox.eval(legacyScript);
} catch (ScriptException e) {
legacyErrorLine = e.getLineNumber();
}
assertThat(legacyErrorLine).isGreaterThan(0);
final int expectedLine = legacyErrorLine;
assertThatThrownBy(() -> evalScript(badScript))
.isInstanceOf(ExecutionException.class)
.cause()
.isInstanceOf(TbScriptException.class)
.asInstanceOf(type(TbScriptException.class))
.satisfies(ex -> {
assertThat(ex.getErrorCode()).isEqualTo(TbScriptException.ErrorCode.COMPILATION);
assertThat(ex.getBody()).contains(badScript);
assertThat(ex.getCause()).isInstanceOf(ScriptException.class);
// The IIFE wrapper shifts sandbox-reported line numbers by a constant +2
// (the beautifier splits the wrapper prefix onto its own lines). Reported
// lines never matched the user's source anyway (the sandbox instrumentation
// already offsets them), so only the small constant shift is tolerated here.
assertThat(((ScriptException) ex.getCause()).getLineNumber()).isBetween(expectedLine, expectedLine + 2);
});
}
@Test
void whenInvokingAfterRelease_thenFailsWithNoCompiledScriptFound() throws Exception {
UUID scriptId = evalScript("return msg;");
invokeScript(scriptId, "{}");
invokeService.release(scriptId).get();
assertThatThrownBy(() -> invokeScript(scriptId, "{}"))
.isInstanceOf(ExecutionException.class)
.hasMessageContaining("No compiled script found");
}
private Object evalInEngine(String expression) throws Exception {
Object sandbox = ReflectionTestUtils.getField(invokeService, "sandbox");
if (sandbox != null) {
return ((NashornSandbox) sandbox).eval(expression);
}
return ((ScriptEngine) ReflectionTestUtils.getField(invokeService, "engine")).eval(expression);
}
private void assertThatScriptIsBlocked(UUID scriptId) {
assertThatThrownBy(() -> {
invokeScript(scriptId, "{}");

294
application/src/test/java/org/thingsboard/server/service/solutions/DefaultSolutionServiceTest.java

@ -0,0 +1,294 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
package org.thingsboard.server.service.solutions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.DashboardInfo;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.asset.Asset;
import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.rule.RuleChain;
import org.thingsboard.server.common.data.rule.RuleChainType;
import org.thingsboard.server.dao.asset.AssetProfileService;
import org.thingsboard.server.dao.asset.AssetService;
import org.thingsboard.server.dao.customer.CustomerService;
import org.thingsboard.server.dao.dashboard.DashboardService;
import org.thingsboard.server.dao.device.DeviceProfileService;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.edge.EdgeService;
import org.thingsboard.server.dao.rule.RuleChainService;
import org.thingsboard.server.service.solutions.data.SolutionValidationResult;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
class DefaultSolutionServiceTest {
private static final String CONFLICTS_INTRO =
"Some entities of the solution template already exist. Rename or delete them and install the template again:";
// mirrors DefaultSolutionService.MAX_LISTED_NAMES_PER_TYPE and the note that goes with it
private static final int LISTED_NAMES_PER_TYPE = 10;
private static final String TRUNCATION_NOTE = "Only the first " + LISTED_NAMES_PER_TYPE
+ " names of each type are listed. The rest are reported the next time the template is installed.";
private final TenantId tenantId = TenantId.fromUUID(UUID.randomUUID());
@Mock
private CustomerService customerService;
@Mock
private DeviceService deviceService;
@Mock
private AssetService assetService;
@Mock
private DashboardService dashboardService;
@Mock
private RuleChainService ruleChainService;
@Mock
private DeviceProfileService deviceProfileService;
@Mock
private AssetProfileService assetProfileService;
@Mock
private EdgeService edgeService;
@InjectMocks
private DefaultSolutionService service;
@TempDir
private Path tempDir;
@Test
void testValidateSolutionNamesEveryConflictingEntity() throws IOException {
writeEntitiesFile("customers.json", "[{\"name\": \"Existing customer\"}, {\"name\": \"Customer $random\"}]");
writeEntitiesFile("devices.json", "[{\"name\": \"Existing device\"}, {\"name\": \"New device\"}]");
writeEntitiesFile("assets.json", "[{\"name\": \"Existing asset\"}, {\"name\": \"New asset\"}]");
Customer customer = new Customer();
customer.setTitle("Existing customer");
when(customerService.findCustomerByTenantIdAndTitle(tenantId, "Existing customer")).thenReturn(Optional.of(customer));
Asset asset = new Asset();
asset.setName("Existing asset");
when(assetService.findAssetByTenantIdAndName(tenantId, "Existing asset")).thenReturn(asset);
when(assetService.findAssetByTenantIdAndName(tenantId, "New asset")).thenReturn(null);
when(deviceService.findDeviceByTenantIdAndName(tenantId, "Existing device"))
.thenReturn(existingDevice("Existing device"));
when(deviceService.findDeviceByTenantIdAndName(tenantId, "New device")).thenReturn(null);
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.isPassed()).isFalse();
assertThat(result.getConflictReport().lines().toList())
.containsSubsequence(
CONFLICTS_INTRO,
"- **Customer**: 'Existing customer'",
"- **Asset**: 'Existing asset'",
"- **Device**: 'Existing device'");
// the randomized customer title and the entities that do not exist yet are not reported
assertThat(result.getConflictReport())
.doesNotContain("Customer $random")
.doesNotContain("New device")
.doesNotContain("New asset");
}
@Test
void testValidateSolutionReportsConflictingDashboard() throws IOException {
writeEntitiesFile("dashboards.json", "[{\"name\": \"Overview\", \"file\": \"overview.json\"}]");
DashboardInfo dashboard = new DashboardInfo();
dashboard.setTitle("Overview");
when(dashboardService.findFirstDashboardInfoByTenantIdAndName(tenantId, "Overview")).thenReturn(dashboard);
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.isPassed()).isFalse();
assertThat(result.getConflictReport().lines().toList())
.containsSubsequence(CONFLICTS_INTRO, "- **Dashboard**: 'Overview'");
}
@Test
void testValidateSolutionUsesTheRuleChainNameFromTheRuleChainFile() throws IOException {
writeEntitiesFile("rule_chains.json", "[{\"name\": \"Name in the definition\", \"file\": \"rc.json\"}]");
writeFile("rule_chains/rc.json", "{\"ruleChain\": {\"name\": \"Name the install creates\"}}");
RuleChain ruleChain = new RuleChain();
ruleChain.setName("Name the install creates");
when(ruleChainService.findTenantRuleChainsByTypeAndName(tenantId, RuleChainType.CORE, "Name the install creates"))
.thenReturn(List.of(ruleChain));
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.isPassed()).isFalse();
assertThat(result.getConflictReport().lines().toList())
.containsSubsequence(CONFLICTS_INTRO, "- **Rule chain**: 'Name the install creates'");
}
@Test
void testValidateSolutionReportsConflictingProfilesAndEdge() throws IOException {
writeEntitiesFile("device_profiles.json", "[{\"name\": \"thermostat\"}]");
writeEntitiesFile("asset_profiles.json", "[{\"name\": \"building\"}]");
writeEntitiesFile("edges.json", "[{\"name\": \"Main edge\"}]");
DeviceProfile deviceProfile = new DeviceProfile();
deviceProfile.setName("thermostat");
AssetProfile assetProfile = new AssetProfile();
assetProfile.setName("building");
Edge edge = new Edge();
edge.setName("Main edge");
when(deviceProfileService.findDeviceProfileByName(tenantId, "thermostat")).thenReturn(deviceProfile);
when(assetProfileService.findAssetProfileByName(tenantId, "building")).thenReturn(assetProfile);
when(edgeService.findEdgeByTenantIdAndName(tenantId, "Main edge")).thenReturn(edge);
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.isPassed()).isFalse();
assertThat(result.getConflictReport().lines().toList()).containsSubsequence(
"- **Device profile**: 'thermostat'",
"- **Asset profile**: 'building'",
"- **Edge**: 'Main edge'");
}
@Test
void testValidateSolutionLooksTheSameNameUpOnce() throws IOException {
writeEntitiesFile("devices.json", "[{\"name\": \"Sensor\"}, {\"name\": \"Sensor\"}]");
when(deviceService.findDeviceByTenantIdAndName(tenantId, "Sensor")).thenReturn(existingDevice("Sensor"));
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.getConflictReport().lines().toList()).contains("- **Device**: 'Sensor'");
verify(deviceService, times(1)).findDeviceByTenantIdAndName(tenantId, "Sensor");
}
@Test
void testValidateSolutionSkipsRuleChainsWithoutAResolvableName() throws IOException {
writeEntitiesFile("rule_chains.json", "[{\"name\": \"No file\", \"file\": \"missing.json\"}," +
"{\"name\": \"No name inside\", \"file\": \"nameless.json\"}]");
writeFile("rule_chains/nameless.json", "{\"ruleChain\": {}}");
assertThat(service.validateSolution(tenantId, tempDir).isPassed()).isTrue();
verifyNoInteractions(ruleChainService);
}
@Test
void testValidateSolutionUsesTheRuleChainTypeFromTheRuleChainFile() throws IOException {
writeEntitiesFile("rule_chains.json", "[{\"name\": \"Edge chain\", \"file\": \"rc.json\"}]");
writeFile("rule_chains/rc.json", "{\"ruleChain\": {\"name\": \"Edge chain\", \"type\": \"EDGE\"}}");
RuleChain ruleChain = new RuleChain();
ruleChain.setName("Edge chain");
when(ruleChainService.findTenantRuleChainsByTypeAndName(tenantId, RuleChainType.EDGE, "Edge chain"))
.thenReturn(List.of(ruleChain));
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.getConflictReport().lines().toList()).contains("- **Rule chain**: 'Edge chain'");
}
@Test
void testValidateSolutionTreatsAJsonNullFileAsEmpty() throws IOException {
writeEntitiesFile("devices.json", "null");
assertThat(service.validateSolution(tenantId, tempDir).isPassed()).isTrue();
verifyNoInteractions(deviceService);
}
@ParameterizedTest
@ValueSource(ints = {LISTED_NAMES_PER_TYPE, LISTED_NAMES_PER_TYPE + 1, LISTED_NAMES_PER_TYPE + 2})
void testValidateSolutionListsAtMostTenNamesOfAType(int conflictCount) throws IOException {
List<String> names = IntStream.rangeClosed(1, conflictCount).mapToObj(i -> "Sensor " + i).toList();
writeEntitiesFile("devices.json", names.stream()
.map(name -> "{\"name\": \"" + name + "\"}")
.collect(Collectors.joining(",", "[", "]")));
names.forEach(name -> when(deviceService.findDeviceByTenantIdAndName(tenantId, name))
.thenReturn(existingDevice(name)));
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
int hidden = conflictCount - LISTED_NAMES_PER_TYPE;
String listed = names.stream().limit(LISTED_NAMES_PER_TYPE)
.map(name -> "'" + name + "'").collect(Collectors.joining(", "));
assertThat(result.getConflictReport().lines().toList()).contains("- **Device**: " + listed
+ (hidden > 0 ? " and " + hidden + " more (" + conflictCount + " in total)" : ""));
if (hidden > 0) {
assertThat(result.getConflictReport()).contains(TRUNCATION_NOTE);
} else {
assertThat(result.getConflictReport()).doesNotContain(TRUNCATION_NOTE);
}
}
/**
* The profile lists are the json file plus every file in the directory of the same name merged into one list, so
* this is where the same name genuinely can appear twice.
*/
@Test
void testValidateSolutionChecksAProfileFromBothSourcesOnce() throws IOException {
writeEntitiesFile("device_profiles.json", "[{\"name\": \"Sensor profile\"}]");
writeFile("device_profiles/sensor_profile.json", "{\"name\": \"Sensor profile\"}");
DeviceProfile profile = new DeviceProfile();
profile.setName("Sensor profile");
when(deviceProfileService.findDeviceProfileByName(tenantId, "Sensor profile")).thenReturn(profile);
SolutionValidationResult result = service.validateSolution(tenantId, tempDir);
assertThat(result.getConflictReport().lines().toList()).contains("- **Device profile**: 'Sensor profile'");
verify(deviceProfileService, times(1)).findDeviceProfileByName(tenantId, "Sensor profile");
}
@Test
void testValidateSolutionWithoutConflicts() throws IOException {
writeEntitiesFile("devices.json", "[{\"name\": \"New device\"}]");
when(deviceService.findDeviceByTenantIdAndName(tenantId, "New device")).thenReturn(null);
assertThat(service.validateSolution(tenantId, tempDir).isPassed()).isTrue();
}
@Test
void testValidateSolutionWithoutEntityFiles() {
assertThat(service.validateSolution(tenantId, tempDir).isPassed()).isTrue();
verifyNoInteractions(customerService, deviceService, assetService, dashboardService, ruleChainService,
deviceProfileService, assetProfileService, edgeService);
}
private static Device existingDevice(String name) {
Device device = new Device();
device.setName(name);
return device;
}
private void writeFile(String relativePath, String content) throws IOException {
Path file = tempDir.resolve(relativePath);
Files.createDirectories(file.getParent());
Files.writeString(file, content);
}
private void writeEntitiesFile(String fileName, String content) throws IOException {
Path entitiesDir = Files.createDirectories(tempDir.resolve("entities"));
Files.writeString(entitiesDir.resolve(fileName), content);
}
}

2
common/actor/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/cache/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/cluster-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/coap-server/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/dao-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/data/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/discovery-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/edge-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

1
common/edge-api/src/main/proto/edge.proto

@ -38,6 +38,7 @@ enum EdgeVersion {
V_4_2_2_3 = 4223;
V_4_2_2_4 = 4224;
V_4_2_2_5 = 4225;
V_4_2_2_6 = 4226;
V_LATEST = 99999;
}

2
common/edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/message/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>common</artifactId>

2
common/proto/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/queue/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/script/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/script/remote-js-client/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>script</artifactId>
</parent>
<groupId>org.thingsboard.common.script</groupId>

2
common/script/script-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>script</artifactId>
</parent>
<groupId>org.thingsboard.common.script</groupId>

26
common/script/script-api/src/main/java/org/thingsboard/script/api/js/NashornJsInvokeService.java

@ -127,14 +127,22 @@ public class NashornJsInvokeService extends AbstractJsInvokeService {
@Override
protected ListenableFuture<UUID> doEval(UUID scriptId, JsScriptInfo scriptInfo, String jsScript) {
// A top-level function declaration creates a non-configurable property on the Nashorn Global
// that can never be deleted, so every eval/release cycle would grow the Global's PropertyMap
// shape history forever. Declaring the function inside an IIFE and assigning it to a global
// property keeps the property configurable, allowing doRelease() to actually delete it.
// The prefix stays on the first line to preserve line numbering on the raw engine path;
// the sandbox beautifier reformats the wrapper and shifts reported error lines anyway.
String wrappedScript = "this['" + scriptInfo.getFunctionName() + "'] = (function() { " + jsScript
+ "\nreturn " + scriptInfo.getFunctionName() + ";\n})();";
return jsExecutor.submit(() -> {
try {
evalLock.lock();
try {
if (useJsSandbox) {
sandbox.eval(jsScript);
sandbox.eval(wrappedScript);
} else {
engine.eval(jsScript);
engine.eval(wrappedScript);
}
} finally {
evalLock.unlock();
@ -169,10 +177,16 @@ public class NashornJsInvokeService extends AbstractJsInvokeService {
}
protected void doRelease(UUID scriptId, JsScriptInfo scriptInfo) throws ScriptException {
if (useJsSandbox) {
sandbox.eval(scriptInfo.getFunctionName() + " = undefined;");
} else {
engine.eval(scriptInfo.getFunctionName() + " = undefined;");
String deleteScript = "delete this['" + scriptInfo.getFunctionName() + "'];";
evalLock.lock();
try {
if (useJsSandbox) {
sandbox.eval(deleteScript);
} else {
engine.eval(deleteScript);
}
} finally {
evalLock.unlock();
}
}

109
common/script/script-api/src/test/java/org/thingsboard/script/api/js/NashornJsInvokeServiceLifecycleTest.java

@ -0,0 +1,109 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
package org.thingsboard.script.api.js;
import delight.nashornsandbox.NashornSandbox;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.Mockito;
import org.springframework.test.util.ReflectionTestUtils;
import org.thingsboard.script.api.ScriptType;
import org.thingsboard.script.api.TbScriptException;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.stats.StatsFactory;
import javax.script.ScriptEngine;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
/**
* Covers the JS global scope lifecycle against both backends the service can be configured with.
* The Spring-wired {@code NashornJsInvokeServiceTest} only exercises the sandbox, since
* {@code js.local.use_js_sandbox} defaults to true.
*/
class NashornJsInvokeServiceLifecycleTest {
private static final String[] ARG_NAMES = {"msg", "metadata", "msgType"};
private NashornJsInvokeService service;
private boolean useJsSandbox;
@AfterEach
void tearDown() {
if (service != null) {
service.stop();
}
}
@ParameterizedTest(name = "useJsSandbox = {0}")
@ValueSource(booleans = {true, false})
void whenScriptIsReleased_thenGlobalPropertyIsRemovedAndFunctionIsGone(boolean useJsSandbox) throws Exception {
givenService(useJsSandbox);
UUID scriptId = UUID.randomUUID();
JsScriptInfo scriptInfo = eval(scriptId, "return {doubled: msg.temperature * 2};");
assertThat(hasGlobalProperty(scriptInfo)).isTrue();
assertThat(invoke(scriptId, scriptInfo, "{\"temperature\":21}")).asString().contains("\"doubled\":42");
service.doRelease(scriptId);
assertThat(hasGlobalProperty(scriptInfo)).isFalse();
assertThatThrownBy(() -> invoke(scriptId, scriptInfo, "{\"temperature\":21}"))
.isInstanceOf(ExecutionException.class)
.cause()
.isInstanceOf(TbScriptException.class);
}
@ParameterizedTest(name = "useJsSandbox = {0}")
@ValueSource(booleans = {true, false})
void whenOneOfTwoScriptsIsReleased_thenTheOtherKeepsWorking(boolean useJsSandbox) throws Exception {
givenService(useJsSandbox);
UUID releasedId = UUID.randomUUID();
UUID retainedId = UUID.randomUUID();
JsScriptInfo released = eval(releasedId, "return {v: 1};");
JsScriptInfo retained = eval(retainedId, "return {v: 2};");
service.doRelease(releasedId);
assertThat(hasGlobalProperty(released)).isFalse();
assertThat(hasGlobalProperty(retained)).isTrue();
assertThat(invoke(retainedId, retained, "{}")).asString().contains("\"v\":2");
}
private void givenService(boolean useJsSandbox) {
this.useJsSandbox = useJsSandbox;
service = new NashornJsInvokeService(Optional.empty(), Optional.empty());
ReflectionTestUtils.setField(service, "statsFactory", mock(StatsFactory.class, Mockito.RETURNS_DEEP_STUBS));
ReflectionTestUtils.setField(service, "useJsSandbox", useJsSandbox);
ReflectionTestUtils.setField(service, "jsExecutorThreadPoolSize", 4);
ReflectionTestUtils.setField(service, "monitorThreadPoolSize", 2);
ReflectionTestUtils.setField(service, "maxCpuTime", 8000L);
ReflectionTestUtils.setField(service, "maxMemory", 104857600L);
service.init();
}
private JsScriptInfo eval(UUID scriptId, String scriptBody) throws Exception {
service.doEvalScript(TenantId.SYS_TENANT_ID, ScriptType.RULE_NODE_SCRIPT, scriptBody, scriptId, ARG_NAMES).get();
return service.scriptInfoMap.get(scriptId);
}
private Object invoke(UUID scriptId, JsScriptInfo scriptInfo, String msg) throws Exception {
return service.doInvokeFunction(scriptId, scriptInfo, new Object[]{msg, "{}", "POST_TELEMETRY_REQUEST"}).get();
}
private boolean hasGlobalProperty(JsScriptInfo scriptInfo) throws Exception {
String expression = "this.hasOwnProperty('" + scriptInfo.getFunctionName() + "')";
Object result = useJsSandbox
? ((NashornSandbox) ReflectionTestUtils.getField(service, "sandbox")).eval(expression)
: ((ScriptEngine) ReflectionTestUtils.getField(service, "engine")).eval(expression);
return Boolean.TRUE.equals(result);
}
}

2
common/stats/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>

2
common/transport/transport-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/util/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/version-control/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
dao/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>dao</artifactId>

2
edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>edqs</artifactId>

2
monitoring/pom.xml

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>

2
msa/black-box-tests/pom.xml

@ -10,7 +10,7 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/js-executor/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard-js-executor",
"private": true,
"version": "4.2.2.5",
"version": "4.2.2.6",
"description": "ThingsBoard JavaScript Executor Microservice",
"main": "server.ts",
"bin": "server.js",

23
msa/js-executor/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>
@ -30,6 +30,13 @@
<pkg.package.phase>package</pkg.package.phase>
<pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
<pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
<!-- The `yarn test` execution has to be skipped when tests are skipped and also when the
yarn build as a whole is skipped: with `yarn install` skipped there is no node_modules
to run the tests from. Maven has no boolean OR, so skip.yarn is used as the default
here (honoured both from the command line and from a pom property) and the
skip-yarn-test profile below folds in maven.test.skip, which is only ever passed on
the command line. -->
<yarn.test.skip>${skip.yarn}</yarn.test.skip>
<docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
</properties>
@ -112,7 +119,7 @@
</goals>
<phase>test</phase>
<configuration>
<skip>${maven.test.skip}</skip>
<skip>${yarn.test.skip}</skip>
<arguments>--mutex network run test</arguments>
</configuration>
</execution>
@ -206,6 +213,18 @@
</plugins>
</build>
<profiles>
<profile>
<id>skip-yarn-test</id>
<activation>
<property>
<name>maven.test.skip</name>
<value>true</value>
</property>
</activation>
<properties>
<yarn.test.skip>true</yarn.test.skip>
</properties>
</profile>
<profile>
<id>yarn-start</id>
<activation>

12
msa/js-executor/yarn.lock

@ -1170,9 +1170,9 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
moment@^2.29.1:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
version "2.31.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.31.0.tgz#6e19184e8005a9dfc61c9351263d4d6ea2ace7aa"
integrity sha512-0acOTfMiWOheYS4eoWb80yYMb/JLvVv9SHbs2PehaDzfUG0Bw855SKyk0IKTnPGa5+U2bmi3W68l1+sGLX/pvw==
ms@^2.1.1, ms@^2.1.3:
version "2.1.3"
@ -1332,9 +1332,9 @@ progress@^2.0.3:
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
proxy-addr@^2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
version "2.0.8"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.8.tgz#624e760fd8ab06b1b8320c2f8506d4422cf8e932"
integrity sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"

2
msa/monitoring/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>

38
msa/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>msa</artifactId>
@ -55,10 +55,7 @@
</modules>
<profiles>
<!-- Mirror of the root-pom skip-deb profile. Required because Maven resolves
child <properties> entries (pkg.deb.phase=package above) with higher priority
than profile properties from a parent POM. Redeclaring the profile here ensures
pkg.deb.phase=none wins when -Dpkg.skip.deb=true is passed. -->
<!-- Activated by -Dpkg.skip.deb=true. Skips the .deb enforce/copy executions. -->
<profile>
<id>skip-deb</id>
<activation>
@ -71,9 +68,9 @@
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<!-- Mirror of the root-pom skip-pkg profile. Same precedence reason as skip-deb above:
pkg.deb.phase=package in this POM's <properties> would win over the parent profile,
so we must redeclare it here to ensure pkg.deb.phase=none when -Dpkg.skip=true. -->
<!-- Activated by -Dpkg.skip=true. Needed alongside skip-deb because profile activation
only sees CLI/system properties, so pkg.skip.deb=true set by the root skip-pkg
profile does not activate skip-deb. -->
<profile>
<id>skip-pkg</id>
<activation>
@ -86,6 +83,31 @@
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<!-- Mirror the root skip-pkg-without-* profiles: no .deb is built when the UI build is skipped. -->
<profile>
<id>skip-pkg-without-yarn</id>
<activation>
<property>
<name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile>
<id>black-box-tests</id>
<activation>

2
msa/tb-node/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/tb/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent>
<groupId>org.thingsboard.msa</groupId>
<artifactId>transport</artifactId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/vc-executor-docker/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/vc-executor/pom.xml

@ -10,7 +10,7 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

4
msa/web-ui/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard-web-ui",
"private": true,
"version": "4.2.2.5",
"version": "4.2.2.6",
"description": "ThingsBoard Web UI Microservice",
"main": "server.ts",
"bin": "server.js",
@ -13,7 +13,7 @@
"build": "tsc"
},
"dependencies": {
"compression": "^1.8.1",
"compression": "^1.8.2",
"config": "^3.3.12",
"connect-history-api-fallback": "1.6.0",
"express": "^5.1.0",

5
msa/web-ui/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>
@ -60,6 +60,9 @@
<configuration>
<installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory>
<!-- Declared at plugin level so that it covers every execution of this plugin,
including the ones contributed by the profiles below. -->
<skip>${skip.ui.build}</skip>
</configuration>
<executions>
<execution>

26
msa/web-ui/yarn.lock

@ -511,14 +511,15 @@ compressible@~2.0.18:
dependencies:
mime-db ">= 1.43.0 < 2"
compression@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.8.1.tgz#4a45d909ac16509195a9a28bd91094889c180d79"
integrity sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==
compression@^1.8.2:
version "1.8.2"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.8.2.tgz#781397127ae2da00c0c5f7c76bda5b2a9b32a49f"
integrity sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ==
dependencies:
bytes "3.1.2"
compressible "~2.0.18"
debug "2.6.9"
destroy "1.2.0"
negotiator "~0.6.4"
on-headers "~1.1.0"
safe-buffer "5.2.1"
@ -604,6 +605,11 @@ depd@2.0.0, depd@^2.0.0:
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
destroy@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015"
integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==
detect-libc@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.4.tgz#f04715b8ba815e53b4d8109655b6508a6865a7e8"
@ -1127,9 +1133,9 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
moment@^2.29.1:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
version "2.31.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.31.0.tgz#6e19184e8005a9dfc61c9351263d4d6ea2ace7aa"
integrity sha512-0acOTfMiWOheYS4eoWb80yYMb/JLvVv9SHbs2PehaDzfUG0Bw855SKyk0IKTnPGa5+U2bmi3W68l1+sGLX/pvw==
ms@2.0.0:
version "2.0.0"
@ -1304,9 +1310,9 @@ progress@^2.0.3:
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
proxy-addr@^2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
version "2.0.8"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.8.tgz#624e760fd8ab06b1b8320c2f8506d4422cf8e932"
integrity sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"

4
netty-mqtt/pom.xml

@ -8,11 +8,11 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>netty-mqtt</artifactId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Netty MQTT Client</name>

161
pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard</groupId>
<artifactId>thingsboard</artifactId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Thingsboard</name>
@ -28,20 +28,27 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<main.dir>${basedir}</main.dir>
<!-- Set to true to skip only the UI builds: the Angular application in ui-ngx and the
`yarn run pkg` launcher of msa/web-ui. It deliberately does NOT
cover msa/js-executor, whose yarn install and sandbox tests keep running.
frontend-maven-plugin reads skip.yarn itself, so that property cannot be narrowed to a
subset of the modules; this one can, and it defaults to skip.yarn so that
-Dskip.yarn=true still skips every yarn invocation in the project exactly as before.
Either flag also skips all packaging (see the skip-pkg-without-* profiles). -->
<skip.ui.build>${skip.yarn}</skip.ui.build>
<pkg.process-resources.phase>none</pkg.process-resources.phase>
<pkg.package.phase>none</pkg.package.phase>
<!-- Use -Dpkg.skip=true to skip all packaging at once (bootjar + deb + rpm + zip).
Individual flags below can be set independently for finer control. -->
<!-- Set to true to skip spring-boot:repackage (the boot jar, i.e. the *-boot.jar artifact).
The boot jar is the mandatory input to Gradle buildDeb; skipping it also prevents
the .deb from being produced. Any msa/* module that depends on a .deb artifact
(e.g. msa/tb-node depends on application:deb) will FAIL when the boot jar and
the .deb from being produced. Any msa/* module that copies a .deb
(e.g. msa/tb-node copies application's .deb) will FAIL when the boot jar and
consequently the .deb are missing. Each packaging module overrides this to false. -->
<pkg.skip.bootjar>false</pkg.skip.bootjar>
<!-- Set to true to skip Gradle buildDeb and suppress the Maven attach-artifact goal
that registers the .deb with the reactor. msa/* docker modules copy the .deb
directly from the upstream module's target/ directory (not from .m2), and their
copy execution is bound to ${pkg.deb.phase}, so they are silently skipped too. -->
<!-- Set to true to skip Gradle buildDeb. msa/* docker modules copy the .deb directly
from the upstream module's target/ directory, and their copy execution is bound to
${pkg.deb.phase} (see msa/pom.xml), so they are silently skipped too. -->
<pkg.skip.deb>false</pkg.skip.deb>
<!-- Set to true to skip Gradle buildRpm. No Maven reactor module depends on the RPM
artifact, so this flag can be toggled freely without breaking downstream modules. -->
@ -50,11 +57,6 @@
module depends on the ZIP artifact, so this flag can be toggled freely without
breaking downstream modules. -->
<pkg.skip.zip>false</pkg.skip.zip>
<!-- Internal: resolved phase for the build-helper attach-deb execution. Overridden to
"none" by the skip-deb profile when pkg.skip.deb=true so the goal is silently
skipped instead of failing on a non-existent .deb file. Packaging modules inherit
"package" via pkg.package.phase; msa/* docker modules set it explicitly in msa/pom.xml. -->
<pkg.deb.phase>${pkg.package.phase}</pkg.deb.phase>
<pkg.user>thingsboard</pkg.user>
<pkg.implementationTitle>${project.name}</pkg.implementationTitle>
<pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder>
@ -67,14 +69,16 @@
entries below once TB migrates its tests off the deprecated @SpyBean/@MockBean to @MockitoSpyBean/@MockitoBean. -->
<spring-boot-test.version>3.5.13</spring-boot-test.version>
<commons-lang3.version>3.18.0</commons-lang3.version> <!-- to fix CVE-2025-48924. TODO: remove when fixed in spring-boot-dependencies -->
<netty.version>4.1.137.Final</netty.version> <!-- to fix CVE-2026-44891, CVE-2026-55831, CVE-2026-55833, CVE-2026-55851, CVE-2026-56745, CVE-2026-56817, CVE-2026-56819, CVE-2026-56820, CVE-2026-56821, CVE-2026-56822, CVE-2026-59901, CVE-2026-59902, CVE-2026-59903, CVE-2026-59920, CVE-2026-62243, CVE-2026-73507, CVE-2026-75595 (supersedes earlier netty CVE pins; also retains the 4.1.134 MQTT decoder regression fix). TODO: remove when fixed in spring-boot-dependencies -->
<netty.version>4.1.138.Final</netty.version> <!-- to fix CVE-2026-44891, CVE-2026-55831, CVE-2026-55833, CVE-2026-55851, CVE-2026-56745, CVE-2026-56817, CVE-2026-56819, CVE-2026-56820, CVE-2026-56821, CVE-2026-56822, CVE-2026-59901, CVE-2026-59902, CVE-2026-59903, CVE-2026-59920, CVE-2026-62243, CVE-2026-73507, CVE-2026-75595, CVE-2026-93488, CVE-2026-93491, CVE-2026-93560, CVE-2026-100655, CVE-2026-100656, CVE-2026-100657 (supersedes earlier netty CVE pins; also retains the 4.1.134 MQTT decoder regression fix). TODO: remove when fixed in spring-boot-dependencies -->
<tomcat.version>10.1.59</tomcat.version> <!-- to fix CVE-2026-53434, CVE-2026-55955, CVE-2026-65182, CVE-2026-65905 and CVE-2026-68525 (10.1.58 was never released; 10.1.59 is the release carrying the fixes). Pinned via the tomcat-embed overrides below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<httpcore5.version>5.4.3</httpcore5.version> <!-- to fix CVE-2026-54399 and CVE-2026-54428 (no fix exists on the 5.3.x line; the httpclient5 5.6.4 pin below requires httpcore5 5.4.3). Pinned via the httpcore5 overrides below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<logback.version>1.5.38</logback.version> <!-- to fix CVE-2026-13006 (1.5.36 as reported by the scanner is still vulnerable; 1.5.37 removed Janino conditional processing entirely, 1.5.38 adds a HardenedObjectInputStream fix). Pinned via the logback overrides below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<jackson-bom.version>2.21.5</jackson-bom.version> <!-- to fix CVE-2026-59889. Pinned via the jackson-bom import below: spring-boot-dependencies re-imports jackson-bom with its own placeholder, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<jackson-bom.version>2.21.7</jackson-bom.version> <!-- to fix CVE-2026-59889, CVE-2026-68497, CVE-2026-89425 and CVE-2026-91777. Pinned via the jackson-bom import below: spring-boot-dependencies re-imports jackson-bom with its own placeholder, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<postgresql.version>42.7.12</postgresql.version> <!-- to fix CVE-2026-54291. Pinned via the postgresql override below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<amqp-client.version>5.33.1</amqp-client.version> <!-- to fix CVE-2026-63337, CVE-2026-69219 and CVE-2026-69220. Pinned via the amqp-client override below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<amqp-client.version>5.34.0</amqp-client.version> <!-- to fix CVE-2026-63337, CVE-2026-69219, CVE-2026-69220 and CVE-2026-75516. Pinned via the amqp-client override below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<httpclient5.version>5.6.4</httpclient5.version> <!-- to fix CVE-2026-71290. Pinned via the httpclient5 overrides below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<zstd-jni.version>1.5.7-14</zstd-jni.version> <!-- to fix CVE-2026-87795, CVE-2026-87823, CVE-2026-87824, CVE-2026-87825, CVE-2026-87877, CVE-2026-90560 and CVE-2026-90852. Transitive dependency of kafka-clients 3.9.2; not managed by any BOM, so the override below is the sole source of the version. TODO: remove once kafka-clients pulls zstd-jni >= 1.5.7-14 -->
<freemarker.version>2.3.35</freemarker.version> <!-- to fix CVE-2026-84939. Pinned via the freemarker override below: spring-boot-dependencies is imported as a BOM, so this property alone would not win. TODO: remove when fixed in spring-boot-dependencies -->
<javax.xml.bind-api.version>2.4.0-b180830.0359</javax.xml.bind-api.version>
<jjwt.version>0.12.5</jjwt.version>
<rat.version>0.10</rat.version> <!-- unused -->
@ -95,7 +99,7 @@
<leshan.version>2.0.0-M15</leshan.version>
<mail.version>2.0.1</mail.version>
<curator.version>5.6.0</curator.version>
<zookeeper.version>3.9.5</zookeeper.version> <!-- to fix CVE-2026-24308 and CVE-2026-24281. TODO: remove override when fixed in curator-client -->
<zookeeper.version>3.9.6</zookeeper.version> <!-- to fix CVE-2026-24281, CVE-2026-24308, CVE-2026-59969 and CVE-2026-84439. TODO: remove override when fixed in curator-client -->
<protobuf.version>3.25.5</protobuf.version> <!-- A Major v4 does not support by the pubsub yet-->
<grpc.version>1.76.0</grpc.version>
<tbel.version>1.2.10</tbel.version>
@ -140,7 +144,7 @@
<commons-beanutils.version>1.11.0</commons-beanutils.version>
<commons-collections.version>4.4</commons-collections.version>
<protobuf-dynamic.version>1.0.4TB</protobuf-dynamic.version>
<wire-schema.version>6.3.0</wire-schema.version> <!-- to fix CVE-2026-45799 (transitive wire-runtime). Not managed by the Spring Boot BOM — this pin is the sole source of the wire version, nothing to defer to. TODO: remove only once a TB dependency pulls wire >= 6.3.0 transitively, making the explicit pin redundant. -->
<wire-schema.version>6.4.5</wire-schema.version> <!-- to fix CVE-2026-45799 and CVE-2026-63126 (transitive wire-runtime). Not managed by the Spring Boot BOM — this pin is the sole source of the wire version, nothing to defer to. TODO: remove only once a TB dependency pulls wire >= 6.4.5 transitively, making the explicit pin redundant. -->
<twilio.version>10.1.3</twilio.version>
<hypersistence-utils.version>3.7.4</hypersistence-utils.version> <!-- artifact name should be updated with hibernate-core version -->
<jakarta.el.version>4.0.2</jakarta.el.version>
@ -215,31 +219,46 @@
</properties>
</profile>
<!-- Activated by -Dpkg.skip.deb=true. Sets the attach-artifact lifecycle phase to "none"
so the build-helper goal that registers the .deb with the Maven reactor is silently
skipped. Without this, the goal would fail because the .deb file does not exist. -->
<!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at once. -->
<profile>
<id>skip-deb</id>
<id>skip-pkg</id>
<activation>
<property>
<name>pkg.skip.deb</name>
<name>pkg.skip</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
<pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties>
</profile>
<!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at
once. Also sets pkg.deb.phase=none directly because Maven profile activation is
evaluated against CLI/system properties only — a property set inside another profile
cannot trigger a second profile, so skip-deb would not fire automatically. -->
<!-- Packages built without the UI are incomplete (and the JS Windows ZIPs fail on the missing
launcher), so skipping the UI build skips all packaging too. One profile per flag because
activation only sees CLI/system properties, not the skip.ui.build default. -->
<profile>
<id>skip-pkg</id>
<id>skip-pkg-without-yarn</id>
<activation>
<property>
<name>pkg.skip</name>
<name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value>
</property>
</activation>
@ -248,7 +267,6 @@
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
@ -538,21 +556,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@ -565,6 +568,8 @@
<skip>${pkg.skip.bootjar}</skip>
<mainClass>${pkg.mainClass}</mainClass>
<classifier>boot</classifier>
<!-- Input for Gradle packaging only; don't install/deploy the fat jar -->
<attach>false</attach>
<layout>ZIP</layout>
<executable>true</executable>
<excludeDevtools>true</excludeDevtools>
@ -579,7 +584,6 @@
<execution>
<goals>
<goal>repackage</goal>
<goal>build-info</goal>
</goals>
</execution>
</executions>
@ -641,28 +645,9 @@
</goals>
<configuration>
<skipAssembly>${pkg.skip.zip}</skipAssembly>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-deb</id>
<phase>${pkg.deb.phase}</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${pkg.name}.deb</file>
<type>deb</type>
<classifier>deb</classifier>
</artifact>
</artifacts>
<!-- Picked up from target/; don't install/deploy the Windows zip.
Set on the execution so other assemblies (e.g. rule nodes) stay attached. -->
<attach>false</attach>
</configuration>
</execution>
</executions>
@ -718,6 +703,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${jar-plugin.version}</version>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it -->
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -728,6 +725,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it,
and ProjectInfo needs build-info.properties at runtime -->
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<!-- Overrides the packaging profile's pkg.skip.bootjar skip -->
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.thingsboard</groupId>
@ -1105,6 +1116,20 @@
<version>${httpclient5.version}</version>
</dependency>
<!-- End of httpclient5 version override -->
<!-- Temporary zstd-jni version override -->
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${zstd-jni.version}</version>
</dependency>
<!-- End of zstd-jni version override -->
<!-- Temporary freemarker version override -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<!-- End of freemarker version override -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>

2
rest-client/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>rest-client</artifactId>

2
rule-engine/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>rule-engine</artifactId>

2
rule-engine/rule-engine-api/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>rule-engine</artifactId>
</parent>
<groupId>org.thingsboard.rule-engine</groupId>

2
rule-engine/rule-engine-components/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>rule-engine</artifactId>
</parent>
<groupId>org.thingsboard.rule-engine</groupId>

2
tools/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>tools</artifactId>

2
transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>transport</artifactId>

2
transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>

10
ui-ngx/angular.json

@ -77,6 +77,16 @@
"input": "node_modules/hugerte",
"output": "/assets/hugerte/"
},
{
"glob": "maplibre-gl-worker.mjs",
"input": "node_modules/maplibre-gl/dist/",
"output": "/assets/maplibre-gl/"
},
{
"glob": "maplibre-gl-shared.mjs",
"input": "node_modules/maplibre-gl/dist/",
"output": "/assets/maplibre-gl/"
},
{
"glob": "marker-icon-2x.png",
"input": "node_modules/leaflet/dist/images/",

8
ui-ngx/package.json

@ -1,6 +1,6 @@
{
"name": "thingsboard",
"version": "4.2.2.5",
"version": "4.2.2.6",
"scripts": {
"ng": "ng",
"start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open",
@ -61,13 +61,13 @@
"jszip": "^3.10.1",
"leaflet": "1.9.4",
"leaflet-polylinedecorator": "1.6.0",
"leaflet-providers": "2.0.0",
"leaflet-providers": "4.0.0",
"leaflet.gridlayer.googlemutant": "0.15.0",
"leaflet.markercluster": "1.5.3",
"libphonenumber-js": "^1.12.35",
"maplibre-gl": "5.2.0",
"maplibre-gl": "6.11.2",
"marked": "~16.4.2",
"moment": "^2.30.1",
"moment": "^2.31.0",
"moment-timezone": "^0.6.0",
"ngx-clipboard": "^16.0.0",
"ngx-daterangepicker-material": "^6.0.4",

13
ui-ngx/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version>
<version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
@ -37,6 +37,9 @@
<configuration>
<installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory>
<!-- Declared at plugin level so that it covers every execution of this plugin,
including the ones contributed by the profiles below. -->
<skip>${skip.ui.build}</skip>
</configuration>
<executions>
<execution>
@ -71,6 +74,14 @@
</filesets>
</configuration>
</plugin>
<plugin>
<!-- Only consumed in-reactor by application and msa/web-ui -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>

9
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts

@ -95,6 +95,12 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
wizardSteps: WizardStep[] = [];
wizardStarted = false;
reviewMode = false;
/**
* Set once the server has an installed item for this device. From that moment every way out of
* the wizard — including the header X and the Cancel button on a still-pending later step —
* has to report 'installed', or the caller keeps showing pre-install counts and badges.
*/
private installRegistered = false;
// Variable resolution state
formValues: Record<string, any> = {};
@ -357,7 +363,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
}
cancel(): void {
this.dialogRef.close(false);
this.dialogRef.close(this.installRegistered ? 'installed' : false);
}
retryEntitySteps(step: WizardStep): void {
@ -809,6 +815,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
{ ignoreLoading: true }
)
);
this.installRegistered = true;
} catch (_e) {
// Non-critical — entities are created, tracking registration failed
console.error('Failed to register device install', _e);

12
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts

@ -51,6 +51,11 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
@Input() mode: 'default' | 'add' = 'default';
@Input() fixedSubType: string;
@Output() addItem = new EventEmitter<MpItemVersionView>();
/**
* Fired whenever an install, update or delete changed what this tenant has installed, so a host
* page showing its own installed-items counter can refresh it instead of waiting for a reload.
*/
@Output() installedItemsChanged = new EventEmitter<void>();
@Input() set activeType(value: ItemType) {
if (value && value !== this._activeType) {
const wasInit = !!this._activeType;
@ -627,7 +632,11 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
});
}
private reloadInstalledItems(): void {
/**
* Re-reads what is installed for the active type and announces the change. Public so a host page
* that opens the item detail dialog itself can refresh this grid through the same path.
*/
reloadInstalledItems(): void {
const config = {ignoreLoading: true};
const pageLink = new PageLink(10000, 0);
if (this.activeType === ItemType.WIDGET) {
@ -643,6 +652,7 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
this.installedItemCounts = counts;
});
}
this.installedItemsChanged.emit();
}
private loadFilterInfo(): void {

14
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-install-dialog.component.html

@ -130,12 +130,14 @@
@case ('error') {
<h2 class="tb-iot-hub-install-title">{{ 'iot-hub.install-error-title' | translate }}</h2>
<p class="tb-iot-hub-install-desc">{{ 'iot-hub.install-error-message' | translate:{ name: item.name } }}</p>
@if (item.type === ItemType.SOLUTION_TEMPLATE) {
<tb-iot-hub-markdown class="tb-iot-hub-error-details-markdown" [data]="errorMessage"></tb-iot-hub-markdown>
} @else {
<div class="tb-iot-hub-error-details">
{{ errorMessage }}
</div>
@if (errorMessage) {
@if (item.type === ItemType.SOLUTION_TEMPLATE) {
<tb-iot-hub-markdown class="tb-iot-hub-error-details-markdown" [data]="errorMessage"></tb-iot-hub-markdown>
} @else {
<div class="tb-iot-hub-error-details">
{{ errorMessage }}
</div>
}
}
}
}

21
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-install-dialog.component.ts

@ -294,7 +294,7 @@ export class TbIotHubInstallDialogComponent extends DialogComponent<TbIotHubInst
next: (result) => {
if (!result.success) {
this.state = 'error';
this.errorMessage = result.errorMessage || this.translate.instant('iot-hub.install-error', { name: this.item.name });
this.errorMessage = result.errorMessage || '';
return;
}
this.handleInstalledDescriptor(result.descriptor);
@ -317,20 +317,31 @@ export class TbIotHubInstallDialogComponent extends DialogComponent<TbIotHubInst
private handleApiError(err: any): void {
this.state = 'error';
this.errorMessage = err?.error?.message || err?.message ||
this.translate.instant('iot-hub.install-error', { name: this.item.name });
this.errorMessage = err?.error?.message || err?.message || '';
}
private handlePlanResult(result: InstallPlanResult): void {
if (!result.success) {
this.state = 'error';
let message = result.errorMessage || this.translate.instant('iot-hub.install-error', { name: this.item.name });
const serverError = result.errorMessage;
// The description above the details already names the item being installed, so nothing is rendered here when
// the server reported no message of its own, and only a failing dependency has to be named - and only when the
// server reported the failure. A missing entry carries an error message of its own, so the failing one is the
// entry the cascade actually tried to install.
let message = serverError || '';
const failedDependency = serverError ? (result.entries ?? []).find(
entry => !entry.root && entry.errorMessage && entry.status === InstallPlanEntryStatus.WILL_INSTALL) : undefined;
if (failedDependency) {
message = this.translate.instant('iot-hub.install-dependency-error',
{ name: failedDependency.name, error: message });
}
// A failed cascade rolls back the items installed so far. When something was actually being
// installed and the rollback came back partial (rolledBack === false), some entities are left
// behind — tell the admin so they know manual cleanup may be needed. The willInstall guard
// avoids the misleading warning on the "empty plan" failure, where nothing was installed.
if (!result.rolledBack && this.planSummary.willInstall > 0) {
message += ' ' + this.translate.instant('iot-hub.install-rollback-partial');
message = [message, this.translate.instant('iot-hub.install-rollback-partial')]
.filter(Boolean).join('\n\n');
}
this.errorMessage = message;
return;

40
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.scss

@ -3,6 +3,10 @@
$text-color: rgba(0,0,0,0.76);
$link-color: #2a7dec;
$copy-button-color: #2a7dec;
// Geometry of the copy icon chip, shared by the chip itself and by the space table
// cells reserve for it, so the two cannot drift apart.
$copy-icon-width: 38px;
$copy-icon-offset: 3px;
$code-block-border-color: rgba(42, 125, 236, .2);
$code-default-color: #212529;
@ -169,10 +173,10 @@ $gallery-border-hover-color: #2a7dec;
div {
background-color: #fff;
position: absolute;
width: 38px;
width: $copy-icon-width;
height: 28px;
top: 3px;
right: 3px;
top: $copy-icon-offset;
right: $copy-icon-offset;
padding: 8px 10px 0;
img {
@ -204,9 +208,30 @@ $gallery-border-hover-color: #2a7dec;
}
th, td {
// Long unbreakable tokens (logins, e-mails, passwords) must never overflow their
// own column. `anywhere` also drops the cell min-content width down to a single
// character, so auto layout can always squeeze the table into the available
// width instead of overflowing (and getting clipped by `overflow: hidden`).
overflow-wrap: break-word; // fallback for engines without `anywhere`
overflow-wrap: anywhere;
// Text is not the only thing that can outgrow a column: a preformatted block keeps
// its whole line as min-content width, which auto layout cannot shrink, so the table
// would push past its container and get cut off by a host that hides horizontal
// overflow (iot-hub-item-detail-dialog's .dlg-body). Wrap it inside the cell instead.
// Prism sets `white-space: pre` on both the block and the code inside it, so both
// have to be relaxed for the cell to shrink.
pre, pre > code {
white-space: pre-wrap;
}
div.code-wrapper {
display: inline-block;
width: 100%;
// Reserve room for the absolutely positioned copy icon, plus the same gap on its
// far side, so the cell text does not run underneath it and the reservation
// follows the chip if its geometry ever changes.
padding-right: $copy-icon-width + 2 * $copy-icon-offset;
button.clipboard-btn {
top: -6px;
@ -275,11 +300,10 @@ $gallery-border-hover-color: #2a7dec;
margin-top: 20px;
margin-bottom: 20px;
overflow: hidden;
table-layout: fixed;
&.auto {
table-layout: auto;
}
// Columns are sized to their content: with fixed layout every column got the
// same width, so cells with long values (e-mails, logins, tokens) had to wrap
// mid-word while short columns kept a lot of unused space.
table-layout: auto;
> thead {
background-color: $table-header-background-color;

6
ui-ngx/src/app/modules/home/components/widget/lib/maps-legacy/map-models.ts

@ -121,9 +121,6 @@ export const hereMapProviderTranslationMap = new Map<HereMapProvider, string>(
export interface HereMapProviderSettings {
mapProviderHere: HereMapProvider;
credentials: {
useV3: boolean;
app_id: string;
app_code: string;
apiKey: string;
};
}
@ -131,9 +128,6 @@ export interface HereMapProviderSettings {
export const defaultHereMapProviderSettings: HereMapProviderSettings = {
mapProviderHere: HereMapProvider.hereNormalDay,
credentials: {
useV3: true,
app_id: 'AhM6TzD9ThyK78CT3ptx',
app_code: 'p6NPiITB3Vv0GMUFnkLOOg',
apiKey: 'kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE'
}
};

11
ui-ngx/src/app/modules/home/components/widget/lib/maps-legacy/providers/here-map.ts

@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import L from 'leaflet';
import LeafletMap from '../leaflet-map';
import { DEFAULT_ZOOM_LEVEL, WidgetUnitedMapSettings } from '../map-models';
import { DEFAULT_ZOOM_LEVEL, defaultHereMapProviderSettings, WidgetUnitedMapSettings } from '../map-models';
import { WidgetContext } from '@home/models/widget-component.models';
import { isDefinedAndNotNull } from '@core/utils';
import { hereV3Provider } from '@shared/models/widget/maps/map.models';
export class HEREMap extends LeafletMap {
constructor(ctx: WidgetContext, $container: HTMLElement, options: WidgetUnitedMapSettings) {
@ -13,11 +13,8 @@ export class HEREMap extends LeafletMap {
doubleClickZoom: !this.options.disableDoubleClickZooming,
zoomControl: !this.options.disableZoomControl
}).setView(options?.parsedDefaultCenterPosition, options?.defaultZoomLevel || DEFAULT_ZOOM_LEVEL);
let provider = options.mapProviderHere || 'HERE.normalDay';
if (options.credentials.useV3 && isDefinedAndNotNull(options.credentials.apiKey)) {
provider = options.mapProviderHere?.replace('HERE', 'HEREv3') || 'HEREv3.normalDay';
}
const tileLayer = (L.tileLayer as any).provider(provider, options.credentials);
const apiKey = options.credentials?.apiKey || defaultHereMapProviderSettings.credentials.apiKey;
const tileLayer = L.tileLayer.provider(hereV3Provider(options.mapProviderHere), {apiKey});
tileLayer.addTo(map);
super.setMap(map);
}

19
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet/leaflet-tb.ts

@ -3,7 +3,7 @@
import L, { TB } from 'leaflet';
import { guid, isDefinedAndNotNull, isNotEmptyStr } from '@core/utils';
import 'leaflet-providers';
import { Map as MapLibreGLMap, LngLat as MapLibreGLLngLat } from 'maplibre-gl';
import { Map as MapLibreGLMap, setWorkerUrl } from 'maplibre-gl';
import '@geoman-io/leaflet-geoman-free';
import 'leaflet.markercluster';
import { MatIconRegistry } from '@angular/material/icon';
@ -1070,6 +1070,9 @@ const chinaProvider = (type: string, options?: L.TileLayerOptions): L.TB.TileLay
return new ChinaProvider(type, options);
}
// The worker is copied to assets by angular.json, bundlers cannot resolve it from import.meta.url
setWorkerUrl(new URL('assets/maplibre-gl/maplibre-gl-worker.mjs', document.baseURI).href);
class MapLibreGLLayer extends L.Layer implements TB.MapLibreGL.MapLibreGLLayer {
options: TB.MapLibreGL.LeafletMapLibreGLMapOptions;
@ -1246,23 +1249,19 @@ class MapLibreGLLayer extends L.Layer implements TB.MapLibreGL.MapLibreGLLayer {
this._transformGL(gl);
if (gl.transform.width !== size.x || gl.transform.height !== size.y) {
if (container.clientWidth !== size.x || container.clientHeight !== size.y) {
container.style.width = size.x + 'px';
container.style.height = size.y + 'px';
gl.resize();
} else {
gl._update();
}
}
private _transformGL(gl: MapLibreGLMap) {
const center = this._map.getCenter();
const tr = gl._getTransformForUpdate();
if (!tr) { return; }
tr.setCenter(MapLibreGLLngLat.convert([center.lng, center.lat]));
tr.setZoom(this._map.getZoom() - 1);
gl.transform.apply(tr);
gl._fireMoveEvents();
gl.jumpTo({
center: [center.lng, center.lat],
zoom: this._map.getZoom() - 1
});
}
private _pinchZoom() {

31
ui-ngx/src/app/modules/home/components/widget/lib/maps/map-layer.ts

@ -1,7 +1,9 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
import {
CartoMapLayerSettings,
CustomMapLayerSettings,
defaultCartoMapLayerSettings,
defaultCustomMapLayerSettings,
defaultGoogleMapLayerSettings,
defaultHereMapLayerSettings,
@ -10,8 +12,10 @@ import {
defaultTencentMapLayerSettings,
GoogleMapLayerSettings,
HereMapLayerSettings,
hereV3Provider,
MapLayerSettings,
MapProvider,
normalizeMapLayerSettings,
OpenStreetMapLayerSettings,
ReferenceLayerType,
TencentMapLayerSettings, WEBGL_ERROR_EVENT
@ -46,9 +50,12 @@ export abstract class TbMapLayer<S extends MapLayerSettings> {
static fromSettings(ctx: WidgetContext,
inputSettings: DeepPartial<MapLayerSettings>) {
inputSettings = normalizeMapLayerSettings(inputSettings as MapLayerSettings);
switch (inputSettings.provider) {
case MapProvider.openstreet:
return new TbOpenStreetMapLayer(ctx, inputSettings);
case MapProvider.carto:
return new TbCartoMapLayer(ctx, inputSettings);
case MapProvider.google:
return new TbGoogleMapLayer(ctx, inputSettings);
case MapProvider.tencent:
@ -212,6 +219,24 @@ class TbOpenStreetMapLayer extends TbMapLayer<OpenStreetMapLayerSettings> {
}
class TbCartoMapLayer extends TbMapLayer<CartoMapLayerSettings> {
constructor(protected ctx: WidgetContext,
protected inputSettings: DeepPartial<MapLayerSettings>) {
super(ctx, inputSettings);
}
protected defaultSettings(): CartoMapLayerSettings {
return defaultCartoMapLayerSettings;
}
protected createLayer(): Observable<L.Layer> {
const layer = L.tileLayer.provider(this.settings.layerType, {apikey: this.settings.apiKey || ''});
return of(layer);
}
}
class TbGoogleMapLayer extends TbMapLayer<GoogleMapLayerSettings> {
static loadedApiKeysGlobal: {[key: string]: boolean} = {};
@ -293,7 +318,7 @@ class TbHereMapLayer extends TbMapLayer<HereMapLayerSettings> {
protected createLayer(): Observable<L.Layer> {
const apiKey = this.settings.apiKey || defaultHereMapLayerSettings.apiKey;
const layer = L.tileLayer.provider(this.settings.layerType, {useV3: true, apiKey} as any);
const layer = L.tileLayer.provider(hereV3Provider(this.settings.layerType), {apiKey});
return of(layer);
}
@ -311,7 +336,9 @@ class TbCustomMapLayer extends TbMapLayer<CustomMapLayerSettings> {
}
protected createLayer(): Observable<L.Layer> {
const layer = L.tileLayer(this.settings.tileUrl);
const layer = L.tileLayer(this.settings.tileUrl, this.settings.customAttribution ? {
attribution: this.settings.customAttribution
} : undefined);
return of(layer);
}

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-row.component.html

@ -23,6 +23,14 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="MapProvider.carto === layerFormGroup.get('provider').value"
class="tb-inline-field tb-layer-field" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="layerType" required>
<mat-option *ngFor="let layerType of cartoLayerTypes" [value]="layerType">
{{ cartoLayerTranslationMap.get(layerType) | translate }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="MapProvider.google === layerFormGroup.get('provider').value"
class="tb-inline-field tb-layer-field" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="layerType" required>

14
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-row.component.ts

@ -25,6 +25,8 @@ import { TbPopoverService } from '@shared/components/popover.service';
import { TranslateService } from '@ngx-translate/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
cartoLayerTranslationMap,
cartoLayerTypes,
defaultLayerTitle,
defaultMapLayerSettings,
googleMapLayerTranslationMap,
@ -35,6 +37,8 @@ import {
MapProvider,
mapProviders,
mapProviderTranslationMap,
mapProviderHasApiKey,
mapProviderRequiresApiKey,
openStreetLayerTypes,
openStreetMapLayerTranslationMap,
tencentLayerTranslationMap,
@ -71,6 +75,10 @@ export class MapLayerRowComponent implements ControlValueAccessor, OnInit {
openStreetMapLayerTranslationMap = openStreetMapLayerTranslationMap;
cartoLayerTypes = cartoLayerTypes;
cartoLayerTranslationMap = cartoLayerTranslationMap;
googleMapLayerTypes = googleMapLayerTypes;
googleMapLayerTranslationMap = googleMapLayerTranslationMap;
@ -110,6 +118,7 @@ export class MapLayerRowComponent implements ControlValueAccessor, OnInit {
provider: [null, [Validators.required]],
layerType: [null, [Validators.required]],
tileUrl: [null, [Validators.required]],
customAttribution: [null, []],
apiKey: [null, [Validators.required]],
referenceLayer: [null, []]
});
@ -202,12 +211,15 @@ export class MapLayerRowComponent implements ControlValueAccessor, OnInit {
const provider: MapProvider = this.layerFormGroup.get('provider').value;
if (provider === MapProvider.custom) {
this.layerFormGroup.get('tileUrl').enable({emitEvent: false});
this.layerFormGroup.get('customAttribution').enable({emitEvent: false});
this.layerFormGroup.get('layerType').disable({emitEvent: false});
} else {
this.layerFormGroup.get('tileUrl').disable({emitEvent: false});
this.layerFormGroup.get('customAttribution').disable({emitEvent: false});
this.layerFormGroup.get('layerType').enable({emitEvent: false});
}
if ([MapProvider.google, MapProvider.here].includes(provider)) {
if (mapProviderHasApiKey(provider)) {
this.layerFormGroup.get('apiKey').setValidators(mapProviderRequiresApiKey(provider) ? [Validators.required] : []);
this.layerFormGroup.get('apiKey').enable({emitEvent: false});
} else {
this.layerFormGroup.get('apiKey').disable({emitEvent: false});

18
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-settings-panel.component.html

@ -33,6 +33,14 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="MapProvider.carto === layerFormGroup.get('provider').value"
class="flex" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="layerType" required>
<mat-option *ngFor="let layerType of cartoLayerTypes" [value]="layerType">
{{ cartoLayerTranslationMap.get(layerType) | translate }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="MapProvider.google === layerFormGroup.get('provider').value"
class="flex" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="layerType" required>
@ -62,12 +70,18 @@
<input matInput formControlName="tileUrl" required placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field>
</div>
<div *ngIf="[MapProvider.google, MapProvider.here].includes(layerFormGroup.get('provider').value)" class="tb-form-panel stroked">
<div *ngIf="MapProvider.custom === layerFormGroup.get('provider').value" class="tb-form-row space-between column-xs">
<div class="fixed-title-width" tb-hint-tooltip-icon="{{ 'widgets.maps.layer.provider.custom.attribution-hint' | translate }}" translate>widgets.maps.layer.provider.custom.attribution</div>
<mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
<input matInput formControlName="customAttribution" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field>
</div>
<div *ngIf="hasApiKey()" class="tb-form-panel stroked">
<div class="tb-form-panel-title" translate>widgets.maps.layer.credentials.credentials</div>
<div class="tb-form-row space-between column-xs">
<div class="fixed-title-width" translate>widgets.maps.layer.credentials.api-key</div>
<mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
<input matInput formControlName="apiKey" required placeholder="{{ 'widget-config.set' | translate }}">
<input matInput formControlName="apiKey" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field>
</div>
</div>

18
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layer-settings-panel.component.ts

@ -5,6 +5,8 @@ import { TbPopoverComponent } from '@shared/components/popover.component';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
cartoLayerTranslationMap,
cartoLayerTypes,
defaultLayerTitle,
defaultMapLayerSettings,
googleMapLayerTranslationMap,
@ -15,6 +17,8 @@ import {
MapProvider,
mapProviders,
mapProviderTranslationMap,
mapProviderHasApiKey,
mapProviderRequiresApiKey,
openStreetLayerTypes,
openStreetMapLayerTranslationMap, referenceLayerTypes, referenceLayerTypeTranslationMap,
tencentLayerTranslationMap,
@ -42,6 +46,10 @@ export class MapLayerSettingsPanelComponent implements OnInit {
openStreetMapLayerTranslationMap = openStreetMapLayerTranslationMap;
cartoLayerTypes = cartoLayerTypes;
cartoLayerTranslationMap = cartoLayerTranslationMap;
googleMapLayerTypes = googleMapLayerTypes;
googleMapLayerTranslationMap = googleMapLayerTranslationMap;
@ -81,6 +89,7 @@ export class MapLayerSettingsPanelComponent implements OnInit {
provider: [null, [Validators.required]],
layerType: [null, [Validators.required]],
tileUrl: [null, [Validators.required]],
customAttribution: [null, []],
apiKey: [null, [Validators.required]],
referenceLayer: [null, []]
}
@ -108,6 +117,10 @@ export class MapLayerSettingsPanelComponent implements OnInit {
return this.translate.instant(translationKey);
}
hasApiKey(): boolean {
return mapProviderHasApiKey(this.layerFormGroup.get('provider').value);
}
applyLayerSettings() {
const layerSettings: MapLayerSettings = this.layerFormGroup.value;
this.mapLayerSettingsApplied.emit(layerSettings);
@ -126,12 +139,15 @@ export class MapLayerSettingsPanelComponent implements OnInit {
const provider: MapProvider = this.layerFormGroup.get('provider').value;
if (provider === MapProvider.custom) {
this.layerFormGroup.get('tileUrl').enable({emitEvent: false});
this.layerFormGroup.get('customAttribution').enable({emitEvent: false});
this.layerFormGroup.get('layerType').disable({emitEvent: false});
} else {
this.layerFormGroup.get('tileUrl').disable({emitEvent: false});
this.layerFormGroup.get('customAttribution').disable({emitEvent: false});
this.layerFormGroup.get('layerType').enable({emitEvent: false});
}
if ([MapProvider.google, MapProvider.here].includes(provider)) {
if (mapProviderHasApiKey(provider)) {
this.layerFormGroup.get('apiKey').setValidators(mapProviderRequiresApiKey(provider) ? [Validators.required] : []);
this.layerFormGroup.get('apiKey').enable({emitEvent: false});
} else {
this.layerFormGroup.get('apiKey').disable({emitEvent: false});

5
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-layers.component.ts

@ -20,7 +20,8 @@ import {
MapLayerSettings,
mapLayerValid,
mapLayerValidator,
MapProvider
MapProvider,
normalizeMapLayerSettings
} from '@shared/models/widget/maps/map.models';
@Component({
@ -93,7 +94,7 @@ export class MapLayersComponent implements ControlValueAccessor, OnInit, Validat
}
writeValue(value: MapLayerSettings[] | undefined): void {
const layers: MapLayerSettings[] = value || [];
const layers: MapLayerSettings[] = (value || []).map(layer => normalizeMapLayerSettings(layer));
this.layersFormGroup.setControl('layers', this.prepareLayersFormArray(layers), {emitEvent: false});
}

23
ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/here-map-provider-settings.component.html

@ -16,25 +16,10 @@
<section class="tb-widget-settings" formGroupName="credentials">
<fieldset class="fields-group">
<legend class="group-title" translate>widgets.maps.credentials</legend>
<mat-slide-toggle formControlName="useV3" style="margin-bottom: 16px;">
{{ 'widgets.maps.here-use-new-version-api-3' | translate }}
</mat-slide-toggle>
<div *ngIf="!providerSettingsFormGroup.get('credentials.useV3').value; else apiKey" class="flex flex-row xs:flex-col gt-xs:gap-2">
<mat-form-field class="flex-1">
<mat-label translate>widgets.maps.here-app-id</mat-label>
<input required matInput formControlName="app_id">
</mat-form-field>
<mat-form-field class="flex-1">
<mat-label translate>widgets.maps.here-app-code</mat-label>
<input required matInput formControlName="app_code">
</mat-form-field>
</div>
<ng-template #apiKey>
<mat-form-field>
<mat-label translate>widgets.maps.here-api-key</mat-label>
<input required matInput formControlName="apiKey">
</mat-form-field>
</ng-template>
<mat-form-field>
<mat-label translate>widgets.maps.here-api-key</mat-label>
<input required matInput formControlName="apiKey">
</mat-form-field>
</fieldset>
</section>
</section>

34
ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/here-map-provider-settings.component.ts

@ -16,11 +16,11 @@ import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { TranslateService } from '@ngx-translate/core';
import {
defaultHereMapProviderSettings,
HereMapProvider,
HereMapProviderSettings,
hereMapProviderTranslationMap
} from '@home/components/widget/lib/maps-legacy/map-models';
import { isDefinedAndNotNull } from '@core/utils';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@Component({
@ -67,25 +67,9 @@ export class HereMapProviderSettingsComponent extends PageComponent implements O
this.providerSettingsFormGroup = this.fb.group({
mapProviderHere: [null, [Validators.required]],
credentials: this.fb.group({
useV3: [true],
app_id: [null, [Validators.required]],
app_code: [null, [Validators.required]],
apiKey: [null, [Validators.required]]
})
});
this.providerSettingsFormGroup.get('credentials.useV3').valueChanges.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(value => {
if (value) {
this.providerSettingsFormGroup.get('credentials.apiKey').enable({emitEvent: false});
this.providerSettingsFormGroup.get('credentials.app_id').disable({emitEvent: false});
this.providerSettingsFormGroup.get('credentials.app_code').disable({emitEvent: false});
} else {
this.providerSettingsFormGroup.get('credentials.apiKey').disable({emitEvent: false});
this.providerSettingsFormGroup.get('credentials.app_id').enable({emitEvent: false});
this.providerSettingsFormGroup.get('credentials.app_code').enable({emitEvent: false});
}
});
this.providerSettingsFormGroup.valueChanges.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
@ -106,21 +90,17 @@ export class HereMapProviderSettingsComponent extends PageComponent implements O
this.providerSettingsFormGroup.disable({emitEvent: false});
} else {
this.providerSettingsFormGroup.enable({emitEvent: false});
this.providerSettingsFormGroup.get('credentials.useV3').updateValueAndValidity({onlySelf: true});
}
}
writeValue(value: HereMapProviderSettings): void {
if (!isDefinedAndNotNull(value.credentials.useV3)) {
if (isDefinedAndNotNull(value.credentials.app_id) && isDefinedAndNotNull(value.credentials.app_code)) {
value.credentials.useV3 = false;
}
}
this.modelValue = value;
this.providerSettingsFormGroup.patchValue(
value, {emitEvent: false}
);
this.providerSettingsFormGroup.get('credentials.useV3').updateValueAndValidity({onlySelf: true});
this.providerSettingsFormGroup.patchValue({
mapProviderHere: value?.mapProviderHere,
credentials: {
apiKey: value?.credentials?.apiKey || defaultHereMapProviderSettings.credentials.apiKey
}
}, {emitEvent: false});
}
public validate(c: FormControl) {

3
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.html

@ -35,7 +35,8 @@
<!-- Browse component (without tabs) -->
<tb-iot-hub-browse
[activeType]="config.type"
[hideTabs]="true">
[hideTabs]="true"
(installedItemsChanged)="loadInstalledCount()">
</tb-iot-hub-browse>
<!-- Become a Creator footer -->

15
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts

@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { map } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models';
import { IotHubApiService } from '@core/http/iot-hub-api.service';
import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service';
import { TbIotHubBrowseComponent } from '@home/components/iot-hub/iot-hub-browse.component';
import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models';
import { MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models';
import { PageLink } from '@shared/models/page/page-link';
@ -83,6 +84,8 @@ export class TbIotHubItemsPageComponent implements OnInit {
config: ItemTypePageConfig;
installedItemsCount = 0;
@ViewChild(TbIotHubBrowseComponent) private browse: TbIotHubBrowseComponent;
constructor(
private route: ActivatedRoute,
private router: Router,
@ -109,7 +112,7 @@ export class TbIotHubItemsPageComponent implements OnInit {
window.open(this.iotHubApiService.baseUrl + '/signup', '_blank');
}
private loadInstalledCount(): void {
loadInstalledCount(): void {
this.iotHubApiService.getInstalledItemsCount(this.config.type, { ignoreLoading: true }).subscribe(count => {
this.installedItemsCount = count;
});
@ -147,7 +150,13 @@ export class TbIotHubItemsPageComponent implements OnInit {
'default',
true,
openItem.preview
).subscribe();
).subscribe(result => {
// The deep-linked dialog is opened by this page rather than by the grid, so its outcome
// has to be fed back in by hand — the grid then refreshes and announces the new count.
if (result === 'installed' || result === 'updated' || result === 'deleted') {
this.browse?.reloadInstalledItems();
}
});
});
}

72
ui-ngx/src/app/shared/models/widget/maps/map.models.ts

@ -832,6 +832,7 @@ export const defaultMapActionButtonSettings: MapActionButtonSettings = {
export enum MapProvider {
openstreet = 'openstreet',
carto = 'carto',
google = 'google',
here = 'here',
tencent = 'tencent',
@ -843,6 +844,7 @@ export const mapProviders = Object.keys(MapProvider) as MapProvider[];
export const mapProviderTranslationMap = new Map<MapProvider, string>(
[
[MapProvider.openstreet, 'widgets.maps.layer.provider.openstreet.title'],
[MapProvider.carto, 'widgets.maps.layer.provider.carto.title'],
[MapProvider.google, 'widgets.maps.layer.provider.google.title'],
[MapProvider.here, 'widgets.maps.layer.provider.here.title'],
[MapProvider.tencent, 'widgets.maps.layer.provider.tencent.title'],
@ -880,6 +882,9 @@ export const mapLayerValid = (layer: MapLayerSettings): boolean => {
case MapProvider.openstreet:
const openStreetLayer = layer as OpenStreetMapLayerSettings;
return !!openStreetLayer.layerType;
case MapProvider.carto:
const cartoLayer = layer as CartoMapLayerSettings;
return !!cartoLayer.layerType;
case MapProvider.google:
const googleLayer = layer as GoogleMapLayerSettings;
return !!googleLayer.layerType;
@ -913,6 +918,9 @@ export const defaultLayerTitle = (layer: MapLayerSettings): string => {
case MapProvider.openstreet:
const openStreetLayer = layer as OpenStreetMapLayerSettings;
return openStreetMapLayerTranslationMap.get(openStreetLayer.layerType);
case MapProvider.carto:
const cartoLayer = layer as CartoMapLayerSettings;
return cartoLayerTranslationMap.get(cartoLayer.layerType);
case MapProvider.google:
const googleLayer = layer as GoogleMapLayerSettings;
return googleMapLayerTranslationMap.get(googleLayer.layerType);
@ -932,9 +940,7 @@ export enum OpenStreetLayerType {
openStreetHot = 'OpenStreetMap.HOT',
esriWorldStreetMap = 'Esri.WorldStreetMap',
esriWorldTopoMap = 'Esri.WorldTopoMap',
esriWorldImagery = 'Esri.WorldImagery',
cartoDbPositron = 'CartoDB.Positron',
cartoDbDarkMatter = 'CartoDB.DarkMatter'
esriWorldImagery = 'Esri.WorldImagery'
}
export const openStreetLayerTypes = Object.values(OpenStreetLayerType) as OpenStreetLayerType[];
@ -945,9 +951,7 @@ export const openStreetMapLayerTranslationMap = new Map<OpenStreetLayerType, str
[OpenStreetLayerType.openStreetHot, 'widgets.maps.layer.provider.openstreet.hot'],
[OpenStreetLayerType.esriWorldStreetMap, 'widgets.maps.layer.provider.openstreet.esri-street'],
[OpenStreetLayerType.esriWorldTopoMap, 'widgets.maps.layer.provider.openstreet.esri-topo'],
[OpenStreetLayerType.esriWorldImagery, 'widgets.maps.layer.provider.openstreet.esri-imagery'],
[OpenStreetLayerType.cartoDbPositron, 'widgets.maps.layer.provider.openstreet.cartodb-positron'],
[OpenStreetLayerType.cartoDbDarkMatter, 'widgets.maps.layer.provider.openstreet.cartodb-dark-matter']
[OpenStreetLayerType.esriWorldImagery, 'widgets.maps.layer.provider.openstreet.esri-imagery']
]
);
@ -961,6 +965,32 @@ export const defaultOpenStreetMapLayerSettings: OpenStreetMapLayerSettings = {
layerType: OpenStreetLayerType.openStreetMapnik
}
export enum CartoLayerType {
cartoPositron = 'CartoDB.Positron',
cartoDarkMatter = 'CartoDB.DarkMatter'
}
export const cartoLayerTypes = Object.values(CartoLayerType) as CartoLayerType[];
export const cartoLayerTranslationMap = new Map<CartoLayerType, string>(
[
[CartoLayerType.cartoPositron, 'widgets.maps.layer.provider.carto.positron'],
[CartoLayerType.cartoDarkMatter, 'widgets.maps.layer.provider.carto.dark-matter']
]
);
export interface CartoMapLayerSettings extends MapLayerSettings {
provider: MapProvider.carto;
layerType: CartoLayerType;
apiKey?: string;
}
export const defaultCartoMapLayerSettings: CartoMapLayerSettings = {
provider: MapProvider.carto,
layerType: CartoLayerType.cartoPositron,
apiKey: null
}
export enum GoogleLayerType {
roadmap = 'roadmap',
satellite = 'satellite',
@ -1021,6 +1051,16 @@ export const defaultHereMapLayerSettings: HereMapLayerSettings = {
apiKey: 'kVXykxAfZ6LS4EbCTO02soFVfjA7HoBzNVVH9u7nzoE'
}
const hereV3Variants: {[v2Variant: string]: string} = {
normalDay: 'exploreDay',
normalNight: 'exploreNight',
hybridDay: 'exploreSatelliteDay',
terrainDay: 'topoDay'
};
export const hereV3Provider = (layerType: string): string =>
`HERE.${hereV3Variants[layerType?.split('.')[1]] || hereV3Variants.normalDay}`;
export enum TencentLayerType {
tencentNormal = 'Tencent.Normal',
tencentSatellite = 'Tencent.Satellite',
@ -1050,6 +1090,7 @@ export const defaultTencentMapLayerSettings: TencentMapLayerSettings = {
export interface CustomMapLayerSettings extends MapLayerSettings {
provider: MapProvider.custom;
tileUrl: string;
customAttribution?: string;
}
export const defaultCustomMapLayerSettings: CustomMapLayerSettings = {
@ -1057,10 +1098,29 @@ export const defaultCustomMapLayerSettings: CustomMapLayerSettings = {
tileUrl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
}
export const mapProviderHasApiKey = (provider: MapProvider): boolean =>
[MapProvider.carto, MapProvider.google, MapProvider.here].includes(provider);
export const mapProviderRequiresApiKey = (provider: MapProvider): boolean =>
[MapProvider.google, MapProvider.here].includes(provider);
const legacyOpenStreetCartoLayerTypes = new Set<string>(cartoLayerTypes);
// CARTO layers used to be stored under the OpenStreetMap provider, keep reading them as CARTO layers
export const normalizeMapLayerSettings = (layer: MapLayerSettings): MapLayerSettings => {
if (layer?.provider === MapProvider.openstreet &&
legacyOpenStreetCartoLayerTypes.has((layer as OpenStreetMapLayerSettings).layerType)) {
return {...layer, provider: MapProvider.carto};
}
return layer;
};
export const defaultMapLayerSettings = (provider: MapProvider): MapLayerSettings => {
switch (provider) {
case MapProvider.openstreet:
return defaultOpenStreetMapLayerSettings;
case MapProvider.carto:
return defaultCartoMapLayerSettings;
case MapProvider.google:
return defaultGoogleMapLayerSettings;
case MapProvider.here:

17
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3850,6 +3850,7 @@
"goto-main-dashboard": "Go to main dashboard",
"install-error-title": "Installation Failed",
"install-error-message": "Failed to install '{{name}}'.",
"install-dependency-error": "Failed to install the dependency '{{name}}': {{error}}",
"install-plan-title": "Install '{{name}}' and its dependencies",
"install-plan-will-install": "{{count}} item(s) will be installed.",
"install-plan-will-update": "{{count}} item(s) already installed and will be skipped.",
@ -8562,9 +8563,12 @@
"hot": "HOT",
"esri-street": "WorldStreetMap",
"esri-topo": "WorldTopoMap",
"esri-imagery": "WorldImagery",
"cartodb-positron": "Positron",
"cartodb-dark-matter": "DarkMatter"
"esri-imagery": "WorldImagery"
},
"carto": {
"title": "CARTO",
"positron": "Positron",
"dark-matter": "DarkMatter"
},
"google": {
"title": "Google",
@ -8588,7 +8592,9 @@
},
"custom": {
"title": "Custom",
"tile-url": "Tile URL"
"tile-url": "Tile URL",
"attribution": "Copyright text",
"attribution-hint": "Displayed at the bottom of the map. Required by most tile providers."
}
},
"credentials": {
@ -8865,10 +8871,7 @@
"here-map-hybrid-day": "HERE.hybridDay",
"here-map-terrain-day": "HERE.terrainDay",
"credentials": "Credentials",
"here-app-id": "HERE app id",
"here-app-code": "HERE app code",
"here-api-key": "HERE API key",
"here-use-new-version-api-3": "Use API version 3",
"tencent-maps-api-key": "Tencent Maps API Key",
"tencent-map-type-roadmap": "Roadmap",
"tencent-map-type-satelite": "Satellite",

297
ui-ngx/yarn.lock

@ -2115,59 +2115,70 @@
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-3.4.2.tgz#99caf114bb74d39c9e1baca99b907353ad8bf461"
integrity sha512-IY+r3bxKW6Q6sIPiMC0L533DEfRJSXibjSI3Ft/w9Q8KQBNqEIvUFXt+09wV8S5BRk0a8uSF19YWxuRwEfI90g==
"@mapbox/geojson-rewind@^0.5.2":
version "0.5.2"
resolved "https://registry.yarnpkg.com/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz#591a5d71a9cd1da1a0bf3420b3bea31b0fc7946a"
integrity sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==
dependencies:
get-stream "^6.0.1"
minimist "^1.2.6"
"@mapbox/jsonlint-lines-primitives@^2.0.2", "@mapbox/jsonlint-lines-primitives@~2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234"
integrity sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==
"@mapbox/jsonlint-lines-primitives@^2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.3.tgz#7d7b0b971fbaf6d60953272db4df03020d3fb004"
integrity sha512-0SElaV0uMxEnxzBhhX9WTuPyUeMsAN/SS0i16tjuba4/mio63MG9khjC1a0JAiPGXAwvwm4UfHJURCN7nyudQg==
"@mapbox/point-geometry@0.1.0", "@mapbox/point-geometry@^0.1.0", "@mapbox/point-geometry@~0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz#8a83f9335c7860effa2eeeca254332aa0aeed8f2"
integrity sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==
"@mapbox/point-geometry@^1.1.0", "@mapbox/point-geometry@~1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz#3328fb54b3a1273bc619bf0a6baad8de37181749"
integrity sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==
"@mapbox/tiny-sdf@^2.0.6":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz#0d67d65a43195003b282764f2297c619736bbc6e"
integrity sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==
"@mapbox/tiny-sdf@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@mapbox/tiny-sdf/-/tiny-sdf-2.2.0.tgz#95dae0dc371b8c55c53d70f3e25d56823427f4c8"
integrity sha512-LVL4wgI9YAum5V+LNVQO6QgFBPw7/MIIY4XJPNsPDMrjEwcE+JfKk1LuIl8GnF197ejVdC9QdPaxrx5gfgdGXg==
"@mapbox/unitbezier@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz#d32deb66c7177e9e9dfc3bbd697083e2e657ff01"
integrity sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==
"@mapbox/unitbezier@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@mapbox/unitbezier/-/unitbezier-1.0.0.tgz#54319aff6c467bb1b909e04895c08cdb966bfbff"
integrity sha512-fqd515fjBmANKGGsQ286E2Wvj/XvDFpGzwJxq4CI6jMQue6Oy04uCKp+JWKF00xRTmk6cEu1jPJ9p3xqH8YWqQ==
"@mapbox/vector-tile@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz#d3a74c90402d06e89ec66de49ec817ff53409666"
integrity sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==
"@mapbox/vector-tile@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@mapbox/vector-tile/-/vector-tile-3.0.0.tgz#71a75acb5ee20c20adca5c4e1ffb5ef95a56e351"
integrity sha512-Qf10S1uIHMk20ri/IVBnpS+esUEkVaR5Hftmz88jTInrpmWgPGJfPe3LVjjlE77trLx8tH6qjTG7uWH9hIq/0Q==
dependencies:
"@mapbox/point-geometry" "~0.1.0"
"@mapbox/point-geometry" "~1.1.0"
"@types/geojson" "^7946.0.16"
pbf "^5.0.0"
"@mapbox/whoots-js@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz#497c67a1cef50d1a2459ba60f315e448d2ad87fe"
integrity sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==
"@maplibre/geojson-vt@^6.1.1":
version "6.1.1"
resolved "https://registry.yarnpkg.com/@maplibre/geojson-vt/-/geojson-vt-6.1.1.tgz#25a032435b4ce2236ea0ba911aff5fb6d5454fc1"
integrity sha512-FVMOcmSP/yqol45t7StApEyTL5/vmqBCuFhH9n+fFuINenhaX+YgHHIt1yJ86S8kln3uJLcMvmEU2cfn6E2eCQ==
dependencies:
kdbush "^4.1.0"
"@maplibre/maplibre-gl-style-spec@^23.1.0":
version "23.3.0"
resolved "https://registry.yarnpkg.com/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-23.3.0.tgz#b69ab48cb3abead4e49213396c8f83492638b97c"
integrity sha512-IGJtuBbaGzOUgODdBRg66p8stnwj9iDXkgbYKoYcNiiQmaez5WVRfXm4b03MCDwmZyX93csbfHFWEJJYHnn5oA==
"@maplibre/maplibre-gl-style-spec@^26.4.4":
version "26.4.4"
resolved "https://registry.yarnpkg.com/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-26.4.4.tgz#e103d50f9eed8a44f1fde1c4970c5d2a47b19b78"
integrity sha512-hG4RZR4PBd/+6A3ODdZ3AnQRF106ZQk1y3bhwDg8bH/A4Oz2tnRUJVVWs9BZa6gXZ1d3UKe89C+Mm+olGBELvA==
dependencies:
"@mapbox/jsonlint-lines-primitives" "~2.0.2"
"@mapbox/unitbezier" "^0.0.1"
"@mapbox/jsonlint-lines-primitives" "^2.0.3"
"@mapbox/unitbezier" "^1.0.0"
json-stringify-pretty-compact "^4.0.0"
minimist "^1.2.8"
quickselect "^3.0.0"
rw "^1.3.3"
tinyqueue "^3.0.0"
"@maplibre/mlt@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@maplibre/mlt/-/mlt-1.3.0.tgz#3a9467d12a0b6edfcdba429dd3a260ca48f11129"
integrity sha512-7M2O7ABM80Oi8XPkfkrjKB8mOBIxGoVgkA52Mu4RMWoBvvMdagQ522+WxVYujZsMpqIr3BpzrTbXrm4k8lCzCQ==
dependencies:
"@mapbox/point-geometry" "^1.1.0"
"@maplibre/vt-pbf@^4.3.2":
version "4.3.2"
resolved "https://registry.yarnpkg.com/@maplibre/vt-pbf/-/vt-pbf-4.3.2.tgz#cfcdbdadaf88b4cb8645e43c8eead77cd6546030"
integrity sha512-j6p0AdjvAR19Z3XaCysle7A4ZSo08tYOzxD0Y9NQylwPAkwJJeYub5b2eVucdeDh7erhv69DahoLOevDRERRUw==
dependencies:
"@mapbox/point-geometry" "^1.1.0"
"@types/geojson" "^7946.0.16"
pbf "^5.1.0"
"@mat-datetimepicker/core@~16.0.1":
version "16.0.1"
resolved "https://registry.yarnpkg.com/@mat-datetimepicker/core/-/core-16.0.1.tgz#f2b19b6ed85f83a83f93be866af1a9564ac0d978"
@ -3503,13 +3514,6 @@
resolved "https://registry.yarnpkg.com/@types/flowjs/-/flowjs-2.13.14.tgz#62cdd8d5d8e0222e505e4a140e73cd385c0a496c"
integrity sha512-OlZFH9hbOq5B+GeBjcM3UvvSailseRT+sKoi9jyFFczvvS1n1LTiTKJysDSLVWnUvGD+tsn7kxb6eC2uaJD+Zw==
"@types/geojson-vt@3.2.5":
version "3.2.5"
resolved "https://registry.yarnpkg.com/@types/geojson-vt/-/geojson-vt-3.2.5.tgz#b6c356874991d9ab4207533476dfbcdb21e38408"
integrity sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==
dependencies:
"@types/geojson" "*"
"@types/geojson@*", "@types/geojson@^7946.0.10", "@types/geojson@^7946.0.16":
version "7946.0.16"
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.16.tgz#8ebe53d69efada7044454e3305c19017d97ced2a"
@ -3594,20 +3598,6 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.23.tgz#c1bb06db218acc8fc232da0447473fc2fb9d9841"
integrity sha512-RDvF6wTulMPjrNdCoYRC8gNR880JNGT8uB+REUpC2Ns4pRqQJhGz90wh7rgdXDPpCczF3VGktDuFGVnz8zP7HA==
"@types/mapbox__point-geometry@*", "@types/mapbox__point-geometry@^0.1.4":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz#0ef017b75eedce02ff6243b4189210e2e6d5e56d"
integrity sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==
"@types/mapbox__vector-tile@^1.3.4":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz#ad757441ef1d34628d9e098afd9c91423c1f8734"
integrity sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==
dependencies:
"@types/geojson" "*"
"@types/mapbox__point-geometry" "*"
"@types/pbf" "*"
"@types/mime@^1":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
@ -3625,11 +3615,6 @@
dependencies:
undici-types "~6.21.0"
"@types/pbf@*", "@types/pbf@^3.0.5":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@types/pbf/-/pbf-3.0.5.tgz#a9495a58d8c75be4ffe9a0bd749a307715c07404"
integrity sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==
"@types/qs@*":
version "6.9.16"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794"
@ -3686,13 +3671,6 @@
dependencies:
"@types/node" "*"
"@types/supercluster@^7.1.3":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@types/supercluster/-/supercluster-7.1.3.tgz#1a1bc2401b09174d9c9e44124931ec7874a72b27"
integrity sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==
dependencies:
"@types/geojson" "*"
"@types/systemjs@6.15.3":
version "6.15.3"
resolved "https://registry.yarnpkg.com/@types/systemjs/-/systemjs-6.15.3.tgz#d758dceafee62d2ed4aad7d07342b145d623e260"
@ -4437,6 +4415,13 @@ beasties@0.3.5:
postcss "^8.4.49"
postcss-media-query-parser "^0.2.3"
bidi-js@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/bidi-js/-/bidi-js-1.1.0.tgz#c92efafe3fce3b9fdd30ba67bdddf0dd4d424af7"
integrity sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==
dependencies:
require-from-string "^2.0.2"
big.js@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
@ -4861,13 +4846,14 @@ compressible@~2.0.18:
mime-db ">= 1.43.0 < 2"
compression@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.8.1.tgz#4a45d909ac16509195a9a28bd91094889c180d79"
integrity sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==
version "1.8.2"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.8.2.tgz#781397127ae2da00c0c5f7c76bda5b2a9b32a49f"
integrity sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ==
dependencies:
bytes "3.1.2"
compressible "~2.0.18"
debug "2.6.9"
destroy "1.2.0"
negotiator "~0.6.4"
on-headers "~1.1.0"
safe-buffer "5.2.1"
@ -5605,10 +5591,10 @@ dunder-proto@^1.0.0, dunder-proto@^1.0.1:
es-errors "^1.3.0"
gopd "^1.2.0"
earcut@^3.0.1:
version "3.0.2"
resolved "https://registry.yarnpkg.com/earcut/-/earcut-3.0.2.tgz#d478a29aaf99acf418151493048aa197d0512248"
integrity sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==
earcut@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/earcut/-/earcut-3.2.3.tgz#74aec19555a7e28773429826729d2e4bfeb19022"
integrity sha512-vnS4AVwp1KHAF13i1vp1/2D5evWy3k5u/iW/B81QVsUZtV8cv2tU0b2VNFlqvh4kYwrFMDdjPCfAmfyJW9y14Q==
eastasianwidth@^0.2.0:
version "0.2.0"
@ -6482,11 +6468,6 @@ gensync@^1.0.0-beta.2:
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
geojson-vt@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/geojson-vt/-/geojson-vt-4.0.2.tgz#1162f6c7d61a0ba305b1030621e6e111f847828a"
integrity sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==
get-caller-file@^2.0.1, get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
@ -6521,11 +6502,6 @@ get-proto@^1.0.1:
dunder-proto "^1.0.1"
es-object-atoms "^1.0.0"
get-stream@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
get-symbol-description@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee"
@ -6535,7 +6511,7 @@ get-symbol-description@^1.1.0:
es-errors "^1.3.0"
get-intrinsic "^1.2.6"
gl-matrix@^3.4.3:
gl-matrix@^3.4.4:
version "3.4.4"
resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.4.4.tgz#7789ee4982f62c7a7af447ee488f3bd6b0c77003"
integrity sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==
@ -6585,15 +6561,6 @@ glob@^13.0.0:
minipass "^7.1.2"
path-scurry "^2.0.0"
global-prefix@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-4.0.0.tgz#e9cc79aab9be1d03287e156a3f912dd0895463ed"
integrity sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==
dependencies:
ini "^4.1.3"
kind-of "^6.0.3"
which "^4.0.0"
globals@^14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
@ -6852,11 +6819,6 @@ icss-utils@^5.0.0, icss-utils@^5.1.0:
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==
ieee754@^1.1.12:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
ignore-walk@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-8.0.0.tgz#380c173badc3a18c57ff33440753f0052f572b14"
@ -6917,11 +6879,6 @@ ini@^1.3.4:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
ini@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.3.tgz#4c359675a6071a46985eb39b14e4a2c0ec98a795"
integrity sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==
ini@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/ini/-/ini-6.0.0.tgz#efc7642b276f6a37d22fdf56ef50889d7146bf30"
@ -7363,9 +7320,9 @@ js-tokens@^4.0.0:
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
js-yaml@^4.1.0, js-yaml@^4.3.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.1.tgz#01216c001d67f48e2cd560d708c7af21090a3848"
integrity sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==
version "4.3.2"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.2.tgz#8e44fb14a2643c59726bb15787b5f1512cb3d3fb"
integrity sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==
dependencies:
argparse "^2.0.1"
@ -7510,10 +7467,10 @@ katex@^0.16.0, katex@^0.16.25:
dependencies:
commander "^8.3.0"
kdbush@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-4.0.2.tgz#2f7b7246328b4657dd122b6c7f025fbc2c868e39"
integrity sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==
kdbush@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-4.1.0.tgz#d504bc0447a59be4fb75533a5c25e316b3ed8859"
integrity sha512-e9vurzrXJQrFX6ckpHP3bvj5l+9CnYzkxDNnNQ1h2QTqdWsUAJgXiKdGNcOa1EY85dU8KbQ+z/FdQdB7P+9yfQ==
keyv@^4.5.4:
version "4.5.4"
@ -7527,7 +7484,7 @@ khroma@^2.1.0:
resolved "https://registry.yarnpkg.com/khroma/-/khroma-2.1.0.tgz#45f2ce94ce231a437cf5b63c2e886e6eb42bbbb1"
integrity sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==
kind-of@^6.0.2, kind-of@^6.0.3:
kind-of@^6.0.2:
version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
@ -7576,10 +7533,10 @@ leaflet-polylinedecorator@1.6.0:
dependencies:
leaflet-rotatedmarker "^0.2.0"
leaflet-providers@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/leaflet-providers/-/leaflet-providers-2.0.0.tgz#dfdab9ca2dccc57c79e1462bc3dd20f78910afcb"
integrity sha512-CWwKEnHd66Qsx0m4o5q5ZOa60s00B91pMxnlr4Y22msubfs7dhbZhdMIz8bvZQkrZqi67ppI1fsZRS6vtrLcOA==
leaflet-providers@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/leaflet-providers/-/leaflet-providers-4.0.0.tgz#a98c5631a671c366739d8658e40be1d02e2c57cb"
integrity sha512-4m3Q4t0e+cHVNIPzlkW9HFWEgplImFRv8cnUFJYOfFoS6p2KosAfmh2Do6qk4HMdqutqbHMpv3F7sn/CUSw6oQ==
leaflet-rotatedmarker@^0.2.0:
version "0.2.0"
@ -7824,37 +7781,29 @@ make-plural@^7.0.0:
resolved "https://registry.yarnpkg.com/make-plural/-/make-plural-7.4.0.tgz#fa6990dd550dea4de6b20163f74e5ed83d8a8d6d"
integrity sha512-4/gC9KVNTV6pvYg2gFeQYTW3mWaoJt7WZE5vrp1KnQDgW92JtYZnzmZT81oj/dUTqAIu0ufI2x3dkgu3bB1tYg==
maplibre-gl@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/maplibre-gl/-/maplibre-gl-5.2.0.tgz#e3cdb66c82232cffbe149b032776484722caee4e"
integrity sha512-9zZKD0M80qtDsqBet+EDuAhoCeA/cnAuZAA0p3hcGKGbyjM/SH+R6wQvnBEgvJz9UhDynnkoKdUwhI+fUkHoXQ==
dependencies:
"@mapbox/geojson-rewind" "^0.5.2"
"@mapbox/jsonlint-lines-primitives" "^2.0.2"
"@mapbox/point-geometry" "^0.1.0"
"@mapbox/tiny-sdf" "^2.0.6"
"@mapbox/unitbezier" "^0.0.1"
"@mapbox/vector-tile" "^1.3.1"
"@mapbox/whoots-js" "^3.1.0"
"@maplibre/maplibre-gl-style-spec" "^23.1.0"
maplibre-gl@6.11.2:
version "6.11.2"
resolved "https://registry.yarnpkg.com/maplibre-gl/-/maplibre-gl-6.11.2.tgz#25f1266666c16f6b935cabccba554c238a3cf394"
integrity sha512-Xh06pxoipjX/Ad1sUPGhiNh9go9naCNGZZ1IJm3sIeqK1kYGuMaMDSTIGDQ2igOLfVyukJU7kvEOA089VO7Z7g==
dependencies:
"@mapbox/point-geometry" "^1.1.0"
"@mapbox/tiny-sdf" "^2.2.0"
"@mapbox/unitbezier" "^1.0.0"
"@mapbox/vector-tile" "^3.0.0"
"@maplibre/geojson-vt" "^6.1.1"
"@maplibre/maplibre-gl-style-spec" "^26.4.4"
"@maplibre/mlt" "^1.3.0"
"@maplibre/vt-pbf" "^4.3.2"
"@types/geojson" "^7946.0.16"
"@types/geojson-vt" "3.2.5"
"@types/mapbox__point-geometry" "^0.1.4"
"@types/mapbox__vector-tile" "^1.3.4"
"@types/pbf" "^3.0.5"
"@types/supercluster" "^7.1.3"
earcut "^3.0.1"
geojson-vt "^4.0.2"
gl-matrix "^3.4.3"
global-prefix "^4.0.0"
kdbush "^4.0.2"
bidi-js "^1.1.0"
earcut "^3.2.3"
gl-matrix "^3.4.4"
kdbush "^4.1.0"
murmurhash-js "^1.0.0"
pbf "^3.3.0"
potpack "^2.0.0"
pbf "^5.1.2"
potpack "^2.1.0"
quickselect "^3.0.0"
supercluster "^8.0.1"
tinyqueue "^3.0.0"
vt-pbf "^3.1.3"
marked@^16.3.0, marked@~16.4.2:
version "16.4.2"
@ -8104,10 +8053,10 @@ moment-timezone@^0.6.0:
dependencies:
moment "^2.29.4"
moment@^2.29.4, moment@^2.30.1:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
moment@^2.29.4, moment@^2.31.0:
version "2.31.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.31.0.tgz#6e19184e8005a9dfc61c9351263d4d6ea2ace7aa"
integrity sha512-0acOTfMiWOheYS4eoWb80yYMb/JLvVv9SHbs2PehaDzfUG0Bw855SKyk0IKTnPGa5+U2bmi3W68l1+sGLX/pvw==
moo@^0.5.1:
version "0.5.2"
@ -8844,12 +8793,11 @@ pathe@^2.0.1, pathe@^2.0.3:
resolved "https://registry.yarnpkg.com/pathe/-/pathe-2.0.3.tgz#3ecbec55421685b70a9da872b2cff3e1cbed1716"
integrity sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==
pbf@^3.2.1, pbf@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/pbf/-/pbf-3.3.0.tgz#1790f3d99118333cc7f498de816028a346ef367f"
integrity sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==
pbf@^5.0.0, pbf@^5.1.0, pbf@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/pbf/-/pbf-5.1.2.tgz#07c427819eda32f02f1ec9741558f61444f2e1c0"
integrity sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==
dependencies:
ieee754 "^1.1.12"
resolve-protobuf-schema "^2.1.0"
photoswipe@^5.4.4:
@ -9052,7 +9000,7 @@ postinstall-prepare@^2.0.0:
resolved "https://registry.yarnpkg.com/postinstall-prepare/-/postinstall-prepare-2.0.0.tgz#2a6867c1a13a05502aa115d0495efbbd778769cb"
integrity sha512-lLFwEKdnGLAaRAm8OpXP6HwrXRW+b8Hh9vRhVHZKmCdobd+D21YM38BCDsi3zrePLSe8Tt0H/mbYkh7/ySQQMg==
potpack@^2.0.0:
potpack@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/potpack/-/potpack-2.1.0.tgz#fe548e2f9061e9937f17191c1ab6dd98ca30e02f"
integrity sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==
@ -9110,9 +9058,9 @@ protocol-buffers-schema@^3.3.1:
integrity sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==
proxy-addr@^2.0.7, proxy-addr@~2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
version "2.0.8"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.8.tgz#624e760fd8ab06b1b8320c2f8506d4422cf8e932"
integrity sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"
@ -9494,7 +9442,7 @@ run-parallel@^1.1.9:
dependencies:
queue-microtask "^1.2.2"
rw@1, rw@^1.3.3:
rw@1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4"
integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==
@ -10171,13 +10119,6 @@ sucrase@^3.35.0:
tinyglobby "^0.2.11"
ts-interface-checker "^0.1.9"
supercluster@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-8.0.1.tgz#9946ba123538e9e9ab15de472531f604e7372df5"
integrity sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==
dependencies:
kdbush "^4.0.2"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
@ -10786,15 +10727,6 @@ vscode-uri@~3.1.0:
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.1.0.tgz#dd09ec5a66a38b5c3fffc774015713496d14e09c"
integrity sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==
vt-pbf@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/vt-pbf/-/vt-pbf-3.1.3.tgz#68fd150756465e2edae1cc5c048e063916dcfaac"
integrity sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==
dependencies:
"@mapbox/point-geometry" "0.1.0"
"@mapbox/vector-tile" "^1.3.1"
pbf "^3.2.1"
watchpack@2.4.4:
version "2.4.4"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.4.tgz#473bda72f0850453da6425081ea46fc0d7602947"
@ -11024,13 +10956,6 @@ which@^2.0.1:
dependencies:
isexe "^2.0.0"
which@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a"
integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==
dependencies:
isexe "^3.1.1"
which@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/which/-/which-6.0.0.tgz#a3a721a14cdd9b991a722e493c177eeff82ff32a"

Loading…
Cancel
Save