@oneuptime/common 11.7.3 → 11.7.4
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/AlertEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/AlertStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
- package/Models/DatabaseModels/Index.ts +5 -0
- package/Models/DatabaseModels/LogDropFilter.ts +89 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +13 -3
- package/Models/DatabaseModels/RecommendationDismissal.ts +463 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
- package/Models/DatabaseModels/StatusPageGroup.ts +95 -0
- package/Models/DatabaseModels/TraceDropFilter.ts +89 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +5 -1
- package/Server/API/AlertAPI.ts +32 -17
- package/Server/API/BaseAPI.ts +31 -2
- package/Server/API/BaseAnalyticsAPI.ts +36 -2
- package/Server/API/CommonAPI.ts +57 -0
- package/Server/API/IncidentAPI.ts +60 -33
- package/Server/API/IncidentEpisodeAPI.ts +31 -16
- package/Server/API/MonitorAPI.ts +30 -0
- package/Server/API/MonitorTemplateAPI.ts +8 -0
- package/Server/API/ProbeAPI.ts +196 -15
- package/Server/API/ProjectAPI.ts +79 -1
- package/Server/API/ScheduledMaintenanceAPI.ts +33 -18
- package/Server/API/StatusPageAPI.ts +74 -37
- package/Server/API/WorkspaceNotificationRuleAPI.ts +34 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.ts +527 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.ts +55 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/AlertEpisodeService.ts +47 -0
- package/Server/Services/AlertService.ts +125 -0
- package/Server/Services/BillingService.ts +98 -0
- package/Server/Services/DatabaseService.ts +184 -20
- package/Server/Services/IncidentEpisodeService.ts +47 -0
- package/Server/Services/IncidentService.ts +123 -0
- package/Server/Services/IncidentTemplateService.ts +123 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LogDropFilterService.ts +133 -0
- package/Server/Services/MonitorProbeService.ts +94 -4
- package/Server/Services/MonitorService.ts +48 -43
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +70 -0
- package/Server/Services/ProbeService.ts +66 -0
- package/Server/Services/ProjectService.ts +131 -7
- package/Server/Services/RecommendationDismissalService.ts +52 -0
- package/Server/Services/RunbookAgentJobService.ts +68 -7
- package/Server/Services/ScheduledMaintenanceService.ts +103 -0
- package/Server/Services/ScheduledMaintenanceTemplateService.ts +90 -0
- package/Server/Services/StatusPageGroupService.ts +186 -0
- package/Server/Services/TraceDropFilterService.ts +133 -0
- package/Server/Types/Workflow/Components/API/Delete.ts +12 -0
- package/Server/Types/Workflow/Components/API/Get.ts +12 -0
- package/Server/Types/Workflow/Components/API/Patch.ts +12 -0
- package/Server/Types/Workflow/Components/API/Post.ts +12 -0
- package/Server/Types/Workflow/Components/API/Put.ts +13 -0
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +212 -0
- package/Server/Utils/DropFilterValidation.ts +127 -0
- package/Server/Utils/Errors.ts +5 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +31 -2
- package/Server/Utils/Telemetry/AppMetrics.ts +31 -0
- package/Tests/Models/DatabaseModels/MonitorProbeColumnAccessControl.test.ts +196 -0
- package/Tests/Models/RecommendationDismissalModel.test.ts +269 -0
- package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +320 -0
- package/Tests/Server/API/BaseAnalyticsAPIUpdatePayloadValidation.test.ts +293 -0
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +164 -0
- package/Tests/Server/API/ProbeAPI.test.ts +422 -53
- package/Tests/Server/API/ProjectAPI.test.ts +180 -0
- package/Tests/Server/API/ProjectAPIExtendTrialBillingDisabled.test.ts +138 -0
- package/Tests/Server/API/ProjectScopedCustomRouteAuth.test.ts +458 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +359 -0
- package/Tests/Server/Infrastructure/ProcessSignalDelivery.test.ts +427 -0
- package/Tests/Server/Services/BillingServiceExtendTrial.test.ts +439 -0
- package/Tests/Server/Services/CrossProjectReferenceWriteGuard.test.ts +810 -0
- package/Tests/Server/Services/DatabaseServiceAtomicAddToColumns.test.ts +269 -0
- package/Tests/Server/Services/DatabaseServiceEmptyUpdate.test.ts +277 -0
- package/Tests/Server/Services/DatabaseServiceSortColumnSelect.test.ts +201 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +81 -23
- package/Tests/Server/Services/DropFilterSaveValidation.test.ts +398 -0
- package/Tests/Server/Services/MonitorProbeDeleteHooks.test.ts +280 -0
- package/Tests/Server/Services/MonitorProbeServiceProbeTenancy.test.ts +304 -0
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +262 -0
- package/Tests/Server/Services/ProjectServiceExtendTrial.test.ts +614 -0
- package/Tests/Server/Services/RecommendationDismissalService.test.ts +306 -0
- package/Tests/Server/Services/RepairCrossProjectIncidentReferencesMigration.test.ts +528 -0
- package/Tests/Server/Services/StatusPageGroupNesting.test.ts +395 -0
- package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +26 -21
- package/Tests/Server/Types/Database/Permissions/WorkflowVariableColumnPermission.test.ts +227 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +285 -0
- package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +463 -0
- package/Tests/Server/Utils/DropFilterValidation.test.ts +269 -0
- package/Tests/Server/Utils/Telemetry/SpanUtil.test.ts +94 -0
- package/Tests/Types/DateUserTimezone.test.ts +52 -0
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +177 -9
- package/Tests/Types/Monitor/MonitorStepDnsMonitor.test.ts +105 -0
- package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +131 -0
- package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +60 -0
- package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +82 -0
- package/Tests/Types/Monitor/MonitorStepInfrastructureMonitors.test.ts +268 -0
- package/Tests/Types/Monitor/MonitorStepMetricMonitor.test.ts +386 -0
- package/Tests/Types/Monitor/MonitorStepProfileMonitor.test.ts +185 -0
- package/Tests/Types/Monitor/MonitorStepSnmpMonitor.test.ts +156 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +371 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +901 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +607 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +754 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +960 -0
- package/Tests/Types/RollingTime/RollingTimeUtil.test.ts +186 -0
- package/Tests/Types/Runbook/RunbookStepTimeout.test.ts +410 -0
- package/Tests/Types/Telemetry/DropFilterSampling.test.ts +241 -0
- package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +353 -0
- package/Tests/Types/Workspace/NotificationRuleUtil.test.ts +566 -0
- package/Tests/UI/Components/CodeEditor.test.tsx +174 -0
- package/Tests/UI/Components/ErrorBoundary.test.tsx +555 -24
- package/Tests/UI/Components/InfoCard.test.tsx +358 -0
- package/Tests/UI/Components/LogTimeRangePicker.test.tsx +138 -0
- package/Tests/UI/Components/Modal.test.tsx +43 -5
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +427 -0
- package/Tests/UI/Components/Runbook/StepTimeoutInput.test.tsx +386 -0
- package/Tests/UI/Components/StatusPage/ResourceGroupSection.test.tsx +671 -0
- package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +404 -0
- package/Tests/UI/Utils/DropdownAlignment.test.ts +306 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +292 -0
- package/Tests/Utils/Monitor/MonitorSummaryProbeUtil.test.ts +263 -0
- package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +583 -0
- package/Tests/Utils/StatusPage/GroupNestingLayout.test.ts +1072 -0
- package/Tests/Utils/StatusPage/GroupTree.test.ts +583 -0
- package/Tests/Utils/StatusPage/ResourceUptime.test.ts +411 -0
- package/Types/Date.ts +15 -6
- package/Types/Monitor/KubernetesAlertTemplates.ts +205 -0
- package/Types/Monitor/MonitorStep.ts +10 -1
- package/Types/Monitor/MonitorStepMetricMonitor.ts +46 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +413 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +168 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +175 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +743 -0
- package/Types/Permission.ts +45 -0
- package/Types/Recommendation/RecommendationType.ts +20 -0
- package/Types/Runbook/RunbookExecutionDeadline.ts +129 -0
- package/Types/Runbook/RunbookStepTimeout.ts +202 -0
- package/Types/Telemetry/DropFilterSampling.ts +92 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +0 -2
- package/UI/Components/Accordion/Accordion.tsx +10 -2
- package/UI/Components/BulkUpdate/BulkLabelActions.tsx +0 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +34 -20
- package/UI/Components/Date/RangeStartAndEndDateView.tsx +0 -1
- package/UI/Components/EditionLabel/EditionLabel.tsx +1 -27
- package/UI/Components/Error/PageError.tsx +0 -4
- package/UI/Components/ErrorBoundary.tsx +252 -15
- package/UI/Components/InfoCard/InfoCard.tsx +58 -1
- package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +34 -1
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +116 -67
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +150 -47
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +34 -1
- package/UI/Utils/DropdownAlignment.ts +162 -0
- package/UI/Utils/TableFilterUrlState.ts +59 -20
- package/Utils/API.ts +106 -2
- package/Utils/Monitor/MonitorSummaryProbeUtil.ts +130 -0
- package/Utils/NetworkDiscovery/ScanTargetUtil.ts +434 -0
- package/Utils/StatusPage/GroupNestingLayout.ts +343 -0
- package/Utils/StatusPage/GroupTree.ts +307 -0
- package/Utils/StatusPage/ResourceUptime.ts +90 -17
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +14 -4
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js +484 -0
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js +94 -0
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +5 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +22 -13
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +22 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +24 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +42 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +43 -26
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +21 -12
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorAPI.js +23 -0
- package/build/dist/Server/API/MonitorAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorTemplateAPI.js +4 -0
- package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -1
- package/build/dist/Server/API/ProbeAPI.js +131 -15
- package/build/dist/Server/API/ProbeAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectAPI.js +62 -3
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +23 -14
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +61 -33
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js +26 -2
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js +397 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +39 -0
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +95 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +71 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +140 -17
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +39 -0
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +100 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +97 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LogDropFilterService.js +93 -0
- package/build/dist/Server/Services/LogDropFilterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +73 -5
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +34 -39
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +64 -0
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +103 -7
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RecommendationDismissalService.js +50 -0
- package/build/dist/Server/Services/RecommendationDismissalService.js.map +1 -0
- package/build/dist/Server/Services/RunbookAgentJobService.js +63 -5
- package/build/dist/Server/Services/RunbookAgentJobService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +83 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js +65 -0
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageGroupService.js +136 -0
- package/build/dist/Server/Services/StatusPageGroupService.js.map +1 -1
- package/build/dist/Server/Services/TraceDropFilterService.js +93 -0
- package/build/dist/Server/Services/TraceDropFilterService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +12 -0
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +132 -0
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -0
- package/build/dist/Server/Utils/DropFilterValidation.js +80 -0
- package/build/dist/Server/Utils/DropFilterValidation.js.map +1 -0
- package/build/dist/Server/Utils/Errors.js +3 -0
- package/build/dist/Server/Utils/Errors.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +30 -12
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +38 -18
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +26 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Types/Date.js +14 -4
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +192 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -1
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js +32 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +294 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +110 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +58 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +451 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -0
- package/build/dist/Types/Permission.js +40 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Recommendation/RecommendationType.js +21 -0
- package/build/dist/Types/Recommendation/RecommendationType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js +93 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js +142 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js.map +1 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js +75 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js.map +1 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -2
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Accordion/Accordion.js +9 -2
- package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +27 -14
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +2 -20
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/Error/PageError.js +1 -3
- package/build/dist/UI/Components/Error/PageError.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +145 -11
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +28 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +4 -32
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +69 -33
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +73 -32
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -1
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js +101 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js.map +1 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js +73 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Utils/DropdownAlignment.js +98 -0
- package/build/dist/UI/Utils/DropdownAlignment.js.map +1 -0
- package/build/dist/UI/Utils/TableFilterUrlState.js +48 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/Utils/API.js +39 -2
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js +97 -0
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +330 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js +280 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupTree.js +214 -0
- package/build/dist/Utils/StatusPage/GroupTree.js.map +1 -0
- package/build/dist/Utils/StatusPage/ResourceUptime.js +60 -16
- package/build/dist/Utils/StatusPage/ResourceUptime.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import ProjectAPI from "../../../Server/API/ProjectAPI";
|
|
2
|
+
import MasterAdminAuthorization from "../../../Server/Middleware/MasterAdminAuthorization";
|
|
3
|
+
import UserMiddleware from "../../../Server/Middleware/UserAuthorization";
|
|
4
|
+
import JSONWebToken from "../../../Server/Utils/JsonWebToken";
|
|
2
5
|
import BillingService from "../../../Server/Services/BillingService";
|
|
3
6
|
import ProjectService from "../../../Server/Services/ProjectService";
|
|
4
7
|
import TeamMemberService from "../../../Server/Services/TeamMemberService";
|
|
@@ -307,4 +310,181 @@ describe("ProjectAPI", () => {
|
|
|
307
310
|
);
|
|
308
311
|
});
|
|
309
312
|
});
|
|
313
|
+
|
|
314
|
+
describe("PUT /project/:id/extend-trial", () => {
|
|
315
|
+
const projectId: ObjectID = ObjectID.generate();
|
|
316
|
+
|
|
317
|
+
beforeEach(() => {
|
|
318
|
+
ProjectService.extendTrial = jest.fn().mockResolvedValue(undefined);
|
|
319
|
+
mockRequest.params = { id: projectId.toString() };
|
|
320
|
+
|
|
321
|
+
/*
|
|
322
|
+
* Response is module-mocked once for the whole file, so its call log
|
|
323
|
+
* carries over from the change-plan tests above.
|
|
324
|
+
*/
|
|
325
|
+
(Response.sendEmptySuccessResponse as jest.Mock).mockClear();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it("should sit behind the master admin middleware", () => {
|
|
329
|
+
/*
|
|
330
|
+
* Extending a trial hands out free service across any project, so it
|
|
331
|
+
* must not be reachable with project-level billing permissions - and not
|
|
332
|
+
* with the static master API key either, only a master admin session.
|
|
333
|
+
*/
|
|
334
|
+
expect(
|
|
335
|
+
mockRouter.match("put", "/project/:id/extend-trial").middleware,
|
|
336
|
+
).toBe(MasterAdminAuthorization.isAuthorizedMasterAdminMiddleware);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it("should extend the trial and respond with an empty success response", async () => {
|
|
340
|
+
const trialEndsAt: string = "2027-01-15T00:00:00.000Z";
|
|
341
|
+
mockRequest.body = { data: { trialEndsAt } };
|
|
342
|
+
|
|
343
|
+
await mockRouter
|
|
344
|
+
.match("put", "/project/:id/extend-trial")
|
|
345
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
346
|
+
|
|
347
|
+
expect(nextFunction).not.toHaveBeenCalled();
|
|
348
|
+
expect(ProjectService.extendTrial).toHaveBeenCalledWith({
|
|
349
|
+
projectId: projectId,
|
|
350
|
+
trialEndsAt: new Date(trialEndsAt),
|
|
351
|
+
});
|
|
352
|
+
expect(Response.sendEmptySuccessResponse).toHaveBeenCalledWith(
|
|
353
|
+
mockRequest,
|
|
354
|
+
mockResponse,
|
|
355
|
+
);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it("should work without a tenant id, since master admins act across projects", async () => {
|
|
359
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
360
|
+
delete (mockRequest as { tenantId?: ObjectID }).tenantId;
|
|
361
|
+
|
|
362
|
+
await mockRouter
|
|
363
|
+
.match("put", "/project/:id/extend-trial")
|
|
364
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
365
|
+
|
|
366
|
+
expect(nextFunction).not.toHaveBeenCalled();
|
|
367
|
+
expect(ProjectService.extendTrial).toHaveBeenCalled();
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
it("should reject when trialEndsAt is missing", async () => {
|
|
371
|
+
mockRequest.body = { data: {} };
|
|
372
|
+
|
|
373
|
+
await mockRouter
|
|
374
|
+
.match("put", "/project/:id/extend-trial")
|
|
375
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
376
|
+
|
|
377
|
+
expect(nextFunction).toHaveBeenCalledWith(
|
|
378
|
+
new BadDataException("Trial end date is required to extend the trial"),
|
|
379
|
+
);
|
|
380
|
+
expect(ProjectService.extendTrial).not.toHaveBeenCalled();
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it("should reject when the body has no data object", async () => {
|
|
384
|
+
mockRequest.body = {};
|
|
385
|
+
|
|
386
|
+
await mockRouter
|
|
387
|
+
.match("put", "/project/:id/extend-trial")
|
|
388
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
389
|
+
|
|
390
|
+
expect(nextFunction).toHaveBeenCalledWith(
|
|
391
|
+
new BadDataException("Trial end date is required to extend the trial"),
|
|
392
|
+
);
|
|
393
|
+
expect(ProjectService.extendTrial).not.toHaveBeenCalled();
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it("should reject when trialEndsAt is not a parseable date", async () => {
|
|
397
|
+
mockRequest.body = { data: { trialEndsAt: "not-a-date" } };
|
|
398
|
+
|
|
399
|
+
await mockRouter
|
|
400
|
+
.match("put", "/project/:id/extend-trial")
|
|
401
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
402
|
+
|
|
403
|
+
expect(nextFunction).toHaveBeenCalledWith(
|
|
404
|
+
new BadDataException("Trial end date is not a valid date"),
|
|
405
|
+
);
|
|
406
|
+
expect(ProjectService.extendTrial).not.toHaveBeenCalled();
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it("should reject a non-string trialEndsAt", async () => {
|
|
410
|
+
/*
|
|
411
|
+
* OneUptimeDate.fromString hands back its own error text rather than a
|
|
412
|
+
* Date for a non-string, which would sail past an isNaN check.
|
|
413
|
+
*/
|
|
414
|
+
for (const value of [12345, { year: 2027 }, ["2027-01-15"], true]) {
|
|
415
|
+
(nextFunction as jest.Mock).mockClear();
|
|
416
|
+
mockRequest.body = { data: { trialEndsAt: value } };
|
|
417
|
+
|
|
418
|
+
await mockRouter
|
|
419
|
+
.match("put", "/project/:id/extend-trial")
|
|
420
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
421
|
+
|
|
422
|
+
expect(nextFunction).toHaveBeenCalledWith(
|
|
423
|
+
new BadDataException("Trial end date is not a valid date"),
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
expect(ProjectService.extendTrial).not.toHaveBeenCalled();
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
it("should record which master admin granted the extension", async () => {
|
|
431
|
+
const adminUserId: ObjectID = ObjectID.generate();
|
|
432
|
+
|
|
433
|
+
jest
|
|
434
|
+
.spyOn(UserMiddleware, "getAccessTokenFromExpressRequest")
|
|
435
|
+
.mockReturnValue("a-master-admin-token");
|
|
436
|
+
jest.spyOn(JSONWebToken, "decode").mockReturnValue({
|
|
437
|
+
userId: adminUserId,
|
|
438
|
+
} as JSONWebTokenData);
|
|
439
|
+
|
|
440
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
441
|
+
|
|
442
|
+
await mockRouter
|
|
443
|
+
.match("put", "/project/:id/extend-trial")
|
|
444
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
445
|
+
|
|
446
|
+
expect(ProjectService.extendTrial).toHaveBeenCalledWith(
|
|
447
|
+
expect.objectContaining({ extendedByUserId: adminUserId }),
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
it("should still extend when the acting admin cannot be resolved", async () => {
|
|
452
|
+
/*
|
|
453
|
+
* The identity is only used for the audit log line - the middleware has
|
|
454
|
+
* already authorized the request, so a decode failure must not block it.
|
|
455
|
+
*/
|
|
456
|
+
jest
|
|
457
|
+
.spyOn(UserMiddleware, "getAccessTokenFromExpressRequest")
|
|
458
|
+
.mockImplementation(() => {
|
|
459
|
+
throw new Error("no cookie on this request");
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
463
|
+
|
|
464
|
+
await mockRouter
|
|
465
|
+
.match("put", "/project/:id/extend-trial")
|
|
466
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
467
|
+
|
|
468
|
+
expect(nextFunction).not.toHaveBeenCalled();
|
|
469
|
+
expect(ProjectService.extendTrial).toHaveBeenCalledWith(
|
|
470
|
+
expect.objectContaining({ extendedByUserId: undefined }),
|
|
471
|
+
);
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
it("should forward service errors to next", async () => {
|
|
475
|
+
const serviceError: BadDataException = new BadDataException(
|
|
476
|
+
"Payment Provider subscription not found",
|
|
477
|
+
);
|
|
478
|
+
|
|
479
|
+
ProjectService.extendTrial = jest.fn().mockRejectedValue(serviceError);
|
|
480
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
481
|
+
|
|
482
|
+
await mockRouter
|
|
483
|
+
.match("put", "/project/:id/extend-trial")
|
|
484
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
485
|
+
|
|
486
|
+
expect(nextFunction).toHaveBeenCalledWith(serviceError);
|
|
487
|
+
expect(Response.sendEmptySuccessResponse).not.toHaveBeenCalled();
|
|
488
|
+
});
|
|
489
|
+
});
|
|
310
490
|
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import ProjectAPI from "../../../Server/API/ProjectAPI";
|
|
2
|
+
import ProjectService from "../../../Server/Services/ProjectService";
|
|
3
|
+
import {
|
|
4
|
+
NextFunction,
|
|
5
|
+
OneUptimeRequest,
|
|
6
|
+
OneUptimeResponse,
|
|
7
|
+
} from "../../../Server/Utils/Express";
|
|
8
|
+
import { mockRouter } from "./Helpers";
|
|
9
|
+
import { describe, expect, it } from "@jest/globals";
|
|
10
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
11
|
+
import OneUptimeDate from "../../../Types/Date";
|
|
12
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* The self-hosted path. ProjectAPI.test.ts module-mocks IsBillingEnabled to
|
|
16
|
+
* true for its whole file, so the billing-disabled behaviour needs its own
|
|
17
|
+
* module registry - hence a separate test file rather than another describe.
|
|
18
|
+
*
|
|
19
|
+
* Self-hosted installs have no payment provider and no trials, so both the
|
|
20
|
+
* route and the service must refuse rather than half-apply anything.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
jest.mock("../../../Server/EnvironmentConfig", () => {
|
|
24
|
+
return {
|
|
25
|
+
...jest.requireActual("../../../Server/EnvironmentConfig"),
|
|
26
|
+
IsBillingEnabled: false,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
jest.mock("../../../Server/Services/BillingService");
|
|
31
|
+
|
|
32
|
+
jest.mock("../../../Server/Utils/Express", () => {
|
|
33
|
+
return {
|
|
34
|
+
getRouter: () => {
|
|
35
|
+
return mockRouter;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
jest.mock("../../../Server/Utils/Response", () => {
|
|
41
|
+
return {
|
|
42
|
+
sendEntityArrayResponse: jest.fn(),
|
|
43
|
+
sendJsonObjectResponse: jest.fn(),
|
|
44
|
+
sendEmptySuccessResponse: jest.fn(),
|
|
45
|
+
sendEntityResponse: jest.fn(),
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
jest.mock("../../../Server/Services/TeamMemberService");
|
|
50
|
+
jest.mock("../../../Server/Services/ProjectService");
|
|
51
|
+
|
|
52
|
+
describe("Extend trial when billing is disabled", () => {
|
|
53
|
+
const billingDisabledError: BadDataException = new BadDataException(
|
|
54
|
+
"Billing is not enabled for this server",
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
let mockRequest: OneUptimeRequest;
|
|
58
|
+
let mockResponse: OneUptimeResponse;
|
|
59
|
+
let nextFunction: NextFunction;
|
|
60
|
+
|
|
61
|
+
beforeEach(() => {
|
|
62
|
+
new ProjectAPI();
|
|
63
|
+
mockRequest = {} as OneUptimeRequest;
|
|
64
|
+
mockResponse = {
|
|
65
|
+
send: jest.fn(),
|
|
66
|
+
json: jest.fn(),
|
|
67
|
+
status: jest.fn().mockReturnThis(),
|
|
68
|
+
} as unknown as OneUptimeResponse;
|
|
69
|
+
nextFunction = jest.fn();
|
|
70
|
+
|
|
71
|
+
ProjectService.extendTrial = jest.fn().mockResolvedValue(undefined);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
afterEach(() => {
|
|
75
|
+
jest.restoreAllMocks();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe("PUT /project/:id/extend-trial", () => {
|
|
79
|
+
it("should reject the request", async () => {
|
|
80
|
+
mockRequest.params = { id: ObjectID.generate().toString() };
|
|
81
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
82
|
+
|
|
83
|
+
await mockRouter
|
|
84
|
+
.match("put", "/project/:id/extend-trial")
|
|
85
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
86
|
+
|
|
87
|
+
expect(nextFunction).toHaveBeenCalledWith(billingDisabledError);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("should not reach the service", async () => {
|
|
91
|
+
mockRequest.params = { id: ObjectID.generate().toString() };
|
|
92
|
+
mockRequest.body = { data: { trialEndsAt: "2027-01-15T00:00:00.000Z" } };
|
|
93
|
+
|
|
94
|
+
await mockRouter
|
|
95
|
+
.match("put", "/project/:id/extend-trial")
|
|
96
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
97
|
+
|
|
98
|
+
expect(ProjectService.extendTrial).not.toHaveBeenCalled();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("should reject before validating the request body", async () => {
|
|
102
|
+
/*
|
|
103
|
+
* A self-hosted admin poking the endpoint should be told billing is off,
|
|
104
|
+
* not that their date is malformed.
|
|
105
|
+
*/
|
|
106
|
+
mockRequest.params = { id: ObjectID.generate().toString() };
|
|
107
|
+
mockRequest.body = {};
|
|
108
|
+
|
|
109
|
+
await mockRouter
|
|
110
|
+
.match("put", "/project/:id/extend-trial")
|
|
111
|
+
.handlerFunction(mockRequest, mockResponse, nextFunction);
|
|
112
|
+
|
|
113
|
+
expect(nextFunction).toHaveBeenCalledWith(billingDisabledError);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe("ProjectService.extendTrial", () => {
|
|
118
|
+
it("should refuse to extend a trial", async () => {
|
|
119
|
+
/*
|
|
120
|
+
* The real service, not the auto-mock: this asserts the guard inside
|
|
121
|
+
* ProjectService itself, so the endpoint is not the only thing standing
|
|
122
|
+
* between a self-hosted install and a payment-provider call.
|
|
123
|
+
*/
|
|
124
|
+
const realProjectService: typeof ProjectService = (
|
|
125
|
+
jest.requireActual("../../../Server/Services/ProjectService") as {
|
|
126
|
+
default: typeof ProjectService;
|
|
127
|
+
}
|
|
128
|
+
).default;
|
|
129
|
+
|
|
130
|
+
await expect(
|
|
131
|
+
realProjectService.extendTrial({
|
|
132
|
+
projectId: ObjectID.generate(),
|
|
133
|
+
trialEndsAt: OneUptimeDate.getSomeDaysAfter(30),
|
|
134
|
+
}),
|
|
135
|
+
).rejects.toThrow("Billing is not enabled for this server");
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
});
|