@oneuptime/common 11.4.1 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/AIRun.ts +50 -0
- package/Models/DatabaseModels/AlertSeverity.ts +6 -0
- package/Models/DatabaseModels/IncidentSeverity.ts +6 -0
- package/Models/DatabaseModels/Index.ts +16 -0
- package/Models/DatabaseModels/IoTDeviceCredential.ts +471 -0
- package/Models/DatabaseModels/LlmLog.ts +56 -0
- package/Models/DatabaseModels/LlmProvider.ts +33 -0
- package/Models/DatabaseModels/NetworkDevice.ts +1385 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +717 -0
- package/Models/DatabaseModels/NetworkDeviceLabelRule.ts +514 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerRule.ts +596 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerTeam.ts +487 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerUser.ts +486 -0
- package/Models/DatabaseModels/NetworkInterface.ts +563 -0
- package/Models/DatabaseModels/Project.ts +145 -0
- package/Models/DatabaseModels/TelemetryEntityRelationship.ts +54 -0
- package/Server/API/AIInvestigationAPI.ts +131 -63
- package/Server/API/AlertAPI.ts +5 -0
- package/Server/API/IncidentAPI.ts +10 -0
- package/Server/API/IncidentEpisodeAPI.ts +5 -0
- package/Server/API/LlmProviderAPI.ts +4 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +5 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.ts +105 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.ts +15 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.ts +192 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
- package/Server/Services/AIRunService.ts +58 -0
- package/Server/Services/AIService.ts +101 -0
- package/Server/Services/IncidentService.ts +14 -41
- package/Server/Services/Index.ts +14 -0
- package/Server/Services/IoTDeviceCredentialService.ts +351 -0
- package/Server/Services/IoTDeviceService.ts +64 -21
- package/Server/Services/LlmLogService.ts +26 -0
- package/Server/Services/LlmProviderService.ts +3 -0
- package/Server/Services/MonitorService.ts +4 -1
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +10 -0
- package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +204 -0
- package/Server/Services/NetworkDeviceLabelRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +222 -0
- package/Server/Services/NetworkDeviceOwnerRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +10 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +10 -0
- package/Server/Services/NetworkDeviceService.ts +50 -0
- package/Server/Services/NetworkInterfaceService.ts +10 -0
- package/Server/Services/TelemetryEntityRelationshipService.ts +23 -0
- package/Server/Services/TelemetryEntityService.ts +72 -2
- package/Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts +244 -12
- package/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts +92 -19
- package/Server/Utils/AI/Sentinel/InvestigationQueue.ts +493 -0
- package/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.ts +88 -68
- package/Server/Utils/AI/Toolbox/Index.ts +2 -1
- package/Server/Utils/AI/Toolbox/MetricTools.ts +391 -0
- package/Server/Utils/LLM/LLMService.ts +21 -0
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +170 -2
- package/Server/Utils/Monitor/IoTDeviceAbsenceSeries.ts +101 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +1 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +19 -3
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +87 -0
- package/Server/Utils/Monitor/MonitorResource.ts +77 -21
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +1 -1
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +201 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +215 -0
- package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +169 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +173 -0
- package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +97 -0
- package/Tests/Server/Services/IoTDeviceService.test.ts +54 -0
- package/Tests/Server/Utils/AI/BaselineAnomalyTool.test.ts +253 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +44 -0
- package/Tests/Server/Utils/AI/SentinelAlertGating.test.ts +360 -0
- package/Tests/Server/Utils/AI/SentinelInvestigationQueue.test.ts +295 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +59 -0
- package/Tests/Server/Utils/Monitor/IoTDeviceAbsenceSeries.test.ts +113 -0
- package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +198 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +1 -1
- package/Tests/Utils/Monitor/LatencyMatrixUtil.test.ts +111 -0
- package/Types/AI/AIRunStatus.ts +9 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +0 -1
- package/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.ts +8 -3
- package/Types/LlmLogStatus.ts +1 -0
- package/Types/Monitor/CriteriaFilter.ts +5 -0
- package/Types/Monitor/IotAlertTemplates.ts +22 -3
- package/Types/Monitor/LatencyMatrix.ts +27 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +2 -2
- package/Types/Monitor/MonitorMetricType.ts +10 -0
- package/Types/Monitor/MonitorStep.ts +36 -11
- package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +55 -0
- package/Types/Monitor/MonitorStepSnmpMonitor.ts +8 -0
- package/Types/Monitor/MonitorType.ts +14 -9
- package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +12 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +116 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +29 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +31 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +24 -0
- package/Types/Monitor/SnmpMonitor/SnmpTrap.ts +20 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +173 -0
- package/Types/Permission.ts +314 -0
- package/Types/Probe/ProbeMonitorResponse.ts +8 -0
- package/UI/Components/Icon/Icon.tsx +8 -6
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +2 -2
- package/UI/Components/Tabs/Tabs.tsx +10 -1
- package/UI/Utils/Navigation.ts +10 -1
- package/Utils/Dashboard/Components/DashboardLogChartComponent.ts +16 -21
- package/Utils/Monitor/LatencyMatrixUtil.ts +162 -0
- package/Utils/Monitor/MonitorMetricType.ts +71 -1
- package/Utils/Monitor/NetworkTopologyUtil.ts +159 -0
- package/Utils/Telemetry/EntityRelationship.ts +11 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +52 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js +493 -0
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js +58 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmProvider.js +33 -0
- package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +1426 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +738 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js +503 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js +502 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +589 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Project.js +147 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js +57 -0
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +95 -55
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +5 -0
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +10 -0
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +5 -0
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +5 -7
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +5 -0
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js +51 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js +101 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +33 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +82 -9
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +14 -25
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +14 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceCredentialService.js +321 -0
- package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -0
- package/build/dist/Server/Services/IoTDeviceService.js +49 -15
- package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
- package/build/dist/Server/Services/LlmLogService.js +29 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +3 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +2 -1
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +166 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +186 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +52 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js +9 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +22 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryEntityService.js +64 -2
- package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js +189 -9
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js +84 -17
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js +428 -0
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js +63 -47
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +300 -0
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +16 -0
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +130 -2
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js +81 -0
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +18 -7
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -10
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +69 -3
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +76 -30
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +147 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +167 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +93 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +9 -0
- package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +0 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/LlmLogStatus.js +1 -0
- package/build/dist/Types/LlmLogStatus.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +5 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/IotAlertTemplates.js +7 -7
- package/build/dist/Types/Monitor/IotAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/LatencyMatrix.js +2 -0
- package/build/dist/Types/Monitor/LatencyMatrix.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +2 -2
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorMetricType.js +9 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +22 -9
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +36 -0
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +14 -9
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +89 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +137 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -0
- package/build/dist/Types/Permission.js +280 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +8 -6
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +2 -2
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Tabs/Tabs.js +3 -1
- package/build/dist/UI/Components/Tabs/Tabs.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +11 -1
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js +17 -20
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js.map +1 -1
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js +89 -0
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js +68 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +112 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
- package/package.json +1 -1
|
@@ -334,6 +334,56 @@ export default class AIRun extends BaseModel {
|
|
|
334
334
|
})
|
|
335
335
|
public triggeredByAlertId?: ObjectID = undefined;
|
|
336
336
|
|
|
337
|
+
@ColumnAccessControl({
|
|
338
|
+
create: [],
|
|
339
|
+
read: [
|
|
340
|
+
Permission.ProjectOwner,
|
|
341
|
+
Permission.ProjectAdmin,
|
|
342
|
+
Permission.ProjectMember,
|
|
343
|
+
],
|
|
344
|
+
update: [],
|
|
345
|
+
})
|
|
346
|
+
@Index()
|
|
347
|
+
@TableColumn({
|
|
348
|
+
type: TableColumnType.ObjectID,
|
|
349
|
+
required: false,
|
|
350
|
+
canReadOnRelationQuery: true,
|
|
351
|
+
title: "Monitor ID",
|
|
352
|
+
description:
|
|
353
|
+
"The monitor behind the alert that triggered this run — the dedupe key for per-monitor investigation windows.",
|
|
354
|
+
})
|
|
355
|
+
@Column({
|
|
356
|
+
type: ColumnType.ObjectID,
|
|
357
|
+
nullable: true,
|
|
358
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
359
|
+
})
|
|
360
|
+
public monitorId?: ObjectID = undefined;
|
|
361
|
+
|
|
362
|
+
@ColumnAccessControl({
|
|
363
|
+
create: [],
|
|
364
|
+
read: [
|
|
365
|
+
Permission.ProjectOwner,
|
|
366
|
+
Permission.ProjectAdmin,
|
|
367
|
+
Permission.ProjectMember,
|
|
368
|
+
],
|
|
369
|
+
update: [],
|
|
370
|
+
})
|
|
371
|
+
@TableColumn({
|
|
372
|
+
required: true,
|
|
373
|
+
type: TableColumnType.Number,
|
|
374
|
+
title: "Attempt Count",
|
|
375
|
+
description:
|
|
376
|
+
"How many times a worker has claimed this run for execution. Incremented on each claim; the queue stops retrying after the maximum.",
|
|
377
|
+
isDefaultValueColumn: true,
|
|
378
|
+
defaultValue: 0,
|
|
379
|
+
})
|
|
380
|
+
@Column({
|
|
381
|
+
nullable: false,
|
|
382
|
+
default: 0,
|
|
383
|
+
type: ColumnType.Number,
|
|
384
|
+
})
|
|
385
|
+
public attemptCount?: number = undefined;
|
|
386
|
+
|
|
337
387
|
@ColumnAccessControl({
|
|
338
388
|
create: [],
|
|
339
389
|
read: [
|
|
@@ -477,6 +477,12 @@ export default class AlertSeverity extends BaseModel {
|
|
|
477
477
|
type: TableColumnType.SmallNumber,
|
|
478
478
|
title: "Order",
|
|
479
479
|
description: "Order / Priority of this resource",
|
|
480
|
+
/*
|
|
481
|
+
* Readable on relation queries like its name/color siblings —
|
|
482
|
+
* severity ranking (lower = more severe) is needed wherever a related
|
|
483
|
+
* alert's severity is selected (e.g. the Service Map overlay).
|
|
484
|
+
*/
|
|
485
|
+
canReadOnRelationQuery: true,
|
|
480
486
|
})
|
|
481
487
|
@Column({
|
|
482
488
|
type: ColumnType.SmallNumber,
|
|
@@ -477,6 +477,12 @@ export default class IncidentSeverity extends BaseModel {
|
|
|
477
477
|
type: TableColumnType.SmallNumber,
|
|
478
478
|
title: "Order",
|
|
479
479
|
description: "Order / Priority of this resource",
|
|
480
|
+
/*
|
|
481
|
+
* Readable on relation queries like its name/color siblings —
|
|
482
|
+
* severity ranking (lower = more severe) is needed wherever a related
|
|
483
|
+
* incident's severity is selected (e.g. the Service Map overlay).
|
|
484
|
+
*/
|
|
485
|
+
canReadOnRelationQuery: true,
|
|
480
486
|
})
|
|
481
487
|
@Column({
|
|
482
488
|
type: ColumnType.SmallNumber,
|
|
@@ -6,6 +6,13 @@ import KubernetesClusterOwnerUser from "./KubernetesClusterOwnerUser";
|
|
|
6
6
|
import KubernetesResource from "./KubernetesResource";
|
|
7
7
|
import KubernetesContainer from "./KubernetesContainer";
|
|
8
8
|
import DockerHost from "./DockerHost";
|
|
9
|
+
import NetworkDevice from "./NetworkDevice";
|
|
10
|
+
import NetworkDeviceOwnerTeam from "./NetworkDeviceOwnerTeam";
|
|
11
|
+
import NetworkDeviceOwnerUser from "./NetworkDeviceOwnerUser";
|
|
12
|
+
import NetworkDeviceOwnerRule from "./NetworkDeviceOwnerRule";
|
|
13
|
+
import NetworkDeviceLabelRule from "./NetworkDeviceLabelRule";
|
|
14
|
+
import NetworkDeviceDiscoveryScan from "./NetworkDeviceDiscoveryScan";
|
|
15
|
+
import NetworkInterface from "./NetworkInterface";
|
|
9
16
|
import DockerHostOwnerTeam from "./DockerHostOwnerTeam";
|
|
10
17
|
import DockerHostOwnerUser from "./DockerHostOwnerUser";
|
|
11
18
|
import DockerResource from "./DockerResource";
|
|
@@ -25,6 +32,7 @@ import IoTFleet from "./IoTFleet";
|
|
|
25
32
|
import IoTFleetOwnerTeam from "./IoTFleetOwnerTeam";
|
|
26
33
|
import IoTFleetOwnerUser from "./IoTFleetOwnerUser";
|
|
27
34
|
import IoTDevice from "./IoTDevice";
|
|
35
|
+
import IoTDeviceCredential from "./IoTDeviceCredential";
|
|
28
36
|
import CephCluster from "./CephCluster";
|
|
29
37
|
import CephClusterOwnerTeam from "./CephClusterOwnerTeam";
|
|
30
38
|
import CephClusterOwnerUser from "./CephClusterOwnerUser";
|
|
@@ -768,6 +776,13 @@ const AllModelTypes: Array<{
|
|
|
768
776
|
KubernetesResource,
|
|
769
777
|
KubernetesContainer,
|
|
770
778
|
DockerHost,
|
|
779
|
+
NetworkDevice,
|
|
780
|
+
NetworkDeviceOwnerTeam,
|
|
781
|
+
NetworkDeviceOwnerUser,
|
|
782
|
+
NetworkDeviceOwnerRule,
|
|
783
|
+
NetworkDeviceLabelRule,
|
|
784
|
+
NetworkDeviceDiscoveryScan,
|
|
785
|
+
NetworkInterface,
|
|
771
786
|
DockerHostOwnerTeam,
|
|
772
787
|
DockerHostOwnerUser,
|
|
773
788
|
DockerResource,
|
|
@@ -787,6 +802,7 @@ const AllModelTypes: Array<{
|
|
|
787
802
|
IoTFleetOwnerTeam,
|
|
788
803
|
IoTFleetOwnerUser,
|
|
789
804
|
IoTDevice,
|
|
805
|
+
IoTDeviceCredential,
|
|
790
806
|
CephCluster,
|
|
791
807
|
CephClusterOwnerTeam,
|
|
792
808
|
CephClusterOwnerUser,
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import IoTFleet from "./IoTFleet";
|
|
2
|
+
import Project from "./Project";
|
|
3
|
+
import User from "./User";
|
|
4
|
+
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
5
|
+
import Route from "../../Types/API/Route";
|
|
6
|
+
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
7
|
+
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
8
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
9
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
10
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
11
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
12
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
13
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
14
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
15
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
16
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
17
|
+
import ObjectID from "../../Types/ObjectID";
|
|
18
|
+
import Permission from "../../Types/Permission";
|
|
19
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* IoT device registry + per-device MQTT credential.
|
|
23
|
+
*
|
|
24
|
+
* Registering a device does two things:
|
|
25
|
+
*
|
|
26
|
+
* 1. Issues a PER-DEVICE credential (secretKey) the device presents
|
|
27
|
+
* on MQTT CONNECT (username = this row's id, password = the
|
|
28
|
+
* secret). Device-authenticated clients can only publish to
|
|
29
|
+
* their own oneuptime/<fleet>/<device>/... topics, and a single
|
|
30
|
+
* compromised device can be revoked (isEnabled=false) without
|
|
31
|
+
* rotating the project-wide ingestion key.
|
|
32
|
+
*
|
|
33
|
+
* 2. Marks the device as EXPECTED: registered devices survive the
|
|
34
|
+
* stale-inventory cleanup (flipped to Down instead of deleted),
|
|
35
|
+
* and IoT Device monitors inject an absent series for registered
|
|
36
|
+
* devices that stop reporting — silent deaths alert per device.
|
|
37
|
+
*
|
|
38
|
+
* This is distinct from IoTDevice, the ingest-written inventory
|
|
39
|
+
* snapshot: credentials are user-managed rows keyed on the same
|
|
40
|
+
* (fleet, externalId) identity the device stamps on its datapoints.
|
|
41
|
+
*/
|
|
42
|
+
@EnableDocumentation()
|
|
43
|
+
@TenantColumn("projectId")
|
|
44
|
+
@CrudApiEndpoint(new Route("/iot-device-credential"))
|
|
45
|
+
@Entity({
|
|
46
|
+
name: "IoTDeviceCredential",
|
|
47
|
+
})
|
|
48
|
+
@Index(["projectId", "iotFleetId", "externalId"], {
|
|
49
|
+
unique: true,
|
|
50
|
+
})
|
|
51
|
+
@TableAccessControl({
|
|
52
|
+
create: [
|
|
53
|
+
Permission.ProjectOwner,
|
|
54
|
+
Permission.ProjectAdmin,
|
|
55
|
+
Permission.CreateIoTDeviceCredential,
|
|
56
|
+
],
|
|
57
|
+
read: [
|
|
58
|
+
Permission.ProjectOwner,
|
|
59
|
+
Permission.ProjectAdmin,
|
|
60
|
+
Permission.ReadIoTDeviceCredential,
|
|
61
|
+
Permission.ReadIoTFleet,
|
|
62
|
+
],
|
|
63
|
+
delete: [
|
|
64
|
+
Permission.ProjectOwner,
|
|
65
|
+
Permission.ProjectAdmin,
|
|
66
|
+
Permission.DeleteIoTDeviceCredential,
|
|
67
|
+
],
|
|
68
|
+
update: [
|
|
69
|
+
Permission.ProjectOwner,
|
|
70
|
+
Permission.ProjectAdmin,
|
|
71
|
+
Permission.EditIoTDeviceCredential,
|
|
72
|
+
],
|
|
73
|
+
})
|
|
74
|
+
@TableMetadata({
|
|
75
|
+
tableName: "IoTDeviceCredential",
|
|
76
|
+
singularName: "IoT Device Credential",
|
|
77
|
+
pluralName: "IoT Device Credentials",
|
|
78
|
+
icon: IconProp.Lock,
|
|
79
|
+
tableDescription:
|
|
80
|
+
"Registered IoT devices and their per-device MQTT credentials. Registered devices get individual authentication, topic isolation, revocation, and silent-death offline detection.",
|
|
81
|
+
})
|
|
82
|
+
export default class IoTDeviceCredential extends BaseModel {
|
|
83
|
+
@ColumnAccessControl({
|
|
84
|
+
create: [
|
|
85
|
+
Permission.ProjectOwner,
|
|
86
|
+
Permission.ProjectAdmin,
|
|
87
|
+
Permission.CreateIoTDeviceCredential,
|
|
88
|
+
],
|
|
89
|
+
read: [
|
|
90
|
+
Permission.ProjectOwner,
|
|
91
|
+
Permission.ProjectAdmin,
|
|
92
|
+
Permission.ReadIoTDeviceCredential,
|
|
93
|
+
Permission.ReadIoTFleet,
|
|
94
|
+
],
|
|
95
|
+
update: [],
|
|
96
|
+
})
|
|
97
|
+
@TableColumn({
|
|
98
|
+
manyToOneRelationColumn: "projectId",
|
|
99
|
+
type: TableColumnType.Entity,
|
|
100
|
+
modelType: Project,
|
|
101
|
+
title: "Project",
|
|
102
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
103
|
+
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
104
|
+
})
|
|
105
|
+
@ManyToOne(
|
|
106
|
+
() => {
|
|
107
|
+
return Project;
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
eager: false,
|
|
111
|
+
nullable: true,
|
|
112
|
+
onDelete: "CASCADE",
|
|
113
|
+
orphanedRowAction: "nullify",
|
|
114
|
+
},
|
|
115
|
+
)
|
|
116
|
+
@JoinColumn({ name: "projectId" })
|
|
117
|
+
public project?: Project = undefined;
|
|
118
|
+
|
|
119
|
+
@ColumnAccessControl({
|
|
120
|
+
create: [
|
|
121
|
+
Permission.ProjectOwner,
|
|
122
|
+
Permission.ProjectAdmin,
|
|
123
|
+
Permission.CreateIoTDeviceCredential,
|
|
124
|
+
],
|
|
125
|
+
read: [
|
|
126
|
+
Permission.ProjectOwner,
|
|
127
|
+
Permission.ProjectAdmin,
|
|
128
|
+
Permission.ReadIoTDeviceCredential,
|
|
129
|
+
Permission.ReadIoTFleet,
|
|
130
|
+
],
|
|
131
|
+
update: [],
|
|
132
|
+
})
|
|
133
|
+
@Index()
|
|
134
|
+
@TableColumn({
|
|
135
|
+
type: TableColumnType.ObjectID,
|
|
136
|
+
required: true,
|
|
137
|
+
canReadOnRelationQuery: true,
|
|
138
|
+
title: "Project ID",
|
|
139
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
140
|
+
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
141
|
+
})
|
|
142
|
+
@Column({
|
|
143
|
+
type: ColumnType.ObjectID,
|
|
144
|
+
nullable: false,
|
|
145
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
146
|
+
})
|
|
147
|
+
public projectId?: ObjectID = undefined;
|
|
148
|
+
|
|
149
|
+
@ColumnAccessControl({
|
|
150
|
+
create: [
|
|
151
|
+
Permission.ProjectOwner,
|
|
152
|
+
Permission.ProjectAdmin,
|
|
153
|
+
Permission.CreateIoTDeviceCredential,
|
|
154
|
+
],
|
|
155
|
+
read: [
|
|
156
|
+
Permission.ProjectOwner,
|
|
157
|
+
Permission.ProjectAdmin,
|
|
158
|
+
Permission.ReadIoTDeviceCredential,
|
|
159
|
+
Permission.ReadIoTFleet,
|
|
160
|
+
],
|
|
161
|
+
update: [],
|
|
162
|
+
})
|
|
163
|
+
@TableColumn({
|
|
164
|
+
manyToOneRelationColumn: "iotFleetId",
|
|
165
|
+
type: TableColumnType.Entity,
|
|
166
|
+
modelType: IoTFleet,
|
|
167
|
+
title: "IoT Fleet",
|
|
168
|
+
description: "Fleet this device belongs to.",
|
|
169
|
+
})
|
|
170
|
+
@ManyToOne(
|
|
171
|
+
() => {
|
|
172
|
+
return IoTFleet;
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
eager: false,
|
|
176
|
+
nullable: true,
|
|
177
|
+
onDelete: "CASCADE",
|
|
178
|
+
orphanedRowAction: "nullify",
|
|
179
|
+
},
|
|
180
|
+
)
|
|
181
|
+
@JoinColumn({ name: "iotFleetId" })
|
|
182
|
+
public iotFleet?: IoTFleet = undefined;
|
|
183
|
+
|
|
184
|
+
@ColumnAccessControl({
|
|
185
|
+
create: [
|
|
186
|
+
Permission.ProjectOwner,
|
|
187
|
+
Permission.ProjectAdmin,
|
|
188
|
+
Permission.CreateIoTDeviceCredential,
|
|
189
|
+
],
|
|
190
|
+
read: [
|
|
191
|
+
Permission.ProjectOwner,
|
|
192
|
+
Permission.ProjectAdmin,
|
|
193
|
+
Permission.ReadIoTDeviceCredential,
|
|
194
|
+
Permission.ReadIoTFleet,
|
|
195
|
+
],
|
|
196
|
+
update: [],
|
|
197
|
+
})
|
|
198
|
+
@Index()
|
|
199
|
+
@TableColumn({
|
|
200
|
+
type: TableColumnType.ObjectID,
|
|
201
|
+
required: true,
|
|
202
|
+
canReadOnRelationQuery: true,
|
|
203
|
+
title: "IoT Fleet ID",
|
|
204
|
+
description: "ID of the IoT Fleet this device belongs to.",
|
|
205
|
+
})
|
|
206
|
+
@Column({
|
|
207
|
+
type: ColumnType.ObjectID,
|
|
208
|
+
nullable: false,
|
|
209
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
210
|
+
})
|
|
211
|
+
public iotFleetId?: ObjectID = undefined;
|
|
212
|
+
|
|
213
|
+
@ColumnAccessControl({
|
|
214
|
+
create: [
|
|
215
|
+
Permission.ProjectOwner,
|
|
216
|
+
Permission.ProjectAdmin,
|
|
217
|
+
Permission.CreateIoTDeviceCredential,
|
|
218
|
+
],
|
|
219
|
+
read: [
|
|
220
|
+
Permission.ProjectOwner,
|
|
221
|
+
Permission.ProjectAdmin,
|
|
222
|
+
Permission.ReadIoTDeviceCredential,
|
|
223
|
+
Permission.ReadIoTFleet,
|
|
224
|
+
],
|
|
225
|
+
update: [],
|
|
226
|
+
})
|
|
227
|
+
@Index()
|
|
228
|
+
@TableColumn({
|
|
229
|
+
required: true,
|
|
230
|
+
type: TableColumnType.ShortText,
|
|
231
|
+
title: "Device ID",
|
|
232
|
+
description:
|
|
233
|
+
"The device id — must match the device.id label the device stamps on its datapoints. It is also the <device> segment of the device's MQTT topics, so a device that reports directly over MQTT cannot use an id containing '/', '+', or '#' (such devices can still report through a gateway).",
|
|
234
|
+
canReadOnRelationQuery: true,
|
|
235
|
+
example: "sensor-001",
|
|
236
|
+
})
|
|
237
|
+
@Column({
|
|
238
|
+
nullable: false,
|
|
239
|
+
type: ColumnType.ShortText,
|
|
240
|
+
length: ColumnLength.ShortText,
|
|
241
|
+
})
|
|
242
|
+
public externalId?: string = undefined;
|
|
243
|
+
|
|
244
|
+
@ColumnAccessControl({
|
|
245
|
+
create: [
|
|
246
|
+
Permission.ProjectOwner,
|
|
247
|
+
Permission.ProjectAdmin,
|
|
248
|
+
Permission.CreateIoTDeviceCredential,
|
|
249
|
+
],
|
|
250
|
+
read: [
|
|
251
|
+
Permission.ProjectOwner,
|
|
252
|
+
Permission.ProjectAdmin,
|
|
253
|
+
Permission.ReadIoTDeviceCredential,
|
|
254
|
+
Permission.ReadIoTFleet,
|
|
255
|
+
],
|
|
256
|
+
update: [
|
|
257
|
+
Permission.ProjectOwner,
|
|
258
|
+
Permission.ProjectAdmin,
|
|
259
|
+
Permission.EditIoTDeviceCredential,
|
|
260
|
+
],
|
|
261
|
+
})
|
|
262
|
+
@TableColumn({
|
|
263
|
+
required: false,
|
|
264
|
+
type: TableColumnType.ShortText,
|
|
265
|
+
title: "Name",
|
|
266
|
+
description: "Any friendly name of this device",
|
|
267
|
+
canReadOnRelationQuery: true,
|
|
268
|
+
example: "Boiler room temperature sensor",
|
|
269
|
+
})
|
|
270
|
+
@Column({
|
|
271
|
+
nullable: true,
|
|
272
|
+
type: ColumnType.ShortText,
|
|
273
|
+
length: ColumnLength.ShortText,
|
|
274
|
+
})
|
|
275
|
+
public name?: string = undefined;
|
|
276
|
+
|
|
277
|
+
@ColumnAccessControl({
|
|
278
|
+
create: [
|
|
279
|
+
Permission.ProjectOwner,
|
|
280
|
+
Permission.ProjectAdmin,
|
|
281
|
+
Permission.CreateIoTDeviceCredential,
|
|
282
|
+
],
|
|
283
|
+
read: [
|
|
284
|
+
Permission.ProjectOwner,
|
|
285
|
+
Permission.ProjectAdmin,
|
|
286
|
+
Permission.ReadIoTDeviceCredential,
|
|
287
|
+
Permission.ReadIoTFleet,
|
|
288
|
+
],
|
|
289
|
+
update: [
|
|
290
|
+
Permission.ProjectOwner,
|
|
291
|
+
Permission.ProjectAdmin,
|
|
292
|
+
Permission.EditIoTDeviceCredential,
|
|
293
|
+
],
|
|
294
|
+
})
|
|
295
|
+
@TableColumn({
|
|
296
|
+
isDefaultValueColumn: true,
|
|
297
|
+
required: true,
|
|
298
|
+
type: TableColumnType.Boolean,
|
|
299
|
+
defaultValue: true,
|
|
300
|
+
title: "Enabled",
|
|
301
|
+
description:
|
|
302
|
+
"Disabled credentials are rejected at MQTT CONNECT and stop the device's silent-death offline detection.",
|
|
303
|
+
})
|
|
304
|
+
@Column({
|
|
305
|
+
type: ColumnType.Boolean,
|
|
306
|
+
nullable: false,
|
|
307
|
+
default: true,
|
|
308
|
+
})
|
|
309
|
+
public isEnabled?: boolean = undefined;
|
|
310
|
+
|
|
311
|
+
@ColumnAccessControl({
|
|
312
|
+
create: [],
|
|
313
|
+
read: [
|
|
314
|
+
Permission.ProjectOwner,
|
|
315
|
+
Permission.ProjectAdmin,
|
|
316
|
+
Permission.ReadIoTDeviceCredential,
|
|
317
|
+
Permission.ReadIoTFleet,
|
|
318
|
+
],
|
|
319
|
+
update: [],
|
|
320
|
+
})
|
|
321
|
+
@TableColumn({
|
|
322
|
+
type: TableColumnType.Date,
|
|
323
|
+
required: false,
|
|
324
|
+
title: "Last Connected At",
|
|
325
|
+
description: "When this credential last authenticated an MQTT connection.",
|
|
326
|
+
})
|
|
327
|
+
@Column({
|
|
328
|
+
type: ColumnType.Date,
|
|
329
|
+
nullable: true,
|
|
330
|
+
})
|
|
331
|
+
public lastConnectedAt?: Date = undefined;
|
|
332
|
+
|
|
333
|
+
@ColumnAccessControl({
|
|
334
|
+
create: [
|
|
335
|
+
Permission.ProjectOwner,
|
|
336
|
+
Permission.ProjectAdmin,
|
|
337
|
+
Permission.CreateIoTDeviceCredential,
|
|
338
|
+
],
|
|
339
|
+
read: [
|
|
340
|
+
Permission.ProjectOwner,
|
|
341
|
+
Permission.ProjectAdmin,
|
|
342
|
+
Permission.ReadIoTDeviceCredential,
|
|
343
|
+
Permission.ReadIoTFleet,
|
|
344
|
+
],
|
|
345
|
+
update: [],
|
|
346
|
+
})
|
|
347
|
+
@TableColumn({
|
|
348
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
349
|
+
type: TableColumnType.Entity,
|
|
350
|
+
modelType: User,
|
|
351
|
+
title: "Created by User",
|
|
352
|
+
description:
|
|
353
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
354
|
+
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
355
|
+
})
|
|
356
|
+
@ManyToOne(
|
|
357
|
+
() => {
|
|
358
|
+
return User;
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
eager: false,
|
|
362
|
+
nullable: true,
|
|
363
|
+
onDelete: "SET NULL",
|
|
364
|
+
orphanedRowAction: "nullify",
|
|
365
|
+
},
|
|
366
|
+
)
|
|
367
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
368
|
+
public createdByUser?: User = undefined;
|
|
369
|
+
|
|
370
|
+
@ColumnAccessControl({
|
|
371
|
+
create: [
|
|
372
|
+
Permission.ProjectOwner,
|
|
373
|
+
Permission.ProjectAdmin,
|
|
374
|
+
Permission.CreateIoTDeviceCredential,
|
|
375
|
+
],
|
|
376
|
+
read: [
|
|
377
|
+
Permission.ProjectOwner,
|
|
378
|
+
Permission.ProjectAdmin,
|
|
379
|
+
Permission.ReadIoTDeviceCredential,
|
|
380
|
+
Permission.ReadIoTFleet,
|
|
381
|
+
],
|
|
382
|
+
update: [],
|
|
383
|
+
})
|
|
384
|
+
@TableColumn({
|
|
385
|
+
type: TableColumnType.ObjectID,
|
|
386
|
+
title: "Created by User ID",
|
|
387
|
+
description:
|
|
388
|
+
"User ID who created this object (if this object was created by a User)",
|
|
389
|
+
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
390
|
+
})
|
|
391
|
+
@Column({
|
|
392
|
+
type: ColumnType.ObjectID,
|
|
393
|
+
nullable: true,
|
|
394
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
395
|
+
})
|
|
396
|
+
public createdByUserId?: ObjectID = undefined;
|
|
397
|
+
|
|
398
|
+
@ColumnAccessControl({
|
|
399
|
+
create: [],
|
|
400
|
+
read: [],
|
|
401
|
+
update: [],
|
|
402
|
+
})
|
|
403
|
+
@TableColumn({
|
|
404
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
405
|
+
type: TableColumnType.Entity,
|
|
406
|
+
title: "Deleted by User",
|
|
407
|
+
modelType: User,
|
|
408
|
+
description:
|
|
409
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
410
|
+
example: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
411
|
+
})
|
|
412
|
+
@ManyToOne(
|
|
413
|
+
() => {
|
|
414
|
+
return User;
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
cascade: false,
|
|
418
|
+
eager: false,
|
|
419
|
+
nullable: true,
|
|
420
|
+
onDelete: "SET NULL",
|
|
421
|
+
orphanedRowAction: "nullify",
|
|
422
|
+
},
|
|
423
|
+
)
|
|
424
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
425
|
+
public deletedByUser?: User = undefined;
|
|
426
|
+
|
|
427
|
+
@ColumnAccessControl({
|
|
428
|
+
create: [],
|
|
429
|
+
read: [],
|
|
430
|
+
update: [],
|
|
431
|
+
})
|
|
432
|
+
@TableColumn({
|
|
433
|
+
type: TableColumnType.ObjectID,
|
|
434
|
+
title: "Deleted by User ID",
|
|
435
|
+
description:
|
|
436
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
437
|
+
example: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
438
|
+
})
|
|
439
|
+
@Column({
|
|
440
|
+
type: ColumnType.ObjectID,
|
|
441
|
+
nullable: true,
|
|
442
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
443
|
+
})
|
|
444
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
445
|
+
|
|
446
|
+
@ColumnAccessControl({
|
|
447
|
+
create: [],
|
|
448
|
+
read: [
|
|
449
|
+
Permission.ProjectOwner,
|
|
450
|
+
Permission.ProjectAdmin,
|
|
451
|
+
Permission.ReadIoTDeviceCredential,
|
|
452
|
+
],
|
|
453
|
+
update: [],
|
|
454
|
+
})
|
|
455
|
+
@Index()
|
|
456
|
+
@TableColumn({
|
|
457
|
+
type: TableColumnType.ObjectID,
|
|
458
|
+
isDefaultValueColumn: false,
|
|
459
|
+
computed: true,
|
|
460
|
+
title: "Device Secret",
|
|
461
|
+
description:
|
|
462
|
+
"Secret this device presents as the MQTT password (with this credential's ID as the username).",
|
|
463
|
+
example: "c3d4e5f6-a7b8-9012-cdef-123456789012",
|
|
464
|
+
})
|
|
465
|
+
@Column({
|
|
466
|
+
type: ColumnType.ObjectID,
|
|
467
|
+
nullable: false,
|
|
468
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
469
|
+
})
|
|
470
|
+
public secretKey?: ObjectID = undefined;
|
|
471
|
+
}
|
|
@@ -302,6 +302,62 @@ export default class LlmLog extends BaseModel {
|
|
|
302
302
|
})
|
|
303
303
|
public totalTokens?: number = undefined;
|
|
304
304
|
|
|
305
|
+
@ColumnAccessControl({
|
|
306
|
+
create: [],
|
|
307
|
+
read: [
|
|
308
|
+
Permission.ProjectOwner,
|
|
309
|
+
Permission.ProjectAdmin,
|
|
310
|
+
Permission.ProjectMember,
|
|
311
|
+
Permission.Viewer,
|
|
312
|
+
Permission.ReadLlmLog,
|
|
313
|
+
],
|
|
314
|
+
update: [],
|
|
315
|
+
})
|
|
316
|
+
@TableColumn({
|
|
317
|
+
required: true,
|
|
318
|
+
type: TableColumnType.Number,
|
|
319
|
+
title: "Cached Input Tokens",
|
|
320
|
+
description:
|
|
321
|
+
"Input tokens served from the provider's prompt cache (billed at a discount)",
|
|
322
|
+
canReadOnRelationQuery: false,
|
|
323
|
+
isDefaultValueColumn: true,
|
|
324
|
+
defaultValue: 0,
|
|
325
|
+
})
|
|
326
|
+
@Column({
|
|
327
|
+
nullable: false,
|
|
328
|
+
default: 0,
|
|
329
|
+
type: ColumnType.Number,
|
|
330
|
+
})
|
|
331
|
+
public cachedInputTokens?: number = undefined;
|
|
332
|
+
|
|
333
|
+
@ColumnAccessControl({
|
|
334
|
+
create: [],
|
|
335
|
+
read: [
|
|
336
|
+
Permission.ProjectOwner,
|
|
337
|
+
Permission.ProjectAdmin,
|
|
338
|
+
Permission.ProjectMember,
|
|
339
|
+
Permission.Viewer,
|
|
340
|
+
Permission.ReadLlmLog,
|
|
341
|
+
],
|
|
342
|
+
update: [],
|
|
343
|
+
})
|
|
344
|
+
@TableColumn({
|
|
345
|
+
required: true,
|
|
346
|
+
type: TableColumnType.Number,
|
|
347
|
+
title: "Cache Creation Tokens",
|
|
348
|
+
description:
|
|
349
|
+
"Input tokens written to the provider's prompt cache on this call",
|
|
350
|
+
canReadOnRelationQuery: false,
|
|
351
|
+
isDefaultValueColumn: true,
|
|
352
|
+
defaultValue: 0,
|
|
353
|
+
})
|
|
354
|
+
@Column({
|
|
355
|
+
nullable: false,
|
|
356
|
+
default: 0,
|
|
357
|
+
type: ColumnType.Number,
|
|
358
|
+
})
|
|
359
|
+
public cacheCreationTokens?: number = undefined;
|
|
360
|
+
|
|
305
361
|
// Cost tracking
|
|
306
362
|
|
|
307
363
|
@ColumnAccessControl({
|
|
@@ -21,6 +21,7 @@ import Permission from "../../Types/Permission";
|
|
|
21
21
|
import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
|
|
22
22
|
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
23
23
|
import LlmType from "../../Types/LLM/LlmType";
|
|
24
|
+
import { JSONObject } from "../../Types/JSON";
|
|
24
25
|
|
|
25
26
|
@EnableDocumentation()
|
|
26
27
|
@TableBillingAccessControl({
|
|
@@ -298,6 +299,38 @@ export default class LlmProvider extends BaseModel {
|
|
|
298
299
|
})
|
|
299
300
|
public baseUrl?: string = undefined;
|
|
300
301
|
|
|
302
|
+
@ColumnAccessControl({
|
|
303
|
+
create: [
|
|
304
|
+
Permission.ProjectOwner,
|
|
305
|
+
Permission.ProjectAdmin,
|
|
306
|
+
Permission.ProjectMember,
|
|
307
|
+
Permission.SettingsAdmin,
|
|
308
|
+
Permission.SettingsMember,
|
|
309
|
+
Permission.CreateProjectLlm,
|
|
310
|
+
],
|
|
311
|
+
read: [Permission.Public],
|
|
312
|
+
update: [
|
|
313
|
+
Permission.ProjectOwner,
|
|
314
|
+
Permission.ProjectAdmin,
|
|
315
|
+
Permission.ProjectMember,
|
|
316
|
+
Permission.SettingsAdmin,
|
|
317
|
+
Permission.SettingsMember,
|
|
318
|
+
Permission.EditProjectLlm,
|
|
319
|
+
],
|
|
320
|
+
})
|
|
321
|
+
@TableColumn({
|
|
322
|
+
required: false,
|
|
323
|
+
type: TableColumnType.JSON,
|
|
324
|
+
title: "Additional Parameters",
|
|
325
|
+
description:
|
|
326
|
+
"Optional JSON object with extra parameters sent directly to the provider API. These are merged last and override any defaults.",
|
|
327
|
+
})
|
|
328
|
+
@Column({
|
|
329
|
+
nullable: true,
|
|
330
|
+
type: ColumnType.JSON,
|
|
331
|
+
})
|
|
332
|
+
public additionalParams?: JSONObject = undefined;
|
|
333
|
+
|
|
301
334
|
@ColumnAccessControl({
|
|
302
335
|
create: [
|
|
303
336
|
Permission.ProjectOwner,
|