@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
@@ -11,8 +11,126 @@ import DatabaseService from "./DatabaseService";
11
11
  import Model from "../../Models/DatabaseModels/NetworkDeviceDiscoveryScan";
12
12
  import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
13
13
  import BadDataException from "../../Types/Exception/BadDataException";
14
+ import OneUptimeDate from "../../Types/Date";
15
+ import LIMIT_MAX from "../../Types/Database/LimitMax";
16
+ import ProbeService from "./ProbeService";
17
+ import RelationIdUtil from "../Utils/Database/RelationIdUtil";
14
18
  import ScanTargetUtil from "../../Utils/NetworkDiscovery/ScanTargetUtil";
15
19
  import ScanNameUtil from "../../Utils/NetworkDiscovery/ScanNameUtil";
20
+ import SnmpScanConfigUtil from "../../Utils/NetworkDiscovery/SnmpScanConfigUtil";
21
+ import { getNextScanAt } from "../../Utils/NetworkDiscovery/RescanIntervalUtil";
22
+ import ScanModeUtil from "../../Utils/NetworkDiscovery/ScanModeUtil";
23
+ /*
24
+ * The two spellings a many-to-one reference reaches a hook under: the
25
+ * dashboard posts the relation object, server callers write the FK column.
26
+ * See RelationIdUtil.
27
+ */
28
+ const PROBE_RELATION_KEYS = ["probeId", "probe"];
29
+ /*
30
+ * The columns that decide what the probe sweeps, and what it sweeps with.
31
+ * Changing any of them means the results already on the row describe a sweep
32
+ * that no longer exists — which is what onUpdateSuccess below acts on.
33
+ *
34
+ * `probe` is folded into `probeId` by RelationIdUtil rather than listed here,
35
+ * because the same reference arrives under either name.
36
+ */
37
+ const SWEEP_COLUMNS = [
38
+ "cidr",
39
+ "probeId",
40
+ /*
41
+ * The method as well as the credentials: turning SNMP off (or back on)
42
+ * changes what the sweep asks of every address, so the hosts already on the
43
+ * row answered a different question (issue #3445).
44
+ */
45
+ "isSnmpEnabled",
46
+ /*
47
+ * The ordered credential list. Listed FIRST among the credential columns
48
+ * because it is the one the form actually posts now; the flattened columns
49
+ * below it are mirrored from its first entry (see applySnmpConfigs) and
50
+ * remain here so a scan edited through the API with only those fields still
51
+ * retires its run (issue #3458).
52
+ */
53
+ "snmpConfigs",
54
+ "snmpVersion",
55
+ "snmpCommunityString",
56
+ "snmpPort",
57
+ "snmpV3SecurityLevel",
58
+ "snmpV3Username",
59
+ "snmpV3AuthProtocol",
60
+ "snmpV3AuthKey",
61
+ "snmpV3PrivProtocol",
62
+ "snmpV3PrivKey",
63
+ ];
64
+ /*
65
+ * The numeric columns a form can hand back as an empty string.
66
+ *
67
+ * A Number field posts its value as text (Common/UI/Components/Forms/Fields/
68
+ * FormField.tsx sets it straight from the input), so an operator who clears
69
+ * the box sends "" — and "" into an integer column is a Postgres error, i.e. a
70
+ * 500 where the operator simply meant "leave this unset". Clearing a box was
71
+ * hard to do before these fields were editable, because a create form starts
72
+ * them empty; an edit form starts them filled.
73
+ */
74
+ const NULLABLE_NUMBER_COLUMNS = [
75
+ "snmpPort",
76
+ "rescanIntervalInMinutes",
77
+ ];
78
+ /*
79
+ * The columns that decide WHEN the scan runs again, and nothing else. They
80
+ * never retire a result — they only re-derive nextScanAt.
81
+ */
82
+ /*
83
+ * The single credential set a scan carried before `snmpConfigs` existed. Still
84
+ * written — mirrored from the list's first entry — so a probe that predates
85
+ * the list keeps sweeping with real credentials; see applySnmpConfigs.
86
+ */
87
+ const LEGACY_SNMP_COLUMNS = [
88
+ "snmpVersion",
89
+ "snmpCommunityString",
90
+ "snmpPort",
91
+ "snmpV3SecurityLevel",
92
+ "snmpV3Username",
93
+ "snmpV3AuthProtocol",
94
+ "snmpV3AuthKey",
95
+ "snmpV3PrivProtocol",
96
+ "snmpV3PrivKey",
97
+ ];
98
+ const SCHEDULE_COLUMNS = [
99
+ "isRecurring",
100
+ "rescanIntervalInMinutes",
101
+ ];
102
+ /*
103
+ * Everything a finished run left on the row. Written together, as one
104
+ * statement, to put the scan back in the state a brand-new one is created in:
105
+ * queued, with nothing to show yet.
106
+ *
107
+ * This is the same reset the requeue worker performs on a recurring scan that
108
+ * is due (Workers/Jobs/NetworkDeviceDiscovery/RequeueRecurringScans.ts) with
109
+ * one deliberate difference: the results ARE cleared here. The worker keeps
110
+ * them because a recurring scan re-runs the SAME sweep, so last run's
111
+ * inventory is still the best answer available until the next one lands. A
112
+ * scan whose target or credentials just changed has no such excuse — its
113
+ * hosts came from somewhere the scan no longer points at.
114
+ */
115
+ const RETIRE_RUN_PAYLOAD = {
116
+ status: "Pending",
117
+ /*
118
+ * Not cleared but replaced, because the row has some explaining to do: the
119
+ * operator saved a settings change and the scan's results vanished. The
120
+ * scans list renders this sentence in the results cell of a scan that has
121
+ * not reported (Dashboard Components/NetworkDevice/DiscoveryScanOutcome),
122
+ * which is exactly where the missing results used to be. The claim endpoint
123
+ * clears it the moment a probe picks the scan up.
124
+ */
125
+ statusMessage: "Settings changed, so this scan is queued to run again. The hosts the previous run found have been cleared - they described settings this scan no longer has.",
126
+ startedAt: null,
127
+ completedAt: null,
128
+ nextScanAt: null,
129
+ discoveredDevices: null,
130
+ scannedHostCount: null,
131
+ respondedHostCount: null,
132
+ autoImportProcessedAt: null,
133
+ };
16
134
  export class Service extends DatabaseService {
17
135
  constructor() {
18
136
  super(Model);
@@ -52,18 +170,102 @@ export class Service extends DatabaseService {
52
170
  */
53
171
  createBy.data["name"] =
54
172
  (_a = ScanNameUtil.normalize(createBy.data.name)) !== null && _a !== void 0 ? _a : undefined;
173
+ this.nullEmptyNumbers(createBy.data, Object.keys(createBy.data || {}));
174
+ const createData = createBy.data;
175
+ /*
176
+ * The keys the CLIENT actually supplied, not the keys the object has.
177
+ *
178
+ * `createBy.data` is a model INSTANCE, and every column on it is declared
179
+ * as a class field with `= undefined` — so `Object.keys()` returns all 37
180
+ * column names on a brand-new scan no matter what was posted. Handing that
181
+ * to applySnmpConfigs made its "the payload wins where it speaks for
182
+ * itself" guard fire for all nine flattened columns, every time, and the
183
+ * mirror it protects became a permanent no-op on this path: a scan created
184
+ * through the wizard (which posts `snmpConfigs` and nothing else) stored
185
+ * its credentials in the list while its flattened columns kept the bare
186
+ * Postgres defaults, and every probe a version behind swept it with
187
+ * v2c/"public"/161 and reported the confident zero the mirror exists to
188
+ * prevent.
189
+ *
190
+ * A column the client really did send carries a DEFINED value — including
191
+ * an explicit null, which is a caller clearing it — so testing for
192
+ * definedness is exactly the distinction the guard wanted in the first
193
+ * place. The update path never had this problem: BaseAPI builds a plain
194
+ * partial there, holding only the posted keys.
195
+ */
196
+ const suppliedCreateKeys = Object.keys(createData || {}).filter((key) => {
197
+ return createData[key] !== undefined;
198
+ });
199
+ /*
200
+ * Only for a scan that will actually send SNMP. An ICMP-only scan has its
201
+ * whole SNMP set nulled at the end of this hook, so validating a credential
202
+ * list it is about to discard would refuse the create over a value nothing
203
+ * will ever read — and the wizard posts the field whether or not the step
204
+ * was visible.
205
+ */
206
+ const isSnmpEnabledOnCreate = ScanModeUtil.isSnmpEnabled(createBy.data);
207
+ if (isSnmpEnabledOnCreate) {
208
+ this.applySnmpConfigs(createData, suppliedCreateKeys);
209
+ }
210
+ /*
211
+ * Every scan leaves this hook WITH a credential list, even one created
212
+ * through the flattened columns alone (an API caller, an integration
213
+ * written before this column existed).
214
+ *
215
+ * The invariant is what the Edit dialog depends on. That form's only SNMP
216
+ * control is the list editor, so it selects `snmpConfigs` and nothing else
217
+ * — a scan whose list were NULL would open with an empty card, and saving
218
+ * it would replace the credentials the operator could not see. The reader
219
+ * (SnmpScanConfigUtil.resolve) still falls back to the flattened columns,
220
+ * because rows written out of band exist; this just means the product
221
+ * never creates one.
222
+ */
223
+ if (isSnmpEnabledOnCreate &&
224
+ !SnmpScanConfigUtil.readStoredList(createData["snmpConfigs"])) {
225
+ createData["snmpConfigs"] = SnmpScanConfigUtil.normalizeForStorage(SnmpScanConfigUtil.resolve(createData));
226
+ }
227
+ await this.validateProbeIsUsable({
228
+ data: createBy.data,
229
+ dataKeys: Object.keys(createBy.data || {}),
230
+ projectId: createBy.data.projectId || createBy.props.tenantId,
231
+ });
232
+ /*
233
+ * A scan that will not send SNMP stores no SNMP settings. Enforced here
234
+ * rather than in the form alone, so it holds for a direct API call too —
235
+ * the same reason the scan target is validated on this hook rather than
236
+ * only in the wizard.
237
+ *
238
+ * Read through ScanModeUtil so an ABSENT flag reads as an SNMP scan, which
239
+ * is what every scan created before this column existed was, and what
240
+ * every API client that has never heard of the column means.
241
+ *
242
+ * LAST, after nullEmptyNumbers: that pass turns an empty snmpPort box into
243
+ * null, and this one nulls the whole SNMP set anyway, so running it after
244
+ * means there is exactly one answer for what an ICMP-only row holds.
245
+ */
246
+ if (ScanModeUtil.isIcmpOnly(createBy.data)) {
247
+ this.clearSnmpConfig(createBy.data);
248
+ }
55
249
  return { createBy, carryForward: null };
56
250
  }
57
251
  /*
58
- * The target column is not user-updatable (its ColumnAccessControl grants no
59
- * update permission), but root writers the probe-ingest endpoints, workers,
60
- * migrations bypass that. Validating any update that carries the column
61
- * keeps the invariant true for every writer instead of just the form.
252
+ * Everything that has to be true of an update before it is allowed to land,
253
+ * plus the reading of the row that onUpdateSuccess needs and can no longer
254
+ * take once the write has happened.
255
+ *
256
+ * Two classes of writer arrive here. The form, editing a scan's settings —
257
+ * which is what this hook mostly exists for now (OneUptime issue #3444) —
258
+ * and the server's own root writers: the probe-ingest endpoints, the
259
+ * recurring-scan worker, migrations. The root writers carry only run-state
260
+ * columns and take the cheap exit below without paying for a read.
62
261
  */
63
262
  async onBeforeUpdate(updateBy) {
64
- const dataKeys = Object.keys(updateBy.data || {});
263
+ var _a;
264
+ const data = (updateBy.data ||
265
+ {});
266
+ const dataKeys = Object.keys(data);
65
267
  if (dataKeys.includes("cidr")) {
66
- this.validateScanTarget(updateBy.data["cidr"]);
268
+ this.validateScanTarget(data["cidr"]);
67
269
  }
68
270
  /*
69
271
  * The name IS user-updatable — renaming a scan is the whole point of
@@ -77,11 +279,610 @@ export class Service extends DatabaseService {
77
279
  * would try to write.
78
280
  */
79
281
  if (dataKeys.includes("name")) {
80
- const data = updateBy.data;
81
282
  this.validateScanName(data["name"]);
82
283
  data["name"] = ScanNameUtil.normalize(data["name"]);
83
284
  }
84
- return { updateBy, carryForward: null };
285
+ this.nullEmptyNumbers(data, dataKeys);
286
+ /*
287
+ * Turning the method off clears the credentials in the same statement, so
288
+ * the row can never say "sends no SNMP" while carrying a community string
289
+ * or a v3 passphrase (issue #3445). The edit form posts every declared
290
+ * field regardless of visibility, so the SNMP boxes the operator just hid
291
+ * are still in this payload.
292
+ *
293
+ * Gated on the key being WRITTEN, not merely on the stored value being
294
+ * false: a rename, or the probe-ingest endpoints writing run state, must
295
+ * not reach in and null a column they never mentioned. `data` is mutated
296
+ * in place because onUpdateSuccess is handed back the same updateBy object.
297
+ */
298
+ const isTurningSnmpOff = dataKeys.includes("isSnmpEnabled") && ScanModeUtil.isIcmpOnly(data);
299
+ if (isTurningSnmpOff) {
300
+ this.clearSnmpConfig(data);
301
+ }
302
+ else {
303
+ /*
304
+ * Runs BEFORE isSweepWritten is computed, because it can ADD the
305
+ * flattened SNMP columns to the payload — and those are sweep columns. A
306
+ * mirror written after that flag was read would be invisible to the
307
+ * reconciliation and could hand the probe one credential while the row
308
+ * advertised another.
309
+ *
310
+ * Skipped entirely when the save is turning SNMP OFF, and that is not
311
+ * merely an optimisation: this pass VALIDATES the credential list, and
312
+ * the form posts every declared field whether or not it was visible. An
313
+ * operator who unticked Check SNMP would otherwise be refused their save
314
+ * over a half-finished credential set they had just told the product to
315
+ * stop using. clearSnmpConfig nulls the list along with the flattened
316
+ * columns, so there is nothing left to validate.
317
+ */
318
+ this.applySnmpConfigs(data, dataKeys);
319
+ }
320
+ const dataKeysAfterMirror = Object.keys(data);
321
+ const isSweepWritten = RelationIdUtil.isWritten(dataKeysAfterMirror, PROBE_RELATION_KEYS) ||
322
+ SWEEP_COLUMNS.some((column) => {
323
+ return dataKeysAfterMirror.includes(column);
324
+ });
325
+ const isScheduleWritten = SCHEDULE_COLUMNS.some((column) => {
326
+ return dataKeysAfterMirror.includes(column);
327
+ });
328
+ /*
329
+ * THE CHEAP EXIT, and it is load-bearing rather than an optimisation.
330
+ *
331
+ * Every server-side writer of this model touches run state only — the
332
+ * claim writes status/startedAt/statusMessage, the result ingest writes
333
+ * the results, the requeue worker and the stale-scan reaper write status
334
+ * and timestamps, the unclaimed-diagnosis pass writes statusMessage. None
335
+ * of them carries a sweep or schedule column, so none of them reads a row
336
+ * here, and none can trip the reconciliation below into retiring the very
337
+ * result it is in the middle of storing.
338
+ *
339
+ * `updateBy` is also handed back as the SAME object, which is what
340
+ * Common/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts
341
+ * pins: the claim's hook-free write is only safe while this hook is a
342
+ * pass-through for the claim's payload.
343
+ */
344
+ if (!isSweepWritten && !isScheduleWritten) {
345
+ return { updateBy, carryForward: null };
346
+ }
347
+ /*
348
+ * Scoped by hand, because this hook runs BEFORE
349
+ * ModelPermission.checkUpdateQueryPermissions and BaseAPI hands the
350
+ * service a bare `{_id}` query — so reading with the caller's own query as
351
+ * root, unscoped, would answer "does this id exist, and what are its
352
+ * credentials" for every project on the instance. Same shape as
353
+ * MonitorService.onBeforeUpdate.
354
+ */
355
+ const scans = await this.findBy({
356
+ query: !updateBy.props.isRoot && updateBy.props.tenantId
357
+ ? Object.assign(Object.assign({}, updateBy.query), { projectId: updateBy.props.tenantId }) : updateBy.query,
358
+ select: {
359
+ _id: true,
360
+ projectId: true,
361
+ cidr: true,
362
+ probeId: true,
363
+ snmpConfigs: true,
364
+ snmpVersion: true,
365
+ snmpCommunityString: true,
366
+ snmpPort: true,
367
+ snmpV3SecurityLevel: true,
368
+ snmpV3Username: true,
369
+ snmpV3AuthProtocol: true,
370
+ snmpV3AuthKey: true,
371
+ snmpV3PrivProtocol: true,
372
+ snmpV3PrivKey: true,
373
+ },
374
+ limit: LIMIT_MAX,
375
+ skip: 0,
376
+ props: {
377
+ isRoot: true,
378
+ ignoreHooks: true,
379
+ },
380
+ });
381
+ const plans = {};
382
+ for (const scan of scans) {
383
+ const scanId = (_a = scan._id) === null || _a === void 0 ? void 0 : _a.toString();
384
+ if (!scanId) {
385
+ continue;
386
+ }
387
+ /*
388
+ * Checked per matched scan, because the answer depends on which project
389
+ * the scan belongs to — and read from the row rather than from the
390
+ * caller's tenant, so a root writer is held to the same rule.
391
+ */
392
+ await this.validateProbeIsUsable({
393
+ data: data,
394
+ dataKeys: dataKeysAfterMirror,
395
+ projectId: scan.projectId,
396
+ });
397
+ const isLegacySnmpWritten = this.reconcileLegacySnmpUpdate({
398
+ data: data,
399
+ dataKeys: dataKeysAfterMirror,
400
+ scan: scan,
401
+ });
402
+ plans[scanId] = {
403
+ isSweepChanged: isSweepWritten
404
+ ? this.hasSweepChanged(scan, data, dataKeysAfterMirror)
405
+ : false,
406
+ isScheduleWritten: isScheduleWritten,
407
+ isLegacySnmpWritten: isLegacySnmpWritten,
408
+ };
409
+ }
410
+ return { updateBy, carryForward: plans };
411
+ }
412
+ /*
413
+ * Put the row back into a state that describes itself honestly.
414
+ *
415
+ * Two things can be wrong the moment a settings edit lands, and neither can
416
+ * be fixed in the update itself: the columns that would fix them
417
+ * (status, nextScanAt, the result columns) grant no update permission to
418
+ * anybody, and ModelPermission checks the payload AFTER onBeforeUpdate has
419
+ * run — so a payload carrying them would be refused for the very user doing
420
+ * the editing. They are written here instead, as root, through the same
421
+ * hook-free single-statement path the probe's claim uses.
422
+ *
423
+ * 1. A changed target, probe or credential leaves the row advertising
424
+ * hosts from a sweep that is no longer the sweep this scan describes:
425
+ * "12 of 254 hosts" beside a range it never visited, a Review Results
426
+ * dialog offering them for import under the new credentials, and an
427
+ * auto-import worker willing to create devices from them. The run is
428
+ * retired and the scan re-queued, so the probe simply sweeps again.
429
+ *
430
+ * 2. nextScanAt is derived state that only the result-ingest endpoint used
431
+ * to write. Turning recurrence ON for a scan that had already finished
432
+ * therefore scheduled nothing at all — the column stayed NULL, and the
433
+ * requeue worker's `nextScanAt <= now` is never true of NULL — so the
434
+ * list said "Every 60 min" over a scan that would never run again.
435
+ * Shortening the interval had the same shape of bug: the new cadence
436
+ * only took effect one full old cadence later.
437
+ *
438
+ * A known and deliberate gap: this is a second statement, so between the two
439
+ * writes the row briefly holds the new settings with the old run state. Two
440
+ * things can go wrong inside that window, both of them one database round
441
+ * trip wide. A probe result landing there is stamped onto the new settings;
442
+ * closing that needs the probe to echo a run identity back, which is a probe
443
+ * protocol change. And if this write itself fails while the settings write
444
+ * succeeded, the row keeps the new settings with the old results until the
445
+ * next edit that actually changes something — the operator sees the error,
446
+ * but re-saving the same values will not repair it, because by then nothing
447
+ * has changed.
448
+ *
449
+ * Doing it FIRST instead, in onBeforeUpdate, would be worse rather than
450
+ * better: that hook runs before the row-level gate as well, so a caller
451
+ * whose update is about to be refused would have retired the scan on the way
452
+ * through.
453
+ */
454
+ async onUpdateSuccess(onUpdate, updatedItemIds) {
455
+ const plans = onUpdate.carryForward || null;
456
+ if (!plans) {
457
+ return onUpdate;
458
+ }
459
+ const now = OneUptimeDate.getCurrentDate();
460
+ for (const itemId of updatedItemIds) {
461
+ const plan = plans[itemId.toString()];
462
+ if (!plan) {
463
+ continue;
464
+ }
465
+ /*
466
+ * Nothing to do at all: the save named a setting but changed none of
467
+ * them, and never mentioned the schedule.
468
+ */
469
+ if (!plan.isSweepChanged &&
470
+ !plan.isScheduleWritten &&
471
+ !plan.isLegacySnmpWritten) {
472
+ continue;
473
+ }
474
+ /*
475
+ * The row as it stands now that the update has landed. Read rather than
476
+ * predicted from the payload: the schedule columns are what the next run
477
+ * is derived from, and reading them back means the derivation sees the
478
+ * values the DATABASE holds — properly typed — instead of whatever
479
+ * shape the request happened to send them in.
480
+ */
481
+ const scan = await this.findOneById({
482
+ id: itemId,
483
+ select: {
484
+ status: true,
485
+ isRecurring: true,
486
+ rescanIntervalInMinutes: true,
487
+ completedAt: true,
488
+ nextScanAt: true,
489
+ /*
490
+ * For the legacy-write rebuild below. Read back rather than taken
491
+ * from the payload, so the list is built from the values the
492
+ * database actually holds — the payload may have named only some of
493
+ * them, and the rest are whatever the row already had.
494
+ */
495
+ isSnmpEnabled: true,
496
+ snmpVersion: true,
497
+ snmpCommunityString: true,
498
+ snmpPort: true,
499
+ snmpV3SecurityLevel: true,
500
+ snmpV3Username: true,
501
+ snmpV3AuthProtocol: true,
502
+ snmpV3AuthKey: true,
503
+ snmpV3PrivProtocol: true,
504
+ snmpV3PrivKey: true,
505
+ },
506
+ props: {
507
+ isRoot: true,
508
+ ignoreHooks: true,
509
+ },
510
+ });
511
+ // Hard-deleted between the write and this read. Nothing to reconcile.
512
+ if (!scan) {
513
+ continue;
514
+ }
515
+ const reconcile = plan.isSweepChanged
516
+ ? Object.assign({}, RETIRE_RUN_PAYLOAD) : {};
517
+ /*
518
+ * The save came through the old single-credential API, so put the list
519
+ * back in step with the flattened columns it just wrote.
520
+ *
521
+ * Rebuilt from the ROW, which is why it happens here: one update payload
522
+ * is shared by every row the query matched, and the values to rebuild
523
+ * from are per row. resolve() over a row with no list synthesizes exactly
524
+ * one config from those columns, which is the whole of a
525
+ * single-credential scan — reconcileLegacySnmpUpdate has already refused
526
+ * the case where the row has more.
527
+ *
528
+ * An ICMP-only scan is skipped: it stores no SNMP settings at all, and
529
+ * materializing a list of the nulls it holds would be a credential set
530
+ * that says nothing, on a scan that sends nothing.
531
+ */
532
+ if (plan.isLegacySnmpWritten && ScanModeUtil.isSnmpEnabled(scan)) {
533
+ reconcile["snmpConfigs"] = SnmpScanConfigUtil.normalizeForStorage(SnmpScanConfigUtil.resolve(scan));
534
+ }
535
+ /*
536
+ * Only a save that changed the sweep or asked about the schedule gets
537
+ * its next run re-derived — and the gate has to be stated here rather
538
+ * than left to the early `continue` above.
539
+ *
540
+ * It used to be left to it: that exit returned unless the sweep had
541
+ * changed or the schedule was written, so nothing else could reach this.
542
+ * Adding the credential-list rebuild to that condition opened a third
543
+ * way in, and a save through the flattened columns alone — which asks
544
+ * about neither — began re-deriving the column. On a recurring scan the
545
+ * stale-scan reaper had made due immediately (nextScanAt pulled back to
546
+ * completedAt so the requeue worker picks it up now), that pushed the
547
+ * recovery a full cadence into the future for a save that changed
548
+ * nothing about when the scan should run.
549
+ *
550
+ * For a retired run the state to derive from is the queued one written
551
+ * just above, not the finished one the row still shows.
552
+ */
553
+ if (plan.isSweepChanged || plan.isScheduleWritten) {
554
+ const nextScanAt = getNextScanAt({
555
+ isRecurring: scan.isRecurring,
556
+ rescanIntervalInMinutes: scan.rescanIntervalInMinutes,
557
+ status: plan.isSweepChanged ? "Pending" : scan.status,
558
+ completedAt: plan.isSweepChanged ? null : scan.completedAt,
559
+ }, now);
560
+ if (!this.isSameMoment(nextScanAt, scan.nextScanAt)) {
561
+ reconcile["nextScanAt"] = nextScanAt;
562
+ }
563
+ }
564
+ if (Object.keys(reconcile).length === 0) {
565
+ continue;
566
+ }
567
+ await this.updateColumnsByIdWithoutHooks({
568
+ id: itemId,
569
+ // Cast: the model's JSON column makes DeepPartial recursion blow up.
570
+ data: reconcile,
571
+ });
572
+ }
573
+ return onUpdate;
574
+ }
575
+ /*
576
+ * Whether this update actually changes what the probe would sweep.
577
+ *
578
+ * VALUE comparison, never key presence: ModelForm posts every field it
579
+ * declares on every save, dirty or not, so an operator who opened Edit and
580
+ * pressed Save without typing sends the whole sweep back verbatim. Keyed on
581
+ * presence, that would retire a good result set on every no-op save.
582
+ */
583
+ hasSweepChanged(scan, data, dataKeys) {
584
+ var _a;
585
+ if (RelationIdUtil.isWritten(dataKeys, PROBE_RELATION_KEYS)) {
586
+ const probeId = RelationIdUtil.read(data, PROBE_RELATION_KEYS);
587
+ if ((probeId === null || probeId === void 0 ? void 0 : probeId.toString()) !== ((_a = scan.probeId) === null || _a === void 0 ? void 0 : _a.toString())) {
588
+ return true;
589
+ }
590
+ }
591
+ for (const column of SWEEP_COLUMNS) {
592
+ if (column === "probeId" || !dataKeys.includes(column)) {
593
+ continue;
594
+ }
595
+ if (this.normalizeSweepValue(data[column]) !==
596
+ this.normalizeSweepValue(scan[column])) {
597
+ return true;
598
+ }
599
+ }
600
+ return false;
601
+ }
602
+ /*
603
+ * The probe a scan is pointed at has to be one this project may actually use
604
+ * — its own, or a global one.
605
+ *
606
+ * The scan is dispatched by probe id alone: the claim endpoint hands a
607
+ * Pending scan to whichever probe authenticates as that id, with no project
608
+ * check of its own, and the results are written back onto this row. So a
609
+ * scan pointing at ANOTHER project's probe is a scan that makes that
610
+ * project's probe sweep its own network and report the hosts it finds into
611
+ * this one. The ids are not guessable and the probe list is tenant-scoped,
612
+ * so this is a lock rather than a repair — but it is the lock that has to
613
+ * exist now that the column can be re-pointed after creation, and it is
614
+ * applied on create for the same reason.
615
+ *
616
+ * A probe with no project is a global probe and is available to everyone.
617
+ */
618
+ async validateProbeIsUsable(input) {
619
+ if (!RelationIdUtil.isWritten(input.dataKeys, PROBE_RELATION_KEYS)) {
620
+ return;
621
+ }
622
+ /*
623
+ * readConsistent, not read: a payload that points the FK column and the
624
+ * relation object at two different probes must be refused rather than
625
+ * validated against whichever one TypeORM happens to persist.
626
+ */
627
+ const probeId = RelationIdUtil.readConsistent(input.data, PROBE_RELATION_KEYS, "Probe");
628
+ /*
629
+ * probeId is NOT NULL, so a payload that names the probe and resolves to
630
+ * nothing is an operator clearing the box. Without this it reaches
631
+ * Postgres as a constraint violation — a 500 where the truthful answer is
632
+ * a 400 with a sentence in it.
633
+ */
634
+ if (!probeId) {
635
+ throw new BadDataException("A discovery scan needs a probe to run it. Pick the probe that can reach this address range.");
636
+ }
637
+ // Nothing to compare against; the write itself is still tenant-checked.
638
+ if (!input.projectId) {
639
+ return;
640
+ }
641
+ const probe = await ProbeService.findOneById({
642
+ id: probeId,
643
+ select: {
644
+ _id: true,
645
+ projectId: true,
646
+ },
647
+ props: {
648
+ isRoot: true,
649
+ },
650
+ });
651
+ if (!probe) {
652
+ throw new BadDataException("That probe could not be found. Pick a probe that can reach this address range.");
653
+ }
654
+ if (probe.projectId &&
655
+ probe.projectId.toString() !== input.projectId.toString()) {
656
+ throw new BadDataException("That probe belongs to another project. Pick one of this project's probes, or a global probe.");
657
+ }
658
+ }
659
+ /*
660
+ * An emptied number box means "unset", not "the empty string".
661
+ *
662
+ * Written in place, like the name normalization above, so the value the rest
663
+ * of the pipeline sees is the value that will be stored.
664
+ */
665
+ nullEmptyNumbers(data, dataKeys) {
666
+ for (const column of NULLABLE_NUMBER_COLUMNS) {
667
+ if (!dataKeys.includes(column)) {
668
+ continue;
669
+ }
670
+ const value = data[column];
671
+ if (typeof value === "string" && value.trim() === "") {
672
+ data[column] = null;
673
+ }
674
+ }
675
+ }
676
+ /*
677
+ * A sweep column's value as a comparable string.
678
+ *
679
+ * An empty box and an unset column are the SAME setting and must compare
680
+ * equal, or a V3 scan — whose community string is NULL in the database and
681
+ * "" in the form — would read as changed on the first save and retire its
682
+ * own results. Numbers are compared as numbers so the port arriving as the
683
+ * string "161" from a form field does not read as a change either.
684
+ */
685
+ normalizeSweepValue(value) {
686
+ if (value === undefined || value === null || value === "") {
687
+ return "";
688
+ }
689
+ if (typeof value === "number") {
690
+ return String(value);
691
+ }
692
+ if (typeof value === "string") {
693
+ return value.trim();
694
+ }
695
+ /*
696
+ * The credential LIST, and the reason the fall-through below cannot be
697
+ * left to speak for it: `String([{ ... }])` is "[object Object]" for every
698
+ * possible list, so two completely different sets of credentials would
699
+ * compare equal and a save that swapped them would leave the row
700
+ * advertising hosts found with the old ones.
701
+ *
702
+ * Compared through the same normalizer the probe and the importer read the
703
+ * column with, so the comparison is of the credentials that will actually
704
+ * be USED — an empty box against an unset field, "161" against 161, "V3"
705
+ * against "3" — rather than of the shape the form happened to post. That
706
+ * is what stops a no-op Save (ModelForm posts every field, dirty or not)
707
+ * from retiring a good result set on every visit to the Edit dialog.
708
+ *
709
+ * An empty array normalizes to "" — the same answer as an unset column —
710
+ * because both mean "this scan has no list of its own". A list is refused
711
+ * as empty at validation time anyway; this only decides whether the two
712
+ * shapes read as a CHANGE.
713
+ */
714
+ if (Array.isArray(value)) {
715
+ /*
716
+ * Compared on what the PROBE would do differently, which is neither the
717
+ * whole stored object nor a naive stringify of it. Two fields are
718
+ * deliberately excluded, and each one caused a real bug:
719
+ *
720
+ * - `name` is the operator's label. It reaches a log line and the
721
+ * scan's status message and nothing else — never the wire. Including
722
+ * it meant renaming a credential card retired the run and deleted
723
+ * every host the scan had found, for a change that alters nothing
724
+ * about the sweep.
725
+ * - `id` is server-minted bookkeeping. applySnmpConfigs runs BEFORE
726
+ * this comparison and mints a fresh ObjectID for any entry that
727
+ * arrived without one, so a client that does not echo ids back — an
728
+ * API caller, a reconciler re-applying the same desired state — sent
729
+ * a byte-identical body twice and had the second read as a credential
730
+ * change. A scan under such a reconciler could never hold a result
731
+ * set at all.
732
+ *
733
+ * What survives is exactly the session parameters: version, community,
734
+ * port and the v3 block, in the operator's order. A REORDER still reads
735
+ * as a change, because order decides which credential each host is tried
736
+ * with first.
737
+ *
738
+ * Through resolve(), NOT normalizeForStorage(): the latter mints ids, and
739
+ * a comparison has to be a pure function of its input.
740
+ */
741
+ const configs = SnmpScanConfigUtil.resolve({
742
+ snmpConfigs: value,
743
+ });
744
+ const sweepShape = configs.map((config) => {
745
+ const sweepFields = Object.assign({}, config);
746
+ delete sweepFields["id"];
747
+ delete sweepFields["name"];
748
+ return sweepFields;
749
+ });
750
+ return value.length === 0 ? "" : JSON.stringify(sweepShape);
751
+ }
752
+ return String(value);
753
+ }
754
+ /*
755
+ * An update written through the FLATTENED columns alone, on a scan that has
756
+ * a credential list.
757
+ *
758
+ * The list shadows those columns — SnmpScanConfigUtil.resolve reads it and
759
+ * ignores them — so such a write would land in the database and change
760
+ * nothing about the sweep, which is the worst of both outcomes: the caller
761
+ * is told it succeeded and the scan keeps the credentials it had.
762
+ *
763
+ * There are exactly two honest answers, and which one applies depends only
764
+ * on how many configs the row holds:
765
+ *
766
+ * - ONE (or none): the scan is single-credential, so the flattened columns
767
+ * can describe it completely. This returns true and onUpdateSuccess
768
+ * REBUILDS the list from the row's own flattened columns once the write
769
+ * has landed — the behaviour this API had before the list existed, with
770
+ * the list kept in step rather than discarded.
771
+ * - MORE THAN ONE: there is no flattened column set that could express the
772
+ * scan, and picking one config to overwrite would silently discard the
773
+ * others. Refused, naming the field to use instead.
774
+ *
775
+ * It does NOT null the column, which is what it used to do. A NULL list is
776
+ * readable — SnmpScanConfigUtil.resolve falls back to the flattened columns
777
+ * — but it is not EDITABLE: the Edit dialog's only SNMP control is the list
778
+ * editor, so it selects `snmpConfigs` alone, and a NULL there opened a blank
779
+ * card over a scan that had real credentials. Saving that card then mirrored
780
+ * its emptiness back over all nine columns and wiped them. The invariant
781
+ * "every scan the product has touched has a list" is what makes that
782
+ * unreachable, and this is the third place that maintains it, after the
783
+ * backfill migration and onBeforeCreate.
784
+ */
785
+ reconcileLegacySnmpUpdate(input) {
786
+ if (input.dataKeys.includes("snmpConfigs")) {
787
+ return false;
788
+ }
789
+ const isLegacyColumnWritten = LEGACY_SNMP_COLUMNS.some((column) => {
790
+ return input.dataKeys.includes(column);
791
+ });
792
+ if (!isLegacyColumnWritten) {
793
+ return false;
794
+ }
795
+ const stored = SnmpScanConfigUtil.readStoredList(input.scan.snmpConfigs);
796
+ if (stored && stored.length > 1) {
797
+ throw new BadDataException(`This scan tries ${stored.length} SNMP configs, which the single snmp* fields cannot describe. ` +
798
+ `Send the whole "snmpConfigs" list instead.`);
799
+ }
800
+ return true;
801
+ }
802
+ /*
803
+ * The scan's ordered SNMP credential list: validated, normalized, and
804
+ * mirrored into the flattened columns.
805
+ *
806
+ * Called from BOTH write hooks, and a no-op for a payload that does not
807
+ * mention `snmpConfigs` — which is every server-side writer of this model
808
+ * (the probe claim, the result ingest, the requeue worker) and every API
809
+ * caller still using the flattened columns alone.
810
+ *
811
+ * THE MIRROR IS THE POINT. A probe is deployed separately from the server
812
+ * and is routinely a version behind, and a probe that has never heard of
813
+ * `snmpConfigs` reads the flattened columns and nothing else. Without this,
814
+ * saving a multi-config scan would leave those columns holding whatever the
815
+ * scan was created with — or, for a scan created after this feature, the
816
+ * bare column defaults — and every older probe in the fleet would sweep with
817
+ * "public"/v2c and report a confident zero. Mirroring the FIRST config keeps
818
+ * such a probe doing exactly what it would have done under the old
819
+ * single-config UI.
820
+ */
821
+ applySnmpConfigs(data, dataKeys) {
822
+ var _a;
823
+ if (!dataKeys.includes("snmpConfigs")) {
824
+ return;
825
+ }
826
+ const raw = data["snmpConfigs"];
827
+ /*
828
+ * An absent list is not the same as a bad one. The edit form always posts
829
+ * the key, so a null/empty value here is an API caller clearing the column
830
+ * — which puts the scan back on its flattened columns, exactly where a
831
+ * scan created before this feature already is. Nothing is mirrored in that
832
+ * case: there is no first config to mirror from, and overwriting the
833
+ * flattened columns with defaults would erase the credentials that clearing
834
+ * the list just fell back to.
835
+ */
836
+ if (raw === undefined || raw === null || raw === "") {
837
+ data["snmpConfigs"] = null;
838
+ return;
839
+ }
840
+ const validationError = SnmpScanConfigUtil.getValidationError(raw);
841
+ if (validationError) {
842
+ throw new BadDataException(validationError);
843
+ }
844
+ const configs = SnmpScanConfigUtil.normalizeForStorage(raw);
845
+ data["snmpConfigs"] = configs;
846
+ if (!configs || configs.length === 0) {
847
+ return;
848
+ }
849
+ const mirrored = SnmpScanConfigUtil.getMirroredLegacyColumns(configs);
850
+ for (const column of Object.keys(mirrored)) {
851
+ /*
852
+ * The payload wins where it speaks for itself. An API caller that sends
853
+ * BOTH the list and a flattened column meant the flattened one, and
854
+ * silently overwriting it would make the two disagree in a way only the
855
+ * database could reveal.
856
+ */
857
+ if (dataKeys.includes(column)) {
858
+ continue;
859
+ }
860
+ data[column] = (_a = mirrored[column]) !== null && _a !== void 0 ? _a : null;
861
+ }
862
+ }
863
+ /*
864
+ * Two nullable timestamps, compared by the instant they name. The stored
865
+ * value comes back from Postgres and the derived one is built here, so a
866
+ * strict equality between the two objects is never true even when the moment
867
+ * is identical, and every no-op save would write the column again.
868
+ */
869
+ isSameMoment(left, right) {
870
+ if (!left || !right) {
871
+ return !left && !right;
872
+ }
873
+ return (OneUptimeDate.fromString(left).getTime() ===
874
+ OneUptimeDate.fromString(right).getTime());
875
+ }
876
+ /*
877
+ * Written through a cast for the same reason the name normalize above is:
878
+ * the properties are typed `string | number | undefined` and
879
+ * exactOptionalPropertyTypes forbids assigning null to them directly.
880
+ */
881
+ clearSnmpConfig(data) {
882
+ const record = data;
883
+ for (const column of Service.SNMP_CONFIG_COLUMNS) {
884
+ record[column] = null;
885
+ }
85
886
  }
86
887
  /*
87
888
  * The value is passed through UNTOUCHED. It arrives straight from the
@@ -114,6 +915,41 @@ export class Service extends DatabaseService {
114
915
  }
115
916
  }
116
917
  }
918
+ /*
919
+ * The columns an ICMP-only scan must not carry (OneUptime issue #3445).
920
+ *
921
+ * Hiding the fields in the form is not enough on its own, for two separate
922
+ * reasons. ModelForm builds the request body out of every DECLARED field
923
+ * without checking whether it was visible, so a v3 passphrase typed before
924
+ * the operator changed their mind is still posted — and TypeORM OMITS an
925
+ * undefined property from the INSERT, at which point Postgres fills in the
926
+ * column defaults, which for this table are 'V2c' and 161. Either way the
927
+ * stored row claims to be an SNMP v2c scan on port 161 while its own method
928
+ * column says it sends no SNMP at all.
929
+ *
930
+ * An explicit null is the only value that beats a column default, which is
931
+ * why these are nulled rather than deleted.
932
+ */
933
+ Service.SNMP_CONFIG_COLUMNS = [
934
+ /*
935
+ * The credential LIST belongs here as much as the flattened columns do,
936
+ * and more urgently: it is where the community strings and v3 passphrases
937
+ * of a multi-credential scan actually live (issue #3458). Clearing the
938
+ * nine below while leaving this behind would store an ICMP-only scan whose
939
+ * own method column says it sends no SNMP, carrying every credential the
940
+ * operator had typed.
941
+ */
942
+ "snmpConfigs",
943
+ "snmpVersion",
944
+ "snmpCommunityString",
945
+ "snmpPort",
946
+ "snmpV3SecurityLevel",
947
+ "snmpV3Username",
948
+ "snmpV3AuthProtocol",
949
+ "snmpV3AuthKey",
950
+ "snmpV3PrivProtocol",
951
+ "snmpV3PrivKey",
952
+ ];
117
953
  __decorate([
118
954
  CaptureSpan(),
119
955
  __metadata("design:type", Function),
@@ -126,5 +962,11 @@ __decorate([
126
962
  __metadata("design:paramtypes", [Object]),
127
963
  __metadata("design:returntype", Promise)
128
964
  ], Service.prototype, "onBeforeUpdate", null);
965
+ __decorate([
966
+ CaptureSpan(),
967
+ __metadata("design:type", Function),
968
+ __metadata("design:paramtypes", [Object, Array]),
969
+ __metadata("design:returntype", Promise)
970
+ ], Service.prototype, "onUpdateSuccess", null);
129
971
  export default new Service();
130
972
  //# sourceMappingURL=NetworkDeviceDiscoveryScanService.js.map