@oneuptime/common 12.0.14 → 12.0.16

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 (853) hide show
  1. package/Models/AnalyticsModels/Index.ts +10 -0
  2. package/Models/AnalyticsModels/LogCountBaseline.ts +174 -0
  3. package/Models/AnalyticsModels/SecurityEvent.ts +794 -0
  4. package/Models/AnalyticsModels/Span.ts +29 -1
  5. package/Models/AnalyticsModels/SpanCountBaseline.ts +198 -0
  6. package/Models/DatabaseModels/Alert.ts +42 -0
  7. package/Models/DatabaseModels/AlertMeasurement.ts +1114 -0
  8. package/Models/DatabaseModels/AlertMeasurementValue.ts +501 -0
  9. package/Models/DatabaseModels/AlertStateTimeline.ts +10 -2
  10. package/Models/DatabaseModels/BillingPaymentMethod.ts +8 -10
  11. package/Models/DatabaseModels/DetectionRule.ts +487 -0
  12. package/Models/DatabaseModels/GlobalOidc.ts +20 -0
  13. package/Models/DatabaseModels/GlobalSso.ts +20 -0
  14. package/Models/DatabaseModels/GoogleSecOpsConnection.ts +382 -0
  15. package/Models/DatabaseModels/Incident.ts +42 -0
  16. package/Models/DatabaseModels/IncidentMeasurement.ts +1114 -0
  17. package/Models/DatabaseModels/IncidentMeasurementValue.ts +501 -0
  18. package/Models/DatabaseModels/IncidentStateTimeline.ts +10 -2
  19. package/Models/DatabaseModels/IncomingCallPolicyLabelRule.ts +36 -0
  20. package/Models/DatabaseModels/IncomingCallPolicyOwnerRule.ts +42 -0
  21. package/Models/DatabaseModels/Index.ts +20 -0
  22. package/Models/DatabaseModels/Label.ts +11 -0
  23. package/Models/DatabaseModels/LlmCostBudget.ts +655 -0
  24. package/Models/DatabaseModels/LlmModelPrice.ts +481 -0
  25. package/Models/DatabaseModels/LogSavedView.ts +87 -0
  26. package/Models/DatabaseModels/MarketingConversion.ts +222 -10
  27. package/Models/DatabaseModels/MetricSavedView.ts +59 -0
  28. package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +46 -0
  29. package/Models/DatabaseModels/OnCallDutyPolicyLabelRule.ts +36 -0
  30. package/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.ts +42 -0
  31. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.ts +36 -0
  32. package/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.ts +42 -0
  33. package/Models/DatabaseModels/Probe.ts +21 -0
  34. package/Models/DatabaseModels/RunbookLabelRule.ts +36 -0
  35. package/Models/DatabaseModels/RunbookOwnerRule.ts +42 -0
  36. package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.ts +1104 -0
  37. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.ts +491 -0
  38. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +10 -2
  39. package/Models/DatabaseModels/StatusPage.ts +7 -4
  40. package/Models/DatabaseModels/StatusPageLabelRule.ts +36 -0
  41. package/Models/DatabaseModels/StatusPageOwnerRule.ts +42 -0
  42. package/Models/DatabaseModels/TableView.ts +15 -0
  43. package/Models/DatabaseModels/Team.ts +13 -0
  44. package/Models/DatabaseModels/TeamMember.ts +8 -0
  45. package/Models/DatabaseModels/TraceSavedView.ts +52 -0
  46. package/Models/DatabaseModels/WorkflowLabelRule.ts +36 -0
  47. package/Models/DatabaseModels/WorkflowOwnerRule.ts +42 -0
  48. package/Server/API/StatusPageAPI.ts +29 -4
  49. package/Server/API/TelemetryAPI.ts +252 -6
  50. package/Server/API/UserAPI.ts +88 -0
  51. package/Server/EnvironmentConfig.ts +43 -1
  52. package/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.ts +19 -0
  53. package/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.ts +40 -0
  54. package/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.ts +88 -0
  55. package/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.ts +457 -0
  56. package/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.ts +97 -0
  57. package/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.ts +45 -0
  58. package/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.ts +105 -0
  59. package/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.ts +77 -0
  60. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +16 -0
  61. package/Server/Middleware/IdentityRateLimit.ts +672 -0
  62. package/Server/Middleware/SlackAuthorization.ts +43 -6
  63. package/Server/Middleware/UserAuthorization.ts +236 -26
  64. package/Server/Middleware/WhatsAppAuthorization.ts +43 -3
  65. package/Server/Services/AccessTokenService.ts +15 -2
  66. package/Server/Services/AlertMeasurementService.ts +302 -0
  67. package/Server/Services/AlertMeasurementValueService.ts +508 -0
  68. package/Server/Services/AlertService.ts +50 -0
  69. package/Server/Services/AlertStateTimelineService.ts +54 -0
  70. package/Server/Services/DetectionRuleService.ts +74 -0
  71. package/Server/Services/GlobalOidcProjectService.ts +126 -1
  72. package/Server/Services/GlobalOidcService.ts +132 -0
  73. package/Server/Services/GlobalSsoProjectService.ts +126 -1
  74. package/Server/Services/GlobalSsoService.ts +132 -0
  75. package/Server/Services/GoogleSecOpsConnectionService.ts +89 -0
  76. package/Server/Services/IncidentMeasurementService.ts +304 -0
  77. package/Server/Services/IncidentMeasurementValueService.ts +523 -0
  78. package/Server/Services/IncidentService.ts +51 -0
  79. package/Server/Services/IncidentStateTimelineService.ts +54 -0
  80. package/Server/Services/Index.ts +30 -0
  81. package/Server/Services/LlmCostBudgetService.ts +93 -0
  82. package/Server/Services/LlmModelPriceService.ts +202 -0
  83. package/Server/Services/LogAggregationService.ts +1106 -2
  84. package/Server/Services/LogCountBaselineService.ts +163 -0
  85. package/Server/Services/MutableMetricService.ts +30 -9
  86. package/Server/Services/ScheduledMaintenanceMeasurementService.ts +311 -0
  87. package/Server/Services/ScheduledMaintenanceMeasurementValueService.ts +546 -0
  88. package/Server/Services/ScheduledMaintenanceService.ts +53 -0
  89. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +188 -1
  90. package/Server/Services/SecurityEventService.ts +104 -0
  91. package/Server/Services/SpanCountBaselineService.ts +173 -0
  92. package/Server/Services/StatusPageService.ts +4 -3
  93. package/Server/Services/TelemetryUsageBillingService.ts +17 -2
  94. package/Server/Services/UserEmailService.ts +4 -4
  95. package/Server/Services/UserService.ts +284 -51
  96. package/Server/Services/UserTotpAuthService.ts +27 -86
  97. package/Server/Services/UserWebAuthnService.ts +26 -86
  98. package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +14 -0
  99. package/Server/Types/Database/Permissions/TenantPermission.ts +10 -0
  100. package/Server/Types/Database/QueryHelper.ts +1 -1
  101. package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +1 -1
  102. package/Server/Utils/AI/Toolbox/Index.ts +6 -0
  103. package/Server/Utils/AI/Toolbox/SecurityEventTools.ts +349 -0
  104. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +13 -4
  105. package/Server/Utils/Attribution.ts +130 -34
  106. package/Server/Utils/CronTab.ts +73 -0
  107. package/Server/Utils/GlobalSsoAuthorization.ts +175 -0
  108. package/Server/Utils/Marketing/ConversionUploadProvider.ts +123 -11
  109. package/Server/Utils/Marketing/Providers/GoogleAds.ts +71 -8
  110. package/Server/Utils/Marketing/Providers/LinkedIn.ts +55 -17
  111. package/Server/Utils/Marketing/Providers/Meta.ts +53 -19
  112. package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +38 -11
  113. package/Server/Utils/Marketing/Providers/Reddit.ts +46 -16
  114. package/Server/Utils/Measurement/MeasurementDefinitionValidator.ts +209 -0
  115. package/Server/Utils/Measurement/MeasurementMetricWriter.ts +189 -0
  116. package/Server/Utils/Monitor/Criteria/APIRequestCriteria.ts +48 -33
  117. package/Server/Utils/Monitor/Criteria/CountAnomaly.ts +182 -0
  118. package/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.ts +35 -30
  119. package/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.ts +33 -28
  120. package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +475 -47
  121. package/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.ts +35 -30
  122. package/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts +34 -28
  123. package/Server/Utils/Monitor/Criteria/LogMonitorCriteria.ts +132 -0
  124. package/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts +33 -28
  125. package/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.ts +35 -0
  126. package/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.ts +69 -40
  127. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +35 -29
  128. package/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts +132 -0
  129. package/Server/Utils/Monitor/DataToProcess.ts +2 -0
  130. package/Server/Utils/Monitor/MonitorCriteriaDataExtractor.ts +14 -0
  131. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +23 -0
  132. package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +20 -0
  133. package/Server/Utils/Monitor/MonitorResource.ts +177 -21
  134. package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +1 -0
  135. package/Server/Utils/Monitor/MonitorStepsReferenceExtractor.ts +1 -0
  136. package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +548 -0
  137. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.ts +262 -0
  138. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +212 -0
  139. package/Server/Utils/SecurityEvent/SecurityEventRow.ts +101 -0
  140. package/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.ts +635 -0
  141. package/Server/Utils/StatusPageContentSecurityPolicy.ts +56 -0
  142. package/Server/Utils/StatusPageCustomizationAccess.ts +117 -0
  143. package/Server/Utils/Telemetry/LlmCostBudgetEvaluator.ts +379 -0
  144. package/Server/Utils/Telemetry/LlmSpan.ts +83 -4
  145. package/Server/Utils/Telemetry/LogErrorPatternSql.ts +136 -0
  146. package/Server/Utils/UserPermission/UserPermission.ts +57 -1
  147. package/Tests/App/Dashboard/AlertsSideMenu.test.tsx +4 -0
  148. package/Tests/App/Dashboard/CreatePageEntryPointPermissions.test.tsx +306 -0
  149. package/Tests/App/Dashboard/DangerZone.test.tsx +11 -0
  150. package/Tests/App/Dashboard/IncidentsSideMenu.test.tsx +4 -0
  151. package/Tests/App/Dashboard/LogMonitorAttributeOperatorPreview.test.tsx +459 -0
  152. package/Tests/App/Dashboard/OverviewCustomFields.test.tsx +24 -0
  153. package/Tests/App/Dashboard/ScheduledMaintenanceSideMenu.test.tsx +6 -0
  154. package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +323 -0
  155. package/Tests/Models/DatabaseModels/ProjectSharedResources.test.ts +386 -0
  156. package/Tests/Server/API/LogErrorPatternAPI.test.ts +811 -0
  157. package/Tests/Server/API/StatusPageCustomizationOrigin.test.ts +348 -0
  158. package/Tests/Server/API/UserAuthenticationAPI.test.ts +11 -0
  159. package/Tests/Server/API/UserProjectsAPI.test.ts +11 -2
  160. package/Tests/Server/API/UserTwoFactorAuthAdminAPI.test.ts +918 -0
  161. package/Tests/Server/Infrastructure/LocalCache.test.ts +149 -0
  162. package/Tests/Server/Infrastructure/Postgres/FixTotpOtpUrlAlgorithmMigration.test.ts +9 -59
  163. package/Tests/Server/Infrastructure/Postgres/SchemaMigrationsOrdering.test.ts +227 -0
  164. package/Tests/Server/Middleware/SlackAuthorization.test.ts +149 -0
  165. package/Tests/Server/Middleware/UserAuthorization.test.ts +27 -13
  166. package/Tests/Server/Middleware/UserAuthorizationGlobalSsoGovernance.test.ts +1455 -0
  167. package/Tests/Server/Middleware/UserAuthorizationSSOProvider.test.ts +91 -2
  168. package/Tests/Server/Middleware/WhatsAppAuthorization.test.ts +233 -0
  169. package/Tests/Server/Services/AccessTokenProjectUserGrant.test.ts +249 -0
  170. package/Tests/Server/Services/AlertMeasurementService.test.ts +665 -0
  171. package/Tests/Server/Services/AlertMeasurementValueService.test.ts +389 -0
  172. package/Tests/Server/Services/DetectionRuleService.test.ts +254 -0
  173. package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +21 -8
  174. package/Tests/Server/Services/GlobalSsoProviderAuthorization.test.ts +1242 -0
  175. package/Tests/Server/Services/IncidentMeasurementService.test.ts +394 -0
  176. package/Tests/Server/Services/IncidentMeasurementValueService.test.ts +816 -0
  177. package/Tests/Server/Services/LlmCostBudgetService.test.ts +104 -0
  178. package/Tests/Server/Services/LogAggregationAttributeOperators.test.ts +405 -0
  179. package/Tests/Server/Services/LogErrorPatternAggregation.test.ts +804 -0
  180. package/Tests/Server/Services/MonitorResourceProbeAgreementHydration.test.ts +459 -0
  181. package/Tests/Server/Services/MonitorResourceProbeAgreementReuse.test.ts +10 -0
  182. package/Tests/Server/Services/MutableMetricNameRouting.test.ts +83 -0
  183. package/Tests/Server/Services/ScheduledMaintenanceMeasurementService.test.ts +750 -0
  184. package/Tests/Server/Services/ScheduledMaintenanceMeasurementValueService.test.ts +478 -0
  185. package/Tests/Server/Services/UserAuthenticationService.test.ts +216 -4
  186. package/Tests/Server/Services/UserTwoFactorAuthAdmin.test.ts +1190 -0
  187. package/Tests/Server/Types/AnalyticsDatabase/AggregateUtilBucketTimestamp.test.ts +416 -0
  188. package/Tests/Server/Types/Database/Permissions/ScopedRoleSharedResourceAccess.test.ts +466 -0
  189. package/Tests/Server/Types/Database/QueryHelperManyToManyAndEmptyValues.test.ts +551 -0
  190. package/Tests/Server/Types/Database/QueryHelperOperators.test.ts +265 -0
  191. package/Tests/Server/Types/Database/QueryHelperTextAndStructuralOperators.test.ts +206 -0
  192. package/Tests/Server/Types/Database/SelectUtil.test.ts +348 -0
  193. package/Tests/Server/Utils/AnalyticsDatabase/ClusterAwareSchema.test.ts +6 -0
  194. package/Tests/Server/Utils/AnalyticsDatabase/FractionalAttributeThreshold.test.ts +224 -0
  195. package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +172 -2
  196. package/Tests/Server/Utils/Attribution.test.ts +228 -1
  197. package/Tests/Server/Utils/CronTab.test.ts +116 -0
  198. package/Tests/Server/Utils/GlobalSSOToken.test.ts +581 -0
  199. package/Tests/Server/Utils/GlobalSsoAuthorization.test.ts +1401 -0
  200. package/Tests/Server/Utils/Marketing/AdUploadableConversionTypes.test.ts +315 -0
  201. package/Tests/Server/Utils/Marketing/ConversionUploadProvider.test.ts +124 -7
  202. package/Tests/Server/Utils/Marketing/GoogleAds.test.ts +253 -1
  203. package/Tests/Server/Utils/Marketing/LinkedIn.test.ts +282 -0
  204. package/Tests/Server/Utils/Marketing/Meta.test.ts +304 -0
  205. package/Tests/Server/Utils/Marketing/MicrosoftAds.test.ts +263 -0
  206. package/Tests/Server/Utils/Marketing/Reddit.test.ts +259 -0
  207. package/Tests/Server/Utils/Measurement/MeasurementDefinitionValidator.test.ts +322 -0
  208. package/Tests/Server/Utils/Measurement/MeasurementMetricWriter.test.ts +373 -0
  209. package/Tests/Server/Utils/Monitor/Criteria/APIRequestCriteriaEvaluateOverTime.test.ts +508 -0
  210. package/Tests/Server/Utils/Monitor/Criteria/APIRequestCriteriaPortTimings.test.ts +30 -9
  211. package/Tests/Server/Utils/Monitor/Criteria/CountAnomaly.test.ts +221 -0
  212. package/Tests/Server/Utils/Monitor/Criteria/EvaluateOverTime.test.ts +987 -0
  213. package/Tests/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.test.ts +916 -0
  214. package/Tests/Server/Utils/Monitor/Criteria/LogMonitorCriteria.test.ts +236 -0
  215. package/Tests/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.test.ts +382 -0
  216. package/Tests/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.test.ts +147 -0
  217. package/Tests/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.test.ts +1219 -0
  218. package/Tests/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.test.ts +274 -0
  219. package/Tests/Server/Utils/Monitor/MonitorResourceIngestedStepSelection.test.ts +86 -0
  220. package/Tests/Server/Utils/Monitor/SecurityEventsMonitorDataExtractor.test.ts +93 -0
  221. package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +660 -0
  222. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsClient.test.ts +308 -0
  223. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +271 -0
  224. package/Tests/Server/Utils/SecurityEvent/SecurityEventRow.test.ts +272 -0
  225. package/Tests/Server/Utils/SecurityEvent/SigmaClickhouseCompiler.test.ts +511 -0
  226. package/Tests/Server/Utils/StatusPageContentSecurityPolicy.test.ts +136 -0
  227. package/Tests/Server/Utils/StatusPageCustomizationAccess.test.ts +223 -0
  228. package/Tests/Server/Utils/Telemetry/LlmCostBudgetEvaluator.test.ts +497 -0
  229. package/Tests/Server/Utils/Telemetry/LlmSpan.test.ts +380 -0
  230. package/Tests/Server/Utils/Telemetry/LogErrorPatternSql.test.ts +207 -0
  231. package/Tests/Server/Utils/UserPermission/ProjectUserGrant.test.ts +293 -0
  232. package/Tests/Types/Monitor/MonitorStepConfigHelpers.test.ts +165 -0
  233. package/Tests/Types/Monitor/MonitorStepInfraMonitorUtils.test.ts +194 -0
  234. package/Tests/Types/Monitor/MonitorStepSecurityEventsMonitor.test.ts +201 -0
  235. package/Tests/Types/NetworkDevice/NetworkDeviceLinkRuleScope.test.ts +215 -0
  236. package/Tests/Types/SecurityEvent/OcsfEventClass.test.ts +105 -0
  237. package/Tests/Types/SecurityEvent/OcsfSeverity.test.ts +111 -0
  238. package/Tests/Types/Telemetry/LlmCostCatalog.test.ts +516 -0
  239. package/Tests/UI/Components/ActiveFilterChipsOperatorValues.test.tsx +222 -0
  240. package/Tests/UI/Components/BulkActionPermissionGating.test.tsx +296 -0
  241. package/Tests/UI/Components/CardModelDetailPermissionGating.test.tsx +305 -0
  242. package/Tests/UI/Components/CustomFields/CustomFieldsDetail.test.tsx +23 -0
  243. package/Tests/UI/Components/DictionaryFilterOperatorDisplay.test.ts +239 -0
  244. package/Tests/UI/Components/DisabledButtonTooltip.test.tsx +267 -0
  245. package/Tests/UI/Components/DuplicateModel.test.tsx +37 -0
  246. package/Tests/UI/Components/Forms/FormSubmitAnalytics.test.tsx +206 -0
  247. package/Tests/UI/Components/ModelCardPermissionGating.test.tsx +348 -0
  248. package/Tests/UI/Components/ModelDelete.test.tsx +25 -1
  249. package/Tests/UI/Components/ModelFormCreatePermission.test.tsx +342 -0
  250. package/Tests/UI/Components/ModelTable/BaseModelTablePermissionGating.test.tsx +680 -0
  251. package/Tests/UI/Components/OrderedStatesListCreateGate.test.tsx +174 -0
  252. package/Tests/UI/Components/SavedViewsDropdownSearch.test.tsx +1127 -0
  253. package/Tests/UI/Components/SavedViewsFacetSection.test.tsx +958 -0
  254. package/Tests/UI/Components/SavedViewsList.test.ts +699 -0
  255. package/Tests/UI/Components/SavedViewsSidebarIntegration.test.tsx +640 -0
  256. package/Tests/UI/Components/SavedViewsSurfaceParity.test.tsx +679 -0
  257. package/Tests/UI/Components/TableViewLoadFailure.test.tsx +248 -0
  258. package/Tests/UI/Types/UseComponentOutsideClick.test.tsx +226 -0
  259. package/Tests/UI/Utils/AIChatExport/ConversationMarkdown.test.ts +774 -0
  260. package/Tests/UI/Utils/AIChatExport/MarkdownBlocks.test.ts +791 -0
  261. package/Tests/UI/Utils/AIChatExport/MarkdownSafety.test.ts +544 -0
  262. package/Tests/UI/Utils/PermissionGate.test.ts +467 -0
  263. package/Tests/Utils/Analytics.test.ts +187 -0
  264. package/Tests/Utils/Measurement/MeasurementEvaluator.test.ts +639 -0
  265. package/Tests/Utils/Monitor/MonitorMetricType.test.ts +80 -0
  266. package/Tests/Utils/Monitor/MonitorSummarySnapshotUtil.test.ts +1 -0
  267. package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +1576 -0
  268. package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +433 -0
  269. package/Tests/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.test.ts +214 -0
  270. package/Tests/Utils/SecurityEvent/GenericNormalizer.test.ts +204 -0
  271. package/Tests/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.test.ts +252 -0
  272. package/Tests/Utils/SecurityEvent/NormalizerHelpers.test.ts +274 -0
  273. package/Tests/Utils/SecurityEvent/OcsfNormalizer.test.ts +208 -0
  274. package/Tests/Utils/SecurityEvent/SecurityEventNormalizer.test.ts +172 -0
  275. package/Tests/Utils/SecurityEvent/SigmaRuleParser.test.ts +471 -0
  276. package/Tests/Utils/SecurityEvent/UdmNormalizer.test.ts +361 -0
  277. package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +82 -0
  278. package/Tests/Utils/Telemetry/LogErrorPattern.test.ts +463 -0
  279. package/Types/AI/AIChatTypes.ts +1 -0
  280. package/Types/Alerts/AlertMeasurementAnchorType.ts +14 -0
  281. package/Types/Alerts/AlertStateRole.ts +11 -0
  282. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +16 -0
  283. package/Types/Dashboard/Chart/ChartType.ts +1 -0
  284. package/Types/Dashboard/DashboardComponentType.ts +2 -0
  285. package/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.ts +18 -0
  286. package/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.ts +16 -0
  287. package/Types/Incident/IncidentMeasurementAnchorType.ts +34 -0
  288. package/Types/Incident/IncidentStateRole.ts +14 -0
  289. package/Types/Marketing/Attribution.ts +75 -0
  290. package/Types/Marketing/MarketingConversion.ts +43 -1
  291. package/Types/Measurement/MeasurementAggregationType.ts +43 -0
  292. package/Types/Measurement/MeasurementAnchorKind.ts +23 -0
  293. package/Types/Measurement/MeasurementOccurrence.ts +14 -0
  294. package/Types/Measurement/MeasurementStatus.ts +34 -0
  295. package/Types/MeteredPlan/ProductType.ts +1 -0
  296. package/Types/Monitor/CriteriaFilter.ts +12 -0
  297. package/Types/Monitor/MonitorCriteriaInstance.ts +64 -0
  298. package/Types/Monitor/MonitorStep.ts +28 -0
  299. package/Types/Monitor/MonitorStepSecurityEventsMonitor.ts +100 -0
  300. package/Types/Monitor/MonitorType.ts +20 -0
  301. package/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.ts +17 -0
  302. package/Types/NetworkDevice/NetworkDeviceLinkRuleScope.ts +51 -0
  303. package/Types/Permission.ts +399 -2
  304. package/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.ts +20 -0
  305. package/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.ts +16 -0
  306. package/Types/SecurityEvent/NormalizedSecurityEvent.ts +92 -0
  307. package/Types/SecurityEvent/OcsfEventClass.ts +205 -0
  308. package/Types/SecurityEvent/OcsfSeverity.ts +88 -0
  309. package/Types/SecurityEvent/SecurityEventFormat.ts +23 -0
  310. package/Types/SecurityEvent/SigmaRule.ts +70 -0
  311. package/Types/Telemetry/LlmConventions.ts +20 -1
  312. package/Types/Telemetry/LlmCostCatalog.ts +557 -0
  313. package/Types/Telemetry/ServiceType.ts +1 -0
  314. package/Types/Telemetry/TelemetryRetentionConfig.ts +5 -1
  315. package/Types/Telemetry/TelemetryType.ts +1 -0
  316. package/Types/TwoFactorAuthStatus.ts +42 -0
  317. package/Types/UserAuthenticationStatus.ts +18 -0
  318. package/UI/Components/ActionButton/ActionButtonSchema.ts +7 -0
  319. package/UI/Components/BulkUpdate/BulkArchiveActions.tsx +35 -2
  320. package/UI/Components/BulkUpdate/BulkLabelActions.tsx +34 -1
  321. package/UI/Components/BulkUpdate/BulkOwnerActions.tsx +45 -1
  322. package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +3 -0
  323. package/UI/Components/Button/Button.tsx +37 -2
  324. package/UI/Components/Card/Card.tsx +6 -0
  325. package/UI/Components/CustomFields/CustomFieldsDetail.tsx +24 -1
  326. package/UI/Components/Dictionary/DictionaryFilterOperator.ts +57 -0
  327. package/UI/Components/DuplicateModel/DuplicateModel.tsx +16 -0
  328. package/UI/Components/FormModal/BasicFormModal.tsx +12 -0
  329. package/UI/Components/Forms/BasicForm.tsx +13 -1
  330. package/UI/Components/Forms/BasicModelForm.tsx +2 -1
  331. package/UI/Components/Forms/ModelForm.tsx +64 -3
  332. package/UI/Components/Forms/Utils/FormAnalyticsName.ts +39 -0
  333. package/UI/Components/List/ListRow.tsx +6 -0
  334. package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +34 -7
  335. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +7 -40
  336. package/UI/Components/LogsViewer/components/SavedViewsDropdown.tsx +155 -3
  337. package/UI/Components/ModelDelete/ModelDelete.tsx +20 -0
  338. package/UI/Components/ModelDetail/CardModelDetail.tsx +36 -23
  339. package/UI/Components/ModelFormModal/ModelFormModal.tsx +6 -1
  340. package/UI/Components/ModelList/ModelList.tsx +21 -2
  341. package/UI/Components/ModelList/StaticModelList.tsx +11 -0
  342. package/UI/Components/ModelTable/BaseModelTable.tsx +168 -62
  343. package/UI/Components/ModelTable/ModelTable.tsx +16 -10
  344. package/UI/Components/ModelTable/TableView.tsx +36 -4
  345. package/UI/Components/MoreMenu/MoreMenuItem.tsx +36 -4
  346. package/UI/Components/OrderedStatesList/Item.tsx +6 -0
  347. package/UI/Components/OrderedStatesList/OrderedStatesList.tsx +81 -47
  348. package/UI/Components/ResetObjectID/ResetObjectID.tsx +16 -0
  349. package/UI/Components/SavedViews/SavedViewsFacetSection.tsx +242 -0
  350. package/UI/Components/SavedViews/SavedViewsList.ts +168 -0
  351. package/UI/Components/SavedViews/SavedViewsSearchInput.tsx +46 -0
  352. package/UI/Components/SavedViews/SavedViewsShowMoreButton.tsx +44 -0
  353. package/UI/Components/Table/TableRow.tsx +12 -0
  354. package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +152 -2
  355. package/UI/Types/UseComponentOutsideClick.ts +47 -0
  356. package/UI/Utils/PermissionGate.ts +277 -0
  357. package/Utils/Analytics.ts +55 -2
  358. package/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.ts +84 -0
  359. package/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.ts +110 -0
  360. package/Utils/Dashboard/Components/Index.ts +14 -0
  361. package/Utils/Measurement/MeasurementEvaluator.ts +359 -0
  362. package/Utils/Monitor/MonitorMetricType.ts +40 -0
  363. package/Utils/Monitor/MonitorSummarySnapshotUtil.ts +1 -0
  364. package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +669 -37
  365. package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +231 -0
  366. package/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.ts +115 -0
  367. package/Utils/SecurityEvent/GenericNormalizer.ts +208 -0
  368. package/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.ts +206 -0
  369. package/Utils/SecurityEvent/NormalizerHelpers.ts +263 -0
  370. package/Utils/SecurityEvent/OcsfNormalizer.ts +194 -0
  371. package/Utils/SecurityEvent/SecurityEventNormalizer.ts +82 -0
  372. package/Utils/SecurityEvent/Sigma/SigmaRuleParser.ts +579 -0
  373. package/Utils/SecurityEvent/UdmNormalizer.ts +442 -0
  374. package/Utils/Telemetry/CrossSignalScope.ts +46 -9
  375. package/Utils/Telemetry/LogErrorPattern.ts +350 -0
  376. package/build/dist/Models/AnalyticsModels/Index.js +10 -0
  377. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  378. package/build/dist/Models/AnalyticsModels/LogCountBaseline.js +159 -0
  379. package/build/dist/Models/AnalyticsModels/LogCountBaseline.js.map +1 -0
  380. package/build/dist/Models/AnalyticsModels/SecurityEvent.js +596 -0
  381. package/build/dist/Models/AnalyticsModels/SecurityEvent.js.map +1 -0
  382. package/build/dist/Models/AnalyticsModels/Span.js +24 -1
  383. package/build/dist/Models/AnalyticsModels/Span.js.map +1 -1
  384. package/build/dist/Models/AnalyticsModels/SpanCountBaseline.js +181 -0
  385. package/build/dist/Models/AnalyticsModels/SpanCountBaseline.js.map +1 -0
  386. package/build/dist/Models/DatabaseModels/Alert.js +43 -0
  387. package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
  388. package/build/dist/Models/DatabaseModels/AlertMeasurement.js +1143 -0
  389. package/build/dist/Models/DatabaseModels/AlertMeasurement.js.map +1 -0
  390. package/build/dist/Models/DatabaseModels/AlertMeasurementValue.js +523 -0
  391. package/build/dist/Models/DatabaseModels/AlertMeasurementValue.js.map +1 -0
  392. package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +9 -2
  393. package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
  394. package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js +10 -11
  395. package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js.map +1 -1
  396. package/build/dist/Models/DatabaseModels/DetectionRule.js +517 -0
  397. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -0
  398. package/build/dist/Models/DatabaseModels/GlobalOidc.js +21 -0
  399. package/build/dist/Models/DatabaseModels/GlobalOidc.js.map +1 -1
  400. package/build/dist/Models/DatabaseModels/GlobalSso.js +21 -0
  401. package/build/dist/Models/DatabaseModels/GlobalSso.js.map +1 -1
  402. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +410 -0
  403. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -0
  404. package/build/dist/Models/DatabaseModels/Incident.js +43 -0
  405. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  406. package/build/dist/Models/DatabaseModels/IncidentMeasurement.js +1143 -0
  407. package/build/dist/Models/DatabaseModels/IncidentMeasurement.js.map +1 -0
  408. package/build/dist/Models/DatabaseModels/IncidentMeasurementValue.js +523 -0
  409. package/build/dist/Models/DatabaseModels/IncidentMeasurementValue.js.map +1 -0
  410. package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +9 -2
  411. package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
  412. package/build/dist/Models/DatabaseModels/IncomingCallPolicyLabelRule.js +36 -0
  413. package/build/dist/Models/DatabaseModels/IncomingCallPolicyLabelRule.js.map +1 -1
  414. package/build/dist/Models/DatabaseModels/IncomingCallPolicyOwnerRule.js +42 -0
  415. package/build/dist/Models/DatabaseModels/IncomingCallPolicyOwnerRule.js.map +1 -1
  416. package/build/dist/Models/DatabaseModels/Index.js +20 -0
  417. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  418. package/build/dist/Models/DatabaseModels/Label.js +11 -0
  419. package/build/dist/Models/DatabaseModels/Label.js.map +1 -1
  420. package/build/dist/Models/DatabaseModels/LlmCostBudget.js +681 -0
  421. package/build/dist/Models/DatabaseModels/LlmCostBudget.js.map +1 -0
  422. package/build/dist/Models/DatabaseModels/LlmModelPrice.js +503 -0
  423. package/build/dist/Models/DatabaseModels/LlmModelPrice.js.map +1 -0
  424. package/build/dist/Models/DatabaseModels/LogSavedView.js +87 -0
  425. package/build/dist/Models/DatabaseModels/LogSavedView.js.map +1 -1
  426. package/build/dist/Models/DatabaseModels/MarketingConversion.js +237 -11
  427. package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -1
  428. package/build/dist/Models/DatabaseModels/MetricSavedView.js +59 -0
  429. package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
  430. package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +47 -0
  431. package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -1
  432. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyLabelRule.js +36 -0
  433. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyLabelRule.js.map +1 -1
  434. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.js +42 -0
  435. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerRule.js.map +1 -1
  436. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.js +36 -0
  437. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLabelRule.js.map +1 -1
  438. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.js +42 -0
  439. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleOwnerRule.js.map +1 -1
  440. package/build/dist/Models/DatabaseModels/Probe.js +21 -0
  441. package/build/dist/Models/DatabaseModels/Probe.js.map +1 -1
  442. package/build/dist/Models/DatabaseModels/RunbookLabelRule.js +36 -0
  443. package/build/dist/Models/DatabaseModels/RunbookLabelRule.js.map +1 -1
  444. package/build/dist/Models/DatabaseModels/RunbookOwnerRule.js +42 -0
  445. package/build/dist/Models/DatabaseModels/RunbookOwnerRule.js.map +1 -1
  446. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +1133 -0
  447. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js.map +1 -0
  448. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +515 -0
  449. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js.map +1 -0
  450. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +9 -2
  451. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
  452. package/build/dist/Models/DatabaseModels/StatusPage.js +4 -4
  453. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  454. package/build/dist/Models/DatabaseModels/StatusPageLabelRule.js +36 -0
  455. package/build/dist/Models/DatabaseModels/StatusPageLabelRule.js.map +1 -1
  456. package/build/dist/Models/DatabaseModels/StatusPageOwnerRule.js +42 -0
  457. package/build/dist/Models/DatabaseModels/StatusPageOwnerRule.js.map +1 -1
  458. package/build/dist/Models/DatabaseModels/TableView.js +15 -0
  459. package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
  460. package/build/dist/Models/DatabaseModels/Team.js +13 -0
  461. package/build/dist/Models/DatabaseModels/Team.js.map +1 -1
  462. package/build/dist/Models/DatabaseModels/TeamMember.js +8 -0
  463. package/build/dist/Models/DatabaseModels/TeamMember.js.map +1 -1
  464. package/build/dist/Models/DatabaseModels/TraceSavedView.js +52 -0
  465. package/build/dist/Models/DatabaseModels/TraceSavedView.js.map +1 -1
  466. package/build/dist/Models/DatabaseModels/WorkflowLabelRule.js +36 -0
  467. package/build/dist/Models/DatabaseModels/WorkflowLabelRule.js.map +1 -1
  468. package/build/dist/Models/DatabaseModels/WorkflowOwnerRule.js +42 -0
  469. package/build/dist/Models/DatabaseModels/WorkflowOwnerRule.js.map +1 -1
  470. package/build/dist/Server/API/StatusPageAPI.js +25 -4
  471. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  472. package/build/dist/Server/API/TelemetryAPI.js +136 -0
  473. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  474. package/build/dist/Server/API/UserAPI.js +75 -2
  475. package/build/dist/Server/API/UserAPI.js.map +1 -1
  476. package/build/dist/Server/EnvironmentConfig.js +35 -1
  477. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  478. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.js +12 -0
  479. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.js.map +1 -0
  480. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.js +29 -0
  481. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.js.map +1 -0
  482. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.js +36 -0
  483. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection.js.map +1 -0
  484. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.js +162 -0
  485. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788100000000-AddMeasurements.js.map +1 -0
  486. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.js +40 -0
  487. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788200000000-AddLlmCostBudget.js.map +1 -0
  488. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.js +22 -0
  489. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788300000000-AddLlmModelPrice.js.map +1 -0
  490. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.js +52 -0
  491. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788400000000-AddMarketingConversionAttribution.js.map +1 -0
  492. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.js +38 -0
  493. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788500000000-RemoveLlmCostBudgetAlertColumns.js.map +1 -0
  494. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +16 -0
  495. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  496. package/build/dist/Server/Middleware/IdentityRateLimit.js +491 -0
  497. package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -0
  498. package/build/dist/Server/Middleware/SlackAuthorization.js +28 -4
  499. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  500. package/build/dist/Server/Middleware/UserAuthorization.js +197 -22
  501. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  502. package/build/dist/Server/Middleware/WhatsAppAuthorization.js +32 -2
  503. package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
  504. package/build/dist/Server/Services/AccessTokenService.js +13 -2
  505. package/build/dist/Server/Services/AccessTokenService.js.map +1 -1
  506. package/build/dist/Server/Services/AlertMeasurementService.js +250 -0
  507. package/build/dist/Server/Services/AlertMeasurementService.js.map +1 -0
  508. package/build/dist/Server/Services/AlertMeasurementValueService.js +400 -0
  509. package/build/dist/Server/Services/AlertMeasurementValueService.js.map +1 -0
  510. package/build/dist/Server/Services/AlertService.js +37 -0
  511. package/build/dist/Server/Services/AlertService.js.map +1 -1
  512. package/build/dist/Server/Services/AlertStateTimelineService.js +48 -0
  513. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  514. package/build/dist/Server/Services/DetectionRuleService.js +50 -0
  515. package/build/dist/Server/Services/DetectionRuleService.js.map +1 -0
  516. package/build/dist/Server/Services/GlobalOidcProjectService.js +105 -0
  517. package/build/dist/Server/Services/GlobalOidcProjectService.js.map +1 -1
  518. package/build/dist/Server/Services/GlobalOidcService.js +127 -0
  519. package/build/dist/Server/Services/GlobalOidcService.js.map +1 -1
  520. package/build/dist/Server/Services/GlobalSsoProjectService.js +105 -0
  521. package/build/dist/Server/Services/GlobalSsoProjectService.js.map +1 -1
  522. package/build/dist/Server/Services/GlobalSsoService.js +127 -0
  523. package/build/dist/Server/Services/GlobalSsoService.js.map +1 -1
  524. package/build/dist/Server/Services/GoogleSecOpsConnectionService.js +55 -0
  525. package/build/dist/Server/Services/GoogleSecOpsConnectionService.js.map +1 -0
  526. package/build/dist/Server/Services/IncidentMeasurementService.js +252 -0
  527. package/build/dist/Server/Services/IncidentMeasurementService.js.map +1 -0
  528. package/build/dist/Server/Services/IncidentMeasurementValueService.js +413 -0
  529. package/build/dist/Server/Services/IncidentMeasurementValueService.js.map +1 -0
  530. package/build/dist/Server/Services/IncidentService.js +41 -0
  531. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  532. package/build/dist/Server/Services/IncidentStateTimelineService.js +50 -0
  533. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  534. package/build/dist/Server/Services/Index.js +30 -0
  535. package/build/dist/Server/Services/Index.js.map +1 -1
  536. package/build/dist/Server/Services/LlmCostBudgetService.js +89 -0
  537. package/build/dist/Server/Services/LlmCostBudgetService.js.map +1 -0
  538. package/build/dist/Server/Services/LlmModelPriceService.js +163 -0
  539. package/build/dist/Server/Services/LlmModelPriceService.js.map +1 -0
  540. package/build/dist/Server/Services/LogAggregationService.js +709 -0
  541. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  542. package/build/dist/Server/Services/LogCountBaselineService.js +112 -0
  543. package/build/dist/Server/Services/LogCountBaselineService.js.map +1 -0
  544. package/build/dist/Server/Services/MutableMetricService.js +28 -9
  545. package/build/dist/Server/Services/MutableMetricService.js.map +1 -1
  546. package/build/dist/Server/Services/ScheduledMaintenanceMeasurementService.js +254 -0
  547. package/build/dist/Server/Services/ScheduledMaintenanceMeasurementService.js.map +1 -0
  548. package/build/dist/Server/Services/ScheduledMaintenanceMeasurementValueService.js +434 -0
  549. package/build/dist/Server/Services/ScheduledMaintenanceMeasurementValueService.js.map +1 -0
  550. package/build/dist/Server/Services/ScheduledMaintenanceService.js +37 -0
  551. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  552. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +134 -0
  553. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  554. package/build/dist/Server/Services/SecurityEventService.js +64 -0
  555. package/build/dist/Server/Services/SecurityEventService.js.map +1 -0
  556. package/build/dist/Server/Services/SpanCountBaselineService.js +122 -0
  557. package/build/dist/Server/Services/SpanCountBaselineService.js.map +1 -0
  558. package/build/dist/Server/Services/StatusPageService.js +4 -3
  559. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  560. package/build/dist/Server/Services/TelemetryUsageBillingService.js +15 -3
  561. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  562. package/build/dist/Server/Services/UserEmailService.js +4 -4
  563. package/build/dist/Server/Services/UserService.js +262 -42
  564. package/build/dist/Server/Services/UserService.js.map +1 -1
  565. package/build/dist/Server/Services/UserTotpAuthService.js +0 -73
  566. package/build/dist/Server/Services/UserTotpAuthService.js.map +1 -1
  567. package/build/dist/Server/Services/UserWebAuthnService.js +1 -73
  568. package/build/dist/Server/Services/UserWebAuthnService.js.map +1 -1
  569. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +13 -0
  570. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
  571. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +10 -0
  572. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
  573. package/build/dist/Server/Types/Database/QueryHelper.js +1 -1
  574. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  575. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +1 -1
  576. package/build/dist/Server/Utils/AI/Toolbox/Index.js +3 -0
  577. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
  578. package/build/dist/Server/Utils/AI/Toolbox/SecurityEventTools.js +257 -0
  579. package/build/dist/Server/Utils/AI/Toolbox/SecurityEventTools.js.map +1 -0
  580. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +13 -4
  581. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  582. package/build/dist/Server/Utils/Attribution.js +77 -33
  583. package/build/dist/Server/Utils/Attribution.js.map +1 -1
  584. package/build/dist/Server/Utils/CronTab.js +66 -0
  585. package/build/dist/Server/Utils/CronTab.js.map +1 -1
  586. package/build/dist/Server/Utils/GlobalSsoAuthorization.js +112 -0
  587. package/build/dist/Server/Utils/GlobalSsoAuthorization.js.map +1 -0
  588. package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +57 -4
  589. package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -1
  590. package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +53 -9
  591. package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -1
  592. package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +42 -18
  593. package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -1
  594. package/build/dist/Server/Utils/Marketing/Providers/Meta.js +43 -19
  595. package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -1
  596. package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +25 -12
  597. package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -1
  598. package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +35 -16
  599. package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -1
  600. package/build/dist/Server/Utils/Measurement/MeasurementDefinitionValidator.js +109 -0
  601. package/build/dist/Server/Utils/Measurement/MeasurementDefinitionValidator.js.map +1 -0
  602. package/build/dist/Server/Utils/Measurement/MeasurementMetricWriter.js +131 -0
  603. package/build/dist/Server/Utils/Measurement/MeasurementMetricWriter.js.map +1 -0
  604. package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js +37 -35
  605. package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js.map +1 -1
  606. package/build/dist/Server/Utils/Monitor/Criteria/CountAnomaly.js +111 -0
  607. package/build/dist/Server/Utils/Monitor/Criteria/CountAnomaly.js.map +1 -0
  608. package/build/dist/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.js +21 -25
  609. package/build/dist/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.js.map +1 -1
  610. package/build/dist/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.js +20 -22
  611. package/build/dist/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.js.map +1 -1
  612. package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +370 -42
  613. package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
  614. package/build/dist/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.js +21 -25
  615. package/build/dist/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.js.map +1 -1
  616. package/build/dist/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.js +21 -25
  617. package/build/dist/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.js.map +1 -1
  618. package/build/dist/Server/Utils/Monitor/Criteria/LogMonitorCriteria.js +84 -1
  619. package/build/dist/Server/Utils/Monitor/Criteria/LogMonitorCriteria.js.map +1 -1
  620. package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js +21 -25
  621. package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js.map +1 -1
  622. package/build/dist/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.js +35 -0
  623. package/build/dist/Server/Utils/Monitor/Criteria/SecurityEventsMonitorCriteria.js.map +1 -0
  624. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js +64 -52
  625. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js.map +1 -1
  626. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +25 -29
  627. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  628. package/build/dist/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.js +84 -1
  629. package/build/dist/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.js.map +1 -1
  630. package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js +7 -0
  631. package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js.map +1 -1
  632. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +20 -0
  633. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  634. package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +9 -0
  635. package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
  636. package/build/dist/Server/Utils/Monitor/MonitorResource.js +133 -23
  637. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  638. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +6 -5
  639. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
  640. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js +1 -0
  641. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js.map +1 -1
  642. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +404 -0
  643. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -0
  644. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js +145 -0
  645. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +1 -0
  646. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +176 -0
  647. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -0
  648. package/build/dist/Server/Utils/SecurityEvent/SecurityEventRow.js +69 -0
  649. package/build/dist/Server/Utils/SecurityEvent/SecurityEventRow.js.map +1 -0
  650. package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js +493 -0
  651. package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js.map +1 -0
  652. package/build/dist/Server/Utils/StatusPageContentSecurityPolicy.js +39 -0
  653. package/build/dist/Server/Utils/StatusPageContentSecurityPolicy.js.map +1 -0
  654. package/build/dist/Server/Utils/StatusPageCustomizationAccess.js +85 -0
  655. package/build/dist/Server/Utils/StatusPageCustomizationAccess.js.map +1 -0
  656. package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js +317 -0
  657. package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js.map +1 -0
  658. package/build/dist/Server/Utils/Telemetry/LlmSpan.js +56 -4
  659. package/build/dist/Server/Utils/Telemetry/LlmSpan.js.map +1 -1
  660. package/build/dist/Server/Utils/Telemetry/LogErrorPatternSql.js +112 -0
  661. package/build/dist/Server/Utils/Telemetry/LogErrorPatternSql.js.map +1 -0
  662. package/build/dist/Server/Utils/UserPermission/UserPermission.js +46 -1
  663. package/build/dist/Server/Utils/UserPermission/UserPermission.js.map +1 -1
  664. package/build/dist/Types/AI/AIChatTypes.js +1 -0
  665. package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
  666. package/build/dist/Types/Alerts/AlertMeasurementAnchorType.js +15 -0
  667. package/build/dist/Types/Alerts/AlertMeasurementAnchorType.js.map +1 -0
  668. package/build/dist/Types/Alerts/AlertStateRole.js +12 -0
  669. package/build/dist/Types/Alerts/AlertStateRole.js.map +1 -0
  670. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +16 -0
  671. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  672. package/build/dist/Types/Dashboard/Chart/ChartType.js +1 -0
  673. package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
  674. package/build/dist/Types/Dashboard/DashboardComponentType.js +2 -0
  675. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  676. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.js +2 -0
  677. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsFlowComponent.js.map +1 -0
  678. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.js +2 -0
  679. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSecurityEventsListComponent.js.map +1 -0
  680. package/build/dist/Types/Incident/IncidentMeasurementAnchorType.js +29 -0
  681. package/build/dist/Types/Incident/IncidentMeasurementAnchorType.js.map +1 -0
  682. package/build/dist/Types/Incident/IncidentStateRole.js +15 -0
  683. package/build/dist/Types/Incident/IncidentStateRole.js.map +1 -0
  684. package/build/dist/Types/Marketing/Attribution.js +68 -0
  685. package/build/dist/Types/Marketing/Attribution.js.map +1 -0
  686. package/build/dist/Types/Marketing/MarketingConversion.js +40 -1
  687. package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -1
  688. package/build/dist/Types/Measurement/MeasurementAggregationType.js +40 -0
  689. package/build/dist/Types/Measurement/MeasurementAggregationType.js.map +1 -0
  690. package/build/dist/Types/Measurement/MeasurementAnchorKind.js +22 -0
  691. package/build/dist/Types/Measurement/MeasurementAnchorKind.js.map +1 -0
  692. package/build/dist/Types/Measurement/MeasurementOccurrence.js +15 -0
  693. package/build/dist/Types/Measurement/MeasurementOccurrence.js.map +1 -0
  694. package/build/dist/Types/Measurement/MeasurementStatus.js +32 -0
  695. package/build/dist/Types/Measurement/MeasurementStatus.js.map +1 -0
  696. package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
  697. package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
  698. package/build/dist/Types/Monitor/CriteriaFilter.js +3 -0
  699. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  700. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +59 -0
  701. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
  702. package/build/dist/Types/Monitor/MonitorStep.js +17 -0
  703. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  704. package/build/dist/Types/Monitor/MonitorStepSecurityEventsMonitor.js +64 -0
  705. package/build/dist/Types/Monitor/MonitorStepSecurityEventsMonitor.js.map +1 -0
  706. package/build/dist/Types/Monitor/MonitorType.js +19 -0
  707. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  708. package/build/dist/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.js +2 -0
  709. package/build/dist/Types/Monitor/SecurityEventsMonitor/SecurityEventsMonitorResponse.js.map +1 -0
  710. package/build/dist/Types/NetworkDevice/NetworkDeviceLinkRuleScope.js +46 -0
  711. package/build/dist/Types/NetworkDevice/NetworkDeviceLinkRuleScope.js.map +1 -0
  712. package/build/dist/Types/Permission.js +347 -2
  713. package/build/dist/Types/Permission.js.map +1 -1
  714. package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.js +19 -0
  715. package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceMeasurementAnchorType.js.map +1 -0
  716. package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.js +17 -0
  717. package/build/dist/Types/ScheduledMaintenance/ScheduledMaintenanceStateRole.js.map +1 -0
  718. package/build/dist/Types/SecurityEvent/NormalizedSecurityEvent.js +2 -0
  719. package/build/dist/Types/SecurityEvent/NormalizedSecurityEvent.js.map +1 -0
  720. package/build/dist/Types/SecurityEvent/OcsfEventClass.js +181 -0
  721. package/build/dist/Types/SecurityEvent/OcsfEventClass.js.map +1 -0
  722. package/build/dist/Types/SecurityEvent/OcsfSeverity.js +81 -0
  723. package/build/dist/Types/SecurityEvent/OcsfSeverity.js.map +1 -0
  724. package/build/dist/Types/SecurityEvent/SecurityEventFormat.js +21 -0
  725. package/build/dist/Types/SecurityEvent/SecurityEventFormat.js.map +1 -0
  726. package/build/dist/Types/SecurityEvent/SigmaRule.js +16 -0
  727. package/build/dist/Types/SecurityEvent/SigmaRule.js.map +1 -0
  728. package/build/dist/Types/Telemetry/LlmConventions.js +19 -1
  729. package/build/dist/Types/Telemetry/LlmConventions.js.map +1 -1
  730. package/build/dist/Types/Telemetry/LlmCostCatalog.js +484 -0
  731. package/build/dist/Types/Telemetry/LlmCostCatalog.js.map +1 -0
  732. package/build/dist/Types/Telemetry/ServiceType.js +1 -0
  733. package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
  734. package/build/dist/Types/Telemetry/TelemetryRetentionConfig.js.map +1 -1
  735. package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
  736. package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
  737. package/build/dist/Types/TwoFactorAuthStatus.js +41 -0
  738. package/build/dist/Types/TwoFactorAuthStatus.js.map +1 -0
  739. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js +16 -2
  740. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js.map +1 -1
  741. package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +15 -1
  742. package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
  743. package/build/dist/UI/Components/BulkUpdate/BulkOwnerActions.js +20 -1
  744. package/build/dist/UI/Components/BulkUpdate/BulkOwnerActions.js.map +1 -1
  745. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +1 -1
  746. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
  747. package/build/dist/UI/Components/Button/Button.js +22 -1
  748. package/build/dist/UI/Components/Button/Button.js.map +1 -1
  749. package/build/dist/UI/Components/Card/Card.js +1 -1
  750. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  751. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +14 -1
  752. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
  753. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js +47 -0
  754. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js.map +1 -1
  755. package/build/dist/UI/Components/DuplicateModel/DuplicateModel.js +8 -0
  756. package/build/dist/UI/Components/DuplicateModel/DuplicateModel.js.map +1 -1
  757. package/build/dist/UI/Components/FormModal/BasicFormModal.js +2 -1
  758. package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
  759. package/build/dist/UI/Components/Forms/BasicForm.js +10 -1
  760. package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
  761. package/build/dist/UI/Components/Forms/BasicModelForm.js +2 -1
  762. package/build/dist/UI/Components/Forms/BasicModelForm.js.map +1 -1
  763. package/build/dist/UI/Components/Forms/ModelForm.js +44 -2
  764. package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
  765. package/build/dist/UI/Components/Forms/Utils/FormAnalyticsName.js +33 -0
  766. package/build/dist/UI/Components/Forms/Utils/FormAnalyticsName.js.map +1 -0
  767. package/build/dist/UI/Components/List/ListRow.js +4 -1
  768. package/build/dist/UI/Components/List/ListRow.js.map +1 -1
  769. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +32 -7
  770. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
  771. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +2 -17
  772. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  773. package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js +93 -4
  774. package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js.map +1 -1
  775. package/build/dist/UI/Components/ModelDelete/ModelDelete.js +13 -0
  776. package/build/dist/UI/Components/ModelDelete/ModelDelete.js.map +1 -1
  777. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +27 -11
  778. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
  779. package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js +2 -1
  780. package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
  781. package/build/dist/UI/Components/ModelList/ModelList.js +13 -2
  782. package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
  783. package/build/dist/UI/Components/ModelList/StaticModelList.js +4 -1
  784. package/build/dist/UI/Components/ModelList/StaticModelList.js.map +1 -1
  785. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +101 -40
  786. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  787. package/build/dist/UI/Components/ModelTable/ModelTable.js +9 -7
  788. package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
  789. package/build/dist/UI/Components/ModelTable/TableView.js +32 -4
  790. package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
  791. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +19 -2
  792. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
  793. package/build/dist/UI/Components/OrderedStatesList/Item.js +4 -1
  794. package/build/dist/UI/Components/OrderedStatesList/Item.js.map +1 -1
  795. package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js +33 -32
  796. package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js.map +1 -1
  797. package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js +8 -0
  798. package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js.map +1 -1
  799. package/build/dist/UI/Components/SavedViews/SavedViewsFacetSection.js +98 -0
  800. package/build/dist/UI/Components/SavedViews/SavedViewsFacetSection.js.map +1 -0
  801. package/build/dist/UI/Components/SavedViews/SavedViewsList.js +99 -0
  802. package/build/dist/UI/Components/SavedViews/SavedViewsList.js.map +1 -0
  803. package/build/dist/UI/Components/SavedViews/SavedViewsSearchInput.js +17 -0
  804. package/build/dist/UI/Components/SavedViews/SavedViewsSearchInput.js.map +1 -0
  805. package/build/dist/UI/Components/SavedViews/SavedViewsShowMoreButton.js +15 -0
  806. package/build/dist/UI/Components/SavedViews/SavedViewsShowMoreButton.js.map +1 -0
  807. package/build/dist/UI/Components/Table/TableRow.js +8 -2
  808. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  809. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +93 -4
  810. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
  811. package/build/dist/UI/Types/UseComponentOutsideClick.js +39 -0
  812. package/build/dist/UI/Types/UseComponentOutsideClick.js.map +1 -1
  813. package/build/dist/UI/Utils/PermissionGate.js +164 -0
  814. package/build/dist/UI/Utils/PermissionGate.js.map +1 -0
  815. package/build/dist/Utils/Analytics.js +50 -2
  816. package/build/dist/Utils/Analytics.js.map +1 -1
  817. package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.js +70 -0
  818. package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsFlowComponent.js.map +1 -0
  819. package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.js +92 -0
  820. package/build/dist/Utils/Dashboard/Components/DashboardSecurityEventsListComponent.js.map +1 -0
  821. package/build/dist/Utils/Dashboard/Components/Index.js +8 -0
  822. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  823. package/build/dist/Utils/Measurement/MeasurementEvaluator.js +210 -0
  824. package/build/dist/Utils/Measurement/MeasurementEvaluator.js.map +1 -0
  825. package/build/dist/Utils/Monitor/MonitorMetricType.js +37 -0
  826. package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
  827. package/build/dist/Utils/Monitor/MonitorSummarySnapshotUtil.js +1 -0
  828. package/build/dist/Utils/Monitor/MonitorSummarySnapshotUtil.js.map +1 -1
  829. package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +359 -37
  830. package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -1
  831. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +108 -0
  832. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -0
  833. package/build/dist/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.js +87 -0
  834. package/build/dist/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.js.map +1 -0
  835. package/build/dist/Utils/SecurityEvent/GenericNormalizer.js +176 -0
  836. package/build/dist/Utils/SecurityEvent/GenericNormalizer.js.map +1 -0
  837. package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js +146 -0
  838. package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js.map +1 -0
  839. package/build/dist/Utils/SecurityEvent/NormalizerHelpers.js +196 -0
  840. package/build/dist/Utils/SecurityEvent/NormalizerHelpers.js.map +1 -0
  841. package/build/dist/Utils/SecurityEvent/OcsfNormalizer.js +136 -0
  842. package/build/dist/Utils/SecurityEvent/OcsfNormalizer.js.map +1 -0
  843. package/build/dist/Utils/SecurityEvent/SecurityEventNormalizer.js +64 -0
  844. package/build/dist/Utils/SecurityEvent/SecurityEventNormalizer.js.map +1 -0
  845. package/build/dist/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +388 -0
  846. package/build/dist/Utils/SecurityEvent/Sigma/SigmaRuleParser.js.map +1 -0
  847. package/build/dist/Utils/SecurityEvent/UdmNormalizer.js +328 -0
  848. package/build/dist/Utils/SecurityEvent/UdmNormalizer.js.map +1 -0
  849. package/build/dist/Utils/Telemetry/CrossSignalScope.js +29 -7
  850. package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
  851. package/build/dist/Utils/Telemetry/LogErrorPattern.js +284 -0
  852. package/build/dist/Utils/Telemetry/LogErrorPattern.js.map +1 -0
  853. package/package.json +3 -1
