@oneuptime/common 12.0.31 → 12.0.33
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/Span.ts +14 -0
- package/Models/DatabaseModels/AlertState.ts +0 -2
- package/Models/DatabaseModels/Domain.ts +1 -1
- package/Models/DatabaseModels/EnterpriseLicense.ts +56 -0
- package/Models/DatabaseModels/Incident.ts +1 -1
- package/Models/DatabaseModels/IncidentTemplate.ts +1 -1
- package/Models/DatabaseModels/Index.ts +12 -0
- package/Models/DatabaseModels/MetricType.ts +0 -2
- package/Models/DatabaseModels/Monitor.ts +76 -0
- package/Models/DatabaseModels/MonitorStatusTimeline.ts +0 -2
- package/Models/DatabaseModels/MonitorTest.ts +0 -2
- package/Models/DatabaseModels/NetworkAlertPolicy.ts +690 -0
- package/Models/DatabaseModels/NetworkDevice.ts +297 -3
- package/Models/DatabaseModels/NetworkDeviceOidTemplate.ts +3 -1
- package/Models/DatabaseModels/NetworkDeviceRole.ts +648 -0
- package/Models/DatabaseModels/NetworkSite.ts +201 -2
- package/Models/DatabaseModels/NetworkSiteType.ts +102 -3
- package/Models/DatabaseModels/NetworkSnmpCredentialProfile.ts +841 -0
- package/Models/DatabaseModels/ScheduledMaintenance.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +0 -2
- package/Models/DatabaseModels/StatusPageAnnouncementTemplate.ts +0 -2
- package/Models/DatabaseModels/StatusPagePrivateUser.ts +0 -2
- package/Models/DatabaseModels/StatusPageResource.ts +0 -2
- package/Models/DatabaseModels/StatusPageSubscriber.ts +0 -2
- package/Models/DatabaseModels/TelemetryException.ts +119 -0
- package/Models/DatabaseModels/UserNotificationEmailRollupBatch.ts +334 -0
- package/Models/DatabaseModels/UserNotificationEmailRollupItem.ts +370 -0
- package/Models/DatabaseModels/UserNotificationEmailRollupSetting.ts +282 -0
- package/Server/API/EnterpriseLicenseAPI.ts +391 -64
- package/Server/API/LlmProviderAPI.ts +137 -22
- package/Server/EnvironmentConfig.ts +14 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790700000000-AddNetworkSiteTypeParentHierarchy.ts +55 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.ts +72 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddEnterpriseLicenseUsageProvenance.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddTelemetryExceptionErrorClass.ts +124 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1791000000000-AddUserNotificationEmailRollup.ts +132 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1791100000000-AddUserNotificationEmailRollupSetting.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1791200000000-AddNetworkSnmpCredentialProfilesAndAlertPolicies.ts +191 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Infrastructure/QueueWorker.ts +38 -8
- package/Server/Middleware/BearerTokenAuthorization.ts +12 -0
- package/Server/Middleware/ProjectAuthorization.ts +11 -0
- package/Server/Middleware/SCIMAuthorization.ts +12 -0
- package/Server/Middleware/TelemetryIngest.ts +11 -0
- package/Server/Services/AIBillingService.ts +101 -27
- package/Server/Services/DatabaseService.ts +39 -9
- package/Server/Services/EnterpriseLicenseInstanceService.ts +197 -0
- package/Server/Services/EnterpriseLicenseService.ts +55 -0
- package/Server/Services/Index.ts +12 -0
- package/Server/Services/MonitorService.ts +143 -21
- package/Server/Services/MonitorStatusTimelineService.ts +150 -8
- package/Server/Services/MonitorTemplateService.ts +217 -1
- package/Server/Services/NetworkAlertPolicyEngineService.ts +2159 -0
- package/Server/Services/NetworkAlertPolicyService.ts +944 -0
- package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +9 -10
- package/Server/Services/NetworkDeviceAutoImportRuleService.ts +60 -15
- package/Server/Services/NetworkDeviceRoleService.ts +90 -0
- package/Server/Services/NetworkDeviceService.ts +1032 -73
- package/Server/Services/NetworkSiteService.ts +1502 -129
- package/Server/Services/NetworkSiteTypeService.ts +1216 -0
- package/Server/Services/NetworkSnmpCredentialProfileService.ts +238 -0
- package/Server/Services/NotificationService.ts +118 -28
- package/Server/Services/ProjectService.ts +186 -44
- package/Server/Services/StatusPagePrivateUserService.ts +103 -3
- package/Server/Services/UserNotificationEmailRollupBatchService.ts +78 -0
- package/Server/Services/UserNotificationEmailRollupItemService.ts +79 -0
- package/Server/Services/UserNotificationEmailRollupSettingService.ts +113 -0
- package/Server/Services/UserNotificationSettingService.ts +62 -31
- package/Server/Services/UserService.ts +95 -0
- package/Server/Types/Database/QueryHelper.ts +2 -2
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +14 -3
- package/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.ts +10 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.ts +10 -0
- package/Server/Utils/AI/SRE/Insights/InsightTriageRunner.ts +62 -1
- package/Server/Utils/AI/Toolbox/AlertTools.ts +15 -1
- package/Server/Utils/Billing/BillingFailureNoticeThrottle.ts +80 -0
- package/Server/Utils/DataSource/HttpFetch.ts +9 -2
- package/Server/Utils/EmailRollup/EmailRollupConstants.ts +98 -0
- package/Server/Utils/EmailRollup/EmailRollupFlushRunner.ts +872 -0
- package/Server/Utils/EmailRollup/EmailRollupRenderer.ts +781 -0
- package/Server/Utils/EmailRollup/EmailRollupWriter.ts +368 -0
- package/Server/Utils/LLM/LLMService.ts +78 -0
- package/Server/Utils/LogRedaction.ts +8 -0
- package/Server/Utils/Logger.ts +79 -1
- package/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.ts +190 -0
- package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +9 -2
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +61 -1
- package/Server/Utils/Monitor/MonitorCriteriaDataExtractor.ts +14 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +49 -0
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +255 -4
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +41 -0
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +43 -0
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +499 -19
- package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +66 -10
- package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +238 -44
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +146 -39
- package/Server/Utils/NetworkDevice/DeviceHealthAggregation.ts +31 -18
- package/Server/Utils/NetworkSite/NetworkSiteHierarchyLock.ts +213 -0
- package/Server/Utils/OutboundUserAgent.ts +152 -0
- package/Server/Utils/StartServer.ts +51 -19
- package/Server/Utils/Telemetry/CaptureSpan.ts +32 -8
- package/Server/Utils/Telemetry/ErrorClassResolver.ts +120 -0
- package/Server/Utils/Telemetry/SpanUtil.ts +33 -0
- package/Server/Utils/Telemetry.ts +198 -51
- package/Server/Views/Partials/SensitiveUrlToken.ejs +140 -0
- package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +158 -27
- package/Tests/App/Dashboard/AskAiSuggestedPrompts.test.ts +279 -0
- package/Tests/App/Dashboard/DashboardChartWidgetZoom.test.tsx +35 -8
- package/Tests/App/Dashboard/DashboardCommandPalette.test.tsx +107 -3
- package/Tests/App/Dashboard/DashboardEditPermissions.test.tsx +517 -0
- package/Tests/App/Dashboard/DashboardVariablesDiscard.test.tsx +26 -0
- package/Tests/App/Dashboard/DashboardWideChartZoom.test.tsx +401 -0
- package/Tests/App/Dashboard/DeviceStatusHero.test.tsx +588 -0
- package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +18 -9
- package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +632 -0
- package/Tests/App/Dashboard/MonitorRecommendationCreateProgress.test.tsx +682 -0
- package/Tests/App/Dashboard/MonitorTemplateColumnAndFacet.test.tsx +318 -0
- package/Tests/App/Dashboard/MonitorTypePicker.test.tsx +4 -2
- package/Tests/App/Dashboard/NetworkDeviceBulkDelete.test.tsx +357 -0
- package/Tests/App/Dashboard/NetworkDeviceCreateFormMonitorBinding.test.tsx +676 -0
- package/Tests/App/Dashboard/NetworkDeviceCreateFormPingMonitor.test.tsx +791 -0
- package/Tests/App/Dashboard/NetworkDeviceCreateFormProbeAndSnmp.test.tsx +833 -0
- package/Tests/App/Dashboard/NetworkDeviceCriteriaFilter.test.ts +161 -0
- package/Tests/App/Dashboard/NetworkDeviceSettingsMonitoringSection.test.tsx +458 -0
- package/Tests/App/Dashboard/NetworkSideMenu.test.tsx +626 -0
- package/Tests/App/Dashboard/PingMonitorProvisioning.test.ts +368 -0
- package/Tests/App/Dashboard/RecommendationCard.test.tsx +796 -0
- package/Tests/App/Dashboard/RecommendationToolbar.test.tsx +519 -0
- package/Tests/App/Dashboard/RecommendationsList.test.tsx +661 -0
- package/Tests/App/Dashboard/SideMenuHarness.tsx +11 -3
- package/Tests/App/Dashboard/UseBulkCreatePingMonitors.test.tsx +899 -0
- package/Tests/App/Dashboard/UseBulkSnmpCredentialProfileActions.test.tsx +732 -0
- package/Tests/App/SensitiveUrlTokenBootstrap.test.ts +256 -0
- package/Tests/App/StatusPage/StatusPageIndexPageRobotsMeta.test.ts +11 -1
- package/Tests/App/StatusPage/StatusPageLoginCodeBootstrap.test.ts +9 -4
- package/Tests/Models/DatabaseModels/ModelRegistryInvariants.test.ts +115 -41
- package/Tests/Models/NetworkSiteHierarchy.test.ts +41 -4
- package/Tests/Server/API/EnterpriseLicenseReportUserCount.test.ts +951 -7
- package/Tests/Server/API/LlmProviderConnectionTest.test.ts +522 -0
- package/Tests/Server/Infrastructure/Postgres/NetworkDeviceRoleTableMigration.test.ts +476 -0
- package/Tests/Server/Infrastructure/Postgres/NetworkSnmpCredentialProfilesAndAlertPoliciesMigration.test.ts +854 -0
- package/Tests/Server/Infrastructure/Postgres/SchemaMigrationsOrdering.test.ts +18 -0
- package/Tests/Server/Infrastructure/Postgres/UserNotificationEmailRollupTableMigration.test.ts +535 -0
- package/Tests/Server/Services/AIChatPrivacyPin.test.ts +560 -0
- package/Tests/Server/Services/BillingRechargeOwnerEmailGuards.test.ts +783 -0
- package/Tests/Server/Services/DatabaseServiceGenerateSlug.test.ts +215 -0
- package/Tests/Server/Services/EnterpriseLicenseInstanceServiceDeletionUsage.test.ts +707 -0
- package/Tests/Server/Services/EnterpriseLicenseServiceUsageAggregationLock.test.ts +329 -0
- package/Tests/Server/Services/MonitorServiceDeleteNetworkDeviceCleanup.test.ts +294 -0
- package/Tests/Server/Services/MonitorStatusBridgeProbePath.test.ts +802 -0
- package/Tests/Server/Services/MonitorStatusTimelineService.test.ts +72 -2
- package/Tests/Server/Services/NetworkAlertPolicyEngineHooks.test.ts +752 -0
- package/Tests/Server/Services/NetworkAlertPolicyEngineService.test.ts +1849 -0
- package/Tests/Server/Services/NetworkAlertPolicyModel.test.ts +1793 -0
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +47 -4
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleService.test.ts +97 -12
- package/Tests/Server/Services/NetworkDeviceAutoMonitorLifecycle.test.ts +148 -3
- package/Tests/Server/Services/NetworkDeviceMonitorBindingUpdateGuard.test.ts +514 -0
- package/Tests/Server/Services/NetworkDeviceMonitorStatusStamp.test.ts +447 -58
- package/Tests/Server/Services/NetworkDeviceMonitoringMethodTransition.test.ts +739 -0
- package/Tests/Server/Services/NetworkDevicePollingTenancy.test.ts +501 -0
- package/Tests/Server/Services/NetworkDeviceRoleModel.test.ts +672 -0
- package/Tests/Server/Services/NetworkDeviceRuleEngines.test.ts +1 -1
- package/Tests/Server/Services/NetworkDeviceSiteDefaultProbe.test.ts +432 -0
- package/Tests/Server/Services/NetworkSiteMonitoringDefaults.test.ts +498 -0
- package/Tests/Server/Services/NetworkSiteRollupPolicyAndMaintenance.test.ts +337 -55
- package/Tests/Server/Services/NetworkSiteService.test.ts +1868 -131
- package/Tests/Server/Services/NetworkSiteTypeService.test.ts +1109 -0
- package/Tests/Server/Services/NetworkSnmpCredentialProfileModel.test.ts +926 -0
- package/Tests/Server/Services/NetworkSnmpCredentialProfileService.test.ts +796 -0
- package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +67 -4
- package/Tests/Server/Services/ProjectServiceNetworkSiteTypeDefaults.test.ts +214 -0
- package/Tests/Server/Services/ScheduledMaintenanceSubscriberEndTime.test.ts +369 -0
- package/Tests/Server/Services/StatusPagePrivateUserEmailChangePasswordResetExpiry.test.ts +269 -0
- package/Tests/Server/Services/UserEmailChangePasswordResetExpiry.test.ts +472 -0
- package/Tests/Server/Services/UserNotificationEmailRollupModels.test.ts +569 -0
- package/Tests/Server/Services/UserNotificationEmailRollupSettingModel.test.ts +314 -0
- package/Tests/Server/Services/UserNotificationEmailRollupSettingService.test.ts +409 -0
- package/Tests/Server/Services/UserNotificationSettingMonitorDefaults.test.ts +248 -0
- package/Tests/Server/Services/UserNotificationSettingRollupRouting.test.ts +856 -0
- package/Tests/Server/Services/UserNotificationSettingWorkspaceChannels.test.ts +145 -3
- package/Tests/Server/Types/Database/Permissions/DashboardAccessPermission.test.ts +321 -0
- package/Tests/Server/Types/Database/QueryHelperOperators.test.ts +17 -0
- package/Tests/Server/Utils/AI/AlertMonitorFilters.test.ts +124 -0
- package/Tests/Server/Utils/AI/Insights/InsightTriageRunner.test.ts +208 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +235 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +253 -0
- package/Tests/Server/Utils/BasicCron.test.ts +283 -0
- package/Tests/Server/Utils/Captcha.test.ts +422 -0
- package/Tests/Server/Utils/DataSource/HttpFetch.test.ts +96 -2
- package/Tests/Server/Utils/Database/MigrationFailureLog.test.ts +466 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupFlushRunnerBehaviour.test.ts +1096 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupFlushRunnerClaim.test.ts +466 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupRenderer.test.ts +1428 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupTestHarness.ts +752 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupWriter.test.ts +864 -0
- package/Tests/Server/Utils/IncomingCallPhoneNumber.test.ts +174 -0
- package/Tests/Server/Utils/LoggerFaultDemotion.test.ts +346 -0
- package/Tests/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.test.ts +633 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +196 -0
- package/Tests/Server/Utils/Monitor/DatabaseMetricWrite.test.ts +367 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +100 -0
- package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +5 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +512 -31
- package/Tests/Server/Utils/Monitor/NetworkDeviceMetricUtil.test.ts +252 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +479 -42
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +351 -5
- package/Tests/Server/Utils/NetworkDevice/DeviceHealthAggregation.test.ts +136 -12
- package/Tests/Server/Utils/NetworkSite/NetworkSiteHierarchyLock.test.ts +306 -0
- package/Tests/Server/Utils/OutboundUserAgent.test.ts +266 -0
- package/Tests/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClientUserAgent.test.ts +141 -0
- package/Tests/Server/Utils/Telemetry/ErrorClassResolver.test.ts +298 -0
- package/Tests/Server/Utils/Telemetry.test.ts +456 -66
- package/Tests/Types/Monitor/DatabaseMetricCatalog.test.ts +388 -0
- package/Tests/Types/Monitor/MonitorStepDatabaseMonitor.test.ts +243 -0
- package/Tests/Types/Monitor/MonitorStepDefaultTelemetryConfig.test.ts +1 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +1 -0
- package/Tests/Types/Monitor/MonitorTypeKeywords.test.ts +16 -7
- package/Tests/Types/Monitor/NetworkDeviceAlertPack.test.ts +60 -0
- package/Tests/Types/NetworkDevice/DefaultNetworkDeviceRole.test.ts +417 -0
- package/Tests/Types/NetworkDevice/NetworkAlertPolicyScope.test.ts +655 -0
- package/Tests/Types/NetworkDevice/NetworkDeviceMonitoringMethod.test.ts +115 -26
- package/Tests/Types/NetworkSite/DefaultNetworkSiteType.test.ts +39 -0
- package/Tests/Types/NotificationSetting/NotificationEmailRollupPolicy.test.ts +299 -0
- package/Tests/Types/Telemetry/ErrorClass.test.ts +483 -0
- package/Tests/UI/Components/BasicRadioButtons.test.tsx +336 -0
- package/Tests/UI/Components/Charts/ChartClickDoubleClickDisambiguation.test.tsx +221 -0
- package/Tests/UI/Components/Charts/ChartDoubleClickReset.test.tsx +220 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +751 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +475 -43
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +89 -0
- package/Tests/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.test.ts +15 -0
- package/Tests/UI/Components/NavBarCommandKGating.test.tsx +103 -8
- package/Tests/UI/Components/ProgressBar.test.tsx +38 -2
- package/Tests/UI/Components/SideMenuItem.test.tsx +256 -4
- package/Tests/UI/Components/SideMenuSection.test.tsx +310 -0
- package/Tests/UI/Components/SideOverSubmitState.test.tsx +335 -0
- package/Tests/UI/Utils/PageScrollLock.test.tsx +377 -0
- package/Tests/UI/Utils/PermissionGate.test.ts +78 -0
- package/Tests/UI/Utils/SensitiveUrlToken.test.ts +140 -0
- package/Tests/UI/Utils/TableColumnsToCsv.test.ts +30 -0
- package/Tests/UI/Utils/UseDashboardTimeRangeZoom.test.tsx +187 -0
- package/Tests/Utils/Dashboard/DashboardResourceListSharedArgs.test.ts +302 -0
- package/Tests/Utils/Dashboard/DashboardTimeRangeZoom.test.ts +242 -0
- package/Tests/Utils/EnterpriseLicenseSeats.test.ts +69 -0
- package/Tests/Utils/EnterpriseLicenseSync.test.ts +7 -1
- package/Tests/Utils/EnterpriseLicenseUsage.test.ts +433 -2
- package/Tests/Utils/Monitor/MonitorMetricType.test.ts +280 -1
- package/Tests/Utils/Monitor/MonitorSummarySnapshotUtil.test.ts +1 -0
- package/Tests/Utils/Monitor/NetworkDeviceRoleCatalog.test.ts +981 -0
- package/Tests/Utils/Monitor/NetworkTopologyRoleCatalog.test.ts +865 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +38 -0
- package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +284 -23
- package/Tests/Utils/NetworkDevice/DeviceReachabilityUtil.test.ts +177 -0
- package/Tests/Utils/NetworkDevice/DeviceRoleKeyUtil.test.ts +538 -0
- package/Tests/Utils/NetworkDevice/MonitoringMethodThreadedClassifiers.test.ts +992 -0
- package/Tests/Utils/NetworkDevice/NetworkAlertPolicyBootstrapUtil.test.ts +427 -0
- package/Tests/Utils/NetworkDevice/ReachabilityStampConsistency.test.ts +185 -0
- package/Tests/Utils/NetworkDevice/SnmpCredentialUtil.test.ts +268 -0
- package/Tests/Utils/NetworkDiscovery/AutoImportRuleMatcher.test.ts +55 -5
- package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +98 -21
- package/Tests/Utils/NetworkDiscovery/DiscoveryImportEligibility.test.ts +98 -20
- package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +8 -7
- package/Tests/Utils/NetworkDiscovery/PingMonitorBuilderForAddress.test.ts +274 -0
- package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +230 -51
- package/Tests/Utils/NetworkSite/TypeHierarchyUtil.test.ts +209 -0
- package/Tests/Utils/Slo/SloEvaluation.test.ts +171 -0
- package/Tests/Utils/Slug.test.ts +61 -1
- package/Tests/Utils/Telemetry/CaptureSpanExportGating.test.ts +145 -0
- package/Tests/jest.setup.ts +19 -0
- package/Types/AI/ExceptionAIClassification.ts +10 -24
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/EnterpriseLicense/EnterpriseLicenseInstanceSummary.ts +5 -0
- package/Types/EnterpriseLicense/EnterpriseLicenseUsageSnapshot.ts +13 -0
- package/Types/EnterpriseLicense/EnterpriseLicenseUserCountSource.ts +6 -0
- package/Types/Exception/ApiException.ts +10 -0
- package/Types/Exception/BadDataException.ts +11 -0
- package/Types/Exception/BadRequestException.ts +11 -0
- package/Types/Exception/Exception.ts +65 -0
- package/Types/Exception/ForbiddenException.ts +10 -0
- package/Types/Exception/NotAuthenticatedException.ts +10 -0
- package/Types/Exception/NotAuthorizedException.ts +10 -0
- package/Types/Exception/NotFoundException.ts +11 -0
- package/Types/Exception/PayloadTooLargeException.ts +11 -0
- package/Types/Exception/PaymentRequiredException.ts +10 -0
- package/Types/Exception/ServiceUnavailableException.ts +10 -0
- package/Types/Exception/SsoAuthorizationException.ts +10 -0
- package/Types/Exception/TenantNotFoundException.ts +11 -0
- package/Types/Exception/TimeoutException.ts +10 -0
- package/Types/Exception/TooManyRequestsException.ts +10 -0
- package/Types/Exception/UnableToReachServer.ts +10 -0
- package/Types/Exception/WebsiteRequestException.ts +10 -0
- package/Types/Monitor/CriteriaFilter.ts +60 -2
- package/Types/Monitor/DatabaseMetricCatalog.ts +693 -0
- package/Types/Monitor/DatabaseMonitor/DatabaseMonitorResponse.ts +83 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +76 -0
- package/Types/Monitor/MonitorMetricType.ts +71 -0
- package/Types/Monitor/MonitorStep.ts +76 -0
- package/Types/Monitor/MonitorStepDatabaseMonitor.ts +171 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +2 -20
- package/Types/Monitor/MonitorType.ts +47 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +22 -1
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +61 -0
- package/Types/Monitor/SqlConnectionConfig.ts +31 -0
- package/Types/NetworkDevice/DefaultNetworkDeviceRole.ts +145 -0
- package/Types/NetworkDevice/NetworkAlertPolicyScope.ts +343 -0
- package/Types/NetworkDevice/NetworkDeviceMonitoringMethod.ts +42 -22
- package/Types/NetworkSite/DefaultNetworkSiteTypeHierarchy.ts +30 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.ts +255 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.ts +104 -0
- package/Types/Permission.ts +135 -0
- package/Types/Probe/ProbeMonitorResponse.ts +16 -0
- package/Types/Telemetry/ErrorClass.ts +274 -0
- package/Types/Telemetry/UnitOfWork.ts +59 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +7 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +6 -0
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +9 -1
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +97 -35
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +14 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +97 -35
- package/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +7 -0
- package/UI/Components/CommandPalette/CommandPalette.tsx +2 -8
- package/UI/Components/EditionLabel/EditionLabel.tsx +4 -0
- package/UI/Components/Modal/Modal.tsx +2 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +50 -15
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +44 -0
- package/UI/Components/Navbar/NavBar.tsx +62 -13
- package/UI/Components/Navbar/NavBarMenuModal.tsx +7 -2
- package/UI/Components/ProgressBar/ProgressBar.tsx +12 -1
- package/UI/Components/RadioButtons/BasicRadioButtons.tsx +37 -7
- package/UI/Components/SideMenu/CountModelSideMenuItem.tsx +2 -0
- package/UI/Components/SideMenu/SideMenu.tsx +135 -7
- package/UI/Components/SideMenu/SideMenuItem.tsx +80 -85
- package/UI/Components/SideMenu/SideMenuSection.tsx +69 -25
- package/UI/Components/SideOver/SideOver.tsx +21 -20
- package/UI/Utils/PageScrollLock.ts +79 -3
- package/UI/Utils/PermissionGate.ts +61 -0
- package/UI/Utils/SensitiveUrlToken.ts +112 -0
- package/UI/Utils/TestLLMProvider.ts +11 -0
- package/UI/Utils/UseDashboardTimeRangeZoom.ts +77 -0
- package/Utils/Dashboard/DashboardTimeRangeZoom.ts +118 -0
- package/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +16 -0
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +191 -11
- package/Utils/Monitor/MonitorMetricType.ts +153 -1
- package/Utils/Monitor/NetworkDeviceRoleCatalog.ts +232 -0
- package/Utils/Monitor/NetworkDeviceRoleUtil.ts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.ts +139 -36
- package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +65 -14
- package/Utils/NetworkDevice/DeviceReachabilityUtil.ts +43 -14
- package/Utils/NetworkDevice/DeviceRoleKeyUtil.ts +137 -0
- package/Utils/NetworkDevice/NetworkAlertPolicyBootstrapUtil.ts +247 -0
- package/Utils/NetworkDevice/SnmpCredentialUtil.ts +68 -0
- package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +15 -7
- package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +52 -17
- package/Utils/NetworkDiscovery/DiscoveryImportEligibility.ts +55 -23
- package/Utils/NetworkDiscovery/PingMonitorBuilder.ts +115 -13
- package/Utils/NetworkSite/SiteStatusRollupUtil.ts +66 -20
- package/Utils/NetworkSite/TypeHierarchyUtil.ts +313 -0
- package/Utils/Rules/RulePatternMatchUtil.ts +1 -1
- package/Utils/Slug.ts +34 -1
- package/build/dist/Models/AnalyticsModels/Span.js +14 -0
- package/build/dist/Models/AnalyticsModels/Span.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertState.js +0 -2
- package/build/dist/Models/DatabaseModels/AlertState.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Domain.js +1 -1
- package/build/dist/Models/DatabaseModels/Domain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/EnterpriseLicense.js +59 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicense.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +12 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricType.js +0 -2
- package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +75 -0
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js +0 -2
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorTest.js +0 -2
- package/build/dist/Models/DatabaseModels/MonitorTest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkAlertPolicy.js +713 -0
- package/build/dist/Models/DatabaseModels/NetworkAlertPolicy.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +304 -4
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js +3 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js +677 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js +200 -2
- package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js +102 -3
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkSnmpCredentialProfile.js +878 -0
- package/build/dist/Models/DatabaseModels/NetworkSnmpCredentialProfile.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageResource.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageResource.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js +0 -2
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +123 -0
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupBatch.js +363 -0
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupBatch.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupItem.js +402 -0
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupItem.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupSetting.js +296 -0
- package/build/dist/Models/DatabaseModels/UserNotificationEmailRollupSetting.js.map +1 -0
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +273 -60
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +108 -13
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +12 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790700000000-AddNetworkSiteTypeParentHierarchy.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790700000000-AddNetworkSiteTypeParentHierarchy.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddEnterpriseLicenseUsageProvenance.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddEnterpriseLicenseUsageProvenance.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddTelemetryExceptionErrorClass.js +111 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790900000000-AddTelemetryExceptionErrorClass.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791000000000-AddUserNotificationEmailRollup.js +77 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791000000000-AddUserNotificationEmailRollup.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791100000000-AddUserNotificationEmailRollupSetting.js +50 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791100000000-AddUserNotificationEmailRollupSetting.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791200000000-AddNetworkSnmpCredentialProfilesAndAlertPolicies.js +83 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791200000000-AddNetworkSnmpCredentialProfilesAndAlertPolicies.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/QueueWorker.js +33 -5
- package/build/dist/Server/Infrastructure/QueueWorker.js.map +1 -1
- package/build/dist/Server/Middleware/BearerTokenAuthorization.js +12 -0
- package/build/dist/Server/Middleware/BearerTokenAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js +11 -0
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +12 -0
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +11 -0
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AIBillingService.js +70 -16
- package/build/dist/Server/Services/AIBillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +31 -5
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseInstanceService.js +167 -0
- package/build/dist/Server/Services/EnterpriseLicenseInstanceService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseService.js +39 -0
- package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +12 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +119 -21
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +127 -8
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +162 -0
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/NetworkAlertPolicyEngineService.js +1683 -0
- package/build/dist/Server/Services/NetworkAlertPolicyEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkAlertPolicyService.js +732 -0
- package/build/dist/Server/Services/NetworkAlertPolicyService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +10 -9
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +54 -11
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceRoleService.js +70 -0
- package/build/dist/Server/Services/NetworkDeviceRoleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +841 -70
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +1145 -107
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteTypeService.js +863 -0
- package/build/dist/Server/Services/NetworkSiteTypeService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSnmpCredentialProfileService.js +217 -0
- package/build/dist/Server/Services/NetworkSnmpCredentialProfileService.js.map +1 -0
- package/build/dist/Server/Services/NotificationService.js +80 -17
- package/build/dist/Server/Services/NotificationService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +131 -30
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/StatusPagePrivateUserService.js +92 -2
- package/build/dist/Server/Services/StatusPagePrivateUserService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationEmailRollupBatchService.js +76 -0
- package/build/dist/Server/Services/UserNotificationEmailRollupBatchService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationEmailRollupItemService.js +77 -0
- package/build/dist/Server/Services/UserNotificationEmailRollupItemService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationEmailRollupSettingService.js +111 -0
- package/build/dist/Server/Services/UserNotificationEmailRollupSettingService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js +46 -21
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +90 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +14 -3
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js +10 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js +10 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js +54 -1
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +18 -4
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
- package/build/dist/Server/Utils/Billing/BillingFailureNoticeThrottle.js +59 -0
- package/build/dist/Server/Utils/Billing/BillingFailureNoticeThrottle.js.map +1 -0
- package/build/dist/Server/Utils/DataSource/HttpFetch.js +2 -1
- package/build/dist/Server/Utils/DataSource/HttpFetch.js.map +1 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupConstants.js +91 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupConstants.js.map +1 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js +691 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js.map +1 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js +497 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js.map +1 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupWriter.js +257 -0
- package/build/dist/Server/Utils/EmailRollup/EmailRollupWriter.js.map +1 -0
- package/build/dist/Server/Utils/LLM/LLMService.js +64 -1
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/LogRedaction.js +8 -0
- package/build/dist/Server/Utils/LogRedaction.js.map +1 -1
- package/build/dist/Server/Utils/Logger.js +63 -1
- package/build/dist/Server/Utils/Logger.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.js +141 -0
- package/build/dist/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +8 -1
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +51 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js +7 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaDataExtractor.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +37 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +158 -6
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +33 -0
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +32 -0
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +330 -21
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +55 -10
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +178 -49
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +119 -29
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js +30 -17
- package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js.map +1 -1
- package/build/dist/Server/Utils/NetworkSite/NetworkSiteHierarchyLock.js +158 -0
- package/build/dist/Server/Utils/NetworkSite/NetworkSiteHierarchyLock.js.map +1 -0
- package/build/dist/Server/Utils/OutboundUserAgent.js +123 -0
- package/build/dist/Server/Utils/OutboundUserAgent.js.map +1 -0
- package/build/dist/Server/Utils/StartServer.js +38 -14
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/CaptureSpan.js +28 -8
- package/build/dist/Server/Utils/Telemetry/CaptureSpan.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ErrorClassResolver.js +95 -0
- package/build/dist/Server/Utils/Telemetry/ErrorClassResolver.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js +29 -0
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry.js +162 -46
- package/build/dist/Server/Utils/Telemetry.js.map +1 -1
- package/build/dist/Types/AI/ExceptionAIClassification.js +10 -24
- package/build/dist/Types/AI/ExceptionAIClassification.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicenseUsageSnapshot.js +2 -0
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicenseUsageSnapshot.js.map +1 -0
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicenseUserCountSource.js +7 -0
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicenseUserCountSource.js.map +1 -0
- package/build/dist/Types/Exception/ApiException.js +9 -0
- package/build/dist/Types/Exception/ApiException.js.map +1 -1
- package/build/dist/Types/Exception/BadDataException.js +10 -0
- package/build/dist/Types/Exception/BadDataException.js.map +1 -1
- package/build/dist/Types/Exception/BadRequestException.js +10 -0
- package/build/dist/Types/Exception/BadRequestException.js.map +1 -1
- package/build/dist/Types/Exception/Exception.js +56 -0
- package/build/dist/Types/Exception/Exception.js.map +1 -1
- package/build/dist/Types/Exception/ForbiddenException.js +9 -0
- package/build/dist/Types/Exception/ForbiddenException.js.map +1 -1
- package/build/dist/Types/Exception/NotAuthenticatedException.js +9 -0
- package/build/dist/Types/Exception/NotAuthenticatedException.js.map +1 -1
- package/build/dist/Types/Exception/NotAuthorizedException.js +9 -0
- package/build/dist/Types/Exception/NotAuthorizedException.js.map +1 -1
- package/build/dist/Types/Exception/NotFoundException.js +10 -0
- package/build/dist/Types/Exception/NotFoundException.js.map +1 -1
- package/build/dist/Types/Exception/PayloadTooLargeException.js +10 -0
- package/build/dist/Types/Exception/PayloadTooLargeException.js.map +1 -1
- package/build/dist/Types/Exception/PaymentRequiredException.js +9 -0
- package/build/dist/Types/Exception/PaymentRequiredException.js.map +1 -1
- package/build/dist/Types/Exception/ServiceUnavailableException.js +9 -0
- package/build/dist/Types/Exception/ServiceUnavailableException.js.map +1 -1
- package/build/dist/Types/Exception/SsoAuthorizationException.js +9 -0
- package/build/dist/Types/Exception/SsoAuthorizationException.js.map +1 -1
- package/build/dist/Types/Exception/TenantNotFoundException.js +10 -0
- package/build/dist/Types/Exception/TenantNotFoundException.js.map +1 -1
- package/build/dist/Types/Exception/TimeoutException.js +9 -0
- package/build/dist/Types/Exception/TimeoutException.js.map +1 -1
- package/build/dist/Types/Exception/TooManyRequestsException.js +9 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js.map +1 -1
- package/build/dist/Types/Exception/UnableToReachServer.js +9 -0
- package/build/dist/Types/Exception/UnableToReachServer.js.map +1 -1
- package/build/dist/Types/Exception/WebsiteRequestException.js +9 -0
- package/build/dist/Types/Exception/WebsiteRequestException.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +45 -2
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/DatabaseMetricCatalog.js +594 -0
- package/build/dist/Types/Monitor/DatabaseMetricCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/DatabaseMonitor/DatabaseMonitorResponse.js +21 -0
- package/build/dist/Types/Monitor/DatabaseMonitor/DatabaseMonitorResponse.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +70 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorMetricType.js +61 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +54 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepDatabaseMonitor.js +122 -0
- package/build/dist/Types/Monitor/MonitorStepDatabaseMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +45 -1
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +21 -1
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -1
- package/build/dist/Types/Monitor/SqlConnectionConfig.js +2 -0
- package/build/dist/Types/Monitor/SqlConnectionConfig.js.map +1 -0
- package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js +105 -0
- package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js.map +1 -0
- package/build/dist/Types/NetworkDevice/NetworkAlertPolicyScope.js +172 -0
- package/build/dist/Types/NetworkDevice/NetworkAlertPolicyScope.js.map +1 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js +40 -22
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js.map +1 -1
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteTypeHierarchy.js +26 -0
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteTypeHierarchy.js.map +1 -0
- package/build/dist/Types/NotificationSetting/NotificationEmailRollupCategory.js +186 -0
- package/build/dist/Types/NotificationSetting/NotificationEmailRollupCategory.js.map +1 -0
- package/build/dist/Types/NotificationSetting/NotificationEmailRollupPolicy.js +87 -0
- package/build/dist/Types/NotificationSetting/NotificationEmailRollupPolicy.js.map +1 -0
- package/build/dist/Types/Permission.js +120 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/ErrorClass.js +216 -0
- package/build/dist/Types/Telemetry/ErrorClass.js.map +1 -0
- package/build/dist/Types/Telemetry/UnitOfWork.js +59 -0
- package/build/dist/Types/Telemetry/UnitOfWork.js.map +1 -0
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +6 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +79 -31
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +7 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +79 -31
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js +14 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js +2 -7
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +3 -0
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +2 -7
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +39 -13
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +39 -0
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +44 -9
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/ProgressBar/ProgressBar.js +12 -1
- package/build/dist/UI/Components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js +6 -6
- package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +76 -11
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +50 -54
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +32 -9
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
- package/build/dist/UI/Components/SideOver/SideOver.js +5 -20
- package/build/dist/UI/Components/SideOver/SideOver.js.map +1 -1
- package/build/dist/UI/Utils/PageScrollLock.js +31 -3
- package/build/dist/UI/Utils/PageScrollLock.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +42 -1
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/build/dist/UI/Utils/SensitiveUrlToken.js +97 -0
- package/build/dist/UI/Utils/SensitiveUrlToken.js.map +1 -0
- package/build/dist/UI/Utils/TestLLMProvider.js +4 -5
- package/build/dist/UI/Utils/TestLLMProvider.js.map +1 -1
- package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js +42 -0
- package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js.map +1 -0
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js +74 -0
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js.map +1 -0
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js +15 -0
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +111 -9
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js +109 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js +126 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +2 -1
- package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +75 -35
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +27 -7
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js +7 -5
- package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js +114 -0
- package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDevice/NetworkAlertPolicyBootstrapUtil.js +180 -0
- package/build/dist/Utils/NetworkDevice/NetworkAlertPolicyBootstrapUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDevice/SnmpCredentialUtil.js +12 -0
- package/build/dist/Utils/NetworkDevice/SnmpCredentialUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js +15 -5
- package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +44 -15
- package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/DiscoveryImportEligibility.js +52 -23
- package/build/dist/Utils/NetworkDiscovery/DiscoveryImportEligibility.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js +85 -13
- package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js.map +1 -1
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +30 -15
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -1
- package/build/dist/Utils/NetworkSite/TypeHierarchyUtil.js +191 -0
- package/build/dist/Utils/NetworkSite/TypeHierarchyUtil.js.map +1 -0
- package/build/dist/Utils/Rules/RulePatternMatchUtil.js +1 -1
- package/build/dist/Utils/Slug.js +31 -1
- package/build/dist/Utils/Slug.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
NetworkTopologyEdge,
|
|
15
15
|
NetworkTopologyNode,
|
|
16
16
|
} from "../../../Types/Monitor/SnmpMonitor/NetworkTopology";
|
|
17
|
+
import NetworkDevice from "../../../Models/DatabaseModels/NetworkDevice";
|
|
17
18
|
|
|
18
19
|
/*
|
|
19
20
|
* Issue #3435 — what the "Add to Monitoring" dialog actually opens with.
|
|
@@ -25,6 +26,12 @@ import {
|
|
|
25
26
|
* initialValues object is type-safe, render-safe, and puts the operator back
|
|
26
27
|
* to retyping what OneUptime already discovered.
|
|
27
28
|
*
|
|
29
|
+
* Every device the dialog creates is probe-polled: there is no monitoring
|
|
30
|
+
* method to choose, the probe is required for a phone exactly as for a
|
|
31
|
+
* switch, and the SNMP step is optional for both. The cases below that used
|
|
32
|
+
* to split on "will this device be polled?" now assert that no such split
|
|
33
|
+
* exists.
|
|
34
|
+
*
|
|
28
35
|
* The form itself is configuration passed as props, so ModelFormModal is
|
|
29
36
|
* mocked to capture them and the capture is asserted directly — the same
|
|
30
37
|
* approach DiscoveryScanWizardValidation.test.tsx uses for the Discovery
|
|
@@ -35,11 +42,18 @@ type CapturedModalProps = {
|
|
|
35
42
|
title: string;
|
|
36
43
|
description: string;
|
|
37
44
|
initialValues: Record<string, unknown>;
|
|
45
|
+
onBeforeCreate?:
|
|
46
|
+
| ((
|
|
47
|
+
item: NetworkDevice,
|
|
48
|
+
miscDataProps: Record<string, unknown>,
|
|
49
|
+
) => Promise<NetworkDevice>)
|
|
50
|
+
| undefined;
|
|
38
51
|
formProps: {
|
|
39
|
-
steps: Array<{ id: string; title: string }>;
|
|
52
|
+
steps: Array<{ id: string; title: string; showIf?: unknown }>;
|
|
40
53
|
fields: Array<{
|
|
41
54
|
field: Record<string, boolean>;
|
|
42
55
|
required?: boolean | undefined;
|
|
56
|
+
stepId?: string | undefined;
|
|
43
57
|
dropdownOptions?: Array<{ label: string; value: string }> | undefined;
|
|
44
58
|
}>;
|
|
45
59
|
};
|
|
@@ -128,12 +142,26 @@ const SECOND_SWITCH_NODE: NetworkTopologyNode = {
|
|
|
128
142
|
status: "up",
|
|
129
143
|
};
|
|
130
144
|
|
|
145
|
+
/*
|
|
146
|
+
* Carries the role stamp the topology builder puts on a node now that roles
|
|
147
|
+
* are per-project rows: `roleId` is the project's row for the classified role,
|
|
148
|
+
* and it is what the form can actually preselect - the role is a relation, and
|
|
149
|
+
* a form cannot resolve a key to a row.
|
|
150
|
+
*/
|
|
151
|
+
const PHONE_ROLE_ID: string = "b7a1a0f6-3a4b-4a0e-9c3f-4f1f7f2a91cd";
|
|
152
|
+
|
|
153
|
+
const SWITCH_ROLE_ID: string = "0c2d5b41-9f22-4a3e-8f61-2d7c6a4e8b03";
|
|
154
|
+
|
|
131
155
|
const PHONE_NODE: NetworkTopologyNode = {
|
|
132
156
|
id: "unmanaged:sep6026aaf2b46b",
|
|
133
157
|
name: "SEP6026AAF2B46B",
|
|
134
158
|
isManaged: false,
|
|
135
159
|
kind: "unmanaged",
|
|
136
160
|
role: "phone",
|
|
161
|
+
roleKey: "phone",
|
|
162
|
+
roleLabel: "IP phone",
|
|
163
|
+
roleId: PHONE_ROLE_ID,
|
|
164
|
+
isSnmpWalkableRole: false,
|
|
137
165
|
status: "unknown",
|
|
138
166
|
deviceModel: "Cisco IP Phone 8811",
|
|
139
167
|
ipAddress: "10.0.12.41",
|
|
@@ -227,17 +255,58 @@ describe("the Add to Monitoring dialog", () => {
|
|
|
227
255
|
test("opens on the role the map classified the device as", async () => {
|
|
228
256
|
const props: CapturedModalProps = await openDialog();
|
|
229
257
|
|
|
230
|
-
|
|
258
|
+
/*
|
|
259
|
+
* The row's id, not the classifier's key: the role is a relation to the
|
|
260
|
+
* project's own NetworkDeviceRole table, so this is what the picker binds
|
|
261
|
+
* to and what a rename or a custom role travels through.
|
|
262
|
+
*/
|
|
263
|
+
expect(props.initialValues["networkDeviceRole"]).toBe(PHONE_ROLE_ID);
|
|
231
264
|
});
|
|
232
265
|
|
|
233
266
|
/*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
267
|
+
* There is no monitoring-method question any more. A phone is never
|
|
268
|
+
* SNMP-walkable, but it is pingable — and pinging is all a probe-polled
|
|
269
|
+
* device needs to have a status — so the dialog asks nothing and writes
|
|
270
|
+
* Probe on the way out. ModelForm sends only the fields it renders, which
|
|
271
|
+
* is why the method travels through onBeforeCreate rather than
|
|
272
|
+
* initialValues: a seeded value with no field behind it would never reach
|
|
273
|
+
* the server.
|
|
236
274
|
*/
|
|
237
|
-
test("
|
|
275
|
+
test("asks no monitoring-method question and writes Probe on the way out", async () => {
|
|
238
276
|
const props: CapturedModalProps = await openDialog();
|
|
239
277
|
|
|
240
|
-
expect(props
|
|
278
|
+
expect(fieldFor(props, "monitoringMethod")).toBeUndefined();
|
|
279
|
+
expect(props.initialValues["monitoringMethod"]).toBeUndefined();
|
|
280
|
+
expect(props.onBeforeCreate).toBeDefined();
|
|
281
|
+
|
|
282
|
+
const device: NetworkDevice = await props.onBeforeCreate!(
|
|
283
|
+
new NetworkDevice(),
|
|
284
|
+
{},
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
expect(device.monitoringMethod).toBe("Probe");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
/*
|
|
291
|
+
* And the same for an infrastructure peer: the method is not a function of
|
|
292
|
+
* the role, so a switch and a phone leave the dialog identically.
|
|
293
|
+
*/
|
|
294
|
+
test("writes Probe for a walkable peer too", async () => {
|
|
295
|
+
const props: CapturedModalProps = await openDialog({
|
|
296
|
+
...PHONE_NODE,
|
|
297
|
+
role: "switch",
|
|
298
|
+
roleKey: "switch",
|
|
299
|
+
roleLabel: "Switch",
|
|
300
|
+
roleId: SWITCH_ROLE_ID,
|
|
301
|
+
isSnmpWalkableRole: true,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const device: NetworkDevice = await props.onBeforeCreate!(
|
|
305
|
+
new NetworkDevice(),
|
|
306
|
+
{},
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
expect(device.monitoringMethod).toBe("Probe");
|
|
241
310
|
});
|
|
242
311
|
|
|
243
312
|
/*
|
|
@@ -290,24 +359,42 @@ describe("the Add to Monitoring dialog", () => {
|
|
|
290
359
|
});
|
|
291
360
|
|
|
292
361
|
/*
|
|
293
|
-
* The probe is
|
|
294
|
-
*
|
|
295
|
-
*
|
|
362
|
+
* The probe is inherited for EVERY device. It used to be withheld from a
|
|
363
|
+
* leaf device, which opened on a monitor-backed branch with the probe
|
|
364
|
+
* field hidden; a phone is as probe-polled as a switch now, so the probe
|
|
365
|
+
* its neighbours agree on is the right head start for both. The phone
|
|
366
|
+
* fixture carries the handset's isSnmpWalkableRole: false, which is
|
|
367
|
+
* exactly the case the seed used to be withheld from.
|
|
296
368
|
*/
|
|
297
|
-
test("inherits a probe for a device
|
|
369
|
+
test("inherits a probe for a leaf device", async () => {
|
|
370
|
+
const props: CapturedModalProps = await openDialog();
|
|
371
|
+
|
|
372
|
+
expect(props.initialValues["probe"]).toBe("probe-a");
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
test("inherits a probe for a walkable device", async () => {
|
|
298
376
|
const props: CapturedModalProps = await openDialog({
|
|
299
377
|
...PHONE_NODE,
|
|
300
378
|
role: "switch",
|
|
379
|
+
roleKey: "switch",
|
|
380
|
+
roleLabel: "Switch",
|
|
381
|
+
roleId: SWITCH_ROLE_ID,
|
|
382
|
+
isSnmpWalkableRole: true,
|
|
301
383
|
});
|
|
302
384
|
|
|
303
|
-
expect(props.initialValues["monitoringMethod"]).toBe("SNMP");
|
|
304
385
|
expect(props.initialValues["probe"]).toBe("probe-a");
|
|
305
386
|
});
|
|
306
387
|
|
|
307
|
-
|
|
388
|
+
/*
|
|
389
|
+
* Required for a phone exactly as for a switch: a probe-polled device with
|
|
390
|
+
* no probe is claimed by nothing and never polls, which is the "Pending
|
|
391
|
+
* forever" this flow exists to end. The server does not insist, so the
|
|
392
|
+
* form does.
|
|
393
|
+
*/
|
|
394
|
+
test("requires a probe for a leaf device", async () => {
|
|
308
395
|
const props: CapturedModalProps = await openDialog();
|
|
309
396
|
|
|
310
|
-
expect(props
|
|
397
|
+
expect(fieldFor(props, "probe")?.required).toBe(true);
|
|
311
398
|
});
|
|
312
399
|
|
|
313
400
|
/*
|
|
@@ -331,16 +418,16 @@ describe("the Add to Monitoring dialog", () => {
|
|
|
331
418
|
});
|
|
332
419
|
|
|
333
420
|
/*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
421
|
+
* No Monitor binding field at all. The binding is the override for gear a
|
|
422
|
+
* probe cannot reach, chosen on a device's Settings page; a neighbour the
|
|
423
|
+
* probe just heard about from the switch beside it is, by construction,
|
|
424
|
+
* reachable — so the dialog does not offer a field whose only honest value
|
|
425
|
+
* here is "empty".
|
|
339
426
|
*/
|
|
340
|
-
test("
|
|
427
|
+
test("has no monitor binding field", async () => {
|
|
341
428
|
const props: CapturedModalProps = await openDialog();
|
|
342
429
|
|
|
343
|
-
expect(fieldFor(props, "monitor")
|
|
430
|
+
expect(fieldFor(props, "monitor")).toBeUndefined();
|
|
344
431
|
});
|
|
345
432
|
|
|
346
433
|
test("still demands the two things a device cannot exist without", async () => {
|
|
@@ -384,18 +471,62 @@ describe("the Add to Monitoring dialog", () => {
|
|
|
384
471
|
]);
|
|
385
472
|
});
|
|
386
473
|
|
|
387
|
-
test("walks the operator through
|
|
474
|
+
test("walks the operator through Device Details, Probe & Site and SNMP", async () => {
|
|
388
475
|
const props: CapturedModalProps = await openDialog();
|
|
389
476
|
|
|
390
477
|
expect(
|
|
391
478
|
props.formProps.steps.map((step: { id: string }) => {
|
|
392
479
|
return step.id;
|
|
393
480
|
}),
|
|
394
|
-
).toEqual([
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
481
|
+
).toEqual(["device-details", "probe-and-site", "snmp"]);
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
/*
|
|
485
|
+
* The SNMP step is walked through by every device, a phone included. It
|
|
486
|
+
* used to be hidden wholesale for a leaf device (nothing polled it, so
|
|
487
|
+
* nothing could use a credential); now the probe walks whatever it has
|
|
488
|
+
* credentials for, and leaving the step empty is the "ping only" answer.
|
|
489
|
+
*/
|
|
490
|
+
test("shows the SNMP step to a leaf device, unconditionally", async () => {
|
|
491
|
+
const props: CapturedModalProps = await openDialog();
|
|
492
|
+
|
|
493
|
+
const snmpStep: { id: string; showIf?: unknown } | undefined =
|
|
494
|
+
props.formProps.steps.find((step: { id: string }) => {
|
|
495
|
+
return step.id === "snmp";
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
expect(snmpStep).toBeDefined();
|
|
499
|
+
expect(snmpStep?.showIf).toBeUndefined();
|
|
500
|
+
expect(fieldFor(props, "snmpVersion")).toBeDefined();
|
|
501
|
+
expect(fieldFor(props, "snmpCommunityString")?.required).toBe(false);
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
/*
|
|
505
|
+
* Every step the wizard declares is claimed by a field, and every field
|
|
506
|
+
* names a declared step — the two silent failures NetworkFormStepsInvariants
|
|
507
|
+
* pins against the source, asserted here against the props the form is
|
|
508
|
+
* actually handed.
|
|
509
|
+
*/
|
|
510
|
+
test("every field lands on a step the wizard declares, and no step is empty", async () => {
|
|
511
|
+
const props: CapturedModalProps = await openDialog();
|
|
512
|
+
|
|
513
|
+
const declared: Array<string> = props.formProps.steps.map(
|
|
514
|
+
(step: { id: string }) => {
|
|
515
|
+
return step.id;
|
|
516
|
+
},
|
|
517
|
+
);
|
|
518
|
+
const used: Array<string> = props.formProps.fields.map(
|
|
519
|
+
(field: { stepId?: string | undefined }) => {
|
|
520
|
+
return field.stepId || "";
|
|
521
|
+
},
|
|
522
|
+
);
|
|
523
|
+
|
|
524
|
+
for (const stepId of used) {
|
|
525
|
+
expect(declared).toContain(stepId);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
for (const stepId of declared) {
|
|
529
|
+
expect(used).toContain(stepId);
|
|
530
|
+
}
|
|
400
531
|
});
|
|
401
532
|
});
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
|
2
|
+
import PageContextUtil, {
|
|
3
|
+
DashboardPageContext,
|
|
4
|
+
SuggestedQuestion,
|
|
5
|
+
} from "../../../../App/FeatureSet/Dashboard/src/Components/AIChat/PageContext";
|
|
6
|
+
import { buildPageContextSection } from "../../../Server/Utils/AI/Chat/ObservabilityChatPrompt";
|
|
7
|
+
import { QueryAlertsTool } from "../../../Server/Utils/AI/Toolbox/AlertTools";
|
|
8
|
+
import AIChatPageContextType, {
|
|
9
|
+
AIChatPageContextHelper,
|
|
10
|
+
} from "../../../Types/AI/AIChatPageContext";
|
|
11
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
12
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Ask AI renders the suggested prompt cards in PageContextUtil.getSuggestions
|
|
16
|
+
* as first-class buttons: one click sends that exact question. Nothing in the
|
|
17
|
+
* type system ties a card to a capability the model actually has, and the two
|
|
18
|
+
* halves live in different packages — the deck in the dashboard bundle, the
|
|
19
|
+
* per-page capability claim the server injects into the system prompt in
|
|
20
|
+
* Common/Server.
|
|
21
|
+
*
|
|
22
|
+
* Issue #3552 is what that gap looks like in production. The incidents list
|
|
23
|
+
* offered "Active incidents — Which incidents are currently active or
|
|
24
|
+
* unresolved?", while the page guidance summarised the very tool that answers
|
|
25
|
+
* it as "query_incidents (recent incidents, or one by incidentId)". The tool
|
|
26
|
+
* itself had always supported state="active"; the prompt described it as
|
|
27
|
+
* narrower than it was, and the model dutifully paraphrased the prompt back at
|
|
28
|
+
* the user: it had no way to list active incidents and needed an incidentId.
|
|
29
|
+
* The product shipped a button that made the assistant deny the feature.
|
|
30
|
+
*
|
|
31
|
+
* These tests are the structural guard for that whole class of bug: a card the
|
|
32
|
+
* model has not been told it can answer.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
// Valid-shaped ids so entity contexts route through the entity guidance.
|
|
36
|
+
const ENTITY_ID: string = "0f10509d-6656-4a08-b957-235fd4e8c52e";
|
|
37
|
+
const TRACE_ID: string = "4bf92f3577b34da6a3ce929d0e0e4736";
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* Tool names are the one thing every page guidance must carry — snake_case
|
|
41
|
+
* identifiers like query_incidents or log_histogram. Guidance that names no
|
|
42
|
+
* tool tells the model nothing it can act on.
|
|
43
|
+
*/
|
|
44
|
+
const TOOL_NAME_REGEX: RegExp = /\b[a-z]+(?:_[a-z]+)+\b/;
|
|
45
|
+
|
|
46
|
+
// A card's question is either a question or a complete instruction.
|
|
47
|
+
const COMPLETE_SENTENCE_REGEX: RegExp = /^[A-Z].*[?.]$/;
|
|
48
|
+
|
|
49
|
+
// Card matchers, as named constants so they read as intent rather than syntax.
|
|
50
|
+
const MENTIONS_AN_INCIDENT: RegExp = /incident/i;
|
|
51
|
+
const ASKS_FOR_UNFINISHED_WORK: RegExp = /\b(active|unresolved|open)\b/i;
|
|
52
|
+
const MENTIONS_A_SOURCE: RegExp = /monitor|source/i;
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
* The card title is rendered on a single line in a half-width grid cell, so it
|
|
56
|
+
* has to stay short — this is a layout constraint, not a copy preference.
|
|
57
|
+
*/
|
|
58
|
+
const MAX_TITLE_LENGTH: number = 32;
|
|
59
|
+
|
|
60
|
+
const ALL_PAGE_CONTEXT_TYPES: Array<AIChatPageContextType> = Object.values(
|
|
61
|
+
AIChatPageContextType,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
function buildContext(type: AIChatPageContextType): DashboardPageContext {
|
|
65
|
+
const isEntity: boolean = AIChatPageContextHelper.isEntityType(type);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
type: type,
|
|
69
|
+
noun: "thing",
|
|
70
|
+
chipLabel: "Thing",
|
|
71
|
+
icon: IconProp.Alert,
|
|
72
|
+
isEntity: isEntity,
|
|
73
|
+
...(isEntity
|
|
74
|
+
? {
|
|
75
|
+
entityId: type === AIChatPageContextType.Trace ? TRACE_ID : ENTITY_ID,
|
|
76
|
+
}
|
|
77
|
+
: {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getDeck(type: AIChatPageContextType): Array<SuggestedQuestion> {
|
|
82
|
+
return PageContextUtil.getSuggestions(buildContext(type));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getGuidance(type: AIChatPageContextType): string {
|
|
86
|
+
return buildPageContextSection(buildContext(type));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const TYPES_WITH_A_DECK: Array<AIChatPageContextType> =
|
|
90
|
+
ALL_PAGE_CONTEXT_TYPES.filter((type: AIChatPageContextType): boolean => {
|
|
91
|
+
return getDeck(type).length > 0;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// test.each rows have to be tuples, so wrap each type in a one-column row.
|
|
95
|
+
const DECK_ROWS: Array<[AIChatPageContextType]> = TYPES_WITH_A_DECK.map(
|
|
96
|
+
(type: AIChatPageContextType): [AIChatPageContextType] => {
|
|
97
|
+
return [type];
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
describe("Ask AI suggested prompts are backed by capabilities the model is told about", () => {
|
|
102
|
+
/*
|
|
103
|
+
* The exact pairing #3552 broke, asserted as one invariant because that is
|
|
104
|
+
* what it is: the card is only honest if the guidance names the argument
|
|
105
|
+
* that answers it. Either half alone passes happily while the product lies
|
|
106
|
+
* to the user.
|
|
107
|
+
*
|
|
108
|
+
* Fails on the pre-fix prompt, which said "recent incidents, or one by
|
|
109
|
+
* incidentId" and never mentioned state="active".
|
|
110
|
+
*/
|
|
111
|
+
test('the incidents list offers an "active incidents" card AND its guidance names state="active"', () => {
|
|
112
|
+
const deck: Array<SuggestedQuestion> = getDeck(
|
|
113
|
+
AIChatPageContextType.IncidentsList,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const activeIncidentsCard: SuggestedQuestion | undefined = deck.find(
|
|
117
|
+
(suggestion: SuggestedQuestion): boolean => {
|
|
118
|
+
return (
|
|
119
|
+
MENTIONS_AN_INCIDENT.test(suggestion.question) &&
|
|
120
|
+
ASKS_FOR_UNFINISHED_WORK.test(suggestion.question)
|
|
121
|
+
);
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(activeIncidentsCard).toBeDefined();
|
|
126
|
+
|
|
127
|
+
const guidance: string = getGuidance(AIChatPageContextType.IncidentsList);
|
|
128
|
+
|
|
129
|
+
expect(guidance).toContain("query_incidents");
|
|
130
|
+
expect(guidance).toContain('state="active"');
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
* The exact regression: describing query_incidents as only "recent
|
|
134
|
+
* incidents, or one by incidentId" is the sentence the model paraphrased
|
|
135
|
+
* back as "I have no tool for that, give me an incidentId".
|
|
136
|
+
*/
|
|
137
|
+
expect(guidance).not.toContain("recent incidents, or one by incidentId");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
* Three list pages lead with a "what is broken RIGHT NOW" card, and each
|
|
142
|
+
* needs a different argument to answer it. The narrow-capability-claim bug
|
|
143
|
+
* was identical on all three, so pin all three rather than only the one the
|
|
144
|
+
* issue happened to be filed against.
|
|
145
|
+
*
|
|
146
|
+
* All three rows fail on the pre-fix prompt, which named the tool but none
|
|
147
|
+
* of these arguments.
|
|
148
|
+
*/
|
|
149
|
+
test.each<[AIChatPageContextType, RegExp, string]>([
|
|
150
|
+
[
|
|
151
|
+
AIChatPageContextType.IncidentsList,
|
|
152
|
+
/\b(active|unresolved)\b/i,
|
|
153
|
+
'state="active"',
|
|
154
|
+
],
|
|
155
|
+
[AIChatPageContextType.AlertsList, /\b(open|active)\b/i, 'state="active"'],
|
|
156
|
+
[
|
|
157
|
+
AIChatPageContextType.MonitorsList,
|
|
158
|
+
/not operational|right now/i,
|
|
159
|
+
"problemsOnly=true",
|
|
160
|
+
],
|
|
161
|
+
])(
|
|
162
|
+
"%s: the guidance names the argument its right-now card depends on",
|
|
163
|
+
(
|
|
164
|
+
type: AIChatPageContextType,
|
|
165
|
+
cardQuestion: RegExp,
|
|
166
|
+
affordance: string,
|
|
167
|
+
): void => {
|
|
168
|
+
const deck: Array<SuggestedQuestion> = getDeck(type);
|
|
169
|
+
|
|
170
|
+
const rightNowCard: SuggestedQuestion | undefined = deck.find(
|
|
171
|
+
(suggestion: SuggestedQuestion): boolean => {
|
|
172
|
+
return cardQuestion.test(suggestion.question);
|
|
173
|
+
},
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
expect(rightNowCard).toBeDefined();
|
|
177
|
+
expect(getGuidance(type)).toContain(affordance);
|
|
178
|
+
},
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
/*
|
|
182
|
+
* Every page that offers cards must also give the model page-scoped
|
|
183
|
+
* guidance. A page with a deck and an empty section is the same defect as
|
|
184
|
+
* #3552 in a different place: the user is invited to ask, and the model is
|
|
185
|
+
* told nothing about where the answer lives. Guard — both halves have always
|
|
186
|
+
* been populated for every type, and this keeps the next page from shipping
|
|
187
|
+
* with only one of them.
|
|
188
|
+
*/
|
|
189
|
+
test("every page context type is either silent or offers both cards and guidance", () => {
|
|
190
|
+
expect(TYPES_WITH_A_DECK.length).toBeGreaterThan(0);
|
|
191
|
+
|
|
192
|
+
const typesMissingGuidance: Array<AIChatPageContextType> =
|
|
193
|
+
TYPES_WITH_A_DECK.filter((type: AIChatPageContextType): boolean => {
|
|
194
|
+
return getGuidance(type).trim().length === 0;
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
expect(typesMissingGuidance).toEqual([]);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
* Guidance that names no tool is guidance the model cannot act on — it can
|
|
202
|
+
* only fall back to "I don't have a way to do that", which is exactly the
|
|
203
|
+
* user-visible symptom of #3552. Guard.
|
|
204
|
+
*/
|
|
205
|
+
test.each<[AIChatPageContextType]>(DECK_ROWS)(
|
|
206
|
+
"%s guidance names at least one tool",
|
|
207
|
+
(type: AIChatPageContextType): void => {
|
|
208
|
+
expect(getGuidance(type)).toMatch(TOOL_NAME_REGEX);
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
/*
|
|
213
|
+
* Card hygiene. The question string is sent verbatim to the model when the
|
|
214
|
+
* card is clicked, so a blank or fragmentary one is a broken button; the
|
|
215
|
+
* title is the card's only label and ChatHomeView keys the rendered list by
|
|
216
|
+
* it, so duplicates within a deck collide as React keys. Guard.
|
|
217
|
+
*/
|
|
218
|
+
test.each<[AIChatPageContextType]>(DECK_ROWS)(
|
|
219
|
+
"%s cards are well formed and uniquely titled",
|
|
220
|
+
(type: AIChatPageContextType): void => {
|
|
221
|
+
const deck: Array<SuggestedQuestion> = getDeck(type);
|
|
222
|
+
|
|
223
|
+
for (const suggestion of deck) {
|
|
224
|
+
expect(suggestion.title.trim().length).toBeGreaterThan(0);
|
|
225
|
+
expect(suggestion.title.length).toBeLessThanOrEqual(MAX_TITLE_LENGTH);
|
|
226
|
+
expect(suggestion.question.trim()).toMatch(COMPLETE_SENTENCE_REGEX);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const titles: Array<string> = deck.map(
|
|
230
|
+
(suggestion: SuggestedQuestion): string => {
|
|
231
|
+
return suggestion.title;
|
|
232
|
+
},
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
expect(new Set(titles).size).toBe(titles.length);
|
|
236
|
+
},
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
/*
|
|
240
|
+
* The alerts deck's "Noisiest source" card asks which monitor generates the
|
|
241
|
+
* most alerts. Answering it needs the originating monitor on every alert
|
|
242
|
+
* row — without it the model can only guess a source from alert titles, or
|
|
243
|
+
* say it cannot tell. The card is only honest once query_alerts both returns
|
|
244
|
+
* that column and says so in its description, since the description is what
|
|
245
|
+
* the model reads when deciding whether the question is answerable.
|
|
246
|
+
*
|
|
247
|
+
* Fails on the pre-fix tool, whose description never mentioned the monitor.
|
|
248
|
+
*/
|
|
249
|
+
test('the alerts deck\'s "noisiest source" card is backed by monitor data in query_alerts', () => {
|
|
250
|
+
const deck: Array<SuggestedQuestion> = getDeck(
|
|
251
|
+
AIChatPageContextType.AlertsList,
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
const noisiestSourceCard: SuggestedQuestion | undefined = deck.find(
|
|
255
|
+
(suggestion: SuggestedQuestion): boolean => {
|
|
256
|
+
return MENTIONS_A_SOURCE.test(suggestion.question);
|
|
257
|
+
},
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
expect(noisiestSourceCard).toBeDefined();
|
|
261
|
+
|
|
262
|
+
const description: string = QueryAlertsTool.description;
|
|
263
|
+
|
|
264
|
+
expect(description).toMatch(/\bmonitor\b/i);
|
|
265
|
+
|
|
266
|
+
/*
|
|
267
|
+
* The monitor has to be something the tool RETURNS, not something the
|
|
268
|
+
* caller filters by — that distinction is what makes the card answerable.
|
|
269
|
+
* Asserted structurally rather than by word order, so a copy edit to the
|
|
270
|
+
* description does not fail this test.
|
|
271
|
+
*/
|
|
272
|
+
const properties: JSONObject =
|
|
273
|
+
(QueryAlertsTool.inputSchema["properties"] as JSONObject | undefined) ||
|
|
274
|
+
{};
|
|
275
|
+
|
|
276
|
+
expect(properties["monitor"]).toBeUndefined();
|
|
277
|
+
expect(properties["monitorId"]).toBeUndefined();
|
|
278
|
+
});
|
|
279
|
+
});
|
|
@@ -20,13 +20,23 @@ import * as React from "react";
|
|
|
20
20
|
import getJestMockFunction, { MockFunction } from "../../MockType";
|
|
21
21
|
|
|
22
22
|
/*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
23
|
+
* The chart widget's STANDALONE fallback: what drag-to-zoom does when the
|
|
24
|
+
* host hands down no onDashboardTimeRangeSelect — the edit-mode settings
|
|
25
|
+
* preview, and any future surface that mounts the widget without owning a
|
|
26
|
+
* time range. Selecting a window narrows THIS widget, refetches for the
|
|
27
|
+
* narrowed window, and offers a way back (Reset) and a way deeper (Open in
|
|
28
|
+
* Explorer, carrying the zoomed window).
|
|
29
|
+
*
|
|
30
|
+
* On a real dashboard the shell DOES take the drag and the whole board
|
|
31
|
+
* retimes (issue #3530) — that contract lives in
|
|
32
|
+
* DashboardWideChartZoom.test.tsx. Both paths are pinned because the
|
|
33
|
+
* widget picks between them purely on whether the callback prop is
|
|
34
|
+
* present, and a host that forgets to pass it should degrade to this
|
|
35
|
+
* rather than lose the gesture.
|
|
36
|
+
*
|
|
37
|
+
* Edit mode must not zoom either way — the drag gesture belongs to widget
|
|
38
|
+
* move/resize there, and series pivots would navigate away from unsaved
|
|
39
|
+
* dashboard changes.
|
|
30
40
|
*/
|
|
31
41
|
|
|
32
42
|
const fetchResultsMock: MockFunction = getJestMockFunction();
|
|
@@ -215,7 +225,24 @@ afterEach(() => {
|
|
|
215
225
|
cleanup();
|
|
216
226
|
});
|
|
217
227
|
|
|
218
|
-
describe("dashboard chart widget drag-to-zoom", () => {
|
|
228
|
+
describe("dashboard chart widget drag-to-zoom (standalone fallback)", () => {
|
|
229
|
+
test("the fallback is what runs when the host offers no dashboard-wide zoom", async () => {
|
|
230
|
+
renderWidget();
|
|
231
|
+
|
|
232
|
+
await waitFor(() => {
|
|
233
|
+
expect(screen.getByTestId("metric-charts")).toBeInTheDocument();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* Guards the branch this whole suite depends on: these props are the
|
|
238
|
+
* switch between narrowing this widget and retiming the board, and
|
|
239
|
+
* buildBaseProps deliberately leaves them off.
|
|
240
|
+
*/
|
|
241
|
+
const baseProps: DashboardBaseComponentProps = buildBaseProps();
|
|
242
|
+
expect(baseProps.onDashboardTimeRangeSelect).toBeUndefined();
|
|
243
|
+
expect(baseProps.onDashboardTimeRangeReset).toBeUndefined();
|
|
244
|
+
});
|
|
245
|
+
|
|
219
246
|
test("drag-selecting a window refetches THIS widget for that window and shows the zoom bar", async () => {
|
|
220
247
|
renderWidget();
|
|
221
248
|
|