@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,377 @@
|
|
|
1
|
+
import {
|
|
2
|
+
lockPageScroll,
|
|
3
|
+
resetPageScrollLockForTesting,
|
|
4
|
+
unlockPageScroll,
|
|
5
|
+
usePageScrollLock,
|
|
6
|
+
} from "../../../UI/Utils/PageScrollLock";
|
|
7
|
+
import { render, RenderResult } from "@testing-library/react";
|
|
8
|
+
import React, { FunctionComponent, ReactElement } from "react";
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, test } from "@jest/globals";
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Issue #3553: the Ask AI panel dimmed the page, declared aria-modal, and then
|
|
13
|
+
* let the incident list behind it scroll away under the wheel, because nothing
|
|
14
|
+
* ever took this lock. The panel now takes it through usePageScrollLock, which
|
|
15
|
+
* is the surface every dialog is meant to use — so the guarantees it makes are
|
|
16
|
+
* pinned here, at the one place they are implemented, rather than re-derived in
|
|
17
|
+
* each component suite.
|
|
18
|
+
*
|
|
19
|
+
* The counter is module state that outlives a single test, so every case starts
|
|
20
|
+
* from a known zero and a known body.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type SetBodyFunction = (overflow: string, paddingRight?: string) => void;
|
|
24
|
+
|
|
25
|
+
const setBody: SetBodyFunction = (
|
|
26
|
+
overflow: string,
|
|
27
|
+
paddingRight: string = "",
|
|
28
|
+
): void => {
|
|
29
|
+
/*
|
|
30
|
+
* setProperty/removeProperty rather than assignment: jsdom's CSS layer
|
|
31
|
+
* silently ignores `style.paddingRight = ""`, so an assigning reset would
|
|
32
|
+
* carry one case's gutter into the next and quietly hand a later assertion
|
|
33
|
+
* the wrong page to look at.
|
|
34
|
+
*/
|
|
35
|
+
document.body.style.setProperty("overflow", overflow);
|
|
36
|
+
document.body.style.setProperty("padding-right", paddingRight);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* jsdom reports innerWidth === clientWidth, so it never has a scrollbar to
|
|
41
|
+
* reclaim. Faking the gap is the only way to exercise the padding compensation,
|
|
42
|
+
* which is the half of the lock a user notices as the page jumping sideways.
|
|
43
|
+
*/
|
|
44
|
+
type SetScrollbarWidthFunction = (width: number) => void;
|
|
45
|
+
|
|
46
|
+
const setScrollbarWidth: SetScrollbarWidthFunction = (width: number): void => {
|
|
47
|
+
Object.defineProperty(document.documentElement, "clientWidth", {
|
|
48
|
+
configurable: true,
|
|
49
|
+
value: window.innerWidth - width,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const Locker: FunctionComponent<{ isLocked: boolean }> = (props: {
|
|
54
|
+
isLocked: boolean;
|
|
55
|
+
}): ReactElement => {
|
|
56
|
+
usePageScrollLock(props.isLocked);
|
|
57
|
+
|
|
58
|
+
return <div data-testid="locker" />;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
describe("PageScrollLock", () => {
|
|
62
|
+
beforeEach(() => {
|
|
63
|
+
resetPageScrollLockForTesting();
|
|
64
|
+
setBody("");
|
|
65
|
+
setScrollbarWidth(0);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
afterEach(() => {
|
|
69
|
+
resetPageScrollLockForTesting();
|
|
70
|
+
setBody("");
|
|
71
|
+
setScrollbarWidth(0);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("lockPageScroll / unlockPageScroll", () => {
|
|
75
|
+
test("hides the page scrollbar while a dialog is up", () => {
|
|
76
|
+
setBody("auto");
|
|
77
|
+
|
|
78
|
+
lockPageScroll();
|
|
79
|
+
|
|
80
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("puts back whatever the page had before, not a hardcoded default", () => {
|
|
84
|
+
setBody("scroll");
|
|
85
|
+
|
|
86
|
+
lockPageScroll();
|
|
87
|
+
unlockPageScroll();
|
|
88
|
+
|
|
89
|
+
expect(document.body.style.overflow).toBe("scroll");
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("restores an empty inline overflow rather than inventing one", () => {
|
|
93
|
+
setBody("");
|
|
94
|
+
|
|
95
|
+
lockPageScroll();
|
|
96
|
+
unlockPageScroll();
|
|
97
|
+
|
|
98
|
+
expect(document.body.style.overflow).toBe("");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test("keeps the page locked while an inner dialog closes over an outer one", () => {
|
|
102
|
+
setBody("auto");
|
|
103
|
+
|
|
104
|
+
lockPageScroll();
|
|
105
|
+
lockPageScroll();
|
|
106
|
+
|
|
107
|
+
unlockPageScroll();
|
|
108
|
+
|
|
109
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
110
|
+
|
|
111
|
+
unlockPageScroll();
|
|
112
|
+
|
|
113
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("restores the page exactly once no matter how deep the nesting went", () => {
|
|
117
|
+
setBody("auto");
|
|
118
|
+
|
|
119
|
+
lockPageScroll();
|
|
120
|
+
lockPageScroll();
|
|
121
|
+
lockPageScroll();
|
|
122
|
+
unlockPageScroll();
|
|
123
|
+
unlockPageScroll();
|
|
124
|
+
unlockPageScroll();
|
|
125
|
+
|
|
126
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("leaves the page alone when unlocked with nothing open", () => {
|
|
130
|
+
/*
|
|
131
|
+
* A stray release — a surface unlocking twice, a cleanup outliving the
|
|
132
|
+
* lock it was paired with — used to paint the snapshot from some earlier
|
|
133
|
+
* dialog straight over the live page, wiping whatever overflow the page
|
|
134
|
+
* had set for itself. Nothing is open, so there is nothing to put back.
|
|
135
|
+
*/
|
|
136
|
+
setBody("auto", "8px");
|
|
137
|
+
|
|
138
|
+
unlockPageScroll();
|
|
139
|
+
unlockPageScroll();
|
|
140
|
+
|
|
141
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
142
|
+
expect(document.body.style.paddingRight).toBe("8px");
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("counts the next lock after a stray unlock as a first lock", () => {
|
|
146
|
+
/*
|
|
147
|
+
* The stray unlocks must not leave a credit behind either: one lock still
|
|
148
|
+
* has to inert the page, and one unlock still has to hand it back. A
|
|
149
|
+
* counter allowed to run negative would need three locks before anything
|
|
150
|
+
* happened at all.
|
|
151
|
+
*/
|
|
152
|
+
setBody("auto");
|
|
153
|
+
|
|
154
|
+
unlockPageScroll();
|
|
155
|
+
unlockPageScroll();
|
|
156
|
+
|
|
157
|
+
lockPageScroll();
|
|
158
|
+
|
|
159
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
160
|
+
|
|
161
|
+
unlockPageScroll();
|
|
162
|
+
|
|
163
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("re-reads the page on every fresh lock instead of reusing a stale snapshot", () => {
|
|
167
|
+
setBody("auto");
|
|
168
|
+
|
|
169
|
+
lockPageScroll();
|
|
170
|
+
unlockPageScroll();
|
|
171
|
+
|
|
172
|
+
setBody("scroll");
|
|
173
|
+
|
|
174
|
+
lockPageScroll();
|
|
175
|
+
unlockPageScroll();
|
|
176
|
+
|
|
177
|
+
expect(document.body.style.overflow).toBe("scroll");
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test("pads the page by the width of the scrollbar it just hid", () => {
|
|
181
|
+
setScrollbarWidth(15);
|
|
182
|
+
|
|
183
|
+
lockPageScroll();
|
|
184
|
+
|
|
185
|
+
expect(document.body.style.paddingRight).toBe("15px");
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test("removes that padding again on unlock", () => {
|
|
189
|
+
setScrollbarWidth(15);
|
|
190
|
+
|
|
191
|
+
lockPageScroll();
|
|
192
|
+
unlockPageScroll();
|
|
193
|
+
|
|
194
|
+
expect(document.body.style.paddingRight).toBe("");
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test("preserves padding the page already had of its own", () => {
|
|
198
|
+
setBody("auto", "8px");
|
|
199
|
+
setScrollbarWidth(15);
|
|
200
|
+
|
|
201
|
+
lockPageScroll();
|
|
202
|
+
|
|
203
|
+
expect(document.body.style.paddingRight).toBe("15px");
|
|
204
|
+
|
|
205
|
+
unlockPageScroll();
|
|
206
|
+
|
|
207
|
+
expect(document.body.style.paddingRight).toBe("8px");
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("adds no padding on overlay-scrollbar platforms, where nothing was reclaimed", () => {
|
|
211
|
+
setScrollbarWidth(0);
|
|
212
|
+
|
|
213
|
+
lockPageScroll();
|
|
214
|
+
|
|
215
|
+
expect(document.body.style.paddingRight).toBe("");
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test("pads only for the outermost dialog, so nesting does not stack gutters", () => {
|
|
219
|
+
setScrollbarWidth(15);
|
|
220
|
+
|
|
221
|
+
lockPageScroll();
|
|
222
|
+
lockPageScroll();
|
|
223
|
+
|
|
224
|
+
expect(document.body.style.paddingRight).toBe("15px");
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
describe("usePageScrollLock", () => {
|
|
229
|
+
test("locks the page for a surface that mounts open", () => {
|
|
230
|
+
setBody("auto");
|
|
231
|
+
|
|
232
|
+
render(<Locker isLocked={true} />);
|
|
233
|
+
|
|
234
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
test("leaves the page alone for a surface that is mounted but closed", () => {
|
|
238
|
+
setBody("auto");
|
|
239
|
+
|
|
240
|
+
render(<Locker isLocked={false} />);
|
|
241
|
+
|
|
242
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test("locks when a mounted-but-closed surface opens", () => {
|
|
246
|
+
setBody("auto");
|
|
247
|
+
|
|
248
|
+
const rendered: RenderResult = render(<Locker isLocked={false} />);
|
|
249
|
+
|
|
250
|
+
rendered.rerender(<Locker isLocked={true} />);
|
|
251
|
+
|
|
252
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
test("releases when the surface closes without unmounting", () => {
|
|
256
|
+
/*
|
|
257
|
+
* AIChatPanel's shape exactly: it stays mounted for the life of the app
|
|
258
|
+
* and swaps its own open flag, so a lock keyed on mount alone would never
|
|
259
|
+
* be handed back.
|
|
260
|
+
*/
|
|
261
|
+
setBody("auto");
|
|
262
|
+
|
|
263
|
+
const rendered: RenderResult = render(<Locker isLocked={true} />);
|
|
264
|
+
|
|
265
|
+
rendered.rerender(<Locker isLocked={false} />);
|
|
266
|
+
|
|
267
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
test("releases when the surface unmounts while still open", () => {
|
|
271
|
+
setBody("auto");
|
|
272
|
+
|
|
273
|
+
const rendered: RenderResult = render(<Locker isLocked={true} />);
|
|
274
|
+
|
|
275
|
+
rendered.unmount();
|
|
276
|
+
|
|
277
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
test("survives being opened and closed repeatedly", () => {
|
|
281
|
+
setBody("auto");
|
|
282
|
+
|
|
283
|
+
const rendered: RenderResult = render(<Locker isLocked={false} />);
|
|
284
|
+
|
|
285
|
+
for (let index: number = 0; index < 5; index++) {
|
|
286
|
+
rendered.rerender(<Locker isLocked={true} />);
|
|
287
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
288
|
+
|
|
289
|
+
rendered.rerender(<Locker isLocked={false} />);
|
|
290
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test("does not re-take the lock on a re-render that leaves it open", () => {
|
|
295
|
+
setBody("auto");
|
|
296
|
+
|
|
297
|
+
const rendered: RenderResult = render(<Locker isLocked={true} />);
|
|
298
|
+
|
|
299
|
+
rendered.rerender(<Locker isLocked={true} />);
|
|
300
|
+
rendered.rerender(<Locker isLocked={true} />);
|
|
301
|
+
|
|
302
|
+
/*
|
|
303
|
+
* A dependency array that missed would acquire once per render and leave
|
|
304
|
+
* the counter far above zero, so one unmount could never unlock the page.
|
|
305
|
+
*/
|
|
306
|
+
rendered.unmount();
|
|
307
|
+
|
|
308
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
test("shares one lock across two surfaces open at the same time", () => {
|
|
312
|
+
setBody("auto");
|
|
313
|
+
|
|
314
|
+
const first: RenderResult = render(<Locker isLocked={true} />);
|
|
315
|
+
const second: RenderResult = render(<Locker isLocked={true} />);
|
|
316
|
+
|
|
317
|
+
first.unmount();
|
|
318
|
+
|
|
319
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
320
|
+
|
|
321
|
+
second.unmount();
|
|
322
|
+
|
|
323
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
test("shares that lock with imperative callers too", () => {
|
|
327
|
+
setBody("auto");
|
|
328
|
+
|
|
329
|
+
lockPageScroll();
|
|
330
|
+
|
|
331
|
+
const rendered: RenderResult = render(<Locker isLocked={true} />);
|
|
332
|
+
|
|
333
|
+
rendered.unmount();
|
|
334
|
+
|
|
335
|
+
expect(document.body.style.overflow).toBe("hidden");
|
|
336
|
+
|
|
337
|
+
unlockPageScroll();
|
|
338
|
+
|
|
339
|
+
expect(document.body.style.overflow).toBe("auto");
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("locks before paint, so a right-pinned surface never draws in the wrong place", () => {
|
|
343
|
+
/*
|
|
344
|
+
* useLayoutEffect, not useEffect. Hiding the scrollbar widens the
|
|
345
|
+
* viewport a fixed overlay resolves `right: 0` against, so a lock that
|
|
346
|
+
* landed after paint would shift the panel sideways by the scrollbar's
|
|
347
|
+
* width on its first frame — the jump SideOver used to document.
|
|
348
|
+
*
|
|
349
|
+
* React flushes every layout effect in a commit before any passive one,
|
|
350
|
+
* so a passive effect ordered AHEAD of the locker in the tree is the
|
|
351
|
+
* discriminator: it sees "hidden" only if the lock was taken during
|
|
352
|
+
* layout. Were the hook a plain useEffect, this probe would run first and
|
|
353
|
+
* still see the page scrolling.
|
|
354
|
+
*/
|
|
355
|
+
setBody("auto");
|
|
356
|
+
|
|
357
|
+
let overflowSeenAfterPaint: string = "";
|
|
358
|
+
|
|
359
|
+
const Probe: FunctionComponent = (): ReactElement => {
|
|
360
|
+
React.useEffect(() => {
|
|
361
|
+
overflowSeenAfterPaint = document.body.style.overflow;
|
|
362
|
+
}, []);
|
|
363
|
+
|
|
364
|
+
return <div />;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
render(
|
|
368
|
+
<React.Fragment>
|
|
369
|
+
<Probe />
|
|
370
|
+
<Locker isLocked={true} />
|
|
371
|
+
</React.Fragment>,
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
expect(overflowSeenAfterPaint).toBe("hidden");
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
});
|
|
@@ -70,6 +70,7 @@ import PermissionGate, {
|
|
|
70
70
|
} from "../../../UI/Utils/PermissionGate";
|
|
71
71
|
import { CardButtonSchema } from "../../../UI/Components/Card/Card";
|
|
72
72
|
import Monitor from "../../../Models/DatabaseModels/Monitor";
|
|
73
|
+
import Team from "../../../Models/DatabaseModels/Team";
|
|
73
74
|
import Log from "../../../Models/AnalyticsModels/Log";
|
|
74
75
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
75
76
|
import Permission from "../../../Types/Permission";
|
|
@@ -297,6 +298,83 @@ describe("PermissionGate", () => {
|
|
|
297
298
|
});
|
|
298
299
|
});
|
|
299
300
|
|
|
301
|
+
/*
|
|
302
|
+
* The server widens a model's declared ACL with the matching
|
|
303
|
+
* *AllOperationalResources wildcard for anything marked @OperationalResource
|
|
304
|
+
* (TablePermission.getEffectiveModelPermissions). The gate has to do the
|
|
305
|
+
* same, or it is stricter than the endpoint it stands in front of: somebody
|
|
306
|
+
* granted "Edit All Operational Resources" and nothing else was told by every
|
|
307
|
+
* edit button in the product that they could not edit, while the API would
|
|
308
|
+
* have accepted the write.
|
|
309
|
+
*/
|
|
310
|
+
describe("operational resource wildcards", () => {
|
|
311
|
+
test("a wildcard grants the operation on an operational resource", () => {
|
|
312
|
+
permissionsForTest = [Permission.EditAllOperationalResources];
|
|
313
|
+
|
|
314
|
+
const result: PermissionGateResult = PermissionGate.check(
|
|
315
|
+
new Monitor(),
|
|
316
|
+
ModelAction.Update,
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
expect(result.isAllowed).toBe(true);
|
|
320
|
+
expect(result.disabledReason).toBeUndefined();
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
test("each wildcard only covers its own operation", () => {
|
|
324
|
+
permissionsForTest = [Permission.ReadAllOperationalResources];
|
|
325
|
+
|
|
326
|
+
const monitor: Monitor = new Monitor();
|
|
327
|
+
|
|
328
|
+
expect(PermissionGate.check(monitor, ModelAction.Read).isAllowed).toBe(
|
|
329
|
+
true,
|
|
330
|
+
);
|
|
331
|
+
expect(PermissionGate.check(monitor, ModelAction.Update).isAllowed).toBe(
|
|
332
|
+
false,
|
|
333
|
+
);
|
|
334
|
+
expect(PermissionGate.check(monitor, ModelAction.Create).isAllowed).toBe(
|
|
335
|
+
false,
|
|
336
|
+
);
|
|
337
|
+
expect(PermissionGate.check(monitor, ModelAction.Delete).isAllowed).toBe(
|
|
338
|
+
false,
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("a wildcard does not cover a model that is not an operational resource", () => {
|
|
343
|
+
permissionsForTest = [Permission.EditAllOperationalResources];
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* Team is a settings model - deliberately outside the wildcard, so that
|
|
347
|
+
* "edit every operational resource" never quietly becomes "administer
|
|
348
|
+
* the project".
|
|
349
|
+
*/
|
|
350
|
+
const result: PermissionGateResult = PermissionGate.check(
|
|
351
|
+
new Team(),
|
|
352
|
+
ModelAction.Update,
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
expect(result.isAllowed).toBe(false);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
/*
|
|
359
|
+
* The wildcard widens the decision, not the explanation. The server names
|
|
360
|
+
* only the model's own permissions when it refuses, and telling a viewer
|
|
361
|
+
* they need "Edit All Operational Resources" would point them at a
|
|
362
|
+
* project-wide grant instead of the one permission they actually want.
|
|
363
|
+
*/
|
|
364
|
+
test("the wildcard is not named in the reason the operation is refused", () => {
|
|
365
|
+
permissionsForTest = [Permission.Viewer];
|
|
366
|
+
|
|
367
|
+
const result: PermissionGateResult = PermissionGate.check(
|
|
368
|
+
new Monitor(),
|
|
369
|
+
ModelAction.Update,
|
|
370
|
+
);
|
|
371
|
+
|
|
372
|
+
expect(result.isAllowed).toBe(false);
|
|
373
|
+
expect(result.disabledReason).toContain("Edit Monitor");
|
|
374
|
+
expect(result.disabledReason).not.toContain("Operational Resources");
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
|
|
300
378
|
describe("getPermissionTitles", () => {
|
|
301
379
|
test("maps permissions to their human titles", () => {
|
|
302
380
|
expect(
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import SensitiveUrlToken from "../../../UI/Utils/SensitiveUrlToken";
|
|
2
|
+
import { describe, expect, it, beforeEach } from "@jest/globals";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* The client half of the reset/verify token handoff.
|
|
6
|
+
*
|
|
7
|
+
* The head bootstrap normally leaves the token in sessionStorage and a clean
|
|
8
|
+
* URL behind it, but it has three failure modes that all have to keep the flow
|
|
9
|
+
* working: storage blocked (private mode), the bootstrap not having run at all
|
|
10
|
+
* (so the token is still in the path), and a spent token that must not linger.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const STORAGE_KEY: string = "oneuptime-sensitive-url-token";
|
|
14
|
+
|
|
15
|
+
function setPath(pathname: string): void {
|
|
16
|
+
window.history.replaceState({}, "", pathname);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe("SensitiveUrlToken.readFromPath", () => {
|
|
20
|
+
it("reads the token out of a reset-password path", () => {
|
|
21
|
+
expect(
|
|
22
|
+
SensitiveUrlToken.readFromPath("/accounts/reset-password/abc-123"),
|
|
23
|
+
).toBe("abc-123");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("reads the token out of a verify-email path", () => {
|
|
27
|
+
expect(
|
|
28
|
+
SensitiveUrlToken.readFromPath("/accounts/verify-email/abc-123"),
|
|
29
|
+
).toBe("abc-123");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("reads the token out of a status page path, with or without a preview prefix", () => {
|
|
33
|
+
expect(SensitiveUrlToken.readFromPath("/reset-password/abc-123")).toBe(
|
|
34
|
+
"abc-123",
|
|
35
|
+
);
|
|
36
|
+
expect(
|
|
37
|
+
SensitiveUrlToken.readFromPath(
|
|
38
|
+
"/status-page/6392f2a1/reset-password/abc-123",
|
|
39
|
+
),
|
|
40
|
+
).toBe("abc-123");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("returns nothing for the cleaned form of the same route", () => {
|
|
44
|
+
/*
|
|
45
|
+
* This is the ordinary case after the bootstrap has run. Returning
|
|
46
|
+
* "reset-password" here would submit the route name as the token.
|
|
47
|
+
*/
|
|
48
|
+
expect(SensitiveUrlToken.readFromPath("/accounts/reset-password")).toBe("");
|
|
49
|
+
expect(SensitiveUrlToken.readFromPath("/reset-password")).toBe("");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("returns nothing for unrelated routes", () => {
|
|
53
|
+
expect(SensitiveUrlToken.readFromPath("/accounts/login")).toBe("");
|
|
54
|
+
expect(SensitiveUrlToken.readFromPath("/accounts/forgot-password")).toBe(
|
|
55
|
+
"",
|
|
56
|
+
);
|
|
57
|
+
expect(SensitiveUrlToken.readFromPath("/")).toBe("");
|
|
58
|
+
expect(SensitiveUrlToken.readFromPath("")).toBe("");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("tolerates a trailing slash", () => {
|
|
62
|
+
expect(
|
|
63
|
+
SensitiveUrlToken.readFromPath("/accounts/reset-password/abc-123/"),
|
|
64
|
+
).toBe("abc-123");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("percent-decodes the token, and passes a malformed escape through", () => {
|
|
68
|
+
expect(
|
|
69
|
+
SensitiveUrlToken.readFromPath("/accounts/reset-password/a%2Bb"),
|
|
70
|
+
).toBe("a+b");
|
|
71
|
+
expect(
|
|
72
|
+
SensitiveUrlToken.readFromPath("/accounts/reset-password/a%zz"),
|
|
73
|
+
).toBe("a%zz");
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
describe("SensitiveUrlToken.read", () => {
|
|
78
|
+
beforeEach(() => {
|
|
79
|
+
window.sessionStorage.clear();
|
|
80
|
+
delete (window as any).__ONEUPTIME_SENSITIVE_URL_TOKEN__;
|
|
81
|
+
setPath("/accounts/reset-password");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("prefers the stash the head bootstrap wrote", () => {
|
|
85
|
+
window.sessionStorage.setItem(STORAGE_KEY, "stashed-token");
|
|
86
|
+
|
|
87
|
+
expect(SensitiveUrlToken.read()).toBe("stashed-token");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("falls back to the in-memory handoff when storage is unavailable", () => {
|
|
91
|
+
(window as any).__ONEUPTIME_SENSITIVE_URL_TOKEN__ = "in-memory-token";
|
|
92
|
+
|
|
93
|
+
expect(SensitiveUrlToken.read()).toBe("in-memory-token");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("falls back to the path when the bootstrap did not run", () => {
|
|
97
|
+
setPath("/accounts/reset-password/path-token");
|
|
98
|
+
|
|
99
|
+
expect(SensitiveUrlToken.read()).toBe("path-token");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("returns nothing when there is no token anywhere", () => {
|
|
103
|
+
expect(SensitiveUrlToken.read()).toBe("");
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("prefers the stash over a token still in the path", () => {
|
|
107
|
+
/*
|
|
108
|
+
* Both can be present when storage worked but replaceState did not. The
|
|
109
|
+
* stash is the value the bootstrap actually captured.
|
|
110
|
+
*/
|
|
111
|
+
setPath("/accounts/reset-password/path-token");
|
|
112
|
+
window.sessionStorage.setItem(STORAGE_KEY, "stashed-token");
|
|
113
|
+
|
|
114
|
+
expect(SensitiveUrlToken.read()).toBe("stashed-token");
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe("SensitiveUrlToken.clear", () => {
|
|
119
|
+
beforeEach(() => {
|
|
120
|
+
window.sessionStorage.clear();
|
|
121
|
+
delete (window as any).__ONEUPTIME_SENSITIVE_URL_TOKEN__;
|
|
122
|
+
setPath("/accounts/reset-password");
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("drops a spent token from both stashes", () => {
|
|
126
|
+
window.sessionStorage.setItem(STORAGE_KEY, "stashed-token");
|
|
127
|
+
(window as any).__ONEUPTIME_SENSITIVE_URL_TOKEN__ = "in-memory-token";
|
|
128
|
+
|
|
129
|
+
SensitiveUrlToken.clear();
|
|
130
|
+
|
|
131
|
+
expect(window.sessionStorage.getItem(STORAGE_KEY)).toBeNull();
|
|
132
|
+
expect(SensitiveUrlToken.read()).toBe("");
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("is safe to call when nothing was stashed", () => {
|
|
136
|
+
expect(() => {
|
|
137
|
+
return SensitiveUrlToken.clear();
|
|
138
|
+
}).not.toThrow();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -41,6 +41,7 @@ const makeInstance: MakeInstanceFunction = (
|
|
|
41
41
|
instanceId: "instance-1",
|
|
42
42
|
host: "oneuptime.acme.internal",
|
|
43
43
|
userCount: 10,
|
|
44
|
+
isCountedTowardsUsage: true,
|
|
44
45
|
lastReportedAt: "2026-01-01T00:00:00.000Z",
|
|
45
46
|
version: "12.0.30",
|
|
46
47
|
...overrides,
|
|
@@ -348,6 +349,74 @@ describe("EnterpriseLicenseSeatsUtil - several instances on one licence", () =>
|
|
|
348
349
|
expect(usage.seatsUsedByOtherInstances).toBe(0);
|
|
349
350
|
expect(usage.seatsInUse).toBe(70);
|
|
350
351
|
});
|
|
352
|
+
|
|
353
|
+
it("does not subtract this installation's stale count from an active-only aggregate", () => {
|
|
354
|
+
const usage: SeatUsage = seats({
|
|
355
|
+
userLimit: 100,
|
|
356
|
+
localUserCount: 80,
|
|
357
|
+
aggregatedUserCount: 100,
|
|
358
|
+
thisInstanceId: "instance-1",
|
|
359
|
+
instances: [
|
|
360
|
+
makeInstance({
|
|
361
|
+
instanceId: "instance-1",
|
|
362
|
+
userCount: 80,
|
|
363
|
+
isCountedTowardsUsage: false,
|
|
364
|
+
}),
|
|
365
|
+
makeInstance({
|
|
366
|
+
instanceId: "instance-2",
|
|
367
|
+
userCount: 100,
|
|
368
|
+
isCountedTowardsUsage: true,
|
|
369
|
+
}),
|
|
370
|
+
],
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
expect(usage.seatsUsedByOtherInstances).toBe(0);
|
|
374
|
+
expect(usage.seatsInUse).toBe(100);
|
|
375
|
+
expect(usage.hasSeatForNewUser).toBe(false);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
it("does not double-count overlapping users when this installation is inactive", () => {
|
|
379
|
+
const usage: SeatUsage = seats({
|
|
380
|
+
userLimit: 100,
|
|
381
|
+
localUserCount: 80,
|
|
382
|
+
aggregatedUserCount: 80,
|
|
383
|
+
thisInstanceId: "instance-1",
|
|
384
|
+
instances: [
|
|
385
|
+
makeInstance({
|
|
386
|
+
instanceId: "instance-1",
|
|
387
|
+
userCount: 80,
|
|
388
|
+
isCountedTowardsUsage: false,
|
|
389
|
+
}),
|
|
390
|
+
makeInstance({
|
|
391
|
+
instanceId: "instance-2",
|
|
392
|
+
userCount: 80,
|
|
393
|
+
isCountedTowardsUsage: true,
|
|
394
|
+
}),
|
|
395
|
+
],
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
expect(usage.seatsInUse).toBe(80);
|
|
399
|
+
expect(usage.hasSeatForNewUser).toBe(true);
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
it("retains subtraction for older license servers without activity provenance", () => {
|
|
403
|
+
const usage: SeatUsage = seats({
|
|
404
|
+
userLimit: 150,
|
|
405
|
+
localUserCount: 80,
|
|
406
|
+
aggregatedUserCount: 100,
|
|
407
|
+
thisInstanceId: "instance-1",
|
|
408
|
+
instances: [
|
|
409
|
+
makeInstance({
|
|
410
|
+
instanceId: "instance-1",
|
|
411
|
+
userCount: 80,
|
|
412
|
+
isCountedTowardsUsage: undefined,
|
|
413
|
+
}),
|
|
414
|
+
],
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
expect(usage.seatsUsedByOtherInstances).toBe(20);
|
|
418
|
+
expect(usage.seatsInUse).toBe(100);
|
|
419
|
+
});
|
|
351
420
|
});
|
|
352
421
|
|
|
353
422
|
describe("EnterpriseLicenseSeatsUtil - when the topology cannot be read", () => {
|