@oneuptime/common 13.0.4 → 13.0.6

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 (1589) hide show
  1. package/Models/AnalyticsModels/AuditLog.ts +81 -1
  2. package/Models/AnalyticsModels/SecurityEvent.ts +4 -4
  3. package/Models/DatabaseModels/Alert.ts +62 -0
  4. package/Models/DatabaseModels/GlobalConfig.ts +1 -1
  5. package/Models/DatabaseModels/Incident.ts +66 -0
  6. package/Models/DatabaseModels/IncidentEpisodePublicNote.ts +74 -0
  7. package/Models/DatabaseModels/IncidentPublicNote.ts +74 -0
  8. package/Models/DatabaseModels/Index.ts +10 -4
  9. package/Models/DatabaseModels/NetworkDevice.ts +67 -0
  10. package/Models/DatabaseModels/NetworkDeviceDiagnostic.ts +746 -0
  11. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +151 -0
  12. package/Models/DatabaseModels/NetworkSiteAssignmentRule.ts +1 -1
  13. package/Models/DatabaseModels/Project.ts +41 -0
  14. package/Models/DatabaseModels/RumApplication.ts +1 -1
  15. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.ts +74 -0
  16. package/Models/DatabaseModels/{GoogleSecOpsConnection.ts → SecurityEventConnection.ts} +61 -51
  17. package/Models/DatabaseModels/{GoogleSecOpsConnectionRun.ts → SecurityEventConnectionRun.ts} +24 -24
  18. package/Models/DatabaseModels/ServiceLevelObjective.ts +185 -8
  19. package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.ts +746 -43
  20. package/Models/DatabaseModels/ServiceLevelObjectiveFeed.ts +575 -0
  21. package/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.ts +582 -0
  22. package/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.ts +16 -0
  23. package/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.ts +16 -0
  24. package/Models/DatabaseModels/StatusPageAnnouncement.ts +75 -0
  25. package/Models/DatabaseModels/TelemetryIngestionKey.ts +2 -2
  26. package/Models/DatabaseModels/ThreatIntelFeed.ts +1 -1
  27. package/Server/API/AIInvestigationAPI.ts +484 -24
  28. package/Server/API/BaseAPI.ts +17 -0
  29. package/Server/API/BillingInvoiceAPI.ts +343 -30
  30. package/Server/API/BillingPaymentMethodAPI.ts +126 -5
  31. package/Server/API/DashboardAPI.ts +96 -2
  32. package/Server/API/SecurityEventConnectionAPI.ts +380 -0
  33. package/Server/API/StatusPageAPI.ts +308 -199
  34. package/Server/API/TelemetryAPI.ts +402 -265
  35. package/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.ts +99 -0
  36. package/Server/Infrastructure/Postgres/SchemaMigrations/1792800000000-AddNetworkDeviceDiagnostic.ts +83 -0
  37. package/Server/Infrastructure/Postgres/SchemaMigrations/1792900000000-AddNetworkDeviceDnsNameAndShortDeviceNames.ts +36 -0
  38. package/Server/Infrastructure/Postgres/SchemaMigrations/1793000000000-AddNetbiosLookupToNetworkDeviceDiscoveryScan.ts +29 -0
  39. package/Server/Infrastructure/Postgres/SchemaMigrations/1793100000000-SloProductOverhaul.ts +516 -0
  40. package/Server/Infrastructure/Postgres/SchemaMigrations/1793200000000-BackfillSloMonitorRulesAndAffectedResources.ts +98 -0
  41. package/Server/Infrastructure/Postgres/SchemaMigrations/1793300000000-AddDataResidencyToProject.ts +27 -0
  42. package/Server/Infrastructure/Postgres/SchemaMigrations/1793400000000-AddSubscriberUpdateNotificationStatus.ts +97 -0
  43. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +16 -0
  44. package/Server/Middleware/TelemetryIngest.ts +101 -6
  45. package/Server/Services/AlertEpisodeLabelRuleEngineService.ts +138 -67
  46. package/Server/Services/AlertEpisodeOwnerRuleEngineService.ts +213 -84
  47. package/Server/Services/AlertEpisodePrivacyRuleEngineService.ts +112 -35
  48. package/Server/Services/AlertLabelRuleEngineService.ts +299 -217
  49. package/Server/Services/AlertOwnerRuleEngineService.ts +572 -396
  50. package/Server/Services/AlertPrivacyRuleEngineService.ts +116 -40
  51. package/Server/Services/AlertService.ts +111 -4
  52. package/Server/Services/AuditLogService.ts +612 -59
  53. package/Server/Services/BillingInvoiceService.ts +112 -102
  54. package/Server/Services/BillingService.ts +539 -11
  55. package/Server/Services/CephClusterLabelRuleEngineService.ts +170 -109
  56. package/Server/Services/CephClusterOwnerRuleEngineService.ts +233 -115
  57. package/Server/Services/CloudResourceLabelRuleEngineService.ts +163 -100
  58. package/Server/Services/CloudResourceOwnerRuleEngineService.ts +236 -115
  59. package/Server/Services/DashboardLabelRuleEngineService.ts +145 -84
  60. package/Server/Services/DashboardOwnerRuleEngineService.ts +213 -95
  61. package/Server/Services/DatabaseService.ts +171 -21
  62. package/Server/Services/DockerHostLabelRuleEngineService.ts +171 -110
  63. package/Server/Services/DockerHostOwnerRuleEngineService.ts +233 -115
  64. package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +181 -112
  65. package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +243 -118
  66. package/Server/Services/ExceptionAggregationService.ts +7 -16
  67. package/Server/Services/HostLabelRuleEngineService.ts +167 -106
  68. package/Server/Services/HostOwnerRuleEngineService.ts +229 -111
  69. package/Server/Services/IncidentEpisodeLabelRuleEngineService.ts +141 -67
  70. package/Server/Services/IncidentEpisodeOwnerRuleEngineService.ts +272 -72
  71. package/Server/Services/IncidentEpisodePrivacyRuleEngineService.ts +112 -35
  72. package/Server/Services/IncidentEpisodePublicNoteService.ts +24 -0
  73. package/Server/Services/IncidentLabelRuleEngineService.ts +279 -204
  74. package/Server/Services/IncidentOwnerRuleEngineService.ts +595 -425
  75. package/Server/Services/IncidentPrivacyRuleEngineService.ts +117 -44
  76. package/Server/Services/IncidentPublicNoteService.ts +24 -0
  77. package/Server/Services/IncidentService.ts +114 -3
  78. package/Server/Services/IncomingCallPolicyLabelRuleEngineService.ts +147 -83
  79. package/Server/Services/IncomingCallPolicyOwnerRuleEngineService.ts +221 -100
  80. package/Server/Services/Index.ts +10 -4
  81. package/Server/Services/InventoryItemService.ts +28 -0
  82. package/Server/Services/IoTFleetLabelRuleEngineService.ts +145 -84
  83. package/Server/Services/IoTFleetOwnerRuleEngineService.ts +213 -95
  84. package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +181 -112
  85. package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +243 -118
  86. package/Server/Services/LabelService.ts +23 -28
  87. package/Server/Services/LogAggregationService.ts +17 -23
  88. package/Server/Services/MetricAggregationService.ts +4 -14
  89. package/Server/Services/MonitorLabelRuleEngineService.ts +152 -92
  90. package/Server/Services/MonitorOwnerRuleEngineService.ts +220 -104
  91. package/Server/Services/MonitorProbeService.ts +20 -2
  92. package/Server/Services/MonitorService.ts +11 -9
  93. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +376 -5
  94. package/Server/Services/NetworkDeviceDiagnosticService.ts +417 -0
  95. package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +147 -83
  96. package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +218 -97
  97. package/Server/Services/NetworkDeviceService.ts +39 -2
  98. package/Server/Services/OnCallDutyPolicyLabelRuleEngineService.ts +151 -80
  99. package/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.ts +222 -97
  100. package/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.ts +154 -83
  101. package/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.ts +225 -100
  102. package/Server/Services/PodmanHostLabelRuleEngineService.ts +171 -110
  103. package/Server/Services/PodmanHostOwnerRuleEngineService.ts +235 -115
  104. package/Server/Services/ProjectService.ts +111 -10
  105. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +174 -110
  106. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +239 -116
  107. package/Server/Services/RumApplicationLabelRuleEngineService.ts +137 -73
  108. package/Server/Services/RumApplicationOwnerRuleEngineService.ts +200 -83
  109. package/Server/Services/RunbookLabelRuleEngineService.ts +146 -84
  110. package/Server/Services/RunbookOwnerRuleEngineService.ts +216 -95
  111. package/Server/Services/ScheduledMaintenanceLabelRuleEngineService.ts +324 -230
  112. package/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.ts +613 -428
  113. package/Server/Services/ScheduledMaintenancePublicNoteService.ts +24 -0
  114. package/Server/Services/ScheduledMaintenanceService.ts +43 -14
  115. package/Server/Services/{GoogleSecOpsConnectionRunService.ts → SecurityEventConnectionRunService.ts} +1 -1
  116. package/Server/Services/SecurityEventConnectionService.ts +590 -0
  117. package/Server/Services/ServerlessFunctionLabelRuleEngineService.ts +143 -74
  118. package/Server/Services/ServerlessFunctionOwnerRuleEngineService.ts +206 -85
  119. package/Server/Services/ServiceLabelRuleEngineService.ts +172 -110
  120. package/Server/Services/ServiceLevelObjectiveBurnRateRuleService.ts +1057 -18
  121. package/Server/Services/ServiceLevelObjectiveFeedService.ts +108 -0
  122. package/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.ts +793 -97
  123. package/Server/Services/ServiceLevelObjectiveMonitorRuleService.ts +1069 -0
  124. package/Server/Services/ServiceLevelObjectiveOwnerTeamService.ts +240 -1
  125. package/Server/Services/ServiceLevelObjectiveOwnerUserService.ts +257 -1
  126. package/Server/Services/ServiceLevelObjectiveService.ts +1356 -56
  127. package/Server/Services/ServiceOwnerRuleEngineService.ts +238 -116
  128. package/Server/Services/StatusPageAnnouncementService.ts +13 -0
  129. package/Server/Services/StatusPageLabelRuleEngineService.ts +146 -85
  130. package/Server/Services/StatusPageOwnerRuleEngineService.ts +210 -99
  131. package/Server/Services/StatusPageSubscriberNotificationTemplateService.ts +28 -232
  132. package/Server/Services/StatusPageSubscriberService.ts +6 -0
  133. package/Server/Services/TelemetryUsageBillingService.ts +38 -7
  134. package/Server/Services/ThreatIntelFeedService.ts +1 -1
  135. package/Server/Services/TraceAggregationService.ts +77 -28
  136. package/Server/Services/VMwareVCenterLabelRuleEngineService.ts +173 -110
  137. package/Server/Services/VMwareVCenterOwnerRuleEngineService.ts +238 -116
  138. package/Server/Services/WorkflowLabelRuleEngineService.ts +145 -84
  139. package/Server/Services/WorkflowOwnerRuleEngineService.ts +215 -95
  140. package/Server/Types/AnalyticsDatabase/ModelPermission.ts +9 -0
  141. package/Server/Types/Database/UpdateByID.ts +3 -0
  142. package/Server/Types/Database/UpdateOneBy.ts +7 -0
  143. package/Server/Utils/AI/AlertAIContextBuilder.ts +19 -0
  144. package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +13 -1
  145. package/Server/Utils/AI/IncidentAIContextBuilder.ts +39 -0
  146. package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +15 -1
  147. package/Server/Utils/AI/SRE/InvestigationEvidence.ts +658 -0
  148. package/Server/Utils/AI/SRE/InvestigationReferences.ts +324 -0
  149. package/Server/Utils/AI/Toolbox/AlertTools.ts +37 -1
  150. package/Server/Utils/AI/Toolbox/IncidentTools.ts +22 -1
  151. package/Server/Utils/AI/Toolbox/Index.ts +38 -0
  152. package/Server/Utils/AI/Toolbox/SloTools.ts +416 -51
  153. package/Server/Utils/AI/Toolbox/TimelineTools.ts +9 -2
  154. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +80 -0
  155. package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +151 -13
  156. package/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.ts +17 -4
  157. package/Server/Utils/Dashboard/PublicDashboardSloWidget.ts +155 -8
  158. package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +16 -0
  159. package/Server/Utils/Database/RelationValueUtil.ts +106 -0
  160. package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +6 -1
  161. package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +22 -27
  162. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +5 -3
  163. package/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.ts +3 -1
  164. package/Server/Utils/Monitor/MonitorStepsProjectValidator.ts +50 -20
  165. package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +13 -1
  166. package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +6 -11
  167. package/Server/Utils/Rules/MonitorRulePatternValidator.ts +51 -0
  168. package/Server/Utils/Rules/OwnerRuleAssignment.ts +110 -0
  169. package/Server/Utils/Rules/RuleRun/RuleApplication.ts +81 -0
  170. package/Server/Utils/Rules/RuleRun/RuleRunPermission.ts +188 -0
  171. package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +803 -0
  172. package/Server/Utils/Rules/RuleRun/RuleRunner.ts +341 -0
  173. package/Server/Utils/SecurityEvent/ConnectorErrorMessage.ts +3 -2
  174. package/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.ts +1108 -0
  175. package/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.ts +732 -0
  176. package/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.ts +497 -0
  177. package/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.ts +689 -0
  178. package/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.ts +767 -0
  179. package/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.ts +571 -0
  180. package/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.ts +827 -0
  181. package/Server/Utils/SecurityEvent/{GoogleSecOps → Connectors/GoogleSecOps}/GoogleSecOpsClient.ts +609 -74
  182. package/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnector.ts +2101 -0
  183. package/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.ts +610 -0
  184. package/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.ts +549 -0
  185. package/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.ts +830 -0
  186. package/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.ts +684 -0
  187. package/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.ts +487 -0
  188. package/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.ts +778 -0
  189. package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.ts +1182 -0
  190. package/Server/Utils/SecurityEvent/{GoogleSecOps/GoogleSecOpsRunExecutor.ts → Connectors/SecurityEventConnectionRunExecutor.ts} +165 -76
  191. package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.ts +306 -0
  192. package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.ts +55 -0
  193. package/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.ts +709 -0
  194. package/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.ts +596 -0
  195. package/Server/Utils/SecurityEvent/Connectors/Types.ts +431 -0
  196. package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +1 -1
  197. package/Server/Utils/SecurityEvent/SecurityEventDedupe.ts +81 -0
  198. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.ts +2 -2
  199. package/Server/Utils/SessionReplay/SessionReplayReadService.ts +902 -40
  200. package/Server/Utils/Slo/SloFeedUtil.ts +200 -0
  201. package/Server/Utils/Slo/SloLegacyMonitorLabelAdoption.ts +173 -0
  202. package/Server/Utils/Slo/SloMetricUtil.ts +327 -0
  203. package/Server/Utils/Slo/SloOwnerReferenceValidator.ts +208 -0
  204. package/Server/Utils/Slo/SloRecordReferenceValidator.ts +169 -0
  205. package/Server/Utils/StartServer.ts +10 -0
  206. package/Server/Utils/StatusPage/MonitorRulePatternValidator.ts +6 -43
  207. package/Server/Utils/StatusPageResource.ts +50 -5
  208. package/Server/Utils/Telemetry/EntityRegistry.ts +8 -0
  209. package/Server/Utils/Telemetry/KubernetesResourceAttributes.ts +108 -0
  210. package/Server/Utils/Telemetry/ResourceEntityFilter.ts +174 -93
  211. package/Server/Utils/Telemetry/ResourceFacetPlanner.ts +251 -0
  212. package/Server/Utils/Telemetry/ResourceFacetResolver.ts +248 -413
  213. package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +668 -0
  214. package/Server/Utils/Telemetry/TraceContextPropagation.ts +348 -0
  215. package/Server/Utils/Telemetry.ts +18 -0
  216. package/Tests/App/Dashboard/AIInvestigationHeaderStatus.test.tsx +1063 -1
  217. package/Tests/App/Dashboard/AIRootCauseFeedItem.test.tsx +285 -0
  218. package/Tests/App/Dashboard/AddWidgetModal.test.tsx +4 -1
  219. package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +242 -0
  220. package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +307 -0
  221. package/Tests/App/Dashboard/AlertEpisodeViewFields.test.tsx +601 -15
  222. package/Tests/App/Dashboard/ArchiveResourceCard.test.tsx +289 -0
  223. package/Tests/App/Dashboard/AuditLogsTable.test.tsx +598 -0
  224. package/Tests/App/Dashboard/BillingDefaultPaymentMethod.test.tsx +1046 -0
  225. package/Tests/App/Dashboard/BillingPaidUsageFlow.test.tsx +3 -0
  226. package/Tests/App/Dashboard/BillingPaymentMethodForm.test.tsx +201 -7
  227. package/Tests/App/Dashboard/BooleanSeriesCriteriaFilterText.test.ts +82 -0
  228. package/Tests/App/Dashboard/BreadcrumbCoverage.test.tsx +16 -1
  229. package/Tests/App/Dashboard/ChangeAlertStateAIHeader.test.tsx +943 -0
  230. package/Tests/App/Dashboard/ChatActivityFeed.test.tsx +168 -1
  231. package/Tests/App/Dashboard/CloudResourceTelemetryScope.test.ts +41 -0
  232. package/Tests/App/Dashboard/ConnectionTestModal.test.tsx +604 -0
  233. package/Tests/App/Dashboard/ConnectorTestReportView.test.tsx +755 -0
  234. package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +1095 -1
  235. package/Tests/App/Dashboard/CorrelateFilterChips.test.tsx +910 -0
  236. package/Tests/App/Dashboard/CorrelateGraph.test.tsx +3747 -25
  237. package/Tests/App/Dashboard/CorrelateGraphHelpers.test.ts +1085 -0
  238. package/Tests/App/Dashboard/CorrelateInspector.test.tsx +1534 -0
  239. package/Tests/App/Dashboard/CorrelateNodeCard.test.tsx +965 -0
  240. package/Tests/App/Dashboard/CorrelateResultSummary.test.tsx +1525 -0
  241. package/Tests/App/Dashboard/CorrelationGraph.test.ts +1030 -0
  242. package/Tests/App/Dashboard/CorrelationGraphLayout.test.ts +526 -0
  243. package/Tests/App/Dashboard/DashboardLazyPages.test.tsx +153 -6
  244. package/Tests/App/Dashboard/DeviceDiagnostics.test.tsx +787 -0
  245. package/Tests/App/Dashboard/DeviceLatencyTrend.test.tsx +278 -0
  246. package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +279 -0
  247. package/Tests/App/Dashboard/DiscoveryScanEditForm.test.tsx +87 -0
  248. package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +443 -8
  249. package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +165 -0
  250. package/Tests/App/Dashboard/EntityFilterDropdownArchivedSlos.test.tsx +340 -0
  251. package/Tests/App/Dashboard/EpisodeChangeState.test.tsx +1069 -0
  252. package/Tests/App/Dashboard/EpisodeMembersCard.test.tsx +772 -0
  253. package/Tests/App/Dashboard/EventOverviewPages.test.tsx +2450 -0
  254. package/Tests/App/Dashboard/EventOverviewSkeleton.test.tsx +210 -0
  255. package/Tests/App/Dashboard/EventStatBar.test.tsx +392 -0
  256. package/Tests/App/Dashboard/EventStatusPanel.test.tsx +247 -0
  257. package/Tests/App/Dashboard/ExceptionAIAssistance.test.tsx +606 -0
  258. package/Tests/App/Dashboard/ExceptionBreadcrumbTimeline.test.tsx +273 -0
  259. package/Tests/App/Dashboard/ExceptionDetailSideMenu.test.tsx +176 -0
  260. package/Tests/App/Dashboard/ExceptionOverviewCards.test.tsx +366 -0
  261. package/Tests/App/Dashboard/ExceptionSegmentedControl.test.tsx +1020 -0
  262. package/Tests/App/Dashboard/ExceptionSignalPages.test.tsx +371 -0
  263. package/Tests/App/Dashboard/ExceptionStackFrameViewer.test.tsx +440 -0
  264. package/Tests/App/Dashboard/ExceptionSummary.test.tsx +381 -0
  265. package/Tests/App/Dashboard/ExceptionTriage.test.tsx +306 -0
  266. package/Tests/App/Dashboard/ExceptionsResourceFacets.test.tsx +604 -0
  267. package/Tests/App/Dashboard/ExceptionsViewerEntityChips.test.tsx +706 -0
  268. package/Tests/App/Dashboard/FeedOrdering.test.ts +32 -0
  269. package/Tests/App/Dashboard/IncidentEpisodeViewFields.test.tsx +618 -13
  270. package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +254 -207
  271. package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +303 -135
  272. package/Tests/App/Dashboard/InvestigationEvidenceList.test.tsx +1472 -0
  273. package/Tests/App/Dashboard/InvestigationFeedRefresh.test.tsx +303 -0
  274. package/Tests/App/Dashboard/InvestigationPanel.test.tsx +1931 -25
  275. package/Tests/App/Dashboard/InvestigationPanelStatus.test.tsx +159 -2
  276. package/Tests/App/Dashboard/InvestigationReferenceLink.test.tsx +177 -0
  277. package/Tests/App/Dashboard/InvestigationReportView.test.tsx +1398 -0
  278. package/Tests/App/Dashboard/InvestigationRunDetails.test.tsx +1166 -0
  279. package/Tests/App/Dashboard/InvoicesPayInvoice.test.tsx +437 -0
  280. package/Tests/App/Dashboard/KubernetesImageReferenceView.test.tsx +114 -0
  281. package/Tests/App/Dashboard/KubernetesLogsTabChips.test.tsx +285 -0
  282. package/Tests/App/Dashboard/LogsEntityChipNames.test.tsx +316 -0
  283. package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +361 -0
  284. package/Tests/App/Dashboard/NetworkDeviceBulkDelete.test.tsx +65 -0
  285. package/Tests/App/Dashboard/NetworkTopologyLiveView.test.tsx +5 -0
  286. package/Tests/App/Dashboard/ProfileTableEntityNames.test.tsx +432 -0
  287. package/Tests/App/Dashboard/ProfileViewEntityName.test.tsx +250 -0
  288. package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +10 -0
  289. package/Tests/App/Dashboard/ResourceAuditLogsSideMenus.test.tsx +74 -0
  290. package/Tests/App/Dashboard/ResourceFeed.test.tsx +125 -5
  291. package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +8 -1
  292. package/Tests/App/Dashboard/ResourceLogsTabsBareLayout.test.tsx +700 -0
  293. package/Tests/App/Dashboard/ResourcePageEntityNameProps.test.tsx +803 -0
  294. package/Tests/App/Dashboard/RumSessionReplaySideMenu.test.tsx +11 -1
  295. package/Tests/App/Dashboard/ScheduledMaintenanceChangeState.test.tsx +1026 -0
  296. package/Tests/App/Dashboard/ScheduledMaintenanceFeedRefresh.test.tsx +436 -0
  297. package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +1195 -0
  298. package/Tests/App/Dashboard/SecurityEventConnectionDiagnostics.test.tsx +1764 -0
  299. package/Tests/App/Dashboard/SecurityEventConnectionFormModal.test.tsx +1958 -0
  300. package/Tests/App/Dashboard/SecurityEventConnectionsEmptyState.test.tsx +448 -0
  301. package/Tests/App/Dashboard/SecurityEventConnectionsTable.test.tsx +1455 -0
  302. package/Tests/App/Dashboard/SecurityEventSeverityPill.test.tsx +233 -0
  303. package/Tests/App/Dashboard/SecurityEventsEmptyState.test.tsx +282 -0
  304. package/Tests/App/Dashboard/SecurityEventsSideMenu.test.tsx +247 -0
  305. package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +375 -274
  306. package/Tests/App/Dashboard/SessionReplayAuditTable.test.tsx +410 -0
  307. package/Tests/App/Dashboard/SloActiveBurnEventsCard.test.tsx +538 -0
  308. package/Tests/App/Dashboard/SloBulkActionsArchive.test.tsx +252 -0
  309. package/Tests/App/Dashboard/SloDashboardTemplateWidgets.test.tsx +322 -518
  310. package/Tests/App/Dashboard/SloElement.test.tsx +194 -0
  311. package/Tests/App/Dashboard/SloFeed.test.tsx +289 -0
  312. package/Tests/App/Dashboard/SloHistoryCharts.test.tsx +471 -0
  313. package/Tests/App/Dashboard/SloHistorySeries.test.tsx +607 -0
  314. package/Tests/App/Dashboard/SloListWidget.test.tsx +783 -0
  315. package/Tests/App/Dashboard/SloMetricsPage.test.tsx +346 -0
  316. package/Tests/App/Dashboard/SloMonitorsPage.test.tsx +661 -0
  317. package/Tests/App/Dashboard/SloMonitorsSummaryCard.test.tsx +489 -0
  318. package/Tests/App/Dashboard/SloNavigationWiring.test.tsx +437 -0
  319. package/Tests/App/Dashboard/SloNoticeBanner.test.tsx +305 -0
  320. package/Tests/App/Dashboard/SloOverviewData.test.tsx +563 -0
  321. package/Tests/App/Dashboard/SloOverviewHero.test.tsx +311 -0
  322. package/Tests/App/Dashboard/SloOverviewKpiStrip.test.tsx +426 -0
  323. package/Tests/App/Dashboard/SloOverviewSidebarCards.test.tsx +493 -0
  324. package/Tests/App/Dashboard/SloSettings.test.tsx +633 -0
  325. package/Tests/App/Dashboard/SloStatusSummaryCards.test.tsx +403 -0
  326. package/Tests/App/Dashboard/SloViewSideMenuCounts.test.tsx +373 -0
  327. package/Tests/App/Dashboard/SloWidgetVariableBinding.test.tsx +689 -0
  328. package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +774 -0
  329. package/Tests/App/Dashboard/TopErrorsPanelResourceNames.test.tsx +316 -0
  330. package/Tests/App/Dashboard/TopologyConnectivitySection.test.tsx +206 -0
  331. package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +30 -0
  332. package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +88 -24
  333. package/Tests/App/Dashboard/TraceExplorer.test.tsx +1590 -0
  334. package/Tests/App/Dashboard/TraceWaterfall.test.tsx +488 -0
  335. package/Tests/App/Dashboard/TracesAnalyticsSeriesLabels.test.tsx +367 -0
  336. package/Tests/App/Dashboard/TracesEntityNames.test.tsx +617 -0
  337. package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +613 -0
  338. package/Tests/App/Dashboard/UseBulkShortenDeviceNames.test.tsx +1312 -0
  339. package/Tests/App/Dashboard/UseServiceNames.test.tsx +359 -0
  340. package/Tests/App/Dashboard/WidgetCatalog.test.ts +9 -1
  341. package/Tests/Models/AnalyticsModels/RumSessionReplayColumns.test.ts +14 -16
  342. package/Tests/Models/DatabaseModels/AuditLogModelConfiguration.test.ts +442 -0
  343. package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +13 -7
  344. package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +48 -1
  345. package/Tests/Models/DatabaseModels/SloOverhaulModels.test.ts +835 -0
  346. package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +3 -2
  347. package/Tests/Models/DiscoveryScanNetbiosLookupColumn.test.ts +328 -0
  348. package/Tests/Models/DiscoveryScanShortDeviceNamesColumn.test.ts +335 -0
  349. package/Tests/Models/InventoryItemNaming.test.ts +132 -16
  350. package/Tests/Models/NetworkDeviceDiagnosticContract.test.ts +194 -0
  351. package/Tests/Models/NetworkDeviceDnsNameColumn.test.ts +321 -0
  352. package/Tests/Models/ProjectDataResidencyColumn.test.ts +154 -0
  353. package/Tests/Models/SecurityDomainAccessControl.test.ts +197 -22
  354. package/Tests/Server/API/AIInvestigationAPI.test.ts +611 -2
  355. package/Tests/Server/API/AIInvestigationEvidenceAPI.test.ts +1098 -0
  356. package/Tests/Server/API/BaseAPI.test.ts +6 -0
  357. package/Tests/Server/API/BaseAPIUpdateMiscDataProps.test.ts +217 -0
  358. package/Tests/Server/API/BillingInvoiceAPI.test.ts +7 -0
  359. package/Tests/Server/API/BillingInvoiceAPIPaymentStates.test.ts +990 -0
  360. package/Tests/Server/API/BillingPaymentMethodAPI.test.ts +498 -0
  361. package/Tests/Server/API/DashboardPublicSloAPI.test.ts +405 -0
  362. package/Tests/Server/API/SecurityEventConnectionAPI.test.ts +1750 -0
  363. package/Tests/Server/API/SessionReplayAPI.test.ts +644 -1
  364. package/Tests/Server/API/StatusPageManageSubscriptionRecipient.test.ts +857 -0
  365. package/Tests/Server/API/StatusPageManageSubscriptionTemplateVariables.test.ts +1084 -0
  366. package/Tests/Server/API/TelemetryFacetsAPI.test.ts +810 -0
  367. package/Tests/Server/Infrastructure/E2EClickHouseFixtureAccess.test.ts +240 -0
  368. package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +33 -3
  369. package/Tests/Server/Infrastructure/Postgres/AddDataResidencyToProjectMigration.test.ts +202 -0
  370. package/Tests/Server/Infrastructure/Postgres/AddNetbiosLookupToNetworkDeviceDiscoveryScanMigration.test.ts +330 -0
  371. package/Tests/Server/Infrastructure/Postgres/AddNetworkDeviceDnsNameAndShortDeviceNamesMigration.test.ts +340 -0
  372. package/Tests/Server/Infrastructure/Postgres/BackfillSloMonitorRulesAndAffectedResourcesMigration.test.ts +343 -0
  373. package/Tests/Server/Infrastructure/Postgres/SloProductOverhaulMigration.test.ts +801 -0
  374. package/Tests/Server/Middleware/TelemetryIngestBrowserKey.test.ts +229 -0
  375. package/Tests/Server/Services/AddSubscriberUpdateNotificationStatusMigration.test.ts +307 -0
  376. package/Tests/Server/Services/AuditLogService.test.ts +1124 -0
  377. package/Tests/Server/Services/AutoImportScanCredentialSelect.test.ts +200 -1
  378. package/Tests/Server/Services/BillingInvoiceServiceMutexRelease.test.ts +254 -0
  379. package/Tests/Server/Services/BillingService.test.ts +70 -0
  380. package/Tests/Server/Services/BillingServicePayInvoiceStates.test.ts +723 -0
  381. package/Tests/Server/Services/BillingServicePaymentMethodReads.test.ts +14 -2
  382. package/Tests/Server/Services/BillingServiceSubscriptionPaymentMethodSync.test.ts +1634 -0
  383. package/Tests/Server/Services/DatabaseServiceAuditRelationDiff.test.ts +492 -0
  384. package/Tests/Server/Services/DatabaseServicePasswordFieldSecrets.test.ts +629 -0
  385. package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +431 -0
  386. package/Tests/Server/Services/IncidentAlertSloReferenceGuard.test.ts +358 -0
  387. package/Tests/Server/Services/InventoryItemDisplayName.test.ts +66 -0
  388. package/Tests/Server/Services/MonitorProbeServicePastDueMonitoring.test.ts +362 -0
  389. package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +1460 -1
  390. package/Tests/Server/Services/NetworkDeviceDiagnosticService.test.ts +962 -0
  391. package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +106 -0
  392. package/Tests/Server/Services/NetworkDeviceRuleEngines.test.ts +10 -1
  393. package/Tests/Server/Services/NetworkDeviceServicePastDueMonitoring.test.ts +335 -0
  394. package/Tests/Server/Services/NetworkDeviceSiteRuleDnsName.test.ts +568 -0
  395. package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +28 -1
  396. package/Tests/Server/Services/ProjectDataResidencyPostgres.test.ts +344 -0
  397. package/Tests/Server/Services/ProjectServiceAuditLogSettingsCache.test.ts +187 -0
  398. package/Tests/Server/Services/ProjectServiceDataResidency.test.ts +369 -0
  399. package/Tests/Server/Services/ProjectServiceDataResidencySelfHosted.test.ts +176 -0
  400. package/Tests/Server/Services/ProjectServicePastDueMonitoring.test.ts +289 -0
  401. package/Tests/Server/Services/ResourceFeedServices.test.ts +24 -8
  402. package/Tests/Server/Services/RuleRun/IncidentAlertMaintenanceRuleEnginesRun.test.ts +1396 -0
  403. package/Tests/Server/Services/RuleRun/LabelRuleEnginesGroupARun.test.ts +917 -0
  404. package/Tests/Server/Services/RuleRun/LabelRuleEnginesGroupBRun.test.ts +1262 -0
  405. package/Tests/Server/Services/RuleRun/OwnerRuleEnginesGroupARun.test.ts +902 -0
  406. package/Tests/Server/Services/RuleRun/OwnerRuleEnginesGroupBRun.test.ts +1163 -0
  407. package/Tests/Server/Services/RuleRun/PrivacyRuleEnginesRun.test.ts +843 -0
  408. package/Tests/Server/Services/ScheduledMaintenanceSubscriberTemplateFormats.test.ts +465 -0
  409. package/Tests/Server/Services/SecurityEventConnectionService.test.ts +1754 -0
  410. package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +77 -23
  411. package/Tests/Server/Services/ServiceLevelObjectiveBurnRateRuleFeedWrites.test.ts +777 -0
  412. package/Tests/Server/Services/ServiceLevelObjectiveBurnRateRuleOptions.test.ts +1399 -0
  413. package/Tests/Server/Services/ServiceLevelObjectiveBurnRateRuleService.test.ts +67 -74
  414. package/Tests/Server/Services/ServiceLevelObjectiveChildRowTenancy.test.ts +906 -0
  415. package/Tests/Server/Services/ServiceLevelObjectiveDeleteTenancy.test.ts +1029 -0
  416. package/Tests/Server/Services/ServiceLevelObjectiveFeedService.test.ts +313 -0
  417. package/Tests/Server/Services/ServiceLevelObjectiveFeedWrites.test.ts +1214 -0
  418. package/Tests/Server/Services/ServiceLevelObjectiveMarkdownLink.test.ts +289 -0
  419. package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.test.ts +1455 -430
  420. package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleLegacyLabelAdoption.test.ts +634 -0
  421. package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleService.test.ts +1193 -0
  422. package/Tests/Server/Services/{SloMonitorLabelRuleHooks.test.ts → ServiceLevelObjectiveMonitorRuleTriggers.test.ts} +135 -41
  423. package/Tests/Server/Services/ServiceLevelObjectiveOwnerFeedWrites.test.ts +671 -0
  424. package/Tests/Server/Services/ServiceLevelObjectiveService.test.ts +180 -85
  425. package/Tests/Server/Services/ServiceLevelObjectiveServiceArchive.test.ts +537 -0
  426. package/Tests/Server/Services/ServiceLevelObjectiveServiceLegacyMonitorLabelWrite.test.ts +870 -0
  427. package/Tests/Server/Services/ServiceLevelObjectiveServiceMonitorRuleGuard.test.ts +343 -0
  428. package/Tests/Server/Services/ServiceLevelObjectiveServiceReEvaluation.test.ts +246 -0
  429. package/Tests/Server/Services/SloAffectedResourceCreatedFeed.test.ts +501 -0
  430. package/Tests/Server/Services/SloAffectedResourceLinkContract.test.ts +86 -0
  431. package/Tests/Server/Services/SloAffectedResourceMetricAttributes.test.ts +547 -0
  432. package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +10 -4
  433. package/Tests/Server/Services/StatusPageMonitorRuleHooks.test.ts +7 -2
  434. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateCompile.test.ts +174 -0
  435. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateServiceVariables.test.ts +40 -0
  436. package/Tests/Server/Services/SubscriberUpdateNotificationHooks.test.ts +541 -0
  437. package/Tests/Server/Services/TelemetryIngestionKeyValidation.test.ts +53 -0
  438. package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +218 -0
  439. package/Tests/Server/Services/TelemetryResourceFacetFilters.test.ts +155 -1
  440. package/Tests/Server/Services/TelemetryUsageBillingSloExclusion.test.ts +288 -0
  441. package/Tests/Server/Services/TraceAggregationExceptionScope.test.ts +142 -0
  442. package/Tests/Server/Services/TraceAnalyticsResourceDisplayNames.test.ts +85 -24
  443. package/Tests/Server/TestingUtils/PastDueMonitoringClaimSql.ts +177 -0
  444. package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +51 -10
  445. package/Tests/Server/TestingUtils/__mocks__/Stripe.mock.ts +16 -1
  446. package/Tests/Server/Types/Database/Permissions/ProjectDataResidencyColumn.test.ts +386 -0
  447. package/Tests/Server/Types/Database/Permissions/SecurityRoleAccess.test.ts +34 -11
  448. package/Tests/Server/Utils/AI/InvestigationEvidence.test.ts +1395 -0
  449. package/Tests/Server/Utils/AI/InvestigationReferences.test.ts +616 -0
  450. package/Tests/Server/Utils/AI/SloAffectedResourceAIContext.test.ts +445 -0
  451. package/Tests/Server/Utils/AI/SloTools.test.ts +423 -1
  452. package/Tests/Server/Utils/AI/SloToolsArchive.test.ts +294 -0
  453. package/Tests/Server/Utils/AI/SloToolsRuleReadPermissions.test.ts +297 -0
  454. package/Tests/Server/Utils/AI/TimelineTools.test.ts +119 -0
  455. package/Tests/Server/Utils/AI/Toolbox/AIToolbox.test.ts +151 -0
  456. package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +65 -0
  457. package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorExceptionScope.test.ts +224 -0
  458. package/Tests/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.test.ts +255 -10
  459. package/Tests/Server/Utils/Dashboard/SloTemplatePublicDashboard.test.ts +404 -750
  460. package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +45 -0
  461. package/Tests/Server/Utils/Database/RelationValueUtil.test.ts +157 -0
  462. package/Tests/Server/Utils/Monitor/Criteria/BooleanSeriesEvaluateOverTime.test.ts +260 -0
  463. package/Tests/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.test.ts +181 -0
  464. package/Tests/Server/Utils/Monitor/Criteria/EvaluateOverTime.test.ts +147 -30
  465. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPerSeriesFanout.test.ts +55 -2
  466. package/Tests/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.test.ts +17 -0
  467. package/Tests/Server/Utils/Monitor/MonitorStepsProjectValidator.test.ts +136 -0
  468. package/Tests/Server/Utils/Monitor/MonitorStepsProjectValidatorLoadOrder.test.ts +472 -0
  469. package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +48 -2
  470. package/Tests/Server/Utils/Monitor/SloTemplateMetricEmitterContract.test.ts +435 -475
  471. package/Tests/Server/Utils/Rules/MonitorRulePatternValidator.test.ts +77 -0
  472. package/Tests/Server/Utils/Rules/OwnerRuleAssignment.test.ts +177 -0
  473. package/Tests/Server/Utils/Rules/RuleRun/RuleRunPermission.test.ts +365 -0
  474. package/Tests/Server/Utils/Rules/RuleRun/RuleRunRegistry.test.ts +173 -0
  475. package/Tests/Server/Utils/Rules/RuleRun/RuleRunner.test.ts +675 -0
  476. package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +8 -8
  477. package/Tests/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.test.ts +1240 -0
  478. package/Tests/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.test.ts +1853 -0
  479. package/Tests/Server/Utils/SecurityEvent/Connectors/ConnectorFetchSummary.test.ts +261 -0
  480. package/Tests/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.test.ts +1184 -0
  481. package/Tests/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.test.ts +1066 -0
  482. package/Tests/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.test.ts +1568 -0
  483. package/Tests/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.test.ts +930 -0
  484. package/Tests/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.test.ts +1409 -0
  485. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsAuth.test.ts → Connectors/GoogleSecOps/GoogleSecOpsAuth.test.ts} +5 -5
  486. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsClient.test.ts → Connectors/GoogleSecOps/GoogleSecOpsClient.test.ts} +9 -5
  487. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnector.test.ts +483 -0
  488. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorCuratedAndLateAlerts.test.ts +676 -0
  489. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorFetchEvents.test.ts +1994 -0
  490. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorFixtures.ts +332 -0
  491. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorHttpIntegration.test.ts +680 -0
  492. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorRequestContract.test.ts +1206 -0
  493. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnectorTestConnection.test.ts +1136 -0
  494. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsCuratedRuleCounts.test.ts +407 -0
  495. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsErrorHandling.test.ts → Connectors/GoogleSecOps/GoogleSecOpsErrorHandling.test.ts} +5 -5
  496. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingAdaptiveCatchUp.test.ts +730 -0
  497. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsClickhouseIntegration.test.ts → Connectors/GoogleSecOps/GoogleSecOpsPollingClickhouseIntegration.test.ts} +130 -35
  498. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingFailureTaxonomy.test.ts +772 -0
  499. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingFixtures.ts +648 -0
  500. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsHttpIntegration.test.ts → Connectors/GoogleSecOps/GoogleSecOpsPollingHttpIntegration.test.ts} +249 -222
  501. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingIntegration.test.ts +1390 -0
  502. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingLoop.test.ts +981 -0
  503. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsPollingNothingImportedRegression.test.ts +290 -0
  504. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsRequestContract.test.ts → Connectors/GoogleSecOps/GoogleSecOpsRequestContract.test.ts} +2 -2
  505. package/Tests/Server/Utils/SecurityEvent/{GoogleSecOpsResponseParsing.test.ts → Connectors/GoogleSecOps/GoogleSecOpsResponseParsing.test.ts} +5 -5
  506. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsSearchDetections.test.ts +763 -0
  507. package/Tests/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsTesterIntegration.test.ts +421 -0
  508. package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.test.ts +763 -0
  509. package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.test.ts +1296 -0
  510. package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.test.ts +1102 -0
  511. package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.test.ts +1174 -0
  512. package/Tests/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.test.ts +1032 -0
  513. package/Tests/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.test.ts +1558 -0
  514. package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.test.ts +4483 -0
  515. package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.test.ts +1178 -0
  516. package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.test.ts +1215 -0
  517. package/Tests/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.test.ts +1068 -0
  518. package/Tests/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.test.ts +1004 -0
  519. package/Tests/Server/Utils/SessionReplay/SessionReplayOriginAllowlist.test.ts +41 -0
  520. package/Tests/Server/Utils/SessionReplay/SessionReplayReadServiceQueries.test.ts +1966 -179
  521. package/Tests/Server/Utils/Slo/SloFeedUtil.test.ts +326 -0
  522. package/Tests/Server/Utils/Slo/SloLegacyMonitorLabelAdoption.test.ts +260 -0
  523. package/Tests/Server/Utils/Slo/SloMetricUtil.test.ts +592 -0
  524. package/Tests/Server/Utils/Slo/SloRecordReferenceValidator.test.ts +311 -0
  525. package/Tests/Server/Utils/StatusPageResource.test.ts +91 -3
  526. package/Tests/Server/Utils/Telemetry/KubernetesResourceAttributes.test.ts +162 -0
  527. package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +460 -13
  528. package/Tests/Server/Utils/Telemetry/ResourceFacetPlanner.test.ts +678 -0
  529. package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +348 -2
  530. package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +525 -0
  531. package/Tests/Server/Utils/Telemetry/TraceContextPropagation.test.ts +420 -0
  532. package/Tests/Types/Billing/SubscriptionStatus.test.ts +176 -0
  533. package/Tests/Types/Billing/SubscriptionStatusPastDueMonitoring.test.ts +187 -0
  534. package/Tests/Types/Dashboard/DashboardTemplateInvariants.test.ts +53 -7
  535. package/Tests/Types/Dashboard/SloDashboardTemplate.test.ts +816 -792
  536. package/Tests/Types/Monitor/CriteriaFilter.test.ts +216 -24
  537. package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +14 -1
  538. package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +14 -1
  539. package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +14 -1
  540. package/Tests/Types/Monitor/MonitorStepRetriesParsing.test.ts +201 -0
  541. package/Tests/Types/Rules/RuleRun.test.ts +315 -0
  542. package/Tests/Types/Rum/SessionReplayApiContracts.test.ts +133 -0
  543. package/Tests/Types/Rum/SessionReplayTransportContracts.test.ts +95 -0
  544. package/Tests/Types/SecurityEvent/Connectors/ConnectorDiagnostics.test.ts +82 -0
  545. package/Tests/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.test.ts +339 -0
  546. package/Tests/Types/StatusPage/SubscriberNotificationTemplateVariables.test.ts +217 -0
  547. package/Tests/Types/StatusPage/SubscriberUpdateNotification.test.ts +200 -0
  548. package/Tests/Types/Telemetry/ExceptionSpanScope.test.ts +89 -0
  549. package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +96 -0
  550. package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +304 -0
  551. package/Tests/UI/Components/ActiveFilterChipsLockedFilters.test.tsx +411 -0
  552. package/Tests/UI/Components/AlertBanner.test.tsx +319 -0
  553. package/Tests/UI/Components/BulkArchiveActionsCopy.test.tsx +310 -0
  554. package/Tests/UI/Components/Card.test.tsx +312 -1
  555. package/Tests/UI/Components/CardModelDetailHeaderLayout.test.tsx +253 -0
  556. package/Tests/UI/Components/CardModelDetailRefresher.test.tsx +342 -0
  557. package/Tests/UI/Components/Checkbox.test.tsx +79 -0
  558. package/Tests/UI/Components/CopyTextButton.test.tsx +142 -0
  559. package/Tests/UI/Components/Detail/DetailIdIsUnique.test.tsx +87 -0
  560. package/Tests/UI/Components/DetailCompactStyle.test.tsx +621 -0
  561. package/Tests/UI/Components/Dropdown/DropdownClearable.test.tsx +393 -0
  562. package/Tests/UI/Components/Dropdown/DropdownMultiSelectChipAccessibleName.test.tsx +64 -0
  563. package/Tests/UI/Components/EmptyState/EmptyState.test.tsx +335 -4
  564. package/Tests/UI/Components/EmptyState/EmptyStateGuideLinks.test.tsx +337 -0
  565. package/Tests/UI/Components/ErrorBoundary.test.tsx +60 -0
  566. package/Tests/UI/Components/FacetSections.test.tsx +581 -0
  567. package/Tests/UI/Components/FacetSidebarControls.test.tsx +812 -0
  568. package/Tests/UI/Components/FacetVisibility.test.ts +429 -0
  569. package/Tests/UI/Components/Forms/ModelFormJsonColumns.test.tsx +21 -20
  570. package/Tests/UI/Components/LabelRuleImportExport.test.tsx +15 -2
  571. package/Tests/UI/Components/LockedFilterChip.test.tsx +788 -0
  572. package/Tests/UI/Components/LogsEntityNames.test.ts +1769 -0
  573. package/Tests/UI/Components/LogsEntityNamesComponents.test.tsx +696 -0
  574. package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +600 -0
  575. package/Tests/UI/Components/LogsViewerEntityNames.test.tsx +713 -0
  576. package/Tests/UI/Components/MarkdownInlineReferences.test.tsx +2079 -0
  577. package/Tests/UI/Components/MemberRoleAssignment.test.tsx +446 -0
  578. package/Tests/UI/Components/ModelDetailRefetch.test.tsx +397 -0
  579. package/Tests/UI/Components/ModelListRefetch.test.tsx +233 -0
  580. package/Tests/UI/Components/ModelPageModelChange.test.tsx +409 -0
  581. package/Tests/UI/Components/MoreMenu.test.tsx +133 -0
  582. package/Tests/UI/Components/MoreMenuMotion.test.tsx +84 -3
  583. package/Tests/UI/Components/PaginationIntegration.test.tsx +25 -0
  584. package/Tests/UI/Components/ResourceFacetConfigs.test.ts +172 -0
  585. package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
  586. package/Tests/UI/Components/RuleRun/RuleDetailFields.test.tsx +336 -0
  587. package/Tests/UI/Components/RuleRun/RuleTable.test.tsx +304 -0
  588. package/Tests/UI/Components/RuleRun/RunRuleNowModal.test.tsx +231 -0
  589. package/Tests/UI/Components/RuleRun/RunRulesBulkAction.test.ts +213 -0
  590. package/Tests/UI/Components/SavedViewsSidebarIntegration.test.tsx +32 -14
  591. package/Tests/UI/Components/TableSortAndMobileColumns.test.tsx +44 -1
  592. package/Tests/UI/Components/TelemetryActiveFilterChipsLockedFilters.test.tsx +367 -0
  593. package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +718 -0
  594. package/Tests/UI/Monitor/EvaluationLogList.test.tsx +303 -0
  595. package/Tests/UI/Monitor/MonitorSummarySnapshotRender.test.tsx +55 -1
  596. package/Tests/UI/Rum/FidelityNotices.test.ts +22 -0
  597. package/Tests/UI/Rum/RecordingHealthCard.test.tsx +120 -136
  598. package/Tests/UI/Rum/RecordingHealthDashboard.test.tsx +988 -0
  599. package/Tests/UI/Rum/ReplayCard.test.tsx +32 -0
  600. package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +709 -12
  601. package/Tests/UI/Rum/ReplayEngine.test.ts +154 -0
  602. package/Tests/UI/Rum/ReplayHeader.test.tsx +284 -124
  603. package/Tests/UI/Rum/ReplayPinControl.test.tsx +189 -10
  604. package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +286 -12
  605. package/Tests/UI/Rum/ReplayRail.test.tsx +294 -0
  606. package/Tests/UI/Rum/ReplayScrubber.test.tsx +213 -1
  607. package/Tests/UI/Rum/ReplayStage.test.tsx +1228 -173
  608. package/Tests/UI/Rum/ReplayStageOverlays.test.tsx +433 -3
  609. package/Tests/UI/Rum/ReplayTabSwitcher.test.tsx +1391 -0
  610. package/Tests/UI/Rum/ReplayTimeline.test.tsx +222 -0
  611. package/Tests/UI/Rum/ReplayUi.test.tsx +189 -2
  612. package/Tests/UI/Rum/ReplayUserSessionsMenu.test.tsx +91 -0
  613. package/Tests/UI/Rum/SessionReplayEmptyState.test.tsx +1 -1
  614. package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +585 -0
  615. package/Tests/UI/Rum/SessionReplayTable.test.tsx +844 -51
  616. package/Tests/UI/Rum/SessionReplayUsersTable.test.tsx +29 -1
  617. package/Tests/UI/Telemetry/TelemetryDetailPanel.test.tsx +288 -0
  618. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +31 -1
  619. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +6 -0
  620. package/Tests/UI/Utils/Clipboard.test.ts +154 -0
  621. package/Tests/UI/Utils/DashboardStackingLayers.test.ts +8 -1
  622. package/Tests/UI/Utils/Navigation.test.ts +24 -0
  623. package/Tests/UI/Utils/RuleRunClient.test.ts +303 -0
  624. package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +2206 -0
  625. package/Tests/UI/Utils/Telemetry/UseTelemetryEntityNames.test.tsx +844 -0
  626. package/Tests/Utils/AI/InvestigationReport.test.ts +2430 -0
  627. package/Tests/Utils/APIOutgoingRequestTracer.test.ts +137 -0
  628. package/Tests/Utils/Dashboard/Components/DashboardComponentDefaults.test.ts +2 -0
  629. package/Tests/Utils/Dashboard/Components/DashboardSloListComponent.test.ts +206 -0
  630. package/Tests/Utils/Dashboard/DashboardSloComponent.test.ts +36 -2
  631. package/Tests/Utils/Dashboard/SloTemplateVariableScoping.test.ts +409 -588
  632. package/Tests/Utils/Dashboard/SloWidgetSource.test.ts +351 -0
  633. package/Tests/Utils/Markdown/MarkdownEscape.test.ts +361 -0
  634. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +1425 -118
  635. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +188 -3
  636. package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +661 -13
  637. package/Tests/Utils/NetworkDiscovery/NetbiosNameUtil.test.ts +349 -0
  638. package/Tests/Utils/NetworkDiscovery/RunImportedDeviceNaming.test.ts +656 -0
  639. package/Tests/Utils/NetworkDiscovery/ShortDeviceNamePlanner.test.ts +1020 -0
  640. package/Tests/Utils/NetworkDiscovery/ShortHostnameUtil.test.ts +619 -0
  641. package/Tests/Utils/NetworkSite/CidrMatchUtil.test.ts +317 -0
  642. package/Tests/Utils/Project/DataResidency.test.ts +198 -0
  643. package/Tests/Utils/Rules/RuleRunSummary.test.ts +394 -0
  644. package/Tests/Utils/Rum/SessionReplayHealthDiagnosis.test.ts +40 -0
  645. package/Tests/Utils/Rum/SessionReplayRecordingEnded.test.ts +619 -0
  646. package/Tests/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.test.ts +631 -0
  647. package/Tests/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.test.ts +479 -0
  648. package/Tests/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.test.ts +507 -0
  649. package/Tests/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.test.ts +686 -0
  650. package/Tests/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.test.ts +474 -0
  651. package/Tests/Utils/SecurityEvent/Connectors/OktaNormalizer.test.ts +736 -0
  652. package/Tests/Utils/SecurityEvent/Connectors/SplunkNormalizer.test.ts +407 -0
  653. package/Tests/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.test.ts +129 -0
  654. package/Tests/Utils/Slo/SloAffectedResourceMarkdown.test.ts +302 -0
  655. package/Tests/Utils/Slo/SloBurnRateTemplate.test.ts +468 -0
  656. package/Tests/Utils/Slo/SloEvaluation.test.ts +20 -4
  657. package/Tests/Utils/Slo/SloFeedMarkdown.test.ts +1185 -0
  658. package/Tests/Utils/Slo/SloHealth.test.ts +262 -0
  659. package/Tests/Utils/Slo/SloHistoryMetricName.test.ts +102 -0
  660. package/Tests/Utils/Slo/SloListWidgetFormat.test.ts +522 -0
  661. package/Tests/Utils/Slo/SloMetricType.test.ts +355 -0
  662. package/Tests/Utils/Slo/SloMonitorRuleCriteria.test.ts +387 -0
  663. package/Tests/Utils/Slo/SloMonitorStatusSummary.test.ts +210 -0
  664. package/Tests/Utils/Slo/SloOverviewText.test.ts +226 -0
  665. package/Tests/Utils/Slo/SloProjection.test.ts +1039 -0
  666. package/Tests/Utils/Slo/SloWidgetFormat.test.ts +47 -0
  667. package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +57 -1
  668. package/Tests/Utils/Telemetry/EntityRelationship.test.ts +36 -0
  669. package/Tests/Utils/Telemetry/LockedFilterSearch.test.ts +521 -0
  670. package/Tests/Utils/Telemetry/NetworkHost.test.ts +48 -0
  671. package/Tests/Utils/Telemetry/OriginAllowList.test.ts +154 -0
  672. package/Tests/Utils/Traces/CriticalPath.test.ts +25 -0
  673. package/Types/AI/AIChatTypes.ts +8 -0
  674. package/Types/AI/InvestigationEvidence.ts +96 -0
  675. package/Types/BaseDatabase/EnableAuditLogOn.ts +41 -0
  676. package/Types/Billing/SubscriptionStatus.ts +39 -4
  677. package/Types/Dashboard/DashboardComponentType.ts +1 -0
  678. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +5 -0
  679. package/Types/Dashboard/DashboardComponents/DashboardSloComponent.ts +10 -0
  680. package/Types/Dashboard/DashboardComponents/DashboardSloListComponent.ts +29 -0
  681. package/Types/Dashboard/DashboardTemplates.ts +290 -297
  682. package/Types/Database/EnableAuditLog.ts +23 -1
  683. package/Types/Email/EmailTemplateType.ts +4 -0
  684. package/Types/Monitor/CriteriaFilter.ts +55 -8
  685. package/Types/Monitor/MonitorEvaluationSummary.ts +5 -0
  686. package/Types/Monitor/MonitorStep.ts +5 -2
  687. package/Types/Monitor/MonitorStepDnsMonitor.ts +3 -1
  688. package/Types/Monitor/MonitorStepDnssecMonitor.ts +3 -1
  689. package/Types/Monitor/MonitorStepDomainMonitor.ts +3 -1
  690. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.ts +3 -1
  691. package/Types/Monitor/MonitorStepRetries.ts +59 -0
  692. package/Types/Monitor/MonitorStepSnmpMonitor.ts +9 -2
  693. package/Types/NetworkDevice/NetworkDeviceDiagnosticResult.ts +104 -0
  694. package/Types/NetworkDevice/NetworkDeviceDiagnosticStatus.ts +47 -0
  695. package/Types/NetworkDevice/NetworkDeviceDiagnosticType.ts +47 -0
  696. package/Types/NetworkDevice/NetworkDevicePingMetricNames.ts +20 -0
  697. package/Types/Permission.ts +129 -2
  698. package/Types/Rules/RuleCriteriaFieldRegistry.ts +5 -0
  699. package/Types/Rules/RuleRun.ts +518 -0
  700. package/Types/Rum/SessionReplay.ts +109 -0
  701. package/Types/Rum/SessionReplayApi.ts +49 -0
  702. package/Types/SecurityEvent/Connectors/ConnectorDiagnostics.ts +117 -0
  703. package/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.ts +113 -0
  704. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.ts +599 -0
  705. package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.ts +45 -0
  706. package/Types/SecurityEvent/GoogleSecOpsRegion.ts +34 -0
  707. package/Types/ServiceLevelObjective/SloHistoryMetricName.ts +25 -0
  708. package/Types/ServiceLevelObjective/SloMetricType.ts +49 -0
  709. package/Types/StatusPage/StatusPageSubscriberNotificationEventType.ts +4 -0
  710. package/Types/StatusPage/SubscriberNotificationTemplateVariables.ts +331 -0
  711. package/Types/StatusPage/SubscriberNotificationTrigger.ts +12 -0
  712. package/Types/StatusPage/SubscriberUpdateNotification.ts +89 -0
  713. package/Types/Telemetry/EntityType.ts +14 -0
  714. package/Types/Telemetry/ExceptionSpanScope.ts +83 -0
  715. package/Types/Telemetry/LockedFilterDetail.ts +25 -0
  716. package/Types/Telemetry/ResourceEntityFacet.ts +17 -10
  717. package/Types/Telemetry/ResourceFacetCatalog.ts +171 -0
  718. package/Types/Telemetry/ServiceType.ts +7 -0
  719. package/Typings/Index.d.ts +53 -3
  720. package/UI/Components/AlertBanner/AlertBanner.tsx +85 -27
  721. package/UI/Components/BulkUpdate/BulkArchiveActions.tsx +21 -2
  722. package/UI/Components/Card/Card.tsx +118 -83
  723. package/UI/Components/Checkbox/Checkbox.tsx +8 -5
  724. package/UI/Components/CopyTextButton/CopyTextButton.tsx +7 -1
  725. package/UI/Components/CustomFields/CustomFieldsDetail.tsx +4 -1
  726. package/UI/Components/Detail/Detail.tsx +145 -23
  727. package/UI/Components/Dropdown/Dropdown.tsx +64 -1
  728. package/UI/Components/EmptyState/EmptyState.tsx +27 -3
  729. package/UI/Components/EmptyState/EmptyStateGuideLinks.tsx +124 -0
  730. package/UI/Components/ErrorBoundary.tsx +38 -0
  731. package/UI/Components/Forms/ModelForm.tsx +6 -5
  732. package/UI/Components/LabelRule/LabelRuleTable.tsx +8 -2
  733. package/UI/Components/LogsViewer/LogsEntityNames.ts +912 -0
  734. package/UI/Components/LogsViewer/LogsViewer.tsx +152 -77
  735. package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +17 -11
  736. package/UI/Components/LogsViewer/components/FacetSection.tsx +66 -79
  737. package/UI/Components/LogsViewer/components/FacetValueRow.tsx +17 -2
  738. package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +45 -5
  739. package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +100 -19
  740. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +156 -39
  741. package/UI/Components/LogsViewer/components/LogsTable.tsx +30 -8
  742. package/UI/Components/LogsViewer/types.ts +6 -0
  743. package/UI/Components/Markdown.tsx/InlineReferences.tsx +628 -0
  744. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +385 -312
  745. package/UI/Components/MemberRoleAssignment/MemberRoleAssignment.tsx +50 -22
  746. package/UI/Components/ModelDetail/CardModelDetail.tsx +15 -0
  747. package/UI/Components/ModelDetail/ModelDetail.tsx +64 -19
  748. package/UI/Components/ModelList/ModelList.tsx +33 -8
  749. package/UI/Components/MoreMenu/MoreMenu.tsx +14 -3
  750. package/UI/Components/Page/ModelPage.tsx +119 -54
  751. package/UI/Components/RuleRun/RuleDetailFields.tsx +359 -0
  752. package/UI/Components/RuleRun/RuleTable.tsx +183 -0
  753. package/UI/Components/RuleRun/RuleView.tsx +170 -0
  754. package/UI/Components/RuleRun/RunRuleNowModal.tsx +147 -0
  755. package/UI/Components/RuleRun/RunRulesBulkAction.ts +103 -0
  756. package/UI/Components/Table/Table.tsx +8 -0
  757. package/UI/Components/Table/TableRow.tsx +13 -5
  758. package/UI/Components/TelemetryViewer/FacetVisibility.ts +229 -0
  759. package/UI/Components/TelemetryViewer/ResourceFacetConfigs.ts +46 -0
  760. package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +7 -0
  761. package/UI/Components/TelemetryViewer/components/FacetSearchInput.tsx +79 -0
  762. package/UI/Components/TelemetryViewer/components/FacetSectionHeader.tsx +69 -0
  763. package/UI/Components/TelemetryViewer/components/FacetShowMoreButton.tsx +36 -0
  764. package/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.tsx +88 -0
  765. package/UI/Components/TelemetryViewer/components/LockedFilterChip.tsx +430 -0
  766. package/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.tsx +14 -10
  767. package/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.tsx +203 -10
  768. package/UI/Components/TelemetryViewer/components/TelemetryFacetSection.tsx +60 -73
  769. package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +94 -7
  770. package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +17 -2
  771. package/UI/Components/TelemetryViewer/types.ts +19 -0
  772. package/UI/Components/TelemetryViewer/useFacetSearchExemptions.ts +158 -0
  773. package/UI/Components/TelemetryViewer/useFacetSectionSearch.ts +102 -0
  774. package/UI/Utils/Clipboard.ts +68 -2
  775. package/UI/Utils/Navigation.ts +17 -2
  776. package/UI/Utils/Rules/RuleRunClient.ts +178 -0
  777. package/UI/Utils/Telemetry/TelemetryEntityNames.ts +628 -0
  778. package/UI/Utils/Telemetry/UseTelemetryEntityNames.ts +151 -0
  779. package/Utils/AI/InvestigationReport.ts +1789 -0
  780. package/Utils/API.ts +90 -1
  781. package/Utils/Dashboard/Components/DashboardSloComponent.ts +19 -2
  782. package/Utils/Dashboard/Components/DashboardSloListComponent.ts +126 -0
  783. package/Utils/Dashboard/Components/Index.ts +7 -0
  784. package/Utils/Dashboard/SloWidgetSource.ts +188 -0
  785. package/Utils/Markdown/MarkdownEscape.ts +63 -0
  786. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +161 -36
  787. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +25 -0
  788. package/Utils/NetworkDiscovery/NetbiosNameUtil.ts +146 -0
  789. package/Utils/NetworkDiscovery/RunImportedDeviceNaming.ts +390 -0
  790. package/Utils/NetworkDiscovery/ShortDeviceNamePlanner.ts +291 -0
  791. package/Utils/NetworkDiscovery/ShortHostnameUtil.ts +91 -0
  792. package/Utils/NetworkSite/CidrMatchUtil.ts +37 -12
  793. package/Utils/Project/DataResidency.ts +63 -0
  794. package/Utils/Rules/RuleRunSummary.ts +323 -0
  795. package/Utils/Rum/SessionReplayHealth.ts +11 -0
  796. package/Utils/Rum/SessionReplayRecordingEnded.ts +134 -0
  797. package/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.ts +427 -0
  798. package/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.ts +197 -0
  799. package/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.ts +464 -0
  800. package/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.ts +567 -0
  801. package/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.ts +299 -0
  802. package/Utils/SecurityEvent/Connectors/OktaNormalizer.ts +467 -0
  803. package/Utils/SecurityEvent/Connectors/SplunkNormalizer.ts +439 -0
  804. package/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.ts +124 -12
  805. package/Utils/Slo/SloAffectedResourceMarkdown.ts +123 -0
  806. package/Utils/Slo/SloBurnRateTemplate.ts +373 -0
  807. package/Utils/Slo/SloFeedMarkdown.ts +1507 -0
  808. package/Utils/Slo/SloHealth.ts +96 -9
  809. package/Utils/Slo/SloListWidgetFormat.ts +370 -0
  810. package/Utils/Slo/SloMetricType.ts +237 -0
  811. package/Utils/Slo/SloMonitorRuleCriteria.ts +364 -0
  812. package/Utils/Slo/SloMonitorStatusSummary.ts +210 -0
  813. package/Utils/Slo/SloOverviewText.ts +265 -0
  814. package/Utils/Slo/SloProjection.ts +967 -0
  815. package/Utils/Slo/SloWidgetFormat.ts +12 -2
  816. package/Utils/Telemetry/CrossSignalScope.ts +22 -8
  817. package/Utils/Telemetry/EntityRelationship.ts +8 -0
  818. package/Utils/Telemetry/LockedFilterSearch.ts +366 -0
  819. package/Utils/Telemetry/NetworkHost.ts +43 -0
  820. package/Utils/Telemetry/OriginAllowList.ts +139 -4
  821. package/Utils/Traces/CriticalPath.ts +10 -4
  822. package/build/dist/Models/AnalyticsModels/AuditLog.js +70 -1
  823. package/build/dist/Models/AnalyticsModels/AuditLog.js.map +1 -1
  824. package/build/dist/Models/AnalyticsModels/SecurityEvent.js +4 -4
  825. package/build/dist/Models/DatabaseModels/Alert.js +60 -0
  826. package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
  827. package/build/dist/Models/DatabaseModels/GlobalConfig.js +1 -1
  828. package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
  829. package/build/dist/Models/DatabaseModels/Incident.js +64 -0
  830. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  831. package/build/dist/Models/DatabaseModels/IncidentEpisodePublicNote.js +75 -0
  832. package/build/dist/Models/DatabaseModels/IncidentEpisodePublicNote.js.map +1 -1
  833. package/build/dist/Models/DatabaseModels/IncidentPublicNote.js +75 -0
  834. package/build/dist/Models/DatabaseModels/IncidentPublicNote.js.map +1 -1
  835. package/build/dist/Models/DatabaseModels/Index.js +10 -4
  836. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  837. package/build/dist/Models/DatabaseModels/NetworkDevice.js +68 -0
  838. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  839. package/build/dist/Models/DatabaseModels/NetworkDeviceDiagnostic.js +772 -0
  840. package/build/dist/Models/DatabaseModels/NetworkDeviceDiagnostic.js.map +1 -0
  841. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +140 -0
  842. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  843. package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js +1 -1
  844. package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js.map +1 -1
  845. package/build/dist/Models/DatabaseModels/Project.js +42 -0
  846. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  847. package/build/dist/Models/DatabaseModels/RumApplication.js +1 -1
  848. package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
  849. package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +75 -0
  850. package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js.map +1 -1
  851. package/build/dist/Models/DatabaseModels/{GoogleSecOpsConnection.js → SecurityEventConnection.js} +87 -75
  852. package/build/dist/Models/DatabaseModels/SecurityEventConnection.js.map +1 -0
  853. package/build/dist/Models/DatabaseModels/{GoogleSecOpsConnectionRun.js → SecurityEventConnectionRun.js} +37 -37
  854. package/build/dist/Models/DatabaseModels/SecurityEventConnectionRun.js.map +1 -0
  855. package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js +192 -10
  856. package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js.map +1 -1
  857. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +798 -96
  858. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js.map +1 -1
  859. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveFeed.js +596 -0
  860. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveFeed.js.map +1 -0
  861. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.js +590 -0
  862. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.js.map +1 -0
  863. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js +16 -0
  864. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js.map +1 -1
  865. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js +16 -0
  866. package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js.map +1 -1
  867. package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +75 -0
  868. package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
  869. package/build/dist/Models/DatabaseModels/TelemetryIngestionKey.js +2 -2
  870. package/build/dist/Models/DatabaseModels/TelemetryIngestionKey.js.map +1 -1
  871. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +1 -1
  872. package/build/dist/Server/API/AIInvestigationAPI.js +336 -27
  873. package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
  874. package/build/dist/Server/API/BaseAPI.js +14 -0
  875. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  876. package/build/dist/Server/API/BillingInvoiceAPI.js +233 -19
  877. package/build/dist/Server/API/BillingInvoiceAPI.js.map +1 -1
  878. package/build/dist/Server/API/BillingPaymentMethodAPI.js +86 -5
  879. package/build/dist/Server/API/BillingPaymentMethodAPI.js.map +1 -1
  880. package/build/dist/Server/API/DashboardAPI.js +72 -2
  881. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  882. package/build/dist/Server/API/SecurityEventConnectionAPI.js +263 -0
  883. package/build/dist/Server/API/SecurityEventConnectionAPI.js.map +1 -0
  884. package/build/dist/Server/API/StatusPageAPI.js +236 -154
  885. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  886. package/build/dist/Server/API/TelemetryAPI.js +248 -170
  887. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  888. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.js +40 -0
  889. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.js.map +1 -0
  890. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792800000000-AddNetworkDeviceDiagnostic.js +34 -0
  891. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792800000000-AddNetworkDeviceDiagnostic.js.map +1 -0
  892. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792900000000-AddNetworkDeviceDnsNameAndShortDeviceNames.js +24 -0
  893. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792900000000-AddNetworkDeviceDnsNameAndShortDeviceNames.js.map +1 -0
  894. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793000000000-AddNetbiosLookupToNetworkDeviceDiscoveryScan.js +21 -0
  895. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793000000000-AddNetbiosLookupToNetworkDeviceDiscoveryScan.js.map +1 -0
  896. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793100000000-SloProductOverhaul.js +207 -0
  897. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793100000000-SloProductOverhaul.js.map +1 -0
  898. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793200000000-BackfillSloMonitorRulesAndAffectedResources.js +72 -0
  899. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793200000000-BackfillSloMonitorRulesAndAffectedResources.js.map +1 -0
  900. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793300000000-AddDataResidencyToProject.js +20 -0
  901. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793300000000-AddDataResidencyToProject.js.map +1 -0
  902. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793400000000-AddSubscriberUpdateNotificationStatus.js +46 -0
  903. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793400000000-AddSubscriberUpdateNotificationStatus.js.map +1 -0
  904. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +16 -0
  905. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  906. package/build/dist/Server/Middleware/TelemetryIngest.js +57 -4
  907. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  908. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js +112 -56
  909. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js.map +1 -1
  910. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js +167 -68
  911. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js.map +1 -1
  912. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js +87 -26
  913. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js.map +1 -1
  914. package/build/dist/Server/Services/AlertLabelRuleEngineService.js +270 -203
  915. package/build/dist/Server/Services/AlertLabelRuleEngineService.js.map +1 -1
  916. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js +498 -354
  917. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js.map +1 -1
  918. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js +97 -34
  919. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js.map +1 -1
  920. package/build/dist/Server/Services/AlertService.js +91 -8
  921. package/build/dist/Server/Services/AlertService.js.map +1 -1
  922. package/build/dist/Server/Services/AuditLogService.js +408 -44
  923. package/build/dist/Server/Services/AuditLogService.js.map +1 -1
  924. package/build/dist/Server/Services/BillingInvoiceService.js +94 -85
  925. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  926. package/build/dist/Server/Services/BillingService.js +406 -14
  927. package/build/dist/Server/Services/BillingService.js.map +1 -1
  928. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +141 -92
  929. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
  930. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +189 -101
  931. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
  932. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +135 -86
  933. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
  934. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +189 -100
  935. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
  936. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js +117 -69
  937. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js.map +1 -1
  938. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js +171 -83
  939. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js.map +1 -1
  940. package/build/dist/Server/Services/DatabaseService.js +125 -18
  941. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  942. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +141 -92
  943. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
  944. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +189 -101
  945. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
  946. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +145 -91
  947. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
  948. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +191 -101
  949. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
  950. package/build/dist/Server/Services/ExceptionAggregationService.js +7 -16
  951. package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
  952. package/build/dist/Server/Services/HostLabelRuleEngineService.js +141 -92
  953. package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
  954. package/build/dist/Server/Services/HostOwnerRuleEngineService.js +190 -102
  955. package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
  956. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js +112 -56
  957. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js.map +1 -1
  958. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js +220 -63
  959. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js.map +1 -1
  960. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js +87 -26
  961. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js.map +1 -1
  962. package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js +24 -0
  963. package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js.map +1 -1
  964. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js +258 -192
  965. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js.map +1 -1
  966. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js +519 -376
  967. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js.map +1 -1
  968. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js +95 -32
  969. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js.map +1 -1
  970. package/build/dist/Server/Services/IncidentPublicNoteService.js +24 -0
  971. package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
  972. package/build/dist/Server/Services/IncidentService.js +90 -5
  973. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  974. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js +113 -65
  975. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js.map +1 -1
  976. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js +171 -83
  977. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js.map +1 -1
  978. package/build/dist/Server/Services/Index.js +10 -4
  979. package/build/dist/Server/Services/Index.js.map +1 -1
  980. package/build/dist/Server/Services/InventoryItemService.js +22 -0
  981. package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
  982. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js +117 -69
  983. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js.map +1 -1
  984. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js +171 -83
  985. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js.map +1 -1
  986. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +145 -91
  987. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
  988. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +191 -101
  989. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
  990. package/build/dist/Server/Services/LabelService.js +20 -25
  991. package/build/dist/Server/Services/LabelService.js.map +1 -1
  992. package/build/dist/Server/Services/LogAggregationService.js +8 -17
  993. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  994. package/build/dist/Server/Services/MetricAggregationService.js +4 -14
  995. package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
  996. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js +123 -77
  997. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js.map +1 -1
  998. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js +167 -82
  999. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js.map +1 -1
  1000. package/build/dist/Server/Services/MonitorProbeService.js +18 -2
  1001. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  1002. package/build/dist/Server/Services/MonitorService.js +11 -9
  1003. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  1004. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +287 -5
  1005. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
  1006. package/build/dist/Server/Services/NetworkDeviceDiagnosticService.js +333 -0
  1007. package/build/dist/Server/Services/NetworkDeviceDiagnosticService.js.map +1 -0
  1008. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +117 -69
  1009. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -1
  1010. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +171 -83
  1011. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -1
  1012. package/build/dist/Server/Services/NetworkDeviceService.js +36 -2
  1013. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  1014. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js +117 -64
  1015. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js.map +1 -1
  1016. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js +173 -83
  1017. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js.map +1 -1
  1018. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js +116 -65
  1019. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js.map +1 -1
  1020. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js +171 -83
  1021. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js.map +1 -1
  1022. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +141 -92
  1023. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
  1024. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +189 -101
  1025. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
  1026. package/build/dist/Server/Services/ProjectService.js +82 -10
  1027. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  1028. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +141 -92
  1029. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
  1030. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +189 -101
  1031. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
  1032. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js +111 -63
  1033. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js.map +1 -1
  1034. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js +161 -77
  1035. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js.map +1 -1
  1036. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js +117 -69
  1037. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js.map +1 -1
  1038. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js +171 -83
  1039. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js.map +1 -1
  1040. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js +280 -209
  1041. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js.map +1 -1
  1042. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js +521 -376
  1043. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js.map +1 -1
  1044. package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +24 -0
  1045. package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
  1046. package/build/dist/Server/Services/ScheduledMaintenanceService.js +24 -8
  1047. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  1048. package/build/dist/Server/Services/{GoogleSecOpsConnectionRunService.js → SecurityEventConnectionRunService.js} +2 -2
  1049. package/build/dist/Server/Services/SecurityEventConnectionRunService.js.map +1 -0
  1050. package/build/dist/Server/Services/SecurityEventConnectionService.js +396 -0
  1051. package/build/dist/Server/Services/SecurityEventConnectionService.js.map +1 -0
  1052. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js +115 -62
  1053. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js.map +1 -1
  1054. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js +163 -77
  1055. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js.map +1 -1
  1056. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +141 -92
  1057. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
  1058. package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js +769 -18
  1059. package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js.map +1 -1
  1060. package/build/dist/Server/Services/ServiceLevelObjectiveFeedService.js +96 -0
  1061. package/build/dist/Server/Services/ServiceLevelObjectiveFeedService.js.map +1 -0
  1062. package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.js +614 -87
  1063. package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.js.map +1 -1
  1064. package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleService.js +844 -0
  1065. package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleService.js.map +1 -0
  1066. package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js +207 -1
  1067. package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js.map +1 -1
  1068. package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js +221 -1
  1069. package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js.map +1 -1
  1070. package/build/dist/Server/Services/ServiceLevelObjectiveService.js +997 -50
  1071. package/build/dist/Server/Services/ServiceLevelObjectiveService.js.map +1 -1
  1072. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +191 -102
  1073. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
  1074. package/build/dist/Server/Services/StatusPageAnnouncementService.js +12 -0
  1075. package/build/dist/Server/Services/StatusPageAnnouncementService.js.map +1 -1
  1076. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js +118 -70
  1077. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js.map +1 -1
  1078. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js +158 -76
  1079. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js.map +1 -1
  1080. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js +19 -215
  1081. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js.map +1 -1
  1082. package/build/dist/Server/Services/StatusPageSubscriberService.js +6 -0
  1083. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  1084. package/build/dist/Server/Services/TelemetryUsageBillingService.js +27 -5
  1085. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  1086. package/build/dist/Server/Services/ThreatIntelFeedService.js +1 -1
  1087. package/build/dist/Server/Services/TraceAggregationService.js +51 -25
  1088. package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
  1089. package/build/dist/Server/Services/VMwareVCenterLabelRuleEngineService.js +141 -92
  1090. package/build/dist/Server/Services/VMwareVCenterLabelRuleEngineService.js.map +1 -1
  1091. package/build/dist/Server/Services/VMwareVCenterOwnerRuleEngineService.js +189 -101
  1092. package/build/dist/Server/Services/VMwareVCenterOwnerRuleEngineService.js.map +1 -1
  1093. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js +117 -69
  1094. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js.map +1 -1
  1095. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js +171 -83
  1096. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js.map +1 -1
  1097. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +9 -0
  1098. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
  1099. package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js +17 -0
  1100. package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js.map +1 -1
  1101. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +3 -0
  1102. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
  1103. package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js +31 -0
  1104. package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js.map +1 -1
  1105. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +14 -7
  1106. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
  1107. package/build/dist/Server/Utils/AI/SRE/InvestigationEvidence.js +468 -0
  1108. package/build/dist/Server/Utils/AI/SRE/InvestigationEvidence.js.map +1 -0
  1109. package/build/dist/Server/Utils/AI/SRE/InvestigationReferences.js +230 -0
  1110. package/build/dist/Server/Utils/AI/SRE/InvestigationReferences.js.map +1 -0
  1111. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +24 -1
  1112. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
  1113. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +21 -1
  1114. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
  1115. package/build/dist/Server/Utils/AI/Toolbox/Index.js +32 -0
  1116. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
  1117. package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +337 -53
  1118. package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -1
  1119. package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +6 -2
  1120. package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -1
  1121. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +59 -0
  1122. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  1123. package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +108 -15
  1124. package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
  1125. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js +2 -2
  1126. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js.map +1 -1
  1127. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js +115 -6
  1128. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js.map +1 -1
  1129. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +13 -0
  1130. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -1
  1131. package/build/dist/Server/Utils/Database/RelationValueUtil.js +82 -0
  1132. package/build/dist/Server/Utils/Database/RelationValueUtil.js.map +1 -0
  1133. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +10 -6
  1134. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
  1135. package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +17 -21
  1136. package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
  1137. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +5 -3
  1138. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  1139. package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js +5 -4
  1140. package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js.map +1 -1
  1141. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js +50 -10
  1142. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js.map +1 -1
  1143. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +13 -1
  1144. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
  1145. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +6 -10
  1146. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -1
  1147. package/build/dist/Server/Utils/Rules/MonitorRulePatternValidator.js +34 -0
  1148. package/build/dist/Server/Utils/Rules/MonitorRulePatternValidator.js.map +1 -0
  1149. package/build/dist/Server/Utils/Rules/OwnerRuleAssignment.js +69 -0
  1150. package/build/dist/Server/Utils/Rules/OwnerRuleAssignment.js.map +1 -0
  1151. package/build/dist/Server/Utils/Rules/RuleRun/RuleApplication.js +25 -0
  1152. package/build/dist/Server/Utils/Rules/RuleRun/RuleApplication.js.map +1 -0
  1153. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunPermission.js +128 -0
  1154. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunPermission.js.map +1 -0
  1155. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +746 -0
  1156. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -0
  1157. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunner.js +221 -0
  1158. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunner.js.map +1 -0
  1159. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js +3 -2
  1160. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js.map +1 -1
  1161. package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.js +752 -0
  1162. package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.js.map +1 -0
  1163. package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.js +493 -0
  1164. package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.js.map +1 -0
  1165. package/build/dist/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.js +354 -0
  1166. package/build/dist/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.js.map +1 -0
  1167. package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.js +405 -0
  1168. package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.js.map +1 -0
  1169. package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.js +466 -0
  1170. package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.js.map +1 -0
  1171. package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.js +344 -0
  1172. package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.js.map +1 -0
  1173. package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.js +511 -0
  1174. package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.js.map +1 -0
  1175. package/build/dist/Server/Utils/SecurityEvent/{GoogleSecOps → Connectors/GoogleSecOps}/GoogleSecOpsClient.js +401 -68
  1176. package/build/dist/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsClient.js.map +1 -0
  1177. package/build/dist/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnector.js +1417 -0
  1178. package/build/dist/Server/Utils/SecurityEvent/Connectors/GoogleSecOps/GoogleSecOpsConnector.js.map +1 -0
  1179. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.js +406 -0
  1180. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.js.map +1 -0
  1181. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.js +336 -0
  1182. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.js.map +1 -0
  1183. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.js +474 -0
  1184. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.js.map +1 -0
  1185. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.js +417 -0
  1186. package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.js.map +1 -0
  1187. package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.js +314 -0
  1188. package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.js.map +1 -0
  1189. package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.js +494 -0
  1190. package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.js.map +1 -0
  1191. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.js +839 -0
  1192. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.js.map +1 -0
  1193. package/build/dist/Server/Utils/SecurityEvent/{GoogleSecOps/GoogleSecOpsRunExecutor.js → Connectors/SecurityEventConnectionRunExecutor.js} +77 -50
  1194. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.js.map +1 -0
  1195. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.js +214 -0
  1196. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.js.map +1 -0
  1197. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.js +42 -0
  1198. package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.js.map +1 -0
  1199. package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.js +494 -0
  1200. package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.js.map +1 -0
  1201. package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.js +379 -0
  1202. package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.js.map +1 -0
  1203. package/build/dist/Server/Utils/SecurityEvent/Connectors/Types.js +122 -0
  1204. package/build/dist/Server/Utils/SecurityEvent/Connectors/Types.js.map +1 -0
  1205. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +1 -1
  1206. package/build/dist/Server/Utils/SecurityEvent/SecurityEventDedupe.js +52 -0
  1207. package/build/dist/Server/Utils/SecurityEvent/SecurityEventDedupe.js.map +1 -0
  1208. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js +2 -2
  1209. package/build/dist/Server/Utils/SessionReplay/SessionReplayReadService.js +599 -32
  1210. package/build/dist/Server/Utils/SessionReplay/SessionReplayReadService.js.map +1 -1
  1211. package/build/dist/Server/Utils/Slo/SloFeedUtil.js +150 -0
  1212. package/build/dist/Server/Utils/Slo/SloFeedUtil.js.map +1 -0
  1213. package/build/dist/Server/Utils/Slo/SloLegacyMonitorLabelAdoption.js +136 -0
  1214. package/build/dist/Server/Utils/Slo/SloLegacyMonitorLabelAdoption.js.map +1 -0
  1215. package/build/dist/Server/Utils/Slo/SloMetricUtil.js +269 -0
  1216. package/build/dist/Server/Utils/Slo/SloMetricUtil.js.map +1 -0
  1217. package/build/dist/Server/Utils/Slo/SloOwnerReferenceValidator.js +134 -0
  1218. package/build/dist/Server/Utils/Slo/SloOwnerReferenceValidator.js.map +1 -0
  1219. package/build/dist/Server/Utils/Slo/SloRecordReferenceValidator.js +137 -0
  1220. package/build/dist/Server/Utils/Slo/SloRecordReferenceValidator.js.map +1 -0
  1221. package/build/dist/Server/Utils/StartServer.js +10 -0
  1222. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  1223. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js +6 -26
  1224. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js.map +1 -1
  1225. package/build/dist/Server/Utils/StatusPageResource.js +31 -5
  1226. package/build/dist/Server/Utils/StatusPageResource.js.map +1 -1
  1227. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +8 -0
  1228. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  1229. package/build/dist/Server/Utils/Telemetry/KubernetesResourceAttributes.js +80 -0
  1230. package/build/dist/Server/Utils/Telemetry/KubernetesResourceAttributes.js.map +1 -0
  1231. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +122 -67
  1232. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
  1233. package/build/dist/Server/Utils/Telemetry/ResourceFacetPlanner.js +146 -0
  1234. package/build/dist/Server/Utils/Telemetry/ResourceFacetPlanner.js.map +1 -0
  1235. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +174 -248
  1236. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
  1237. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +492 -0
  1238. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -0
  1239. package/build/dist/Server/Utils/Telemetry/TraceContextPropagation.js +259 -0
  1240. package/build/dist/Server/Utils/Telemetry/TraceContextPropagation.js.map +1 -0
  1241. package/build/dist/Server/Utils/Telemetry.js +11 -5
  1242. package/build/dist/Server/Utils/Telemetry.js.map +1 -1
  1243. package/build/dist/Types/AI/InvestigationEvidence.js +2 -0
  1244. package/build/dist/Types/AI/InvestigationEvidence.js.map +1 -0
  1245. package/build/dist/Types/Billing/SubscriptionStatus.js +37 -3
  1246. package/build/dist/Types/Billing/SubscriptionStatus.js.map +1 -1
  1247. package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
  1248. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  1249. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +5 -0
  1250. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  1251. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloListComponent.js +2 -0
  1252. package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloListComponent.js.map +1 -0
  1253. package/build/dist/Types/Dashboard/DashboardTemplates.js +275 -286
  1254. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  1255. package/build/dist/Types/Database/EnableAuditLog.js +19 -1
  1256. package/build/dist/Types/Database/EnableAuditLog.js.map +1 -1
  1257. package/build/dist/Types/Email/EmailTemplateType.js +4 -0
  1258. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  1259. package/build/dist/Types/Monitor/CriteriaFilter.js +45 -6
  1260. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  1261. package/build/dist/Types/Monitor/MonitorStep.js +2 -0
  1262. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  1263. package/build/dist/Types/Monitor/MonitorStepDnsMonitor.js +3 -1
  1264. package/build/dist/Types/Monitor/MonitorStepDnsMonitor.js.map +1 -1
  1265. package/build/dist/Types/Monitor/MonitorStepDnssecMonitor.js +3 -1
  1266. package/build/dist/Types/Monitor/MonitorStepDnssecMonitor.js.map +1 -1
  1267. package/build/dist/Types/Monitor/MonitorStepDomainMonitor.js +3 -1
  1268. package/build/dist/Types/Monitor/MonitorStepDomainMonitor.js.map +1 -1
  1269. package/build/dist/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +3 -1
  1270. package/build/dist/Types/Monitor/MonitorStepExternalStatusPageMonitor.js.map +1 -1
  1271. package/build/dist/Types/Monitor/MonitorStepRetries.js +47 -0
  1272. package/build/dist/Types/Monitor/MonitorStepRetries.js.map +1 -0
  1273. package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js +3 -1
  1274. package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js.map +1 -1
  1275. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticResult.js +29 -0
  1276. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticResult.js.map +1 -0
  1277. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticStatus.js +37 -0
  1278. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticStatus.js.map +1 -0
  1279. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticType.js +42 -0
  1280. package/build/dist/Types/NetworkDevice/NetworkDeviceDiagnosticType.js.map +1 -0
  1281. package/build/dist/Types/NetworkDevice/NetworkDevicePingMetricNames.js +20 -0
  1282. package/build/dist/Types/NetworkDevice/NetworkDevicePingMetricNames.js.map +1 -0
  1283. package/build/dist/Types/Permission.js +116 -2
  1284. package/build/dist/Types/Permission.js.map +1 -1
  1285. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +5 -0
  1286. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
  1287. package/build/dist/Types/Rules/RuleRun.js +267 -0
  1288. package/build/dist/Types/Rules/RuleRun.js.map +1 -0
  1289. package/build/dist/Types/Rum/SessionReplay.js +95 -0
  1290. package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
  1291. package/build/dist/Types/Rum/SessionReplayApi.js.map +1 -1
  1292. package/build/dist/Types/SecurityEvent/Connectors/ConnectorDiagnostics.js +18 -0
  1293. package/build/dist/Types/SecurityEvent/Connectors/ConnectorDiagnostics.js.map +1 -0
  1294. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.js +17 -0
  1295. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.js.map +1 -0
  1296. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +439 -0
  1297. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js.map +1 -0
  1298. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js +39 -0
  1299. package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js.map +1 -0
  1300. package/build/dist/Types/SecurityEvent/GoogleSecOpsRegion.js +35 -0
  1301. package/build/dist/Types/SecurityEvent/GoogleSecOpsRegion.js.map +1 -0
  1302. package/build/dist/Types/ServiceLevelObjective/SloHistoryMetricName.js +26 -0
  1303. package/build/dist/Types/ServiceLevelObjective/SloHistoryMetricName.js.map +1 -0
  1304. package/build/dist/Types/ServiceLevelObjective/SloMetricType.js +45 -0
  1305. package/build/dist/Types/ServiceLevelObjective/SloMetricType.js.map +1 -0
  1306. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js +4 -0
  1307. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js.map +1 -1
  1308. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js +295 -0
  1309. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js.map +1 -0
  1310. package/build/dist/Types/StatusPage/SubscriberNotificationTrigger.js +13 -0
  1311. package/build/dist/Types/StatusPage/SubscriberNotificationTrigger.js.map +1 -0
  1312. package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js +67 -0
  1313. package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js.map +1 -0
  1314. package/build/dist/Types/Telemetry/EntityType.js +14 -0
  1315. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  1316. package/build/dist/Types/Telemetry/ExceptionSpanScope.js +59 -0
  1317. package/build/dist/Types/Telemetry/ExceptionSpanScope.js.map +1 -0
  1318. package/build/dist/Types/Telemetry/LockedFilterDetail.js +16 -0
  1319. package/build/dist/Types/Telemetry/LockedFilterDetail.js.map +1 -0
  1320. package/build/dist/Types/Telemetry/ResourceEntityFacet.js +16 -10
  1321. package/build/dist/Types/Telemetry/ResourceEntityFacet.js.map +1 -1
  1322. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +119 -0
  1323. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -0
  1324. package/build/dist/Types/Telemetry/ServiceType.js +7 -0
  1325. package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
  1326. package/build/dist/UI/Components/AlertBanner/AlertBanner.js +48 -19
  1327. package/build/dist/UI/Components/AlertBanner/AlertBanner.js.map +1 -1
  1328. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js +10 -2
  1329. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js.map +1 -1
  1330. package/build/dist/UI/Components/Card/Card.js +34 -17
  1331. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  1332. package/build/dist/UI/Components/Checkbox/Checkbox.js +6 -4
  1333. package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
  1334. package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js +5 -1
  1335. package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js.map +1 -1
  1336. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +1 -1
  1337. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
  1338. package/build/dist/UI/Components/Detail/Detail.js +74 -15
  1339. package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
  1340. package/build/dist/UI/Components/Dropdown/Dropdown.js +33 -5
  1341. package/build/dist/UI/Components/Dropdown/Dropdown.js.map +1 -1
  1342. package/build/dist/UI/Components/EmptyState/EmptyState.js +3 -3
  1343. package/build/dist/UI/Components/EmptyState/EmptyState.js.map +1 -1
  1344. package/build/dist/UI/Components/EmptyState/EmptyStateGuideLinks.js +47 -0
  1345. package/build/dist/UI/Components/EmptyState/EmptyStateGuideLinks.js.map +1 -0
  1346. package/build/dist/UI/Components/ErrorBoundary.js +34 -0
  1347. package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
  1348. package/build/dist/UI/Components/Forms/ModelForm.js +6 -5
  1349. package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
  1350. package/build/dist/UI/Components/LabelRule/LabelRuleTable.js +6 -2
  1351. package/build/dist/UI/Components/LabelRule/LabelRuleTable.js.map +1 -1
  1352. package/build/dist/UI/Components/LogsViewer/LogsEntityNames.js +535 -0
  1353. package/build/dist/UI/Components/LogsViewer/LogsEntityNames.js.map +1 -0
  1354. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +117 -57
  1355. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  1356. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +3 -7
  1357. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
  1358. package/build/dist/UI/Components/LogsViewer/components/FacetSection.js +31 -44
  1359. package/build/dist/UI/Components/LogsViewer/components/FacetSection.js.map +1 -1
  1360. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +17 -3
  1361. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
  1362. package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +19 -3
  1363. package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
  1364. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +64 -18
  1365. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
  1366. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +100 -41
  1367. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  1368. package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +13 -5
  1369. package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
  1370. package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
  1371. package/build/dist/UI/Components/Markdown.tsx/InlineReferences.js +403 -0
  1372. package/build/dist/UI/Components/Markdown.tsx/InlineReferences.js.map +1 -0
  1373. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +197 -179
  1374. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
  1375. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js +30 -21
  1376. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js.map +1 -1
  1377. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +12 -0
  1378. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
  1379. package/build/dist/UI/Components/ModelDetail/ModelDetail.js +46 -12
  1380. package/build/dist/UI/Components/ModelDetail/ModelDetail.js.map +1 -1
  1381. package/build/dist/UI/Components/ModelList/ModelList.js +26 -7
  1382. package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
  1383. package/build/dist/UI/Components/MoreMenu/MoreMenu.js +3 -1
  1384. package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
  1385. package/build/dist/UI/Components/Page/ModelPage.js +62 -34
  1386. package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
  1387. package/build/dist/UI/Components/RuleRun/RuleDetailFields.js +226 -0
  1388. package/build/dist/UI/Components/RuleRun/RuleDetailFields.js.map +1 -0
  1389. package/build/dist/UI/Components/RuleRun/RuleTable.js +97 -0
  1390. package/build/dist/UI/Components/RuleRun/RuleTable.js.map +1 -0
  1391. package/build/dist/UI/Components/RuleRun/RuleView.js +83 -0
  1392. package/build/dist/UI/Components/RuleRun/RuleView.js.map +1 -0
  1393. package/build/dist/UI/Components/RuleRun/RunRuleNowModal.js +74 -0
  1394. package/build/dist/UI/Components/RuleRun/RunRuleNowModal.js.map +1 -0
  1395. package/build/dist/UI/Components/RuleRun/RunRulesBulkAction.js +78 -0
  1396. package/build/dist/UI/Components/RuleRun/RunRulesBulkAction.js.map +1 -0
  1397. package/build/dist/UI/Components/Table/Table.js +3 -1
  1398. package/build/dist/UI/Components/Table/Table.js.map +1 -1
  1399. package/build/dist/UI/Components/Table/TableRow.js +8 -1
  1400. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  1401. package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js +111 -0
  1402. package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js.map +1 -0
  1403. package/build/dist/UI/Components/TelemetryViewer/ResourceFacetConfigs.js +22 -0
  1404. package/build/dist/UI/Components/TelemetryViewer/ResourceFacetConfigs.js.map +1 -0
  1405. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +1 -1
  1406. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
  1407. package/build/dist/UI/Components/TelemetryViewer/components/FacetSearchInput.js +36 -0
  1408. package/build/dist/UI/Components/TelemetryViewer/components/FacetSearchInput.js.map +1 -0
  1409. package/build/dist/UI/Components/TelemetryViewer/components/FacetSectionHeader.js +21 -0
  1410. package/build/dist/UI/Components/TelemetryViewer/components/FacetSectionHeader.js.map +1 -0
  1411. package/build/dist/UI/Components/TelemetryViewer/components/FacetShowMoreButton.js +14 -0
  1412. package/build/dist/UI/Components/TelemetryViewer/components/FacetShowMoreButton.js.map +1 -0
  1413. package/build/dist/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.js +27 -0
  1414. package/build/dist/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.js.map +1 -0
  1415. package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js +202 -0
  1416. package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js.map +1 -0
  1417. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.js +2 -6
  1418. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.js.map +1 -1
  1419. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.js +111 -12
  1420. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.js.map +1 -1
  1421. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSection.js +27 -40
  1422. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSection.js.map +1 -1
  1423. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +70 -10
  1424. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
  1425. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +17 -3
  1426. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
  1427. package/build/dist/UI/Components/TelemetryViewer/types.js +0 -4
  1428. package/build/dist/UI/Components/TelemetryViewer/types.js.map +1 -1
  1429. package/build/dist/UI/Components/TelemetryViewer/useFacetSearchExemptions.js +70 -0
  1430. package/build/dist/UI/Components/TelemetryViewer/useFacetSearchExemptions.js.map +1 -0
  1431. package/build/dist/UI/Components/TelemetryViewer/useFacetSectionSearch.js +52 -0
  1432. package/build/dist/UI/Components/TelemetryViewer/useFacetSectionSearch.js.map +1 -0
  1433. package/build/dist/UI/Utils/Clipboard.js +59 -2
  1434. package/build/dist/UI/Utils/Clipboard.js.map +1 -1
  1435. package/build/dist/UI/Utils/Navigation.js +11 -2
  1436. package/build/dist/UI/Utils/Navigation.js.map +1 -1
  1437. package/build/dist/UI/Utils/Rules/RuleRunClient.js +98 -0
  1438. package/build/dist/UI/Utils/Rules/RuleRunClient.js.map +1 -0
  1439. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +479 -0
  1440. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -0
  1441. package/build/dist/UI/Utils/Telemetry/UseTelemetryEntityNames.js +113 -0
  1442. package/build/dist/UI/Utils/Telemetry/UseTelemetryEntityNames.js.map +1 -0
  1443. package/build/dist/Utils/AI/InvestigationReport.js +1241 -0
  1444. package/build/dist/Utils/AI/InvestigationReport.js.map +1 -0
  1445. package/build/dist/Utils/API.js +25 -0
  1446. package/build/dist/Utils/API.js.map +1 -1
  1447. package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js +16 -2
  1448. package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js.map +1 -1
  1449. package/build/dist/Utils/Dashboard/Components/DashboardSloListComponent.js +94 -0
  1450. package/build/dist/Utils/Dashboard/Components/DashboardSloListComponent.js.map +1 -0
  1451. package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
  1452. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  1453. package/build/dist/Utils/Dashboard/SloWidgetSource.js +125 -0
  1454. package/build/dist/Utils/Dashboard/SloWidgetSource.js.map +1 -0
  1455. package/build/dist/Utils/Markdown/MarkdownEscape.js +49 -0
  1456. package/build/dist/Utils/Markdown/MarkdownEscape.js.map +1 -0
  1457. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +112 -34
  1458. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
  1459. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +22 -0
  1460. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
  1461. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js +129 -0
  1462. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js.map +1 -0
  1463. package/build/dist/Utils/NetworkDiscovery/RunImportedDeviceNaming.js +255 -0
  1464. package/build/dist/Utils/NetworkDiscovery/RunImportedDeviceNaming.js.map +1 -0
  1465. package/build/dist/Utils/NetworkDiscovery/ShortDeviceNamePlanner.js +184 -0
  1466. package/build/dist/Utils/NetworkDiscovery/ShortDeviceNamePlanner.js.map +1 -0
  1467. package/build/dist/Utils/NetworkDiscovery/ShortHostnameUtil.js +79 -0
  1468. package/build/dist/Utils/NetworkDiscovery/ShortHostnameUtil.js.map +1 -0
  1469. package/build/dist/Utils/NetworkSite/CidrMatchUtil.js +21 -12
  1470. package/build/dist/Utils/NetworkSite/CidrMatchUtil.js.map +1 -1
  1471. package/build/dist/Utils/Project/DataResidency.js +51 -0
  1472. package/build/dist/Utils/Project/DataResidency.js.map +1 -0
  1473. package/build/dist/Utils/Rules/RuleRunSummary.js +197 -0
  1474. package/build/dist/Utils/Rules/RuleRunSummary.js.map +1 -0
  1475. package/build/dist/Utils/Rum/SessionReplayHealth.js +10 -0
  1476. package/build/dist/Utils/Rum/SessionReplayHealth.js.map +1 -1
  1477. package/build/dist/Utils/Rum/SessionReplayRecordingEnded.js +54 -0
  1478. package/build/dist/Utils/Rum/SessionReplayRecordingEnded.js.map +1 -0
  1479. package/build/dist/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.js +311 -0
  1480. package/build/dist/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.js.map +1 -0
  1481. package/build/dist/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.js +150 -0
  1482. package/build/dist/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.js.map +1 -0
  1483. package/build/dist/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.js +328 -0
  1484. package/build/dist/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.js.map +1 -0
  1485. package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.js +405 -0
  1486. package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.js.map +1 -0
  1487. package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.js +212 -0
  1488. package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.js.map +1 -0
  1489. package/build/dist/Utils/SecurityEvent/Connectors/OktaNormalizer.js +351 -0
  1490. package/build/dist/Utils/SecurityEvent/Connectors/OktaNormalizer.js.map +1 -0
  1491. package/build/dist/Utils/SecurityEvent/Connectors/SplunkNormalizer.js +348 -0
  1492. package/build/dist/Utils/SecurityEvent/Connectors/SplunkNormalizer.js.map +1 -0
  1493. package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js +103 -10
  1494. package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js.map +1 -1
  1495. package/build/dist/Utils/Slo/SloAffectedResourceMarkdown.js +51 -0
  1496. package/build/dist/Utils/Slo/SloAffectedResourceMarkdown.js.map +1 -0
  1497. package/build/dist/Utils/Slo/SloBurnRateTemplate.js +228 -0
  1498. package/build/dist/Utils/Slo/SloBurnRateTemplate.js.map +1 -0
  1499. package/build/dist/Utils/Slo/SloFeedMarkdown.js +934 -0
  1500. package/build/dist/Utils/Slo/SloFeedMarkdown.js.map +1 -0
  1501. package/build/dist/Utils/Slo/SloHealth.js +75 -9
  1502. package/build/dist/Utils/Slo/SloHealth.js.map +1 -1
  1503. package/build/dist/Utils/Slo/SloListWidgetFormat.js +217 -0
  1504. package/build/dist/Utils/Slo/SloListWidgetFormat.js.map +1 -0
  1505. package/build/dist/Utils/Slo/SloMetricType.js +212 -0
  1506. package/build/dist/Utils/Slo/SloMetricType.js.map +1 -0
  1507. package/build/dist/Utils/Slo/SloMonitorRuleCriteria.js +216 -0
  1508. package/build/dist/Utils/Slo/SloMonitorRuleCriteria.js.map +1 -0
  1509. package/build/dist/Utils/Slo/SloMonitorStatusSummary.js +129 -0
  1510. package/build/dist/Utils/Slo/SloMonitorStatusSummary.js.map +1 -0
  1511. package/build/dist/Utils/Slo/SloOverviewText.js +110 -0
  1512. package/build/dist/Utils/Slo/SloOverviewText.js.map +1 -0
  1513. package/build/dist/Utils/Slo/SloProjection.js +448 -0
  1514. package/build/dist/Utils/Slo/SloProjection.js.map +1 -0
  1515. package/build/dist/Utils/Slo/SloWidgetFormat.js +4 -2
  1516. package/build/dist/Utils/Slo/SloWidgetFormat.js.map +1 -1
  1517. package/build/dist/Utils/Telemetry/CrossSignalScope.js +16 -5
  1518. package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
  1519. package/build/dist/Utils/Telemetry/EntityRelationship.js +7 -0
  1520. package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
  1521. package/build/dist/Utils/Telemetry/LockedFilterSearch.js +252 -0
  1522. package/build/dist/Utils/Telemetry/LockedFilterSearch.js.map +1 -0
  1523. package/build/dist/Utils/Telemetry/NetworkHost.js +39 -0
  1524. package/build/dist/Utils/Telemetry/NetworkHost.js.map +1 -0
  1525. package/build/dist/Utils/Telemetry/OriginAllowList.js +105 -4
  1526. package/build/dist/Utils/Telemetry/OriginAllowList.js.map +1 -1
  1527. package/build/dist/Utils/Traces/CriticalPath.js +9 -4
  1528. package/build/dist/Utils/Traces/CriticalPath.js.map +1 -1
  1529. package/package.json +1 -1
  1530. package/Server/API/GoogleSecOpsConnectionAPI.ts +0 -79
  1531. package/Server/Services/GoogleSecOpsConnectionService.ts +0 -101
  1532. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +0 -774
  1533. package/Tests/App/Dashboard/GoogleSecOpsConnectionsErrors.test.tsx +0 -423
  1534. package/Tests/App/Dashboard/GoogleSecOpsDiagnostics.test.tsx +0 -724
  1535. package/Tests/Server/API/GoogleSecOpsConnectionAPI.test.ts +0 -248
  1536. package/Tests/Server/Services/GoogleSecOpsDiagnosticsModel.test.ts +0 -153
  1537. package/Tests/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.test.ts +0 -711
  1538. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsDiagnostics.test.ts +0 -838
  1539. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +0 -716
  1540. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +0 -860
  1541. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerHardening.test.ts +0 -1231
  1542. package/Tests/UI/Rum/RecordingHealthStrip.test.tsx +0 -600
  1543. package/Types/SecurityEvent/GoogleSecOpsDiagnostics.ts +0 -56
  1544. package/UI/Components/GanttChart/Bar/BarLabel.tsx +0 -17
  1545. package/UI/Components/GanttChart/Bar/Index.tsx +0 -149
  1546. package/UI/Components/GanttChart/ChartContainer.tsx +0 -50
  1547. package/UI/Components/GanttChart/Index.tsx +0 -90
  1548. package/UI/Components/GanttChart/Row/Index.tsx +0 -22
  1549. package/UI/Components/GanttChart/Row/Row.tsx +0 -231
  1550. package/UI/Components/GanttChart/Row/RowLabel.tsx +0 -30
  1551. package/UI/Components/GanttChart/Rows.tsx +0 -59
  1552. package/UI/Components/GanttChart/Timeline/Index.tsx +0 -46
  1553. package/UI/Components/GanttChart/Timeline/TimelineInterval.tsx +0 -33
  1554. package/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.tsx +0 -43
  1555. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +0 -1
  1556. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnectionRun.js.map +0 -1
  1557. package/build/dist/Server/API/GoogleSecOpsConnectionAPI.js +0 -56
  1558. package/build/dist/Server/API/GoogleSecOpsConnectionAPI.js.map +0 -1
  1559. package/build/dist/Server/Services/GoogleSecOpsConnectionRunService.js.map +0 -1
  1560. package/build/dist/Server/Services/GoogleSecOpsConnectionService.js +0 -62
  1561. package/build/dist/Server/Services/GoogleSecOpsConnectionService.js.map +0 -1
  1562. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +0 -1
  1563. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +0 -577
  1564. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +0 -1
  1565. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.js.map +0 -1
  1566. package/build/dist/Types/SecurityEvent/GoogleSecOpsDiagnostics.js +0 -2
  1567. package/build/dist/Types/SecurityEvent/GoogleSecOpsDiagnostics.js.map +0 -1
  1568. package/build/dist/UI/Components/GanttChart/Bar/BarLabel.js +0 -8
  1569. package/build/dist/UI/Components/GanttChart/Bar/BarLabel.js.map +0 -1
  1570. package/build/dist/UI/Components/GanttChart/Bar/Index.js +0 -77
  1571. package/build/dist/UI/Components/GanttChart/Bar/Index.js.map +0 -1
  1572. package/build/dist/UI/Components/GanttChart/ChartContainer.js +0 -33
  1573. package/build/dist/UI/Components/GanttChart/ChartContainer.js.map +0 -1
  1574. package/build/dist/UI/Components/GanttChart/Index.js +0 -39
  1575. package/build/dist/UI/Components/GanttChart/Index.js.map +0 -1
  1576. package/build/dist/UI/Components/GanttChart/Row/Index.js +0 -7
  1577. package/build/dist/UI/Components/GanttChart/Row/Index.js.map +0 -1
  1578. package/build/dist/UI/Components/GanttChart/Row/Row.js +0 -106
  1579. package/build/dist/UI/Components/GanttChart/Row/Row.js.map +0 -1
  1580. package/build/dist/UI/Components/GanttChart/Row/RowLabel.js +0 -10
  1581. package/build/dist/UI/Components/GanttChart/Row/RowLabel.js.map +0 -1
  1582. package/build/dist/UI/Components/GanttChart/Rows.js +0 -19
  1583. package/build/dist/UI/Components/GanttChart/Rows.js.map +0 -1
  1584. package/build/dist/UI/Components/GanttChart/Timeline/Index.js +0 -16
  1585. package/build/dist/UI/Components/GanttChart/Timeline/Index.js.map +0 -1
  1586. package/build/dist/UI/Components/GanttChart/Timeline/TimelineInterval.js +0 -13
  1587. package/build/dist/UI/Components/GanttChart/Timeline/TimelineInterval.js.map +0 -1
  1588. package/build/dist/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.js +0 -13
  1589. package/build/dist/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.js.map +0 -1
