@oneuptime/common 12.0.25 → 12.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (834) hide show
  1. package/Models/AnalyticsModels/Index.ts +2 -0
  2. package/Models/AnalyticsModels/ThreatIntelIndicator.ts +413 -0
  3. package/Models/DatabaseModels/AlertSeverity.ts +4 -1
  4. package/Models/DatabaseModels/CephClusterFeed.ts +625 -0
  5. package/Models/DatabaseModels/CloudResourceFeed.ts +625 -0
  6. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +13 -0
  7. package/Models/DatabaseModels/DetectionRule.ts +9 -3
  8. package/Models/DatabaseModels/DockerHostFeed.ts +625 -0
  9. package/Models/DatabaseModels/DockerSwarmClusterFeed.ts +628 -0
  10. package/Models/DatabaseModels/GoogleSecOpsConnection.ts +9 -3
  11. package/Models/DatabaseModels/HostFeed.ts +625 -0
  12. package/Models/DatabaseModels/IncidentSeverity.ts +4 -1
  13. package/Models/DatabaseModels/Index.ts +22 -0
  14. package/Models/DatabaseModels/KubernetesClusterFeed.ts +628 -0
  15. package/Models/DatabaseModels/Monitor.ts +87 -0
  16. package/Models/DatabaseModels/NetworkDevice.ts +96 -5
  17. package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +92 -6
  18. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +301 -31
  19. package/Models/DatabaseModels/NetworkSite.ts +120 -0
  20. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +1 -0
  21. package/Models/DatabaseModels/PodmanHostFeed.ts +625 -0
  22. package/Models/DatabaseModels/ProxmoxClusterFeed.ts +626 -0
  23. package/Models/DatabaseModels/ScheduledMaintenance.ts +67 -0
  24. package/Models/DatabaseModels/ServiceFeed.ts +625 -0
  25. package/Models/DatabaseModels/TelemetrySourceMap.ts +474 -0
  26. package/Models/DatabaseModels/ThreatIntelFeed.ts +758 -0
  27. package/Models/DatabaseModels/UserOnCallLog.ts +1 -0
  28. package/Models/DatabaseModels/UserTotpAuth.ts +1 -0
  29. package/Models/DatabaseModels/UserWebAuthn.ts +1 -0
  30. package/Server/API/AlertAPI.ts +23 -1
  31. package/Server/API/BaseAPI.ts +14 -3
  32. package/Server/API/IncidentAPI.ts +41 -1
  33. package/Server/API/IncidentEpisodeAPI.ts +23 -1
  34. package/Server/API/MicrosoftTeamsAPI.ts +31 -2
  35. package/Server/API/ScheduledMaintenanceAPI.ts +23 -1
  36. package/Server/API/SlackAPI.ts +48 -0
  37. package/Server/API/TelemetryAPI.ts +167 -42
  38. package/Server/API/UserOnCallLogTimelineAPI.ts +75 -61
  39. package/Server/API/UserTotpAuthAPI.ts +67 -1
  40. package/Server/API/UserWebAuthnAPI.ts +44 -1
  41. package/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.ts +57 -0
  42. package/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.ts +49 -0
  43. package/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.ts +129 -0
  44. package/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.ts +54 -0
  45. package/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.ts +64 -0
  46. package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.ts +64 -0
  47. package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.ts +72 -0
  48. package/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.ts +31 -0
  49. package/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.ts +489 -0
  50. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +18 -0
  51. package/Server/Middleware/IdentityRateLimit.ts +53 -3
  52. package/Server/Services/AIService.ts +181 -41
  53. package/Server/Services/CephClusterFeedService.ts +99 -0
  54. package/Server/Services/CephClusterLabelRuleEngineService.ts +29 -0
  55. package/Server/Services/CephClusterOwnerRuleEngineService.ts +23 -0
  56. package/Server/Services/CephClusterOwnerTeamService.ts +129 -0
  57. package/Server/Services/CephClusterOwnerUserService.ts +123 -0
  58. package/Server/Services/CephClusterService.ts +223 -2
  59. package/Server/Services/CloudResourceFeedService.ts +99 -0
  60. package/Server/Services/CloudResourceLabelRuleEngineService.ts +30 -0
  61. package/Server/Services/CloudResourceOwnerRuleEngineService.ts +33 -0
  62. package/Server/Services/CloudResourceOwnerTeamService.ts +129 -0
  63. package/Server/Services/CloudResourceOwnerUserService.ts +123 -0
  64. package/Server/Services/CloudResourceService.ts +227 -2
  65. package/Server/Services/DatabaseService.ts +265 -0
  66. package/Server/Services/DockerHostFeedService.ts +99 -0
  67. package/Server/Services/DockerHostLabelRuleEngineService.ts +29 -0
  68. package/Server/Services/DockerHostOwnerRuleEngineService.ts +23 -0
  69. package/Server/Services/DockerHostOwnerTeamService.ts +129 -0
  70. package/Server/Services/DockerHostOwnerUserService.ts +123 -0
  71. package/Server/Services/DockerHostService.ts +227 -2
  72. package/Server/Services/DockerSwarmClusterFeedService.ts +102 -0
  73. package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +30 -0
  74. package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +24 -0
  75. package/Server/Services/DockerSwarmClusterOwnerTeamService.ts +133 -0
  76. package/Server/Services/DockerSwarmClusterOwnerUserService.ts +127 -0
  77. package/Server/Services/DockerSwarmClusterService.ts +229 -2
  78. package/Server/Services/EnterpriseLicenseService.ts +15 -7
  79. package/Server/Services/ExceptionAggregationService.ts +12 -2
  80. package/Server/Services/HostFeedService.ts +99 -0
  81. package/Server/Services/HostLabelRuleEngineService.ts +29 -0
  82. package/Server/Services/HostOwnerRuleEngineService.ts +23 -0
  83. package/Server/Services/HostOwnerTeamService.ts +129 -0
  84. package/Server/Services/HostOwnerUserService.ts +123 -0
  85. package/Server/Services/HostService.ts +215 -2
  86. package/Server/Services/IncidentService.ts +11 -0
  87. package/Server/Services/Index.ts +24 -0
  88. package/Server/Services/KubernetesClusterFeedService.ts +99 -0
  89. package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +30 -0
  90. package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +24 -0
  91. package/Server/Services/KubernetesClusterOwnerTeamService.ts +133 -0
  92. package/Server/Services/KubernetesClusterOwnerUserService.ts +127 -0
  93. package/Server/Services/KubernetesClusterService.ts +231 -2
  94. package/Server/Services/LogAggregationService.ts +23 -280
  95. package/Server/Services/MetricAggregationService.ts +98 -1
  96. package/Server/Services/MonitorService.ts +177 -13
  97. package/Server/Services/MonitorTemplateService.ts +111 -0
  98. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +777 -86
  99. package/Server/Services/NetworkDeviceAutoImportRuleService.ts +199 -16
  100. package/Server/Services/NetworkDeviceDiscoveryScanService.ts +1055 -14
  101. package/Server/Services/NetworkDeviceService.ts +750 -4
  102. package/Server/Services/NetworkInterfaceService.ts +415 -0
  103. package/Server/Services/NetworkSiteService.ts +485 -52
  104. package/Server/Services/PodmanHostFeedService.ts +99 -0
  105. package/Server/Services/PodmanHostLabelRuleEngineService.ts +29 -0
  106. package/Server/Services/PodmanHostOwnerRuleEngineService.ts +23 -0
  107. package/Server/Services/PodmanHostOwnerTeamService.ts +129 -0
  108. package/Server/Services/PodmanHostOwnerUserService.ts +123 -0
  109. package/Server/Services/PodmanHostService.ts +227 -2
  110. package/Server/Services/ProjectService.ts +16 -10
  111. package/Server/Services/ProxmoxClusterFeedService.ts +99 -0
  112. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +30 -0
  113. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +24 -0
  114. package/Server/Services/ProxmoxClusterOwnerTeamService.ts +131 -0
  115. package/Server/Services/ProxmoxClusterOwnerUserService.ts +124 -0
  116. package/Server/Services/ProxmoxClusterService.ts +225 -2
  117. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +61 -0
  118. package/Server/Services/ServiceFeedService.ts +99 -0
  119. package/Server/Services/ServiceLabelRuleEngineService.ts +29 -0
  120. package/Server/Services/ServiceOwnerRuleEngineService.ts +26 -0
  121. package/Server/Services/ServiceOwnerTeamService.ts +129 -0
  122. package/Server/Services/ServiceOwnerUserService.ts +123 -0
  123. package/Server/Services/ServiceService.ts +227 -3
  124. package/Server/Services/StatusPageSubscriberService.ts +7 -0
  125. package/Server/Services/TelemetryAttributeService.ts +13 -3
  126. package/Server/Services/TelemetrySourceMapService.ts +307 -0
  127. package/Server/Services/ThreatIntelFeedService.ts +222 -0
  128. package/Server/Services/ThreatIntelIndicatorService.ts +428 -0
  129. package/Server/Services/TraceAggregationService.ts +101 -11
  130. package/Server/Services/UserService.ts +13 -6
  131. package/Server/Services/UserTwoFactorBackupCodeService.ts +127 -0
  132. package/Server/Services/UserWebhookService.ts +11 -2
  133. package/Server/Static/Brand/README.md +38 -0
  134. package/Server/Static/Brand/favicons/apple-touch-icon.png +0 -0
  135. package/Server/Static/Brand/favicons/favicon-16x16.png +0 -0
  136. package/Server/Static/Brand/favicons/favicon-32x32.png +0 -0
  137. package/Server/Static/Brand/favicons/favicon.ico +0 -0
  138. package/Server/Static/Brand/favicons/safari-pinned-tab.svg +31 -0
  139. package/Server/Static/Brand/hou-wb.svg +1 -0
  140. package/Server/Static/Brand/oneuptime-logo.svg +1 -0
  141. package/Server/Static/Brand/ou-wb.svg +1 -0
  142. package/Server/Static/Vendor/README.md +4 -0
  143. package/Server/Types/AnalyticsDatabase/ModelPermission.ts +13 -3
  144. package/Server/Types/Database/AggregateBy.ts +83 -0
  145. package/Server/Types/Database/AggregateResultUtil.ts +126 -0
  146. package/Server/Types/Database/JSONColumnQuery.ts +18 -0
  147. package/Server/Types/Database/QueryHelper.ts +40 -0
  148. package/Server/Types/Database/QueryUtil.ts +26 -0
  149. package/Server/Types/Workflow/Components/API/Utils.ts +10 -1
  150. package/Server/Types/Workflow/Components/JavaScript.ts +8 -0
  151. package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +9 -0
  152. package/Server/Utils/AI/SRE/InvestigationGrader.ts +18 -0
  153. package/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.ts +422 -0
  154. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +176 -0
  155. package/Server/Utils/DataSource/HttpFetch.ts +18 -0
  156. package/Server/Utils/Database/RelationIdUtil.ts +42 -0
  157. package/Server/Utils/Marketing/MarketingEventUtil.ts +38 -9
  158. package/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.ts +34 -3
  159. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +9 -1
  160. package/Server/Utils/Monitor/Criteria/SyntheticMonitor.ts +28 -10
  161. package/Server/Utils/Monitor/MonitorAlert.ts +541 -332
  162. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +330 -64
  163. package/Server/Utils/Monitor/MonitorIncident.ts +640 -434
  164. package/Server/Utils/Monitor/MonitorResource.ts +226 -49
  165. package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +46 -3
  166. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +23 -102
  167. package/Server/Utils/Monitor/PerEntityCriteriaFanOut.ts +329 -0
  168. package/Server/Utils/NetworkDevice/DeviceHealthAggregation.ts +427 -0
  169. package/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.ts +310 -0
  170. package/Server/Utils/OnCallNotificationContext.ts +686 -0
  171. package/Server/Utils/PrivateNetworkWebhookConfig.ts +549 -0
  172. package/Server/Utils/ResourceFeed/ResourceFeedUtil.ts +139 -0
  173. package/Server/Utils/Response.ts +11 -1
  174. package/Server/Utils/SSRFProtection.ts +230 -60
  175. package/Server/Utils/SecurityEvent/ConnectorErrorMessage.ts +106 -0
  176. package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +84 -284
  177. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +47 -20
  178. package/Server/Utils/SecurityEvent/SecurityEventAlerting.ts +318 -0
  179. package/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.ts +199 -0
  180. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.ts +252 -0
  181. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.ts +739 -0
  182. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.ts +533 -0
  183. package/Server/Utils/StartServer.ts +83 -56
  184. package/Server/Utils/StatusPageSubscriberWebhook.ts +3 -0
  185. package/Server/Utils/Telemetry/SourceMapResolver.ts +480 -0
  186. package/Server/Utils/TwoFactorBackupCodeNotification.ts +106 -0
  187. package/Server/Utils/VM/VMAPI.ts +3 -0
  188. package/Server/Utils/VM/VMRunner.ts +27 -1
  189. package/Server/Utils/VendorAssets.ts +42 -0
  190. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +136 -6
  191. package/Server/Views/AcknowledgeUserOnCallNotification.ejs +11 -9
  192. package/Server/Views/Partials/Head.ejs +9 -9
  193. package/Server/Views/Partials/OnCallNotificationDetails.ejs +48 -0
  194. package/Server/Views/ViewMessage.ejs +11 -9
  195. package/Tests/App/Accounts/LoginTwoFactorRecovery.test.tsx +972 -0
  196. package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +401 -0
  197. package/Tests/App/Dashboard/DiscoveryScanEditForm.test.tsx +707 -0
  198. package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +1908 -18
  199. package/Tests/App/Dashboard/ResourceFeed.test.tsx +230 -0
  200. package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +216 -0
  201. package/Tests/App/Dashboard/TopologyAddToMonitoring.test.tsx +192 -0
  202. package/Tests/App/Dashboard/WorkspaceNotificationRuleConditions.test.tsx +439 -0
  203. package/Tests/Models/DatabaseModels/DateColumnDeserialization.test.ts +182 -0
  204. package/Tests/Models/DatabaseModels/RelationColumnModelTypeCoverage.test.ts +82 -0
  205. package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +398 -0
  206. package/Tests/Models/DiscoveryScanNameColumn.test.ts +151 -16
  207. package/Tests/Models/DiscoveryScanSnmpEnabledColumn.test.ts +593 -0
  208. package/Tests/Models/NetworkDeviceCreateContract.test.ts +102 -0
  209. package/Tests/Server/API/AIGenerationProjectAIToggle.test.ts +607 -0
  210. package/Tests/Server/API/AIGenerationRequestBudget.test.ts +355 -0
  211. package/Tests/Server/API/AIKillSwitchBackstop.test.ts +602 -0
  212. package/Tests/Server/API/BaseAPIUpdateDateColumns.test.ts +154 -0
  213. package/Tests/Server/API/MicrosoftTeamsBotTestEndpoint.test.ts +335 -0
  214. package/Tests/Server/API/UserOnCallLogTimelineAcknowledgePage.test.ts +611 -0
  215. package/Tests/Server/API/UserTotpAuthAPI.test.ts +498 -4
  216. package/Tests/Server/API/UserWebAuthnBackupCodeMinting.test.ts +682 -0
  217. package/Tests/Server/Infrastructure/ExampleDockerfiles.test.ts +595 -0
  218. package/Tests/Server/Services/AIServiceDailyBudget.test.ts +9 -0
  219. package/Tests/Server/Services/AIServiceProjectAccess.test.ts +6 -0
  220. package/Tests/Server/Services/AutoImportScanCredentialSelect.test.ts +18 -0
  221. package/Tests/Server/Services/DatabaseServiceAggregateBy.test.ts +590 -0
  222. package/Tests/Server/Services/DatabaseServiceUpdateWriteRouting.test.ts +12 -0
  223. package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +162 -26
  224. package/Tests/Server/Services/EnterpriseLicenseServiceCreate.test.ts +292 -0
  225. package/Tests/Server/Services/FeedRetentionConsistency.test.ts +119 -12
  226. package/Tests/Server/Services/LogAggregationAttributeOperators.test.ts +109 -0
  227. package/Tests/Server/Services/MetricAggregationAttributeOperators.test.ts +170 -0
  228. package/Tests/Server/Services/MonitorTemplateServiceNetworkDeviceSync.test.ts +383 -0
  229. package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +997 -3
  230. package/Tests/Server/Services/NetworkDeviceAutoImportRuleService.test.ts +830 -0
  231. package/Tests/Server/Services/NetworkDeviceAutoMonitorLifecycle.test.ts +528 -0
  232. package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +3141 -1
  233. package/Tests/Server/Services/NetworkDeviceRegisteredHostnames.test.ts +1023 -0
  234. package/Tests/Server/Services/NetworkDeviceSiteAssignmentRuleSkip.test.ts +728 -0
  235. package/Tests/Server/Services/NetworkInterfaceServiceUpsert.test.ts +795 -0
  236. package/Tests/Server/Services/NetworkSiteRollupPolicyAndMaintenance.test.ts +903 -0
  237. package/Tests/Server/Services/NetworkSiteService.test.ts +165 -24
  238. package/Tests/Server/Services/ProjectServiceChangePlan.test.ts +5 -3
  239. package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +5 -2
  240. package/Tests/Server/Services/ResourceCreationFeedWrites.test.ts +304 -0
  241. package/Tests/Server/Services/ResourceFeedServices.test.ts +269 -0
  242. package/Tests/Server/Services/ResourceOwnerFeedWrites.test.ts +245 -0
  243. package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +792 -0
  244. package/Tests/Server/Services/TelemetrySourceMapService.test.ts +483 -0
  245. package/Tests/Server/Services/ThreatIntelFeedService.test.ts +351 -0
  246. package/Tests/Server/Services/ThreatIntelIndicatorService.test.ts +366 -0
  247. package/Tests/Server/Services/TraceAggregationAttributeOperators.test.ts +507 -0
  248. package/Tests/Server/Services/UserTwoFactorBackupCodeGenerateIfNone.test.ts +705 -0
  249. package/Tests/Server/Services/WorkspaceNotificationRuleOnCallDutyPolicy.test.ts +306 -0
  250. package/Tests/Server/Types/Database/AggregateResultUtil.test.ts +386 -0
  251. package/Tests/Server/Types/Database/Permissions/SelectRejectionMessageContract.test.ts +424 -0
  252. package/Tests/Server/Types/Database/QueryHelperWildcard.test.ts +142 -0
  253. package/Tests/Server/Types/Workflow/Components/ApiComponentPrivateNetwork.test.ts +163 -0
  254. package/Tests/Server/Types/Workflow/Components/JavaScriptPrivateNetwork.test.ts +124 -0
  255. package/Tests/Server/Utils/AI/CodeFixAgentCompletion.test.ts +5 -0
  256. package/Tests/Server/Utils/AI/InvestigationGrader.test.ts +39 -1
  257. package/Tests/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.test.ts +338 -0
  258. package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorWildcard.test.ts +383 -0
  259. package/Tests/Server/Utils/Marketing/EmittedMarketingEvent.ts +23 -0
  260. package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +51 -0
  261. package/Tests/Server/Utils/Monitor/Criteria/SyntheticMonitorCriteria.test.ts +259 -0
  262. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPerSeriesFanout.test.ts +557 -0
  263. package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +12 -2
  264. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkLogWritePath.test.ts +404 -0
  265. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +8 -2
  266. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +125 -98
  267. package/Tests/Server/Utils/Monitor/PerEntityCriteriaFanOut.test.ts +444 -0
  268. package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1112 -0
  269. package/Tests/Server/Utils/NetworkDevice/DeviceHealthAggregation.test.ts +717 -0
  270. package/Tests/Server/Utils/NetworkDevice/RulePatternValidator.test.ts +78 -0
  271. package/Tests/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.test.ts +363 -0
  272. package/Tests/Server/Utils/OfflineAssetHygiene.test.ts +35 -0
  273. package/Tests/Server/Utils/OnCallNotificationContext.test.ts +908 -0
  274. package/Tests/Server/Utils/PrivateNetworkWebhookConfig.test.ts +423 -0
  275. package/Tests/Server/Utils/ResourceFeed/ResourceFeedUtil.test.ts +191 -0
  276. package/Tests/Server/Utils/SSRFProtectionPrivateNetwork.test.ts +597 -0
  277. package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +819 -0
  278. package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +381 -0
  279. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +417 -0
  280. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +819 -0
  281. package/Tests/Server/Utils/SecurityEvent/SecurityEventAlerting.test.ts +246 -0
  282. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.test.ts +282 -0
  283. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.test.ts +312 -0
  284. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.test.ts +854 -0
  285. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.test.ts +437 -0
  286. package/Tests/Server/Utils/StartServerErrorStatus.test.ts +225 -0
  287. package/Tests/Server/Utils/StatusPage/MonitorRulePatternValidator.test.ts +62 -0
  288. package/Tests/Server/Utils/StatusPageSubscriberWebhookPrivateNetwork.test.ts +119 -0
  289. package/Tests/Server/Utils/Telemetry/SourceMapResolver.test.ts +542 -0
  290. package/Tests/Server/Utils/TwoFactorBackupCodeNotification.test.ts +272 -0
  291. package/Tests/Server/Utils/VM/VMRunnerPrivateNetworkWiring.test.ts +111 -0
  292. package/Tests/Server/Utils/VendorAssets.test.ts +117 -0
  293. package/Tests/Server/Utils/Workspace/MicrosoftTeamsChannelSend.test.ts +101 -4
  294. package/Tests/Server/Utils/Workspace/MicrosoftTeamsInstallStateDiagnostics.test.ts +922 -0
  295. package/Tests/Server/Utils/Workspace/MicrosoftTeamsRosterDiagnosticMessages.test.ts +642 -0
  296. package/Tests/Server/Views/OnCallAcknowledgePage.test.ts +430 -0
  297. package/Tests/Types/API/URLQueryString.test.ts +472 -0
  298. package/Tests/Types/BaseDatabase/Wildcard.test.ts +163 -0
  299. package/Tests/Types/BaseDatabase/WildcardPattern.test.ts +149 -0
  300. package/Tests/Types/Database/DateColumnValue.test.ts +265 -0
  301. package/Tests/Types/DateToIsoStringOrNull.test.ts +67 -0
  302. package/Tests/Types/Log/LogQueryToFilter.test.ts +218 -43
  303. package/Tests/Types/Monitor/KubernetesTemplateGroupByKeys.test.ts +225 -0
  304. package/Tests/Types/Monitor/TemplateGroupByKeys.test.ts +296 -0
  305. package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +102 -0
  306. package/Tests/Types/NetworkAutomation/RuleRunResultDescribe.test.ts +145 -0
  307. package/Tests/Types/NetworkSite/SiteHealthRollupPolicy.test.ts +58 -0
  308. package/Tests/Types/SerializableObjectDictionaryImportCycle.test.ts +15 -0
  309. package/Tests/Types/Telemetry/TelemetrySearchQuery.test.ts +620 -0
  310. package/Tests/Types/WhatsApp/WhatsAppTemplates.test.ts +110 -0
  311. package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +76 -6
  312. package/Tests/Types/Workspace/NotificationRules/NotificationRuleCondition.test.ts +16 -4
  313. package/Tests/Types/Workspace/NotificationRules/OnCallDutyPolicyConditions.test.ts +669 -0
  314. package/Tests/UI/Components/DictionaryFilterOperatorWildcard.test.ts +175 -0
  315. package/Tests/UI/Components/IconOpticalSize.test.tsx +377 -0
  316. package/Tests/UI/MicrosoftTeams/MicrosoftTeamsChatsCardInstallGuidance.test.tsx +332 -0
  317. package/Tests/UI/MicrosoftTeams/MicrosoftTeamsInstallGuidanceContent.test.tsx +643 -0
  318. package/Tests/Utils/Monitor/InterfaceInventoryUtil.test.ts +824 -0
  319. package/Tests/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.test.ts +626 -0
  320. package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +718 -0
  321. package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +59 -0
  322. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +287 -2
  323. package/Tests/Utils/NetworkDiscovery/DiscoveryImportEligibility.test.ts +73 -0
  324. package/Tests/Utils/NetworkDiscovery/PingMonitorBuilder.test.ts +317 -0
  325. package/Tests/Utils/NetworkDiscovery/RescanIntervalUtil.test.ts +262 -0
  326. package/Tests/Utils/NetworkDiscovery/ScanModeUtil.test.ts +474 -0
  327. package/Tests/Utils/NetworkDiscovery/SnmpScanConfigUtil.test.ts +2442 -0
  328. package/Tests/Utils/NetworkSite/SiteMaintenanceUtil.test.ts +188 -0
  329. package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +522 -0
  330. package/Tests/Utils/NetworkSite/SiteUptimeUtil.test.ts +694 -0
  331. package/Tests/Utils/SecurityEvent/ThreatIntel/StixPatternParser.test.ts +281 -0
  332. package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +87 -67
  333. package/Types/API/URL.ts +45 -10
  334. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +8 -0
  335. package/Types/BaseDatabase/NotWildcard.ts +86 -0
  336. package/Types/BaseDatabase/Wildcard.ts +89 -0
  337. package/Types/BaseDatabase/WildcardPattern.ts +176 -0
  338. package/Types/Database/DateColumnValue.ts +184 -0
  339. package/Types/Database/TableColumn.ts +40 -5
  340. package/Types/Date.ts +37 -0
  341. package/Types/Email/EmailTemplateType.ts +1 -0
  342. package/Types/JSON.ts +8 -0
  343. package/Types/Log/LogQueryToFilter.ts +167 -129
  344. package/Types/Monitor/DockerAlertTemplates.ts +43 -12
  345. package/Types/Monitor/HostAlertTemplates.ts +31 -3
  346. package/Types/Monitor/KubernetesAlertTemplates.ts +98 -0
  347. package/Types/Monitor/MonitorStep.ts +49 -0
  348. package/Types/Monitor/PodmanAlertTemplates.ts +39 -12
  349. package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +14 -0
  350. package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +11 -0
  351. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +11 -4
  352. package/Types/NetworkAutomation/RuleRunResult.ts +191 -2
  353. package/Types/NetworkSite/SiteHealthRollupPolicy.ts +96 -0
  354. package/Types/Permission.ts +411 -0
  355. package/Types/Probe/ProbeApiIngestResponse.ts +42 -0
  356. package/Types/SecurityEvent/ThreatIntelConstants.ts +118 -0
  357. package/Types/SerializableObjectDictionary.ts +8 -0
  358. package/Types/Telemetry/SourceMap.ts +56 -0
  359. package/Types/Telemetry/TelemetrySearchQuery.ts +949 -0
  360. package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +12 -1
  361. package/UI/Components/Dictionary/DictionaryFilterOperator.ts +83 -0
  362. package/UI/Components/Icon/Icon.tsx +28 -1
  363. package/UI/Components/LogsViewer/components/LogSearchBar.tsx +26 -4
  364. package/UI/Components/LogsViewer/components/LogSearchHelp.tsx +34 -16
  365. package/UI/Components/TelemetryViewer/components/TelemetrySearchBar.tsx +15 -2
  366. package/Utils/Metrics/MetricExplorerUrl.ts +77 -15
  367. package/Utils/Monitor/InterfaceInventoryUtil.ts +251 -0
  368. package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +333 -0
  369. package/Utils/Monitor/NetworkTopologyUtil.ts +249 -28
  370. package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +14 -6
  371. package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +2 -0
  372. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +49 -18
  373. package/Utils/NetworkDiscovery/PingMonitorBuilder.ts +215 -0
  374. package/Utils/NetworkDiscovery/RescanIntervalUtil.ts +148 -0
  375. package/Utils/NetworkDiscovery/ScanModeUtil.ts +105 -0
  376. package/Utils/NetworkDiscovery/SnmpScanConfigUtil.ts +827 -0
  377. package/Utils/NetworkSite/SiteMaintenanceUtil.ts +110 -0
  378. package/Utils/NetworkSite/SiteStatusRollupUtil.ts +350 -19
  379. package/Utils/NetworkSite/SiteUptimeUtil.ts +422 -21
  380. package/Utils/SecurityEvent/ThreatIntel/StixPatternParser.ts +383 -0
  381. package/Utils/Telemetry/CrossSignalScope.ts +37 -39
  382. package/build/dist/Models/AnalyticsModels/Index.js +2 -0
  383. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  384. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js +325 -0
  385. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js.map +1 -0
  386. package/build/dist/Models/DatabaseModels/AlertSeverity.js +4 -1
  387. package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
  388. package/build/dist/Models/DatabaseModels/CephClusterFeed.js +648 -0
  389. package/build/dist/Models/DatabaseModels/CephClusterFeed.js.map +1 -0
  390. package/build/dist/Models/DatabaseModels/CloudResourceFeed.js +648 -0
  391. package/build/dist/Models/DatabaseModels/CloudResourceFeed.js.map +1 -0
  392. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +11 -0
  393. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
  394. package/build/dist/Models/DatabaseModels/DetectionRule.js +9 -3
  395. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
  396. package/build/dist/Models/DatabaseModels/DockerHostFeed.js +648 -0
  397. package/build/dist/Models/DatabaseModels/DockerHostFeed.js.map +1 -0
  398. package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js +648 -0
  399. package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js.map +1 -0
  400. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +9 -3
  401. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -1
  402. package/build/dist/Models/DatabaseModels/HostFeed.js +648 -0
  403. package/build/dist/Models/DatabaseModels/HostFeed.js.map +1 -0
  404. package/build/dist/Models/DatabaseModels/IncidentSeverity.js +4 -1
  405. package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
  406. package/build/dist/Models/DatabaseModels/Index.js +22 -0
  407. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  408. package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js +648 -0
  409. package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js.map +1 -0
  410. package/build/dist/Models/DatabaseModels/Monitor.js +81 -0
  411. package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
  412. package/build/dist/Models/DatabaseModels/NetworkDevice.js +103 -7
  413. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  414. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +91 -6
  415. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -1
  416. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +276 -31
  417. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  418. package/build/dist/Models/DatabaseModels/NetworkSite.js +124 -1
  419. package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -1
  420. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +1 -0
  421. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
  422. package/build/dist/Models/DatabaseModels/PodmanHostFeed.js +648 -0
  423. package/build/dist/Models/DatabaseModels/PodmanHostFeed.js.map +1 -0
  424. package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js +648 -0
  425. package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js.map +1 -0
  426. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +66 -0
  427. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  428. package/build/dist/Models/DatabaseModels/ServiceFeed.js +648 -0
  429. package/build/dist/Models/DatabaseModels/ServiceFeed.js.map +1 -0
  430. package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js +496 -0
  431. package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js.map +1 -0
  432. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +800 -0
  433. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js.map +1 -0
  434. package/build/dist/Models/DatabaseModels/UserOnCallLog.js +1 -0
  435. package/build/dist/Models/DatabaseModels/UserOnCallLog.js.map +1 -1
  436. package/build/dist/Models/DatabaseModels/UserTotpAuth.js +1 -0
  437. package/build/dist/Models/DatabaseModels/UserTotpAuth.js.map +1 -1
  438. package/build/dist/Models/DatabaseModels/UserWebAuthn.js +1 -0
  439. package/build/dist/Models/DatabaseModels/UserWebAuthn.js.map +1 -1
  440. package/build/dist/Server/API/AlertAPI.js +18 -1
  441. package/build/dist/Server/API/AlertAPI.js.map +1 -1
  442. package/build/dist/Server/API/BaseAPI.js +8 -1
  443. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  444. package/build/dist/Server/API/IncidentAPI.js +35 -1
  445. package/build/dist/Server/API/IncidentAPI.js.map +1 -1
  446. package/build/dist/Server/API/IncidentEpisodeAPI.js +18 -1
  447. package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
  448. package/build/dist/Server/API/MicrosoftTeamsAPI.js +30 -2
  449. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  450. package/build/dist/Server/API/ScheduledMaintenanceAPI.js +18 -1
  451. package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
  452. package/build/dist/Server/API/SlackAPI.js +45 -0
  453. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  454. package/build/dist/Server/API/TelemetryAPI.js +100 -35
  455. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  456. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +64 -59
  457. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
  458. package/build/dist/Server/API/UserTotpAuthAPI.js +65 -1
  459. package/build/dist/Server/API/UserTotpAuthAPI.js.map +1 -1
  460. package/build/dist/Server/API/UserWebAuthnAPI.js +42 -1
  461. package/build/dist/Server/API/UserWebAuthnAPI.js.map +1 -1
  462. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js +26 -0
  463. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js.map +1 -0
  464. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js +22 -0
  465. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js.map +1 -0
  466. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js +88 -0
  467. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js.map +1 -0
  468. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js +39 -0
  469. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js.map +1 -0
  470. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js +34 -0
  471. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js.map +1 -0
  472. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js +32 -0
  473. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js.map +1 -0
  474. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js +61 -0
  475. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js.map +1 -0
  476. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js +23 -0
  477. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js.map +1 -0
  478. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js +179 -0
  479. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js.map +1 -0
  480. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +18 -0
  481. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  482. package/build/dist/Server/Middleware/IdentityRateLimit.js +40 -3
  483. package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -1
  484. package/build/dist/Server/Services/AIService.js +177 -30
  485. package/build/dist/Server/Services/AIService.js.map +1 -1
  486. package/build/dist/Server/Services/CephClusterFeedService.js +89 -0
  487. package/build/dist/Server/Services/CephClusterFeedService.js.map +1 -0
  488. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +27 -3
  489. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
  490. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +21 -0
  491. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
  492. package/build/dist/Server/Services/CephClusterOwnerTeamService.js +120 -0
  493. package/build/dist/Server/Services/CephClusterOwnerTeamService.js.map +1 -1
  494. package/build/dist/Server/Services/CephClusterOwnerUserService.js +113 -0
  495. package/build/dist/Server/Services/CephClusterOwnerUserService.js.map +1 -1
  496. package/build/dist/Server/Services/CephClusterService.js +175 -1
  497. package/build/dist/Server/Services/CephClusterService.js.map +1 -1
  498. package/build/dist/Server/Services/CloudResourceFeedService.js +89 -0
  499. package/build/dist/Server/Services/CloudResourceFeedService.js.map +1 -0
  500. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +27 -3
  501. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
  502. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +28 -3
  503. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
  504. package/build/dist/Server/Services/CloudResourceOwnerTeamService.js +120 -0
  505. package/build/dist/Server/Services/CloudResourceOwnerTeamService.js.map +1 -1
  506. package/build/dist/Server/Services/CloudResourceOwnerUserService.js +113 -0
  507. package/build/dist/Server/Services/CloudResourceOwnerUserService.js.map +1 -1
  508. package/build/dist/Server/Services/CloudResourceService.js +177 -1
  509. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  510. package/build/dist/Server/Services/DatabaseService.js +201 -0
  511. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  512. package/build/dist/Server/Services/DockerHostFeedService.js +89 -0
  513. package/build/dist/Server/Services/DockerHostFeedService.js.map +1 -0
  514. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +27 -3
  515. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
  516. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +21 -0
  517. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
  518. package/build/dist/Server/Services/DockerHostOwnerTeamService.js +120 -0
  519. package/build/dist/Server/Services/DockerHostOwnerTeamService.js.map +1 -1
  520. package/build/dist/Server/Services/DockerHostOwnerUserService.js +113 -0
  521. package/build/dist/Server/Services/DockerHostOwnerUserService.js.map +1 -1
  522. package/build/dist/Server/Services/DockerHostService.js +177 -1
  523. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  524. package/build/dist/Server/Services/DockerSwarmClusterFeedService.js +90 -0
  525. package/build/dist/Server/Services/DockerSwarmClusterFeedService.js.map +1 -0
  526. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +27 -3
  527. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
  528. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +21 -0
  529. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
  530. package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js +120 -0
  531. package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js.map +1 -1
  532. package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js +113 -0
  533. package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js.map +1 -1
  534. package/build/dist/Server/Services/DockerSwarmClusterService.js +175 -1
  535. package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
  536. package/build/dist/Server/Services/EnterpriseLicenseService.js +40 -30
  537. package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
  538. package/build/dist/Server/Services/ExceptionAggregationService.js +8 -2
  539. package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
  540. package/build/dist/Server/Services/HostFeedService.js +89 -0
  541. package/build/dist/Server/Services/HostFeedService.js.map +1 -0
  542. package/build/dist/Server/Services/HostLabelRuleEngineService.js +27 -3
  543. package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
  544. package/build/dist/Server/Services/HostOwnerRuleEngineService.js +21 -0
  545. package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
  546. package/build/dist/Server/Services/HostOwnerTeamService.js +120 -0
  547. package/build/dist/Server/Services/HostOwnerTeamService.js.map +1 -1
  548. package/build/dist/Server/Services/HostOwnerUserService.js +113 -0
  549. package/build/dist/Server/Services/HostOwnerUserService.js.map +1 -1
  550. package/build/dist/Server/Services/HostService.js +175 -1
  551. package/build/dist/Server/Services/HostService.js.map +1 -1
  552. package/build/dist/Server/Services/IncidentService.js +10 -0
  553. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  554. package/build/dist/Server/Services/Index.js +24 -0
  555. package/build/dist/Server/Services/Index.js.map +1 -1
  556. package/build/dist/Server/Services/KubernetesClusterFeedService.js +89 -0
  557. package/build/dist/Server/Services/KubernetesClusterFeedService.js.map +1 -0
  558. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +27 -3
  559. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
  560. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +21 -0
  561. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
  562. package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js +120 -0
  563. package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js.map +1 -1
  564. package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js +113 -0
  565. package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js.map +1 -1
  566. package/build/dist/Server/Services/KubernetesClusterService.js +177 -1
  567. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  568. package/build/dist/Server/Services/LogAggregationService.js +19 -196
  569. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  570. package/build/dist/Server/Services/MetricAggregationService.js +59 -0
  571. package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
  572. package/build/dist/Server/Services/MonitorService.js +115 -13
  573. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  574. package/build/dist/Server/Services/MonitorTemplateService.js +86 -0
  575. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  576. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +561 -67
  577. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
  578. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +130 -16
  579. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
  580. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +850 -8
  581. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
  582. package/build/dist/Server/Services/NetworkDeviceService.js +594 -5
  583. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  584. package/build/dist/Server/Services/NetworkInterfaceService.js +306 -0
  585. package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -1
  586. package/build/dist/Server/Services/NetworkSiteService.js +408 -47
  587. package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
  588. package/build/dist/Server/Services/PodmanHostFeedService.js +89 -0
  589. package/build/dist/Server/Services/PodmanHostFeedService.js.map +1 -0
  590. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +27 -3
  591. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
  592. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +21 -0
  593. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
  594. package/build/dist/Server/Services/PodmanHostOwnerTeamService.js +120 -0
  595. package/build/dist/Server/Services/PodmanHostOwnerTeamService.js.map +1 -1
  596. package/build/dist/Server/Services/PodmanHostOwnerUserService.js +113 -0
  597. package/build/dist/Server/Services/PodmanHostOwnerUserService.js.map +1 -1
  598. package/build/dist/Server/Services/PodmanHostService.js +177 -1
  599. package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
  600. package/build/dist/Server/Services/ProjectService.js +40 -30
  601. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  602. package/build/dist/Server/Services/ProxmoxClusterFeedService.js +89 -0
  603. package/build/dist/Server/Services/ProxmoxClusterFeedService.js.map +1 -0
  604. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +27 -3
  605. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
  606. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +21 -0
  607. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
  608. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js +120 -0
  609. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js.map +1 -1
  610. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js +113 -0
  611. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js.map +1 -1
  612. package/build/dist/Server/Services/ProxmoxClusterService.js +175 -1
  613. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
  614. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +56 -0
  615. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  616. package/build/dist/Server/Services/ServiceFeedService.js +89 -0
  617. package/build/dist/Server/Services/ServiceFeedService.js.map +1 -0
  618. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +27 -3
  619. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
  620. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +24 -0
  621. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
  622. package/build/dist/Server/Services/ServiceOwnerTeamService.js +120 -0
  623. package/build/dist/Server/Services/ServiceOwnerTeamService.js.map +1 -1
  624. package/build/dist/Server/Services/ServiceOwnerUserService.js +113 -0
  625. package/build/dist/Server/Services/ServiceOwnerUserService.js.map +1 -1
  626. package/build/dist/Server/Services/ServiceService.js +173 -2
  627. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  628. package/build/dist/Server/Services/StatusPageSubscriberService.js +7 -0
  629. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  630. package/build/dist/Server/Services/TelemetryAttributeService.js +9 -3
  631. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  632. package/build/dist/Server/Services/TelemetrySourceMapService.js +265 -0
  633. package/build/dist/Server/Services/TelemetrySourceMapService.js.map +1 -0
  634. package/build/dist/Server/Services/ThreatIntelFeedService.js +157 -0
  635. package/build/dist/Server/Services/ThreatIntelFeedService.js.map +1 -0
  636. package/build/dist/Server/Services/ThreatIntelIndicatorService.js +276 -0
  637. package/build/dist/Server/Services/ThreatIntelIndicatorService.js.map +1 -0
  638. package/build/dist/Server/Services/TraceAggregationService.js +62 -6
  639. package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
  640. package/build/dist/Server/Services/UserService.js +22 -13
  641. package/build/dist/Server/Services/UserService.js.map +1 -1
  642. package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js +120 -0
  643. package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js.map +1 -1
  644. package/build/dist/Server/Services/UserWebhookService.js +11 -2
  645. package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
  646. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +12 -1
  647. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
  648. package/build/dist/Server/Types/Database/AggregateBy.js +2 -0
  649. package/build/dist/Server/Types/Database/AggregateBy.js.map +1 -0
  650. package/build/dist/Server/Types/Database/AggregateResultUtil.js +90 -0
  651. package/build/dist/Server/Types/Database/AggregateResultUtil.js.map +1 -0
  652. package/build/dist/Server/Types/Database/JSONColumnQuery.js +14 -0
  653. package/build/dist/Server/Types/Database/JSONColumnQuery.js.map +1 -1
  654. package/build/dist/Server/Types/Database/QueryHelper.js +42 -0
  655. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  656. package/build/dist/Server/Types/Database/QueryUtil.js +18 -0
  657. package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
  658. package/build/dist/Server/Types/Workflow/Components/API/Utils.js +10 -1
  659. package/build/dist/Server/Types/Workflow/Components/API/Utils.js.map +1 -1
  660. package/build/dist/Server/Types/Workflow/Components/JavaScript.js +8 -0
  661. package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
  662. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +8 -0
  663. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
  664. package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +15 -0
  665. package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js.map +1 -1
  666. package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js +266 -0
  667. package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js.map +1 -0
  668. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +134 -0
  669. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  670. package/build/dist/Server/Utils/DataSource/HttpFetch.js +8 -0
  671. package/build/dist/Server/Utils/DataSource/HttpFetch.js.map +1 -1
  672. package/build/dist/Server/Utils/Database/RelationIdUtil.js +31 -0
  673. package/build/dist/Server/Utils/Database/RelationIdUtil.js.map +1 -1
  674. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js +26 -8
  675. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js.map +1 -1
  676. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js +42 -17
  677. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js.map +1 -1
  678. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +9 -1
  679. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  680. package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js +15 -2
  681. package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js.map +1 -1
  682. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +386 -271
  683. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  684. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +278 -64
  685. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  686. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +469 -350
  687. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  688. package/build/dist/Server/Utils/Monitor/MonitorResource.js +183 -44
  689. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  690. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +46 -3
  691. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
  692. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +18 -91
  693. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  694. package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js +194 -0
  695. package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js.map +1 -0
  696. package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js +332 -0
  697. package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js.map +1 -0
  698. package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js +279 -0
  699. package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js.map +1 -0
  700. package/build/dist/Server/Utils/OnCallNotificationContext.js +415 -0
  701. package/build/dist/Server/Utils/OnCallNotificationContext.js.map +1 -0
  702. package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js +424 -0
  703. package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js.map +1 -0
  704. package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js +108 -0
  705. package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js.map +1 -0
  706. package/build/dist/Server/Utils/Response.js +12 -1
  707. package/build/dist/Server/Utils/Response.js.map +1 -1
  708. package/build/dist/Server/Utils/SSRFProtection.js +160 -58
  709. package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
  710. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js +89 -0
  711. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js.map +1 -0
  712. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +75 -234
  713. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -1
  714. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +41 -16
  715. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
  716. package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js +217 -0
  717. package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js.map +1 -0
  718. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js +103 -0
  719. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js.map +1 -0
  720. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js +168 -0
  721. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js.map +1 -0
  722. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js +527 -0
  723. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js.map +1 -0
  724. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js +376 -0
  725. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js.map +1 -0
  726. package/build/dist/Server/Utils/StartServer.js +70 -44
  727. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  728. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js +3 -0
  729. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js.map +1 -1
  730. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js +327 -0
  731. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js.map +1 -0
  732. package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js +84 -0
  733. package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js.map +1 -0
  734. package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
  735. package/build/dist/Server/Utils/VM/VMRunner.js +10 -1
  736. package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
  737. package/build/dist/Server/Utils/VendorAssets.js +29 -0
  738. package/build/dist/Server/Utils/VendorAssets.js.map +1 -1
  739. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +121 -6
  740. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  741. package/build/dist/Types/API/URL.js +40 -10
  742. package/build/dist/Types/API/URL.js.map +1 -1
  743. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +8 -0
  744. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  745. package/build/dist/Types/BaseDatabase/NotWildcard.js +72 -0
  746. package/build/dist/Types/BaseDatabase/NotWildcard.js.map +1 -0
  747. package/build/dist/Types/BaseDatabase/Wildcard.js +75 -0
  748. package/build/dist/Types/BaseDatabase/Wildcard.js.map +1 -0
  749. package/build/dist/Types/BaseDatabase/WildcardPattern.js +137 -0
  750. package/build/dist/Types/BaseDatabase/WildcardPattern.js.map +1 -0
  751. package/build/dist/Types/Database/DateColumnValue.js +125 -0
  752. package/build/dist/Types/Database/DateColumnValue.js.map +1 -0
  753. package/build/dist/Types/Database/TableColumn.js +18 -2
  754. package/build/dist/Types/Database/TableColumn.js.map +1 -1
  755. package/build/dist/Types/Date.js +31 -0
  756. package/build/dist/Types/Date.js.map +1 -1
  757. package/build/dist/Types/Email/EmailTemplateType.js +1 -0
  758. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  759. package/build/dist/Types/JSON.js +2 -0
  760. package/build/dist/Types/JSON.js.map +1 -1
  761. package/build/dist/Types/Log/LogQueryToFilter.js +111 -108
  762. package/build/dist/Types/Log/LogQueryToFilter.js.map +1 -1
  763. package/build/dist/Types/Monitor/DockerAlertTemplates.js +40 -16
  764. package/build/dist/Types/Monitor/DockerAlertTemplates.js.map +1 -1
  765. package/build/dist/Types/Monitor/HostAlertTemplates.js +29 -7
  766. package/build/dist/Types/Monitor/HostAlertTemplates.js.map +1 -1
  767. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +98 -4
  768. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  769. package/build/dist/Types/Monitor/MonitorStep.js +40 -0
  770. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  771. package/build/dist/Types/Monitor/PodmanAlertTemplates.js +36 -16
  772. package/build/dist/Types/Monitor/PodmanAlertTemplates.js.map +1 -1
  773. package/build/dist/Types/NetworkAutomation/RuleRunResult.js +90 -0
  774. package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
  775. package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js +84 -0
  776. package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js.map +1 -0
  777. package/build/dist/Types/Permission.js +354 -0
  778. package/build/dist/Types/Permission.js.map +1 -1
  779. package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js +100 -0
  780. package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js.map +1 -0
  781. package/build/dist/Types/SerializableObjectDictionary.js +8 -0
  782. package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
  783. package/build/dist/Types/Telemetry/SourceMap.js +9 -0
  784. package/build/dist/Types/Telemetry/SourceMap.js.map +1 -0
  785. package/build/dist/Types/Telemetry/TelemetrySearchQuery.js +661 -0
  786. package/build/dist/Types/Telemetry/TelemetrySearchQuery.js.map +1 -0
  787. package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +12 -1
  788. package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
  789. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js +67 -0
  790. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js.map +1 -1
  791. package/build/dist/UI/Components/Icon/Icon.js +28 -1
  792. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  793. package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js +25 -4
  794. package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js.map +1 -1
  795. package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js +36 -16
  796. package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js.map +1 -1
  797. package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js +14 -2
  798. package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js.map +1 -1
  799. package/build/dist/Utils/Metrics/MetricExplorerUrl.js +54 -9
  800. package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -1
  801. package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js +128 -0
  802. package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js.map +1 -0
  803. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +190 -0
  804. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -0
  805. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +206 -28
  806. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  807. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +14 -7
  808. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -1
  809. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
  810. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +34 -18
  811. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
  812. package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js +163 -0
  813. package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js.map +1 -0
  814. package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js +99 -0
  815. package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js.map +1 -0
  816. package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js +85 -0
  817. package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js.map +1 -0
  818. package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +560 -0
  819. package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js.map +1 -0
  820. package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js +56 -0
  821. package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js.map +1 -0
  822. package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +185 -10
  823. package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -1
  824. package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js +248 -21
  825. package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js.map +1 -1
  826. package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js +255 -0
  827. package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js.map +1 -0
  828. package/build/dist/Utils/Telemetry/CrossSignalScope.js +27 -30
  829. package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
  830. package/package.json +2 -1
  831. package/Tests/Types/Log/LogQueryParser.test.ts +0 -186
  832. package/Types/Log/LogQueryParser.ts +0 -252
  833. package/build/dist/Types/Log/LogQueryParser.js +0 -200
  834. package/build/dist/Types/Log/LogQueryParser.js.map +0 -1
