@oneuptime/common 12.0.28 → 12.0.30
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/DashboardDomain.ts +43 -0
- package/Models/DatabaseModels/Index.ts +11 -0
- package/Models/DatabaseModels/MonitorTemplate.ts +15 -3
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +43 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.ts +662 -0
- package/Models/DatabaseModels/ProjectOnCallCalendarFeed.ts +584 -0
- package/Models/DatabaseModels/StatusPageDomain.ts +43 -0
- package/Models/DatabaseModels/UserOnCallCalendarFeed.ts +546 -0
- package/Models/DatabaseModels/UserOnCallShiftReminder.ts +231 -0
- package/Models/DatabaseModels/UserOnCallShiftReminderLog.ts +331 -0
- package/Server/API/DashboardDomainAPI.ts +74 -0
- package/Server/API/MicrosoftTeamsAPI.ts +81 -180
- package/Server/API/OnCallCalendarAPI.ts +2194 -0
- package/Server/API/StatusPageDomainAPI.ts +74 -0
- package/Server/EnvironmentConfig.ts +138 -0
- package/Server/Infrastructure/OnCallCalendarFeedCache.ts +1050 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.ts +43 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.ts +40 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.ts +253 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
- package/Server/Middleware/OnCallCalendarFeedRateLimit.ts +487 -0
- package/Server/Middleware/ProjectAuthorization.ts +6 -1
- package/Server/Services/DashboardDomainService.ts +131 -0
- package/Server/Services/Index.ts +12 -0
- package/Server/Services/LogPipelineProcessorService.ts +88 -0
- package/Server/Services/MonitorTemplateService.ts +70 -11
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +32 -0
- package/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.ts +260 -0
- package/Server/Services/OnCallDutyPolicyScheduleLayerService.ts +70 -3
- package/Server/Services/OnCallDutyPolicyScheduleLayerUserService.ts +138 -3
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +1465 -134
- package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +167 -31
- package/Server/Services/ProjectOnCallCalendarFeedService.ts +192 -0
- package/Server/Services/StatusPageDomainService.ts +163 -3
- package/Server/Services/StatusPagePrivateUserSessionService.ts +197 -56
- package/Server/Services/TeamMemberService.ts +489 -1
- package/Server/Services/TeamService.ts +50 -0
- package/Server/Services/UserNotificationSettingService.ts +44 -1
- package/Server/Services/UserOnCallCalendarFeedService.ts +159 -0
- package/Server/Services/UserOnCallShiftReminderLogService.ts +151 -0
- package/Server/Services/UserOnCallShiftReminderService.ts +112 -0
- package/Server/Types/Domain.ts +17 -0
- package/Server/Utils/APIKey/AccessPermission.ts +24 -0
- package/Server/Utils/Greenlock/Greenlock.ts +156 -58
- package/Server/Utils/LogPipelineProcessorValidation.ts +112 -0
- package/Server/Utils/OnCall/CalendarFeedToken.ts +241 -0
- package/Server/Utils/OnCall/OnCallCalendarFeedRenderer.ts +1488 -0
- package/Server/Utils/OnCall/OnCallCalendarFeedUrls.ts +230 -0
- package/Server/Utils/OnCall/OnCallShiftChangeListeners.ts +227 -0
- package/Server/Utils/OnCall/OnCallShiftMaterializer.ts +1127 -0
- package/Server/Utils/OnCall/OnCallShiftReminderListener.ts +174 -0
- package/Server/Utils/OnCall/OnCallShiftReminderRunner.ts +2584 -0
- package/Server/Utils/Response.ts +134 -0
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.ts +1094 -45
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +153 -17
- package/Server/Utils/StartServer.ts +10 -0
- package/Server/Utils/Telemetry/AppMetrics.ts +51 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +23 -11
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +0 -170
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.ts +158 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +23 -11
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +35 -13
- package/Tests/App/Dashboard/MonitorTemplateColumnAndFacet.test.tsx +505 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedLinks.test.tsx +229 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedPlanGate.test.tsx +489 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedSideMenus.test.tsx +149 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedUtil.test.ts +855 -0
- package/Tests/App/Dashboard/OnCallPersonalCalendarFeed.test.tsx +1209 -0
- package/Tests/App/Dashboard/OnCallSharedCalendarFeedCard.test.tsx +1019 -0
- package/Tests/App/Dashboard/OnCallShiftRemindersAndUpcomingShifts.test.tsx +655 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +73 -0
- package/Tests/App/StatusPage/StatusPageLoginCodeBootstrap.test.ts +106 -0
- package/Tests/App/StatusPage/StatusPageLoginCodeUtil.test.ts +84 -0
- package/Tests/App/StatusPage/StatusPageRedirectSafety.test.ts +119 -0
- package/Tests/Models/MonitorTemplateMonitorNameColumn.test.ts +258 -0
- package/Tests/Models/OnCallCalendarFeedModels.test.ts +642 -0
- package/Tests/Models/OnCallDutyPolicyScheduleCalendarFeed.test.ts +288 -0
- package/Tests/Models/OnCallDutyPolicyScheduleShiftConfigVersion.test.ts +88 -0
- package/Tests/Models/UserOnCallShiftReminderModels.test.ts +368 -0
- package/Tests/Server/API/CustomDomainReissueSslAPI.test.ts +469 -0
- package/Tests/Server/API/Helpers.ts +8 -0
- package/Tests/Server/API/MicrosoftTeamsBotMessagesEndpoint.test.ts +729 -0
- package/Tests/Server/API/MicrosoftTeamsBotTestEndpoint.test.ts +26 -0
- package/Tests/Server/API/MicrosoftTeamsLegacyWebhookRemoval.test.ts +402 -0
- package/Tests/Server/API/OnCallCalendarAPI.test.ts +4461 -0
- package/Tests/Server/EnvironmentConfigOnCallCalendarFeed.test.ts +357 -0
- package/Tests/Server/Infrastructure/OnCallCalendarFeedCache.test.ts +1589 -0
- package/Tests/Server/Infrastructure/Postgres/AddOnCallCalendarFeedsMigration.test.ts +369 -0
- package/Tests/Server/Middleware/OnCallCalendarFeedRateLimit.test.ts +1365 -0
- package/Tests/Server/Middleware/ProjectAuthorizationApiKeyMiddleware.test.ts +4 -0
- package/Tests/Server/Services/AddCertificateReissueRequestedAtToDomainsMigration.test.ts +287 -0
- package/Tests/Server/Services/CustomDomainCertificateReissue.test.ts +477 -0
- package/Tests/Server/Services/FeedRetentionConsistency.test.ts +70 -0
- package/Tests/Server/Services/LogPipelineProcessorSaveValidation.test.ts +249 -0
- package/Tests/Server/Services/MonitorTemplateServiceBulkSync.test.ts +549 -0
- package/Tests/Server/Services/MonitorTemplateServiceNetworkDeviceSync.test.ts +16 -3
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +57 -0
- package/Tests/Server/Services/OnCallCalendarFeedServices.test.ts +1103 -0
- package/Tests/Server/Services/OnCallDutyPolicyScheduleResolver.test.ts +1037 -0
- package/Tests/Server/Services/OnCallShiftConfigPropagation.test.ts +1270 -0
- package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +151 -15
- package/Tests/Server/Services/StatusPagePrivateUserSessionService.test.ts +587 -0
- package/Tests/Server/Services/TeamDeleteMemberCleanup.test.ts +156 -0
- package/Tests/Server/Services/TeamMemberOnCallCleanup.test.ts +755 -0
- package/Tests/Server/Services/UserNotificationSettingShiftReminderDefaults.test.ts +267 -0
- package/Tests/Server/Services/UserOnCallShiftReminderServices.test.ts +583 -0
- package/Tests/Server/Types/Database/Permissions/ApiKeyFileAccess.test.ts +286 -0
- package/Tests/Server/Types/Database/Permissions/MonitorTemplateColumnAccess.test.ts +328 -0
- package/Tests/Server/Types/Database/Permissions/OnCallCalendarFeedPermissions.test.ts +254 -0
- package/Tests/Server/Types/Database/QueryHelperFindWithSameTextAndIsNull.test.ts +83 -0
- package/Tests/Server/Utils/AI/SRE/ConfidenceSignal.test.ts +377 -0
- package/Tests/Server/Utils/APIKey/AccessPermission.test.ts +16 -1
- package/Tests/Server/Utils/Greenlock/CertificateRenewalSchedule.test.ts +250 -0
- package/Tests/Server/Utils/LogPipelineProcessorValidation.test.ts +198 -0
- package/Tests/Server/Utils/OnCall/CalendarFeedToken.test.ts +467 -0
- package/Tests/Server/Utils/OnCall/OnCallCalendarFeedRenderer.test.ts +2142 -0
- package/Tests/Server/Utils/OnCall/OnCallCalendarFeedUrls.test.ts +278 -0
- package/Tests/Server/Utils/OnCall/OnCallResolverTestHarness.ts +440 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftChangeListeners.test.ts +314 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftMaterializer.test.ts +1502 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderListener.test.ts +491 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderRunner.test.ts +3088 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderTestHarness.ts +910 -0
- package/Tests/Server/Utils/ResponseSendCalendarResponse.test.ts +561 -0
- package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +48 -9
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsAuth.test.ts +726 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsClient.test.ts +74 -11
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsErrorHandling.test.ts +1107 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +20 -3
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +51 -11
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerHardening.test.ts +1246 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsRequestContract.test.ts +961 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsResponseParsing.test.ts +653 -0
- package/Tests/Server/Utils/StartServerEncryptionSecretWarning.test.ts +64 -0
- package/Tests/Server/Utils/Telemetry/AppMetrics.test.ts +29 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsActionAuthorization.test.ts +880 -0
- package/Tests/Types/API/HTTPResponse.test.ts +175 -0
- package/Tests/Types/API/Route.test.ts +36 -4
- package/Tests/Types/Calendar/ICalendar.test.ts +488 -0
- package/Tests/Types/Database/DatabaseProperty.test.ts +171 -0
- package/Tests/Types/DateLocalShortDateTimeString.test.ts +518 -0
- package/Tests/Types/DateLocalTimeString.test.ts +259 -0
- package/Tests/Types/DateUserPrefers12HourFormat.test.ts +316 -0
- package/Tests/Types/NotificationSetting/NotificationSettingEventType.test.ts +53 -0
- package/Tests/Types/OnCallDutyPolicy/CalendarFeedTestFixtures.ts +310 -0
- package/Tests/Types/OnCallDutyPolicy/CalendarFeedWindow.test.ts +205 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilLayerMetaAndIterationCap.test.ts +458 -0
- package/Tests/Types/OnCallDutyPolicy/MaterializedShift.test.ts +197 -0
- package/Tests/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.test.ts +1986 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleShiftUtilGroupKey.test.ts +678 -0
- package/Tests/Types/OnCallDutyPolicy/ShiftSeamUtil.test.ts +417 -0
- package/Tests/UI/Components/LogsHistogram.test.tsx +41 -2
- package/Tests/UI/Components/LogsViewerEmptyStateTimeRange.test.tsx +212 -0
- package/Tests/UI/Components/TelemetryChartClockFormat.test.tsx +359 -0
- package/Tests/UI/Components/TimeRangePickerClockFormat.test.tsx +422 -0
- package/Tests/UI/Components/TimeRangePickerDropdown.test.tsx +146 -8
- package/Tests/UI/MicrosoftTeams/MicrosoftTeamsMessagingEndpointGuidance.test.tsx +520 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +10 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +2 -0
- package/Tests/UI/Utils/Navigation.test.ts +82 -0
- package/Tests/Utils/Array.test.ts +100 -0
- package/Tests/Utils/CertificateReissue.test.ts +225 -0
- package/Tests/Utils/Grok/Grok.test.ts +492 -0
- package/Tests/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.test.ts +181 -13
- package/Types/API/Route.ts +20 -5
- package/Types/Calendar/ICalendar.ts +442 -0
- package/Types/Date.ts +143 -13
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/OnCallDutyPolicy/CalendarFeedWindow.ts +140 -0
- package/Types/OnCallDutyPolicy/Layer.ts +190 -35
- package/Types/OnCallDutyPolicy/MaterializedShift.ts +274 -0
- package/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.ts +1415 -0
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +159 -4
- package/Types/OnCallDutyPolicy/ShiftSeamUtil.ts +106 -0
- package/Types/Rum/SessionReplay.ts +62 -1
- package/UI/Components/Date/TimeRangePickerDropdown.tsx +9 -5
- package/UI/Components/LogsViewer/LogsViewer.tsx +12 -7
- package/UI/Components/LogsViewer/components/HistogramTooltip.tsx +18 -17
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +21 -28
- package/UI/Components/LogsViewer/components/LogsHistogram.tsx +2 -4
- package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +2 -4
- package/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.tsx +17 -16
- package/UI/Utils/Navigation.ts +42 -0
- package/Utils/Array.ts +37 -0
- package/Utils/CertificateReissue.ts +128 -0
- package/Utils/Grok/Grok.ts +461 -0
- package/Utils/Grok/GrokPatterns.ts +118 -0
- package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +58 -6
- package/build/dist/Models/DatabaseModels/DashboardDomain.js +44 -0
- package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +11 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js +17 -4
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +44 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +699 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js +620 -0
- package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js +44 -0
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js +585 -0
- package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js +247 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js +355 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js.map +1 -0
- package/build/dist/Server/API/DashboardDomainAPI.js +43 -1
- package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +74 -118
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/OnCallCalendarAPI.js +1371 -0
- package/build/dist/Server/API/OnCallCalendarAPI.js.map +1 -0
- package/build/dist/Server/API/StatusPageDomainAPI.js +43 -1
- package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +102 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js +663 -0
- package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790200000000-AllowNullMonitorNameOnMonitorTemplate.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.js +28 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790300000000-AddCertificateReissueRequestedAtToDomains.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.js +103 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/OnCallCalendarFeedRateLimit.js +342 -0
- package/build/dist/Server/Middleware/OnCallCalendarFeedRateLimit.js.map +1 -0
- package/build/dist/Server/Middleware/ProjectAuthorization.js +6 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Services/DashboardDomainService.js +104 -0
- package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +12 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LogPipelineProcessorService.js +65 -0
- package/build/dist/Server/Services/LogPipelineProcessorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +57 -11
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +20 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js +219 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js +47 -3
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js +112 -3
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +955 -9
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +93 -6
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
- package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js +157 -0
- package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/StatusPageDomainService.js +132 -3
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/StatusPagePrivateUserSessionService.js +112 -32
- package/build/dist/Server/Services/StatusPagePrivateUserSessionService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +396 -1
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TeamService.js +43 -0
- package/build/dist/Server/Services/TeamService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js +26 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallCalendarFeedService.js +140 -0
- package/build/dist/Server/Services/UserOnCallCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js +116 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js.map +1 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderService.js +92 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderService.js.map +1 -0
- package/build/dist/Server/Types/Domain.js +16 -0
- package/build/dist/Server/Types/Domain.js.map +1 -1
- package/build/dist/Server/Utils/APIKey/AccessPermission.js +24 -0
- package/build/dist/Server/Utils/APIKey/AccessPermission.js.map +1 -1
- package/build/dist/Server/Utils/Greenlock/Greenlock.js +110 -35
- package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
- package/build/dist/Server/Utils/LogPipelineProcessorValidation.js +77 -0
- package/build/dist/Server/Utils/LogPipelineProcessorValidation.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js +161 -0
- package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js +983 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js +155 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js +145 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js +752 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js +92 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js +1786 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js.map +1 -0
- package/build/dist/Server/Utils/Response.js +97 -0
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js +777 -36
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +108 -17
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +9 -1
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +41 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +17 -6
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +0 -159
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.js +128 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Authorization.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +17 -6
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +25 -13
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/API/Route.js +16 -5
- package/build/dist/Types/API/Route.js.map +1 -1
- package/build/dist/Types/Calendar/ICalendar.js +290 -0
- package/build/dist/Types/Calendar/ICalendar.js.map +1 -0
- package/build/dist/Types/Date.js +115 -13
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js +97 -0
- package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +113 -19
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js +134 -0
- package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js +800 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +97 -3
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js +77 -0
- package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js.map +1 -0
- package/build/dist/Types/Rum/SessionReplay.js +38 -0
- package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
- package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js +9 -5
- package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +12 -7
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/HistogramTooltip.js +15 -14
- package/build/dist/UI/Components/LogsViewer/components/HistogramTooltip.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +17 -22
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +2 -4
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +2 -4
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.js +15 -14
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogramTooltip.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +30 -0
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/Utils/Array.js +25 -0
- package/build/dist/Utils/Array.js.map +1 -1
- package/build/dist/Utils/CertificateReissue.js +97 -0
- package/build/dist/Utils/CertificateReissue.js.map +1 -0
- package/build/dist/Utils/Grok/Grok.js +324 -0
- package/build/dist/Utils/Grok/Grok.js.map +1 -0
- package/build/dist/Utils/Grok/GrokPatterns.js +112 -0
- package/build/dist/Utils/Grok/GrokPatterns.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +63 -3
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -1
- package/package.json +1 -1
- package/UI/Utils/JsonWebToken.ts +0 -14
- package/build/dist/UI/Utils/JsonWebToken.js +0 -10
- package/build/dist/UI/Utils/JsonWebToken.js.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import CalendarEvent from "../Calendar/CalendarEvent";
|
|
2
2
|
import OneUptimeDate from "../Date";
|
|
3
|
+
import { ROTATION_PERIOD_START_KEY } from "./Layer";
|
|
4
|
+
import UserOverrideUtil, { OverrideEventMeta } from "./UserOverrideUtil";
|
|
3
5
|
|
|
4
6
|
/*
|
|
5
7
|
* Turns the low-level calendar events produced by LayerUtil into the
|
|
@@ -36,6 +38,38 @@ export interface OnCallShift {
|
|
|
36
38
|
* coverage ("40h across the week") instead of the misleading span ("4d 8h").
|
|
37
39
|
*/
|
|
38
40
|
coverageSeconds: number;
|
|
41
|
+
/*
|
|
42
|
+
* Metadata carried over from the FIRST raw segment folded into this shift:
|
|
43
|
+
* the override that produced it (UserOverrideUtil stamps it on the event)
|
|
44
|
+
* and the layer it came from (LayerUtil stamps layerId/layerName when the
|
|
45
|
+
* caller identified the layer). Only present when the segment carried them.
|
|
46
|
+
*
|
|
47
|
+
* With the default grouping (by user id) a shift can span segments from
|
|
48
|
+
* several layers or override windows, so these describe the first segment
|
|
49
|
+
* only. Callers that need them to hold for the WHOLE shift pass a groupKey
|
|
50
|
+
* that includes them (see groupKeyByUserOverrideAndLayer), which is what the
|
|
51
|
+
* on-call calendar feed does.
|
|
52
|
+
*/
|
|
53
|
+
override?: OverrideEventMeta;
|
|
54
|
+
layerId?: string;
|
|
55
|
+
layerName?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* Decides which raw segments may be folded into the same shift. Two adjacent
|
|
60
|
+
* segments are merged only when their keys are equal (and they touch, or the
|
|
61
|
+
* caller asked to merge across gaps).
|
|
62
|
+
*/
|
|
63
|
+
export type ShiftGroupKeyFunction = (event: CalendarEvent) => string;
|
|
64
|
+
|
|
65
|
+
export interface GroupEventsIntoShiftsOptions {
|
|
66
|
+
mergeAcrossGaps?: boolean | undefined;
|
|
67
|
+
/*
|
|
68
|
+
* Defaults to the on-call user id (event.title), which is what every
|
|
69
|
+
* schedule summary in the dashboard wants: "Alice, Mon 09:00 -> Fri 17:00"
|
|
70
|
+
* regardless of which layer or override put her there.
|
|
71
|
+
*/
|
|
72
|
+
groupKey?: ShiftGroupKeyFunction | undefined;
|
|
39
73
|
}
|
|
40
74
|
|
|
41
75
|
export interface CoverageGap {
|
|
@@ -116,13 +150,15 @@ export default class ScheduleShiftUtil {
|
|
|
116
150
|
*/
|
|
117
151
|
public static groupEventsIntoShifts(
|
|
118
152
|
events: Array<CalendarEvent>,
|
|
119
|
-
options?:
|
|
153
|
+
options?: GroupEventsIntoShiftsOptions | undefined,
|
|
120
154
|
): Array<OnCallShift> {
|
|
121
155
|
if (!events || events.length === 0) {
|
|
122
156
|
return [];
|
|
123
157
|
}
|
|
124
158
|
|
|
125
159
|
const mergeAcrossGaps: boolean = Boolean(options?.mergeAcrossGaps);
|
|
160
|
+
const groupKey: ShiftGroupKeyFunction =
|
|
161
|
+
options?.groupKey ?? ScheduleShiftUtil.defaultGroupKey;
|
|
126
162
|
|
|
127
163
|
// Work on a copy sorted by start time; never mutate the caller's array.
|
|
128
164
|
const sorted: Array<CalendarEvent> = [...events]
|
|
@@ -142,16 +178,18 @@ export default class ScheduleShiftUtil {
|
|
|
142
178
|
});
|
|
143
179
|
|
|
144
180
|
const shifts: Array<OnCallShift> = [];
|
|
181
|
+
let lastKey: string | null = null;
|
|
145
182
|
|
|
146
183
|
for (const event of sorted) {
|
|
147
184
|
const userId: string = event.title;
|
|
185
|
+
const key: string = groupKey(event);
|
|
148
186
|
const eventSeconds: number = OneUptimeDate.getDifferenceInSeconds(
|
|
149
187
|
event.end,
|
|
150
188
|
event.start,
|
|
151
189
|
);
|
|
152
190
|
const last: OnCallShift | undefined = shifts[shifts.length - 1];
|
|
153
191
|
|
|
154
|
-
const sameUser: boolean = Boolean(last) &&
|
|
192
|
+
const sameUser: boolean = Boolean(last) && lastKey === key;
|
|
155
193
|
|
|
156
194
|
const isContiguous: boolean =
|
|
157
195
|
Boolean(last) &&
|
|
@@ -175,17 +213,134 @@ export default class ScheduleShiftUtil {
|
|
|
175
213
|
continue;
|
|
176
214
|
}
|
|
177
215
|
|
|
178
|
-
|
|
216
|
+
const shift: OnCallShift = {
|
|
179
217
|
userId,
|
|
180
218
|
start: event.start,
|
|
181
219
|
end: event.end,
|
|
182
220
|
coverageSeconds: eventSeconds,
|
|
183
|
-
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/*
|
|
224
|
+
* Only add the metadata keys when the segment carries them, so callers
|
|
225
|
+
* that never stamp them (every dashboard summary) get the exact shift
|
|
226
|
+
* objects they always did.
|
|
227
|
+
*/
|
|
228
|
+
const override: OverrideEventMeta | null =
|
|
229
|
+
UserOverrideUtil.getOverrideMeta(event);
|
|
230
|
+
if (override) {
|
|
231
|
+
shift.override = override;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const layerId: string | undefined =
|
|
235
|
+
ScheduleShiftUtil.getEventLayerId(event);
|
|
236
|
+
if (layerId !== undefined) {
|
|
237
|
+
shift.layerId = layerId;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const layerName: string | undefined =
|
|
241
|
+
ScheduleShiftUtil.getEventLayerName(event);
|
|
242
|
+
if (layerName !== undefined) {
|
|
243
|
+
shift.layerName = layerName;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
shifts.push(shift);
|
|
247
|
+
lastKey = key;
|
|
184
248
|
}
|
|
185
249
|
|
|
186
250
|
return shifts;
|
|
187
251
|
}
|
|
188
252
|
|
|
253
|
+
// The default grouping: one shift per run of the same on-call user.
|
|
254
|
+
public static defaultGroupKey(event: CalendarEvent): string {
|
|
255
|
+
return event.title;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/*
|
|
259
|
+
* Grouping that keeps a shift inside ONE layer, ONE override window and ONE
|
|
260
|
+
* rotation period: the user id, plus the override identity (original user +
|
|
261
|
+
* window) when the segment was produced by an override, plus the layer id
|
|
262
|
+
* when known, plus the rotation period the engine stamped on the event. This
|
|
263
|
+
* is the key the on-call calendar feed groups with, so an override split
|
|
264
|
+
* yields A / B / A as three events and a layer handover is visible as a
|
|
265
|
+
* boundary instead of being folded into a single shift.
|
|
266
|
+
*
|
|
267
|
+
* The rotation period matters because two consecutive turns held by the SAME
|
|
268
|
+
* user (a single-user layer, or [A, A, B]) are contiguous across the engine's
|
|
269
|
+
* 1 s seam and would otherwise fold into one block whose start and end are
|
|
270
|
+
* decided by how far the expansion window reached — the block would slide
|
|
271
|
+
* forward every time the feed window did, changing the event's UID and
|
|
272
|
+
* DTSTART for every subscriber. Override segments deliberately ignore the
|
|
273
|
+
* period: an override that spans a rotation boundary is ONE stretch of cover
|
|
274
|
+
* and stays one event.
|
|
275
|
+
*/
|
|
276
|
+
public static groupKeyByUserOverrideAndLayer(event: CalendarEvent): string {
|
|
277
|
+
const override: OverrideEventMeta | null =
|
|
278
|
+
UserOverrideUtil.getOverrideMeta(event);
|
|
279
|
+
|
|
280
|
+
const overridePart: string = override
|
|
281
|
+
? `${override.originalUserId}@${override.overrideStartsAt.getTime()}-${override.overrideEndsAt.getTime()}`
|
|
282
|
+
: "";
|
|
283
|
+
|
|
284
|
+
const periodStart: number | undefined = override
|
|
285
|
+
? undefined
|
|
286
|
+
: ScheduleShiftUtil.getEventRotationPeriodStart(event);
|
|
287
|
+
|
|
288
|
+
const periodPart: string =
|
|
289
|
+
periodStart === undefined ? "" : periodStart.toString();
|
|
290
|
+
|
|
291
|
+
return `${event.title}|${overridePart}|${ScheduleShiftUtil.getEventLayerId(event) ?? ""}|${periodPart}`;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/*
|
|
295
|
+
* LayerUtil stamps layerId/layerName onto merged events (see
|
|
296
|
+
* PriorityCalendarEvents). CalendarEvent is a JSONObject, so the keys are
|
|
297
|
+
* read through the index signature and type-checked here.
|
|
298
|
+
*/
|
|
299
|
+
public static getEventLayerId(event: CalendarEvent): string | undefined {
|
|
300
|
+
const value: unknown = (event as unknown as Record<string, unknown>)[
|
|
301
|
+
"layerId"
|
|
302
|
+
];
|
|
303
|
+
return typeof value === "string" ? value : undefined;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
public static getEventLayerName(event: CalendarEvent): string | undefined {
|
|
307
|
+
const value: unknown = (event as unknown as Record<string, unknown>)[
|
|
308
|
+
"layerName"
|
|
309
|
+
];
|
|
310
|
+
return typeof value === "string" ? value : undefined;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/*
|
|
314
|
+
* Epoch milliseconds of the rotation period an engine event belongs to (see
|
|
315
|
+
* ROTATION_PERIOD_START_KEY in Layer.ts). Undefined for hand-built events and
|
|
316
|
+
* for anything that did not come out of LayerUtil — those simply group as
|
|
317
|
+
* they always did. Dates and ISO strings are accepted so a JSON round trip
|
|
318
|
+
* does not silently drop the period.
|
|
319
|
+
*/
|
|
320
|
+
public static getEventRotationPeriodStart(
|
|
321
|
+
event: CalendarEvent,
|
|
322
|
+
): number | undefined {
|
|
323
|
+
const value: unknown = (event as unknown as Record<string, unknown>)[
|
|
324
|
+
ROTATION_PERIOD_START_KEY
|
|
325
|
+
];
|
|
326
|
+
|
|
327
|
+
if (typeof value === "number") {
|
|
328
|
+
return Number.isFinite(value) ? value : undefined;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (value instanceof Date) {
|
|
332
|
+
const time: number = value.getTime();
|
|
333
|
+
return Number.isNaN(time) ? undefined : time;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (typeof value === "string") {
|
|
337
|
+
const parsed: number = Date.parse(value);
|
|
338
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
|
|
189
344
|
/*
|
|
190
345
|
* The shift that contains `now` (the person on call right now) and the first
|
|
191
346
|
* shift that starts after `now` (up next). Either can be null: `current` is
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Seam normalisation for resolved on-call segments.
|
|
3
|
+
*
|
|
4
|
+
* The rotation engine and its post-processors leave one-second artefacts at
|
|
5
|
+
* every boundary: LayerUtil resumes each segment one second after the
|
|
6
|
+
* previous one ends (Layer.ts advances with addRemoveSeconds(end, 1)), the
|
|
7
|
+
* multi-layer priority merge trims to `start - 1s` / `end + 1s`, and the
|
|
8
|
+
* override splitter cuts at the exact instant. Fed straight into a calendar
|
|
9
|
+
* that renders as 09:00:01 -> 16:59:59, with adjacent shifts that neither
|
|
10
|
+
* touch nor overlap — which Google's week view draws side by side.
|
|
11
|
+
*
|
|
12
|
+
* Handoff and restriction times are minute-granular by construction, so the
|
|
13
|
+
* artefacts are unambiguous: a start on second 1 means the minute, an end on
|
|
14
|
+
* second 59 means the next minute, and two segments a second apart are
|
|
15
|
+
* meant to touch. Everything else is left alone.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface TimeSegment {
|
|
19
|
+
start: Date;
|
|
20
|
+
end: Date;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Segments this close together (in ms) are made to touch exactly.
|
|
24
|
+
export const SEAM_TOLERANCE_MILLISECONDS: number = 1000;
|
|
25
|
+
|
|
26
|
+
const MILLISECONDS_PER_MINUTE: number = 60 * 1000;
|
|
27
|
+
|
|
28
|
+
export default class ShiftSeamUtil {
|
|
29
|
+
/*
|
|
30
|
+
* Returns a NEW array (sorted by start, then end) of NEW segment objects
|
|
31
|
+
* with the seams normalised; neither the input array nor its segments are
|
|
32
|
+
* mutated. Any extra properties on the segments are preserved, so this can
|
|
33
|
+
* run on OnCallShift / MaterializedShift objects directly.
|
|
34
|
+
*
|
|
35
|
+
* Rules, in order:
|
|
36
|
+
* 1. a start whose seconds == 1 snaps DOWN to the minute;
|
|
37
|
+
* 2. an end whose seconds == 59 snaps UP to the next minute;
|
|
38
|
+
* 3. walking in start order, when the next segment starts 0..1 s after
|
|
39
|
+
* this one ends, this one's end becomes exactly the next one's start.
|
|
40
|
+
* Snapping only ever widens a segment, so it cannot create an empty or
|
|
41
|
+
* inverted one; a segment that is already empty or inverted is left alone.
|
|
42
|
+
*/
|
|
43
|
+
public static normalizeSeams<T extends TimeSegment>(
|
|
44
|
+
segments: Array<T>,
|
|
45
|
+
): Array<T> {
|
|
46
|
+
const normalized: Array<T> = segments.map((segment: T) => {
|
|
47
|
+
const snappedStart: Date = ShiftSeamUtil.snapStart(segment.start);
|
|
48
|
+
const snappedEnd: Date = ShiftSeamUtil.snapEnd(segment.end);
|
|
49
|
+
|
|
50
|
+
const keepSnaps: boolean =
|
|
51
|
+
segment.end.getTime() > segment.start.getTime() &&
|
|
52
|
+
snappedEnd.getTime() > snappedStart.getTime();
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
...segment,
|
|
56
|
+
start: keepSnaps ? snappedStart : new Date(segment.start.getTime()),
|
|
57
|
+
end: keepSnaps ? snappedEnd : new Date(segment.end.getTime()),
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
normalized.sort((a: T, b: T) => {
|
|
62
|
+
const byStart: number = a.start.getTime() - b.start.getTime();
|
|
63
|
+
if (byStart !== 0) {
|
|
64
|
+
return byStart;
|
|
65
|
+
}
|
|
66
|
+
return a.end.getTime() - b.end.getTime();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
for (let i: number = 0; i < normalized.length - 1; i++) {
|
|
70
|
+
const segment: T = normalized[i]!;
|
|
71
|
+
const next: T = normalized[i + 1]!;
|
|
72
|
+
|
|
73
|
+
const delta: number = next.start.getTime() - segment.end.getTime();
|
|
74
|
+
|
|
75
|
+
if (delta >= 0 && delta <= SEAM_TOLERANCE_MILLISECONDS) {
|
|
76
|
+
segment.end = new Date(next.start.getTime());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return normalized;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 10:00:01(.xxx) -> 10:00:00.000; anything else is returned as a copy.
|
|
84
|
+
public static snapStart(date: Date): Date {
|
|
85
|
+
if (date.getUTCSeconds() === 1) {
|
|
86
|
+
return new Date(
|
|
87
|
+
Math.floor(date.getTime() / MILLISECONDS_PER_MINUTE) *
|
|
88
|
+
MILLISECONDS_PER_MINUTE,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return new Date(date.getTime());
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 16:59:59(.xxx) -> 17:00:00.000; anything else is returned as a copy.
|
|
96
|
+
public static snapEnd(date: Date): Date {
|
|
97
|
+
if (date.getUTCSeconds() === 59) {
|
|
98
|
+
return new Date(
|
|
99
|
+
(Math.floor(date.getTime() / MILLISECONDS_PER_MINUTE) + 1) *
|
|
100
|
+
MILLISECONDS_PER_MINUTE,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return new Date(date.getTime());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -327,10 +327,52 @@ export interface SessionReplayChunkEnvelope {
|
|
|
327
327
|
traceIds?: Array<string>;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/*
|
|
331
|
+
* WHY a config response says enabled:false.
|
|
332
|
+
*
|
|
333
|
+
* The disabled response is deliberately a complete, well-formed config
|
|
334
|
+
* rather than an error, so a recorder that cannot parse a config still
|
|
335
|
+
* refuses to record. The cost of that was one answer for five very
|
|
336
|
+
* different causes: from a browser, an instance-wide kill switch, a
|
|
337
|
+
* deployment whose recorder bundle was never built, an application
|
|
338
|
+
* somebody switched off and a Redis outage were all "enabled: false" and
|
|
339
|
+
* nothing else, and no amount of dashboard configuration fixes three of
|
|
340
|
+
* them.
|
|
341
|
+
*
|
|
342
|
+
* This is a closed vocabulary carrying no project data - it is answered
|
|
343
|
+
* only to a request already bearing a valid ingestion key for that
|
|
344
|
+
* project, and it says strictly less than the Dashboard's own ingest
|
|
345
|
+
* status endpoint already shows the same customer.
|
|
346
|
+
*/
|
|
347
|
+
export enum SessionReplayDisabledReason {
|
|
348
|
+
/* SESSION_REPLAY_INGEST_ENABLED=false on this deployment. */
|
|
349
|
+
IngestDisabled = "ingest-disabled",
|
|
350
|
+
|
|
351
|
+
/* SESSION_REPLAY_ENABLED_BY_DEFAULT=false on this deployment. */
|
|
352
|
+
DisabledByDefault = "disabled-by-default",
|
|
353
|
+
|
|
354
|
+
/*
|
|
355
|
+
* No published recorder artifact. The build never ran, or its output is
|
|
356
|
+
* not where the server looks for it - overwhelmingly the answer on a
|
|
357
|
+
* self-hosted install where replay has never worked at all.
|
|
358
|
+
*/
|
|
359
|
+
RecorderNotBuilt = "recorder-not-built",
|
|
360
|
+
|
|
361
|
+
/* The policy lookup threw. Fail closed, and say that it failed. */
|
|
362
|
+
PolicyUnavailable = "policy-unavailable",
|
|
363
|
+
|
|
364
|
+
/*
|
|
365
|
+
* No policy for this project/application pair: the application is
|
|
366
|
+
* switched off, the project is not allowed replay, the identifier does
|
|
367
|
+
* not match one, or a kill key is set.
|
|
368
|
+
*/
|
|
369
|
+
NotEnabledForApplication = "not-enabled-for-application",
|
|
370
|
+
}
|
|
371
|
+
|
|
330
372
|
/*
|
|
331
373
|
* Policy snapshot handed to the recorder at startup. This endpoint is
|
|
332
374
|
* what makes every server-side privacy control reachable by a live
|
|
333
|
-
* recorder
|
|
375
|
+
* recorder - without it, flipping a masking setting would never take
|
|
334
376
|
* effect in a browser that already loaded.
|
|
335
377
|
*/
|
|
336
378
|
export interface SessionReplayConfigResponse {
|
|
@@ -415,6 +457,25 @@ export interface SessionReplayConfigResponse {
|
|
|
415
457
|
configEpoch: number;
|
|
416
458
|
|
|
417
459
|
directive: SessionReplayDirective;
|
|
460
|
+
|
|
461
|
+
/*
|
|
462
|
+
* Set only alongside enabled:false. Optional on the wire like every
|
|
463
|
+
* other field added after v1: an older recorder ignores it, a newer one
|
|
464
|
+
* logs it, and neither breaks.
|
|
465
|
+
*/
|
|
466
|
+
disabledReason?: SessionReplayDisabledReason;
|
|
467
|
+
|
|
468
|
+
/*
|
|
469
|
+
* Ask every recorder that reads this policy to print its decisions to
|
|
470
|
+
* the browser console (SESSION_REPLAY_DEBUG on the deployment).
|
|
471
|
+
*
|
|
472
|
+
* The switch of last resort, and the only one an operator can reach
|
|
473
|
+
* without editing a page they do not own: the per-browser localStorage
|
|
474
|
+
* and query-string switches need somebody at that browser. It is off by
|
|
475
|
+
* default and must stay that way - a RUM script logging on every visitor
|
|
476
|
+
* of every customer is noise on somebody else's site.
|
|
477
|
+
*/
|
|
478
|
+
debug?: boolean;
|
|
418
479
|
}
|
|
419
480
|
|
|
420
481
|
/* Response to a chunk POST. Deliberately tiny. */
|
|
@@ -7,6 +7,7 @@ import React, {
|
|
|
7
7
|
useState,
|
|
8
8
|
} from "react";
|
|
9
9
|
import InBetween from "../../../Types/BaseDatabase/InBetween";
|
|
10
|
+
import OneUptimeDate from "../../../Types/Date";
|
|
10
11
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
11
12
|
import RangeStartAndEndDateTime, {
|
|
12
13
|
RangeStartAndEndDateTimeUtil,
|
|
@@ -54,12 +55,15 @@ export const TIME_RANGE_PRESET_OPTIONS: Array<TimeRangePickerPresetOption> = [
|
|
|
54
55
|
{ range: TimeRange.PAST_THREE_MONTHS, label: "Past 3 Months" },
|
|
55
56
|
];
|
|
56
57
|
|
|
58
|
+
/*
|
|
59
|
+
* Both ends of a custom window are written the way the user's machine writes
|
|
60
|
+
* times: on its 12- or 24-hour clock, in the timezone they configured. Reading
|
|
61
|
+
* the digits off the Date itself - which is what this used to do - pinned the
|
|
62
|
+
* label to a 24-hour clock in whatever zone the browser process happened to be
|
|
63
|
+
* in, so a machine set to AM/PM still got "Mar 1, 14:30" back.
|
|
64
|
+
*/
|
|
57
65
|
function formatDateShort(date: Date): string {
|
|
58
|
-
|
|
59
|
-
const day: number = date.getDate();
|
|
60
|
-
const hours: string = date.getHours().toString().padStart(2, "0");
|
|
61
|
-
const minutes: string = date.getMinutes().toString().padStart(2, "0");
|
|
62
|
-
return `${month} ${day}, ${hours}:${minutes}`;
|
|
66
|
+
return OneUptimeDate.getDateAsLocalShortDateTimeString(date);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
export function getTimeRangeButtonLabel(
|
|
@@ -175,7 +175,11 @@ const severityWeight: Record<string, number> = {
|
|
|
175
175
|
trace: 1,
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
/*
|
|
179
|
+
* Exported so the window it reports can be unit-tested directly - rendering the
|
|
180
|
+
* whole viewer to read one sentence is not worth the setup.
|
|
181
|
+
*/
|
|
182
|
+
export function getEmptyMessageWithTimeRange(
|
|
179
183
|
timeRange: RangeStartAndEndDateTime | undefined,
|
|
180
184
|
): string {
|
|
181
185
|
if (!timeRange) {
|
|
@@ -185,13 +189,14 @@ function getEmptyMessageWithTimeRange(
|
|
|
185
189
|
if (timeRange.range === TimeRange.CUSTOM && timeRange.startAndEndDate) {
|
|
186
190
|
const startDate: Date = timeRange.startAndEndDate.startValue;
|
|
187
191
|
const endDate: Date = timeRange.startAndEndDate.endValue;
|
|
192
|
+
/*
|
|
193
|
+
* Same shape, clock and timezone as the label on the picker button that
|
|
194
|
+
* set this window - pinning en-US here handed a US viewer AM/PM even on a
|
|
195
|
+
* 24-hour machine, and read the digits in the browser's zone rather than
|
|
196
|
+
* the one configured in User Settings.
|
|
197
|
+
*/
|
|
188
198
|
const fmt: (d: Date) => string = (d: Date): string => {
|
|
189
|
-
return
|
|
190
|
-
month: "short",
|
|
191
|
-
day: "numeric",
|
|
192
|
-
hour: "2-digit",
|
|
193
|
-
minute: "2-digit",
|
|
194
|
-
});
|
|
199
|
+
return OneUptimeDate.getDateAsLocalShortDateTimeString(d);
|
|
195
200
|
};
|
|
196
201
|
|
|
197
202
|
return `Time range: ${fmt(startDate)} – ${fmt(endDate)}. Try adjusting filters or expanding the time range.`;
|
|
@@ -28,26 +28,27 @@ function formatTooltipTime(label: string | undefined): string {
|
|
|
28
28
|
return label;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
31
|
+
const use12HourFormat: boolean = OneUptimeDate.getUserPrefers12HourFormat();
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* Today's buckets need no date on them - the explorer's own range picker
|
|
35
|
+
* already says which day is on screen. "Today" has to be decided in the
|
|
36
|
+
* configured timezone, or buckets either side of midnight there get the
|
|
37
|
+
* date added and dropped a few hours off.
|
|
38
|
+
*/
|
|
39
|
+
if (
|
|
40
|
+
OneUptimeDate.areOnTheSameLocalDay(date, OneUptimeDate.getCurrentDate())
|
|
41
|
+
) {
|
|
42
|
+
return OneUptimeDate.getLocalTimeString(date, {
|
|
43
|
+
includeSeconds: true,
|
|
44
|
+
use12HourFormat,
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
return OneUptimeDate.getDateAsLocalShortDateTimeString(date, {
|
|
49
|
+
includeSeconds: true,
|
|
50
|
+
use12HourFormat,
|
|
48
51
|
});
|
|
49
|
-
|
|
50
|
-
return `${dateStr}, ${time}`;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
const HistogramTooltip: FunctionComponent<HistogramTooltipProps> = (
|
|
@@ -134,17 +134,32 @@ function pivotTimeseriesData(rows: Array<AnalyticsTimeseriesRow>): {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
function formatTickTime(time: string): string {
|
|
137
|
+
export function formatTickTime(time: string): string {
|
|
138
138
|
const date: Date = OneUptimeDate.fromString(time);
|
|
139
139
|
|
|
140
140
|
if (isNaN(date.getTime())) {
|
|
141
141
|
return time;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
return OneUptimeDate.getLocalTimeString(date, {
|
|
145
|
+
use12HourFormat: OneUptimeDate.getUserPrefers12HourFormat(),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** The bucket a tooltip is pointing at, dated because it can be any day in the window. */
|
|
150
|
+
export function formatTooltipLabel(label: string | undefined): string {
|
|
151
|
+
if (!label) {
|
|
152
|
+
return "";
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const date: Date = OneUptimeDate.fromString(label);
|
|
156
|
+
|
|
157
|
+
if (isNaN(date.getTime())) {
|
|
158
|
+
return label;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return OneUptimeDate.getDateAsLocalShortDateTimeString(date, {
|
|
162
|
+
use12HourFormat: OneUptimeDate.getUserPrefers12HourFormat(),
|
|
148
163
|
});
|
|
149
164
|
}
|
|
150
165
|
|
|
@@ -234,32 +249,10 @@ const AnalyticsTooltip: FunctionComponent<AnalyticsTooltipProps> = (
|
|
|
234
249
|
0,
|
|
235
250
|
);
|
|
236
251
|
|
|
237
|
-
const formatTime: (label: string | undefined) => string = (
|
|
238
|
-
label: string | undefined,
|
|
239
|
-
): string => {
|
|
240
|
-
if (!label) {
|
|
241
|
-
return "";
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
const date: Date = OneUptimeDate.fromString(label);
|
|
245
|
-
|
|
246
|
-
if (isNaN(date.getTime())) {
|
|
247
|
-
return label;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return date.toLocaleString([], {
|
|
251
|
-
month: "short",
|
|
252
|
-
day: "numeric",
|
|
253
|
-
hour: "2-digit",
|
|
254
|
-
minute: "2-digit",
|
|
255
|
-
hour12: false,
|
|
256
|
-
});
|
|
257
|
-
};
|
|
258
|
-
|
|
259
252
|
return (
|
|
260
253
|
<div className="rounded-lg border border-gray-200/80 bg-white/95 px-3.5 py-2.5 shadow-lg backdrop-blur-sm">
|
|
261
254
|
<p className="mb-2 border-b border-gray-100 pb-2 font-mono text-[11px] font-medium text-gray-400">
|
|
262
|
-
{
|
|
255
|
+
{formatTooltipLabel(props.label)}
|
|
263
256
|
</p>
|
|
264
257
|
<div className="space-y-1">
|
|
265
258
|
{entries.map((entry: { key: string; value: number; color: string }) => {
|
|
@@ -68,10 +68,8 @@ function formatTickTime(time: string): string {
|
|
|
68
68
|
return time;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
minute: "2-digit",
|
|
74
|
-
hour12: false,
|
|
71
|
+
return OneUptimeDate.getLocalTimeString(date, {
|
|
72
|
+
use12HourFormat: OneUptimeDate.getUserPrefers12HourFormat(),
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
|
|
@@ -73,10 +73,8 @@ function formatTickTime(time: string): string {
|
|
|
73
73
|
return time;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
minute: "2-digit",
|
|
79
|
-
hour12: false,
|
|
76
|
+
return OneUptimeDate.getLocalTimeString(date, {
|
|
77
|
+
use12HourFormat: OneUptimeDate.getUserPrefers12HourFormat(),
|
|
80
78
|
});
|
|
81
79
|
}
|
|
82
80
|
|
|
@@ -34,26 +34,27 @@ function formatTooltipTime(label: string | undefined): string {
|
|
|
34
34
|
return label;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const
|
|
38
|
-
const isToday: boolean = date.toDateString() === now.toDateString();
|
|
37
|
+
const use12HourFormat: boolean = OneUptimeDate.getUserPrefers12HourFormat();
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
/*
|
|
40
|
+
* Today's buckets need no date on them - the explorer's own range picker
|
|
41
|
+
* already says which day is on screen. "Today" has to be decided in the
|
|
42
|
+
* configured timezone, or buckets either side of midnight there get the
|
|
43
|
+
* date added and dropped a few hours off.
|
|
44
|
+
*/
|
|
45
|
+
if (
|
|
46
|
+
OneUptimeDate.areOnTheSameLocalDay(date, OneUptimeDate.getCurrentDate())
|
|
47
|
+
) {
|
|
48
|
+
return OneUptimeDate.getLocalTimeString(date, {
|
|
49
|
+
includeSeconds: true,
|
|
50
|
+
use12HourFormat,
|
|
51
|
+
});
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
return OneUptimeDate.getDateAsLocalShortDateTimeString(date, {
|
|
55
|
+
includeSeconds: true,
|
|
56
|
+
use12HourFormat,
|
|
54
57
|
});
|
|
55
|
-
|
|
56
|
-
return `${dateStr}, ${time}`;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
const TelemetryHistogramTooltip: FunctionComponent<
|