@@ -4,6 +4,8 @@ import ExceptionInstanceService from "../../../../Server/Services/ExceptionInsta
4
4
  import { Statement } from "../../../../Server/Utils/AnalyticsDatabase/Statement";
5
5
  import SessionReplayReadService, {
6
6
  MAX_LIST_ROUTES,
7
+ MAX_SESSION_REPLAY_SESSION_ID_LENGTH,
8
+ MAX_SESSION_REPLAY_SUMMARIES_BATCH_SIZE,
7
9
  MAX_SESSION_REPLAY_USERS_LIMIT,
8
10
  SESSION_REPLAY_ACTIVITY_SUMMARY_CACHE_TTL_MS,
9
11
  SessionReplayApplicationActivitySummary,
@@ -17,15 +19,25 @@ import SessionReplayReadService, {
17
19
  SessionReplayManifest,
18
20
  SessionReplaySessionHeader,
19
21
  SessionReplaySessionIdentity,
22
+ SessionReplaySummariesRequest,
23
+ SessionReplaySummary,
20
24
  SessionReplayUserRollup,
21
25
  SessionReplayUsersRequest,
22
26
  SessionReplayUsersResult,
23
27
  } from "../../../../Server/Utils/SessionReplay/SessionReplayReadService";
28
+ import logger from "../../../../Server/Utils/Logger";
24
29
  import BadDataException from "../../../../Types/Exception/BadDataException";
25
30
  import { JSONObject } from "../../../../Types/JSON";
26
31
  import ObjectID from "../../../../Types/ObjectID";
27
- import { MAX_SESSION_REPLAY_READ_BYTES } from "../../../../Types/Rum/SessionReplay";
32
+ import AnalyticsTableName from "../../../../Types/AnalyticsDatabase/AnalyticsTableName";
33
+ import {
34
+ MAX_SESSION_REPLAY_CHUNKS_PER_SESSION,
35
+ MAX_SESSION_REPLAY_READ_BYTES,
36
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS,
37
+ SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS,
38
+ } from "../../../../Types/Rum/SessionReplay";
28
39
  import { SessionReplaySortBy } from "../../../../Types/Rum/SessionReplayApi";
40
+ import ServiceType from "../../../../Types/Telemetry/ServiceType";
29
41
  import { afterEach, beforeEach, describe, expect, test } from "@jest/globals";
30
42
 
31
43
  /*
@@ -136,6 +148,173 @@ describe("SessionReplayReadService statements", () => {
136
148
  return statementOf(headerQuerySpy).query;
137
149
  }
138
150
 
151
+ function summariesRequest(
152
+ overrides: Partial<SessionReplaySummariesRequest> = {},
153
+ ): SessionReplaySummariesRequest {
154
+ return {
155
+ projectId: projectId,
156
+ rumApplicationId: rumApplicationId,
157
+ sessionIds: ["session-a", "session-b"],
158
+ ...overrides,
159
+ };
160
+ }
161
+
162
+ describe("session summary batch", () => {
163
+ test("uses one application-scoped argMax query with only non-identity summary columns", async () => {
164
+ await SessionReplayReadService.getSessionSummaries(summariesRequest());
165
+
166
+ expect(headerQuerySpy).toHaveBeenCalledTimes(1);
167
+ expect(chunkQuerySpy).not.toHaveBeenCalled();
168
+
169
+ const statement: Statement = statementOf(headerQuerySpy);
170
+ const query: string = statement.query;
171
+
172
+ expect(query).toMatch(/FROM \{p\d+:Identifier\}/);
173
+ expect(query).toContain("projectId = ");
174
+ expect(query).toContain("rumApplicationId = ");
175
+ expect(query).toContain("sessionId IN (");
176
+ expect(query).toContain(
177
+ "GROUP BY projectId, rumApplicationId, sessionId",
178
+ );
179
+ expect(query).toContain("argMax(startTime, version)");
180
+ expect(query).toContain("argMax(entryUrl, version)");
181
+ expect(query).toContain("argMax(browserName, version)");
182
+ expect(query).toContain("argMax(browserVersion, version)");
183
+ expect(query).toContain("argMax(osName, version)");
184
+ expect(query).toContain("argMax(deviceType, version)");
185
+ expect(query).toContain("retentionDate >= now()");
186
+ expect(query).toContain("timeout_overflow_mode = 'throw'");
187
+ expect(query).not.toContain(" FINAL");
188
+
189
+ for (const forbiddenColumn of [
190
+ "identifiedUserKey",
191
+ "identifiedUserLabel",
192
+ "identifiedUserTraits",
193
+ "visitorId",
194
+ "payload",
195
+ "exitUrl",
196
+ "countryCode",
197
+ ]) {
198
+ expect(query).not.toContain(forbiddenColumn);
199
+ }
200
+
201
+ const values: Array<unknown> = boundValues(statement);
202
+ expect(values).toContain(AnalyticsTableName.RumSession);
203
+ expect(values).toContain(projectId.toString());
204
+ expect(values).toContain(rumApplicationId.toString());
205
+ expect(values).toContainEqual(["session-a", "session-b"]);
206
+ });
207
+
208
+ test("deduplicates ids, returns stable request order and omits missing or unexpected rows", async () => {
209
+ headerQuerySpy.mockResolvedValue(
210
+ fakeResultSet([
211
+ {
212
+ sessionId: "not-requested",
213
+ aggStartTime: 1,
214
+ },
215
+ {
216
+ sessionId: "session-b",
217
+ aggStartTime: 1700000200000,
218
+ aggDurationMs: "45000",
219
+ aggEntryUrl: "https://example.com/checkout",
220
+ aggBrowserName: "Firefox",
221
+ aggBrowserVersion: "130",
222
+ aggOsName: "Linux",
223
+ aggDeviceType: "desktop",
224
+ },
225
+ {
226
+ sessionId: "session-a",
227
+ aggStartTime: 1700000100000,
228
+ aggDurationMs: 15000,
229
+ aggEntryUrl: "https://example.com/",
230
+ aggBrowserName: "Safari",
231
+ aggBrowserVersion: "18",
232
+ aggOsName: "iOS",
233
+ aggDeviceType: "mobile",
234
+ },
235
+ /* Defensive duplicate driver rows never duplicate the response. */
236
+ {
237
+ sessionId: "session-a",
238
+ aggStartTime: 2,
239
+ },
240
+ ]) as never,
241
+ );
242
+
243
+ const summaries: Array<SessionReplaySummary> =
244
+ await SessionReplayReadService.getSessionSummaries(
245
+ summariesRequest({
246
+ sessionIds: [
247
+ "session-a",
248
+ "session-b",
249
+ "session-a",
250
+ "missing-session",
251
+ ],
252
+ }),
253
+ );
254
+
255
+ expect(summaries).toEqual([
256
+ {
257
+ sessionId: "session-a",
258
+ startTime: new Date(1700000100000),
259
+ startTimeUnixMs: 1700000100000,
260
+ durationMs: 15000,
261
+ entryUrl: "https://example.com/",
262
+ browserName: "Safari",
263
+ browserVersion: "18",
264
+ osName: "iOS",
265
+ deviceType: "mobile",
266
+ },
267
+ {
268
+ sessionId: "session-b",
269
+ startTime: new Date(1700000200000),
270
+ startTimeUnixMs: 1700000200000,
271
+ durationMs: 45000,
272
+ entryUrl: "https://example.com/checkout",
273
+ browserName: "Firefox",
274
+ browserVersion: "130",
275
+ osName: "Linux",
276
+ deviceType: "desktop",
277
+ },
278
+ ]);
279
+
280
+ const values: Array<unknown> = boundValues(statementOf(headerQuerySpy));
281
+ expect(values).toContainEqual([
282
+ "session-a",
283
+ "session-b",
284
+ "missing-session",
285
+ ]);
286
+ });
287
+
288
+ test.each([
289
+ { name: "an empty batch", sessionIds: [] },
290
+ { name: "an empty id", sessionIds: [""] },
291
+ {
292
+ name: "an overlong id",
293
+ sessionIds: ["x".repeat(MAX_SESSION_REPLAY_SESSION_ID_LENGTH + 1)],
294
+ },
295
+ {
296
+ name: "an oversized batch",
297
+ sessionIds: Array.from(
298
+ { length: MAX_SESSION_REPLAY_SUMMARIES_BATCH_SIZE + 1 },
299
+ (_value: unknown, index: number): string => {
300
+ return `session-${index}`;
301
+ },
302
+ ),
303
+ },
304
+ ])(
305
+ "rejects $name before querying",
306
+ async ({ sessionIds }: { sessionIds: Array<string> }) => {
307
+ await expect(
308
+ SessionReplayReadService.getSessionSummaries(
309
+ summariesRequest({ sessionIds: sessionIds }),
310
+ ),
311
+ ).rejects.toBeInstanceOf(BadDataException);
312
+
313
+ expect(headerQuerySpy).not.toHaveBeenCalled();
314
+ },
315
+ );
316
+ });
317
+
139
318
  describe("list predicates are HAVING clauses over argMax aliases", () => {
140
319
  test("hasIdentifiedUser tests the digest alias, never the label", async () => {
141
320
  const positive: string = await listQuery({ hasIdentifiedUser: true });
@@ -623,164 +802,863 @@ describe("SessionReplayReadService statements", () => {
623
802
  });
624
803
  });
625
804
 
626
- describe("getSessionHeader", () => {
627
- const headerRow: JSONObject = {
628
- sessionId: "s-1",
629
- headerProjectId: "p",
630
- applicationId: "a",
631
- aggStartTime: 1700000000000,
632
- aggEndTime: 1700000060000,
633
- aggIsFinalized: 1,
634
- aggClientReportedStart: 1699999999000,
635
- aggTags: { env: "prod" },
636
- aggExpiresAt: 1700604800000,
637
- aggClickCount: 7,
638
- aggCustomEventCount: 2,
639
- aggActiveMs: 30000,
640
- aggFirstErrorOffsetMs: 5000,
641
- aggAttributes: {
642
- "recorder.capabilities": "click-events,web-vitals,made-up",
643
- },
644
- aggIdentifiedUserKey: "hmac-key",
645
- aggVisitorId: "0123456789abcdef0123456789abcdef",
646
- };
805
+ /*
806
+ * The bug: a user closed the tab, the recorder sent its final chunk, and
807
+ * the sessions table kept saying "Recording now" for 10-15 minutes -
808
+ * because the only fact the list returned was isFinalized, and the
809
+ * finalizer only runs once a session has been idle for ten minutes. The
810
+ * list now also says whether every tab of an unfinalized session has
811
+ * ended, read from the chunk rows by the shared rule, once the same
812
+ * grace the finalizer waits on has passed.
813
+ */
814
+ describe("hasRecordingEnded on the session list", () => {
815
+ /* An arbitrary fixed device clock: the end of a tab's final chunk. */
816
+ const FINAL_END: number = 1757000000000;
817
+ /*
818
+ * The SERVER unix ms the tab's newest chunk row was written (its
819
+ * version). Deliberately not FINAL_END: the grace is measured on the
820
+ * server clock, never on the device's.
821
+ */
822
+ const STORED_AT: number = FINAL_END + 2345;
823
+ /* The first server "now" at which STORED_AT is past the grace. */
824
+ const GRACE_PASSED: number =
825
+ STORED_AT + SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS;
826
+
827
+ function request(
828
+ overrides: Partial<SessionReplayListRequest> = {},
829
+ ): SessionReplayListRequest {
830
+ return listRequest({ nowUnixMs: GRACE_PASSED, ...overrides });
831
+ }
647
832
 
648
- test("never names the identity columns and pins the application only when given one", async () => {
649
- headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
833
+ function listRow(sessionId: string, isFinalized: boolean): JSONObject {
834
+ return {
835
+ sessionId: sessionId,
836
+ applicationId: rumApplicationId.toString(),
837
+ aggStartTime: FINAL_END - 60000,
838
+ aggEndTime: FINAL_END,
839
+ aggIsFinalized: isFinalized ? 1 : 0,
840
+ aggSealedReason: isFinalized ? "final-chunk" : "",
841
+ };
842
+ }
650
843
 
651
- await SessionReplayReadService.getSessionHeader({
652
- projectId: projectId,
653
- sessionId: "s-1",
654
- });
844
+ /* A tab whose final chunk ended at FINAL_END and nothing started after. */
845
+ function endedTabRow(
846
+ sessionId: string,
847
+ tabId: string,
848
+ overrides: JSONObject = {},
849
+ ): JSONObject {
850
+ return {
851
+ sessionId: sessionId,
852
+ tabId: tabId,
853
+ tabHasFinalChunk: 1,
854
+ tabFinalChunkEndUnixMs: FINAL_END,
855
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
856
+ tabMaxChunkIndex: 4,
857
+ tabLastChunkStoredAtUnixMs: STORED_AT,
858
+ ...overrides,
859
+ };
860
+ }
655
861
 
656
- const plain: string = statementOf(headerQuerySpy).query;
657
- expect(plain).not.toContain("identifiedUserLabel");
658
- expect(plain).not.toContain("identifiedUserTraits");
659
- expect(plain).not.toContain("rumApplicationId = ");
660
- expect(plain).toContain("LIMIT 2");
661
- expect(plain).toContain("retentionDate >= now()");
862
+ /* A tab that has not sent a final chunk: maxIf's default end is epoch. */
863
+ function liveTabRow(
864
+ sessionId: string,
865
+ tabId: string,
866
+ overrides: JSONObject = {},
867
+ ): JSONObject {
868
+ return {
869
+ sessionId: sessionId,
870
+ tabId: tabId,
871
+ tabHasFinalChunk: 0,
872
+ tabFinalChunkEndUnixMs: 0,
873
+ tabLastChunkStartUnixMs: FINAL_END,
874
+ tabMaxChunkIndex: 4,
875
+ tabLastChunkStoredAtUnixMs: STORED_AT,
876
+ ...overrides,
877
+ };
878
+ }
662
879
 
663
- headerQuerySpy.mockClear();
880
+ function mockPage(rows: Array<JSONObject>): void {
881
+ headerQuerySpy.mockResolvedValue(fakeResultSet(rows) as never);
882
+ }
664
883
 
665
- await SessionReplayReadService.getSessionHeader({
666
- projectId: projectId,
667
- sessionId: "s-1",
668
- rumApplicationId: rumApplicationId,
669
- });
884
+ function mockChunkFacts(rows: Array<JSONObject>): void {
885
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(rows) as never);
886
+ }
670
887
 
671
- const pinned: Statement = statementOf(headerQuerySpy);
672
- expect(whereSection(pinned.query)).toContain("rumApplicationId = ");
673
- expect(boundValues(pinned)).toContain(rumApplicationId.toString());
674
- });
888
+ function endedBySessionId(
889
+ result: SessionReplayListResult,
890
+ ): Record<string, boolean> {
891
+ const ended: Record<string, boolean> = {};
675
892
 
676
- test("maps the clock, tags, expiry, counters and the known recorder capabilities", async () => {
677
- headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
893
+ for (const session of result.sessions) {
894
+ ended[session.sessionId] = session.hasRecordingEnded;
895
+ }
678
896
 
679
- const header: SessionReplaySessionHeader | null =
680
- await SessionReplayReadService.getSessionHeader({
681
- projectId: projectId,
682
- sessionId: "s-1",
683
- });
897
+ return ended;
898
+ }
684
899
 
685
- expect(header).not.toBeNull();
686
- expect(header!.startTimeUnixMs).toBe(1700000000000);
687
- expect(header!.endTimeUnixMs).toBe(1700000060000);
688
- expect(header!.clientReportedStartUnixMs).toBe(1699999999000);
689
- expect(header!.tags).toEqual({ env: "prod" });
690
- expect(header!.expiresAtUnixMs).toBe(1700604800000);
691
- expect(header!.clickCount).toBe(7);
692
- expect(header!.customEventCount).toBe(2);
693
- expect(header!.activeMs).toBe(30000);
694
- expect(header!.firstErrorOffsetMs).toBe(5000);
695
- /* A stored value outside the vocabulary never reaches the player. */
696
- expect(header!.recorderCapabilities).toEqual([
697
- "click-events",
698
- "web-vitals",
900
+ test("the follow-up is one parameterised, application-pinned, per-tab key-range read over the chunk table", async () => {
901
+ mockPage([
902
+ listRow("s-1", false),
903
+ listRow("s-2", true),
904
+ listRow("s-3", false),
699
905
  ]);
700
- expect(header!.identifiedUserLabel).toBeUndefined();
701
- expect(header!.identifiedUserTraits).toBeUndefined();
702
- });
703
906
 
704
- /*
705
- * The digest alias was always SELECTed by the header read and simply
706
- * never mapped, so the player had no key to hand back to /list for
707
- * "this person's other sessions". Both keys ride on the header read
708
- * itself - not on the separate, identity-gated getSessionIdentity -
709
- * because neither names anyone.
710
- */
711
- test("maps the identity digest and the visitor id off the header read, without the identity columns", async () => {
712
- headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
907
+ await SessionReplayReadService.listSessions(request());
713
908
 
714
- const header: SessionReplaySessionHeader | null =
715
- await SessionReplayReadService.getSessionHeader({
716
- projectId: projectId,
717
- sessionId: "s-1",
718
- });
909
+ expect(headerQuerySpy).toHaveBeenCalledTimes(1);
910
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(1);
719
911
 
720
- const query: string = statementOf(headerQuerySpy).query;
912
+ const statement: Statement = statementOf(chunkQuerySpy);
913
+ const query: string = statement.query;
914
+ const bound: Array<unknown> = boundValues(statement);
915
+
916
+ /* The chunk table, bound as an identifier like every other read. */
917
+ expect(bound).toContain(AnalyticsTableName.RumSessionChunk);
918
+
919
+ /* The sort-key prefix (projectId, sessionId) plus the app pin. */
920
+ expect(whereSection(query)).toMatch(/projectId = \{p\d+:String\}/);
921
+ expect(whereSection(query)).toMatch(
922
+ /AND sessionId IN \(\{p\d+:Array\(String\)\}\)/,
923
+ );
924
+ expect(whereSection(query)).toMatch(
925
+ /AND rumApplicationId = \{p\d+:String\}/,
926
+ );
927
+ expect(whereSection(query)).toContain("retentionDate >= now()");
928
+ expect(bound).toContain(projectId.toString());
929
+ expect(bound).toContain(rumApplicationId.toString());
930
+
931
+ /* Only the unfinalized sessions of the page, bound, never spelled. */
932
+ expect(bound).toContainEqual(["s-1", "s-3"]);
933
+ expect(query).not.toContain("'s-1'");
934
+ expect(query).not.toContain("'s-3'");
935
+ for (const value of bound) {
936
+ if (Array.isArray(value)) {
937
+ expect(value).not.toContain("s-2");
938
+ }
939
+ }
940
+
941
+ /* Per tab, with exactly the five documented facts. */
942
+ expect(query).toContain("GROUP BY sessionId, tabId");
943
+ expect(query).toContain("max(toUInt8(isFinal)) AS tabHasFinalChunk");
721
944
  expect(query).toContain(
722
- "argMax(identifiedUserKey, version) AS aggIdentifiedUserKey",
945
+ "toFloat64(toUnixTimestamp64Milli(maxIf(chunkEndTime, isFinal))) AS tabFinalChunkEndUnixMs",
946
+ );
947
+ expect(query).toContain(
948
+ "toFloat64(toUnixTimestamp64Milli(max(chunkStartTime))) AS tabLastChunkStartUnixMs",
949
+ );
950
+ expect(query).toContain("toFloat64(max(chunkIndex)) AS tabMaxChunkIndex");
951
+ expect(query).toContain(
952
+ "toFloat64(max(version)) AS tabLastChunkStoredAtUnixMs",
723
953
  );
724
- expect(query).toContain("argMax(visitorId, version) AS aggVisitorId");
725
- expect(query).not.toContain("identifiedUserLabel");
726
954
 
727
- expect(header!.identifiedUserKey).toBe("hmac-key");
728
- expect(header!.visitorId).toBe("0123456789abcdef0123456789abcdef");
955
+ /*
956
+ * The grace is judged in the process against the rows' server write
957
+ * time, not in SQL against the device clock or now64().
958
+ */
959
+ expect(query).not.toContain("now64(");
729
960
 
730
- /* An older recorder's header reads as "", never undefined. */
731
- const olderRow: JSONObject = { ...headerRow, aggIdentifiedUserKey: "" };
732
- delete olderRow["aggVisitorId"];
961
+ /* Maxima need no de-duplication, and the payload is never named. */
962
+ expect(query).not.toContain("LIMIT 1 BY");
963
+ expect(query).not.toMatch(/\bpayload\b(?!Bytes)/);
964
+ expect(query).toContain("timeout_overflow_mode = 'throw'");
965
+ });
733
966
 
734
- headerQuerySpy.mockResolvedValue(fakeResultSet([olderRow]) as never);
967
+ test("an unfinalized session whose single tab sent its final chunk reads as ended once the grace has passed (the closed-tab regression)", async () => {
968
+ mockPage([listRow("s-1", false)]);
969
+ mockChunkFacts([endedTabRow("s-1", "tab-1")]);
735
970
 
736
- const older: SessionReplaySessionHeader | null =
737
- await SessionReplayReadService.getSessionHeader({
738
- projectId: projectId,
739
- sessionId: "s-1",
740
- });
971
+ const result: SessionReplayListResult =
972
+ await SessionReplayReadService.listSessions(request());
741
973
 
742
- expect(older!.identifiedUserKey).toBe("");
743
- expect(older!.visitorId).toBe("");
974
+ expect(result.sessions).toHaveLength(1);
975
+ expect(result.sessions[0]!.isFinalized).toBe(false);
976
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(true);
744
977
  });
745
978
 
746
- test("an ambiguous session id is refused with an actionable message", async () => {
747
- headerQuerySpy.mockResolvedValue(
748
- fakeResultSet([
749
- headerRow,
750
- { ...headerRow, applicationId: "b" },
751
- ]) as never,
752
- );
979
+ /*
980
+ * The flap this grace exists for: in a multi-page app, page A's final
981
+ * chunk lands while page B (a new tab id under the same session) has
982
+ * not stored its first chunk yet. For that moment the only tab the
983
+ * rows know about has ended, and without a grace the list would say
984
+ * "Recording ended" for a session that is still recording, then flip
985
+ * back on the next poll.
986
+ */
987
+ test.each([
988
+ ["stored just now", 0, false],
989
+ ["stored 20 s ago (page B's first chunk still on its way)", 20000, false],
990
+ [
991
+ "stored 1 ms short of the grace",
992
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS - 1,
993
+ false,
994
+ ],
995
+ [
996
+ "stored exactly the grace ago",
997
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS,
998
+ true,
999
+ ],
1000
+ [
1001
+ "stored well past the grace",
1002
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS + 5 * 60 * 1000,
1003
+ true,
1004
+ ],
1005
+ ] as Array<[string, number, boolean]>)(
1006
+ "a single sealed tab %s (%i ms old): hasRecordingEnded %s",
1007
+ async (_label: string, ageMs: number, expected: boolean) => {
1008
+ mockPage([listRow("s-1", false)]);
1009
+ mockChunkFacts([endedTabRow("s-1", "tab-1")]);
1010
+
1011
+ const result: SessionReplayListResult =
1012
+ await SessionReplayReadService.listSessions(
1013
+ request({ nowUnixMs: STORED_AT + ageMs }),
1014
+ );
1015
+
1016
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(expected);
1017
+ },
1018
+ );
753
1019
 
754
- await expect(
755
- SessionReplayReadService.getSessionHeader({
756
- projectId: projectId,
757
- sessionId: "s-1",
1020
+ test("the grace is measured from the NEWEST stored chunk of any tab, not from the oldest seal", async () => {
1021
+ /*
1022
+ * Page A sealed and was stored long ago; page B sealed moments ago.
1023
+ * Page C may still be about to register, so the session is not over.
1024
+ */
1025
+ mockPage([listRow("s-1", false)]);
1026
+ mockChunkFacts([
1027
+ endedTabRow("s-1", "tab-page-a", {
1028
+ tabLastChunkStoredAtUnixMs: STORED_AT - 10 * 60 * 1000,
758
1029
  }),
759
- ).rejects.toThrow(/rumApplicationId/);
760
- });
761
- });
1030
+ endedTabRow("s-1", "tab-page-b", {
1031
+ tabLastChunkStoredAtUnixMs: STORED_AT,
1032
+ }),
1033
+ ]);
762
1034
 
763
- describe("getSessionIdentity", () => {
764
- test("names both identity columns, pinned to the application", async () => {
765
- headerQuerySpy.mockResolvedValue(
766
- fakeResultSet([
767
- {
768
- aggIdentifiedUserLabel: "jane@example.com",
769
- aggIdentifiedUserTraits: { plan: "pro", seats: 4 },
770
- },
771
- ]) as never,
772
- );
1035
+ const early: SessionReplayListResult =
1036
+ await SessionReplayReadService.listSessions(
1037
+ request({ nowUnixMs: GRACE_PASSED - 1 }),
1038
+ );
1039
+ expect(early.sessions[0]!.hasRecordingEnded).toBe(false);
773
1040
 
774
- const identity: SessionReplaySessionIdentity =
775
- await SessionReplayReadService.getSessionIdentity({
776
- projectId: projectId,
777
- rumApplicationId: rumApplicationId,
778
- sessionId: "s-1",
779
- });
1041
+ const late: SessionReplayListResult =
1042
+ await SessionReplayReadService.listSessions(
1043
+ request({ nowUnixMs: GRACE_PASSED }),
1044
+ );
1045
+ expect(late.sessions[0]!.hasRecordingEnded).toBe(true);
1046
+ });
780
1047
 
781
- const statement: Statement = statementOf(headerQuerySpy);
782
- expect(statement.query).toContain(
783
- "argMax(identifiedUserLabel, version) AS aggIdentifiedUserLabel",
1048
+ test("the grace reads the rows' server write time, not the device's chunk clock", async () => {
1049
+ /*
1050
+ * A device clock hours behind the server: its final chunk "ended"
1051
+ * long before now, but the row was stored seconds ago.
1052
+ */
1053
+ mockPage([listRow("s-1", false)]);
1054
+ mockChunkFacts([
1055
+ endedTabRow("s-1", "tab-1", {
1056
+ tabFinalChunkEndUnixMs: FINAL_END - 3 * 60 * 60 * 1000,
1057
+ tabLastChunkStartUnixMs: FINAL_END - 3 * 60 * 60 * 1000 - 15000,
1058
+ }),
1059
+ ]);
1060
+
1061
+ const result: SessionReplayListResult =
1062
+ await SessionReplayReadService.listSessions(
1063
+ request({ nowUnixMs: STORED_AT + 5000 }),
1064
+ );
1065
+
1066
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(false);
1067
+ });
1068
+
1069
+ test("without an injected clock the list measures the grace against Date.now()", async () => {
1070
+ mockPage([listRow("s-1", false)]);
1071
+ mockChunkFacts([endedTabRow("s-1", "tab-1")]);
1072
+
1073
+ const nowSpy: jest.SpyInstance = jest
1074
+ .spyOn(Date, "now")
1075
+ .mockReturnValue(GRACE_PASSED - 1);
1076
+
1077
+ const early: SessionReplayListResult =
1078
+ await SessionReplayReadService.listSessions(listRequest());
1079
+ expect(early.sessions[0]!.hasRecordingEnded).toBe(false);
1080
+
1081
+ nowSpy.mockReturnValue(GRACE_PASSED);
1082
+
1083
+ const late: SessionReplayListResult =
1084
+ await SessionReplayReadService.listSessions(listRequest());
1085
+ expect(late.sessions[0]!.hasRecordingEnded).toBe(true);
1086
+ });
1087
+
1088
+ /*
1089
+ * A tab that reached the per-session chunk cap never gets a final
1090
+ * chunk: the ingest gate refuses every index past the last one, the
1091
+ * recorder's own truncation seal included. It has ended all the same.
1092
+ */
1093
+ test.each([
1094
+ [
1095
+ "at the last permitted index, grace passed",
1096
+ MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
1097
+ GRACE_PASSED,
1098
+ true,
1099
+ ],
1100
+ [
1101
+ "at the last permitted index, inside the grace",
1102
+ MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
1103
+ GRACE_PASSED - 1,
1104
+ false,
1105
+ ],
1106
+ [
1107
+ "one index short of the cap, grace passed",
1108
+ MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 2,
1109
+ GRACE_PASSED,
1110
+ false,
1111
+ ],
1112
+ ] as Array<[string, number, number, boolean]>)(
1113
+ "a capped tab with no final chunk %s (index %i, now %i): hasRecordingEnded %s",
1114
+ async (
1115
+ _label: string,
1116
+ maxChunkIndex: number,
1117
+ nowUnixMs: number,
1118
+ expected: boolean,
1119
+ ) => {
1120
+ mockPage([listRow("s-1", false)]);
1121
+ mockChunkFacts([
1122
+ liveTabRow("s-1", "tab-1", { tabMaxChunkIndex: maxChunkIndex }),
1123
+ ]);
1124
+
1125
+ const result: SessionReplayListResult =
1126
+ await SessionReplayReadService.listSessions(
1127
+ request({ nowUnixMs: nowUnixMs }),
1128
+ );
1129
+
1130
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(expected);
1131
+ },
1132
+ );
1133
+
1134
+ test("one live tab among ended ones keeps the whole session recording", async () => {
1135
+ mockPage([listRow("s-1", false)]);
1136
+ mockChunkFacts([
1137
+ endedTabRow("s-1", "tab-1"),
1138
+ liveTabRow("s-1", "tab-2"),
1139
+ endedTabRow("s-1", "tab-3"),
1140
+ ]);
1141
+
1142
+ const result: SessionReplayListResult =
1143
+ await SessionReplayReadService.listSessions(request());
1144
+
1145
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(false);
1146
+ });
1147
+
1148
+ test("an older recorder's trailing chunk inside the tolerance still ends the tab; one past it does not", async () => {
1149
+ mockPage([listRow("s-trailing", false), listRow("s-resumed", false)]);
1150
+ mockChunkFacts([
1151
+ endedTabRow("s-trailing", "tab-1", {
1152
+ tabLastChunkStartUnixMs:
1153
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS,
1154
+ }),
1155
+ endedTabRow("s-resumed", "tab-1", {
1156
+ tabLastChunkStartUnixMs:
1157
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS + 1,
1158
+ }),
1159
+ ]);
1160
+
1161
+ const result: SessionReplayListResult =
1162
+ await SessionReplayReadService.listSessions(request());
1163
+
1164
+ expect(endedBySessionId(result)).toEqual({
1165
+ "s-trailing": true,
1166
+ "s-resumed": false,
1167
+ });
1168
+ });
1169
+
1170
+ test("each session is judged on its own tabs and its own stored times", async () => {
1171
+ mockPage([
1172
+ listRow("s-ended", false),
1173
+ listRow("s-live", false),
1174
+ listRow("s-mixed", false),
1175
+ listRow("s-recent", false),
1176
+ ]);
1177
+ mockChunkFacts([
1178
+ endedTabRow("s-ended", "tab-1"),
1179
+ endedTabRow("s-ended", "tab-2"),
1180
+ liveTabRow("s-live", "tab-1"),
1181
+ endedTabRow("s-mixed", "tab-1"),
1182
+ liveTabRow("s-mixed", "tab-2"),
1183
+ endedTabRow("s-recent", "tab-1", {
1184
+ tabLastChunkStoredAtUnixMs: GRACE_PASSED - 1000,
1185
+ }),
1186
+ ]);
1187
+
1188
+ const result: SessionReplayListResult =
1189
+ await SessionReplayReadService.listSessions(request());
1190
+
1191
+ expect(endedBySessionId(result)).toEqual({
1192
+ "s-ended": true,
1193
+ "s-live": false,
1194
+ "s-mixed": false,
1195
+ "s-recent": false,
1196
+ });
1197
+ });
1198
+
1199
+ test("a finalized session is never 'ended', even when chunk facts for it come back", async () => {
1200
+ mockPage([listRow("s-final", true), listRow("s-open", false)]);
1201
+ mockChunkFacts([
1202
+ endedTabRow("s-final", "tab-1"),
1203
+ endedTabRow("s-open", "tab-1"),
1204
+ ]);
1205
+
1206
+ const result: SessionReplayListResult =
1207
+ await SessionReplayReadService.listSessions(request());
1208
+
1209
+ expect(endedBySessionId(result)).toEqual({
1210
+ "s-final": false,
1211
+ "s-open": true,
1212
+ });
1213
+ expect(boundValues(statementOf(chunkQuerySpy))).toContainEqual([
1214
+ "s-open",
1215
+ ]);
1216
+ });
1217
+
1218
+ test("a page of only finalized sessions runs no follow-up query", async () => {
1219
+ mockPage([listRow("s-1", true), listRow("s-2", true)]);
1220
+
1221
+ const result: SessionReplayListResult =
1222
+ await SessionReplayReadService.listSessions(request());
1223
+
1224
+ expect(chunkQuerySpy).not.toHaveBeenCalled();
1225
+ expect(endedBySessionId(result)).toEqual({ "s-1": false, "s-2": false });
1226
+ });
1227
+
1228
+ test("an empty page runs no follow-up query", async () => {
1229
+ mockPage([]);
1230
+
1231
+ const result: SessionReplayListResult =
1232
+ await SessionReplayReadService.listSessions(request());
1233
+
1234
+ expect(result.sessions).toHaveLength(0);
1235
+ expect(chunkQuerySpy).not.toHaveBeenCalled();
1236
+ });
1237
+
1238
+ test("the look-ahead row past the page size is not asked about", async () => {
1239
+ mockPage([listRow("s-1", false), listRow("s-2", false)]);
1240
+
1241
+ const result: SessionReplayListResult =
1242
+ await SessionReplayReadService.listSessions(request({ limit: 1 }));
1243
+
1244
+ expect(result.sessions).toHaveLength(1);
1245
+ expect(result.nextCursor).not.toBeNull();
1246
+ expect(boundValues(statementOf(chunkQuerySpy))).toContainEqual(["s-1"]);
1247
+ });
1248
+
1249
+ test("an unfinalized session with no chunk rows yet is not 'ended'", async () => {
1250
+ mockPage([listRow("s-1", false), listRow("s-2", false)]);
1251
+ mockChunkFacts([endedTabRow("s-2", "tab-1")]);
1252
+
1253
+ const result: SessionReplayListResult =
1254
+ await SessionReplayReadService.listSessions(request());
1255
+
1256
+ expect(endedBySessionId(result)).toEqual({ "s-1": false, "s-2": true });
1257
+ });
1258
+
1259
+ test("a thrown follow-up leaves every row false and still returns the list", async () => {
1260
+ const warnSpy: jest.SpyInstance = jest
1261
+ .spyOn(logger, "warn")
1262
+ .mockImplementation((): void => {
1263
+ return;
1264
+ });
1265
+
1266
+ mockPage([listRow("s-1", false), listRow("s-2", true)]);
1267
+ chunkQuerySpy.mockRejectedValue(new Error("clickhouse down") as never);
1268
+
1269
+ const result: SessionReplayListResult =
1270
+ await SessionReplayReadService.listSessions(request());
1271
+
1272
+ expect(result.sessions).toHaveLength(2);
1273
+ expect(endedBySessionId(result)).toEqual({ "s-1": false, "s-2": false });
1274
+ expect(warnSpy).toHaveBeenCalled();
1275
+ });
1276
+
1277
+ test("a follow-up whose body cannot be parsed degrades the same way", async () => {
1278
+ jest.spyOn(logger, "warn").mockImplementation((): void => {
1279
+ return;
1280
+ });
1281
+
1282
+ mockPage([listRow("s-1", false)]);
1283
+ chunkQuerySpy.mockResolvedValue({
1284
+ json: async (): Promise<JSONObject> => {
1285
+ throw new Error("truncated body");
1286
+ },
1287
+ } as never);
1288
+
1289
+ const result: SessionReplayListResult =
1290
+ await SessionReplayReadService.listSessions(request());
1291
+
1292
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(false);
1293
+ });
1294
+
1295
+ test("ClickHouse's quoted numbers parse, and a missing clock is never read as ended", async () => {
1296
+ mockPage([
1297
+ listRow("s-quoted", false),
1298
+ listRow("s-no-start", false),
1299
+ listRow("s-no-end", false),
1300
+ listRow("s-garbled", false),
1301
+ listRow("s-no-stored-at", false),
1302
+ listRow("s-blank-stored-at", false),
1303
+ listRow("s-no-index", false),
1304
+ ]);
1305
+ mockChunkFacts([
1306
+ {
1307
+ sessionId: "s-quoted",
1308
+ tabId: "tab-1",
1309
+ tabHasFinalChunk: "1",
1310
+ tabFinalChunkEndUnixMs: String(FINAL_END),
1311
+ tabLastChunkStartUnixMs: String(FINAL_END - 15000),
1312
+ tabMaxChunkIndex: "4",
1313
+ tabLastChunkStoredAtUnixMs: String(STORED_AT),
1314
+ },
1315
+ {
1316
+ sessionId: "s-no-start",
1317
+ tabId: "tab-1",
1318
+ tabHasFinalChunk: 1,
1319
+ tabFinalChunkEndUnixMs: FINAL_END,
1320
+ tabMaxChunkIndex: 4,
1321
+ tabLastChunkStoredAtUnixMs: STORED_AT,
1322
+ },
1323
+ {
1324
+ sessionId: "s-no-end",
1325
+ tabId: "tab-1",
1326
+ tabHasFinalChunk: 1,
1327
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1328
+ tabMaxChunkIndex: 4,
1329
+ tabLastChunkStoredAtUnixMs: STORED_AT,
1330
+ },
1331
+ {
1332
+ sessionId: "s-garbled",
1333
+ tabId: "tab-1",
1334
+ tabHasFinalChunk: 1,
1335
+ tabFinalChunkEndUnixMs: "not-a-number",
1336
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1337
+ tabMaxChunkIndex: 4,
1338
+ tabLastChunkStoredAtUnixMs: STORED_AT,
1339
+ },
1340
+ /*
1341
+ * A missing write time must not read as 0 - epoch is older than
1342
+ * any grace, which would skip it outright.
1343
+ */
1344
+ {
1345
+ sessionId: "s-no-stored-at",
1346
+ tabId: "tab-1",
1347
+ tabHasFinalChunk: 1,
1348
+ tabFinalChunkEndUnixMs: FINAL_END,
1349
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1350
+ tabMaxChunkIndex: 4,
1351
+ },
1352
+ {
1353
+ sessionId: "s-blank-stored-at",
1354
+ tabId: "tab-1",
1355
+ tabHasFinalChunk: 1,
1356
+ tabFinalChunkEndUnixMs: FINAL_END,
1357
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1358
+ tabMaxChunkIndex: 4,
1359
+ tabLastChunkStoredAtUnixMs: " ",
1360
+ },
1361
+ /*
1362
+ * A missing chunk index only means the cap rule cannot apply; a
1363
+ * sealed tab is still judged by its seal.
1364
+ */
1365
+ {
1366
+ sessionId: "s-no-index",
1367
+ tabId: "tab-1",
1368
+ tabHasFinalChunk: 1,
1369
+ tabFinalChunkEndUnixMs: FINAL_END,
1370
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1371
+ tabLastChunkStoredAtUnixMs: STORED_AT,
1372
+ },
1373
+ ]);
1374
+
1375
+ const result: SessionReplayListResult =
1376
+ await SessionReplayReadService.listSessions(request());
1377
+
1378
+ expect(endedBySessionId(result)).toEqual({
1379
+ "s-quoted": true,
1380
+ "s-no-start": false,
1381
+ "s-no-end": false,
1382
+ "s-garbled": false,
1383
+ "s-no-stored-at": false,
1384
+ "s-blank-stored-at": false,
1385
+ "s-no-index": true,
1386
+ });
1387
+ });
1388
+
1389
+ test("a missing or garbled chunk index never reads as capped", async () => {
1390
+ mockPage([listRow("s-no-index", false), listRow("s-garbled", false)]);
1391
+ mockChunkFacts([
1392
+ liveTabRow("s-no-index", "tab-1", { tabMaxChunkIndex: undefined }),
1393
+ liveTabRow("s-garbled", "tab-1", { tabMaxChunkIndex: "Infinity" }),
1394
+ ]);
1395
+
1396
+ const result: SessionReplayListResult =
1397
+ await SessionReplayReadService.listSessions(request());
1398
+
1399
+ expect(endedBySessionId(result)).toEqual({
1400
+ "s-no-index": false,
1401
+ "s-garbled": false,
1402
+ });
1403
+ });
1404
+
1405
+ test("a chunk row for a session that was not asked about decides nothing", async () => {
1406
+ mockPage([listRow("s-1", false)]);
1407
+ mockChunkFacts([
1408
+ endedTabRow("s-1", "tab-1"),
1409
+ liveTabRow("someone-else", "tab-1"),
1410
+ endedTabRow("", "tab-1"),
1411
+ ]);
1412
+
1413
+ const result: SessionReplayListResult =
1414
+ await SessionReplayReadService.listSessions(request());
1415
+
1416
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(true);
1417
+ });
1418
+
1419
+ /*
1420
+ * The follow-up now keys its facts per (session, tab) so the manifest
1421
+ * can answer each tab's own hasRecordingEnded off the same read. GROUP
1422
+ * BY sessionId, tabId makes that pair unique, so this only guards a
1423
+ * result that repeats one: the rows fold with the same maxima the group
1424
+ * applies, and the session verdict is what it always was.
1425
+ */
1426
+ test("repeated rows for one tab of a session fold like a single group", async () => {
1427
+ mockPage([listRow("s-sealed", false), listRow("s-resumed", false)]);
1428
+ mockChunkFacts([
1429
+ /* Both rows of the tab sealed: the session is over. */
1430
+ liveTabRow("s-sealed", "tab-1", {
1431
+ tabLastChunkStartUnixMs: FINAL_END - 15000,
1432
+ }),
1433
+ endedTabRow("s-sealed", "tab-1"),
1434
+ /* The tab kept recording past the tolerance: still recording. */
1435
+ endedTabRow("s-resumed", "tab-1"),
1436
+ liveTabRow("s-resumed", "tab-1", {
1437
+ tabLastChunkStartUnixMs:
1438
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS + 1,
1439
+ }),
1440
+ ]);
1441
+
1442
+ const result: SessionReplayListResult =
1443
+ await SessionReplayReadService.listSessions(request());
1444
+
1445
+ expect(endedBySessionId(result)).toEqual({
1446
+ "s-sealed": true,
1447
+ "s-resumed": false,
1448
+ });
1449
+ });
1450
+
1451
+ /*
1452
+ * The manifest's per-tab flags ride on the same read; the list must
1453
+ * still answer one flag per session and nothing per tab.
1454
+ */
1455
+ test("the list reports only the session-level flag, from one follow-up read", async () => {
1456
+ mockPage([listRow("s-1", false)]);
1457
+ mockChunkFacts([endedTabRow("s-1", "tab-1"), liveTabRow("s-1", "tab-2")]);
1458
+
1459
+ const result: SessionReplayListResult =
1460
+ await SessionReplayReadService.listSessions(request());
1461
+
1462
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(1);
1463
+ expect(result.sessions[0]!.hasRecordingEnded).toBe(false);
1464
+ expect(Object.keys(result.sessions[0]!)).not.toContain("tabs");
1465
+ });
1466
+
1467
+ test("the follow-up does not change the list statement or its filters", async () => {
1468
+ mockPage([listRow("s-1", false)]);
1469
+
1470
+ const query: string = await listQuery({ isFinalized: false });
1471
+
1472
+ /* "Live" stays "not finalized"; the chunk facts never reach HAVING. */
1473
+ expect(havingSection(query)).toMatch(/aggIsFinalized = \{p\d+:Bool\}/);
1474
+ expect(query).not.toContain("isFinal)");
1475
+ expect(query).not.toContain("tabHasFinalChunk");
1476
+ expect(query).not.toContain("tabLastChunkStoredAtUnixMs");
1477
+ });
1478
+ });
1479
+
1480
+ describe("getSessionHeader", () => {
1481
+ const headerRow: JSONObject = {
1482
+ sessionId: "s-1",
1483
+ headerProjectId: "p",
1484
+ applicationId: "a",
1485
+ aggStartTime: 1700000000000,
1486
+ aggEndTime: 1700000060000,
1487
+ aggIsFinalized: 1,
1488
+ aggClientReportedStart: 1699999999000,
1489
+ aggTags: { env: "prod" },
1490
+ aggExpiresAt: 1700604800000,
1491
+ aggClickCount: 7,
1492
+ aggCustomEventCount: 2,
1493
+ aggActiveMs: 30000,
1494
+ aggFirstErrorOffsetMs: 5000,
1495
+ aggAttributes: {
1496
+ "recorder.capabilities": "click-events,web-vitals,made-up",
1497
+ },
1498
+ aggIdentifiedUserKey: "hmac-key",
1499
+ aggVisitorId: "0123456789abcdef0123456789abcdef",
1500
+ };
1501
+
1502
+ test("never names the identity columns and pins the application only when given one", async () => {
1503
+ headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
1504
+
1505
+ await SessionReplayReadService.getSessionHeader({
1506
+ projectId: projectId,
1507
+ sessionId: "s-1",
1508
+ });
1509
+
1510
+ const plain: string = statementOf(headerQuerySpy).query;
1511
+ expect(plain).not.toContain("identifiedUserLabel");
1512
+ expect(plain).not.toContain("identifiedUserTraits");
1513
+ expect(plain).not.toContain("rumApplicationId = ");
1514
+ expect(plain).toContain("LIMIT 2");
1515
+ expect(plain).toContain("retentionDate >= now()");
1516
+
1517
+ headerQuerySpy.mockClear();
1518
+
1519
+ await SessionReplayReadService.getSessionHeader({
1520
+ projectId: projectId,
1521
+ sessionId: "s-1",
1522
+ rumApplicationId: rumApplicationId,
1523
+ });
1524
+
1525
+ const pinned: Statement = statementOf(headerQuerySpy);
1526
+ expect(whereSection(pinned.query)).toContain("rumApplicationId = ");
1527
+ expect(boundValues(pinned)).toContain(rumApplicationId.toString());
1528
+ });
1529
+
1530
+ test("maps the clock, tags, expiry, counters and the known recorder capabilities", async () => {
1531
+ headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
1532
+
1533
+ const header: SessionReplaySessionHeader | null =
1534
+ await SessionReplayReadService.getSessionHeader({
1535
+ projectId: projectId,
1536
+ sessionId: "s-1",
1537
+ });
1538
+
1539
+ expect(header).not.toBeNull();
1540
+ expect(header!.startTimeUnixMs).toBe(1700000000000);
1541
+ expect(header!.endTimeUnixMs).toBe(1700000060000);
1542
+ expect(header!.clientReportedStartUnixMs).toBe(1699999999000);
1543
+ expect(header!.tags).toEqual({ env: "prod" });
1544
+ expect(header!.expiresAtUnixMs).toBe(1700604800000);
1545
+ expect(header!.clickCount).toBe(7);
1546
+ expect(header!.customEventCount).toBe(2);
1547
+ expect(header!.activeMs).toBe(30000);
1548
+ expect(header!.firstErrorOffsetMs).toBe(5000);
1549
+ /* A stored value outside the vocabulary never reaches the player. */
1550
+ expect(header!.recorderCapabilities).toEqual([
1551
+ "click-events",
1552
+ "web-vitals",
1553
+ ]);
1554
+ expect(header!.identifiedUserLabel).toBeUndefined();
1555
+ expect(header!.identifiedUserTraits).toBeUndefined();
1556
+ });
1557
+
1558
+ /*
1559
+ * The digest alias was always SELECTed by the header read and simply
1560
+ * never mapped, so the player had no key to hand back to /list for
1561
+ * "this person's other sessions". Both keys ride on the header read
1562
+ * itself - not on the separate, identity-gated getSessionIdentity -
1563
+ * because neither names anyone.
1564
+ */
1565
+ test("maps the identity digest and the visitor id off the header read, without the identity columns", async () => {
1566
+ headerQuerySpy.mockResolvedValue(fakeResultSet([headerRow]) as never);
1567
+
1568
+ const header: SessionReplaySessionHeader | null =
1569
+ await SessionReplayReadService.getSessionHeader({
1570
+ projectId: projectId,
1571
+ sessionId: "s-1",
1572
+ });
1573
+
1574
+ const query: string = statementOf(headerQuerySpy).query;
1575
+ expect(query).toContain(
1576
+ "argMax(identifiedUserKey, version) AS aggIdentifiedUserKey",
1577
+ );
1578
+ expect(query).toContain("argMax(visitorId, version) AS aggVisitorId");
1579
+ expect(query).not.toContain("identifiedUserLabel");
1580
+
1581
+ expect(header!.identifiedUserKey).toBe("hmac-key");
1582
+ expect(header!.visitorId).toBe("0123456789abcdef0123456789abcdef");
1583
+
1584
+ /* An older recorder's header reads as "", never undefined. */
1585
+ const olderRow: JSONObject = { ...headerRow, aggIdentifiedUserKey: "" };
1586
+ delete olderRow["aggVisitorId"];
1587
+
1588
+ headerQuerySpy.mockResolvedValue(fakeResultSet([olderRow]) as never);
1589
+
1590
+ const older: SessionReplaySessionHeader | null =
1591
+ await SessionReplayReadService.getSessionHeader({
1592
+ projectId: projectId,
1593
+ sessionId: "s-1",
1594
+ });
1595
+
1596
+ expect(older!.identifiedUserKey).toBe("");
1597
+ expect(older!.visitorId).toBe("");
1598
+ });
1599
+
1600
+ /*
1601
+ * The header read is also the authorization lookup behind every chunk
1602
+ * and heartbeat request (cached 30s), so it must not grow a chunk-table
1603
+ * read. It answers false; getManifest judges the field.
1604
+ */
1605
+ test("never reads the chunk table and leaves hasRecordingEnded to the manifest", async () => {
1606
+ headerQuerySpy.mockResolvedValue(
1607
+ fakeResultSet([
1608
+ { ...headerRow, aggIsFinalized: 0, aggSealedReason: "final-chunk" },
1609
+ ]) as never,
1610
+ );
1611
+
1612
+ const header: SessionReplaySessionHeader | null =
1613
+ await SessionReplayReadService.getSessionHeader({
1614
+ projectId: projectId,
1615
+ sessionId: "s-1",
1616
+ rumApplicationId: rumApplicationId,
1617
+ });
1618
+
1619
+ expect(header!.isFinalized).toBe(false);
1620
+ expect(header!.hasRecordingEnded).toBe(false);
1621
+ expect(chunkQuerySpy).not.toHaveBeenCalled();
1622
+ });
1623
+
1624
+ test("an ambiguous session id is refused with an actionable message", async () => {
1625
+ headerQuerySpy.mockResolvedValue(
1626
+ fakeResultSet([
1627
+ headerRow,
1628
+ { ...headerRow, applicationId: "b" },
1629
+ ]) as never,
1630
+ );
1631
+
1632
+ await expect(
1633
+ SessionReplayReadService.getSessionHeader({
1634
+ projectId: projectId,
1635
+ sessionId: "s-1",
1636
+ }),
1637
+ ).rejects.toThrow(/rumApplicationId/);
1638
+ });
1639
+ });
1640
+
1641
+ describe("getSessionIdentity", () => {
1642
+ test("names both identity columns, pinned to the application", async () => {
1643
+ headerQuerySpy.mockResolvedValue(
1644
+ fakeResultSet([
1645
+ {
1646
+ aggIdentifiedUserLabel: "jane@example.com",
1647
+ aggIdentifiedUserTraits: { plan: "pro", seats: 4 },
1648
+ },
1649
+ ]) as never,
1650
+ );
1651
+
1652
+ const identity: SessionReplaySessionIdentity =
1653
+ await SessionReplayReadService.getSessionIdentity({
1654
+ projectId: projectId,
1655
+ rumApplicationId: rumApplicationId,
1656
+ sessionId: "s-1",
1657
+ });
1658
+
1659
+ const statement: Statement = statementOf(headerQuerySpy);
1660
+ expect(statement.query).toContain(
1661
+ "argMax(identifiedUserLabel, version) AS aggIdentifiedUserLabel",
784
1662
  );
785
1663
  expect(statement.query).toContain(
786
1664
  "argMax(identifiedUserTraits, version) AS aggIdentifiedUserTraits",
@@ -1355,6 +2233,7 @@ describe("SessionReplayReadService statements", () => {
1355
2233
  recorderCapabilities: [],
1356
2234
  identifiedUserKey: "",
1357
2235
  visitorId: "",
2236
+ hasRecordingEnded: false,
1358
2237
  ...overrides,
1359
2238
  };
1360
2239
  }
@@ -1395,70 +2274,750 @@ describe("SessionReplayReadService statements", () => {
1395
2274
  },
1396
2275
  ];
1397
2276
 
1398
- test("projects clickCount and url per chunk, never the payload, and derives each tab's first offset", async () => {
1399
- chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2277
+ test("projects clickCount and url per chunk, never the payload, and derives each tab's first offset", async () => {
2278
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2279
+
2280
+ const manifest: SessionReplayManifest =
2281
+ await SessionReplayReadService.getManifest({
2282
+ header: header({ isFinalized: true, durationMs: 150000 }),
2283
+ projectId: projectId,
2284
+ rumApplicationId: rumApplicationId,
2285
+ sessionId: "s-1",
2286
+ });
2287
+
2288
+ const query: string = statementOf(chunkQuerySpy).query;
2289
+ expect(query).toContain("clickCount");
2290
+ expect(query).toContain("url");
2291
+ expect(query).not.toMatch(/\bpayload\b(?!Bytes)/);
2292
+ expect(query).not.toContain("length(payload)");
2293
+ expect(query).toContain("retentionDate >= now()");
2294
+
2295
+ expect(manifest.tabs).toHaveLength(2);
2296
+ expect(manifest.tabs[0]!.firstChunkStartOffsetMs).toBe(0);
2297
+ expect(manifest.tabs[1]!.firstChunkStartOffsetMs).toBe(134000);
2298
+ expect(manifest.tabs[0]!.chunks[1]!.clickCount).toBe(1);
2299
+ expect(manifest.tabs[0]!.chunks[1]!.url).toBe("https://a/checkout");
2300
+ });
2301
+
2302
+ test("a finalized header is returned untouched", async () => {
2303
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2304
+
2305
+ const finalized: SessionReplaySessionHeader = header({
2306
+ isFinalized: true,
2307
+ durationMs: 90000,
2308
+ chunkCount: 9,
2309
+ eventCount: 9,
2310
+ });
2311
+
2312
+ const manifest: SessionReplayManifest =
2313
+ await SessionReplayReadService.getManifest({
2314
+ header: finalized,
2315
+ projectId: projectId,
2316
+ rumApplicationId: rumApplicationId,
2317
+ sessionId: "s-1",
2318
+ });
2319
+
2320
+ expect(manifest.header).toBe(finalized);
2321
+ });
2322
+
2323
+ test("a provisional header reports what its chunk rows prove instead of zeros", async () => {
2324
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2325
+
2326
+ const manifest: SessionReplayManifest =
2327
+ await SessionReplayReadService.getManifest({
2328
+ header: header({ isFinalized: false }),
2329
+ projectId: projectId,
2330
+ rumApplicationId: rumApplicationId,
2331
+ sessionId: "s-1",
2332
+ });
2333
+
2334
+ expect(manifest.header.isFinalized).toBe(false);
2335
+ expect(manifest.header.durationMs).toBe(150000);
2336
+ expect(manifest.header.chunkCount).toBe(3);
2337
+ expect(manifest.header.eventCount).toBe(170);
2338
+ expect(manifest.header.maxChunkIndex).toBe(1);
2339
+ expect(manifest.header.endTimeUnixMs).toBe(1700000150000);
2340
+ expect(manifest.header.endTime.getTime()).toBe(1700000150000);
2341
+ });
2342
+
2343
+ /*
2344
+ * The player's Live pill reads the manifest header. The header read
2345
+ * itself never judges hasRecordingEnded (it is also the cached
2346
+ * authorization lookup), so the manifest does, with the same helper
2347
+ * and the same statement as the list.
2348
+ */
2349
+ describe("hasRecordingEnded on the manifest header", () => {
2350
+ const FINAL_END: number = 1700000150000;
2351
+ /* Server write time of the newest chunk row (its version). */
2352
+ const STORED_AT: number = FINAL_END + 1500;
2353
+ const GRACE_PASSED: number =
2354
+ STORED_AT + SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS;
2355
+
2356
+ function endedTabRow(
2357
+ tabId: string,
2358
+ overrides: JSONObject = {},
2359
+ ): JSONObject {
2360
+ return {
2361
+ sessionId: "s-1",
2362
+ tabId: tabId,
2363
+ tabHasFinalChunk: 1,
2364
+ tabFinalChunkEndUnixMs: FINAL_END,
2365
+ tabLastChunkStartUnixMs: FINAL_END - 16000,
2366
+ tabMaxChunkIndex: 1,
2367
+ tabLastChunkStoredAtUnixMs: STORED_AT,
2368
+ ...overrides,
2369
+ };
2370
+ }
2371
+
2372
+ function liveTabRow(
2373
+ tabId: string,
2374
+ overrides: JSONObject = {},
2375
+ ): JSONObject {
2376
+ return {
2377
+ sessionId: "s-1",
2378
+ tabId: tabId,
2379
+ tabHasFinalChunk: 0,
2380
+ tabFinalChunkEndUnixMs: 0,
2381
+ tabLastChunkStartUnixMs: FINAL_END,
2382
+ tabMaxChunkIndex: 1,
2383
+ tabLastChunkStoredAtUnixMs: STORED_AT,
2384
+ ...overrides,
2385
+ };
2386
+ }
2387
+
2388
+ async function manifestAt(
2389
+ nowUnixMs: number | undefined,
2390
+ ): Promise<SessionReplayManifest> {
2391
+ return SessionReplayReadService.getManifest({
2392
+ header: header({ isFinalized: false }),
2393
+ projectId: projectId,
2394
+ rumApplicationId: rumApplicationId,
2395
+ sessionId: "s-1",
2396
+ ...(nowUnixMs !== undefined && { nowUnixMs: nowUnixMs }),
2397
+ });
2398
+ }
2399
+
2400
+ function mockManifestThenFacts(facts: Array<JSONObject>): void {
2401
+ chunkQuerySpy
2402
+ .mockResolvedValueOnce(fakeResultSet(chunkRows) as never)
2403
+ .mockResolvedValueOnce(fakeResultSet(facts) as never);
2404
+ }
2405
+
2406
+ test("an unfinalized session whose every tab sent its final chunk is ended once the grace has passed, read pinned to the authorized application", async () => {
2407
+ mockManifestThenFacts([
2408
+ endedTabRow("tab-1"),
2409
+ endedTabRow("tab-2", {
2410
+ tabLastChunkStartUnixMs: FINAL_END + 4,
2411
+ }),
2412
+ ]);
2413
+
2414
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2415
+
2416
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(2);
2417
+
2418
+ /* The manifest statement goes first and is unchanged. */
2419
+ const manifestQuery: string = statementOf(chunkQuerySpy, 0).query;
2420
+ expect(manifestQuery).toContain("LIMIT 1 BY tabId, chunkIndex");
2421
+ expect(manifestQuery).not.toContain("tabHasFinalChunk");
2422
+
2423
+ const ended: Statement = statementOf(chunkQuerySpy, 1);
2424
+ expect(ended.query).toContain("GROUP BY sessionId, tabId");
2425
+ expect(ended.query).toMatch(
2426
+ /AND sessionId IN \(\{p\d+:Array\(String\)\}\)/,
2427
+ );
2428
+ expect(ended.query).toMatch(/AND rumApplicationId = \{p\d+:String\}/);
2429
+ expect(ended.query).toContain(
2430
+ "toFloat64(max(chunkIndex)) AS tabMaxChunkIndex",
2431
+ );
2432
+ expect(ended.query).toContain(
2433
+ "toFloat64(max(version)) AS tabLastChunkStoredAtUnixMs",
2434
+ );
2435
+ expect(boundValues(ended)).toContainEqual(["s-1"]);
2436
+ expect(boundValues(ended)).toContain(rumApplicationId.toString());
2437
+ expect(boundValues(ended)).toContain(projectId.toString());
2438
+
2439
+ expect(manifest.header.isFinalized).toBe(false);
2440
+ expect(manifest.header.hasRecordingEnded).toBe(true);
2441
+ /* The live reconciliation still happens alongside it. */
2442
+ expect(manifest.header.durationMs).toBe(150000);
2443
+ expect(manifest.header.chunkCount).toBe(3);
2444
+ });
2445
+
2446
+ /*
2447
+ * The player's Live pill must not switch off while a multi-page
2448
+ * app's next page is still registering its first chunk.
2449
+ */
2450
+ test.each([
2451
+ ["stored just now", 0, false],
2452
+ [
2453
+ "stored 1 ms short of the grace",
2454
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS - 1,
2455
+ false,
2456
+ ],
2457
+ [
2458
+ "stored exactly the grace ago",
2459
+ SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS,
2460
+ true,
2461
+ ],
2462
+ ] as Array<[string, number, boolean]>)(
2463
+ "a single sealed tab %s (%i ms old): hasRecordingEnded %s",
2464
+ async (_label: string, ageMs: number, expected: boolean) => {
2465
+ mockManifestThenFacts([endedTabRow("tab-1")]);
2466
+
2467
+ const manifest: SessionReplayManifest = await manifestAt(
2468
+ STORED_AT + ageMs,
2469
+ );
2470
+
2471
+ expect(manifest.header.hasRecordingEnded).toBe(expected);
2472
+ },
2473
+ );
2474
+
2475
+ test("a capped tab with no final chunk is ended after the grace, not before", async () => {
2476
+ const capped: JSONObject = liveTabRow("tab-1", {
2477
+ tabMaxChunkIndex: MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
2478
+ });
2479
+
2480
+ mockManifestThenFacts([capped]);
2481
+ expect(
2482
+ (await manifestAt(GRACE_PASSED - 1)).header.hasRecordingEnded,
2483
+ ).toBe(false);
2484
+
2485
+ mockManifestThenFacts([capped]);
2486
+ expect((await manifestAt(GRACE_PASSED)).header.hasRecordingEnded).toBe(
2487
+ true,
2488
+ );
2489
+ });
2490
+
2491
+ test("without an injected clock the manifest measures the grace against Date.now()", async () => {
2492
+ const nowSpy: jest.SpyInstance = jest
2493
+ .spyOn(Date, "now")
2494
+ .mockReturnValue(GRACE_PASSED - 1);
2495
+
2496
+ mockManifestThenFacts([endedTabRow("tab-1")]);
2497
+ expect((await manifestAt(undefined)).header.hasRecordingEnded).toBe(
2498
+ false,
2499
+ );
2500
+
2501
+ nowSpy.mockReturnValue(GRACE_PASSED);
2502
+
2503
+ mockManifestThenFacts([endedTabRow("tab-1")]);
2504
+ expect((await manifestAt(undefined)).header.hasRecordingEnded).toBe(
2505
+ true,
2506
+ );
2507
+ });
2508
+
2509
+ test("one tab still recording keeps the header live", async () => {
2510
+ mockManifestThenFacts([endedTabRow("tab-1"), liveTabRow("tab-2")]);
2511
+
2512
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2513
+
2514
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2515
+ });
2516
+
2517
+ test("a tab that kept recording past the tolerance after its final chunk keeps the header live", async () => {
2518
+ mockManifestThenFacts([
2519
+ endedTabRow("tab-1", {
2520
+ tabLastChunkStartUnixMs:
2521
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS + 1,
2522
+ }),
2523
+ ]);
2524
+
2525
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2526
+
2527
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2528
+ });
2529
+
2530
+ test("a finalized header runs no second read and is still returned untouched", async () => {
2531
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2532
+
2533
+ const finalized: SessionReplaySessionHeader = header({
2534
+ isFinalized: true,
2535
+ durationMs: 150000,
2536
+ });
2537
+
2538
+ const manifest: SessionReplayManifest =
2539
+ await SessionReplayReadService.getManifest({
2540
+ header: finalized,
2541
+ projectId: projectId,
2542
+ rumApplicationId: rumApplicationId,
2543
+ sessionId: "s-1",
2544
+ nowUnixMs: GRACE_PASSED,
2545
+ });
2546
+
2547
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(1);
2548
+ expect(manifest.header).toBe(finalized);
2549
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2550
+ });
2551
+
2552
+ test("a failed ended read answers 'not ended' and never fails the manifest", async () => {
2553
+ const warnSpy: jest.SpyInstance = jest
2554
+ .spyOn(logger, "warn")
2555
+ .mockImplementation((): void => {
2556
+ return;
2557
+ });
2558
+
2559
+ chunkQuerySpy
2560
+ .mockResolvedValueOnce(fakeResultSet(chunkRows) as never)
2561
+ .mockRejectedValueOnce(new Error("clickhouse down") as never);
2562
+
2563
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2564
+
2565
+ expect(manifest.tabs).toHaveLength(2);
2566
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2567
+ expect(manifest.header.chunkCount).toBe(3);
2568
+ expect(warnSpy).toHaveBeenCalled();
2569
+ });
2570
+
2571
+ test("a failed manifest read still fails, whatever the ended read answered", async () => {
2572
+ chunkQuerySpy
2573
+ .mockRejectedValueOnce(new Error("manifest down") as never)
2574
+ .mockResolvedValueOnce(
2575
+ fakeResultSet([endedTabRow("tab-1")]) as never,
2576
+ );
2577
+
2578
+ await expect(manifestAt(GRACE_PASSED)).rejects.toThrow("manifest down");
2579
+ });
2580
+
2581
+ test("an unfinalized header with no chunk rows is not ended and keeps its fields", async () => {
2582
+ const provisional: SessionReplaySessionHeader = header({
2583
+ isFinalized: false,
2584
+ });
2585
+
2586
+ const manifest: SessionReplayManifest =
2587
+ await SessionReplayReadService.getManifest({
2588
+ header: provisional,
2589
+ projectId: projectId,
2590
+ rumApplicationId: rumApplicationId,
2591
+ sessionId: "s-1",
2592
+ nowUnixMs: GRACE_PASSED,
2593
+ });
2594
+
2595
+ expect(manifest.tabs).toHaveLength(0);
2596
+ expect(manifest.header).toEqual({
2597
+ ...provisional,
2598
+ hasRecordingEnded: false,
2599
+ });
2600
+ });
2601
+
2602
+ /*
2603
+ * The list badge and the player's Live pill are two reads of one
2604
+ * helper. Fed the same chunk facts at the same server "now", they
2605
+ * must give the same answer, at every edge of the rule.
2606
+ */
2607
+ describe("the list and the manifest agree", () => {
2608
+ const scenarios: Array<[string, Array<JSONObject>, number, boolean]> = [
2609
+ [
2610
+ "a sealed tab inside the grace",
2611
+ [endedTabRow("tab-1")],
2612
+ GRACE_PASSED - 1,
2613
+ false,
2614
+ ],
2615
+ [
2616
+ "a sealed tab at the grace",
2617
+ [endedTabRow("tab-1")],
2618
+ GRACE_PASSED,
2619
+ true,
2620
+ ],
2621
+ [
2622
+ "a capped non-final tab inside the grace",
2623
+ [
2624
+ liveTabRow("tab-1", {
2625
+ tabMaxChunkIndex: MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
2626
+ }),
2627
+ ],
2628
+ GRACE_PASSED - 1,
2629
+ false,
2630
+ ],
2631
+ [
2632
+ "a capped non-final tab at the grace",
2633
+ [
2634
+ liveTabRow("tab-1", {
2635
+ tabMaxChunkIndex: MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
2636
+ }),
2637
+ ],
2638
+ GRACE_PASSED,
2639
+ true,
2640
+ ],
2641
+ [
2642
+ "a non-final tab one index short of the cap",
2643
+ [
2644
+ liveTabRow("tab-1", {
2645
+ tabMaxChunkIndex: MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 2,
2646
+ }),
2647
+ ],
2648
+ GRACE_PASSED,
2649
+ false,
2650
+ ],
2651
+ [
2652
+ "an old sealed tab next to a freshly sealed one",
2653
+ [
2654
+ endedTabRow("tab-1", {
2655
+ tabLastChunkStoredAtUnixMs: STORED_AT - 10 * 60 * 1000,
2656
+ }),
2657
+ endedTabRow("tab-2"),
2658
+ ],
2659
+ GRACE_PASSED - 1,
2660
+ false,
2661
+ ],
2662
+ [
2663
+ "a sealed tab next to a live one",
2664
+ [endedTabRow("tab-1"), liveTabRow("tab-2")],
2665
+ GRACE_PASSED,
2666
+ false,
2667
+ ],
2668
+ ];
2669
+
2670
+ test.each(scenarios)(
2671
+ "%s",
2672
+ async (
2673
+ _label: string,
2674
+ facts: Array<JSONObject>,
2675
+ nowUnixMs: number,
2676
+ expected: boolean,
2677
+ ) => {
2678
+ /*
2679
+ * Answer each chunk-table statement by what it is, so the
2680
+ * list's single follow-up and the manifest's pair can share
2681
+ * one mock regardless of order.
2682
+ */
2683
+ chunkQuerySpy.mockImplementation(
2684
+ async (statement: Statement): Promise<unknown> => {
2685
+ return fakeResultSet(
2686
+ statement.query.includes("tabHasFinalChunk")
2687
+ ? facts
2688
+ : chunkRows,
2689
+ );
2690
+ },
2691
+ );
2692
+ headerQuerySpy.mockResolvedValue(
2693
+ fakeResultSet([
2694
+ {
2695
+ sessionId: "s-1",
2696
+ applicationId: rumApplicationId.toString(),
2697
+ aggStartTime: FINAL_END - 60000,
2698
+ aggEndTime: FINAL_END,
2699
+ aggIsFinalized: 0,
2700
+ aggSealedReason: "",
2701
+ },
2702
+ ]) as never,
2703
+ );
2704
+
2705
+ const list: SessionReplayListResult =
2706
+ await SessionReplayReadService.listSessions(
2707
+ listRequest({ nowUnixMs: nowUnixMs }),
2708
+ );
2709
+ const manifest: SessionReplayManifest = await manifestAt(nowUnixMs);
2710
+
2711
+ expect(list.sessions).toHaveLength(1);
2712
+ expect(list.sessions[0]!.hasRecordingEnded).toBe(expected);
2713
+ expect(manifest.header.hasRecordingEnded).toBe(expected);
2714
+ },
2715
+ );
2716
+ });
2717
+ });
2718
+
2719
+ /*
2720
+ * The recorder mints a NEW tab id on every page load, so a session's
2721
+ * "tabs" are the pages the person walked through and the header's one
2722
+ * "every tab has ended" cannot say WHICH of them is still open - the
2723
+ * fact the player sorts open tabs before closed ones by. Each manifest
2724
+ * tab therefore carries its own flag, judged per tab by the same shared
2725
+ * rule, from the SAME single grouped read the header's flag comes from.
2726
+ */
2727
+ describe("hasRecordingEnded per manifest tab", () => {
2728
+ const FINAL_END: number = 1700000150000;
2729
+ /* Server write time of the newest chunk row (its version). */
2730
+ const STORED_AT: number = FINAL_END + 1500;
2731
+ const GRACE_PASSED: number =
2732
+ STORED_AT + SESSION_REPLAY_ENDED_FINALIZE_GRACE_MS;
2733
+
2734
+ /* A tab that sealed: final chunk at FINAL_END, nothing after it. */
2735
+ function endedTabRow(
2736
+ tabId: string,
2737
+ overrides: JSONObject = {},
2738
+ ): JSONObject {
2739
+ return {
2740
+ sessionId: "s-1",
2741
+ tabId: tabId,
2742
+ tabHasFinalChunk: 1,
2743
+ tabFinalChunkEndUnixMs: FINAL_END,
2744
+ tabLastChunkStartUnixMs: FINAL_END - 16000,
2745
+ tabMaxChunkIndex: 1,
2746
+ tabLastChunkStoredAtUnixMs: STORED_AT,
2747
+ ...overrides,
2748
+ };
2749
+ }
1400
2750
 
1401
- const manifest: SessionReplayManifest =
1402
- await SessionReplayReadService.getManifest({
1403
- header: header({ isFinalized: true, durationMs: 150000 }),
2751
+ /* A tab still recording: no final chunk at all. */
2752
+ function liveTabRow(
2753
+ tabId: string,
2754
+ overrides: JSONObject = {},
2755
+ ): JSONObject {
2756
+ return {
2757
+ sessionId: "s-1",
2758
+ tabId: tabId,
2759
+ tabHasFinalChunk: 0,
2760
+ tabFinalChunkEndUnixMs: 0,
2761
+ tabLastChunkStartUnixMs: FINAL_END,
2762
+ tabMaxChunkIndex: 1,
2763
+ tabLastChunkStoredAtUnixMs: STORED_AT,
2764
+ ...overrides,
2765
+ };
2766
+ }
2767
+
2768
+ function mockManifestThenFacts(facts: Array<JSONObject>): void {
2769
+ chunkQuerySpy
2770
+ .mockResolvedValueOnce(fakeResultSet(chunkRows) as never)
2771
+ .mockResolvedValueOnce(fakeResultSet(facts) as never);
2772
+ }
2773
+
2774
+ async function manifestAt(
2775
+ nowUnixMs: number,
2776
+ overrides: Partial<SessionReplaySessionHeader> = {},
2777
+ ): Promise<SessionReplayManifest> {
2778
+ return SessionReplayReadService.getManifest({
2779
+ header: header({ isFinalized: false, ...overrides }),
1404
2780
  projectId: projectId,
1405
2781
  rumApplicationId: rumApplicationId,
1406
2782
  sessionId: "s-1",
2783
+ nowUnixMs: nowUnixMs,
1407
2784
  });
2785
+ }
1408
2786
 
1409
- const query: string = statementOf(chunkQuerySpy).query;
1410
- expect(query).toContain("clickCount");
1411
- expect(query).toContain("url");
1412
- expect(query).not.toMatch(/\bpayload\b(?!Bytes)/);
1413
- expect(query).not.toContain("length(payload)");
1414
- expect(query).toContain("retentionDate >= now()");
2787
+ function endedByTabId(
2788
+ manifest: SessionReplayManifest,
2789
+ ): Record<string, boolean> {
2790
+ const ended: Record<string, boolean> = {};
1415
2791
 
1416
- expect(manifest.tabs).toHaveLength(2);
1417
- expect(manifest.tabs[0]!.firstChunkStartOffsetMs).toBe(0);
1418
- expect(manifest.tabs[1]!.firstChunkStartOffsetMs).toBe(134000);
1419
- expect(manifest.tabs[0]!.chunks[1]!.clickCount).toBe(1);
1420
- expect(manifest.tabs[0]!.chunks[1]!.url).toBe("https://a/checkout");
1421
- });
2792
+ for (const tab of manifest.tabs) {
2793
+ ended[tab.tabId] = tab.hasRecordingEnded;
2794
+ }
1422
2795
 
1423
- test("a finalized header is returned untouched", async () => {
1424
- chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2796
+ return ended;
2797
+ }
1425
2798
 
1426
- const finalized: SessionReplaySessionHeader = header({
1427
- isFinalized: true,
1428
- durationMs: 90000,
1429
- chunkCount: 9,
1430
- eventCount: 9,
2799
+ test("a finalized session ends every tab without a second read", async () => {
2800
+ chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2801
+
2802
+ const manifest: SessionReplayManifest =
2803
+ await SessionReplayReadService.getManifest({
2804
+ header: header({ isFinalized: true, durationMs: 150000 }),
2805
+ projectId: projectId,
2806
+ rumApplicationId: rumApplicationId,
2807
+ sessionId: "s-1",
2808
+ nowUnixMs: GRACE_PASSED,
2809
+ });
2810
+
2811
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(1);
2812
+ expect(endedByTabId(manifest)).toEqual({
2813
+ "tab-1": true,
2814
+ "tab-2": true,
2815
+ });
1431
2816
  });
1432
2817
 
1433
- const manifest: SessionReplayManifest =
1434
- await SessionReplayReadService.getManifest({
1435
- header: finalized,
1436
- projectId: projectId,
1437
- rumApplicationId: rumApplicationId,
1438
- sessionId: "s-1",
2818
+ test("a sealed tab and a still-recording one are told apart while the session stays live", async () => {
2819
+ mockManifestThenFacts([endedTabRow("tab-1"), liveTabRow("tab-2")]);
2820
+
2821
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2822
+
2823
+ expect(endedByTabId(manifest)).toEqual({
2824
+ "tab-1": true,
2825
+ "tab-2": false,
1439
2826
  });
2827
+ /* One live tab keeps the session - and so the Live pill - going. */
2828
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2829
+ });
1440
2830
 
1441
- expect(manifest.header).toBe(finalized);
1442
- });
2831
+ /*
2832
+ * The grace is about a NEW tab id that may still register, which says
2833
+ * nothing about whether THIS tab sealed. A closed page is closed the
2834
+ * moment its final chunk lands, so the tab flag has no grace.
2835
+ */
2836
+ test("a sealed tab is ended inside the session's grace, when the header still says live", async () => {
2837
+ mockManifestThenFacts([endedTabRow("tab-1"), endedTabRow("tab-2")]);
1443
2838
 
1444
- test("a provisional header reports what its chunk rows prove instead of zeros", async () => {
1445
- chunkQuerySpy.mockResolvedValue(fakeResultSet(chunkRows) as never);
2839
+ const manifest: SessionReplayManifest = await manifestAt(
2840
+ GRACE_PASSED - 1,
2841
+ );
1446
2842
 
1447
- const manifest: SessionReplayManifest =
1448
- await SessionReplayReadService.getManifest({
1449
- header: header({ isFinalized: false }),
1450
- projectId: projectId,
1451
- rumApplicationId: rumApplicationId,
1452
- sessionId: "s-1",
2843
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2844
+ expect(endedByTabId(manifest)).toEqual({
2845
+ "tab-1": true,
2846
+ "tab-2": true,
1453
2847
  });
2848
+ });
1454
2849
 
1455
- expect(manifest.header.isFinalized).toBe(false);
1456
- expect(manifest.header.durationMs).toBe(150000);
1457
- expect(manifest.header.chunkCount).toBe(3);
1458
- expect(manifest.header.eventCount).toBe(170);
1459
- expect(manifest.header.maxChunkIndex).toBe(1);
1460
- expect(manifest.header.endTimeUnixMs).toBe(1700000150000);
1461
- expect(manifest.header.endTime.getTime()).toBe(1700000150000);
2850
+ test("a session that has ended as a whole ends every tab, including one the facts read knows nothing about", async () => {
2851
+ /* Only tab-1 has facts; tab-2's rows are in the manifest read. */
2852
+ mockManifestThenFacts([endedTabRow("tab-1")]);
2853
+
2854
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2855
+
2856
+ expect(manifest.header.hasRecordingEnded).toBe(true);
2857
+ expect(endedByTabId(manifest)).toEqual({
2858
+ "tab-1": true,
2859
+ "tab-2": true,
2860
+ });
2861
+ });
2862
+
2863
+ test("a tab with no facts of its own is not ended while the session is still recording", async () => {
2864
+ mockManifestThenFacts([liveTabRow("tab-2")]);
2865
+
2866
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2867
+
2868
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2869
+ expect(endedByTabId(manifest)).toEqual({
2870
+ "tab-1": false,
2871
+ "tab-2": false,
2872
+ });
2873
+ });
2874
+
2875
+ /*
2876
+ * A tab that reached the per-session chunk cap never gets a final
2877
+ * chunk - the ingest gate refuses every index past the last one - and
2878
+ * has ended all the same.
2879
+ */
2880
+ test("a capped tab with no final chunk is ended on its own", async () => {
2881
+ mockManifestThenFacts([
2882
+ liveTabRow("tab-1", {
2883
+ tabMaxChunkIndex: MAX_SESSION_REPLAY_CHUNKS_PER_SESSION - 1,
2884
+ }),
2885
+ liveTabRow("tab-2"),
2886
+ ]);
2887
+
2888
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2889
+
2890
+ expect(endedByTabId(manifest)).toEqual({
2891
+ "tab-1": true,
2892
+ "tab-2": false,
2893
+ });
2894
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2895
+ });
2896
+
2897
+ test("an older recorder's trailing chunk inside the tolerance still ends the tab; one past it leaves it open", async () => {
2898
+ mockManifestThenFacts([
2899
+ endedTabRow("tab-1", {
2900
+ tabLastChunkStartUnixMs:
2901
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS,
2902
+ }),
2903
+ endedTabRow("tab-2", {
2904
+ tabLastChunkStartUnixMs:
2905
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS + 1,
2906
+ }),
2907
+ ]);
2908
+
2909
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2910
+
2911
+ expect(endedByTabId(manifest)).toEqual({
2912
+ "tab-1": true,
2913
+ "tab-2": false,
2914
+ });
2915
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2916
+ });
2917
+
2918
+ test("a failed facts read leaves every tab false and still returns the manifest", async () => {
2919
+ const warnSpy: jest.SpyInstance = jest
2920
+ .spyOn(logger, "warn")
2921
+ .mockImplementation((): void => {
2922
+ return;
2923
+ });
2924
+
2925
+ chunkQuerySpy
2926
+ .mockResolvedValueOnce(fakeResultSet(chunkRows) as never)
2927
+ .mockRejectedValueOnce(new Error("clickhouse down") as never);
2928
+
2929
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2930
+
2931
+ expect(manifest.tabs).toHaveLength(2);
2932
+ expect(endedByTabId(manifest)).toEqual({
2933
+ "tab-1": false,
2934
+ "tab-2": false,
2935
+ });
2936
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2937
+ expect(warnSpy).toHaveBeenCalled();
2938
+ });
2939
+
2940
+ test("ClickHouse's quoted facts are judged per tab, and an unmeasured clock is never ended", async () => {
2941
+ mockManifestThenFacts([
2942
+ {
2943
+ sessionId: "s-1",
2944
+ tabId: "tab-1",
2945
+ tabHasFinalChunk: "1",
2946
+ tabFinalChunkEndUnixMs: String(FINAL_END),
2947
+ tabLastChunkStartUnixMs: String(FINAL_END - 16000),
2948
+ tabMaxChunkIndex: "1",
2949
+ tabLastChunkStoredAtUnixMs: String(STORED_AT),
2950
+ },
2951
+ endedTabRow("tab-2", { tabFinalChunkEndUnixMs: "not-a-number" }),
2952
+ ]);
2953
+
2954
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2955
+
2956
+ expect(endedByTabId(manifest)).toEqual({
2957
+ "tab-1": true,
2958
+ "tab-2": false,
2959
+ });
2960
+ });
2961
+
2962
+ /*
2963
+ * GROUP BY sessionId, tabId makes the pair unique, so this only
2964
+ * guards a result that repeats one: the rows fold with the same
2965
+ * maxima the group would have applied, never on less evidence.
2966
+ */
2967
+ test("repeated rows for one tab fold like a single group", async () => {
2968
+ mockManifestThenFacts([
2969
+ liveTabRow("tab-1", { tabLastChunkStartUnixMs: FINAL_END - 16000 }),
2970
+ endedTabRow("tab-1"),
2971
+ endedTabRow("tab-2"),
2972
+ liveTabRow("tab-2", {
2973
+ tabLastChunkStartUnixMs:
2974
+ FINAL_END + SESSION_REPLAY_ENDED_TRAILING_CHUNK_TOLERANCE_MS + 1,
2975
+ }),
2976
+ ]);
2977
+
2978
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
2979
+
2980
+ expect(endedByTabId(manifest)).toEqual({
2981
+ "tab-1": true,
2982
+ "tab-2": false,
2983
+ });
2984
+ expect(manifest.header.hasRecordingEnded).toBe(false);
2985
+ });
2986
+
2987
+ test("the tab flags come from the one grouped read the header's flag comes from, and the manifest statement is unchanged", async () => {
2988
+ mockManifestThenFacts([endedTabRow("tab-1"), liveTabRow("tab-2")]);
2989
+
2990
+ await manifestAt(GRACE_PASSED);
2991
+
2992
+ expect(chunkQuerySpy).toHaveBeenCalledTimes(2);
2993
+
2994
+ const manifestQuery: string = statementOf(chunkQuerySpy, 0).query;
2995
+ expect(manifestQuery).toContain("LIMIT 1 BY tabId, chunkIndex");
2996
+ expect(manifestQuery).not.toContain("tabHasFinalChunk");
2997
+ expect(manifestQuery).not.toContain("GROUP BY sessionId, tabId");
2998
+
2999
+ const facts: Statement = statementOf(chunkQuerySpy, 1);
3000
+ expect(facts.query).toContain("GROUP BY sessionId, tabId");
3001
+ expect(facts.query).toContain(
3002
+ "max(toUInt8(isFinal)) AS tabHasFinalChunk",
3003
+ );
3004
+ expect(facts.query).not.toMatch(/\bpayload\b(?!Bytes)/);
3005
+ expect(boundValues(facts)).toContainEqual(["s-1"]);
3006
+ expect(boundValues(facts)).toContain(rumApplicationId.toString());
3007
+ });
3008
+
3009
+ test("the rest of each tab is untouched by the new flag", async () => {
3010
+ mockManifestThenFacts([endedTabRow("tab-1"), liveTabRow("tab-2")]);
3011
+
3012
+ const manifest: SessionReplayManifest = await manifestAt(GRACE_PASSED);
3013
+
3014
+ expect(manifest.tabs[0]!.tabId).toBe("tab-1");
3015
+ expect(manifest.tabs[0]!.chunkIndexes).toEqual([0, 1]);
3016
+ expect(manifest.tabs[0]!.fullSnapshotChunkIndexes).toEqual([0]);
3017
+ expect(manifest.tabs[0]!.firstChunkStartOffsetMs).toBe(0);
3018
+ expect(manifest.tabs[1]!.firstChunkStartOffsetMs).toBe(134000);
3019
+ expect(manifest.tabs[1]!.totalPayloadBytes).toBe(256);
3020
+ });
1462
3021
  });
1463
3022
  });
1464
3023
 
@@ -1660,6 +3219,234 @@ describe("SessionReplayReadService statements", () => {
1660
3219
  expect(boundValues(headers)).toContain("s-9");
1661
3220
  });
1662
3221
 
3222
+ test("binds both live-instance and finalized-header RUM matches to the exception application", async () => {
3223
+ const primaryEntityId: ObjectID = ObjectID.generate();
3224
+
3225
+ exceptionQuerySpy.mockResolvedValue(
3226
+ fakeResultSet([{ sessionId: "scoped-live-session" }]) as never,
3227
+ );
3228
+
3229
+ await SessionReplayReadService.getSessionsForException({
3230
+ projectId: projectId,
3231
+ exceptionFingerprint: "shared-fingerprint",
3232
+ primaryEntityId: primaryEntityId,
3233
+ primaryEntityType: ServiceType.RealUserMonitor,
3234
+ accessibleRumApplicationIds: null,
3235
+ limit: 5,
3236
+ });
3237
+
3238
+ const instances: Statement = statementOf(exceptionQuerySpy);
3239
+ expect(instances.query).toContain("AND primaryEntityId = ");
3240
+ expect(instances.query).toContain("AND primaryEntityType = ");
3241
+ expect(boundValues(instances)).toContain(primaryEntityId.toString());
3242
+ expect(boundValues(instances)).toContain(ServiceType.RealUserMonitor);
3243
+
3244
+ const headers: Statement = statementOf(headerQuerySpy);
3245
+ const where: string = whereSection(headers.query);
3246
+ expect(where).toMatch(/AND rumApplicationId = \{p\d+:String\}/);
3247
+ expect(where).toContain("hasAny(exceptionFingerprints");
3248
+ expect(where).toContain("OR sessionId IN (");
3249
+ expect(headers.query).toContain(
3250
+ "HAVING (hasAny(aggExceptionFingerprints",
3251
+ );
3252
+ expect(boundValues(headers)).toContain(primaryEntityId.toString());
3253
+ expect(boundValues(headers)).toContainEqual(["scoped-live-session"]);
3254
+ });
3255
+
3256
+ test("a scoped backend exception admits only instance-proven sessions", async () => {
3257
+ const primaryEntityId: ObjectID = ObjectID.generate();
3258
+
3259
+ exceptionQuerySpy.mockResolvedValue(
3260
+ fakeResultSet([{ sessionId: "backend-session" }]) as never,
3261
+ );
3262
+ headerQuerySpy.mockResolvedValue(
3263
+ fakeResultSet([
3264
+ {
3265
+ sessionId: "backend-session",
3266
+ applicationId: rumApplicationId.toString(),
3267
+ aggStartTime: "2026-08-14 10:00:00.000",
3268
+ aggEndTime: "2026-08-14 10:10:00.000",
3269
+ matchedApplicationCount: 1,
3270
+ },
3271
+ ]) as never,
3272
+ );
3273
+
3274
+ const sessions: Array<SessionReplayExceptionSession> =
3275
+ await SessionReplayReadService.getSessionsForException({
3276
+ projectId: projectId,
3277
+ exceptionFingerprint: "shared-fingerprint",
3278
+ primaryEntityId: primaryEntityId,
3279
+ primaryEntityType: ServiceType.OpenTelemetry,
3280
+ accessibleRumApplicationIds: null,
3281
+ limit: 5,
3282
+ });
3283
+
3284
+ expect(sessions).toHaveLength(1);
3285
+ expect(sessions[0]?.sessionId).toBe("backend-session");
3286
+ expect(sessions[0]?.rumApplicationId).toBe(rumApplicationId.toString());
3287
+
3288
+ const instances: Statement = statementOf(exceptionQuerySpy);
3289
+ expect(instances.query).toContain("AND primaryEntityId = ");
3290
+ expect(instances.query).toContain(
3291
+ "ifNull(primaryEntityType, '') = '' OR primaryEntityType = ",
3292
+ );
3293
+ expect(boundValues(instances)).toContain(ServiceType.OpenTelemetry);
3294
+
3295
+ const headers: Statement = statementOf(headerQuerySpy);
3296
+ expect(whereSection(headers.query)).toContain("sessionId IN (");
3297
+ expect(headers.query).not.toContain("hasAny(exceptionFingerprints");
3298
+ expect(headers.query).not.toContain("hasAny(aggExceptionFingerprints");
3299
+ expect(boundValues(headers)).toContainEqual(["backend-session"]);
3300
+ });
3301
+
3302
+ test("an id-only legacy scope uses the same conservative instance and ambiguity guards", async () => {
3303
+ const primaryEntityId: ObjectID = ObjectID.generate();
3304
+
3305
+ exceptionQuerySpy.mockResolvedValue(
3306
+ fakeResultSet([{ sessionId: "legacy-session" }]) as never,
3307
+ );
3308
+ headerQuerySpy.mockResolvedValue(
3309
+ fakeResultSet([
3310
+ {
3311
+ sessionId: "legacy-session",
3312
+ applicationId: rumApplicationId.toString(),
3313
+ aggStartTime: "2026-08-14 10:00:00.000",
3314
+ aggEndTime: "2026-08-14 10:10:00.000",
3315
+ matchedApplicationCount: 1,
3316
+ },
3317
+ ]) as never,
3318
+ );
3319
+
3320
+ const sessions: Array<SessionReplayExceptionSession> =
3321
+ await SessionReplayReadService.getSessionsForException({
3322
+ projectId: projectId,
3323
+ exceptionFingerprint: "shared-fingerprint",
3324
+ primaryEntityId: primaryEntityId,
3325
+ accessibleRumApplicationIds: null,
3326
+ limit: 5,
3327
+ });
3328
+
3329
+ expect(sessions).toHaveLength(1);
3330
+
3331
+ const instances: Statement = statementOf(exceptionQuerySpy);
3332
+ expect(instances.query).toContain("AND primaryEntityId = ");
3333
+ expect(instances.query).not.toContain("AND primaryEntityType = ");
3334
+
3335
+ const headers: Statement = statementOf(headerQuerySpy);
3336
+ expect(headers.query).not.toContain("hasAny(exceptionFingerprints");
3337
+ expect(headers.query).toContain(
3338
+ "count() OVER (PARTITION BY sessionId) AS matchedApplicationCount",
3339
+ );
3340
+ expect(headers.query).toContain("QUALIFY matchedApplicationCount = 1");
3341
+ });
3342
+
3343
+ test("rejects a scoped backend session id shared by two applications before authorization and limit", async () => {
3344
+ const primaryEntityId: ObjectID = ObjectID.generate();
3345
+ const accessibleApplicationId: ObjectID = ObjectID.generate();
3346
+ const startTime: Date = new Date("2026-08-14T10:00:00.000Z");
3347
+ const endTime: Date = new Date("2026-08-14T11:00:00.000Z");
3348
+
3349
+ exceptionQuerySpy.mockResolvedValue(
3350
+ fakeResultSet([{ sessionId: "colliding-session" }]) as never,
3351
+ );
3352
+ /* The selected pre-limit window count also makes the mapper fail closed. */
3353
+ headerQuerySpy.mockResolvedValue(
3354
+ fakeResultSet([
3355
+ {
3356
+ sessionId: "colliding-session",
3357
+ applicationId: accessibleApplicationId.toString(),
3358
+ aggStartTime: startTime.getTime(),
3359
+ matchedApplicationCount: 2,
3360
+ },
3361
+ ]) as never,
3362
+ );
3363
+
3364
+ const sessions: Array<SessionReplayExceptionSession> =
3365
+ await SessionReplayReadService.getSessionsForException({
3366
+ projectId: projectId,
3367
+ exceptionFingerprint: "shared-fingerprint",
3368
+ primaryEntityId: primaryEntityId,
3369
+ primaryEntityType: ServiceType.OpenTelemetry,
3370
+ accessibleRumApplicationIds: [accessibleApplicationId],
3371
+ startTime: startTime,
3372
+ endTime: endTime,
3373
+ limit: 1,
3374
+ });
3375
+
3376
+ expect(sessions).toEqual([]);
3377
+
3378
+ const headers: Statement = statementOf(headerQuerySpy);
3379
+ const where: string = whereSection(headers.query);
3380
+ const qualifyIndex: number = headers.query.indexOf(
3381
+ "QUALIFY matchedApplicationCount = 1",
3382
+ );
3383
+ const authorizationIndex: number = headers.query.indexOf(
3384
+ "rumApplicationId IN (",
3385
+ );
3386
+ const orderIndex: number = headers.query.indexOf("ORDER BY");
3387
+ const limitIndex: number = headers.query.indexOf("LIMIT");
3388
+
3389
+ expect(headers.query).toContain(
3390
+ "count() OVER (PARTITION BY sessionId) AS matchedApplicationCount",
3391
+ );
3392
+ expect(where).not.toContain("rumApplicationId IN (");
3393
+ expect(where).not.toContain("startTime >= ");
3394
+ expect(headers.query).toMatch(/aggStartTime >= \{p\d+:Int64\}/);
3395
+ expect(headers.query).toMatch(/aggStartTime <= \{p\d+:Int64\}/);
3396
+ expect(qualifyIndex).toBeGreaterThan(headers.query.indexOf("GROUP BY"));
3397
+ expect(authorizationIndex).toBeGreaterThan(qualifyIndex);
3398
+ expect(orderIndex).toBeGreaterThan(authorizationIndex);
3399
+ expect(limitIndex).toBeGreaterThan(orderIndex);
3400
+ expect(boundValues(headers)).toContainEqual([
3401
+ accessibleApplicationId.toString(),
3402
+ ]);
3403
+ expect(boundValues(headers)).toContain(startTime.getTime());
3404
+ expect(boundValues(headers)).toContain(endTime.getTime());
3405
+ });
3406
+
3407
+ test("a scoped backend exception with no proven session fails closed", async () => {
3408
+ exceptionQuerySpy.mockResolvedValue(fakeResultSet([]) as never);
3409
+
3410
+ const sessions: Array<SessionReplayExceptionSession> =
3411
+ await SessionReplayReadService.getSessionsForException({
3412
+ projectId: projectId,
3413
+ exceptionFingerprint: "fp-1",
3414
+ primaryEntityId: ObjectID.generate(),
3415
+ primaryEntityType: ServiceType.OpenTelemetry,
3416
+ accessibleRumApplicationIds: null,
3417
+ limit: 5,
3418
+ });
3419
+
3420
+ expect(sessions).toEqual([]);
3421
+ expect(headerQuerySpy).not.toHaveBeenCalled();
3422
+ });
3423
+
3424
+ test("rejects a type without an id or an invalid entity type before querying", async () => {
3425
+ await expect(
3426
+ SessionReplayReadService.getSessionsForException({
3427
+ projectId: projectId,
3428
+ exceptionFingerprint: "fp-1",
3429
+ primaryEntityType: ServiceType.OpenTelemetry,
3430
+ accessibleRumApplicationIds: null,
3431
+ limit: 5,
3432
+ }),
3433
+ ).rejects.toBeInstanceOf(BadDataException);
3434
+
3435
+ await expect(
3436
+ SessionReplayReadService.getSessionsForException({
3437
+ projectId: projectId,
3438
+ exceptionFingerprint: "fp-1",
3439
+ primaryEntityId: ObjectID.generate(),
3440
+ primaryEntityType: "invalid" as ServiceType,
3441
+ accessibleRumApplicationIds: null,
3442
+ limit: 5,
3443
+ }),
3444
+ ).rejects.toBeInstanceOf(BadDataException);
3445
+
3446
+ expect(exceptionQuerySpy).not.toHaveBeenCalled();
3447
+ expect(headerQuerySpy).not.toHaveBeenCalled();
3448
+ });
3449
+
1663
3450
  test("a pinned session the instance table has never seen falls back to the fingerprint alone", async () => {
1664
3451
  /* The session exists, but it never threw this exception. */
1665
3452
  exceptionQuerySpy.mockResolvedValue(fakeResultSet([]) as never);