@@ -0,0 +1,560 @@
1
+ import ColumnLength from "../../Types/Database/ColumnLength";
2
+ import ObjectID from "../../Types/ObjectID";
3
+ import SnmpAuthProtocol, { SnmpAuthProtocolUtil, } from "../../Types/Monitor/SnmpMonitor/SnmpAuthProtocol";
4
+ import SnmpPrivProtocol, { SnmpPrivProtocolUtil, } from "../../Types/Monitor/SnmpMonitor/SnmpPrivProtocol";
5
+ import SnmpSecurityLevel, { SnmpSecurityLevelUtil, } from "../../Types/Monitor/SnmpMonitor/SnmpSecurityLevel";
6
+ import SnmpVersion, { SnmpVersionUtil, } from "../../Types/Monitor/SnmpMonitor/SnmpVersion";
7
+ /*
8
+ * The id given to the single config synthesized from a scan's flattened
9
+ * columns — every scan created before `snmpConfigs` existed, and every scan
10
+ * written by an API caller that only knows the old fields.
11
+ *
12
+ * A literal rather than a minted ObjectID because it has to be STABLE across
13
+ * calls: the probe stamps it onto each discovered host, and the import path
14
+ * looks it up again in a separately resolved list, in a different process,
15
+ * possibly days later.
16
+ */
17
+ export const LEGACY_SNMP_CONFIG_ID = "legacy";
18
+ /*
19
+ * How many credential sets one scan may carry.
20
+ *
21
+ * WHAT AN EXTRA SET COSTS
22
+ *
23
+ * The sweep tries sets in order and stops at the first that answers, so a host
24
+ * that ANSWERS costs what it always did. A host that answers nothing costs one
25
+ * full SNMP timeout per set, and the arithmetic for a whole range is
26
+ *
27
+ * hosts x sets x 2s timeout / 32 concurrent probes
28
+ *
29
+ * WHICH DOES NOT FIT THE MAXIMUM TARGET, AND DID NOT BEFORE THIS EXISTED
30
+ *
31
+ * ScanTargetUtil.MAX_SCAN_HOSTS is 32,768, so a full-range sweep costs ~34
32
+ * minutes per set: about 34 minutes at one set, 68 at two, and past the
33
+ * probe's PROBE_DISCOVERY_SCAN_TIMEOUT_IN_MS deadline (90 minutes) at three.
34
+ * Ten sets would be some 5.7 hours. This ceiling therefore CANNOT be chosen to
35
+ * make the worst case fit — a single-credential scan of a maximum target
36
+ * already sits inside a factor of three of the deadline, and always has.
37
+ *
38
+ * WHAT ACTUALLY BOUNDS IT
39
+ *
40
+ * The ICMP pre-sweep. Only hosts that answered ping are SNMP-probed, so the
41
+ * realistic cost is proportional to LIVE hosts, not to the size of the range —
42
+ * and a 32,768-address range with a few hundred live hosts costs seconds per
43
+ * set. Exactly two paths pay the full-range price: a probe that cannot send
44
+ * ICMP at all (no ping binary, no NET_RAW), and the phase-3 fallback, which
45
+ * re-probes every ICMP-silent address when NO set answered anything. Both are
46
+ * already unusual, and the second is itself the "your credentials are wrong"
47
+ * case this feature exists to fix.
48
+ *
49
+ * When a sweep does cross the deadline the probe abandons it and reports the
50
+ * scan Failed with a sentence telling the operator to narrow the target — so
51
+ * the failure is loud and actionable rather than silent. This ceiling is the
52
+ * cheaper guard in front of that: ten is far more than any real segment needs
53
+ * (three or four is the shape of a mixed subnet), and the validation message
54
+ * below says what to do instead of a longer list.
55
+ */
56
+ export const MAX_SNMP_CONFIGS_PER_SCAN = 10;
57
+ /*
58
+ * Matches NetworkDeviceDiscoveryScan.name, which is a ShortText column, for
59
+ * the same reason ScanNameUtil bounds that one: these names are rendered on a
60
+ * single line in a card header and inlined into the probe's log messages. The
61
+ * value itself lives inside a jsonb column with no length of its own, so
62
+ * nothing downstream would reject an essay — which is exactly why it is
63
+ * bounded here.
64
+ */
65
+ export const MAX_SNMP_CONFIG_NAME_LENGTH = ColumnLength.ShortText;
66
+ /*
67
+ * The credential fields are bounded to the columns they are MIRRORED INTO, not
68
+ * to the jsonb column they live in.
69
+ *
70
+ * A jsonb value has no length of its own, so nothing downstream would reject a
71
+ * novel typed into a community string — but the first config of every list is
72
+ * copied onto the flattened columns for probes that predate the list
73
+ * (getMirroredLegacyColumns), and those are a varchar(100) and a varchar(500).
74
+ * Postgres does not truncate an over-long value there, it throws, so without
75
+ * this the save failed on the WRITE with an error naming `snmpCommunityString`
76
+ * — a column that no longer appears on the form — and only when the offending
77
+ * value happened to be in card #1. In any other card it stored fine and became
78
+ * a credential the mirror could never carry.
79
+ *
80
+ * Bounding here makes it one rule, checked on every card, in the words of the
81
+ * field the operator is actually looking at.
82
+ */
83
+ export const MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH = ColumnLength.ShortText;
84
+ export const MAX_SNMP_CONFIG_KEY_LENGTH = ColumnLength.LongText;
85
+ // Matches the UDP port range; see validateSnmpPort in the Dashboard's form.
86
+ export const MINIMUM_SNMP_PORT = 1;
87
+ export const MAXIMUM_SNMP_PORT = 65535;
88
+ export class SnmpScanConfigUtil {
89
+ /*
90
+ * The credential sets this scan tries, in the order it tries them. NEVER
91
+ * empty: a scan with no `snmpConfigs` is a scan configured the old way, and
92
+ * its flattened columns ARE its one credential set.
93
+ *
94
+ * This is the single reader. The probe sweeps with what it returns, the
95
+ * import path resolves a host's credentials out of it, and the form seeds
96
+ * its editor from it — so "what does this scan actually try?" has exactly
97
+ * one answer no matter who asks.
98
+ */
99
+ static resolve(scan) {
100
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
101
+ const stored = Array.isArray(scan.snmpConfigs)
102
+ ? scan.snmpConfigs.filter((config) => {
103
+ return Boolean(config) && typeof config === "object";
104
+ })
105
+ : [];
106
+ if (stored.length > 0) {
107
+ return stored.map((config, index) => {
108
+ return SnmpScanConfigUtil.normalizeConfig(config, index);
109
+ });
110
+ }
111
+ /*
112
+ * The legacy shape. Read straight off the flattened columns rather than
113
+ * migrated into the new column, deliberately: a data migration over every
114
+ * historical scan buys nothing (this synthesizes the identical config on
115
+ * every read) and would have to guess at rows whose columns are half
116
+ * populated.
117
+ */
118
+ return [
119
+ SnmpScanConfigUtil.normalizeConfig({
120
+ id: LEGACY_SNMP_CONFIG_ID,
121
+ snmpVersion: (_a = scan.snmpVersion) !== null && _a !== void 0 ? _a : undefined,
122
+ snmpCommunityString: (_b = scan.snmpCommunityString) !== null && _b !== void 0 ? _b : undefined,
123
+ snmpPort: (_c = scan.snmpPort) !== null && _c !== void 0 ? _c : undefined,
124
+ snmpV3SecurityLevel: (_d = scan.snmpV3SecurityLevel) !== null && _d !== void 0 ? _d : undefined,
125
+ snmpV3Username: (_e = scan.snmpV3Username) !== null && _e !== void 0 ? _e : undefined,
126
+ snmpV3AuthProtocol: (_f = scan.snmpV3AuthProtocol) !== null && _f !== void 0 ? _f : undefined,
127
+ snmpV3AuthKey: (_g = scan.snmpV3AuthKey) !== null && _g !== void 0 ? _g : undefined,
128
+ snmpV3PrivProtocol: (_h = scan.snmpV3PrivProtocol) !== null && _h !== void 0 ? _h : undefined,
129
+ snmpV3PrivKey: (_j = scan.snmpV3PrivKey) !== null && _j !== void 0 ? _j : undefined,
130
+ }, 0),
131
+ ];
132
+ }
133
+ /*
134
+ * The stored list, when the value really is one, or null.
135
+ *
136
+ * The distinction matters at every WRITE site: "this row has its own
137
+ * credential list" and "this row is described by its flattened columns" are
138
+ * two different states, and a jsonb column can arrive holding neither shape
139
+ * (a string, an object, an empty array) from an out-of-band writer. resolve()
140
+ * papers over all of that for readers; this is the version writers need,
141
+ * which answers the question honestly rather than synthesizing something.
142
+ */
143
+ static readStoredList(value) {
144
+ if (!Array.isArray(value) || value.length === 0) {
145
+ return null;
146
+ }
147
+ const configs = value.filter((config) => {
148
+ return Boolean(config) && typeof config === "object";
149
+ });
150
+ return configs.length > 0 ? configs : null;
151
+ }
152
+ /*
153
+ * The config that found a given host, or undefined when the host carries no
154
+ * config id (every result stored before this feature) or names one that is
155
+ * no longer in the list.
156
+ *
157
+ * Callers fall back to the FIRST config rather than to nothing — see
158
+ * `resolveForHost` — because a device imported with the wrong credentials is
159
+ * repairable on the device form, whereas a device imported with none can
160
+ * never poll and gives the operator nothing to correct.
161
+ */
162
+ static findById(configs, id) {
163
+ if (!id) {
164
+ return undefined;
165
+ }
166
+ return configs.find((config) => {
167
+ return config.id === id;
168
+ });
169
+ }
170
+ /*
171
+ * The credentials to import a discovered host with: the config that actually
172
+ * answered it, falling back to the first config in the list.
173
+ *
174
+ * The fallback is what makes results stored before this feature — and
175
+ * ping-only hosts, which no config found — import exactly as they did
176
+ * before, because for a legacy scan the first (and only) config IS the
177
+ * flattened columns.
178
+ */
179
+ static resolveForHost(scan, snmpConfigId) {
180
+ const configs = SnmpScanConfigUtil.resolve(scan);
181
+ return SnmpScanConfigUtil.findById(configs, snmpConfigId) || configs[0];
182
+ }
183
+ /*
184
+ * One config, cleaned up into the shape everything downstream expects:
185
+ * trimmed strings, a numeric port, blanks dropped, and an id guaranteed.
186
+ *
187
+ * The `index` is only used to synthesize an id for a config that has none.
188
+ * That is a repair for out-of-band writers, NOT the normal path — the form
189
+ * mints an id per card and the service's write hooks mint one for anything
190
+ * that arrives without. It is index-derived rather than random so that
191
+ * resolving the same row twice yields the same ids, which matters because
192
+ * this runs independently in the probe and in the importer.
193
+ */
194
+ static normalizeConfig(config, index) {
195
+ const normalized = {
196
+ id: SnmpScanConfigUtil.readString(config.id) || `config-${index + 1}`,
197
+ };
198
+ const name = SnmpScanConfigUtil.readString(config.name);
199
+ if (name !== undefined) {
200
+ normalized.name = name;
201
+ }
202
+ /*
203
+ * Normalized to the stored spelling ("V1"/"V2c"/"V3") rather than left as
204
+ * typed. SnmpVersionUtil.parse accepts either spelling and defaults to
205
+ * V2c, so this both repairs a hand-written "3" and gives the version an
206
+ * unambiguous value for the comparisons the service does on save.
207
+ */
208
+ normalized.snmpVersion = SnmpScanConfigUtil.toStoredVersion(config.snmpVersion);
209
+ const communityString = SnmpScanConfigUtil.readString(config.snmpCommunityString);
210
+ if (communityString !== undefined) {
211
+ normalized.snmpCommunityString = communityString;
212
+ }
213
+ const port = SnmpScanConfigUtil.readPort(config.snmpPort);
214
+ if (port !== undefined) {
215
+ normalized.snmpPort = port;
216
+ }
217
+ /*
218
+ * The v3 block is carried verbatim (beyond trimming). It is NOT dropped
219
+ * for a v1/v2c config, nor is the community dropped for a v3 one: an
220
+ * operator who switches a card's version to try something and switches it
221
+ * back must not silently lose the keys they had typed. The probe reads
222
+ * only what the chosen version needs.
223
+ */
224
+ const v3Fields = [
225
+ ["snmpV3SecurityLevel", config.snmpV3SecurityLevel],
226
+ ["snmpV3Username", config.snmpV3Username],
227
+ ["snmpV3AuthProtocol", config.snmpV3AuthProtocol],
228
+ ["snmpV3AuthKey", config.snmpV3AuthKey],
229
+ ["snmpV3PrivProtocol", config.snmpV3PrivProtocol],
230
+ ["snmpV3PrivKey", config.snmpV3PrivKey],
231
+ ];
232
+ for (const [key, rawValue] of v3Fields) {
233
+ const value = SnmpScanConfigUtil.readString(rawValue);
234
+ if (value !== undefined) {
235
+ normalized[key] = value;
236
+ }
237
+ }
238
+ return normalized;
239
+ }
240
+ /*
241
+ * The stored spelling of a version ("V1" / "V2c" / "V3").
242
+ *
243
+ * Written as an explicit map off the parsed enum rather than by
244
+ * upper-casing the input, so an unrecognized value lands on the same
245
+ * default the probe would have used ("V2c") instead of being stored as
246
+ * itself and disagreeing with the sweep.
247
+ */
248
+ static toStoredVersion(value) {
249
+ if (SnmpVersionUtil.isV3(value)) {
250
+ return "V3";
251
+ }
252
+ return SnmpVersionUtil.parse(value) === SnmpVersion.V1 ? "V1" : "V2c";
253
+ }
254
+ /*
255
+ * A short, non-secret way to refer to one config in running text — a probe
256
+ * log line, a validation message, the caption under a discovered host.
257
+ *
258
+ * NEVER includes a community string or a key. These strings reach places the
259
+ * credential columns deliberately do not (the probe's log, the scan's
260
+ * statusMessage, which is readable by a Viewer), so the label is built from
261
+ * the operator's own name and the version alone.
262
+ */
263
+ static getConfigLabel(config, index) {
264
+ const name = SnmpScanConfigUtil.readString(config.name);
265
+ const version = SnmpScanConfigUtil.toStoredVersion(config.snmpVersion);
266
+ if (name) {
267
+ return `${name} (${version})`;
268
+ }
269
+ return index === undefined
270
+ ? version
271
+ : `SNMP config ${index + 1} (${version})`;
272
+ }
273
+ /*
274
+ * The single validation entry point for the whole list, shared by the
275
+ * Dashboard form and the server's create/update hooks — so the sentence the
276
+ * operator reads on the form is the same sentence the API returns.
277
+ *
278
+ * Returns null when the value is storable, INCLUDING when it is absent: the
279
+ * column is optional and a scan with no list is a scan configured through
280
+ * the flattened columns.
281
+ *
282
+ * `value` is typed unknown for the same reason ScanTargetUtil's target is:
283
+ * the server hook runs before the model's own type checks, so it is the
284
+ * first thing to see whatever the client actually sent — which for a jsonb
285
+ * column really can be a string, a number or an object.
286
+ */
287
+ static getValidationError(value) {
288
+ if (value === undefined || value === null) {
289
+ return null;
290
+ }
291
+ if (!Array.isArray(value)) {
292
+ return "SNMP configs must be a list.";
293
+ }
294
+ if (value.length === 0) {
295
+ /*
296
+ * An empty list is refused rather than quietly treated as "use the
297
+ * flattened columns". The operator got here by deleting every card, and
298
+ * silently falling back to a hidden credential set they can no longer
299
+ * see is the kind of behaviour that produces a scan nobody can explain.
300
+ */
301
+ return "Add at least one SNMP config, or the scan has no credentials to try.";
302
+ }
303
+ if (value.length > MAX_SNMP_CONFIGS_PER_SCAN) {
304
+ return (`A scan can try at most ${MAX_SNMP_CONFIGS_PER_SCAN} SNMP configs. ` +
305
+ `This one has ${value.length}. Every extra config costs another SNMP ` +
306
+ `timeout on each address that answers nothing, so a long list can push ` +
307
+ `a large sweep past the probe's time limit. Split the range into more scans instead.`);
308
+ }
309
+ const seenIds = new Set();
310
+ for (let index = 0; index < value.length; index++) {
311
+ const config = value[index];
312
+ if (!config || typeof config !== "object" || Array.isArray(config)) {
313
+ return `SNMP config ${index + 1} is not valid.`;
314
+ }
315
+ const error = SnmpScanConfigUtil.getConfigValidationError(config, index);
316
+ if (error) {
317
+ return error;
318
+ }
319
+ /*
320
+ * Duplicate ids would make `findById` ambiguous, so a host found by the
321
+ * second of two identically-identified configs could import with the
322
+ * first one's credentials — the precise bug this whole id scheme exists
323
+ * to prevent. Only reachable through an out-of-band write; the form
324
+ * mints one id per card.
325
+ */
326
+ const id = SnmpScanConfigUtil.readString(config.id);
327
+ if (id) {
328
+ if (seenIds.has(id)) {
329
+ return `Two SNMP configs share the id "${id}". Each config needs its own.`;
330
+ }
331
+ seenIds.add(id);
332
+ }
333
+ }
334
+ return null;
335
+ }
336
+ /*
337
+ * One config's rules. Split out so the message can name WHICH card is wrong
338
+ * — with five credential sets on screen, "SNMP v3 Username is required" on
339
+ * its own is not an actionable sentence.
340
+ */
341
+ static getConfigValidationError(config, index) {
342
+ const position = `SNMP config ${index + 1}`;
343
+ for (const [key, label] of [
344
+ ["id", "id"],
345
+ ["name", "name"],
346
+ ["snmpVersion", "version"],
347
+ ["snmpCommunityString", "community string"],
348
+ ["snmpV3SecurityLevel", "v3 security level"],
349
+ ["snmpV3Username", "v3 username"],
350
+ ["snmpV3AuthProtocol", "v3 authentication protocol"],
351
+ ["snmpV3AuthKey", "v3 authentication key"],
352
+ ["snmpV3PrivProtocol", "v3 privacy protocol"],
353
+ ["snmpV3PrivKey", "v3 privacy key"],
354
+ ]) {
355
+ const raw = config[key];
356
+ if (raw !== undefined && raw !== null && typeof raw !== "string") {
357
+ return `${position}: the ${label} must be text.`;
358
+ }
359
+ }
360
+ const name = SnmpScanConfigUtil.readString(config.name);
361
+ if (name !== undefined && name.length > MAX_SNMP_CONFIG_NAME_LENGTH) {
362
+ return (`${position}: a name cannot be longer than ${MAX_SNMP_CONFIG_NAME_LENGTH} ` +
363
+ `characters. This one is ${name.length}.`);
364
+ }
365
+ for (const [key, label, maxLength] of [
366
+ ["id", "id", MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH],
367
+ [
368
+ "snmpCommunityString",
369
+ "community string",
370
+ MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
371
+ ],
372
+ ["snmpV3Username", "v3 username", MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH],
373
+ [
374
+ "snmpV3SecurityLevel",
375
+ "v3 security level",
376
+ MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
377
+ ],
378
+ [
379
+ "snmpV3AuthProtocol",
380
+ "v3 authentication protocol",
381
+ MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
382
+ ],
383
+ [
384
+ "snmpV3PrivProtocol",
385
+ "v3 privacy protocol",
386
+ MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
387
+ ],
388
+ ["snmpV3AuthKey", "v3 authentication key", MAX_SNMP_CONFIG_KEY_LENGTH],
389
+ ["snmpV3PrivKey", "v3 privacy key", MAX_SNMP_CONFIG_KEY_LENGTH],
390
+ ]) {
391
+ const value = SnmpScanConfigUtil.readString(config[key]);
392
+ if (value !== undefined && value.length > maxLength) {
393
+ return (`${position}: the ${label} cannot be longer than ${maxLength} ` +
394
+ `characters. This one is ${value.length}.`);
395
+ }
396
+ }
397
+ const portError = SnmpScanConfigUtil.getPortValidationError(config.snmpPort, position);
398
+ if (portError) {
399
+ return portError;
400
+ }
401
+ if (!SnmpVersionUtil.isV3(config.snmpVersion)) {
402
+ /*
403
+ * v1/v2c. The community string is NOT required here even though the
404
+ * device certainly needs one, because the probe falls back to "public"
405
+ * — which is a real, and very common, answer for discovery. Requiring it
406
+ * would refuse the single most useful default.
407
+ */
408
+ return null;
409
+ }
410
+ if (!SnmpScanConfigUtil.readString(config.snmpV3Username)) {
411
+ return `${position}: SNMP v3 needs a username (the security name configured on the device).`;
412
+ }
413
+ if (SnmpSecurityLevelUtil.isUnrecognized(config.snmpV3SecurityLevel)) {
414
+ return (`${position}: "${config.snmpV3SecurityLevel}" is not a recognized SNMP v3 security level. ` +
415
+ `Expected one of: ${Object.values(SnmpSecurityLevel).join(", ")}.`);
416
+ }
417
+ if (SnmpAuthProtocolUtil.isUnrecognized(config.snmpV3AuthProtocol)) {
418
+ return (`${position}: "${config.snmpV3AuthProtocol}" is not a recognized SNMP v3 authentication protocol. ` +
419
+ `Expected one of: ${Object.values(SnmpAuthProtocol).join(", ")}.`);
420
+ }
421
+ if (SnmpPrivProtocolUtil.isUnrecognized(config.snmpV3PrivProtocol)) {
422
+ return (`${position}: "${config.snmpV3PrivProtocol}" is not a recognized SNMP v3 privacy protocol. ` +
423
+ `Expected one of: ${Object.values(SnmpPrivProtocol).join(", ")}.`);
424
+ }
425
+ const securityLevel = SnmpSecurityLevelUtil.parse(config.snmpV3SecurityLevel);
426
+ /*
427
+ * A level that asks for authentication with nothing to authenticate with
428
+ * does not fail loudly — the session is simply rejected by every device,
429
+ * host after host, and the scan reports zero. Caught here so it is a
430
+ * sentence on the form instead.
431
+ */
432
+ const needsAuth = securityLevel === SnmpSecurityLevel.AuthNoPriv ||
433
+ securityLevel === SnmpSecurityLevel.AuthPriv;
434
+ if (needsAuth && !SnmpScanConfigUtil.readString(config.snmpV3AuthKey)) {
435
+ return `${position}: the "${securityLevel}" security level needs an authentication key.`;
436
+ }
437
+ if (securityLevel === SnmpSecurityLevel.AuthPriv &&
438
+ !SnmpScanConfigUtil.readString(config.snmpV3PrivKey)) {
439
+ return `${position}: the "${SnmpSecurityLevel.AuthPriv}" security level needs a privacy key.`;
440
+ }
441
+ return null;
442
+ }
443
+ /*
444
+ * The port rule, in the same words the single-config form used before this
445
+ * list existed (see validateSnmpPort in the Dashboard's SnmpConfigFormFields
446
+ * — that one still guards the NetworkDevice forms).
447
+ *
448
+ * Checked against the RAW value: a Number form field posts its contents as
449
+ * text, so "161.5" would parseInt to 161, clear both bounds, and then fail
450
+ * the write against a port the probe cannot dial.
451
+ */
452
+ static getPortValidationError(raw, position) {
453
+ if (raw === undefined || raw === null || String(raw).trim() === "") {
454
+ return null;
455
+ }
456
+ const port = Number(String(raw).trim());
457
+ if (!isFinite(port) || !Number.isInteger(port)) {
458
+ return `${position}: the SNMP port must be a whole number.`;
459
+ }
460
+ if (port < MINIMUM_SNMP_PORT || port > MAXIMUM_SNMP_PORT) {
461
+ return `${position}: the SNMP port must be between ${MINIMUM_SNMP_PORT} and ${MAXIMUM_SNMP_PORT}.`;
462
+ }
463
+ return null;
464
+ }
465
+ /*
466
+ * The list as it should be stored: validated by the caller, then normalized
467
+ * and given ids.
468
+ *
469
+ * Returns null for an absent list, which is what the column holds for a scan
470
+ * configured the old way — so a write that never mentions `snmpConfigs`
471
+ * leaves it alone rather than materializing a list nobody asked for.
472
+ */
473
+ static normalizeForStorage(value) {
474
+ if (!Array.isArray(value) || value.length === 0) {
475
+ return null;
476
+ }
477
+ return value.map((config, index) => {
478
+ const normalized = SnmpScanConfigUtil.normalizeConfig((config || {}), index);
479
+ /*
480
+ * Mint a real id for anything that arrived without one. The
481
+ * index-derived id `normalizeConfig` falls back to is fine for READING
482
+ * a row, but storing it would make the id positional — delete the
483
+ * first card and every id below it now names a different credential
484
+ * set, re-pointing results the probe has already stamped.
485
+ */
486
+ if (!SnmpScanConfigUtil.readString(config === null || config === void 0 ? void 0 : config.id)) {
487
+ normalized.id = ObjectID.generate().toString();
488
+ }
489
+ return normalized;
490
+ });
491
+ }
492
+ /*
493
+ * The flattened columns that should accompany a stored list, taken from its
494
+ * FIRST config.
495
+ *
496
+ * This mirroring is a compatibility guarantee, not redundancy. A probe is
497
+ * deployed separately from the server and is routinely a version behind; a
498
+ * probe that has never heard of `snmpConfigs` reads the flattened columns
499
+ * and nothing else. Without the mirror, saving a multi-config scan would
500
+ * blank the credentials of every older probe in the fleet — the scan would
501
+ * run with the column defaults (v2c/"public") and report a confident zero.
502
+ *
503
+ * The FIRST config specifically, because that is the one such a probe would
504
+ * have been given under the old single-config UI, and because the list is
505
+ * ordered by the operator's own preference.
506
+ *
507
+ * Every key is always present, with null for "unset": these values are also
508
+ * what the probe-claim endpoint compares its optimistic-concurrency
509
+ * `expectedData` against, and a key omitted for being empty would read as
510
+ * "unchanged" instead of "cleared".
511
+ */
512
+ static getMirroredLegacyColumns(configs) {
513
+ var _a, _b, _c, _d, _e, _f, _g, _h;
514
+ const first = configs[0];
515
+ return {
516
+ snmpVersion: SnmpScanConfigUtil.toStoredVersion(first === null || first === void 0 ? void 0 : first.snmpVersion),
517
+ snmpCommunityString: (_a = first === null || first === void 0 ? void 0 : first.snmpCommunityString) !== null && _a !== void 0 ? _a : null,
518
+ snmpPort: (_b = first === null || first === void 0 ? void 0 : first.snmpPort) !== null && _b !== void 0 ? _b : null,
519
+ snmpV3SecurityLevel: (_c = first === null || first === void 0 ? void 0 : first.snmpV3SecurityLevel) !== null && _c !== void 0 ? _c : null,
520
+ snmpV3Username: (_d = first === null || first === void 0 ? void 0 : first.snmpV3Username) !== null && _d !== void 0 ? _d : null,
521
+ snmpV3AuthProtocol: (_e = first === null || first === void 0 ? void 0 : first.snmpV3AuthProtocol) !== null && _e !== void 0 ? _e : null,
522
+ snmpV3AuthKey: (_f = first === null || first === void 0 ? void 0 : first.snmpV3AuthKey) !== null && _f !== void 0 ? _f : null,
523
+ snmpV3PrivProtocol: (_g = first === null || first === void 0 ? void 0 : first.snmpV3PrivProtocol) !== null && _g !== void 0 ? _g : null,
524
+ snmpV3PrivKey: (_h = first === null || first === void 0 ? void 0 : first.snmpV3PrivKey) !== null && _h !== void 0 ? _h : null,
525
+ };
526
+ }
527
+ /*
528
+ * A trimmed string, or undefined for anything that is not usable text.
529
+ * Values arrive straight from request JSON, so "not a string" is a real
530
+ * case rather than a defensive one.
531
+ */
532
+ static readString(value) {
533
+ if (typeof value !== "string") {
534
+ return undefined;
535
+ }
536
+ const trimmed = value.trim();
537
+ return trimmed.length > 0 ? trimmed : undefined;
538
+ }
539
+ /*
540
+ * A usable port number, or undefined. Anything out of range is dropped
541
+ * rather than clamped, so the column default (161) applies — callers that
542
+ * want to REFUSE it call getPortValidationError first, exactly like
543
+ * ScanNameUtil.normalize/getValidationError.
544
+ */
545
+ static readPort(value) {
546
+ if (value === undefined || value === null || String(value).trim() === "") {
547
+ return undefined;
548
+ }
549
+ const port = Number(String(value).trim());
550
+ if (!isFinite(port) ||
551
+ !Number.isInteger(port) ||
552
+ port < MINIMUM_SNMP_PORT ||
553
+ port > MAXIMUM_SNMP_PORT) {
554
+ return undefined;
555
+ }
556
+ return port;
557
+ }
558
+ }
559
+ export default SnmpScanConfigUtil;
560
+ //# sourceMappingURL=SnmpScanConfigUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnmpScanConfigUtil.js","sourceRoot":"","sources":["../../../../Utils/NetworkDiscovery/SnmpScanConfigUtil.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mCAAmC,CAAC;AAC7D,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,gBAAgB,EAAE,EACvB,oBAAoB,GACrB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,gBAAgB,EAAE,EACvB,oBAAoB,GACrB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,iBAAiB,EAAE,EACxB,qBAAqB,GACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,WAAW,EAAE,EAClB,eAAe,GAChB,MAAM,6CAA6C,CAAC;AAmGrD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAW,QAAQ,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAW,EAAE,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAW,YAAY,CAAC,SAAS,CAAC;AAE1E;;;;;;;;;;;;;;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QACnB,CAAC;QAED,MAAM,OAAO,GAAW,KAAK,CAAC,IAAI,EAAE,CAAC;QAErC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,QAAQ,CAAC,KAAc;QACpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACzE,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAW,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAElD,IACE,CAAC,QAAQ,CAAC,IAAI,CAAC;YACf,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACvB,IAAI,GAAG,iBAAiB;YACxB,IAAI,GAAG,iBAAiB,EACxB,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import MaterializedPathUtil from "./MaterializedPathUtil";
2
+ export class SiteMaintenanceUtil {
3
+ /*
4
+ * The windows that cover one site: those attached to the site itself, and
5
+ * those attached to any of its ancestors.
6
+ *
7
+ * Ancestry is read off the site's materialized path, whose segments are
8
+ * exactly its ancestor ids followed by its own. A site with no path (never
9
+ * placed in the hierarchy, or mid-repair) still matches windows attached
10
+ * to it directly - `siteId` is checked on its own rather than trusted to
11
+ * appear in the path.
12
+ */
13
+ static windowsCoveringSite(data) {
14
+ const coveringIds = new Set([data.siteId]);
15
+ for (const segment of MaterializedPathUtil.segmentsOf(data.materializedPath)) {
16
+ coveringIds.add(segment);
17
+ }
18
+ const windows = [];
19
+ for (const event of data.events) {
20
+ if (!SiteMaintenanceUtil.intersects(event.siteIds, coveringIds)) {
21
+ continue;
22
+ }
23
+ windows.push({
24
+ startsAt: event.startsAt,
25
+ endsAt: event.endsAt,
26
+ });
27
+ }
28
+ return windows;
29
+ }
30
+ /*
31
+ * The same resolution for many sites at once, keyed by site id. Sites with
32
+ * no covering window are present in the map with an empty array, so a
33
+ * caller can tell "resolved, nothing covers it" from "never looked".
34
+ */
35
+ static windowsBySite(data) {
36
+ const bySite = new Map();
37
+ for (const site of data.sites) {
38
+ bySite.set(site.id, SiteMaintenanceUtil.windowsCoveringSite({
39
+ siteId: site.id,
40
+ materializedPath: site.materializedPath,
41
+ events: data.events,
42
+ }));
43
+ }
44
+ return bySite;
45
+ }
46
+ static intersects(values, set) {
47
+ for (const value of values) {
48
+ if (set.has(value)) {
49
+ return true;
50
+ }
51
+ }
52
+ return false;
53
+ }
54
+ }
55
+ export default SiteMaintenanceUtil;
56
+ //# sourceMappingURL=SiteMaintenanceUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteMaintenanceUtil.js","sourceRoot":"","sources":["../../../../Utils/NetworkSite/SiteMaintenanceUtil.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAkC1D,MAAM,OAAO,mBAAmB;IAC9B;;;;;;;;;OASG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAIjC;QACC,MAAM,WAAW,GAAgB,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhE,KAAK,MAAM,OAAO,IAAI,oBAAoB,CAAC,UAAU,CACnD,IAAI,CAAC,gBAAgB,CACtB,EAAE,CAAC;YACF,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QAED,MAAM,OAAO,GAAiC,EAAE,CAAC;QAEjD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,W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