@@ -1,27 +1,71 @@
1
- /*
2
- * Turning label rules into uplinks.
3
- *
4
- * Pure data-in/data-out so the whole decision matrix — which is mostly about
5
- * REFUSING to draw things — is unit-testable without a database.
6
- *
7
- * The shape is a star, not a clique. A rule names a set of child labels and a
8
- * set of parent labels; every device carrying all the child labels gets one
9
- * edge to the single device carrying all the parent labels. Matching "devices
10
- * that share a label" symmetrically, which is what was originally asked for,
11
- * would turn one forty-device site label into 780 edges.
12
- */
13
- export default class NetworkDeviceLinkRuleUtil {
1
+ import { NetworkDeviceLinkRuleScopeUtil } from "../../Types/NetworkDevice/NetworkDeviceLinkRuleScope";
2
+ class NetworkDeviceLinkRuleUtil {
14
3
  /*
15
4
  * ALL of the rule's labels must be present on the device, not any. "Devices
16
5
  * that are both an access point AND on floor 1" is the question an operator
17
6
  * is asking; any-of would sweep in every access point in the building.
18
7
  */
19
- static deviceMatches(device, requiredLabelIds) {
20
- const owned = new Set(device.labelIds);
8
+ static matches(labelSet, requiredLabelIds) {
21
9
  return requiredLabelIds.every((labelId) => {
22
- return owned.has(labelId);
10
+ return labelSet.has(labelId);
23
11
  });
24
12
  }
13
+ static resolveGroup(rule, group) {
14
+ const parents = group.filter((entry) => {
15
+ return NetworkDeviceLinkRuleUtil.matches(entry.labelSet, rule.parentLabelIds);
16
+ });
17
+ /*
18
+ * Counted before the parent branch, not after: a site that failed to
19
+ * resolve still has to report how many devices are floating there, and
20
+ * that number is the operator's damage assessment.
21
+ */
22
+ const childCandidates = group.filter((entry) => {
23
+ return NetworkDeviceLinkRuleUtil.matches(entry.labelSet, rule.childLabelIds);
24
+ });
25
+ const childMatchCount = childCandidates.length;
26
+ if (parents.length === 0) {
27
+ return {
28
+ links: [],
29
+ parentMatchCount: 0,
30
+ childMatchCount: childMatchCount,
31
+ failure: "noParentMatched",
32
+ };
33
+ }
34
+ /*
35
+ * Two candidate parents is not a tie to break — it is a question the
36
+ * labels do not answer. Drawing to either one would assert a cabling
37
+ * fact nobody stated.
38
+ */
39
+ if (parents.length > 1) {
40
+ return {
41
+ links: [],
42
+ parentMatchCount: parents.length,
43
+ childMatchCount: childMatchCount,
44
+ failure: "ambiguousParent",
45
+ };
46
+ }
47
+ const parent = parents[0];
48
+ // The parent is excluded even when it matches both sets: no self-links.
49
+ const children = childCandidates.filter((entry) => {
50
+ return entry.device.id !== parent.device.id;
51
+ });
52
+ if (children.length === 0) {
53
+ return {
54
+ links: [],
55
+ parentMatchCount: 1,
56
+ childMatchCount: childMatchCount,
57
+ failure: "noChildrenMatched",
58
+ };
59
+ }
60
+ return {
61
+ links: children.map((child) => {
62
+ return { fromDeviceId: child.device.id, toDeviceId: parent.device.id };
63
+ }),
64
+ parentMatchCount: 1,
65
+ childMatchCount: childMatchCount,
66
+ failure: null,
67
+ };
68
+ }
25
69
  static resolveRule(rule, devices) {
26
70
  const empty = (reason, parents = 0, children = 0) => {
27
71
  return {
@@ -33,6 +77,13 @@ export default class NetworkDeviceLinkRuleUtil {
33
77
  matchedChildCount: children,
34
78
  };
35
79
  };
80
+ /*
81
+ * The three checks below are properties of the rule's TEXT, true in every
82
+ * site, so they are settled before scope is even read. A disabled rule is
83
+ * not "disabled in Unit 7", and partitioning a rule with an empty parent
84
+ * label set would make every site in the project ambiguous at once — the
85
+ * worst noise outcome available.
86
+ */
36
87
  if (rule.isEnabled === false) {
37
88
  return empty("disabled");
38
89
  }
@@ -47,39 +98,183 @@ export default class NetworkDeviceLinkRuleUtil {
47
98
  if (rule.parentLabelIds.length === 0) {
48
99
  return empty("noParentLabels");
49
100
  }
50
- const parents = devices.filter((device) => {
51
- return NetworkDeviceLinkRuleUtil.deviceMatches(device, rule.parentLabelIds);
101
+ const normalized = devices.map((device) => {
102
+ return {
103
+ device: device,
104
+ labelSet: new Set(device.labelIds),
105
+ siteKey: (device.siteId || "").toString().trim(),
106
+ };
52
107
  });
53
- if (parents.length === 0) {
108
+ if (NetworkDeviceLinkRuleScopeUtil.isSiteScoped(rule.scope)) {
109
+ return NetworkDeviceLinkRuleUtil.resolvePerSite(rule, normalized);
110
+ }
111
+ return NetworkDeviceLinkRuleUtil.resolveProject(rule, normalized, empty);
112
+ }
113
+ static resolveProject(rule, normalized, empty) {
114
+ const result = NetworkDeviceLinkRuleUtil.resolveGroup(rule, normalized);
115
+ if (result.failure === "noParentMatched") {
54
116
  return empty("noParentMatched", 0);
55
117
  }
56
- /*
57
- * Two candidate parents is not a tie to break — it is a question the
58
- * labels do not answer. Drawing to either one would assert a cabling
59
- * fact nobody stated.
60
- */
61
- if (parents.length > 1) {
62
- return empty("ambiguousParent", parents.length);
118
+ if (result.failure === "ambiguousParent") {
119
+ return empty("ambiguousParent", result.parentMatchCount);
63
120
  }
64
- const parent = parents[0];
65
- const children = devices.filter((device) => {
66
- // The parent is excluded even when it matches both sets: no self-links.
67
- return (device.id !== parent.id &&
68
- NetworkDeviceLinkRuleUtil.deviceMatches(device, rule.childLabelIds));
69
- });
70
- if (children.length === 0) {
121
+ if (result.failure === "noChildrenMatched") {
71
122
  return empty("noChildrenMatched", 1);
72
123
  }
73
124
  return {
74
125
  ruleId: rule.id,
75
126
  ruleName: rule.name,
76
- links: children.map((child) => {
77
- return { fromDeviceId: child.id, toDeviceId: parent.id };
78
- }),
127
+ links: result.links,
79
128
  matchedParentCount: 1,
80
- matchedChildCount: children.length,
129
+ matchedChildCount: result.links.length,
81
130
  };
82
131
  }
132
+ static resolvePerSite(rule, normalized) {
133
+ /*
134
+ * Bucketed in ONE pass in first-appearance order. Never
135
+ * `devices.filter(...)` inside a loop over sites: that is O(devices x
136
+ * sites) per rule, and this endpoint runs at ten thousand devices.
137
+ */
138
+ const buckets = new Map();
139
+ let unsitedChildDeviceCount = 0;
140
+ for (const entry of normalized) {
141
+ /*
142
+ * A device with no site is EXCLUDED, not pooled with the other unsited
143
+ * ones and not given a group of its own. Pooling would ask "exactly one
144
+ * parent among all the unsited devices", a question nobody posed, and
145
+ * would draw an edge between two boxes whose only relationship is that
146
+ * neither has been assigned a site yet. Counted instead, so the map can
147
+ * say how many the rule walked past.
148
+ */
149
+ if (entry.siteKey === "") {
150
+ if (NetworkDeviceLinkRuleUtil.matches(entry.labelSet, rule.childLabelIds)) {
151
+ unsitedChildDeviceCount++;
152
+ }
153
+ continue;
154
+ }
155
+ const bucket = buckets.get(entry.siteKey);
156
+ if (bucket) {
157
+ bucket.push(entry);
158
+ }
159
+ else {
160
+ buckets.set(entry.siteKey, [entry]);
161
+ }
162
+ }
163
+ const links = [];
164
+ const groupFailures = [];
165
+ let applicableSiteCount = 0;
166
+ let matchedParentCount = 0;
167
+ for (const [siteId, group] of buckets) {
168
+ const result = NetworkDeviceLinkRuleUtil.resolveGroup(rule, group);
169
+ if (result.links.length > 0) {
170
+ applicableSiteCount++;
171
+ matchedParentCount += result.parentMatchCount;
172
+ links.push(...result.links);
173
+ continue;
174
+ }
175
+ /*
176
+ * A site speaks only when it holds devices this rule wanted to place.
177
+ * Sites with nothing to place are not misconfigured — the rule simply
178
+ * does not apply there, and a parent label like `SubCategory:Router` is
179
+ * present in nearly every site by construction. Without this gate, site
180
+ * scoping would trade one loud failure for two hundred quiet ones and
181
+ * the banner would be ignored inside a week.
182
+ *
183
+ * `noChildrenMatched` lands here too: the only child candidate was the
184
+ * parent itself, so after the self-link exclusion there is nothing to
185
+ * place and nothing to report.
186
+ */
187
+ if (result.childMatchCount === 0 ||
188
+ result.failure === null ||
189
+ result.failure === "noChildrenMatched") {
190
+ continue;
191
+ }
192
+ applicableSiteCount++;
193
+ matchedParentCount += result.parentMatchCount;
194
+ groupFailures.push({
195
+ siteId: siteId,
196
+ siteName: NetworkDeviceLinkRuleUtil.siteNameOf(group),
197
+ reason: result.failure,
198
+ matchedParentCount: result.parentMatchCount,
199
+ matchedChildCount: result.childMatchCount,
200
+ });
201
+ }
202
+ const outcome = {
203
+ ruleId: rule.id,
204
+ ruleName: rule.name,
205
+ links: links,
206
+ matchedParentCount: matchedParentCount,
207
+ matchedChildCount: links.length,
208
+ applicableSiteCount: applicableSiteCount,
209
+ };
210
+ /*
211
+ * Keeps `links.length === 0 <=> skipReason defined` true with no gaps, so
212
+ * describeOutcome can never fall through to "Draws 0 uplinks" on an empty
213
+ * outcome. The second arm covers both an empty device list and a rule
214
+ * whose labels match nothing anywhere.
215
+ */
216
+ if (links.length === 0) {
217
+ outcome.skipReason =
218
+ groupFailures.length > 0 ? "noSiteResolved" : "noChildrenMatched";
219
+ }
220
+ if (groupFailures.length > 0) {
221
+ outcome.groupFailures = groupFailures;
222
+ }
223
+ if (unsitedChildDeviceCount > 0) {
224
+ outcome.unsitedChildDeviceCount = unsitedChildDeviceCount;
225
+ }
226
+ return outcome;
227
+ }
228
+ /** First non-empty site name among a site's devices, if any of them carry one. */
229
+ static siteNameOf(group) {
230
+ for (const entry of group) {
231
+ if (entry.device.siteName) {
232
+ return entry.device.siteName;
233
+ }
234
+ }
235
+ return undefined;
236
+ }
237
+ /*
238
+ * By site name, then by id so equally-named (and unnamed) sites still have
239
+ * ONE order. Load-bearing rather than cosmetic: the live view refetches
240
+ * every sixty seconds and the device query has no ORDER BY, so an unsorted
241
+ * list would reshuffle the banner on every poll and read as a change that
242
+ * did not happen. The sentence and the site list share it so the three names
243
+ * the sentence gives are the first three rows of the list.
244
+ */
245
+ static sortSiteFailures(failures) {
246
+ return [...failures].sort((a, b) => {
247
+ return ((a.siteName || "").localeCompare(b.siteName || "") ||
248
+ a.siteId.localeCompare(b.siteId));
249
+ });
250
+ }
251
+ /*
252
+ * "Unit 4, Unit 9 and 2 more sites".
253
+ *
254
+ * Named in sortSiteFailures order, for the reasons given there. The count
255
+ * stays exact even when the names are elided, so the operator always knows
256
+ * the true blast radius — and `getWarning` sends the sites themselves
257
+ * alongside, because a blast radius is not a list of buildings.
258
+ */
259
+ static describeSiteList(failures) {
260
+ const sorted = NetworkDeviceLinkRuleUtil.sortSiteFailures(failures);
261
+ const names = sorted
262
+ .slice(0, NetworkDeviceLinkRuleUtil.MAX_NAMED_SITES)
263
+ .map((failure) => {
264
+ const name = failure.siteName || NetworkDeviceLinkRuleUtil.UNNAMED_SITE;
265
+ return name.length > NetworkDeviceLinkRuleUtil.MAX_SITE_NAME_LENGTH
266
+ ? `${name.slice(0, NetworkDeviceLinkRuleUtil.MAX_SITE_NAME_LENGTH - 1)}…`
267
+ : name;
268
+ });
269
+ const remaining = sorted.length - names.length;
270
+ if (remaining > 0) {
271
+ return `${names.join(", ")} and ${remaining} more site${remaining === 1 ? "" : "s"}`;
272
+ }
273
+ if (names.length === 1) {
274
+ return names[0];
275
+ }
276
+ return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
277
+ }
83
278
  static resolveRules(rules, devices) {
84
279
  return rules.map((rule) => {
85
280
  return NetworkDeviceLinkRuleUtil.resolveRule(rule, devices);
@@ -100,9 +295,136 @@ export default class NetworkDeviceLinkRuleUtil {
100
295
  return `${outcome.matchedParentCount} devices carry the parent labels. Exactly one must, or there is no way to tell which is the uplink.`;
101
296
  case "noChildrenMatched":
102
297
  return "No device carries the child labels yet.";
298
+ case "noSiteResolved":
299
+ return "No site resolved this rule.";
103
300
  default:
104
301
  return `Draws ${outcome.matchedChildCount} uplink${outcome.matchedChildCount === 1 ? "" : "s"}.`;
105
302
  }
106
303
  }
304
+ /**
305
+ * The operator-facing warning, or null when the rule needs no explanation.
306
+ *
307
+ * Singular on purpose: ONE bullet per rule, never one per site. The banner's
308
+ * length is then bounded by the number of rules the operator wrote — a small
309
+ * number they control — rather than by the number of sites in their project.
310
+ *
311
+ * This is also the only sanctioned "did this rule fail" predicate. A caller
312
+ * must not go back to testing `outcome.links.length === 0`, which a rule
313
+ * drawing thirteen of fourteen sites passes while genuinely failing.
314
+ */
315
+ static getWarning(outcome) {
316
+ const failures = outcome.groupFailures || [];
317
+ const unsited = outcome.unsitedChildDeviceCount || 0;
318
+ /*
319
+ * Project scope always lands here, and this branch is what the topology
320
+ * API used to compute inline: warn iff the rule drew nothing, using
321
+ * describeOutcome's own words. The `!skipReason` guard makes the old
322
+ * code's implicit assumption explicit rather than emitting a warning with
323
+ * an undefined reason.
324
+ */
325
+ if (failures.length === 0 && unsited === 0) {
326
+ if (outcome.links.length > 0 || !outcome.skipReason) {
327
+ return null;
328
+ }
329
+ return {
330
+ ruleId: outcome.ruleId,
331
+ ruleName: outcome.ruleName,
332
+ reason: outcome.skipReason,
333
+ message: NetworkDeviceLinkRuleUtil.describeOutcome(outcome),
334
+ };
335
+ }
336
+ const parts = [];
337
+ const applicableSiteCount = outcome.applicableSiteCount || 0;
338
+ if (outcome.links.length === 0) {
339
+ parts.push("No site resolved this rule.");
340
+ }
341
+ else if (applicableSiteCount > 1) {
342
+ // A single applicable site needs no coverage fraction.
343
+ parts.push(`Drawing in ${applicableSiteCount - failures.length} of ${applicableSiteCount} sites.`);
344
+ }
345
+ const ambiguous = failures.filter((failure) => {
346
+ return failure.reason === "ambiguousParent";
347
+ });
348
+ const parentless = failures.filter((failure) => {
349
+ return failure.reason === "noParentMatched";
350
+ });
351
+ if (ambiguous.length === 1) {
352
+ /*
353
+ * The trailing sentence deliberately echoes the project-scope wording so
354
+ * an operator's vocabulary does not fork between the two scopes.
355
+ */
356
+ parts.push(`${ambiguous[0].matchedParentCount} devices carry the parent labels in ${NetworkDeviceLinkRuleUtil.describeSiteList(ambiguous)}. Exactly one must, or there is no way to tell which is the uplink.`);
357
+ }
358
+ else if (ambiguous.length > 1) {
359
+ parts.push(`Several devices carry the parent labels in ${NetworkDeviceLinkRuleUtil.describeSiteList(ambiguous)}. Exactly one per site must, or there is no way to tell which is the uplink.`);
360
+ }
361
+ if (parentless.length > 0) {
362
+ const stranded = parentless.reduce((sum, failure) => {
363
+ return sum + failure.matchedChildCount;
364
+ }, 0);
365
+ parts.push(`No device carries the parent labels in ${NetworkDeviceLinkRuleUtil.describeSiteList(parentless)}, so ${stranded} ${stranded === 1 ? "device" : "devices"} there ${stranded === 1 ? "has" : "have"} no uplink.`);
366
+ }
367
+ /*
368
+ * Always last and always its own sentence: the fix here is "assign these
369
+ * devices to a site", not "fix your labels", so they are never folded into
370
+ * a site-name list.
371
+ */
372
+ if (unsited > 0) {
373
+ parts.push(`${unsited} ${unsited === 1 ? "device" : "devices"} carrying the child labels ${unsited === 1 ? "is" : "are"} not assigned to a site, so this site-scoped rule skips ${unsited === 1 ? "it" : "them"}.`);
374
+ }
375
+ const warning = {
376
+ ruleId: outcome.ruleId,
377
+ ruleName: outcome.ruleName,
378
+ // Highest-ranked condition present. Ambiguity outranks a missing parent.
379
+ reason: ambiguous.length > 0
380
+ ? "ambiguousParent"
381
+ : parentless.length > 0
382
+ ? "noParentMatched"
383
+ : "devicesWithoutSite",
384
+ message: parts.join(" "),
385
+ };
386
+ /*
387
+ * The list, for the sentence the operator cannot act on. Written only when
388
+ * there are failing sites, so a warning that is purely about unsited
389
+ * devices — which names no site at all — keeps the exact shape it had.
390
+ *
391
+ * `siteCount` is the true total and `sites` may be shorter; a caller that
392
+ * reads sites.length as the number of broken sites is wrong at the cap,
393
+ * which is precisely the scale this exists for.
394
+ */
395
+ if (failures.length > 0) {
396
+ warning.siteCount = failures.length;
397
+ warning.sites = NetworkDeviceLinkRuleUtil.sortSiteFailures(failures)
398
+ .slice(0, NetworkDeviceLinkRuleUtil.MAX_LISTED_SITES)
399
+ .map((failure) => {
400
+ return {
401
+ siteId: failure.siteId,
402
+ siteName: failure.siteName,
403
+ reason: failure.reason,
404
+ strandedDeviceCount: failure.matchedChildCount,
405
+ matchedParentCount: failure.matchedParentCount,
406
+ };
407
+ });
408
+ }
409
+ return warning;
410
+ }
107
411
  }
412
+ /*
413
+ * Appended by the caller when the device list hit its row cap. Lives here so
414
+ * every operator-facing string this feature produces stays in one file.
415
+ */
416
+ NetworkDeviceLinkRuleUtil.TRUNCATED_DEVICE_LIST_NOTE = "The device list was truncated, so some of these may be false alarms.";
417
+ // Three names is enough to recognise a pattern; fourteen is a wall of text.
418
+ NetworkDeviceLinkRuleUtil.MAX_NAMED_SITES = 3;
419
+ /*
420
+ * How many failing sites ride back on the warning for the operator to work
421
+ * through. Far more than the sentence names, because this is a list nobody
422
+ * reads until they open it — but still capped: a project with 949 broken
423
+ * sites must not turn a 60-second map poll into a megabyte of site names.
424
+ */
425
+ NetworkDeviceLinkRuleUtil.MAX_LISTED_SITES = 100;
426
+ // Site names are ShortText and can run to 100 characters.
427
+ NetworkDeviceLinkRuleUtil.MAX_SITE_NAME_LENGTH = 40;
428
+ NetworkDeviceLinkRuleUtil.UNNAMED_SITE = "an unnamed site";
429
+ export default NetworkDeviceLinkRuleUtil;
108
430
  //# sourceMappingURL=NetworkDeviceLinkRuleUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkDeviceLinkRuleUtil.js","sourceRoot":"","sources":["../../../../Utils/Monitor/NetworkDeviceLinkRuleUtil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyCH,MAAM,CAAC,OAAO,OAAO,yBAAyB;IAC5C;;;;OAIG;IACK,MAAM,CAAC,aAAa,CAC1B,MAA2B,EAC3B,gBAA+B;QAE/B,MAAM,KAAK,GAAgB,IAAI,GAAG,CAAS,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5D,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAe,EAAE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S,CAAC,MAAM,GAAG,CAAC;gBAClB,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;oBACrB,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,oBAAoB;YAC5B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SACzB,CAAC;QAEF;;;;;;;;WAQG;QACH,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;YACpC,OAAO,CAAC,KAAK,GAAG,yBAAyB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;iBACjE,KAAK,CAAC,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC;iBACpD,GAAG,CAAC,CAAC,OAA6B,EAAE,EAAE;gBACrC,OAAO;oBACL,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,mBAAmB,EAAE,OAAO,CAAC,iBAAiB;oBAC9C,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;iBAC/C,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AAzkBD;;;GAGG;AACoB,oDAA0B,GAC/C,sEAAsE,CAAC;AAEzE,4EAA4E;AACpD,yCAAe,GAAW,CAAC,CAAC;AACpD;;;;;GAKG;AACoB,0CAAgB,GAAW,GAAG,CAAC;AACtD,0DAA0D;AAClC,8CAAoB,GAAW,EAAE,CAAC;AAClC,sCAAY,GAAW,iBAAiB,CAAC;eAnB9C,yBAAyB"}
@@ -0,0 +1,108 @@
1
+ import DeviceReachabilityUtil, { NetworkDeviceReachability, } from "./DeviceReachabilityUtil";
2
+ /**
3
+ * The state of one device.
4
+ *
5
+ * Order is load-bearing. A stamped monitor status is the operator's own
6
+ * system of record and beats everything; then hard-down beats everything
7
+ * else, because a device that does not answer has interface counts that
8
+ * are by definition stale; then — and only for a device known to be up —
9
+ * dark ports make it degraded.
10
+ *
11
+ * Note what this means for a device stamped "Degraded": the ladder does not
12
+ * call it offline, so it is up, and it lands in "degraded" only if it also
13
+ * reports dark ports. That is the device map's rule, reproduced exactly.
14
+ * Diverging from it here — however reasonable the divergence — would put a
15
+ * site card and the map it opens into disagreement, which is the one
16
+ * outcome this module exists to make impossible.
17
+ */
18
+ export function deviceHealthState(device, now) {
19
+ if (!device) {
20
+ return "unknown";
21
+ }
22
+ let isUp;
23
+ if (device.monitorStatusIsOffline === true ||
24
+ device.monitorStatusIsOffline === false) {
25
+ // Anything the ladder does not call OFFLINE is up. See the input docs.
26
+ isUp = !device.monitorStatusIsOffline;
27
+ }
28
+ else {
29
+ const reachability = DeviceReachabilityUtil.getStatus({
30
+ isReachable: device.isReachable,
31
+ lastPolledAt: device.lastPolledAt,
32
+ lastSeenAt: device.lastSeenAt,
33
+ pollingIntervalInMinutes: device.pollingIntervalInMinutes,
34
+ }, now);
35
+ if (reachability === NetworkDeviceReachability.Pending) {
36
+ return "unknown";
37
+ }
38
+ isUp = reachability === NetworkDeviceReachability.Up;
39
+ }
40
+ if (!isUp) {
41
+ return "down";
42
+ }
43
+ if (typeof device.interfacesDown === "number" &&
44
+ Number.isFinite(device.interfacesDown) &&
45
+ device.interfacesDown > 0) {
46
+ return "degraded";
47
+ }
48
+ return "healthy";
49
+ }
50
+ /** A fresh, all-zero tally. */
51
+ export function emptyDeviceHealthCounts() {
52
+ return {
53
+ total: 0,
54
+ down: 0,
55
+ degraded: 0,
56
+ healthy: 0,
57
+ unknown: 0,
58
+ };
59
+ }
60
+ /**
61
+ * Add one device's verdict to a tally, in place.
62
+ *
63
+ * Mutating on purpose: the hierarchy aggregator walks tens of thousands of
64
+ * devices into a few hundred buckets in one pass, and allocating a fresh
65
+ * five-field object per device is the whole cost of that pass.
66
+ */
67
+ export function addDeviceHealth(counts, state) {
68
+ counts.total += 1;
69
+ counts[state] += 1;
70
+ }
71
+ /** The sum of two tallies, as a new object. */
72
+ export function mergeDeviceHealthCounts(first, second) {
73
+ return {
74
+ total: first.total + second.total,
75
+ down: first.down + second.down,
76
+ degraded: first.degraded + second.degraded,
77
+ healthy: first.healthy + second.healthy,
78
+ unknown: first.unknown + second.unknown,
79
+ };
80
+ }
81
+ /**
82
+ * How many devices in this tally need somebody to look at them — the union
83
+ * of down and degraded, which is what every "needs attention" control in
84
+ * the product means by the phrase.
85
+ */
86
+ export function deviceAttentionCount(counts) {
87
+ return counts.down + counts.degraded;
88
+ }
89
+ /**
90
+ * The worst state present in a tally, or "unknown" for an empty one.
91
+ *
92
+ * Used to color a site by its devices: one dark switch in a store of forty
93
+ * makes the store's device rollup read "down", the same worst-of rule
94
+ * SiteStatusRollupUtil applies to the site's own MonitorStatus.
95
+ */
96
+ export function worstDeviceHealthState(counts) {
97
+ if (counts.down > 0) {
98
+ return "down";
99
+ }
100
+ if (counts.degraded > 0) {
101
+ return "degraded";
102
+ }
103
+ if (counts.healthy > 0) {
104
+ return "healthy";
105
+ }
106
+ return "unknown";
107
+ }
108
+ //# sourceMappingURL=DeviceHealthStateUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceHealthStateUtil.js","sourceRoot":"","sources":["../../../../Utils/NetworkDevice/DeviceHealthStateUtil.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,EAAE,EAC7B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AA6FlC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAiD,EACjD,GAAsB;IAEtB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,IAAa,CAAC;IAElB,IACE,MAAM,CAAC,sBAAsB,KAAK,IAAI;QACtC,MAAM,CAAC,sBAAsB,KAAK,KAAK,EACvC,CAAC;QACD,uEAAu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