@oneuptime/common 12.0.32 → 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/EnterpriseLicense.ts +56 -0
- package/Models/DatabaseModels/Index.ts +10 -0
- package/Models/DatabaseModels/Monitor.ts +76 -0
- package/Models/DatabaseModels/NetworkAlertPolicy.ts +690 -0
- package/Models/DatabaseModels/NetworkDevice.ts +176 -1
- package/Models/DatabaseModels/NetworkSite.ts +201 -2
- package/Models/DatabaseModels/NetworkSiteType.ts +102 -3
- package/Models/DatabaseModels/NetworkSnmpCredentialProfile.ts +841 -0
- 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/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 +12 -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/EnterpriseLicenseInstanceService.ts +197 -0
- package/Server/Services/EnterpriseLicenseService.ts +55 -0
- package/Server/Services/Index.ts +10 -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/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 +105 -48
- 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 -25
- 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 +134 -33
- package/Tests/App/Dashboard/AskAiSuggestedPrompts.test.ts +279 -0
- package/Tests/App/Dashboard/DashboardEditPermissions.test.tsx +517 -0
- package/Tests/App/Dashboard/DashboardVariablesDiscard.test.tsx +26 -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/MonitorTypePicker.test.tsx +4 -2
- 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 +41 -5
- 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/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/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/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/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/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/ProjectServiceNetworkSiteTypeDefaults.test.ts +214 -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/UserNotificationSettingRollupRouting.test.ts +856 -0
- package/Tests/Server/Services/UserNotificationSettingWorkspaceChannels.test.ts +102 -1
- 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/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/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/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/MonitorTemplateVariables/TemplateVariablesCatalog.test.ts +15 -0
- package/Tests/UI/Components/ProgressBar.test.tsx +38 -2
- package/Tests/UI/Components/SideMenuItem.test.tsx +226 -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/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/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/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/Telemetry/CaptureSpanExportGating.test.ts +145 -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/SqlConnectionConfig.ts +31 -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 +90 -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/CommandPalette/CommandPalette.tsx +2 -8
- package/UI/Components/EditionLabel/EditionLabel.tsx +4 -0
- package/UI/Components/Modal/Modal.tsx +2 -8
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +44 -0
- package/UI/Components/ProgressBar/ProgressBar.tsx +12 -1
- package/UI/Components/RadioButtons/BasicRadioButtons.tsx +37 -7
- package/UI/Components/SideMenu/SideMenu.tsx +123 -5
- package/UI/Components/SideMenu/SideMenuItem.tsx +76 -84
- package/UI/Components/SideMenu/SideMenuSection.tsx +55 -23
- 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/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +16 -0
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +191 -11
- package/Utils/Monitor/MonitorMetricType.ts +153 -1
- package/Utils/Monitor/NetworkTopologyUtil.ts +23 -3
- package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +65 -14
- package/Utils/NetworkDevice/DeviceReachabilityUtil.ts +43 -14
- 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/build/dist/Models/AnalyticsModels/Span.js +14 -0
- package/build/dist/Models/AnalyticsModels/Span.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/Index.js +10 -0
- package/build/dist/Models/DatabaseModels/Index.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/NetworkAlertPolicy.js +713 -0
- package/build/dist/Models/DatabaseModels/NetworkAlertPolicy.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +180 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- 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/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/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 +12 -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/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 +10 -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/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 +66 -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 -20
- 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/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 +80 -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/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/MonitorTemplateVariables/TemplateVariablesCatalog.js +39 -0
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.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/SideMenu.js +67 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +49 -53
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +25 -7
- 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/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/NetworkTopologyUtil.js +8 -3
- 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/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/package.json +2 -2
|
@@ -0,0 +1,676 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
2
|
+
import {
|
|
3
|
+
cleanup,
|
|
4
|
+
fireEvent,
|
|
5
|
+
render,
|
|
6
|
+
screen,
|
|
7
|
+
waitFor,
|
|
8
|
+
} from "@testing-library/react";
|
|
9
|
+
import React, { ReactElement } from "react";
|
|
10
|
+
import { MemoryRouter } from "react-router-dom";
|
|
11
|
+
import {
|
|
12
|
+
afterEach,
|
|
13
|
+
beforeEach,
|
|
14
|
+
describe,
|
|
15
|
+
expect,
|
|
16
|
+
jest,
|
|
17
|
+
test,
|
|
18
|
+
} from "@jest/globals";
|
|
19
|
+
import NetworkDeviceMonitoringMethod from "../../../Types/NetworkDevice/NetworkDeviceMonitoringMethod";
|
|
20
|
+
import MonitorStatus from "../../../Models/DatabaseModels/MonitorStatus";
|
|
21
|
+
import NetworkDevice from "../../../Models/DatabaseModels/NetworkDevice";
|
|
22
|
+
import { Green } from "../../../Types/BrandColors";
|
|
23
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* The Network Devices create form, as the page actually hands it to the
|
|
27
|
+
* table.
|
|
28
|
+
*
|
|
29
|
+
* Registering a device is a statement about the DEVICE: what it is called,
|
|
30
|
+
* where it is, and which probe can reach it. The form used to open by asking
|
|
31
|
+
* something else entirely — "how is this device monitored?", Probe or Bound
|
|
32
|
+
* monitor — a question about OneUptime's internals, put to the operator
|
|
33
|
+
* before they had told it a single thing about their device, and answered
|
|
34
|
+
* wrong by anyone who read "Bound monitor" as "monitored". The answer then
|
|
35
|
+
* decided whether the rest of the form asked for a probe or for a monitor,
|
|
36
|
+
* so getting it wrong produced a device that nothing polls and nothing
|
|
37
|
+
* reports on.
|
|
38
|
+
*
|
|
39
|
+
* There is no such question now. Every device this form creates is
|
|
40
|
+
* probe-polled — pinged by its probe, and walked over SNMP as well once it
|
|
41
|
+
* has credentials — and the bound-monitor override lives on the device's
|
|
42
|
+
* Settings page, where an operator meets it already knowing what their
|
|
43
|
+
* device is. The Monitor binding field went with the question: it existed
|
|
44
|
+
* only to serve the "Bound monitor" answer, and a field shown by a branch
|
|
45
|
+
* that can no longer be taken is a field nobody sees.
|
|
46
|
+
*
|
|
47
|
+
* MonitorBindingNeverRequired.test.ts (in App/Tests) pins the source text of
|
|
48
|
+
* the surfaces that DO bind a monitor. This pins the create form's own
|
|
49
|
+
* fields, evaluated the way BasicForm evaluates them, so a method question
|
|
50
|
+
* or a binding smuggled back in as a `required` callback, a
|
|
51
|
+
* `customValidation` or a differently-named helper is caught here rather
|
|
52
|
+
* than by a text match.
|
|
53
|
+
*
|
|
54
|
+
* ModelTable is replaced by a prop recorder — the point is what the page
|
|
55
|
+
* hands it, not re-testing the table (the same approach as
|
|
56
|
+
* NetworkDeviceBulkDelete.test.tsx).
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
jest.mock("react-i18next", () => {
|
|
60
|
+
return {
|
|
61
|
+
useTranslation: () => {
|
|
62
|
+
return {
|
|
63
|
+
t: (key: string): string => {
|
|
64
|
+
return key;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
jest.mock("../../../UI/Utils/Permission", () => {
|
|
72
|
+
return {
|
|
73
|
+
__esModule: true,
|
|
74
|
+
default: {
|
|
75
|
+
getAllPermissions: () => {
|
|
76
|
+
return [];
|
|
77
|
+
},
|
|
78
|
+
getProjectPermissions: () => {
|
|
79
|
+
return [];
|
|
80
|
+
},
|
|
81
|
+
getGlobalPermissions: () => {
|
|
82
|
+
return [];
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
jest.mock("../../../UI/Utils/User", () => {
|
|
89
|
+
return {
|
|
90
|
+
__esModule: true,
|
|
91
|
+
default: {
|
|
92
|
+
isMasterAdmin: () => {
|
|
93
|
+
return false;
|
|
94
|
+
},
|
|
95
|
+
getUserId: () => {
|
|
96
|
+
return null;
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
type FormValuesLike = Record<string, unknown>;
|
|
103
|
+
|
|
104
|
+
type CapturedFormField = {
|
|
105
|
+
field?: Record<string, unknown> | undefined;
|
|
106
|
+
overrideField?: Record<string, unknown> | undefined;
|
|
107
|
+
overrideFieldKey?: string | undefined;
|
|
108
|
+
title?: string | undefined;
|
|
109
|
+
stepId?: string | undefined;
|
|
110
|
+
description?: string | undefined;
|
|
111
|
+
placeholder?: string | undefined;
|
|
112
|
+
required?: boolean | ((values: FormValuesLike) => boolean) | undefined;
|
|
113
|
+
showIf?: ((values: FormValuesLike) => boolean) | undefined;
|
|
114
|
+
customValidation?: ((values: FormValuesLike) => string | null) | undefined;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
type CapturedFormStep = {
|
|
118
|
+
id: string;
|
|
119
|
+
title: string;
|
|
120
|
+
showIf?: ((values: FormValuesLike) => boolean) | undefined;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** A column as the page hands it to the table; only what the tests read. */
|
|
124
|
+
type CapturedTableColumn = {
|
|
125
|
+
field?: Record<string, unknown> | undefined;
|
|
126
|
+
title?: string | undefined;
|
|
127
|
+
getElement?: ((item: NetworkDevice) => ReactElement) | undefined;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type CapturedTableProps = {
|
|
131
|
+
formFields?: Array<CapturedFormField> | undefined;
|
|
132
|
+
formSteps?: Array<CapturedFormStep> | undefined;
|
|
133
|
+
columns?: Array<CapturedTableColumn> | undefined;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
let capturedTableProps: CapturedTableProps | null = null;
|
|
137
|
+
|
|
138
|
+
jest.mock("../../../UI/Components/ModelTable/ModelTable", () => {
|
|
139
|
+
return {
|
|
140
|
+
__esModule: true,
|
|
141
|
+
default: (props: CapturedTableProps) => {
|
|
142
|
+
capturedTableProps = props;
|
|
143
|
+
return null;
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
* The facet bar fetches sites, labels and probes on mount and owns the query
|
|
150
|
+
* the table is given. None of that is what these tests are about.
|
|
151
|
+
*/
|
|
152
|
+
jest.mock(
|
|
153
|
+
"../../../../App/FeatureSet/Dashboard/src/Components/ResourceOwners/useResourceOwners",
|
|
154
|
+
() => {
|
|
155
|
+
const actual: Record<string, unknown> = jest.requireActual(
|
|
156
|
+
"../../../../App/FeatureSet/Dashboard/src/Components/ResourceOwners/useResourceOwners",
|
|
157
|
+
) as Record<string, unknown>;
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
...actual,
|
|
161
|
+
__esModule: true,
|
|
162
|
+
default: () => {
|
|
163
|
+
return {
|
|
164
|
+
filterBar: null,
|
|
165
|
+
mergeFiltersIntoQuery: (
|
|
166
|
+
base: Record<string, unknown> | undefined,
|
|
167
|
+
) => {
|
|
168
|
+
return base || {};
|
|
169
|
+
},
|
|
170
|
+
hasActiveFilters: false,
|
|
171
|
+
facetSelections: {},
|
|
172
|
+
facetOperators: {},
|
|
173
|
+
setFacetSelection: () => {
|
|
174
|
+
// no-op
|
|
175
|
+
},
|
|
176
|
+
clearAllFacets: () => {
|
|
177
|
+
// no-op
|
|
178
|
+
},
|
|
179
|
+
facetSaveState: {},
|
|
180
|
+
restoreFacetState: () => {
|
|
181
|
+
// no-op
|
|
182
|
+
},
|
|
183
|
+
getOwnersForResource: () => {
|
|
184
|
+
return [];
|
|
185
|
+
},
|
|
186
|
+
isLoadingOwners: false,
|
|
187
|
+
onResourcesFetched: () => {
|
|
188
|
+
// no-op
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
jest.mock("../../../UI/Components/BulkUpdate/BulkLabelActions", () => {
|
|
197
|
+
return {
|
|
198
|
+
__esModule: true,
|
|
199
|
+
default: () => {
|
|
200
|
+
return { bulkActions: [], modals: null };
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
jest.mock(
|
|
206
|
+
"../../../../App/FeatureSet/Dashboard/src/Components/NetworkDevice/useBulkOidTemplateActions",
|
|
207
|
+
() => {
|
|
208
|
+
return {
|
|
209
|
+
__esModule: true,
|
|
210
|
+
default: () => {
|
|
211
|
+
return { bulkActions: [], modals: null };
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
jest.mock(
|
|
218
|
+
"../../../../App/FeatureSet/Dashboard/src/Components/NetworkDevice/DeviceSummaryCards",
|
|
219
|
+
() => {
|
|
220
|
+
return {
|
|
221
|
+
__esModule: true,
|
|
222
|
+
default: () => {
|
|
223
|
+
return null;
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
* One probe, so the SNMP half of the form has an option to offer and the
|
|
231
|
+
* probe field's own `required: true` is exercised against real data.
|
|
232
|
+
*/
|
|
233
|
+
jest.mock("../../../../App/FeatureSet/Dashboard/src/Utils/Probe", () => {
|
|
234
|
+
return {
|
|
235
|
+
__esModule: true,
|
|
236
|
+
default: {
|
|
237
|
+
getAllProbes: async () => {
|
|
238
|
+
return [{ _id: "probe-1", name: "Branch probe" }];
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
import NetworkDevicesPage from "../../../../App/FeatureSet/Dashboard/src/Pages/NetworkDevice/Devices";
|
|
245
|
+
import PageComponentProps from "../../../../App/FeatureSet/Dashboard/src/Pages/PageComponentProps";
|
|
246
|
+
import {
|
|
247
|
+
BOUND_MONITOR_PENDING_TOOLTIP,
|
|
248
|
+
NO_MONITOR_QUALIFIER,
|
|
249
|
+
UNBOUND_MONITOR_BACKED_PENDING_TOOLTIP,
|
|
250
|
+
} from "../../../../App/FeatureSet/Dashboard/src/Components/NetworkDevice/DeviceStatusUtil";
|
|
251
|
+
import Route from "../../../Types/API/Route";
|
|
252
|
+
|
|
253
|
+
const PAGE_PROPS: PageComponentProps = {
|
|
254
|
+
pageRoute: new Route("/dashboard/network-devices"),
|
|
255
|
+
currentProject: null,
|
|
256
|
+
hasPaymentMethod: true,
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
async function renderDevicesPage(): Promise<CapturedTableProps> {
|
|
260
|
+
const Page: (props: PageComponentProps) => ReactElement =
|
|
261
|
+
NetworkDevicesPage as unknown as (
|
|
262
|
+
props: PageComponentProps,
|
|
263
|
+
) => ReactElement;
|
|
264
|
+
|
|
265
|
+
render(
|
|
266
|
+
<MemoryRouter>
|
|
267
|
+
<Page {...PAGE_PROPS} />
|
|
268
|
+
</MemoryRouter>,
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
await waitFor(() => {
|
|
272
|
+
expect(capturedTableProps).not.toBeNull();
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
return capturedTableProps!;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** The field for a column, or undefined when the form does not ask for it. */
|
|
279
|
+
function maybeFieldFor(
|
|
280
|
+
props: CapturedTableProps,
|
|
281
|
+
key: string,
|
|
282
|
+
): CapturedFormField | undefined {
|
|
283
|
+
return (props.formFields || []).find((field: CapturedFormField): boolean => {
|
|
284
|
+
return Object.keys(field.field || {})[0] === key;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function fieldFor(props: CapturedTableProps, key: string): CapturedFormField {
|
|
289
|
+
const match: CapturedFormField | undefined = maybeFieldFor(props, key);
|
|
290
|
+
|
|
291
|
+
expect({ key: key, found: Boolean(match) }).toEqual({
|
|
292
|
+
key: key,
|
|
293
|
+
found: true,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
return match!;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** `required` the way FormField.tsx reads it: a boolean, or a callback. */
|
|
300
|
+
function isRequired(field: CapturedFormField, values: FormValuesLike): boolean {
|
|
301
|
+
if (typeof field.required === "function") {
|
|
302
|
+
return field.required(values);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return field.required === true;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/*
|
|
309
|
+
* A half-filled create form. There is no monitoring method among the values,
|
|
310
|
+
* because the form does not ask for one — which is exactly what makes it the
|
|
311
|
+
* right thing to evaluate every showIf and every `required` against.
|
|
312
|
+
*/
|
|
313
|
+
const DEVICE: FormValuesLike = {
|
|
314
|
+
name: "core-switch-01",
|
|
315
|
+
hostname: "10.0.0.1",
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
/** `showIf` the way BasicForm reads it: absent means "always". */
|
|
319
|
+
function isShown(field: CapturedFormField, values: FormValuesLike): boolean {
|
|
320
|
+
return field.showIf ? field.showIf(values) : true;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function stepIdsOf(props: CapturedTableProps): Array<string> {
|
|
324
|
+
return (props.formSteps || []).map((step: CapturedFormStep): string => {
|
|
325
|
+
return step.id;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
describe("the Network Devices create form asks about the device, not about monitoring", () => {
|
|
330
|
+
beforeEach(() => {
|
|
331
|
+
capturedTableProps = null;
|
|
332
|
+
window.localStorage.clear();
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
afterEach(() => {
|
|
336
|
+
cleanup();
|
|
337
|
+
jest.clearAllMocks();
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
/*
|
|
341
|
+
* The regression this file exists for. Not "the question is answered for
|
|
342
|
+
* you" and not "the question is hidden" — the field is GONE, because a
|
|
343
|
+
* hidden field's default is still submitted and a collapsed question is
|
|
344
|
+
* still a question somebody has to maintain the copy for.
|
|
345
|
+
*/
|
|
346
|
+
test("has no monitoring-method field and no step to put one on", async () => {
|
|
347
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
348
|
+
|
|
349
|
+
expect(maybeFieldFor(props, "monitoringMethod")).toBeUndefined();
|
|
350
|
+
expect(stepIdsOf(props)).not.toContain("monitoring-method");
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
/*
|
|
354
|
+
* The binding existed only to serve the "Bound monitor" answer, and it is
|
|
355
|
+
* still offered — on the device's Settings page, once the device exists
|
|
356
|
+
* and the operator knows they need the override.
|
|
357
|
+
*/
|
|
358
|
+
test("offers no monitor binding", async () => {
|
|
359
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
360
|
+
|
|
361
|
+
expect(maybeFieldFor(props, "monitor")).toBeUndefined();
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
/*
|
|
365
|
+
* The steps that are left are all about the device. Pinned as a set,
|
|
366
|
+
* because "SNMP" losing its step is how an optional step becomes an
|
|
367
|
+
* invisible one (its fields would then render on every step, or on none —
|
|
368
|
+
* see NetworkFormStepsInvariants.test.ts).
|
|
369
|
+
*/
|
|
370
|
+
test("walks the operator through device details, probe and site, and SNMP", async () => {
|
|
371
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
372
|
+
|
|
373
|
+
expect(stepIdsOf(props)).toEqual([
|
|
374
|
+
"device-details",
|
|
375
|
+
"probe-and-site",
|
|
376
|
+
"snmp",
|
|
377
|
+
]);
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
/*
|
|
381
|
+
* What IS required is the identity of the device and the probe that
|
|
382
|
+
* reaches it. A form that dropped the method question by dropping
|
|
383
|
+
* questions wholesale would pass the tests above and let a nameless,
|
|
384
|
+
* addressless, unpolled device through to the server's own validation.
|
|
385
|
+
*/
|
|
386
|
+
test("still requires the device's name, hostname and probe", async () => {
|
|
387
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
388
|
+
|
|
389
|
+
expect(isRequired(fieldFor(props, "name"), DEVICE)).toBe(true);
|
|
390
|
+
expect(isRequired(fieldFor(props, "hostname"), DEVICE)).toBe(true);
|
|
391
|
+
expect(isRequired(fieldFor(props, "probe"), DEVICE)).toBe(true);
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
/*
|
|
395
|
+
* Nothing on this form branches on a monitoring method any more, so
|
|
396
|
+
* nothing may HIDE on one either: a showIf that returned false for the
|
|
397
|
+
* values this form actually holds would take its field off the wizard
|
|
398
|
+
* entirely, which is silent — BasicForm renders what matches and warns
|
|
399
|
+
* about nothing.
|
|
400
|
+
*/
|
|
401
|
+
test("shows every field it asks for, whatever the form holds", async () => {
|
|
402
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
403
|
+
|
|
404
|
+
for (const key of ["name", "hostname", "probe", "site"]) {
|
|
405
|
+
expect({
|
|
406
|
+
key: key,
|
|
407
|
+
shown: isShown(fieldFor(props, key), DEVICE),
|
|
408
|
+
}).toEqual({ key: key, shown: true });
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
/*
|
|
413
|
+
* The site is the one thing on this form the operator may genuinely not
|
|
414
|
+
* know yet — a device found in a cupboard belongs somewhere, and which
|
|
415
|
+
* site that is can be settled later (or by an assignment rule).
|
|
416
|
+
*/
|
|
417
|
+
test("does not require a site to register a device", async () => {
|
|
418
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
419
|
+
const site: CapturedFormField = fieldFor(props, "site");
|
|
420
|
+
|
|
421
|
+
expect(isRequired(site, DEVICE)).toBe(false);
|
|
422
|
+
expect(site.customValidation).toBeUndefined();
|
|
423
|
+
expect(site.placeholder?.toLowerCase()).toContain("optional");
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
/*
|
|
428
|
+
* The Status column, RENDERED.
|
|
429
|
+
*
|
|
430
|
+
* The same unbound-versus-bound distinction the device Overview hero draws
|
|
431
|
+
* (DeviceStatusHero.test.tsx) is drawn here, in the list every operator
|
|
432
|
+
* scans first: a monitor-backed device with nothing bound reads "Pending"
|
|
433
|
+
* with a gray "No monitor" qualifier beside it, one whose monitor is bound
|
|
434
|
+
* but quiet reads "Pending" alone, and one whose monitor has reported shows
|
|
435
|
+
* the monitor's own status word. Every sentence of that was pinned by a
|
|
436
|
+
* source-text match, so negating the predicate in this one column — which
|
|
437
|
+
* puts "No monitor" on every BOUND device and takes it off the ones that
|
|
438
|
+
* need it — left every suite green. The page's real column definition is
|
|
439
|
+
* taken from the captured props and its `getElement` rendered per row.
|
|
440
|
+
*
|
|
441
|
+
* Tooltips are tippy, portalled to document.body on mouseenter (see the
|
|
442
|
+
* notes in DisabledButtonTooltip.test.tsx).
|
|
443
|
+
*/
|
|
444
|
+
|
|
445
|
+
const STATUS_DEVICE_ID: ObjectID = new ObjectID(
|
|
446
|
+
"22222222-0000-4000-8000-000000000002",
|
|
447
|
+
);
|
|
448
|
+
const STATUS_MONITOR_ID: ObjectID = new ObjectID(
|
|
449
|
+
"33333333-0000-4000-8000-000000000003",
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
const STATUS_PROBE_ID: ObjectID = new ObjectID(
|
|
453
|
+
"44444444-0000-4000-8000-000000000004",
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
/** A list row carrying only the columns the Status cell is decided from. */
|
|
457
|
+
function statusRow(data: {
|
|
458
|
+
monitoringMethod: string | undefined;
|
|
459
|
+
monitorId?: ObjectID | undefined;
|
|
460
|
+
probeId?: ObjectID | undefined;
|
|
461
|
+
status?: { name: string; isOfflineState: boolean } | undefined;
|
|
462
|
+
}): NetworkDevice {
|
|
463
|
+
const row: NetworkDevice = new NetworkDevice();
|
|
464
|
+
row.id = STATUS_DEVICE_ID;
|
|
465
|
+
row.name = "lobby-ap-01";
|
|
466
|
+
row.hostname = "10.0.0.7";
|
|
467
|
+
|
|
468
|
+
if (data.monitoringMethod !== undefined) {
|
|
469
|
+
row.monitoringMethod = data.monitoringMethod;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (data.monitorId) {
|
|
473
|
+
row.monitorId = data.monitorId;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (data.probeId) {
|
|
477
|
+
row.probeId = data.probeId;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (data.status) {
|
|
481
|
+
const status: MonitorStatus = new MonitorStatus();
|
|
482
|
+
status.name = data.status.name;
|
|
483
|
+
status.color = Green;
|
|
484
|
+
status.isOfflineState = data.status.isOfflineState;
|
|
485
|
+
row.currentMonitorStatus = status;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return row;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function statusColumnFor(props: CapturedTableProps): CapturedTableColumn {
|
|
492
|
+
const match: CapturedTableColumn | undefined = (props.columns || []).find(
|
|
493
|
+
(column: CapturedTableColumn): boolean => {
|
|
494
|
+
return column.title === "Status";
|
|
495
|
+
},
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
expect({ title: "Status", found: Boolean(match) }).toEqual({
|
|
499
|
+
title: "Status",
|
|
500
|
+
found: true,
|
|
501
|
+
});
|
|
502
|
+
expect(match!.getElement).toBeDefined();
|
|
503
|
+
|
|
504
|
+
return match!;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Render the cell the way the table would, and hand back its root. */
|
|
508
|
+
function renderStatusCell(
|
|
509
|
+
props: CapturedTableProps,
|
|
510
|
+
row: NetworkDevice,
|
|
511
|
+
): HTMLElement {
|
|
512
|
+
const column: CapturedTableColumn = statusColumnFor(props);
|
|
513
|
+
|
|
514
|
+
const rendered: { container: HTMLElement } = render(
|
|
515
|
+
<MemoryRouter>{column.getElement!(row)}</MemoryRouter>,
|
|
516
|
+
);
|
|
517
|
+
|
|
518
|
+
return rendered.container;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function pillTextsIn(container: HTMLElement): Array<string> {
|
|
522
|
+
return Array.from(
|
|
523
|
+
container.querySelectorAll<HTMLElement>('[data-testid="pill"]'),
|
|
524
|
+
).map((pill: HTMLElement): string => {
|
|
525
|
+
return pill.textContent || "";
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function pillIn(container: HTMLElement, text: string): HTMLElement {
|
|
530
|
+
const match: HTMLElement | undefined = Array.from(
|
|
531
|
+
container.querySelectorAll<HTMLElement>('[data-testid="pill"]'),
|
|
532
|
+
).find((pill: HTMLElement): boolean => {
|
|
533
|
+
return pill.textContent === text;
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
expect({ text: text, found: Boolean(match) }).toEqual({
|
|
537
|
+
text: text,
|
|
538
|
+
found: true,
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
return match!;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/** Hover a pill and return the text of every tooltip tippy has mounted. */
|
|
545
|
+
function tooltipsAfterHovering(pill: HTMLElement): Array<string> {
|
|
546
|
+
fireEvent.mouseEnter(pill);
|
|
547
|
+
|
|
548
|
+
return screen.getAllByRole("tooltip").map((tooltip: HTMLElement): string => {
|
|
549
|
+
return tooltip.textContent || "";
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
describe("the Network Devices list's Status column", () => {
|
|
554
|
+
beforeEach(() => {
|
|
555
|
+
capturedTableProps = null;
|
|
556
|
+
window.localStorage.clear();
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
afterEach(() => {
|
|
560
|
+
cleanup();
|
|
561
|
+
jest.clearAllMocks();
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
test("reads Pending with the No monitor qualifier for a monitor-backed device with nothing bound", async () => {
|
|
565
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
566
|
+
|
|
567
|
+
const cell: HTMLElement = renderStatusCell(
|
|
568
|
+
props,
|
|
569
|
+
statusRow({ monitoringMethod: NetworkDeviceMonitoringMethod.Monitor }),
|
|
570
|
+
);
|
|
571
|
+
|
|
572
|
+
expect(pillTextsIn(cell)).toEqual(["Pending", NO_MONITOR_QUALIFIER.text]);
|
|
573
|
+
expect(pillTextsIn(cell)).toContain("No monitor");
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
test("reads Pending alone for a bound monitor that has not reported", async () => {
|
|
577
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
578
|
+
|
|
579
|
+
const cell: HTMLElement = renderStatusCell(
|
|
580
|
+
props,
|
|
581
|
+
statusRow({
|
|
582
|
+
monitoringMethod: NetworkDeviceMonitoringMethod.Monitor,
|
|
583
|
+
monitorId: STATUS_MONITOR_ID,
|
|
584
|
+
}),
|
|
585
|
+
);
|
|
586
|
+
|
|
587
|
+
expect(pillTextsIn(cell)).toEqual(["Pending"]);
|
|
588
|
+
expect(pillTextsIn(cell)).not.toContain("No monitor");
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
/*
|
|
592
|
+
* NULL in the column is what every device created before the method
|
|
593
|
+
* existed holds, and it parses as Probe — a device with no binding to be
|
|
594
|
+
* missing, so no "No monitor" however long it sits on Pending. With a
|
|
595
|
+
* probe assigned it is simply waiting for its first poll.
|
|
596
|
+
*/
|
|
597
|
+
test("reads Pending alone for a probe-polled device that has never been polled", async () => {
|
|
598
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
599
|
+
|
|
600
|
+
const cell: HTMLElement = renderStatusCell(
|
|
601
|
+
props,
|
|
602
|
+
statusRow({ monitoringMethod: undefined, probeId: STATUS_PROBE_ID }),
|
|
603
|
+
);
|
|
604
|
+
|
|
605
|
+
expect(pillTextsIn(cell)).toEqual(["Pending"]);
|
|
606
|
+
expect(pillTextsIn(cell)).not.toContain("No monitor");
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
/*
|
|
610
|
+
* The probe-polled counterpart of "No monitor": a device with no probe is
|
|
611
|
+
* not waiting for a poll, because none is coming. It is a different pill
|
|
612
|
+
* for a different fix, and it must not read as the monitor one — the
|
|
613
|
+
* create form requires a probe precisely so this row is rare.
|
|
614
|
+
*/
|
|
615
|
+
test("reads Pending with the No probe qualifier when no probe is assigned", async () => {
|
|
616
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
617
|
+
|
|
618
|
+
const cell: HTMLElement = renderStatusCell(
|
|
619
|
+
props,
|
|
620
|
+
statusRow({ monitoringMethod: undefined }),
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
expect(pillTextsIn(cell)).toEqual(["Pending", "No probe"]);
|
|
624
|
+
expect(pillTextsIn(cell)).not.toContain("No monitor");
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
test("shows the monitor's own status word once the bound monitor has reported", async () => {
|
|
628
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
629
|
+
|
|
630
|
+
const cell: HTMLElement = renderStatusCell(
|
|
631
|
+
props,
|
|
632
|
+
statusRow({
|
|
633
|
+
monitoringMethod: NetworkDeviceMonitoringMethod.Monitor,
|
|
634
|
+
monitorId: STATUS_MONITOR_ID,
|
|
635
|
+
status: { name: "Operational", isOfflineState: false },
|
|
636
|
+
}),
|
|
637
|
+
);
|
|
638
|
+
|
|
639
|
+
expect(pillTextsIn(cell)).toEqual(["Operational"]);
|
|
640
|
+
expect(pillTextsIn(cell)).not.toContain("No monitor");
|
|
641
|
+
expect(pillTextsIn(cell)).not.toContain("Pending");
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
/*
|
|
645
|
+
* The two Pendings look identical; the tooltip is the only place the list
|
|
646
|
+
* says which one it is, and a single hedged sentence for both was the
|
|
647
|
+
* thing the split was made to avoid.
|
|
648
|
+
*/
|
|
649
|
+
test("explains the unbound Pending as a missing binding and the bound one as a quiet monitor", async () => {
|
|
650
|
+
const props: CapturedTableProps = await renderDevicesPage();
|
|
651
|
+
|
|
652
|
+
const unbound: HTMLElement = renderStatusCell(
|
|
653
|
+
props,
|
|
654
|
+
statusRow({ monitoringMethod: NetworkDeviceMonitoringMethod.Monitor }),
|
|
655
|
+
);
|
|
656
|
+
|
|
657
|
+
expect(tooltipsAfterHovering(pillIn(unbound, "Pending"))).toContain(
|
|
658
|
+
UNBOUND_MONITOR_BACKED_PENDING_TOOLTIP,
|
|
659
|
+
);
|
|
660
|
+
expect(
|
|
661
|
+
tooltipsAfterHovering(pillIn(unbound, NO_MONITOR_QUALIFIER.text)),
|
|
662
|
+
).toContain(NO_MONITOR_QUALIFIER.tooltip);
|
|
663
|
+
|
|
664
|
+
const bound: HTMLElement = renderStatusCell(
|
|
665
|
+
props,
|
|
666
|
+
statusRow({
|
|
667
|
+
monitoringMethod: NetworkDeviceMonitoringMethod.Monitor,
|
|
668
|
+
monitorId: STATUS_MONITOR_ID,
|
|
669
|
+
}),
|
|
670
|
+
);
|
|
671
|
+
|
|
672
|
+
expect(tooltipsAfterHovering(pillIn(bound, "Pending"))).toContain(
|
|
673
|
+
BOUND_MONITOR_PENDING_TOOLTIP,
|
|
674
|
+
);
|
|
675
|
+
});
|
|
676
|
+
});
|