@oneuptime/common 13.0.3 → 13.0.5
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.
- package/Models/DatabaseModels/Index.ts +4 -0
- package/Models/DatabaseModels/RumApplication.ts +1 -1
- package/Models/DatabaseModels/SecurityEventConnection.ts +457 -0
- package/Models/DatabaseModels/SecurityEventConnectionRun.ts +263 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.ts +2 -2
- package/Server/API/AIInvestigationAPI.ts +484 -24
- package/Server/API/GoogleSecOpsConnectionAPI.ts +249 -8
- package/Server/API/SecurityEventConnectionAPI.ts +250 -0
- package/Server/API/TelemetryAPI.ts +402 -265
- package/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.ts +99 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Middleware/TelemetryIngest.ts +101 -6
- package/Server/Services/ExceptionAggregationService.ts +7 -16
- package/Server/Services/GoogleSecOpsConnectionService.ts +15 -0
- package/Server/Services/Index.ts +4 -0
- package/Server/Services/InventoryItemService.ts +28 -0
- package/Server/Services/LogAggregationService.ts +17 -23
- package/Server/Services/MetricAggregationService.ts +4 -14
- package/Server/Services/SecurityEventConnectionRunService.ts +10 -0
- package/Server/Services/SecurityEventConnectionService.ts +538 -0
- package/Server/Services/TraceAggregationService.ts +77 -28
- package/Server/Types/AnalyticsDatabase/ModelPermission.ts +9 -0
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +13 -1
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +15 -1
- package/Server/Utils/AI/SRE/InvestigationEvidence.ts +658 -0
- package/Server/Utils/AI/SRE/InvestigationReferences.ts +324 -0
- package/Server/Utils/AI/Toolbox/Index.ts +38 -0
- package/Server/Utils/AI/Toolbox/TimelineTools.ts +9 -2
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +80 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +5 -3
- package/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.ts +1108 -0
- package/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.ts +732 -0
- package/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.ts +495 -0
- package/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.ts +689 -0
- package/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.ts +767 -0
- package/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.ts +571 -0
- package/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.ts +827 -0
- package/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.ts +610 -0
- package/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.ts +549 -0
- package/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.ts +830 -0
- package/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.ts +684 -0
- package/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.ts +487 -0
- package/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.ts +778 -0
- package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.ts +1002 -0
- package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.ts +556 -0
- package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.ts +275 -0
- package/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.ts +53 -0
- package/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.ts +709 -0
- package/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.ts +596 -0
- package/Server/Utils/SecurityEvent/Connectors/Types.ts +191 -0
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.ts +353 -65
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsConnectionTester.ts +777 -0
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +747 -148
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.ts +48 -2
- package/Server/Utils/SecurityEvent/SecurityEventDedupe.ts +81 -0
- package/Server/Utils/SessionReplay/SessionReplayReadService.ts +741 -40
- package/Server/Utils/StartServer.ts +10 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +8 -0
- package/Server/Utils/Telemetry/KubernetesResourceAttributes.ts +108 -0
- package/Server/Utils/Telemetry/ResourceEntityFilter.ts +174 -93
- package/Server/Utils/Telemetry/ResourceFacetPlanner.ts +251 -0
- package/Server/Utils/Telemetry/ResourceFacetResolver.ts +248 -413
- package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +668 -0
- package/Server/Utils/Telemetry/TraceContextPropagation.ts +348 -0
- package/Server/Utils/Telemetry.ts +18 -0
- package/Tests/App/Dashboard/AIInvestigationHeaderStatus.test.tsx +413 -0
- package/Tests/App/Dashboard/AIRootCauseFeedItem.test.tsx +285 -0
- package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +242 -0
- package/Tests/App/Dashboard/AlertEpisodeViewFields.test.tsx +601 -15
- package/Tests/App/Dashboard/ChangeAlertStateAIHeader.test.tsx +835 -0
- package/Tests/App/Dashboard/CloudResourceTelemetryScope.test.ts +41 -0
- package/Tests/App/Dashboard/ConnectionTestModal.test.tsx +604 -0
- package/Tests/App/Dashboard/ConnectorTestReportView.test.tsx +738 -0
- package/Tests/App/Dashboard/DashboardLazyPages.test.tsx +153 -6
- package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +165 -0
- package/Tests/App/Dashboard/EpisodeChangeState.test.tsx +1069 -0
- package/Tests/App/Dashboard/EpisodeMembersCard.test.tsx +772 -0
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +2354 -0
- package/Tests/App/Dashboard/EventOverviewSkeleton.test.tsx +210 -0
- package/Tests/App/Dashboard/EventStatBar.test.tsx +392 -0
- package/Tests/App/Dashboard/EventStatusPanel.test.tsx +247 -0
- package/Tests/App/Dashboard/ExceptionAIAssistance.test.tsx +606 -0
- package/Tests/App/Dashboard/ExceptionBreadcrumbTimeline.test.tsx +273 -0
- package/Tests/App/Dashboard/ExceptionDetailSideMenu.test.tsx +176 -0
- package/Tests/App/Dashboard/ExceptionOverviewCards.test.tsx +366 -0
- package/Tests/App/Dashboard/ExceptionSignalPages.test.tsx +371 -0
- package/Tests/App/Dashboard/ExceptionStackFrameViewer.test.tsx +440 -0
- package/Tests/App/Dashboard/ExceptionSummary.test.tsx +381 -0
- package/Tests/App/Dashboard/ExceptionTriage.test.tsx +306 -0
- package/Tests/App/Dashboard/ExceptionsResourceFacets.test.tsx +604 -0
- package/Tests/App/Dashboard/ExceptionsViewerEntityChips.test.tsx +706 -0
- package/Tests/App/Dashboard/FeedOrdering.test.ts +32 -0
- package/Tests/App/Dashboard/GoogleSecOpsConnectionForm.test.tsx +838 -0
- package/Tests/App/Dashboard/GoogleSecOpsConnectionsErrors.test.tsx +18 -0
- package/Tests/App/Dashboard/GoogleSecOpsDiagnostics.test.tsx +297 -20
- package/Tests/App/Dashboard/IncidentEpisodeViewFields.test.tsx +618 -13
- package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +254 -207
- package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +303 -135
- package/Tests/App/Dashboard/InvestigationEvidenceList.test.tsx +1251 -0
- package/Tests/App/Dashboard/InvestigationFeedRefresh.test.tsx +303 -0
- package/Tests/App/Dashboard/InvestigationPanel.test.tsx +876 -8
- package/Tests/App/Dashboard/InvestigationPanelStatus.test.tsx +35 -0
- package/Tests/App/Dashboard/InvestigationReferenceLink.test.tsx +177 -0
- package/Tests/App/Dashboard/InvestigationReportView.test.tsx +1295 -0
- package/Tests/App/Dashboard/KubernetesImageReferenceView.test.tsx +114 -0
- package/Tests/App/Dashboard/KubernetesLogsTabChips.test.tsx +285 -0
- package/Tests/App/Dashboard/LogsEntityChipNames.test.tsx +316 -0
- package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +361 -0
- package/Tests/App/Dashboard/ProfileTableEntityNames.test.tsx +432 -0
- package/Tests/App/Dashboard/ProfileViewEntityName.test.tsx +250 -0
- package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +10 -0
- package/Tests/App/Dashboard/ResourceLogsTabsBareLayout.test.tsx +700 -0
- package/Tests/App/Dashboard/ResourcePageEntityNameProps.test.tsx +803 -0
- package/Tests/App/Dashboard/RumSessionReplaySideMenu.test.tsx +11 -1
- package/Tests/App/Dashboard/ScheduledMaintenanceChangeState.test.tsx +1026 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceFeedRefresh.test.tsx +436 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +1195 -0
- package/Tests/App/Dashboard/SecurityEventConnectionFormModal.test.tsx +1022 -0
- package/Tests/App/Dashboard/SecurityEventConnectionsTable.test.tsx +905 -0
- package/Tests/App/Dashboard/SecurityEventsSideMenu.test.tsx +247 -0
- package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +375 -274
- package/Tests/App/Dashboard/SessionReplayAuditTable.test.tsx +410 -0
- package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +774 -0
- package/Tests/App/Dashboard/TopErrorsPanelResourceNames.test.tsx +316 -0
- package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +30 -0
- package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +88 -24
- package/Tests/App/Dashboard/TraceExplorer.test.tsx +1590 -0
- package/Tests/App/Dashboard/TraceWaterfall.test.tsx +488 -0
- package/Tests/App/Dashboard/TracesAnalyticsSeriesLabels.test.tsx +367 -0
- package/Tests/App/Dashboard/TracesEntityNames.test.tsx +585 -0
- package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +613 -0
- package/Tests/App/Dashboard/UseServiceNames.test.tsx +359 -0
- package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +7 -0
- package/Tests/Models/InventoryItemNaming.test.ts +132 -16
- package/Tests/Models/SecurityDomainAccessControl.test.ts +61 -17
- package/Tests/Server/API/AIInvestigationAPI.test.ts +611 -2
- package/Tests/Server/API/AIInvestigationEvidenceAPI.test.ts +1098 -0
- package/Tests/Server/API/GoogleSecOpsConnectionAPI.test.ts +409 -0
- package/Tests/Server/API/SecurityEventConnectionAPI.test.ts +856 -0
- package/Tests/Server/API/SessionReplayAPI.test.ts +528 -1
- package/Tests/Server/API/TelemetryFacetsAPI.test.ts +810 -0
- package/Tests/Server/Infrastructure/E2EClickHouseFixtureAccess.test.ts +240 -0
- package/Tests/Server/Middleware/TelemetryIngestBrowserKey.test.ts +229 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +66 -0
- package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +28 -1
- package/Tests/Server/Services/SecurityEventConnectionService.test.ts +1233 -0
- package/Tests/Server/Services/TelemetryIngestionKeyValidation.test.ts +53 -0
- package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +218 -0
- package/Tests/Server/Services/TelemetryResourceFacetFilters.test.ts +155 -1
- package/Tests/Server/Services/TraceAggregationExceptionScope.test.ts +142 -0
- package/Tests/Server/Services/TraceAnalyticsResourceDisplayNames.test.ts +85 -24
- package/Tests/Server/Types/Database/Permissions/SecurityRoleAccess.test.ts +33 -0
- package/Tests/Server/Utils/AI/InvestigationEvidence.test.ts +1395 -0
- package/Tests/Server/Utils/AI/InvestigationReferences.test.ts +616 -0
- package/Tests/Server/Utils/AI/TimelineTools.test.ts +119 -0
- package/Tests/Server/Utils/AI/Toolbox/AIToolbox.test.ts +151 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +65 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorExceptionScope.test.ts +224 -0
- package/Tests/Server/Utils/LoggerCore.test.ts +597 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPerSeriesFanout.test.ts +55 -2
- package/Tests/Server/Utils/Monitor/MonitorTemplateUtil.test.ts +1109 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.test.ts +1240 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.test.ts +1853 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.test.ts +1129 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.test.ts +1066 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.test.ts +1568 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.test.ts +930 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.test.ts +1409 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.test.ts +763 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.test.ts +1296 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.test.ts +1102 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.test.ts +1174 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.test.ts +1032 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.test.ts +1558 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.test.ts +3041 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.test.ts +1168 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.test.ts +906 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.test.ts +1068 -0
- package/Tests/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.test.ts +1004 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsConnectionTester.test.ts +784 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.test.ts +113 -1
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsClient.test.ts +5 -1
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsDiagnostics.test.ts +93 -13
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsHttpIntegration.test.ts +23 -1
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +25 -3
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +22 -8
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerHardening.test.ts +82 -16
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsSearchDetections.test.ts +730 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsThreePassPoller.test.ts +1577 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayOriginAllowlist.test.ts +41 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayReadServiceQueries.test.ts +1453 -18
- package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +711 -0
- package/Tests/Server/Utils/Telemetry/KubernetesResourceAttributes.test.ts +162 -0
- package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +460 -13
- package/Tests/Server/Utils/Telemetry/ResourceFacetPlanner.test.ts +678 -0
- package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +868 -0
- package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +525 -0
- package/Tests/Server/Utils/Telemetry/TraceContextPropagation.test.ts +420 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilCorePaths.test.ts +1014 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveRotation.test.ts +9 -6
- package/Tests/Types/Rules/RuleCriteriaFieldRegistry.test.ts +276 -0
- package/Tests/Types/Rum/SessionReplayApiContracts.test.ts +73 -0
- package/Tests/Types/Rum/SessionReplayTransportContracts.test.ts +95 -0
- package/Tests/Types/SecurityEvent/Connectors/ConnectorDiagnostics.test.ts +82 -0
- package/Tests/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.test.ts +314 -0
- package/Tests/Types/Telemetry/ExceptionSpanScope.test.ts +89 -0
- package/Tests/Types/Telemetry/LlmConventions.test.ts +495 -0
- package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +96 -0
- package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +304 -0
- package/Tests/UI/Components/ActiveFilterChipsLockedFilters.test.tsx +357 -0
- package/Tests/UI/Components/Card.test.tsx +312 -1
- package/Tests/UI/Components/CardModelDetailHeaderLayout.test.tsx +253 -0
- package/Tests/UI/Components/CardModelDetailRefresher.test.tsx +342 -0
- package/Tests/UI/Components/Checkbox.test.tsx +79 -0
- package/Tests/UI/Components/CopyTextButton.test.tsx +142 -0
- package/Tests/UI/Components/DetailCompactStyle.test.tsx +621 -0
- package/Tests/UI/Components/ErrorBoundary.test.tsx +60 -0
- package/Tests/UI/Components/FacetSections.test.tsx +581 -0
- package/Tests/UI/Components/FacetSidebarControls.test.tsx +812 -0
- package/Tests/UI/Components/FacetVisibility.test.ts +429 -0
- package/Tests/UI/Components/LockedFilterActions.test.tsx +396 -0
- package/Tests/UI/Components/LockedFilterChip.test.tsx +651 -0
- package/Tests/UI/Components/LogsEntityNames.test.ts +1769 -0
- package/Tests/UI/Components/LogsEntityNamesComponents.test.tsx +696 -0
- package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +600 -0
- package/Tests/UI/Components/LogsViewerEntityNames.test.tsx +713 -0
- package/Tests/UI/Components/MarkdownInlineReferences.test.tsx +2079 -0
- package/Tests/UI/Components/MemberRoleAssignment.test.tsx +446 -0
- package/Tests/UI/Components/ModelDetailRefetch.test.tsx +397 -0
- package/Tests/UI/Components/ModelListRefetch.test.tsx +233 -0
- package/Tests/UI/Components/ModelPageModelChange.test.tsx +409 -0
- package/Tests/UI/Components/PaginationIntegration.test.tsx +25 -0
- package/Tests/UI/Components/ResourceFacetConfigs.test.ts +172 -0
- package/Tests/UI/Components/SavedViewsSidebarIntegration.test.tsx +32 -14
- package/Tests/UI/Components/TableSortAndMobileColumns.test.tsx +44 -1
- package/Tests/UI/Components/TelemetryActiveFilterChipsLockedFilters.test.tsx +304 -0
- package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +718 -0
- package/Tests/UI/Monitor/EvaluationLogList.test.tsx +303 -0
- package/Tests/UI/Monitor/MonitorSummarySnapshotRender.test.tsx +55 -1
- package/Tests/UI/Rum/FidelityNotices.test.ts +22 -0
- package/Tests/UI/Rum/RecordingHealthCard.test.tsx +120 -136
- package/Tests/UI/Rum/RecordingHealthDashboard.test.tsx +988 -0
- package/Tests/UI/Rum/ReplayCard.test.tsx +32 -0
- package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +709 -12
- package/Tests/UI/Rum/ReplayHeader.test.tsx +50 -1
- package/Tests/UI/Rum/ReplayPinControl.test.tsx +67 -10
- package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +41 -12
- package/Tests/UI/Rum/ReplayStage.test.tsx +663 -1
- package/Tests/UI/Rum/ReplayStageOverlays.test.tsx +173 -0
- package/Tests/UI/Rum/ReplayUi.test.tsx +189 -2
- package/Tests/UI/Rum/ReplayUserSessionsMenu.test.tsx +91 -0
- package/Tests/UI/Rum/SessionReplayEmptyState.test.tsx +1 -1
- package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +585 -0
- package/Tests/UI/Rum/SessionReplayTable.test.tsx +844 -51
- package/Tests/UI/Rum/SessionReplayUsersTable.test.tsx +29 -1
- package/Tests/UI/Telemetry/TelemetryDetailPanel.test.tsx +288 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +31 -1
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +6 -0
- package/Tests/UI/Utils/Clipboard.test.ts +154 -0
- package/Tests/UI/Utils/Navigation.test.ts +24 -0
- package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +2205 -0
- package/Tests/UI/Utils/Telemetry/UseTelemetryEntityNames.test.tsx +844 -0
- package/Tests/Utils/AI/InvestigationReport.test.ts +2430 -0
- package/Tests/Utils/APIOutgoingRequestTracer.test.ts +137 -0
- package/Tests/Utils/Rum/SessionReplayHealth.test.ts +884 -0
- package/Tests/Utils/Rum/SessionReplayHealthDiagnosis.test.ts +40 -0
- package/Tests/Utils/Rum/SessionReplayRecordingEnded.test.ts +619 -0
- package/Tests/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.test.ts +631 -0
- package/Tests/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.test.ts +479 -0
- package/Tests/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.test.ts +507 -0
- package/Tests/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.test.ts +686 -0
- package/Tests/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.test.ts +474 -0
- package/Tests/Utils/SecurityEvent/Connectors/OktaNormalizer.test.ts +736 -0
- package/Tests/Utils/SecurityEvent/Connectors/SplunkNormalizer.test.ts +407 -0
- package/Tests/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.test.ts +129 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +57 -1
- package/Tests/Utils/Telemetry/EntityRelationship.test.ts +36 -0
- package/Tests/Utils/Telemetry/LockedFilterSearch.test.ts +600 -0
- package/Tests/Utils/Telemetry/NetworkHost.test.ts +48 -0
- package/Tests/Utils/Telemetry/OriginAllowList.test.ts +154 -0
- package/Tests/Utils/Traces/CriticalPath.test.ts +25 -0
- package/Types/AI/AIChatTypes.ts +8 -0
- package/Types/AI/InvestigationEvidence.ts +96 -0
- package/Types/Monitor/MonitorEvaluationSummary.ts +5 -0
- package/Types/OnCallDutyPolicy/Layer.ts +12 -0
- package/Types/Permission.ts +2 -2
- package/Types/Rules/RuleCriteriaFieldRegistry.ts +12 -0
- package/Types/Rum/SessionReplay.ts +109 -0
- package/Types/Rum/SessionReplayApi.ts +31 -0
- package/Types/SecurityEvent/Connectors/ConnectorDiagnostics.ts +111 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.ts +87 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.ts +492 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.ts +41 -0
- package/Types/SecurityEvent/GoogleSecOpsDiagnostics.ts +56 -1
- package/Types/SecurityEvent/GoogleSecOpsRegion.ts +34 -0
- package/Types/Telemetry/EntityType.ts +14 -0
- package/Types/Telemetry/ExceptionSpanScope.ts +83 -0
- package/Types/Telemetry/LockedFilterDetail.ts +46 -0
- package/Types/Telemetry/ResourceEntityFacet.ts +17 -10
- package/Types/Telemetry/ResourceFacetCatalog.ts +171 -0
- package/UI/Components/Card/Card.tsx +118 -83
- package/UI/Components/Checkbox/Checkbox.tsx +8 -5
- package/UI/Components/CopyTextButton/CopyTextButton.tsx +7 -1
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +4 -1
- package/UI/Components/Detail/Detail.tsx +137 -22
- package/UI/Components/ErrorBoundary.tsx +38 -0
- package/UI/Components/LogsViewer/LogsEntityNames.ts +912 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +156 -77
- package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +28 -11
- package/UI/Components/LogsViewer/components/FacetSection.tsx +66 -79
- package/UI/Components/LogsViewer/components/FacetValueRow.tsx +17 -2
- package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +45 -5
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +100 -19
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +156 -39
- package/UI/Components/LogsViewer/components/LogsTable.tsx +30 -8
- package/UI/Components/LogsViewer/types.ts +6 -0
- package/UI/Components/Markdown.tsx/InlineReferences.tsx +628 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +385 -312
- package/UI/Components/MemberRoleAssignment/MemberRoleAssignment.tsx +50 -22
- package/UI/Components/ModelDetail/CardModelDetail.tsx +15 -0
- package/UI/Components/ModelDetail/ModelDetail.tsx +64 -19
- package/UI/Components/ModelList/ModelList.tsx +33 -8
- package/UI/Components/Page/ModelPage.tsx +119 -54
- package/UI/Components/Table/Table.tsx +8 -0
- package/UI/Components/Table/TableRow.tsx +13 -5
- package/UI/Components/TelemetryViewer/FacetVisibility.ts +229 -0
- package/UI/Components/TelemetryViewer/ResourceFacetConfigs.ts +46 -0
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +11 -0
- package/UI/Components/TelemetryViewer/components/FacetSearchInput.tsx +79 -0
- package/UI/Components/TelemetryViewer/components/FacetSectionHeader.tsx +69 -0
- package/UI/Components/TelemetryViewer/components/FacetShowMoreButton.tsx +36 -0
- package/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.tsx +88 -0
- package/UI/Components/TelemetryViewer/components/LockedFilterActions.tsx +205 -0
- package/UI/Components/TelemetryViewer/components/LockedFilterChip.tsx +496 -0
- package/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.tsx +30 -10
- package/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.tsx +203 -10
- package/UI/Components/TelemetryViewer/components/TelemetryFacetSection.tsx +60 -73
- package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +94 -7
- package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +17 -2
- package/UI/Components/TelemetryViewer/types.ts +19 -0
- package/UI/Components/TelemetryViewer/useFacetSearchExemptions.ts +158 -0
- package/UI/Components/TelemetryViewer/useFacetSectionSearch.ts +102 -0
- package/UI/Utils/Clipboard.ts +68 -2
- package/UI/Utils/Navigation.ts +17 -2
- package/UI/Utils/Telemetry/TelemetryEntityNames.ts +620 -0
- package/UI/Utils/Telemetry/UseTelemetryEntityNames.ts +151 -0
- package/Utils/AI/InvestigationReport.ts +1789 -0
- package/Utils/API.ts +90 -1
- package/Utils/Rum/SessionReplayHealth.ts +11 -0
- package/Utils/Rum/SessionReplayRecordingEnded.ts +134 -0
- package/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.ts +427 -0
- package/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.ts +197 -0
- package/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.ts +464 -0
- package/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.ts +567 -0
- package/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.ts +299 -0
- package/Utils/SecurityEvent/Connectors/OktaNormalizer.ts +467 -0
- package/Utils/SecurityEvent/Connectors/SplunkNormalizer.ts +439 -0
- package/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.ts +124 -12
- package/Utils/Telemetry/CrossSignalScope.ts +22 -8
- package/Utils/Telemetry/EntityRelationship.ts +8 -0
- package/Utils/Telemetry/LockedFilterSearch.ts +412 -0
- package/Utils/Telemetry/NetworkHost.ts +43 -0
- package/Utils/Telemetry/OriginAllowList.ts +139 -4
- package/Utils/Traces/CriticalPath.ts +10 -4
- package/build/dist/Models/DatabaseModels/Index.js +4 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js +1 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
- package/build/dist/Models/DatabaseModels/SecurityEventConnection.js +490 -0
- package/build/dist/Models/DatabaseModels/SecurityEventConnection.js.map +1 -0
- package/build/dist/Models/DatabaseModels/SecurityEventConnectionRun.js +287 -0
- package/build/dist/Models/DatabaseModels/SecurityEventConnectionRun.js.map +1 -0
- package/build/dist/Models/DatabaseModels/TelemetryIngestionKey.js +2 -2
- package/build/dist/Models/DatabaseModels/TelemetryIngestionKey.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +336 -27
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/GoogleSecOpsConnectionAPI.js +182 -7
- package/build/dist/Server/API/GoogleSecOpsConnectionAPI.js.map +1 -1
- package/build/dist/Server/API/SecurityEventConnectionAPI.js +171 -0
- package/build/dist/Server/API/SecurityEventConnectionAPI.js.map +1 -0
- package/build/dist/Server/API/TelemetryAPI.js +248 -170
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1792700000000-AddSecurityEventConnections.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +57 -4
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/ExceptionAggregationService.js +7 -16
- package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
- package/build/dist/Server/Services/GoogleSecOpsConnectionService.js +8 -0
- package/build/dist/Server/Services/GoogleSecOpsConnectionService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +22 -0
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +8 -17
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +4 -14
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/SecurityEventConnectionRunService.js +9 -0
- package/build/dist/Server/Services/SecurityEventConnectionRunService.js.map +1 -0
- package/build/dist/Server/Services/SecurityEventConnectionService.js +356 -0
- package/build/dist/Server/Services/SecurityEventConnectionService.js.map +1 -0
- package/build/dist/Server/Services/TraceAggregationService.js +51 -25
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +9 -0
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +3 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +14 -7
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationEvidence.js +468 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationEvidence.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationReferences.js +230 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationReferences.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +32 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +6 -2
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +59 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +5 -3
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.js +752 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.js +493 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/AwsSecurityHub/AwsSecurityHubConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.js +352 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ConnectorPlatformHealth.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.js +405 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.js +466 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/CrowdStrikeFalcon/CrowdStrikeFalconConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.js +344 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.js +511 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/ElasticSecurity/ElasticSecurityConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.js +406 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.js +336 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdr/MicrosoftDefenderXdrConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.js +474 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.js +417 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/MicrosoftSentinel/MicrosoftSentinelConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.js +314 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.js +494 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Okta/OktaConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.js +719 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionPoller.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.js +404 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionRunExecutor.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.js +209 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectionTester.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.js +40 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/SecurityEventConnectorRegistry.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.js +494 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.js +379 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Splunk/SplunkConnector.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Types.js +27 -0
- package/build/dist/Server/Utils/SecurityEvent/Connectors/Types.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js +234 -61
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsConnectionTester.js +537 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsConnectionTester.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +572 -115
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.js +35 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsRunExecutor.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventDedupe.js +52 -0
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventDedupe.js.map +1 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayReadService.js +521 -32
- package/build/dist/Server/Utils/SessionReplay/SessionReplayReadService.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +10 -0
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +8 -0
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/KubernetesResourceAttributes.js +80 -0
- package/build/dist/Server/Utils/Telemetry/KubernetesResourceAttributes.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +122 -67
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ResourceFacetPlanner.js +146 -0
- package/build/dist/Server/Utils/Telemetry/ResourceFacetPlanner.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +174 -248
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +492 -0
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/TraceContextPropagation.js +259 -0
- package/build/dist/Server/Utils/Telemetry/TraceContextPropagation.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry.js +11 -5
- package/build/dist/Server/Utils/Telemetry.js.map +1 -1
- package/build/dist/Types/AI/InvestigationEvidence.js +2 -0
- package/build/dist/Types/AI/InvestigationEvidence.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +11 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/Permission.js +2 -2
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +9 -0
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
- package/build/dist/Types/Rum/SessionReplay.js +95 -0
- package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
- package/build/dist/Types/Rum/SessionReplayApi.js.map +1 -1
- package/build/dist/Types/SecurityEvent/Connectors/ConnectorDiagnostics.js +18 -0
- package/build/dist/Types/SecurityEvent/Connectors/ConnectorDiagnostics.js.map +1 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.js +2 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectionDiagnostics.js.map +1 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +374 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js.map +1 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js +35 -0
- package/build/dist/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js.map +1 -0
- package/build/dist/Types/SecurityEvent/GoogleSecOpsRegion.js +35 -0
- package/build/dist/Types/SecurityEvent/GoogleSecOpsRegion.js.map +1 -0
- package/build/dist/Types/Telemetry/EntityType.js +14 -0
- package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
- package/build/dist/Types/Telemetry/ExceptionSpanScope.js +59 -0
- package/build/dist/Types/Telemetry/ExceptionSpanScope.js.map +1 -0
- package/build/dist/Types/Telemetry/LockedFilterDetail.js +16 -0
- package/build/dist/Types/Telemetry/LockedFilterDetail.js.map +1 -0
- package/build/dist/Types/Telemetry/ResourceEntityFacet.js +16 -10
- package/build/dist/Types/Telemetry/ResourceEntityFacet.js.map +1 -1
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +119 -0
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -0
- package/build/dist/UI/Components/Card/Card.js +34 -17
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js +6 -4
- package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
- package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js +5 -1
- package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +63 -13
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +34 -0
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsEntityNames.js +535 -0
- package/build/dist/UI/Components/LogsViewer/LogsEntityNames.js.map +1 -0
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +117 -57
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +5 -7
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetSection.js +31 -44
- package/build/dist/UI/Components/LogsViewer/components/FacetSection.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +17 -3
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +19 -3
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +64 -18
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +100 -41
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +13 -5
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/InlineReferences.js +403 -0
- package/build/dist/UI/Components/Markdown.tsx/InlineReferences.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +197 -179
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js +30 -21
- package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +12 -0
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js +46 -12
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelList/ModelList.js +26 -7
- package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
- package/build/dist/UI/Components/Page/ModelPage.js +62 -34
- package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +3 -1
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +8 -1
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js +111 -0
- package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/ResourceFacetConfigs.js +22 -0
- package/build/dist/UI/Components/TelemetryViewer/ResourceFacetConfigs.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/FacetSearchInput.js +36 -0
- package/build/dist/UI/Components/TelemetryViewer/components/FacetSearchInput.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/FacetSectionHeader.js +21 -0
- package/build/dist/UI/Components/TelemetryViewer/components/FacetSectionHeader.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/FacetShowMoreButton.js +14 -0
- package/build/dist/UI/Components/TelemetryViewer/components/FacetShowMoreButton.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.js +27 -0
- package/build/dist/UI/Components/TelemetryViewer/components/HiddenFacetsFooter.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterActions.js +88 -0
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterActions.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js +228 -0
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.js +6 -6
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.js +111 -12
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryDetailPanel.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSection.js +27 -40
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSection.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +70 -10
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +17 -3
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/types.js +0 -4
- package/build/dist/UI/Components/TelemetryViewer/types.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/useFacetSearchExemptions.js +70 -0
- package/build/dist/UI/Components/TelemetryViewer/useFacetSearchExemptions.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/useFacetSectionSearch.js +52 -0
- package/build/dist/UI/Components/TelemetryViewer/useFacetSectionSearch.js.map +1 -0
- package/build/dist/UI/Utils/Clipboard.js +59 -2
- package/build/dist/UI/Utils/Clipboard.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +11 -2
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +471 -0
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -0
- package/build/dist/UI/Utils/Telemetry/UseTelemetryEntityNames.js +113 -0
- package/build/dist/UI/Utils/Telemetry/UseTelemetryEntityNames.js.map +1 -0
- package/build/dist/Utils/AI/InvestigationReport.js +1241 -0
- package/build/dist/Utils/AI/InvestigationReport.js.map +1 -0
- package/build/dist/Utils/API.js +25 -0
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Rum/SessionReplayHealth.js +10 -0
- package/build/dist/Utils/Rum/SessionReplayHealth.js.map +1 -1
- package/build/dist/Utils/Rum/SessionReplayRecordingEnded.js +54 -0
- package/build/dist/Utils/Rum/SessionReplayRecordingEnded.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.js +311 -0
- package/build/dist/Utils/SecurityEvent/Connectors/AwsSecurityHubNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.js +150 -0
- package/build/dist/Utils/SecurityEvent/Connectors/CrowdStrikeFalconNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.js +328 -0
- package/build/dist/Utils/SecurityEvent/Connectors/ElasticSecurityNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.js +405 -0
- package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftDefenderXdrNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.js +212 -0
- package/build/dist/Utils/SecurityEvent/Connectors/MicrosoftSentinelNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/OktaNormalizer.js +351 -0
- package/build/dist/Utils/SecurityEvent/Connectors/OktaNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/Connectors/SplunkNormalizer.js +348 -0
- package/build/dist/Utils/SecurityEvent/Connectors/SplunkNormalizer.js.map +1 -0
- package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js +103 -10
- package/build/dist/Utils/SecurityEvent/GoogleSecOpsAlertNormalizer.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +16 -5
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
- package/build/dist/Utils/Telemetry/EntityRelationship.js +7 -0
- package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
- package/build/dist/Utils/Telemetry/LockedFilterSearch.js +277 -0
- package/build/dist/Utils/Telemetry/LockedFilterSearch.js.map +1 -0
- package/build/dist/Utils/Telemetry/NetworkHost.js +39 -0
- package/build/dist/Utils/Telemetry/NetworkHost.js.map +1 -0
- package/build/dist/Utils/Telemetry/OriginAllowList.js +105 -4
- package/build/dist/Utils/Telemetry/OriginAllowList.js.map +1 -1
- package/build/dist/Utils/Traces/CriticalPath.js +9 -4
- package/build/dist/Utils/Traces/CriticalPath.js.map +1 -1
- package/package.json +1 -1
- package/Tests/UI/Rum/RecordingHealthStrip.test.tsx +0 -600
- package/UI/Components/GanttChart/Bar/BarLabel.tsx +0 -17
- package/UI/Components/GanttChart/Bar/Index.tsx +0 -149
- package/UI/Components/GanttChart/ChartContainer.tsx +0 -50
- package/UI/Components/GanttChart/Index.tsx +0 -90
- package/UI/Components/GanttChart/Row/Index.tsx +0 -22
- package/UI/Components/GanttChart/Row/Row.tsx +0 -231
- package/UI/Components/GanttChart/Row/RowLabel.tsx +0 -30
- package/UI/Components/GanttChart/Rows.tsx +0 -59
- package/UI/Components/GanttChart/Timeline/Index.tsx +0 -46
- package/UI/Components/GanttChart/Timeline/TimelineInterval.tsx +0 -33
- package/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.tsx +0 -43
- package/build/dist/UI/Components/GanttChart/Bar/BarLabel.js +0 -8
- package/build/dist/UI/Components/GanttChart/Bar/BarLabel.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Bar/Index.js +0 -77
- package/build/dist/UI/Components/GanttChart/Bar/Index.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/ChartContainer.js +0 -33
- package/build/dist/UI/Components/GanttChart/ChartContainer.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Index.js +0 -39
- package/build/dist/UI/Components/GanttChart/Index.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Row/Index.js +0 -7
- package/build/dist/UI/Components/GanttChart/Row/Index.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Row/Row.js +0 -106
- package/build/dist/UI/Components/GanttChart/Row/Row.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Row/RowLabel.js +0 -10
- package/build/dist/UI/Components/GanttChart/Row/RowLabel.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Rows.js +0 -19
- package/build/dist/UI/Components/GanttChart/Rows.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Timeline/Index.js +0 -16
- package/build/dist/UI/Components/GanttChart/Timeline/Index.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Timeline/TimelineInterval.js +0 -13
- package/build/dist/UI/Components/GanttChart/Timeline/TimelineInterval.js.map +0 -1
- package/build/dist/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.js +0 -13
- package/build/dist/UI/Components/GanttChart/Timeline/TimelineIntervalMarks.js.map +0 -1
|
@@ -0,0 +1,1014 @@
|
|
|
1
|
+
import LayerUtil, {
|
|
2
|
+
LayerEventsResult,
|
|
3
|
+
PriorityCalendarEvents,
|
|
4
|
+
ROTATION_PERIOD_START_KEY,
|
|
5
|
+
} from "../../../Types/OnCallDutyPolicy/Layer";
|
|
6
|
+
import CalendarEvent from "../../../Types/Calendar/CalendarEvent";
|
|
7
|
+
import RestrictionTimes, {
|
|
8
|
+
RestrictionType,
|
|
9
|
+
WeeklyResctriction,
|
|
10
|
+
} from "../../../Types/OnCallDutyPolicy/RestrictionTimes";
|
|
11
|
+
import Recurring from "../../../Types/Events/Recurring";
|
|
12
|
+
import EventInterval from "../../../Types/Events/EventInterval";
|
|
13
|
+
import StartAndEndTime from "../../../Types/Time/StartAndEndTime";
|
|
14
|
+
import DayOfWeek from "../../../Types/Day/DayOfWeek";
|
|
15
|
+
import User from "../../../Models/DatabaseModels/User";
|
|
16
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
17
|
+
import { describe, expect, test } from "@jest/globals";
|
|
18
|
+
import moment from "moment-timezone";
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* Core-path coverage for LayerUtil that the many audit/regression suites next
|
|
22
|
+
* to this file do not pin directly: JSON / string input sanitisation, a
|
|
23
|
+
* missing handoff, the plain round-robin order for several users, handoff
|
|
24
|
+
* phase, daily and weekly restriction trimming (including overnight and
|
|
25
|
+
* weekend wrap-around windows), DST behaviour of Day vs Hour rotations,
|
|
26
|
+
* multi-layer priority metadata and the event-count cap.
|
|
27
|
+
*
|
|
28
|
+
* Every instant is built in an explicit IANA zone and every layer carries an
|
|
29
|
+
* explicit `timezone`, so results do not depend on the process TZ.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const UTC: string = "UTC";
|
|
33
|
+
const NY: string = "America/New_York";
|
|
34
|
+
const SECOND_MS: number = 1000;
|
|
35
|
+
const HOUR_MS: number = 60 * 60 * SECOND_MS;
|
|
36
|
+
|
|
37
|
+
function user(id: string): User {
|
|
38
|
+
return {
|
|
39
|
+
id: {
|
|
40
|
+
toString: (): string => {
|
|
41
|
+
return id;
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
} as unknown as User;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function rotation(
|
|
48
|
+
intervalType: EventInterval,
|
|
49
|
+
intervalCount: number,
|
|
50
|
+
): Recurring {
|
|
51
|
+
return Recurring.fromJSON({
|
|
52
|
+
_type: "Recurring",
|
|
53
|
+
value: {
|
|
54
|
+
intervalType: intervalType,
|
|
55
|
+
intervalCount: { _type: "PositiveNumber", value: intervalCount },
|
|
56
|
+
},
|
|
57
|
+
} as JSONObject);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function at(iso: string, tz: string = UTC): Date {
|
|
61
|
+
return moment.tz(iso, tz).toDate();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function wall(d: Date, tz: string = UTC): string {
|
|
65
|
+
return moment.tz(d, tz).format("YYYY-MM-DD HH:mm:ss");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function noRestriction(): RestrictionTimes {
|
|
69
|
+
const rt: RestrictionTimes = new RestrictionTimes();
|
|
70
|
+
rt.restictionType = RestrictionType.None;
|
|
71
|
+
return rt;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function dailyRestriction(
|
|
75
|
+
startIso: string,
|
|
76
|
+
endIso: string,
|
|
77
|
+
tz: string = UTC,
|
|
78
|
+
): RestrictionTimes {
|
|
79
|
+
const rt: RestrictionTimes = new RestrictionTimes();
|
|
80
|
+
rt.restictionType = RestrictionType.Daily;
|
|
81
|
+
rt.dayRestrictionTimes = {
|
|
82
|
+
startTime: at(startIso, tz),
|
|
83
|
+
endTime: at(endIso, tz),
|
|
84
|
+
};
|
|
85
|
+
return rt;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function weeklyRestriction(
|
|
89
|
+
windows: Array<WeeklyResctriction>,
|
|
90
|
+
): RestrictionTimes {
|
|
91
|
+
const rt: RestrictionTimes = new RestrictionTimes();
|
|
92
|
+
rt.restictionType = RestrictionType.Weekly;
|
|
93
|
+
rt.weeklyRestrictionTimes = windows;
|
|
94
|
+
return rt;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface Summary {
|
|
98
|
+
user: string;
|
|
99
|
+
start: string;
|
|
100
|
+
end: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function summarize(
|
|
104
|
+
events: Array<CalendarEvent>,
|
|
105
|
+
tz: string = UTC,
|
|
106
|
+
): Array<Summary> {
|
|
107
|
+
return events.map((e: CalendarEvent): Summary => {
|
|
108
|
+
return { user: e.title, start: wall(e.start, tz), end: wall(e.end, tz) };
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
describe("LayerUtil.getEvents - input validation", () => {
|
|
113
|
+
test("returns no events when the user list is empty", () => {
|
|
114
|
+
const result: LayerEventsResult = new LayerUtil().getEventsWithMeta({
|
|
115
|
+
users: [],
|
|
116
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
117
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
118
|
+
restrictionTimes: noRestriction(),
|
|
119
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
120
|
+
timezone: UTC,
|
|
121
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
122
|
+
calendarEndDate: at("2026-01-10 00:00"),
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
expect(result).toEqual({ events: [], truncated: false });
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test("returns no events when the calendar end is before the calendar start", () => {
|
|
129
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
130
|
+
users: [user("a")],
|
|
131
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
132
|
+
handOffTime: at("2026-01-01 00:00"),
|
|
133
|
+
restrictionTimes: noRestriction(),
|
|
134
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
135
|
+
timezone: UTC,
|
|
136
|
+
calendarStartDate: at("2026-01-10 00:00"),
|
|
137
|
+
calendarEndDate: at("2026-01-05 00:00"),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
expect(events).toEqual([]);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
test("returns no events when the layer starts after the calendar window ends", () => {
|
|
144
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
145
|
+
users: [user("a")],
|
|
146
|
+
startDateTimeOfLayer: at("2026-02-01 00:00"),
|
|
147
|
+
handOffTime: at("2026-02-01 00:00"),
|
|
148
|
+
restrictionTimes: noRestriction(),
|
|
149
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
150
|
+
timezone: UTC,
|
|
151
|
+
calendarStartDate: at("2026-01-01 00:00"),
|
|
152
|
+
calendarEndDate: at("2026-01-10 00:00"),
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
expect(events).toEqual([]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test("returns no events when the handoff time is missing", () => {
|
|
159
|
+
const result: LayerEventsResult = new LayerUtil().getEventsWithMeta({
|
|
160
|
+
users: [user("a")],
|
|
161
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
162
|
+
handOffTime: null as unknown as Date,
|
|
163
|
+
restrictionTimes: noRestriction(),
|
|
164
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
165
|
+
timezone: UTC,
|
|
166
|
+
calendarStartDate: at("2026-01-01 00:00"),
|
|
167
|
+
calendarEndDate: at("2026-01-03 00:00"),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(result).toEqual({ events: [], truncated: false });
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test("clamps the window start to the layer start when the layer starts inside the window", () => {
|
|
174
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
175
|
+
users: [user("a")],
|
|
176
|
+
startDateTimeOfLayer: at("2026-01-03 06:00"),
|
|
177
|
+
handOffTime: at("2026-01-03 06:00"),
|
|
178
|
+
restrictionTimes: noRestriction(),
|
|
179
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
180
|
+
timezone: UTC,
|
|
181
|
+
calendarStartDate: at("2026-01-01 00:00"),
|
|
182
|
+
calendarEndDate: at("2026-01-04 00:00"),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
expect(events.length).toBeGreaterThan(0);
|
|
186
|
+
expect(wall(events[0]!.start)).toBe("2026-01-03 06:00:00");
|
|
187
|
+
expect(wall(events[events.length - 1]!.end)).toBe("2026-01-04 00:00:00");
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
test("accepts JSON-serialised rotation / restriction and ISO string dates", () => {
|
|
191
|
+
const util: LayerUtil = new LayerUtil();
|
|
192
|
+
|
|
193
|
+
const typed: Array<CalendarEvent> = util.getEvents({
|
|
194
|
+
users: [user("a"), user("b")],
|
|
195
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
196
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
197
|
+
restrictionTimes: dailyRestriction(
|
|
198
|
+
"2026-01-05 09:00",
|
|
199
|
+
"2026-01-05 17:00",
|
|
200
|
+
),
|
|
201
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
202
|
+
timezone: UTC,
|
|
203
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
204
|
+
calendarEndDate: at("2026-01-08 00:00"),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const fromJson: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
208
|
+
users: [user("a"), user("b")],
|
|
209
|
+
startDateTimeOfLayer: "2026-01-05T00:00:00.000Z" as unknown as Date,
|
|
210
|
+
handOffTime: "2026-01-05T00:00:00.000Z" as unknown as Date,
|
|
211
|
+
restrictionTimes: dailyRestriction(
|
|
212
|
+
"2026-01-05 09:00",
|
|
213
|
+
"2026-01-05 17:00",
|
|
214
|
+
).toJSON() as unknown as RestrictionTimes,
|
|
215
|
+
rotation: rotation(EventInterval.Day, 1).toJSON() as unknown as Recurring,
|
|
216
|
+
timezone: UTC,
|
|
217
|
+
calendarStartDate: "2026-01-05T00:00:00.000Z" as unknown as Date,
|
|
218
|
+
calendarEndDate: "2026-01-08T00:00:00.000Z" as unknown as Date,
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
expect(typed.length).toBe(3);
|
|
222
|
+
expect(summarize(fromJson)).toEqual(summarize(typed));
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe("LayerUtil.getEvents - rotation order and handoff", () => {
|
|
227
|
+
test("rotates three users round-robin on a daily handoff with 1 s seams", () => {
|
|
228
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
229
|
+
users: [user("a"), user("b"), user("c")],
|
|
230
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
231
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
232
|
+
restrictionTimes: noRestriction(),
|
|
233
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
234
|
+
timezone: UTC,
|
|
235
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
236
|
+
calendarEndDate: at("2026-01-10 00:00"),
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
expect(
|
|
240
|
+
events.map((e: CalendarEvent): string => {
|
|
241
|
+
return e.title;
|
|
242
|
+
}),
|
|
243
|
+
).toEqual(["a", "b", "c", "a", "b"]);
|
|
244
|
+
|
|
245
|
+
// Ids are unique and sequential.
|
|
246
|
+
expect(
|
|
247
|
+
events.map((e: CalendarEvent): number => {
|
|
248
|
+
return e.id;
|
|
249
|
+
}),
|
|
250
|
+
).toEqual([1, 2, 3, 4, 5]);
|
|
251
|
+
|
|
252
|
+
for (let i: number = 1; i < events.length; i++) {
|
|
253
|
+
expect(events[i]!.start.getTime() - events[i - 1]!.end.getTime()).toBe(
|
|
254
|
+
SECOND_MS,
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
expect(wall(events[0]!.start)).toBe("2026-01-05 00:00:00");
|
|
259
|
+
expect(wall(events[0]!.end)).toBe("2026-01-06 00:00:00");
|
|
260
|
+
expect(wall(events[4]!.end)).toBe("2026-01-10 00:00:00");
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test("REGRESSION: a window ending exactly on a handoff emits no trailing inverted event", () => {
|
|
264
|
+
for (const restrictionTimes of [
|
|
265
|
+
noRestriction(),
|
|
266
|
+
dailyRestriction("2026-01-01 00:00", "2026-01-01 23:00"),
|
|
267
|
+
]) {
|
|
268
|
+
const result: LayerEventsResult = new LayerUtil().getEventsWithMeta({
|
|
269
|
+
users: [user("a"), user("b")],
|
|
270
|
+
startDateTimeOfLayer: at("2026-01-05 08:00"),
|
|
271
|
+
handOffTime: at("2026-01-05 08:00"),
|
|
272
|
+
restrictionTimes: restrictionTimes,
|
|
273
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
274
|
+
timezone: UTC,
|
|
275
|
+
calendarStartDate: at("2026-01-05 08:00"),
|
|
276
|
+
calendarEndDate: at("2026-01-07 08:00"),
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
expect(result.truncated).toBe(false);
|
|
280
|
+
for (const e of result.events) {
|
|
281
|
+
expect(e.end.getTime()).toBeGreaterThan(e.start.getTime());
|
|
282
|
+
expect(e.end.getTime()).toBeLessThanOrEqual(
|
|
283
|
+
at("2026-01-07 08:00").getTime(),
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
// The next user ("a" again) must not appear as a 1 s-inverted stub.
|
|
287
|
+
expect(result.events[result.events.length - 1]!.title).toBe("b");
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
test("a single user holds every period", () => {
|
|
292
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
293
|
+
users: [user("solo")],
|
|
294
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
295
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
296
|
+
restrictionTimes: noRestriction(),
|
|
297
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
298
|
+
timezone: UTC,
|
|
299
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
300
|
+
calendarEndDate: at("2026-01-08 00:00"),
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
expect(events.length).toBe(3);
|
|
304
|
+
for (const e of events) {
|
|
305
|
+
expect(e.title).toBe("solo");
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
test("a mid-day handoff splits the first period at the handoff time", () => {
|
|
310
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
311
|
+
users: [user("a"), user("b")],
|
|
312
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
313
|
+
handOffTime: at("2026-01-05 09:30"),
|
|
314
|
+
restrictionTimes: noRestriction(),
|
|
315
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
316
|
+
timezone: UTC,
|
|
317
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
318
|
+
calendarEndDate: at("2026-01-07 12:00"),
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
expect(summarize(events)).toEqual([
|
|
322
|
+
{ user: "a", start: "2026-01-05 00:00:00", end: "2026-01-05 09:30:00" },
|
|
323
|
+
{ user: "b", start: "2026-01-05 09:30:01", end: "2026-01-06 09:30:00" },
|
|
324
|
+
{ user: "a", start: "2026-01-06 09:30:01", end: "2026-01-07 09:30:00" },
|
|
325
|
+
{ user: "b", start: "2026-01-07 09:30:01", end: "2026-01-07 12:00:00" },
|
|
326
|
+
]);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
test("a window starting weeks after the layer start resumes at the correct user", () => {
|
|
330
|
+
const layer: {
|
|
331
|
+
users: Array<User>;
|
|
332
|
+
startDateTimeOfLayer: Date;
|
|
333
|
+
handOffTime: Date;
|
|
334
|
+
} = {
|
|
335
|
+
users: [user("a"), user("b"), user("c")],
|
|
336
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
337
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
const full: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
341
|
+
...layer,
|
|
342
|
+
restrictionTimes: noRestriction(),
|
|
343
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
344
|
+
timezone: UTC,
|
|
345
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
346
|
+
calendarEndDate: at("2026-01-25 00:00"),
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
const late: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
350
|
+
...layer,
|
|
351
|
+
restrictionTimes: noRestriction(),
|
|
352
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
353
|
+
timezone: UTC,
|
|
354
|
+
calendarStartDate: at("2026-01-20 00:00"),
|
|
355
|
+
calendarEndDate: at("2026-01-25 00:00"),
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// Day 15 after the start: 15 % 3 === 0 -> user "a".
|
|
359
|
+
expect(late[0]!.title).toBe("a");
|
|
360
|
+
// The first event is clamped to the window start instead of the seam.
|
|
361
|
+
expect(wall(late[0]!.start)).toBe("2026-01-20 00:00:00");
|
|
362
|
+
expect(summarize(late.slice(1))).toEqual(summarize(full.slice(16)));
|
|
363
|
+
expect(
|
|
364
|
+
late.map((e: CalendarEvent): string => {
|
|
365
|
+
return e.title;
|
|
366
|
+
}),
|
|
367
|
+
).toEqual(
|
|
368
|
+
full.slice(15).map((e: CalendarEvent): string => {
|
|
369
|
+
return e.title;
|
|
370
|
+
}),
|
|
371
|
+
);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
test("a multi-day rotation interval keeps a user on for the whole interval", () => {
|
|
375
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
376
|
+
users: [user("a"), user("b")],
|
|
377
|
+
startDateTimeOfLayer: at("2026-01-05 08:00"),
|
|
378
|
+
handOffTime: at("2026-01-05 08:00"),
|
|
379
|
+
restrictionTimes: noRestriction(),
|
|
380
|
+
rotation: rotation(EventInterval.Day, 3),
|
|
381
|
+
timezone: UTC,
|
|
382
|
+
calendarStartDate: at("2026-01-05 08:00"),
|
|
383
|
+
calendarEndDate: at("2026-01-14 08:00"),
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
expect(summarize(events)).toEqual([
|
|
387
|
+
{ user: "a", start: "2026-01-05 08:00:00", end: "2026-01-08 08:00:00" },
|
|
388
|
+
{ user: "b", start: "2026-01-08 08:00:01", end: "2026-01-11 08:00:00" },
|
|
389
|
+
{ user: "a", start: "2026-01-11 08:00:01", end: "2026-01-14 08:00:00" },
|
|
390
|
+
]);
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
test("a restricted layer stamps the true period start on a window-clamped first event", () => {
|
|
394
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
395
|
+
users: [user("a"), user("b")],
|
|
396
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
397
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
398
|
+
restrictionTimes: dailyRestriction(
|
|
399
|
+
"2026-01-01 09:00",
|
|
400
|
+
"2026-01-01 17:00",
|
|
401
|
+
),
|
|
402
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
403
|
+
timezone: UTC,
|
|
404
|
+
calendarStartDate: at("2026-01-06 15:00"),
|
|
405
|
+
calendarEndDate: at("2026-01-08 00:00"),
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const periodStart: (e: CalendarEvent) => number = (
|
|
409
|
+
e: CalendarEvent,
|
|
410
|
+
): number => {
|
|
411
|
+
return (e as unknown as Record<string, number>)[
|
|
412
|
+
ROTATION_PERIOD_START_KEY
|
|
413
|
+
]!;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
expect(summarize(events)).toEqual([
|
|
417
|
+
{ user: "b", start: "2026-01-06 15:00:00", end: "2026-01-06 17:00:00" },
|
|
418
|
+
{ user: "a", start: "2026-01-07 09:00:00", end: "2026-01-07 17:00:00" },
|
|
419
|
+
]);
|
|
420
|
+
// The seam puts every period after the first one second past the handoff.
|
|
421
|
+
expect(periodStart(events[0]!)).toBe(at("2026-01-06 00:00:01").getTime());
|
|
422
|
+
expect(periodStart(events[1]!)).toBe(at("2026-01-07 00:00:01").getTime());
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
describe("LayerUtil.getEvents - DST", () => {
|
|
427
|
+
test("a daily rotation in New York keeps its 09:00 wall-clock handoff across spring-forward", () => {
|
|
428
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
429
|
+
users: [user("a"), user("b")],
|
|
430
|
+
startDateTimeOfLayer: at("2026-03-06 09:00", NY),
|
|
431
|
+
handOffTime: at("2026-03-06 09:00", NY),
|
|
432
|
+
restrictionTimes: noRestriction(),
|
|
433
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
434
|
+
timezone: NY,
|
|
435
|
+
calendarStartDate: at("2026-03-06 09:00", NY),
|
|
436
|
+
calendarEndDate: at("2026-03-10 09:00", NY),
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
expect(summarize(events, NY)).toEqual([
|
|
440
|
+
{ user: "a", start: "2026-03-06 09:00:00", end: "2026-03-07 09:00:00" },
|
|
441
|
+
{ user: "b", start: "2026-03-07 09:00:01", end: "2026-03-08 09:00:00" },
|
|
442
|
+
{ user: "a", start: "2026-03-08 09:00:01", end: "2026-03-09 09:00:00" },
|
|
443
|
+
{ user: "b", start: "2026-03-09 09:00:01", end: "2026-03-10 09:00:00" },
|
|
444
|
+
]);
|
|
445
|
+
|
|
446
|
+
// The day containing the transition (Mar 7 -> Mar 8) is only 23 real hours.
|
|
447
|
+
expect(events[1]!.end.getTime() - events[1]!.start.getTime()).toBe(
|
|
448
|
+
23 * HOUR_MS - SECOND_MS,
|
|
449
|
+
);
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
test("a daily rotation in New York is 25 real hours across fall-back", () => {
|
|
453
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
454
|
+
users: [user("a"), user("b")],
|
|
455
|
+
startDateTimeOfLayer: at("2026-10-31 09:00", NY),
|
|
456
|
+
handOffTime: at("2026-10-31 09:00", NY),
|
|
457
|
+
restrictionTimes: noRestriction(),
|
|
458
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
459
|
+
timezone: NY,
|
|
460
|
+
calendarStartDate: at("2026-10-31 09:00", NY),
|
|
461
|
+
calendarEndDate: at("2026-11-02 09:00", NY),
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
expect(summarize(events, NY)).toEqual([
|
|
465
|
+
{ user: "a", start: "2026-10-31 09:00:00", end: "2026-11-01 09:00:00" },
|
|
466
|
+
{ user: "b", start: "2026-11-01 09:00:01", end: "2026-11-02 09:00:00" },
|
|
467
|
+
]);
|
|
468
|
+
expect(events[0]!.end.getTime() - events[0]!.start.getTime()).toBe(
|
|
469
|
+
25 * HOUR_MS,
|
|
470
|
+
);
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
test("an hourly rotation steps absolute hours across spring-forward", () => {
|
|
474
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
475
|
+
users: [user("a"), user("b")],
|
|
476
|
+
startDateTimeOfLayer: at("2026-03-08 00:00", NY),
|
|
477
|
+
handOffTime: at("2026-03-08 00:00", NY),
|
|
478
|
+
restrictionTimes: noRestriction(),
|
|
479
|
+
rotation: rotation(EventInterval.Hour, 1),
|
|
480
|
+
timezone: NY,
|
|
481
|
+
calendarStartDate: at("2026-03-08 00:00", NY),
|
|
482
|
+
calendarEndDate: at("2026-03-08 04:00", NY),
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
// 00:00 -> 04:00 NY on spring-forward day is only 3 real hours.
|
|
486
|
+
expect(
|
|
487
|
+
events.map((e: CalendarEvent): string => {
|
|
488
|
+
return e.title;
|
|
489
|
+
}),
|
|
490
|
+
).toEqual(["a", "b", "a"]);
|
|
491
|
+
expect(
|
|
492
|
+
events.map((e: CalendarEvent): string => {
|
|
493
|
+
return moment.tz(e.start, NY).format("HH:mm:ss");
|
|
494
|
+
}),
|
|
495
|
+
).toEqual(["00:00:00", "01:00:01", "03:00:01"]);
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
describe("LayerUtil.getEvents - restrictions", () => {
|
|
500
|
+
test("a daily 09:00-17:00 restriction yields one working-hours event per day, rotating users", () => {
|
|
501
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
502
|
+
users: [user("a"), user("b")],
|
|
503
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
504
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
505
|
+
restrictionTimes: dailyRestriction(
|
|
506
|
+
"2026-01-01 09:00",
|
|
507
|
+
"2026-01-01 17:00",
|
|
508
|
+
),
|
|
509
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
510
|
+
timezone: UTC,
|
|
511
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
512
|
+
calendarEndDate: at("2026-01-08 00:00"),
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
expect(summarize(events)).toEqual([
|
|
516
|
+
{ user: "a", start: "2026-01-05 09:00:00", end: "2026-01-05 17:00:00" },
|
|
517
|
+
{ user: "b", start: "2026-01-06 09:00:00", end: "2026-01-06 17:00:00" },
|
|
518
|
+
{ user: "a", start: "2026-01-07 09:00:00", end: "2026-01-07 17:00:00" },
|
|
519
|
+
]);
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
test("a daily restriction is resolved in the schedule zone (New York), not the process zone", () => {
|
|
523
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
524
|
+
users: [user("a")],
|
|
525
|
+
startDateTimeOfLayer: at("2026-07-06 00:00", NY),
|
|
526
|
+
handOffTime: at("2026-07-06 00:00", NY),
|
|
527
|
+
restrictionTimes: dailyRestriction(
|
|
528
|
+
"2026-01-01 09:00",
|
|
529
|
+
"2026-01-01 17:00",
|
|
530
|
+
NY,
|
|
531
|
+
),
|
|
532
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
533
|
+
timezone: NY,
|
|
534
|
+
calendarStartDate: at("2026-07-06 00:00", NY),
|
|
535
|
+
calendarEndDate: at("2026-07-08 00:00", NY),
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// Authored in winter (EST) but applied in summer (EDT): wall-clock holds.
|
|
539
|
+
expect(summarize(events, NY)).toEqual([
|
|
540
|
+
{ user: "a", start: "2026-07-06 09:00:00", end: "2026-07-06 17:00:00" },
|
|
541
|
+
{ user: "a", start: "2026-07-07 09:00:00", end: "2026-07-07 17:00:00" },
|
|
542
|
+
]);
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
test("an overnight daily restriction (22:00-06:00) covers the night across the day boundary", () => {
|
|
546
|
+
const util: LayerUtil = new LayerUtil();
|
|
547
|
+
const events: Array<CalendarEvent> = util.getEvents({
|
|
548
|
+
users: [user("a")],
|
|
549
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
550
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
551
|
+
restrictionTimes: dailyRestriction(
|
|
552
|
+
"2026-01-01 22:00",
|
|
553
|
+
"2026-01-01 06:00",
|
|
554
|
+
),
|
|
555
|
+
rotation: rotation(EventInterval.Week, 1),
|
|
556
|
+
timezone: UTC,
|
|
557
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
558
|
+
calendarEndDate: at("2026-01-07 00:00"),
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
const covered: (iso: string) => boolean = (iso: string): boolean => {
|
|
562
|
+
const t: number = at(iso).getTime();
|
|
563
|
+
return events.some((e: CalendarEvent): boolean => {
|
|
564
|
+
return e.start.getTime() <= t && t <= e.end.getTime();
|
|
565
|
+
});
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
expect(covered("2026-01-05 00:30")).toBe(true);
|
|
569
|
+
expect(covered("2026-01-05 05:59")).toBe(true);
|
|
570
|
+
expect(covered("2026-01-05 06:30")).toBe(false);
|
|
571
|
+
expect(covered("2026-01-05 12:00")).toBe(false);
|
|
572
|
+
expect(covered("2026-01-05 21:59")).toBe(false);
|
|
573
|
+
expect(covered("2026-01-05 22:30")).toBe(true);
|
|
574
|
+
expect(covered("2026-01-06 03:00")).toBe(true);
|
|
575
|
+
expect(covered("2026-01-06 12:00")).toBe(false);
|
|
576
|
+
expect(covered("2026-01-06 23:00")).toBe(true);
|
|
577
|
+
|
|
578
|
+
for (const e of events) {
|
|
579
|
+
expect(e.end.getTime()).toBeGreaterThan(e.start.getTime());
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
test("a period fully inside a restriction gap does not consume a user's turn", () => {
|
|
584
|
+
// Weekdays 09:00-17:00 only; daily rotation. Sat/Sun produce no coverage.
|
|
585
|
+
const windows: Array<WeeklyResctriction> = [];
|
|
586
|
+
const mondayIso: Array<string> = [
|
|
587
|
+
"2026-01-05",
|
|
588
|
+
"2026-01-06",
|
|
589
|
+
"2026-01-07",
|
|
590
|
+
"2026-01-08",
|
|
591
|
+
"2026-01-09",
|
|
592
|
+
];
|
|
593
|
+
const days: Array<DayOfWeek> = [
|
|
594
|
+
DayOfWeek.Monday,
|
|
595
|
+
DayOfWeek.Tuesday,
|
|
596
|
+
DayOfWeek.Wednesday,
|
|
597
|
+
DayOfWeek.Thursday,
|
|
598
|
+
DayOfWeek.Friday,
|
|
599
|
+
];
|
|
600
|
+
for (let i: number = 0; i < days.length; i++) {
|
|
601
|
+
windows.push({
|
|
602
|
+
startDay: days[i]!,
|
|
603
|
+
endDay: days[i]!,
|
|
604
|
+
startTime: at(`${mondayIso[i]} 09:00`),
|
|
605
|
+
endTime: at(`${mondayIso[i]} 17:00`),
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
610
|
+
users: [user("a"), user("b"), user("c")],
|
|
611
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
612
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
613
|
+
restrictionTimes: weeklyRestriction(windows),
|
|
614
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
615
|
+
timezone: UTC,
|
|
616
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
617
|
+
calendarEndDate: at("2026-01-14 00:00"),
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
expect(summarize(events)).toEqual([
|
|
621
|
+
{ user: "a", start: "2026-01-05 09:00:00", end: "2026-01-05 17:00:00" },
|
|
622
|
+
{ user: "b", start: "2026-01-06 09:00:00", end: "2026-01-06 17:00:00" },
|
|
623
|
+
{ user: "c", start: "2026-01-07 09:00:00", end: "2026-01-07 17:00:00" },
|
|
624
|
+
{ user: "a", start: "2026-01-08 09:00:00", end: "2026-01-08 17:00:00" },
|
|
625
|
+
{ user: "b", start: "2026-01-09 09:00:00", end: "2026-01-09 17:00:00" },
|
|
626
|
+
// weekend skipped without advancing the rotation
|
|
627
|
+
{ user: "c", start: "2026-01-12 09:00:00", end: "2026-01-12 17:00:00" },
|
|
628
|
+
{ user: "a", start: "2026-01-13 09:00:00", end: "2026-01-13 17:00:00" },
|
|
629
|
+
]);
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
test("a weekend wrap-around weekly restriction (Fri 18:00 -> Mon 08:00) on a weekly rotation", () => {
|
|
633
|
+
const events: Array<CalendarEvent> = new LayerUtil().getEvents({
|
|
634
|
+
users: [user("a"), user("b")],
|
|
635
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
636
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
637
|
+
restrictionTimes: weeklyRestriction([
|
|
638
|
+
{
|
|
639
|
+
startDay: DayOfWeek.Friday,
|
|
640
|
+
endDay: DayOfWeek.Monday,
|
|
641
|
+
startTime: at("2026-01-09 18:00"),
|
|
642
|
+
endTime: at("2026-01-12 08:00"),
|
|
643
|
+
},
|
|
644
|
+
]),
|
|
645
|
+
rotation: rotation(EventInterval.Week, 1),
|
|
646
|
+
timezone: UTC,
|
|
647
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
648
|
+
calendarEndDate: at("2026-01-19 00:00"),
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
const covering: (iso: string) => string | null = (
|
|
652
|
+
iso: string,
|
|
653
|
+
): string | null => {
|
|
654
|
+
const t: number = at(iso).getTime();
|
|
655
|
+
const hit: CalendarEvent | undefined = events.find(
|
|
656
|
+
(e: CalendarEvent): boolean => {
|
|
657
|
+
return e.start.getTime() <= t && t <= e.end.getTime();
|
|
658
|
+
},
|
|
659
|
+
);
|
|
660
|
+
return hit ? hit.title : null;
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// Week 1 (user a): early Monday tail of the previous weekend + Fri->Mon.
|
|
664
|
+
expect(covering("2026-01-05 07:00")).toBe("a");
|
|
665
|
+
expect(covering("2026-01-07 12:00")).toBeNull();
|
|
666
|
+
expect(covering("2026-01-09 17:59")).toBeNull();
|
|
667
|
+
expect(covering("2026-01-09 19:00")).toBe("a");
|
|
668
|
+
expect(covering("2026-01-11 12:00")).toBe("a");
|
|
669
|
+
// Week 2 (user b).
|
|
670
|
+
expect(covering("2026-01-12 12:00")).toBeNull();
|
|
671
|
+
expect(covering("2026-01-16 19:00")).toBe("b");
|
|
672
|
+
expect(covering("2026-01-18 23:00")).toBe("b");
|
|
673
|
+
|
|
674
|
+
// No two events overlap.
|
|
675
|
+
const sorted: Array<CalendarEvent> = [...events].sort(
|
|
676
|
+
(x: CalendarEvent, y: CalendarEvent): number => {
|
|
677
|
+
return x.start.getTime() - y.start.getTime();
|
|
678
|
+
},
|
|
679
|
+
);
|
|
680
|
+
for (let i: number = 1; i < sorted.length; i++) {
|
|
681
|
+
expect(sorted[i]!.start.getTime()).toBeGreaterThan(
|
|
682
|
+
sorted[i - 1]!.end.getTime(),
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
describe("LayerUtil restriction helpers", () => {
|
|
689
|
+
test("trimStartAndEndTimesBasedOnRestrictionTimes passes the event through with no restriction", () => {
|
|
690
|
+
const start: Date = at("2026-01-05 03:00");
|
|
691
|
+
const end: Date = at("2026-01-06 03:00");
|
|
692
|
+
expect(
|
|
693
|
+
new LayerUtil().trimStartAndEndTimesBasedOnRestrictionTimes({
|
|
694
|
+
eventStartTime: start,
|
|
695
|
+
eventEndTime: end,
|
|
696
|
+
restrictionTimes: noRestriction(),
|
|
697
|
+
}),
|
|
698
|
+
).toEqual([{ startTime: start, endTime: end }]);
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
test("a Daily restriction type with no day window yields nothing", () => {
|
|
702
|
+
const rt: RestrictionTimes = new RestrictionTimes();
|
|
703
|
+
rt.restictionType = RestrictionType.Daily;
|
|
704
|
+
rt.dayRestrictionTimes = null;
|
|
705
|
+
|
|
706
|
+
expect(
|
|
707
|
+
new LayerUtil().trimStartAndEndTimesBasedOnRestrictionTimes({
|
|
708
|
+
eventStartTime: at("2026-01-05 00:00"),
|
|
709
|
+
eventEndTime: at("2026-01-06 00:00"),
|
|
710
|
+
restrictionTimes: rt,
|
|
711
|
+
}),
|
|
712
|
+
).toEqual([]);
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
test("trimming does not mutate the caller's RestrictionTimes", () => {
|
|
716
|
+
const rt: RestrictionTimes = dailyRestriction(
|
|
717
|
+
"2026-01-01 09:00",
|
|
718
|
+
"2026-01-01 17:00",
|
|
719
|
+
);
|
|
720
|
+
const before: StartAndEndTime = { ...rt.dayRestrictionTimes! };
|
|
721
|
+
|
|
722
|
+
const util: LayerUtil = new LayerUtil();
|
|
723
|
+
util.trimStartAndEndTimesBasedOnRestrictionTimes({
|
|
724
|
+
eventStartTime: at("2026-03-05 00:00"),
|
|
725
|
+
eventEndTime: at("2026-03-06 00:00"),
|
|
726
|
+
restrictionTimes: rt,
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
expect(rt.dayRestrictionTimes!.startTime.getTime()).toBe(
|
|
730
|
+
before.startTime.getTime(),
|
|
731
|
+
);
|
|
732
|
+
expect(rt.dayRestrictionTimes!.endTime.getTime()).toBe(
|
|
733
|
+
before.endTime.getTime(),
|
|
734
|
+
);
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
test("getEventsByDailyRestriction with a null window returns the event unchanged", () => {
|
|
738
|
+
const start: Date = at("2026-01-05 00:00");
|
|
739
|
+
const end: Date = at("2026-01-05 12:00");
|
|
740
|
+
expect(
|
|
741
|
+
new LayerUtil().getEventsByDailyRestriction({
|
|
742
|
+
eventStartTime: start,
|
|
743
|
+
eventEndTime: end,
|
|
744
|
+
restrictionStartAndEndTime: null as unknown as StartAndEndTime,
|
|
745
|
+
props: { intervalType: EventInterval.Day },
|
|
746
|
+
}),
|
|
747
|
+
).toEqual([{ startTime: start, endTime: end }]);
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
test("getEventsByDailyRestriction emits nothing when the event ends before the window opens", () => {
|
|
751
|
+
expect(
|
|
752
|
+
new LayerUtil().getEventsByDailyRestriction({
|
|
753
|
+
eventStartTime: at("2026-01-05 01:00"),
|
|
754
|
+
eventEndTime: at("2026-01-05 08:00"),
|
|
755
|
+
restrictionStartAndEndTime: {
|
|
756
|
+
startTime: at("2026-01-05 09:00"),
|
|
757
|
+
endTime: at("2026-01-05 17:00"),
|
|
758
|
+
},
|
|
759
|
+
props: { intervalType: EventInterval.Day },
|
|
760
|
+
}),
|
|
761
|
+
).toEqual([]);
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
test("getEventsByDailyRestriction tiles a multi-day event day by day", () => {
|
|
765
|
+
const util: LayerUtil = new LayerUtil();
|
|
766
|
+
(util as unknown as { timezone: string }).timezone = UTC;
|
|
767
|
+
|
|
768
|
+
const out: Array<StartAndEndTime> = util.getEventsByDailyRestriction({
|
|
769
|
+
eventStartTime: at("2026-01-05 12:00"),
|
|
770
|
+
eventEndTime: at("2026-01-07 10:00"),
|
|
771
|
+
restrictionStartAndEndTime: {
|
|
772
|
+
startTime: at("2026-01-05 09:00"),
|
|
773
|
+
endTime: at("2026-01-05 17:00"),
|
|
774
|
+
},
|
|
775
|
+
props: { intervalType: EventInterval.Day },
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
expect(
|
|
779
|
+
out.map((s: StartAndEndTime): Array<string> => {
|
|
780
|
+
return [wall(s.startTime), wall(s.endTime)];
|
|
781
|
+
}),
|
|
782
|
+
).toEqual([
|
|
783
|
+
["2026-01-05 12:00:00", "2026-01-05 17:00:00"],
|
|
784
|
+
["2026-01-06 09:00:00", "2026-01-06 17:00:00"],
|
|
785
|
+
["2026-01-07 09:00:00", "2026-01-07 10:00:00"],
|
|
786
|
+
]);
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
test("getEventsByWeeklyRestriction with no weekly windows returns the event unchanged", () => {
|
|
790
|
+
const start: Date = at("2026-01-05 00:00");
|
|
791
|
+
const end: Date = at("2026-01-12 00:00");
|
|
792
|
+
expect(
|
|
793
|
+
new LayerUtil().getEventsByWeeklyRestriction({
|
|
794
|
+
eventStartTime: start,
|
|
795
|
+
eventEndTime: end,
|
|
796
|
+
restrictionTimes: weeklyRestriction([]),
|
|
797
|
+
}),
|
|
798
|
+
).toEqual([{ startTime: start, endTime: end }]);
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
test("getEventsByWeeklyRestriction merges overlapping windows that share a start", () => {
|
|
802
|
+
const util: LayerUtil = new LayerUtil();
|
|
803
|
+
(util as unknown as { timezone: string }).timezone = UTC;
|
|
804
|
+
|
|
805
|
+
const out: Array<StartAndEndTime> = util.getEventsByWeeklyRestriction({
|
|
806
|
+
eventStartTime: at("2026-01-05 00:00"),
|
|
807
|
+
eventEndTime: at("2026-01-12 00:00"),
|
|
808
|
+
restrictionTimes: weeklyRestriction([
|
|
809
|
+
{
|
|
810
|
+
startDay: DayOfWeek.Tuesday,
|
|
811
|
+
endDay: DayOfWeek.Tuesday,
|
|
812
|
+
startTime: at("2026-01-06 09:00"),
|
|
813
|
+
endTime: at("2026-01-06 12:00"),
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
startDay: DayOfWeek.Tuesday,
|
|
817
|
+
endDay: DayOfWeek.Tuesday,
|
|
818
|
+
startTime: at("2026-01-06 09:00"),
|
|
819
|
+
endTime: at("2026-01-06 17:00"),
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
startDay: DayOfWeek.Thursday,
|
|
823
|
+
endDay: DayOfWeek.Thursday,
|
|
824
|
+
startTime: at("2026-01-08 10:00"),
|
|
825
|
+
endTime: at("2026-01-08 11:00"),
|
|
826
|
+
},
|
|
827
|
+
]),
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
expect(
|
|
831
|
+
out.map((s: StartAndEndTime): Array<string> => {
|
|
832
|
+
return [wall(s.startTime), wall(s.endTime)];
|
|
833
|
+
}),
|
|
834
|
+
).toEqual([
|
|
835
|
+
["2026-01-06 09:00:00", "2026-01-06 17:00:00"],
|
|
836
|
+
["2026-01-08 10:00:00", "2026-01-08 11:00:00"],
|
|
837
|
+
]);
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
test("getWeeklyRestrictionTimesForWeek splits a wrap-around window into head and main segments", () => {
|
|
841
|
+
const util: LayerUtil = new LayerUtil();
|
|
842
|
+
(util as unknown as { timezone: string }).timezone = UTC;
|
|
843
|
+
|
|
844
|
+
const out: Array<StartAndEndTime> = util.getWeeklyRestrictionTimesForWeek({
|
|
845
|
+
eventStartTime: at("2026-01-07 12:00"), // Wednesday
|
|
846
|
+
eventEndTime: at("2026-01-14 12:00"),
|
|
847
|
+
restrictionTimes: weeklyRestriction([
|
|
848
|
+
{
|
|
849
|
+
startDay: DayOfWeek.Saturday,
|
|
850
|
+
endDay: DayOfWeek.Monday,
|
|
851
|
+
startTime: at("2026-01-03 00:00"),
|
|
852
|
+
endTime: at("2026-01-05 06:00"),
|
|
853
|
+
},
|
|
854
|
+
]),
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
expect(out.length).toBe(2);
|
|
858
|
+
// head: from the start of the (Sunday-based) week to Monday 06:00
|
|
859
|
+
expect(wall(out[0]!.startTime)).toBe("2026-01-04 00:00:00");
|
|
860
|
+
expect(wall(out[0]!.endTime)).toBe("2026-01-05 06:00:00");
|
|
861
|
+
// main: Saturday 00:00 through the following Monday 06:00
|
|
862
|
+
expect(wall(out[1]!.startTime)).toBe("2026-01-10 00:00:00");
|
|
863
|
+
expect(wall(out[1]!.endTime)).toBe("2026-01-12 06:00:00");
|
|
864
|
+
});
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
describe("LayerUtil.getMultiLayerEvents", () => {
|
|
868
|
+
test("a higher priority layer wins and events are stamped with priority and layer identity", () => {
|
|
869
|
+
const events: Array<CalendarEvent> = new LayerUtil().getMultiLayerEvents({
|
|
870
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
871
|
+
calendarEndDate: at("2026-01-06 00:00"),
|
|
872
|
+
layers: [
|
|
873
|
+
{
|
|
874
|
+
layerId: "primary",
|
|
875
|
+
layerName: "Business hours",
|
|
876
|
+
users: [user("day")],
|
|
877
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
878
|
+
handOffTime: at("2026-01-01 00:00"),
|
|
879
|
+
restrictionTimes: dailyRestriction(
|
|
880
|
+
"2026-01-01 09:00",
|
|
881
|
+
"2026-01-01 17:00",
|
|
882
|
+
),
|
|
883
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
884
|
+
timezone: UTC,
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
users: [user("fallback")],
|
|
888
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
889
|
+
handOffTime: at("2026-01-01 00:00"),
|
|
890
|
+
restrictionTimes: noRestriction(),
|
|
891
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
892
|
+
timezone: UTC,
|
|
893
|
+
},
|
|
894
|
+
],
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
const shaped: Array<{
|
|
898
|
+
user: string;
|
|
899
|
+
priority: number;
|
|
900
|
+
layerId: string | undefined;
|
|
901
|
+
layerName: string | undefined;
|
|
902
|
+
start: string;
|
|
903
|
+
end: string;
|
|
904
|
+
}> = (events as Array<PriorityCalendarEvents>).map(
|
|
905
|
+
(e: PriorityCalendarEvents) => {
|
|
906
|
+
return {
|
|
907
|
+
user: e.title,
|
|
908
|
+
priority: e.priority,
|
|
909
|
+
layerId: e.layerId,
|
|
910
|
+
layerName: e.layerName,
|
|
911
|
+
start: wall(e.start),
|
|
912
|
+
end: wall(e.end),
|
|
913
|
+
};
|
|
914
|
+
},
|
|
915
|
+
);
|
|
916
|
+
|
|
917
|
+
expect(shaped).toEqual([
|
|
918
|
+
{
|
|
919
|
+
user: "fallback",
|
|
920
|
+
priority: 2,
|
|
921
|
+
layerId: undefined,
|
|
922
|
+
layerName: undefined,
|
|
923
|
+
start: "2026-01-05 00:00:00",
|
|
924
|
+
end: "2026-01-05 08:59:59",
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
user: "day",
|
|
928
|
+
priority: 1,
|
|
929
|
+
layerId: "primary",
|
|
930
|
+
layerName: "Business hours",
|
|
931
|
+
start: "2026-01-05 09:00:00",
|
|
932
|
+
end: "2026-01-05 17:00:00",
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
user: "fallback",
|
|
936
|
+
priority: 2,
|
|
937
|
+
layerId: undefined,
|
|
938
|
+
layerName: undefined,
|
|
939
|
+
start: "2026-01-05 17:00:01",
|
|
940
|
+
end: "2026-01-06 00:00:00",
|
|
941
|
+
},
|
|
942
|
+
]);
|
|
943
|
+
|
|
944
|
+
// Fallback events carry no layer identity keys at all.
|
|
945
|
+
expect(Object.keys(events[0]!)).not.toContain("layerId");
|
|
946
|
+
});
|
|
947
|
+
|
|
948
|
+
test("getNumberOfEvents caps the merged result, not each layer", () => {
|
|
949
|
+
const events: Array<CalendarEvent> = new LayerUtil().getMultiLayerEvents(
|
|
950
|
+
{
|
|
951
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
952
|
+
calendarEndDate: at("2026-01-10 00:00"),
|
|
953
|
+
layers: [
|
|
954
|
+
{
|
|
955
|
+
users: [user("a"), user("b")],
|
|
956
|
+
startDateTimeOfLayer: at("2026-01-05 00:00"),
|
|
957
|
+
handOffTime: at("2026-01-05 00:00"),
|
|
958
|
+
restrictionTimes: noRestriction(),
|
|
959
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
960
|
+
timezone: UTC,
|
|
961
|
+
},
|
|
962
|
+
],
|
|
963
|
+
},
|
|
964
|
+
{ getNumberOfEvents: 2 },
|
|
965
|
+
);
|
|
966
|
+
|
|
967
|
+
expect(
|
|
968
|
+
events.map((e: CalendarEvent): string => {
|
|
969
|
+
return e.title;
|
|
970
|
+
}),
|
|
971
|
+
).toEqual(["a", "b"]);
|
|
972
|
+
});
|
|
973
|
+
|
|
974
|
+
test("a layer with no users contributes nothing while other layers still resolve", () => {
|
|
975
|
+
const result: LayerEventsResult =
|
|
976
|
+
new LayerUtil().getMultiLayerEventsWithMeta({
|
|
977
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
978
|
+
calendarEndDate: at("2026-01-06 00:00"),
|
|
979
|
+
layers: [
|
|
980
|
+
{
|
|
981
|
+
users: [],
|
|
982
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
983
|
+
handOffTime: at("2026-01-01 00:00"),
|
|
984
|
+
restrictionTimes: noRestriction(),
|
|
985
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
986
|
+
timezone: UTC,
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
users: [user("b")],
|
|
990
|
+
startDateTimeOfLayer: at("2026-01-01 00:00"),
|
|
991
|
+
handOffTime: at("2026-01-01 00:00"),
|
|
992
|
+
restrictionTimes: noRestriction(),
|
|
993
|
+
rotation: rotation(EventInterval.Day, 1),
|
|
994
|
+
timezone: UTC,
|
|
995
|
+
},
|
|
996
|
+
],
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
expect(result.truncated).toBe(false);
|
|
1000
|
+
expect(result.events.length).toBe(1);
|
|
1001
|
+
expect(result.events[0]!.title).toBe("b");
|
|
1002
|
+
expect((result.events[0] as PriorityCalendarEvents).priority).toBe(2);
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
test("an empty layer list yields no events", () => {
|
|
1006
|
+
expect(
|
|
1007
|
+
new LayerUtil().getMultiLayerEvents({
|
|
1008
|
+
calendarStartDate: at("2026-01-05 00:00"),
|
|
1009
|
+
calendarEndDate: at("2026-01-06 00:00"),
|
|
1010
|
+
layers: [],
|
|
1011
|
+
}),
|
|
1012
|
+
).toEqual([]);
|
|
1013
|
+
});
|
|
1014
|
+
});
|