@oneuptime/common 11.7.2 → 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/AnalyticsModels/KubernetesCostAllocation.ts +103 -0
- 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/TableView.ts +40 -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/1785241000000-AddColumnsToTableView.ts +13 -0
- 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 +10 -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/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -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/JSONFunctions.test.ts +103 -1
- 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/BaseModelTableColumnCustomization.test.tsx +679 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +999 -0
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -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/Tests/Utils/UserPreferences.test.ts +563 -0
- package/Types/Date.ts +15 -6
- package/Types/JSONFunctions.ts +7 -2
- package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
- 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/MasterPage/MasterPage.tsx +65 -0
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +503 -71
- package/UI/Components/ModelTable/Column.ts +17 -0
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +523 -0
- package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
- package/UI/Components/ModelTable/TableView.tsx +24 -2
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/SideMenu/SideMenu.tsx +24 -4
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/Table/Table.tsx +14 -1
- package/UI/Components/Table/TableRow.tsx +180 -175
- package/UI/Components/Table/Types/Column.ts +2 -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/Utils/UserPreferences.ts +53 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
- 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/TableView.js +40 -0
- package/build/dist/Models/DatabaseModels/TableView.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/1785241000000-AddColumnsToTableView.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
- 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 +10 -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/JSONFunctions.js +8 -3
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.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/MasterPage/MasterPage.js +50 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.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 +308 -40
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +230 -0
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
- 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/SideMenu/SideMenu.js +15 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- 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/Table/Table.js +15 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +11 -6
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- 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/build/dist/Utils/UserPreferences.js +33 -0
- package/build/dist/Utils/UserPreferences.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import InBetween from "../../../Types/BaseDatabase/InBetween";
|
|
2
|
+
import RollingTime from "../../../Types/RollingTime/RollingTime";
|
|
3
|
+
import RollingTimeUtil from "../../../Types/RollingTime/RollingTimeUtil";
|
|
4
|
+
|
|
5
|
+
const MINUTE_MS: number = 60 * 1000;
|
|
6
|
+
const HOUR_MS: number = 60 * MINUTE_MS;
|
|
7
|
+
const DAY_MS: number = 24 * HOUR_MS;
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Expected window length (endDate - startDate) for each RollingTime value.
|
|
11
|
+
*
|
|
12
|
+
* Minute/hour windows use OneUptimeDate.addRemove{Minutes,Hours}, which shift
|
|
13
|
+
* by an exact number of milliseconds, so a tight ±2s tolerance (for the two
|
|
14
|
+
* separate getCurrentDate() calls) is enough.
|
|
15
|
+
*
|
|
16
|
+
* Day windows use addRemoveDays, which is calendar-aware: a window that spans
|
|
17
|
+
* a daylight-saving transition is one wall-clock hour longer or shorter than
|
|
18
|
+
* N*24h. Those entries therefore allow an extra ±1h of tolerance.
|
|
19
|
+
*
|
|
20
|
+
* Note: RollingTime.Past1Hours is intentionally "Past 1 Day" (its display
|
|
21
|
+
* string), so it maps to a one-day window, not a one-hour window.
|
|
22
|
+
*/
|
|
23
|
+
const EXACT_TOLERANCE_MS: number = 2000;
|
|
24
|
+
const DST_TOLERANCE_MS: number = HOUR_MS + 2000;
|
|
25
|
+
|
|
26
|
+
const EXPECTED_SPAN_MS: Array<{
|
|
27
|
+
rollingTime: RollingTime;
|
|
28
|
+
spanMs: number;
|
|
29
|
+
toleranceMs: number;
|
|
30
|
+
}> = [
|
|
31
|
+
{
|
|
32
|
+
rollingTime: RollingTime.Past1Minute,
|
|
33
|
+
spanMs: MINUTE_MS,
|
|
34
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
rollingTime: RollingTime.Past5Minutes,
|
|
38
|
+
spanMs: 5 * MINUTE_MS,
|
|
39
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
rollingTime: RollingTime.Past10Minutes,
|
|
43
|
+
spanMs: 10 * MINUTE_MS,
|
|
44
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
rollingTime: RollingTime.Past15Minutes,
|
|
48
|
+
spanMs: 15 * MINUTE_MS,
|
|
49
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
rollingTime: RollingTime.Past30Minutes,
|
|
53
|
+
spanMs: 30 * MINUTE_MS,
|
|
54
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
rollingTime: RollingTime.Past1Hour,
|
|
58
|
+
spanMs: HOUR_MS,
|
|
59
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
rollingTime: RollingTime.Past2Hours,
|
|
63
|
+
spanMs: 2 * HOUR_MS,
|
|
64
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
rollingTime: RollingTime.Past3Hours,
|
|
68
|
+
spanMs: 3 * HOUR_MS,
|
|
69
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
rollingTime: RollingTime.Past6Hours,
|
|
73
|
+
spanMs: 6 * HOUR_MS,
|
|
74
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
rollingTime: RollingTime.Past12Hours,
|
|
78
|
+
spanMs: 12 * HOUR_MS,
|
|
79
|
+
toleranceMs: EXACT_TOLERANCE_MS,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
rollingTime: RollingTime.Past1Hours,
|
|
83
|
+
spanMs: DAY_MS,
|
|
84
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
rollingTime: RollingTime.Past2Days,
|
|
88
|
+
spanMs: 2 * DAY_MS,
|
|
89
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
rollingTime: RollingTime.Past3Days,
|
|
93
|
+
spanMs: 3 * DAY_MS,
|
|
94
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
rollingTime: RollingTime.Past7Days,
|
|
98
|
+
spanMs: 7 * DAY_MS,
|
|
99
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
rollingTime: RollingTime.Past14Days,
|
|
103
|
+
spanMs: 14 * DAY_MS,
|
|
104
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
rollingTime: RollingTime.Past30Days,
|
|
108
|
+
spanMs: 30 * DAY_MS,
|
|
109
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
rollingTime: RollingTime.Past60Days,
|
|
113
|
+
spanMs: 60 * DAY_MS,
|
|
114
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
rollingTime: RollingTime.Past90Days,
|
|
118
|
+
spanMs: 90 * DAY_MS,
|
|
119
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
rollingTime: RollingTime.Past180Days,
|
|
123
|
+
spanMs: 180 * DAY_MS,
|
|
124
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
rollingTime: RollingTime.Past365Days,
|
|
128
|
+
spanMs: 365 * DAY_MS,
|
|
129
|
+
toleranceMs: DST_TOLERANCE_MS,
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
describe("RollingTimeUtil", () => {
|
|
134
|
+
describe("getDefault", () => {
|
|
135
|
+
test("defaults to the past 1 minute", () => {
|
|
136
|
+
expect(RollingTimeUtil.getDefault()).toBe(RollingTime.Past1Minute);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
describe("convertToStartAndEndDate", () => {
|
|
141
|
+
test("returns an InBetween whose end is at (or after) its start", () => {
|
|
142
|
+
const window: InBetween<Date> = RollingTimeUtil.convertToStartAndEndDate(
|
|
143
|
+
RollingTime.Past1Hour,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
expect(window).toBeInstanceOf(InBetween);
|
|
147
|
+
expect(window.endValue.getTime()).toBeGreaterThanOrEqual(
|
|
148
|
+
window.startValue.getTime(),
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test.each(EXPECTED_SPAN_MS)(
|
|
153
|
+
"produces the expected window length for $rollingTime",
|
|
154
|
+
({
|
|
155
|
+
rollingTime,
|
|
156
|
+
spanMs,
|
|
157
|
+
toleranceMs,
|
|
158
|
+
}: {
|
|
159
|
+
rollingTime: RollingTime;
|
|
160
|
+
spanMs: number;
|
|
161
|
+
toleranceMs: number;
|
|
162
|
+
}) => {
|
|
163
|
+
const window: InBetween<Date> =
|
|
164
|
+
RollingTimeUtil.convertToStartAndEndDate(rollingTime);
|
|
165
|
+
|
|
166
|
+
const actualSpanMs: number =
|
|
167
|
+
window.endValue.getTime() - window.startValue.getTime();
|
|
168
|
+
|
|
169
|
+
expect(actualSpanMs).toBeGreaterThanOrEqual(spanMs - toleranceMs);
|
|
170
|
+
expect(actualSpanMs).toBeLessThanOrEqual(spanMs + toleranceMs);
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
test("Past1Hours maps to a full day, not an hour (its display string is 'Past 1 Day')", () => {
|
|
175
|
+
const window: InBetween<Date> = RollingTimeUtil.convertToStartAndEndDate(
|
|
176
|
+
RollingTime.Past1Hours,
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const actualSpanMs: number =
|
|
180
|
+
window.endValue.getTime() - window.startValue.getTime();
|
|
181
|
+
|
|
182
|
+
expect(actualSpanMs).toBeGreaterThan(HOUR_MS);
|
|
183
|
+
expect(actualSpanMs).toBeGreaterThanOrEqual(DAY_MS - 2000);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
|
2
|
+
import {
|
|
3
|
+
AGENT_CLAIM_TIMEOUT_BOUNDS,
|
|
4
|
+
NON_NUMERIC_TIMEOUT_MESSAGE,
|
|
5
|
+
willTimeoutBeClamped,
|
|
6
|
+
DEFAULT_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
7
|
+
DEFAULT_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
8
|
+
MAX_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
9
|
+
MAX_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
10
|
+
MIN_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
11
|
+
MIN_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
12
|
+
STEP_EXECUTION_TIMEOUT_BOUNDS,
|
|
13
|
+
TimeoutBounds,
|
|
14
|
+
getTimeoutValidationError,
|
|
15
|
+
resolveAgentClaimTimeoutInMs,
|
|
16
|
+
resolveStepExecutionTimeoutInMs,
|
|
17
|
+
resolveTimeoutInMs,
|
|
18
|
+
secondsInputValueToTimeoutInMs,
|
|
19
|
+
timeoutInMsToSecondsInputValue,
|
|
20
|
+
} from "../../../Types/Runbook/RunbookStepTimeout";
|
|
21
|
+
|
|
22
|
+
describe("Runbook step timeout bounds", () => {
|
|
23
|
+
test("documented defaults stay put — the docs promise 30s execution and 2m claim", () => {
|
|
24
|
+
expect(DEFAULT_STEP_EXECUTION_TIMEOUT_IN_MS).toBe(30_000);
|
|
25
|
+
expect(DEFAULT_AGENT_CLAIM_TIMEOUT_IN_MS).toBe(120_000);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("each bound set is internally consistent: min <= default <= max", () => {
|
|
29
|
+
const boundSets: Array<TimeoutBounds> = [
|
|
30
|
+
STEP_EXECUTION_TIMEOUT_BOUNDS,
|
|
31
|
+
AGENT_CLAIM_TIMEOUT_BOUNDS,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
for (const bounds of boundSets) {
|
|
35
|
+
expect(bounds.minInMs).toBeLessThanOrEqual(bounds.defaultInMs);
|
|
36
|
+
expect(bounds.defaultInMs).toBeLessThanOrEqual(bounds.maxInMs);
|
|
37
|
+
expect(bounds.minInMs).toBeGreaterThan(0);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("the exported bound objects mirror the individual constants", () => {
|
|
42
|
+
expect(STEP_EXECUTION_TIMEOUT_BOUNDS).toEqual({
|
|
43
|
+
defaultInMs: DEFAULT_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
44
|
+
minInMs: MIN_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
45
|
+
maxInMs: MAX_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
46
|
+
});
|
|
47
|
+
expect(AGENT_CLAIM_TIMEOUT_BOUNDS).toEqual({
|
|
48
|
+
defaultInMs: DEFAULT_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
49
|
+
minInMs: MIN_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
50
|
+
maxInMs: MAX_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe("resolveTimeoutInMs", () => {
|
|
56
|
+
const bounds: TimeoutBounds = {
|
|
57
|
+
defaultInMs: 30_000,
|
|
58
|
+
minInMs: 1_000,
|
|
59
|
+
maxInMs: 60_000,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
test("a value inside the range is used as configured", () => {
|
|
63
|
+
expect(resolveTimeoutInMs(45_000, bounds)).toBe(45_000);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("the boundaries themselves are accepted, not clamped away", () => {
|
|
67
|
+
expect(resolveTimeoutInMs(bounds.minInMs, bounds)).toBe(bounds.minInMs);
|
|
68
|
+
expect(resolveTimeoutInMs(bounds.maxInMs, bounds)).toBe(bounds.maxInMs);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("unset values fall back to the default", () => {
|
|
72
|
+
expect(resolveTimeoutInMs(undefined, bounds)).toBe(30_000);
|
|
73
|
+
expect(resolveTimeoutInMs(null, bounds)).toBe(30_000);
|
|
74
|
+
expect(resolveTimeoutInMs("", bounds)).toBe(30_000);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test("zero and negatives fall back to the default rather than disabling the timeout", () => {
|
|
78
|
+
expect(resolveTimeoutInMs(0, bounds)).toBe(30_000);
|
|
79
|
+
expect(resolveTimeoutInMs(-1, bounds)).toBe(30_000);
|
|
80
|
+
expect(resolveTimeoutInMs(-999_999, bounds)).toBe(30_000);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("junk values fall back to the default instead of throwing", () => {
|
|
84
|
+
expect(resolveTimeoutInMs(NaN, bounds)).toBe(30_000);
|
|
85
|
+
expect(resolveTimeoutInMs(Infinity, bounds)).toBe(30_000);
|
|
86
|
+
expect(resolveTimeoutInMs(-Infinity, bounds)).toBe(30_000);
|
|
87
|
+
expect(resolveTimeoutInMs("not a number", bounds)).toBe(30_000);
|
|
88
|
+
expect(resolveTimeoutInMs({} as unknown as number, bounds)).toBe(30_000);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test("numeric strings are accepted — JSON step configs are not type-checked at rest", () => {
|
|
92
|
+
expect(resolveTimeoutInMs("5000", bounds)).toBe(5_000);
|
|
93
|
+
expect(resolveTimeoutInMs(" 5000 ", bounds)).toBe(5_000);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("values below the minimum are raised to the minimum", () => {
|
|
97
|
+
expect(resolveTimeoutInMs(1, bounds)).toBe(1_000);
|
|
98
|
+
expect(resolveTimeoutInMs(999, bounds)).toBe(1_000);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test("values above the maximum are capped so one step cannot pin a Worker slot open", () => {
|
|
102
|
+
expect(resolveTimeoutInMs(60_001, bounds)).toBe(60_000);
|
|
103
|
+
expect(resolveTimeoutInMs(Number.MAX_SAFE_INTEGER, bounds)).toBe(60_000);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test("fractional milliseconds are rounded to whole milliseconds", () => {
|
|
107
|
+
expect(resolveTimeoutInMs(5_000.4, bounds)).toBe(5_000);
|
|
108
|
+
expect(resolveTimeoutInMs(5_000.6, bounds)).toBe(5_001);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("a fractional value below the minimum still lands on the minimum", () => {
|
|
112
|
+
expect(resolveTimeoutInMs(0.5, bounds)).toBe(1_000);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe("resolveStepExecutionTimeoutInMs", () => {
|
|
117
|
+
test("defaults to 30 seconds when unset", () => {
|
|
118
|
+
expect(resolveStepExecutionTimeoutInMs(undefined)).toBe(
|
|
119
|
+
DEFAULT_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test("honours a configured value", () => {
|
|
124
|
+
expect(resolveStepExecutionTimeoutInMs(5 * 60_000)).toBe(300_000);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("clamps to the execution bounds", () => {
|
|
128
|
+
expect(resolveStepExecutionTimeoutInMs(1)).toBe(
|
|
129
|
+
MIN_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
130
|
+
);
|
|
131
|
+
expect(resolveStepExecutionTimeoutInMs(999 * 60 * 60_000)).toBe(
|
|
132
|
+
MAX_STEP_EXECUTION_TIMEOUT_IN_MS,
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe("resolveAgentClaimTimeoutInMs", () => {
|
|
138
|
+
test("defaults to 2 minutes when unset", () => {
|
|
139
|
+
expect(resolveAgentClaimTimeoutInMs(undefined)).toBe(
|
|
140
|
+
DEFAULT_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test("honours a configured value", () => {
|
|
145
|
+
expect(resolveAgentClaimTimeoutInMs(10 * 60_000)).toBe(600_000);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test("clamps to the claim bounds", () => {
|
|
149
|
+
expect(resolveAgentClaimTimeoutInMs(10)).toBe(
|
|
150
|
+
MIN_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
151
|
+
);
|
|
152
|
+
expect(resolveAgentClaimTimeoutInMs(Number.MAX_SAFE_INTEGER)).toBe(
|
|
153
|
+
MAX_AGENT_CLAIM_TIMEOUT_IN_MS,
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test("execution and claim timeouts are resolved independently", () => {
|
|
158
|
+
/*
|
|
159
|
+
* A 45 minute execution timeout is legal; the same number as a claim
|
|
160
|
+
* timeout is also legal. Resolving one must not leak the other's bounds.
|
|
161
|
+
*/
|
|
162
|
+
expect(resolveStepExecutionTimeoutInMs(45 * 60_000)).toBe(2_700_000);
|
|
163
|
+
expect(resolveAgentClaimTimeoutInMs(45 * 60_000)).toBe(2_700_000);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe("timeoutInMsToSecondsInputValue", () => {
|
|
168
|
+
test("milliseconds render as seconds", () => {
|
|
169
|
+
expect(timeoutInMsToSecondsInputValue(30_000)).toBe("30");
|
|
170
|
+
expect(timeoutInMsToSecondsInputValue(120_000)).toBe("120");
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test("unset values render as an empty field, which reads as 'use the default'", () => {
|
|
174
|
+
expect(timeoutInMsToSecondsInputValue(undefined)).toBe("");
|
|
175
|
+
expect(timeoutInMsToSecondsInputValue(null)).toBe("");
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test("zero and negatives render as empty rather than as a literal 0", () => {
|
|
179
|
+
expect(timeoutInMsToSecondsInputValue(0)).toBe("");
|
|
180
|
+
expect(timeoutInMsToSecondsInputValue(-5_000)).toBe("");
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test("non-numeric values render as empty", () => {
|
|
184
|
+
expect(timeoutInMsToSecondsInputValue(NaN)).toBe("");
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test("sub-second values keep their decimal instead of collapsing to 0", () => {
|
|
188
|
+
expect(timeoutInMsToSecondsInputValue(500)).toBe("0.5");
|
|
189
|
+
expect(timeoutInMsToSecondsInputValue(1_500)).toBe("1.5");
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
describe("secondsInputValueToTimeoutInMs", () => {
|
|
194
|
+
test("seconds are stored as milliseconds", () => {
|
|
195
|
+
expect(secondsInputValueToTimeoutInMs("30")).toBe(30_000);
|
|
196
|
+
expect(secondsInputValueToTimeoutInMs("120")).toBe(120_000);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("a blank field means unset, not zero", () => {
|
|
200
|
+
expect(secondsInputValueToTimeoutInMs("")).toBeUndefined();
|
|
201
|
+
expect(secondsInputValueToTimeoutInMs(" ")).toBeUndefined();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test("zero, negatives and junk mean unset", () => {
|
|
205
|
+
expect(secondsInputValueToTimeoutInMs("0")).toBeUndefined();
|
|
206
|
+
expect(secondsInputValueToTimeoutInMs("-5")).toBeUndefined();
|
|
207
|
+
expect(secondsInputValueToTimeoutInMs("abc")).toBeUndefined();
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("decimals are converted to whole milliseconds", () => {
|
|
211
|
+
expect(secondsInputValueToTimeoutInMs("0.5")).toBe(500);
|
|
212
|
+
expect(secondsInputValueToTimeoutInMs("1.25")).toBe(1_250);
|
|
213
|
+
expect(secondsInputValueToTimeoutInMs("0.001")).toBe(1);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test("input that rounds down to zero milliseconds reports as unset, not as 0", () => {
|
|
217
|
+
/*
|
|
218
|
+
* A literal 0 in the step config would mean nothing — every consumer
|
|
219
|
+
* treats it as "unset" anyway, so it must not be written in the first
|
|
220
|
+
* place.
|
|
221
|
+
*/
|
|
222
|
+
expect(secondsInputValueToTimeoutInMs("0.0004")).toBeUndefined();
|
|
223
|
+
expect(secondsInputValueToTimeoutInMs("0.00001")).toBeUndefined();
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test("never returns a value that resolution would treat as unusable", () => {
|
|
227
|
+
const inputs: Array<string> = [
|
|
228
|
+
"",
|
|
229
|
+
"0",
|
|
230
|
+
"-1",
|
|
231
|
+
"abc",
|
|
232
|
+
"0.0004",
|
|
233
|
+
"0.5",
|
|
234
|
+
"1",
|
|
235
|
+
"30",
|
|
236
|
+
"99999",
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
for (const input of inputs) {
|
|
240
|
+
const result: number | undefined = secondsInputValueToTimeoutInMs(input);
|
|
241
|
+
if (result !== undefined) {
|
|
242
|
+
expect(result).toBeGreaterThan(0);
|
|
243
|
+
expect(isFinite(result)).toBe(true);
|
|
244
|
+
expect(Number.isInteger(result)).toBe(true);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("surrounding whitespace is tolerated", () => {
|
|
250
|
+
expect(secondsInputValueToTimeoutInMs(" 45 ")).toBe(45_000);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test("round-trips with the seconds renderer", () => {
|
|
254
|
+
const values: Array<number> = [1_000, 30_000, 120_000, 500, 3_600_000];
|
|
255
|
+
|
|
256
|
+
for (const ms of values) {
|
|
257
|
+
expect(
|
|
258
|
+
secondsInputValueToTimeoutInMs(timeoutInMsToSecondsInputValue(ms)),
|
|
259
|
+
).toBe(ms);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
describe("getTimeoutValidationError", () => {
|
|
265
|
+
const bounds: TimeoutBounds = {
|
|
266
|
+
defaultInMs: 30_000,
|
|
267
|
+
minInMs: 1_000,
|
|
268
|
+
maxInMs: 3_600_000,
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
test("a blank field is valid — it means 'use the default'", () => {
|
|
272
|
+
expect(getTimeoutValidationError("", bounds)).toBeNull();
|
|
273
|
+
expect(getTimeoutValidationError(" ", bounds)).toBeNull();
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("in-range values are valid", () => {
|
|
277
|
+
expect(getTimeoutValidationError("30", bounds)).toBeNull();
|
|
278
|
+
expect(getTimeoutValidationError("1", bounds)).toBeNull();
|
|
279
|
+
expect(getTimeoutValidationError("3600", bounds)).toBeNull();
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
test("non-numeric input is rejected", () => {
|
|
283
|
+
expect(getTimeoutValidationError("abc", bounds)).toBe(
|
|
284
|
+
NON_NUMERIC_TIMEOUT_MESSAGE,
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
test("zero and negatives are rejected", () => {
|
|
289
|
+
expect(getTimeoutValidationError("0", bounds)).toContain("greater than 0");
|
|
290
|
+
expect(getTimeoutValidationError("-3", bounds)).toContain("greater than 0");
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
test("input that rounds down to zero milliseconds is rejected as zero, not as below-minimum", () => {
|
|
294
|
+
/*
|
|
295
|
+
* It falls back to the default rather than being clamped up to the
|
|
296
|
+
* minimum, so telling the author "minimum is 1 second" would describe the
|
|
297
|
+
* wrong outcome.
|
|
298
|
+
*/
|
|
299
|
+
expect(getTimeoutValidationError("0.0004", bounds)).toContain(
|
|
300
|
+
"greater than 0",
|
|
301
|
+
);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
test("below-minimum values report the minimum", () => {
|
|
305
|
+
expect(getTimeoutValidationError("0.5", bounds)).toContain("Minimum is 1");
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
test("above-maximum values report the maximum", () => {
|
|
309
|
+
expect(getTimeoutValidationError("3601", bounds)).toContain("Maximum is");
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
test("the minimum message is singular for a one-second floor", () => {
|
|
313
|
+
expect(getTimeoutValidationError("0.5", bounds)).toBe(
|
|
314
|
+
"Minimum is 1 second.",
|
|
315
|
+
);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test("the minimum message is plural for a multi-second floor", () => {
|
|
319
|
+
expect(
|
|
320
|
+
getTimeoutValidationError("1", {
|
|
321
|
+
defaultInMs: 30_000,
|
|
322
|
+
minInMs: 5_000,
|
|
323
|
+
maxInMs: 60_000,
|
|
324
|
+
}),
|
|
325
|
+
).toBe("Minimum is 5 seconds.");
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
test("anything the validator accepts survives resolution unchanged", () => {
|
|
329
|
+
/*
|
|
330
|
+
* The editor's guard rails and the Worker's clamp have to agree: an input
|
|
331
|
+
* the UI calls valid must not be silently rewritten at run time.
|
|
332
|
+
*/
|
|
333
|
+
const acceptedInputs: Array<string> = ["1", "30", "120", "600", "3600"];
|
|
334
|
+
|
|
335
|
+
for (const input of acceptedInputs) {
|
|
336
|
+
expect(getTimeoutValidationError(input, bounds)).toBeNull();
|
|
337
|
+
const inMs: number | undefined = secondsInputValueToTimeoutInMs(input);
|
|
338
|
+
expect(resolveTimeoutInMs(inMs, bounds)).toBe(inMs);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("the clamp predicate agrees with what resolution actually does", () => {
|
|
343
|
+
/*
|
|
344
|
+
* The editor tells the author which of two things will happen to a rejected
|
|
345
|
+
* value: clamped into range, or dropped for the default. That copy is only
|
|
346
|
+
* trustworthy if the predicate matches the resolver, so check both against
|
|
347
|
+
* the resolver's real output.
|
|
348
|
+
*/
|
|
349
|
+
const inputs: Array<string> = [
|
|
350
|
+
"",
|
|
351
|
+
"0",
|
|
352
|
+
"-5",
|
|
353
|
+
"abc",
|
|
354
|
+
"0.0004",
|
|
355
|
+
"0.5",
|
|
356
|
+
"1",
|
|
357
|
+
"30",
|
|
358
|
+
"3600",
|
|
359
|
+
"3601",
|
|
360
|
+
"99999",
|
|
361
|
+
];
|
|
362
|
+
|
|
363
|
+
for (const input of inputs) {
|
|
364
|
+
const inMs: number | undefined = secondsInputValueToTimeoutInMs(input);
|
|
365
|
+
const resolved: number = resolveTimeoutInMs(inMs, bounds);
|
|
366
|
+
const clampPredicted: boolean = willTimeoutBeClamped(input, bounds);
|
|
367
|
+
|
|
368
|
+
if (clampPredicted) {
|
|
369
|
+
// Claimed clamped: the value was usable and moved to a bound.
|
|
370
|
+
expect(inMs).not.toBeUndefined();
|
|
371
|
+
expect(resolved).not.toBe(inMs);
|
|
372
|
+
expect([bounds.minInMs, bounds.maxInMs]).toContain(resolved);
|
|
373
|
+
} else if (inMs === undefined) {
|
|
374
|
+
// Claimed default: resolution really does hand back the default.
|
|
375
|
+
expect(resolved).toBe(bounds.defaultInMs);
|
|
376
|
+
} else {
|
|
377
|
+
// Neither: the value was in range and survived untouched.
|
|
378
|
+
expect(resolved).toBe(inMs);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
test("in-range and unusable values are not advertised as clamped", () => {
|
|
384
|
+
expect(willTimeoutBeClamped("", bounds)).toBe(false);
|
|
385
|
+
expect(willTimeoutBeClamped("0", bounds)).toBe(false);
|
|
386
|
+
expect(willTimeoutBeClamped("abc", bounds)).toBe(false);
|
|
387
|
+
expect(willTimeoutBeClamped("0.0004", bounds)).toBe(false);
|
|
388
|
+
expect(willTimeoutBeClamped("30", bounds)).toBe(false);
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
test("usable out-of-range values are advertised as clamped", () => {
|
|
392
|
+
expect(willTimeoutBeClamped("0.5", bounds)).toBe(true);
|
|
393
|
+
expect(willTimeoutBeClamped("3601", bounds)).toBe(true);
|
|
394
|
+
expect(willTimeoutBeClamped("99999", bounds)).toBe(true);
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
test("anything the validator rejects is still made safe by resolution", () => {
|
|
398
|
+
const rejectedInputs: Array<string> = ["0", "-10", "abc", "0.5", "999999"];
|
|
399
|
+
|
|
400
|
+
for (const input of rejectedInputs) {
|
|
401
|
+
expect(getTimeoutValidationError(input, bounds)).not.toBeNull();
|
|
402
|
+
const resolved: number = resolveTimeoutInMs(
|
|
403
|
+
secondsInputValueToTimeoutInMs(input),
|
|
404
|
+
bounds,
|
|
405
|
+
);
|
|
406
|
+
expect(resolved).toBeGreaterThanOrEqual(bounds.minInMs);
|
|
407
|
+
expect(resolved).toBeLessThanOrEqual(bounds.maxInMs);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
});
|