@oneuptime/common 14.0.106 → 14.0.108
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/AuditLog.js +1 -1
- package/Models/AnalyticsModels/Index.js +3 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.d.mts +5 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.d.ts +5 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.js +300 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.mjs +3 -0
- package/Models/DatabaseModels/CallLog.d.mts +4 -0
- package/Models/DatabaseModels/CallLog.d.ts +4 -0
- package/Models/DatabaseModels/CallLog.js +85 -0
- package/Models/DatabaseModels/DataBiConnection.d.mts +7 -0
- package/Models/DatabaseModels/DataBiConnection.d.ts +7 -0
- package/Models/DatabaseModels/DataBiConnection.js +105 -2
- package/Models/DatabaseModels/DataDashboard.d.mts +10 -0
- package/Models/DatabaseModels/DataDashboard.d.ts +10 -0
- package/Models/DatabaseModels/DataDashboard.js +129 -2
- package/Models/DatabaseModels/Index.js +8 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +55 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.d.mts +26 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.d.ts +26 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.js +536 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.mjs +2 -0
- package/Models/DatabaseModels/NetworkSite.d.mts +1 -0
- package/Models/DatabaseModels/NetworkSite.d.ts +1 -0
- package/Models/DatabaseModels/NetworkSite.js +51 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.d.mts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.d.ts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +41 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.d.mts +2 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.d.ts +2 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.js +80 -1
- package/Models/DatabaseModels/RumApplication.d.mts +2 -0
- package/Models/DatabaseModels/RumApplication.d.ts +2 -0
- package/Models/DatabaseModels/RumApplication.js +108 -0
- package/Models/DatabaseModels/RumProductAnalyticsSavedView.d.mts +20 -0
- package/Models/DatabaseModels/RumProductAnalyticsSavedView.d.ts +20 -0
- package/Models/DatabaseModels/RumProductAnalyticsSavedView.js +353 -0
- package/Models/DatabaseModels/RumProductAnalyticsSavedView.mjs +2 -0
- package/Models/DatabaseModels/Team.js +10 -2
- package/Models/DatabaseModels/TeamComplianceSetting.js +8 -1
- package/Models/DatabaseModels/TeamCustomRole.js +9 -1
- package/Models/DatabaseModels/TeamMember.js +15 -1
- package/Models/DatabaseModels/TeamOwnerTeam.d.mts +17 -0
- package/Models/DatabaseModels/TeamOwnerTeam.d.ts +17 -0
- package/Models/DatabaseModels/TeamOwnerTeam.js +325 -0
- package/Models/DatabaseModels/TeamOwnerTeam.mjs +2 -0
- package/Models/DatabaseModels/TeamOwnerUser.d.mts +17 -0
- package/Models/DatabaseModels/TeamOwnerUser.d.ts +17 -0
- package/Models/DatabaseModels/TeamOwnerUser.js +331 -0
- package/Models/DatabaseModels/TeamOwnerUser.mjs +2 -0
- package/Models/DatabaseModels/TeamPermission.js +12 -1
- package/Models/DatabaseModels/TelemetryUsageBilling.d.mts +1 -0
- package/Models/DatabaseModels/TelemetryUsageBilling.d.ts +1 -0
- package/Models/DatabaseModels/TelemetryUsageBilling.js +34 -0
- package/Models/DatabaseModels/WhatsAppLog.d.mts +3 -0
- package/Models/DatabaseModels/WhatsAppLog.d.ts +3 -0
- package/Models/DatabaseModels/WhatsAppLog.js +62 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.d.mts +11 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.d.ts +11 -0
- package/Models/DatabaseModels/WorkspaceUserGroup.js +1 -1
- package/Server/Utils/Telemetry/NotificationDeliveryMetrics.d.mts +212 -0
- package/Server/Utils/Telemetry/NotificationDeliveryMetrics.d.ts +212 -0
- package/Server/Utils/Workspace/WorkspaceBase.d.mts +3 -0
- package/Server/Utils/Workspace/WorkspaceBase.d.ts +3 -0
- package/Types/AI/AIActionWords.d.mts +1 -0
- package/Types/AI/AIActionWords.d.ts +1 -0
- package/Types/AI/AIActionWords.js +15 -4
- package/Types/AI/AIChatRecordSeen.d.mts +3 -0
- package/Types/AI/AIChatRecordSeen.d.ts +3 -0
- package/Types/AI/AIChatRecordSeen.js +28 -3
- package/Types/AI/AIChatRecordSeen.mjs +1 -0
- package/Types/AI/AIChatTypes.d.mts +2 -1
- package/Types/AI/AIChatTypes.d.ts +2 -1
- package/Types/AI/AIChatTypes.js +2 -0
- package/Types/AI/InvestigationNotStartedReason.d.mts +7 -0
- package/Types/AI/InvestigationNotStartedReason.d.ts +7 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.d.mts +2 -1
- package/Types/AnalyticsDatabase/AnalyticsTableName.d.ts +2 -1
- package/Types/AnalyticsDatabase/AnalyticsTableName.js +7 -0
- package/Types/AuditLog/AuditLogRetention.d.mts +10 -0
- package/Types/AuditLog/AuditLogRetention.d.ts +10 -0
- package/Types/AuditLog/AuditLogRetention.js +91 -0
- package/Types/AuditLog/AuditLogRetention.mjs +8 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.d.mts +37 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.d.ts +37 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.js +224 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.mjs +3 -0
- package/Types/CodeInSentence.d.mts +8 -0
- package/Types/CodeInSentence.d.ts +8 -0
- package/Types/CodeInSentence.js +875 -0
- package/Types/CodeInSentence.mjs +4 -0
- package/Types/CodeRepository/CodeFileSeen.d.mts +3 -0
- package/Types/CodeRepository/CodeFileSeen.d.ts +3 -0
- package/Types/CodeRepository/CodeFileSeen.js +61 -3
- package/Types/Dashboard/DashboardComponentType.d.mts +2 -0
- package/Types/Dashboard/DashboardComponentType.d.ts +2 -0
- package/Types/Dashboard/DashboardComponentType.js +7 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.d.mts +3 -1
- package/Types/Dashboard/DashboardComponents/ComponentArgument.d.ts +3 -1
- package/Types/Dashboard/DashboardComponents/ComponentArgument.js +3 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsFunnelComponent.d.mts +11 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsFunnelComponent.d.ts +11 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsFunnelComponent.js +2 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsFunnelComponent.mjs +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsRetentionComponent.d.mts +11 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsRetentionComponent.d.ts +11 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsRetentionComponent.js +2 -0
- package/Types/Dashboard/DashboardComponents/DashboardProductAnalyticsRetentionComponent.mjs +1 -0
- package/Types/Dashboard/PublicDashboardServedSettings.js +15 -7
- package/Types/DataObservability/DataBiRefreshAlert.d.mts +44 -0
- package/Types/DataObservability/DataBiRefreshAlert.d.ts +44 -0
- package/Types/DataObservability/DataBiRefreshAlert.js +206 -0
- package/Types/DataObservability/DataBiRefreshAlert.mjs +12 -0
- package/Types/DataObservability/DataDashboardActivity.d.mts +40 -0
- package/Types/DataObservability/DataDashboardActivity.d.ts +40 -0
- package/Types/DataObservability/DataDashboardActivity.js +119 -0
- package/Types/DataObservability/DataDashboardActivity.mjs +12 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.mts +14 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.ts +14 -0
- package/Types/DataObservability/DataObservabilityApiTypes.js +14 -0
- package/Types/DataObservability/DataTableLineage.d.mts +108 -0
- package/Types/DataObservability/DataTableLineage.d.ts +108 -0
- package/Types/DataObservability/DataTableLineage.js +119 -0
- package/Types/DataObservability/DataTableLineage.mjs +21 -0
- package/Types/DataSecurity/DataStoreKind.d.mts +1 -0
- package/Types/DataSecurity/DataStoreKind.d.ts +1 -0
- package/Types/DataSecurity/DataStoreKind.js +3 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +6 -0
- package/Types/DatabaseServer/DatabaseServerMetricCatalog.js +71 -82
- package/Types/Date.d.mts +4 -0
- package/Types/Date.d.ts +4 -0
- package/Types/Date.js +47 -2
- package/Types/Date.mjs +2 -0
- package/Types/DateLanguage.d.mts +9 -0
- package/Types/DateLanguage.d.ts +9 -0
- package/Types/DateLanguage.js +79 -1
- package/Types/DateLanguage.mjs +4 -0
- package/Types/HashedString.js +9 -2
- package/Types/MessageQueue/MessageQueueMetricCatalog.js +61 -61
- package/Types/Monitor/CriteriaFilterTerms.d.mts +4 -0
- package/Types/Monitor/CriteriaFilterTerms.d.ts +4 -0
- package/Types/Monitor/CriteriaFilterTerms.js +166 -0
- package/Types/Monitor/CriteriaFilterTerms.mjs +4 -0
- package/Types/Monitor/CriteriaFilterValues.d.mts +16 -0
- package/Types/Monitor/CriteriaFilterValues.d.ts +16 -0
- package/Types/Monitor/CriteriaFilterValues.js +324 -0
- package/Types/Monitor/CriteriaFilterValues.mjs +2 -0
- package/Types/Monitor/DataBiRefreshMonitorStep.d.mts +13 -0
- package/Types/Monitor/DataBiRefreshMonitorStep.d.ts +13 -0
- package/Types/Monitor/DataBiRefreshMonitorStep.js +108 -0
- package/Types/Monitor/DataBiRefreshMonitorStep.mjs +3 -0
- package/Types/Monitor/EvaluationSentence.d.mts +37 -0
- package/Types/Monitor/EvaluationSentence.d.ts +37 -0
- package/Types/Monitor/EvaluationSentence.js +298 -0
- package/Types/Monitor/EvaluationSentence.mjs +12 -0
- package/Types/Monitor/IncomingEmailMonitor/IncomingEmailMonitorRequest.d.mts +1 -0
- package/Types/Monitor/IncomingEmailMonitor/IncomingEmailMonitorRequest.d.ts +1 -0
- package/Types/Monitor/MonitorCriteria.d.mts +2 -0
- package/Types/Monitor/MonitorCriteria.d.ts +2 -0
- package/Types/Monitor/MonitorCriteria.js +8 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.js +265 -196
- package/Types/Monitor/MonitorEvaluationDetails.d.mts +2 -0
- package/Types/Monitor/MonitorEvaluationDetails.d.ts +2 -0
- package/Types/Monitor/MonitorEvaluationSummary.d.mts +4 -0
- package/Types/Monitor/MonitorEvaluationSummary.d.ts +4 -0
- package/Types/Monitor/MonitorStep.d.mts +2 -0
- package/Types/Monitor/MonitorStep.d.ts +2 -0
- package/Types/Monitor/MonitorStep.js +28 -11
- package/Types/Monitor/MonitorStepMetricMonitor.js +6 -1
- package/Types/Monitor/MonitorStepRollingTime.d.mts +12 -0
- package/Types/Monitor/MonitorStepRollingTime.d.ts +12 -0
- package/Types/Monitor/MonitorStepRollingTime.js +117 -0
- package/Types/Monitor/MonitorStepRollingTime.mjs +2 -0
- package/Types/Monitor/MonitorSteps.d.mts +2 -0
- package/Types/Monitor/MonitorSteps.d.ts +2 -0
- package/Types/Monitor/MonitorType.d.mts +1 -0
- package/Types/Monitor/MonitorType.d.ts +1 -0
- package/Types/Monitor/MonitorType.js +12 -0
- package/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +11 -0
- package/Types/Monitor/ServerMonitor/ServerMonitorResponse.d.mts +1 -0
- package/Types/Monitor/ServerMonitor/ServerMonitorResponse.d.ts +1 -0
- package/Types/Monitor/TelemetryAlertRule.js +7 -2
- package/Types/Monitor/TelemetryObservation.d.mts +15 -0
- package/Types/Monitor/TelemetryObservation.d.ts +15 -0
- package/Types/Monitor/TelemetryObservation.js +28 -0
- package/Types/Monitor/TelemetryObservation.mjs +2 -0
- package/Types/NetworkDevice/DeviceNaming.d.mts +87 -0
- package/Types/NetworkDevice/DeviceNaming.d.ts +87 -0
- package/Types/NetworkDevice/DeviceNaming.js +279 -0
- package/Types/NetworkDevice/DeviceNaming.mjs +24 -0
- package/Types/NetworkDevice/DiscoveredDevice.d.mts +1 -0
- package/Types/NetworkDevice/DiscoveredDevice.d.ts +1 -0
- package/Types/NetworkDevice/DiscoveredDevice.js +4 -0
- package/Types/NotificationRule/NotificationRepeat.d.mts +10 -0
- package/Types/NotificationRule/NotificationRepeat.d.ts +10 -0
- package/Types/NotificationRule/NotificationRepeat.js +51 -0
- package/Types/NotificationRule/NotificationRepeat.mjs +2 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +70 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +70 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +276 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +12 -0
- package/Types/OnCallDutyPolicy/OnCallEscalationWait.d.mts +9 -0
- package/Types/OnCallDutyPolicy/OnCallEscalationWait.d.ts +9 -0
- package/Types/OnCallDutyPolicy/OnCallEscalationWait.js +44 -0
- package/Types/OnCallDutyPolicy/OnCallEscalationWait.mjs +5 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.d.mts +68 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.d.ts +68 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.js +351 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.mjs +15 -0
- package/Types/Permission.d.mts +5 -0
- package/Types/Permission.d.ts +5 -0
- package/Types/Permission.js +61 -5
- package/Types/Probe/ProbeMonitorResponse.d.mts +1 -0
- package/Types/Probe/ProbeMonitorResponse.d.ts +1 -0
- package/Types/ReadingDirection.d.mts +2 -0
- package/Types/ReadingDirection.d.ts +2 -0
- package/Types/ReadingDirection.js +221 -25
- package/Types/ReadingDirection.mjs +2 -0
- package/Types/RollingTime/RollingTimeUtil.d.mts +7 -0
- package/Types/RollingTime/RollingTimeUtil.d.ts +7 -0
- package/Types/RollingTime/RollingTimeUtil.js +240 -71
- package/Types/Rules/RuleCriteriaFieldRegistry.js +12 -0
- package/Types/Rules/RuleCriteriaSubject.js +1 -0
- package/Types/Rum/ProductAnalyticsEventReads.d.mts +115 -0
- package/Types/Rum/ProductAnalyticsEventReads.d.ts +115 -0
- package/Types/Rum/ProductAnalyticsEventReads.js +166 -0
- package/Types/Rum/ProductAnalyticsEventReads.mjs +27 -0
- package/Types/Rum/ProductAnalyticsEvents.d.mts +121 -0
- package/Types/Rum/ProductAnalyticsEvents.d.ts +121 -0
- package/Types/Rum/ProductAnalyticsEvents.js +477 -0
- package/Types/Rum/ProductAnalyticsEvents.mjs +40 -0
- package/Types/Rum/ProductAnalyticsSavedViews.d.mts +56 -0
- package/Types/Rum/ProductAnalyticsSavedViews.d.ts +56 -0
- package/Types/Rum/ProductAnalyticsSavedViews.js +219 -0
- package/Types/Rum/ProductAnalyticsSavedViews.mjs +14 -0
- package/Types/Rum/SessionReplay.d.mts +4 -0
- package/Types/Rum/SessionReplay.d.ts +4 -0
- package/Types/Rum/SessionReplayHealth.js +1 -1
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +8 -7
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.d.mts +10 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.d.ts +10 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.js +51 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.mjs +4 -0
- package/Types/Team/BuiltInTeam.d.mts +1 -0
- package/Types/Team/BuiltInTeam.d.ts +1 -0
- package/Types/Team/BuiltInTeam.js +14 -1
- package/Types/Team/BuiltInTeam.mjs +1 -0
- package/Types/Telemetry/ServiceType.d.mts +1 -0
- package/Types/Telemetry/ServiceType.d.ts +1 -0
- package/Types/Telemetry/ServiceType.js +6 -0
- package/Types/Telemetry/TelemetryUsage.d.mts +7 -2
- package/Types/Telemetry/TelemetryUsage.d.ts +7 -2
- package/Types/Telemetry/TelemetryUsage.js +24 -5
- package/Types/Telemetry/TelemetryUsage.mjs +3 -0
- package/Types/UserNotification/UserNotificationStatus.d.mts +2 -1
- package/Types/UserNotification/UserNotificationStatus.d.ts +2 -1
- package/Types/UserNotification/UserNotificationStatus.js +8 -0
- package/Types/Workspace/NotificationRules/EventType.d.mts +2 -1
- package/Types/Workspace/NotificationRules/EventType.d.ts +2 -1
- package/Types/Workspace/NotificationRules/EventType.js +8 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +7 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +7 -1
- package/Types/Workspace/NotificationRules/NotificationRuleInvites.js +5 -1
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.d.mts +4 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.d.ts +4 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.js +2 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.mjs +1 -0
- package/Utils/AI/InvestigationReport.js +93 -21
- package/Utils/AI/InvestigationReportLanguages.d.mts +25 -0
- package/Utils/AI/InvestigationReportLanguages.d.ts +25 -0
- package/Utils/AI/InvestigationReportLanguages.js +603 -0
- package/Utils/AI/InvestigationReportLanguages.mjs +11 -0
- package/Utils/Crypto.js +10 -3
- package/Utils/Dashboard/Components/DashboardProductAnalyticsFunnelComponent.d.mts +7 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsFunnelComponent.d.ts +7 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsFunnelComponent.js +67 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsFunnelComponent.mjs +2 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsRetentionComponent.d.mts +7 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsRetentionComponent.d.ts +7 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsRetentionComponent.js +68 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsRetentionComponent.mjs +2 -0
- package/Utils/Dashboard/DashboardWidgetIds.js +6 -1
- package/Utils/Dashboard/TableThresholds.js +5 -2
- package/Utils/Metrics/MetricQueryCloudAggregation.js +2 -4
- package/Utils/Monitor/MonitorLogSummaryUtil.d.mts +8 -0
- package/Utils/Monitor/MonitorLogSummaryUtil.d.ts +8 -0
- package/Utils/Monitor/MonitorLogSummaryUtil.js +170 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +17 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +17 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +246 -0
- package/Utils/Monitor/MonitorRootCauseWording.mjs +2 -0
- package/Utils/Monitor/MonitorStepMetricQueries.js +2 -1
- package/Utils/Monitor/MonitorStepsValuesUtil.d.mts +13 -0
- package/Utils/Monitor/MonitorStepsValuesUtil.d.ts +13 -0
- package/Utils/Monitor/MonitorStepsValuesUtil.js +80 -0
- package/Utils/Monitor/MonitorStepsValuesUtil.mjs +2 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.d.mts +3 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.d.ts +3 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.js +5 -2
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.d.mts +75 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.d.ts +75 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.js +303 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.mjs +8 -0
- package/Utils/NetworkDevice/Naming/NamePattern.d.mts +122 -0
- package/Utils/NetworkDevice/Naming/NamePattern.d.ts +122 -0
- package/Utils/NetworkDevice/Naming/NamePattern.js +649 -0
- package/Utils/NetworkDevice/Naming/NamePattern.mjs +22 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.d.mts +77 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.d.ts +77 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.js +467 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.mjs +14 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.d.mts +26 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.d.ts +26 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.js +327 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.mjs +7 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.d.mts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.d.ts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.js +8 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.d.mts +2 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.d.ts +2 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.js +1 -0
- package/Utils/{Rum → SessionReplay}/SessionReplayHealth.d.mts +7 -6
- package/Utils/{Rum → SessionReplay}/SessionReplayHealth.d.ts +7 -6
- package/Utils/SessionReplay/SessionReplayHealth.js +703 -0
- package/Utils/Slo/SloErrorBudgetPolicy.d.mts +7 -0
- package/Utils/Slo/SloErrorBudgetPolicy.d.ts +7 -0
- package/Utils/Slo/SloErrorBudgetPolicy.js +39 -0
- package/Utils/Slo/SloErrorBudgetPolicy.mjs +1 -0
- package/Utils/Slo/SloFeedMarkdown.d.mts +19 -4
- package/Utils/Slo/SloFeedMarkdown.d.ts +19 -4
- package/Utils/Slo/SloFeedMarkdown.js +64 -17
- package/Utils/Slo/SloFeedMarkdown.mjs +4 -0
- package/Utils/Slo/SloProjection.d.mts +18 -0
- package/Utils/Slo/SloProjection.d.ts +18 -0
- package/Utils/Slo/SloProjection.js +53 -12
- package/Utils/Slo/SloProjection.mjs +2 -0
- package/Utils/StatusPage/ResourceExplorer.d.mts +0 -10
- package/Utils/StatusPage/ResourceExplorer.d.ts +0 -10
- package/Utils/StatusPage/ResourceExplorer.js +5 -32
- package/Utils/TotpSetupKey.d.mts +3 -0
- package/Utils/TotpSetupKey.d.ts +3 -0
- package/Utils/TotpSetupKey.js +72 -0
- package/Utils/TotpSetupKey.mjs +4 -0
- package/Utils/Workspace/WorkspaceChannelName.js +5 -1
- package/package.json +1 -1
- package/Utils/Rum/SessionReplayHealth.js +0 -558
- /package/Utils/{Rum → SessionReplay}/SessionReplayHealth.mjs +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { NamingLookupEntry, NamingLookupKey } from "../../../Types/NetworkDevice/DeviceNaming.mjs";
|
|
2
|
+
export declare const NAMING_LOOKUP_KEY_TITLES: Readonly<Record<NamingLookupKey, string>>;
|
|
3
|
+
export declare const NAMING_LOOKUP_VALUE_EXAMPLE: string;
|
|
4
|
+
export declare const NAMING_LOOKUP_KEY_EXAMPLES: Readonly<Record<NamingLookupKey, string>>;
|
|
5
|
+
export declare const NAMING_LOOKUP_PROBLEMS: {
|
|
6
|
+
readonly notAList: string;
|
|
7
|
+
readonly tooMany: string;
|
|
8
|
+
readonly noKeyKind: string;
|
|
9
|
+
readonly unusedTable: string;
|
|
10
|
+
readonly emptyTable: string;
|
|
11
|
+
readonly badKey: string;
|
|
12
|
+
readonly keyTooLong: string;
|
|
13
|
+
readonly emptyValue: string;
|
|
14
|
+
readonly valueTooLong: string;
|
|
15
|
+
readonly controlCharacter: string;
|
|
16
|
+
readonly duplicateKey: string;
|
|
17
|
+
};
|
|
18
|
+
export interface NamingLookupProblem {
|
|
19
|
+
template: string;
|
|
20
|
+
values: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export declare function formatNamingLookupProblem(problem: NamingLookupProblem): string;
|
|
23
|
+
/**
|
|
24
|
+
* A key as the table compares it, or null when it is not a key of its kind:
|
|
25
|
+
* "051" is 51, "00-05-0B-B0-7F-FC" is 00:05:0b:b0:7f:fc, "DMB-5" is dmb-5.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeNamingLookupKey(kind: NamingLookupKey, value: unknown): string | null;
|
|
28
|
+
export interface NamingLookupTable {
|
|
29
|
+
kind: NamingLookupKey;
|
|
30
|
+
values: ReadonlyMap<string, string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The table a rule stored, read for lookups: each row's key normalized, the
|
|
34
|
+
* first row of a key winning. Rows that are not rows are skipped - the
|
|
35
|
+
* service refuses them at save, so a skipped row is one written around it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readNamingLookupTable(data: {
|
|
38
|
+
kind: unknown;
|
|
39
|
+
entries: unknown;
|
|
40
|
+
}): NamingLookupTable | null;
|
|
41
|
+
export interface NamingLookupFacts {
|
|
42
|
+
ipAddress?: string | undefined;
|
|
43
|
+
macAddress?: string | undefined;
|
|
44
|
+
discoveredName?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
export declare function getNamingLookupKeyOf(kind: NamingLookupKey, facts: NamingLookupFacts): string | null;
|
|
47
|
+
export declare function lookUpNamingValue(table: NamingLookupTable, facts: NamingLookupFacts): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The rows checked as the service saves them and the form shows them: each
|
|
50
|
+
* key a key of the kind, each value there and short enough, no key twice.
|
|
51
|
+
* Returns the rows to store - trimmed, keys as typed - or the first problem.
|
|
52
|
+
* Row numbers count from 1, as a person reads the table.
|
|
53
|
+
*/
|
|
54
|
+
export declare function validateNamingLookupEntries(data: {
|
|
55
|
+
kind: unknown;
|
|
56
|
+
entries: unknown;
|
|
57
|
+
}): {
|
|
58
|
+
entries: Array<NamingLookupEntry>;
|
|
59
|
+
} | {
|
|
60
|
+
problem: NamingLookupProblem;
|
|
61
|
+
};
|
|
62
|
+
export interface ParsedNamingLookupText {
|
|
63
|
+
entries: Array<NamingLookupEntry>;
|
|
64
|
+
incompleteLines: Array<number>;
|
|
65
|
+
}
|
|
66
|
+
export declare const MAX_NAMING_LOOKUP_TEXT_LENGTH: number;
|
|
67
|
+
/**
|
|
68
|
+
* The rows of a pasted table or a CSV file. Rows are not checked here: the
|
|
69
|
+
* form shows them and validateNamingLookupEntries says what is wrong, with
|
|
70
|
+
* the row it is on.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseNamingLookupText(text: string, kind: NamingLookupKey): ParsedNamingLookupText;
|
|
73
|
+
/**
|
|
74
|
+
* The table as a CSV file: a header line naming the key, then a line per
|
|
75
|
+
* row. parseNamingLookupText reads it back to the same rows.
|
|
76
|
+
*/
|
|
77
|
+
export declare function toNamingLookupCsv(kind: NamingLookupKey, entries: ReadonlyArray<NamingLookupEntry>): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { NamingLookupEntry, NamingLookupKey } from "../../../Types/NetworkDevice/DeviceNaming";
|
|
2
|
+
export declare const NAMING_LOOKUP_KEY_TITLES: Readonly<Record<NamingLookupKey, string>>;
|
|
3
|
+
export declare const NAMING_LOOKUP_VALUE_EXAMPLE: string;
|
|
4
|
+
export declare const NAMING_LOOKUP_KEY_EXAMPLES: Readonly<Record<NamingLookupKey, string>>;
|
|
5
|
+
export declare const NAMING_LOOKUP_PROBLEMS: {
|
|
6
|
+
readonly notAList: string;
|
|
7
|
+
readonly tooMany: string;
|
|
8
|
+
readonly noKeyKind: string;
|
|
9
|
+
readonly unusedTable: string;
|
|
10
|
+
readonly emptyTable: string;
|
|
11
|
+
readonly badKey: string;
|
|
12
|
+
readonly keyTooLong: string;
|
|
13
|
+
readonly emptyValue: string;
|
|
14
|
+
readonly valueTooLong: string;
|
|
15
|
+
readonly controlCharacter: string;
|
|
16
|
+
readonly duplicateKey: string;
|
|
17
|
+
};
|
|
18
|
+
export interface NamingLookupProblem {
|
|
19
|
+
template: string;
|
|
20
|
+
values: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export declare function formatNamingLookupProblem(problem: NamingLookupProblem): string;
|
|
23
|
+
/**
|
|
24
|
+
* A key as the table compares it, or null when it is not a key of its kind:
|
|
25
|
+
* "051" is 51, "00-05-0B-B0-7F-FC" is 00:05:0b:b0:7f:fc, "DMB-5" is dmb-5.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeNamingLookupKey(kind: NamingLookupKey, value: unknown): string | null;
|
|
28
|
+
export interface NamingLookupTable {
|
|
29
|
+
kind: NamingLookupKey;
|
|
30
|
+
values: ReadonlyMap<string, string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The table a rule stored, read for lookups: each row's key normalized, the
|
|
34
|
+
* first row of a key winning. Rows that are not rows are skipped - the
|
|
35
|
+
* service refuses them at save, so a skipped row is one written around it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readNamingLookupTable(data: {
|
|
38
|
+
kind: unknown;
|
|
39
|
+
entries: unknown;
|
|
40
|
+
}): NamingLookupTable | null;
|
|
41
|
+
export interface NamingLookupFacts {
|
|
42
|
+
ipAddress?: string | undefined;
|
|
43
|
+
macAddress?: string | undefined;
|
|
44
|
+
discoveredName?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
export declare function getNamingLookupKeyOf(kind: NamingLookupKey, facts: NamingLookupFacts): string | null;
|
|
47
|
+
export declare function lookUpNamingValue(table: NamingLookupTable, facts: NamingLookupFacts): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The rows checked as the service saves them and the form shows them: each
|
|
50
|
+
* key a key of the kind, each value there and short enough, no key twice.
|
|
51
|
+
* Returns the rows to store - trimmed, keys as typed - or the first problem.
|
|
52
|
+
* Row numbers count from 1, as a person reads the table.
|
|
53
|
+
*/
|
|
54
|
+
export declare function validateNamingLookupEntries(data: {
|
|
55
|
+
kind: unknown;
|
|
56
|
+
entries: unknown;
|
|
57
|
+
}): {
|
|
58
|
+
entries: Array<NamingLookupEntry>;
|
|
59
|
+
} | {
|
|
60
|
+
problem: NamingLookupProblem;
|
|
61
|
+
};
|
|
62
|
+
export interface ParsedNamingLookupText {
|
|
63
|
+
entries: Array<NamingLookupEntry>;
|
|
64
|
+
incompleteLines: Array<number>;
|
|
65
|
+
}
|
|
66
|
+
export declare const MAX_NAMING_LOOKUP_TEXT_LENGTH: number;
|
|
67
|
+
/**
|
|
68
|
+
* The rows of a pasted table or a CSV file. Rows are not checked here: the
|
|
69
|
+
* form shows them and validateNamingLookupEntries says what is wrong, with
|
|
70
|
+
* the row it is on.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseNamingLookupText(text: string, kind: NamingLookupKey): ParsedNamingLookupText;
|
|
73
|
+
/**
|
|
74
|
+
* The table as a CSV file: a header line naming the key, then a line per
|
|
75
|
+
* row. parseNamingLookupText reads it back to the same rows.
|
|
76
|
+
*/
|
|
77
|
+
export declare function toNamingLookupCsv(kind: NamingLookupKey, entries: ReadonlyArray<NamingLookupEntry>): string;
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_NAMING_LOOKUP_TEXT_LENGTH = exports.NAMING_LOOKUP_PROBLEMS = exports.NAMING_LOOKUP_KEY_EXAMPLES = exports.NAMING_LOOKUP_VALUE_EXAMPLE = exports.NAMING_LOOKUP_KEY_TITLES = void 0;
|
|
4
|
+
exports.formatNamingLookupProblem = formatNamingLookupProblem;
|
|
5
|
+
exports.normalizeNamingLookupKey = normalizeNamingLookupKey;
|
|
6
|
+
exports.readNamingLookupTable = readNamingLookupTable;
|
|
7
|
+
exports.getNamingLookupKeyOf = getNamingLookupKeyOf;
|
|
8
|
+
exports.lookUpNamingValue = lookUpNamingValue;
|
|
9
|
+
exports.validateNamingLookupEntries = validateNamingLookupEntries;
|
|
10
|
+
exports.parseNamingLookupText = parseNamingLookupText;
|
|
11
|
+
exports.toNamingLookupCsv = toNamingLookupCsv;
|
|
12
|
+
const DeviceNaming_1 = require("../../../Types/NetworkDevice/DeviceNaming");
|
|
13
|
+
const NamePattern_1 = require("./NamePattern");
|
|
14
|
+
/*
|
|
15
|
+
* A NAMING RULE'S LOOKUP TABLE (OneUptime issue #6619).
|
|
16
|
+
*
|
|
17
|
+
* A naming convention is often a table, not a formula. The reporter's is:
|
|
18
|
+
* in every unit's subnet, the device at .51 is the menu player MNUPLR01, the
|
|
19
|
+
* one at .151 the left screen MNUSCR01, the ones at .154 to .159 the drive-
|
|
20
|
+
* through screens DRTSCR01 to DRTSCR06. No pattern computes that from the
|
|
21
|
+
* address. So a rule may carry a table - the last part of the IP address, the
|
|
22
|
+
* IP address, the MAC address or the discovered name, each with the value it
|
|
23
|
+
* stands for - and its pattern puts the device's value where it says
|
|
24
|
+
* {lookup}: "UN{site.code}{lookup}" names all seventeen devices of every unit.
|
|
25
|
+
*
|
|
26
|
+
* A device whose value is not in the table is not named by the rule, and the
|
|
27
|
+
* next rule is tried. The table is typed in the rule form, pasted from a
|
|
28
|
+
* spreadsheet, or read from a CSV file, and saved back as one.
|
|
29
|
+
*
|
|
30
|
+
* Keys are compared the way their kind is written by different tools: an
|
|
31
|
+
* address without leading zeros, a MAC without its separators, a name
|
|
32
|
+
* without case.
|
|
33
|
+
*/
|
|
34
|
+
/*
|
|
35
|
+
* Marks an English sentence as a key of the Dashboard's locales (see
|
|
36
|
+
* NamePattern.ts, whose marker this is too).
|
|
37
|
+
*/
|
|
38
|
+
const translationKey = (text) => {
|
|
39
|
+
return text;
|
|
40
|
+
};
|
|
41
|
+
// One part of an IPv4 address, as digits.
|
|
42
|
+
const OCTET_DIGITS = /^\d{1,3}$/;
|
|
43
|
+
// What an IPv6 address is written with.
|
|
44
|
+
const IPV6_CHARACTERS = /^[0-9a-fA-F:.]+$/;
|
|
45
|
+
/*
|
|
46
|
+
* A cell a spreadsheet would run as a formula, and the same cell as the
|
|
47
|
+
* export writes it, behind an apostrophe.
|
|
48
|
+
*/
|
|
49
|
+
const FORMULA_CELL = /^[=+\-@]/;
|
|
50
|
+
const ESCAPED_FORMULA_CELL = /^'[=+\-@]/;
|
|
51
|
+
// A cell the CSV export puts in quotes.
|
|
52
|
+
const CELL_NEEDING_QUOTES = /[",;\t\r\n]/;
|
|
53
|
+
// What the rule form's choice and the table's first column call each key.
|
|
54
|
+
exports.NAMING_LOOKUP_KEY_TITLES = {
|
|
55
|
+
[DeviceNaming_1.NamingLookupKey.LastIpOctet]: translationKey("Last part of the IP address"),
|
|
56
|
+
[DeviceNaming_1.NamingLookupKey.IpAddress]: translationKey("IP address"),
|
|
57
|
+
[DeviceNaming_1.NamingLookupKey.MacAddress]: translationKey("MAC address"),
|
|
58
|
+
[DeviceNaming_1.NamingLookupKey.DiscoveredName]: translationKey("Discovered name"),
|
|
59
|
+
};
|
|
60
|
+
// An example of a table's value: the reporter's menu player's code.
|
|
61
|
+
exports.NAMING_LOOKUP_VALUE_EXAMPLE = "MNUPLR01";
|
|
62
|
+
// An example key of each kind, for the table's empty row.
|
|
63
|
+
exports.NAMING_LOOKUP_KEY_EXAMPLES = {
|
|
64
|
+
[DeviceNaming_1.NamingLookupKey.LastIpOctet]: "51",
|
|
65
|
+
[DeviceNaming_1.NamingLookupKey.IpAddress]: "10.48.145.51",
|
|
66
|
+
[DeviceNaming_1.NamingLookupKey.MacAddress]: "00:05:0b:b0:7f:fc",
|
|
67
|
+
[DeviceNaming_1.NamingLookupKey.DiscoveredName]: "dmb-5",
|
|
68
|
+
};
|
|
69
|
+
exports.NAMING_LOOKUP_PROBLEMS = {
|
|
70
|
+
notAList: translationKey("The lookup table must be a list of rows, each with a key and a value."),
|
|
71
|
+
tooMany: translationKey("A lookup table can have at most {{max}} rows."),
|
|
72
|
+
noKeyKind: translationKey("Choose what the lookup table is keyed by: the last part of the IP address, the IP address, the MAC address or the discovered name."),
|
|
73
|
+
unusedTable: translationKey("Put {lookup} in the name pattern where the table's value goes, or clear the table."),
|
|
74
|
+
emptyTable: translationKey("The name pattern uses {lookup}: add a row to the lookup table, or take {lookup} out of the pattern."),
|
|
75
|
+
badKey: translationKey('Row {{row}}: "{{key}}" is not a {{kind}}, such as {{example}}.'),
|
|
76
|
+
keyTooLong: translationKey("Row {{row}}: the key can be at most {{max}} characters long."),
|
|
77
|
+
emptyValue: translationKey("Row {{row}}: enter the value for {{key}}."),
|
|
78
|
+
valueTooLong: translationKey("Row {{row}}: the value can be at most {{max}} characters long."),
|
|
79
|
+
controlCharacter: translationKey("Row {{row}}: a key or value can't contain line breaks or other control characters."),
|
|
80
|
+
duplicateKey: translationKey('Rows {{first}} and {{row}} both have the key "{{key}}". Keep one of them.'),
|
|
81
|
+
};
|
|
82
|
+
function formatNamingLookupProblem(problem) {
|
|
83
|
+
let text = problem.template;
|
|
84
|
+
for (const [key, value] of Object.entries(problem.values)) {
|
|
85
|
+
text = text.split(`{{${key}}}`).join(value);
|
|
86
|
+
}
|
|
87
|
+
return text;
|
|
88
|
+
}
|
|
89
|
+
function hasControlCharacter(value) {
|
|
90
|
+
for (let index = 0; index < value.length; index++) {
|
|
91
|
+
const code = value.charCodeAt(index);
|
|
92
|
+
if (code < 0x20 || (code >= 0x7f && code <= 0x9f)) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A key as the table compares it, or null when it is not a key of its kind:
|
|
100
|
+
* "051" is 51, "00-05-0B-B0-7F-FC" is 00:05:0b:b0:7f:fc, "DMB-5" is dmb-5.
|
|
101
|
+
*/
|
|
102
|
+
function normalizeNamingLookupKey(kind, value) {
|
|
103
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const text = String(value).trim();
|
|
107
|
+
if (!text || text.length > DeviceNaming_1.MAX_NAMING_LOOKUP_KEY_LENGTH) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
switch (kind) {
|
|
111
|
+
case DeviceNaming_1.NamingLookupKey.LastIpOctet: {
|
|
112
|
+
// A whole number from 0 to 255, or a written ".51".
|
|
113
|
+
const digits = text.startsWith(".") ? text.substring(1) : text;
|
|
114
|
+
if (!OCTET_DIGITS.test(digits)) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const octet = parseInt(digits, 10);
|
|
118
|
+
return octet <= 255 ? String(octet) : null;
|
|
119
|
+
}
|
|
120
|
+
case DeviceNaming_1.NamingLookupKey.IpAddress: {
|
|
121
|
+
const octets = (0, NamePattern_1.readIpv4Octets)(text);
|
|
122
|
+
if (octets) {
|
|
123
|
+
return octets.join(".");
|
|
124
|
+
}
|
|
125
|
+
// An IPv6 address, compared without case.
|
|
126
|
+
return text.includes(":") && IPV6_CHARACTERS.test(text)
|
|
127
|
+
? text.toLowerCase()
|
|
128
|
+
: null;
|
|
129
|
+
}
|
|
130
|
+
case DeviceNaming_1.NamingLookupKey.MacAddress: {
|
|
131
|
+
const digits = (0, NamePattern_1.readMacAddressDigits)(text);
|
|
132
|
+
if (!digits) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
const lower = digits.toLowerCase();
|
|
136
|
+
const pairs = [];
|
|
137
|
+
for (let index = 0; index < lower.length; index += 2) {
|
|
138
|
+
pairs.push(lower.substring(index, index + 2));
|
|
139
|
+
}
|
|
140
|
+
return pairs.join(":");
|
|
141
|
+
}
|
|
142
|
+
case DeviceNaming_1.NamingLookupKey.DiscoveredName:
|
|
143
|
+
return hasControlCharacter(text) ? null : text.toLowerCase();
|
|
144
|
+
default:
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The table a rule stored, read for lookups: each row's key normalized, the
|
|
150
|
+
* first row of a key winning. Rows that are not rows are skipped - the
|
|
151
|
+
* service refuses them at save, so a skipped row is one written around it.
|
|
152
|
+
*/
|
|
153
|
+
function readNamingLookupTable(data) {
|
|
154
|
+
if (!(0, DeviceNaming_1.isNamingLookupKey)(data.kind) || !Array.isArray(data.entries)) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const values = new Map();
|
|
158
|
+
for (const entry of data.entries.slice(0, DeviceNaming_1.MAX_NAMING_LOOKUP_ENTRIES)) {
|
|
159
|
+
if (!entry || typeof entry !== "object") {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const record = entry;
|
|
163
|
+
const key = normalizeNamingLookupKey(data.kind, record["key"]);
|
|
164
|
+
const value = typeof record["value"] === "string" ? record["value"].trim() : "";
|
|
165
|
+
if (!key || !value || values.has(key)) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
values.set(key, value);
|
|
169
|
+
}
|
|
170
|
+
return { kind: data.kind, values: values };
|
|
171
|
+
}
|
|
172
|
+
// The device's key in a table of this kind, or null when it has none.
|
|
173
|
+
function getNamingLookupKeyOf(kind, facts) {
|
|
174
|
+
switch (kind) {
|
|
175
|
+
case DeviceNaming_1.NamingLookupKey.LastIpOctet: {
|
|
176
|
+
const octets = (0, NamePattern_1.readIpv4Octets)(facts.ipAddress);
|
|
177
|
+
return octets ? octets[3] : null;
|
|
178
|
+
}
|
|
179
|
+
case DeviceNaming_1.NamingLookupKey.IpAddress:
|
|
180
|
+
return normalizeNamingLookupKey(kind, facts.ipAddress || "");
|
|
181
|
+
case DeviceNaming_1.NamingLookupKey.MacAddress:
|
|
182
|
+
return normalizeNamingLookupKey(kind, facts.macAddress || "");
|
|
183
|
+
case DeviceNaming_1.NamingLookupKey.DiscoveredName:
|
|
184
|
+
return normalizeNamingLookupKey(kind, facts.discoveredName || "");
|
|
185
|
+
default:
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// The table's value for the device, or undefined when the table has no row for it.
|
|
190
|
+
function lookUpNamingValue(table, facts) {
|
|
191
|
+
const key = getNamingLookupKeyOf(table.kind, facts);
|
|
192
|
+
return key === null ? undefined : table.values.get(key);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The rows checked as the service saves them and the form shows them: each
|
|
196
|
+
* key a key of the kind, each value there and short enough, no key twice.
|
|
197
|
+
* Returns the rows to store - trimmed, keys as typed - or the first problem.
|
|
198
|
+
* Row numbers count from 1, as a person reads the table.
|
|
199
|
+
*/
|
|
200
|
+
function validateNamingLookupEntries(data) {
|
|
201
|
+
if (data.entries === undefined || data.entries === null) {
|
|
202
|
+
return { entries: [] };
|
|
203
|
+
}
|
|
204
|
+
if (!Array.isArray(data.entries)) {
|
|
205
|
+
return {
|
|
206
|
+
problem: { template: exports.NAMING_LOOKUP_PROBLEMS.notAList, values: {} },
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (data.entries.length === 0) {
|
|
210
|
+
return { entries: [] };
|
|
211
|
+
}
|
|
212
|
+
if (data.entries.length > DeviceNaming_1.MAX_NAMING_LOOKUP_ENTRIES) {
|
|
213
|
+
return {
|
|
214
|
+
problem: {
|
|
215
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.tooMany,
|
|
216
|
+
values: { max: String(DeviceNaming_1.MAX_NAMING_LOOKUP_ENTRIES) },
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (!(0, DeviceNaming_1.isNamingLookupKey)(data.kind)) {
|
|
221
|
+
return {
|
|
222
|
+
problem: { template: exports.NAMING_LOOKUP_PROBLEMS.noKeyKind, values: {} },
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const kind = data.kind;
|
|
226
|
+
const entries = [];
|
|
227
|
+
const firstRowOfKey = new Map();
|
|
228
|
+
for (let index = 0; index < data.entries.length; index++) {
|
|
229
|
+
const row = String(index + 1);
|
|
230
|
+
const entry = data.entries[index];
|
|
231
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
232
|
+
return {
|
|
233
|
+
problem: { template: exports.NAMING_LOOKUP_PROBLEMS.notAList, values: {} },
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
const record = entry;
|
|
237
|
+
const rawKey = typeof record["key"] === "string" || typeof record["key"] === "number"
|
|
238
|
+
? String(record["key"]).trim()
|
|
239
|
+
: "";
|
|
240
|
+
const value = typeof record["value"] === "string" ? record["value"].trim() : "";
|
|
241
|
+
if (hasControlCharacter(rawKey) || hasControlCharacter(value)) {
|
|
242
|
+
return {
|
|
243
|
+
problem: {
|
|
244
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.controlCharacter,
|
|
245
|
+
values: { row: row },
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (rawKey.length > DeviceNaming_1.MAX_NAMING_LOOKUP_KEY_LENGTH) {
|
|
250
|
+
return {
|
|
251
|
+
problem: {
|
|
252
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.keyTooLong,
|
|
253
|
+
values: { row: row, max: String(DeviceNaming_1.MAX_NAMING_LOOKUP_KEY_LENGTH) },
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
const key = normalizeNamingLookupKey(kind, rawKey);
|
|
258
|
+
if (!key) {
|
|
259
|
+
return {
|
|
260
|
+
problem: {
|
|
261
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.badKey,
|
|
262
|
+
values: {
|
|
263
|
+
row: row,
|
|
264
|
+
key: rawKey,
|
|
265
|
+
kind: exports.NAMING_LOOKUP_KEY_TITLES[kind].toLowerCase(),
|
|
266
|
+
example: exports.NAMING_LOOKUP_KEY_EXAMPLES[kind],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (!value) {
|
|
272
|
+
return {
|
|
273
|
+
problem: {
|
|
274
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.emptyValue,
|
|
275
|
+
values: { row: row, key: rawKey },
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
if (value.length > DeviceNaming_1.MAX_NAMING_LOOKUP_VALUE_LENGTH) {
|
|
280
|
+
return {
|
|
281
|
+
problem: {
|
|
282
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.valueTooLong,
|
|
283
|
+
values: { row: row, max: String(DeviceNaming_1.MAX_NAMING_LOOKUP_VALUE_LENGTH) },
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const first = firstRowOfKey.get(key);
|
|
288
|
+
if (first !== undefined) {
|
|
289
|
+
return {
|
|
290
|
+
problem: {
|
|
291
|
+
template: exports.NAMING_LOOKUP_PROBLEMS.duplicateKey,
|
|
292
|
+
values: { first: String(first), row: row, key: rawKey },
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
firstRowOfKey.set(key, index + 1);
|
|
297
|
+
entries.push({ key: rawKey, value: value });
|
|
298
|
+
}
|
|
299
|
+
return { entries: entries };
|
|
300
|
+
}
|
|
301
|
+
// The longest text a paste or a file may be read from: 5,000 rows of 200 characters.
|
|
302
|
+
exports.MAX_NAMING_LOOKUP_TEXT_LENGTH = 1000000;
|
|
303
|
+
/*
|
|
304
|
+
* The separator the text is written with: whichever of a tab, a comma and a
|
|
305
|
+
* semicolon its first lines use most, outside quotes - a quoted cell may
|
|
306
|
+
* hold the others.
|
|
307
|
+
*/
|
|
308
|
+
function detectSeparator(lines) {
|
|
309
|
+
const totals = new Map([
|
|
310
|
+
["\t", 0],
|
|
311
|
+
[",", 0],
|
|
312
|
+
[";", 0],
|
|
313
|
+
]);
|
|
314
|
+
for (const line of lines.slice(0, 20)) {
|
|
315
|
+
let isQuoted = false;
|
|
316
|
+
for (const character of line) {
|
|
317
|
+
if (character === '"') {
|
|
318
|
+
isQuoted = !isQuoted;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (!isQuoted && totals.has(character)) {
|
|
322
|
+
totals.set(character, totals.get(character) + 1);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const counts = [
|
|
327
|
+
"\t",
|
|
328
|
+
",",
|
|
329
|
+
";",
|
|
330
|
+
].map((separator) => {
|
|
331
|
+
return { separator: separator, count: totals.get(separator) || 0 };
|
|
332
|
+
});
|
|
333
|
+
// A tab wins any tie: a spreadsheet's paste is tab-separated.
|
|
334
|
+
counts.sort((left, right) => {
|
|
335
|
+
return right.count - left.count;
|
|
336
|
+
});
|
|
337
|
+
return counts[0] && counts[0].count > 0 ? counts[0].separator : ",";
|
|
338
|
+
}
|
|
339
|
+
// One line's cells, honouring quotes ("a,b" is one cell, "" a quote in it).
|
|
340
|
+
function splitCells(line, separator) {
|
|
341
|
+
const cells = [];
|
|
342
|
+
let cell = "";
|
|
343
|
+
let isQuoted = false;
|
|
344
|
+
for (let index = 0; index < line.length; index++) {
|
|
345
|
+
const character = line[index];
|
|
346
|
+
if (isQuoted) {
|
|
347
|
+
if (character === '"' && line[index + 1] === '"') {
|
|
348
|
+
cell += '"';
|
|
349
|
+
index++;
|
|
350
|
+
}
|
|
351
|
+
else if (character === '"') {
|
|
352
|
+
isQuoted = false;
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
cell += character;
|
|
356
|
+
}
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (character === '"' && cell.trim().length === 0) {
|
|
360
|
+
cell = "";
|
|
361
|
+
isQuoted = true;
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
if (character === separator) {
|
|
365
|
+
cells.push(cell.trim());
|
|
366
|
+
cell = "";
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
cell += character;
|
|
370
|
+
}
|
|
371
|
+
cells.push(cell.trim());
|
|
372
|
+
return cells;
|
|
373
|
+
}
|
|
374
|
+
/*
|
|
375
|
+
* A cell as text: trimmed, and without the apostrophe toNamingLookupCsv puts
|
|
376
|
+
* before text a spreadsheet would read as a formula, so a table exported and
|
|
377
|
+
* read back has the same rows.
|
|
378
|
+
*/
|
|
379
|
+
function fromCsvText(cell) {
|
|
380
|
+
const trimmed = cell.trim();
|
|
381
|
+
return ESCAPED_FORMULA_CELL.test(trimmed) ? trimmed.substring(1) : trimmed;
|
|
382
|
+
}
|
|
383
|
+
function isHeaderLine(cells, kind) {
|
|
384
|
+
const first = (cells[0] || "").trim().toLowerCase();
|
|
385
|
+
const second = (cells[1] || "").trim().toLowerCase();
|
|
386
|
+
if (second !== "value" && second !== "name") {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
return (first === "key" ||
|
|
390
|
+
first === exports.NAMING_LOOKUP_KEY_TITLES[kind].toLowerCase() ||
|
|
391
|
+
normalizeNamingLookupKey(kind, cells[0] || "") === null);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* The rows of a pasted table or a CSV file. Rows are not checked here: the
|
|
395
|
+
* form shows them and validateNamingLookupEntries says what is wrong, with
|
|
396
|
+
* the row it is on.
|
|
397
|
+
*/
|
|
398
|
+
function parseNamingLookupText(text, kind) {
|
|
399
|
+
const limited = text.length > exports.MAX_NAMING_LOOKUP_TEXT_LENGTH
|
|
400
|
+
? text.substring(0, exports.MAX_NAMING_LOOKUP_TEXT_LENGTH)
|
|
401
|
+
: text;
|
|
402
|
+
// A byte order mark a spreadsheet writes at the start of a CSV file.
|
|
403
|
+
const withoutBom = limited.startsWith("")
|
|
404
|
+
? limited.substring(1)
|
|
405
|
+
: limited;
|
|
406
|
+
const lines = withoutBom.split(/\r\n|\n|\r/);
|
|
407
|
+
const separator = detectSeparator(lines);
|
|
408
|
+
const entries = [];
|
|
409
|
+
const incompleteLines = [];
|
|
410
|
+
let isFirstContentLine = true;
|
|
411
|
+
for (let index = 0; index < lines.length; index++) {
|
|
412
|
+
const line = lines[index];
|
|
413
|
+
if (!line.trim()) {
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
const cells = splitCells(line, separator);
|
|
417
|
+
if (isFirstContentLine) {
|
|
418
|
+
isFirstContentLine = false;
|
|
419
|
+
if (isHeaderLine(cells, kind)) {
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
const key = fromCsvText(cells[0] || "");
|
|
424
|
+
const value = fromCsvText(cells[1] || "");
|
|
425
|
+
if (!key && !value) {
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
if (!key || !value) {
|
|
429
|
+
incompleteLines.push(index + 1);
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
entries.push({ key: key, value: value });
|
|
433
|
+
if (entries.length >= DeviceNaming_1.MAX_NAMING_LOOKUP_ENTRIES + 1) {
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return { entries: entries, incompleteLines: incompleteLines };
|
|
438
|
+
}
|
|
439
|
+
/*
|
|
440
|
+
* One CSV cell, quoted when it holds a separator of any kind the reader
|
|
441
|
+
* tells apart (a comma, a semicolon, a tab), a quote or a line break - so
|
|
442
|
+
* the file reads back with the comma it was written with.
|
|
443
|
+
*/
|
|
444
|
+
function toCsvCell(value) {
|
|
445
|
+
/*
|
|
446
|
+
* A cell a spreadsheet would read as a formula (=, +, -, @) is kept as
|
|
447
|
+
* text with a leading apostrophe, so an exported table opened in a
|
|
448
|
+
* spreadsheet never runs one.
|
|
449
|
+
*/
|
|
450
|
+
const safe = FORMULA_CELL.test(value) ? `'${value}` : value;
|
|
451
|
+
return CELL_NEEDING_QUOTES.test(safe)
|
|
452
|
+
? `"${safe.replace(/"/g, '""')}"`
|
|
453
|
+
: safe;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* The table as a CSV file: a header line naming the key, then a line per
|
|
457
|
+
* row. parseNamingLookupText reads it back to the same rows.
|
|
458
|
+
*/
|
|
459
|
+
function toNamingLookupCsv(kind, entries) {
|
|
460
|
+
const lines = [
|
|
461
|
+
`${toCsvCell(exports.NAMING_LOOKUP_KEY_TITLES[kind])},Value`,
|
|
462
|
+
];
|
|
463
|
+
for (const entry of entries) {
|
|
464
|
+
lines.push(`${toCsvCell(entry.key)},${toCsvCell(entry.value)}`);
|
|
465
|
+
}
|
|
466
|
+
return lines.join("\r\n") + "\r\n";
|
|
467
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import commonJsModule from "./NamingLookup.js";
|
|
2
|
+
export const MAX_NAMING_LOOKUP_TEXT_LENGTH = commonJsModule.MAX_NAMING_LOOKUP_TEXT_LENGTH;
|
|
3
|
+
export const NAMING_LOOKUP_KEY_EXAMPLES = commonJsModule.NAMING_LOOKUP_KEY_EXAMPLES;
|
|
4
|
+
export const NAMING_LOOKUP_KEY_TITLES = commonJsModule.NAMING_LOOKUP_KEY_TITLES;
|
|
5
|
+
export const NAMING_LOOKUP_PROBLEMS = commonJsModule.NAMING_LOOKUP_PROBLEMS;
|
|
6
|
+
export const NAMING_LOOKUP_VALUE_EXAMPLE = commonJsModule.NAMING_LOOKUP_VALUE_EXAMPLE;
|
|
7
|
+
export const formatNamingLookupProblem = commonJsModule.formatNamingLookupProblem;
|
|
8
|
+
export const getNamingLookupKeyOf = commonJsModule.getNamingLookupKeyOf;
|
|
9
|
+
export const lookUpNamingValue = commonJsModule.lookUpNamingValue;
|
|
10
|
+
export const normalizeNamingLookupKey = commonJsModule.normalizeNamingLookupKey;
|
|
11
|
+
export const parseNamingLookupText = commonJsModule.parseNamingLookupText;
|
|
12
|
+
export const readNamingLookupTable = commonJsModule.readNamingLookupTable;
|
|
13
|
+
export const toNamingLookupCsv = commonJsModule.toNamingLookupCsv;
|
|
14
|
+
export const validateNamingLookupEntries = commonJsModule.validateNamingLookupEntries;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface DeviceNamingFacts {
|
|
2
|
+
ipAddress?: string | undefined;
|
|
3
|
+
macAddress?: string | undefined;
|
|
4
|
+
vendor?: string | undefined;
|
|
5
|
+
discoveredName?: string | undefined;
|
|
6
|
+
siteId?: string | undefined;
|
|
7
|
+
siteIds?: Array<string> | undefined;
|
|
8
|
+
siteName?: string | undefined;
|
|
9
|
+
siteCode?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface NamingRuleConditionColumns {
|
|
12
|
+
criteria?: unknown;
|
|
13
|
+
ipMatchTarget?: string | null | undefined;
|
|
14
|
+
discoveredNamePattern?: string | null | undefined;
|
|
15
|
+
macAddressPattern?: string | null | undefined;
|
|
16
|
+
vendorPattern?: string | null | undefined;
|
|
17
|
+
sites?: Array<unknown> | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function normalizeNamingAddressRange(value: string): string;
|
|
20
|
+
export declare function isValidNamingAddressRange(value: unknown): boolean;
|
|
21
|
+
export declare function addressIsInNamingRange(address: string | undefined, range: string): boolean;
|
|
22
|
+
export declare function getMacAddressSpellings(value: string | undefined): Array<string>;
|
|
23
|
+
export declare class NamingRuleMatcher {
|
|
24
|
+
static ruleMatches(rule: NamingRuleConditionColumns, facts: DeviceNamingFacts): boolean;
|
|
25
|
+
}
|
|
26
|
+
export default NamingRuleMatcher;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface DeviceNamingFacts {
|
|
2
|
+
ipAddress?: string | undefined;
|
|
3
|
+
macAddress?: string | undefined;
|
|
4
|
+
vendor?: string | undefined;
|
|
5
|
+
discoveredName?: string | undefined;
|
|
6
|
+
siteId?: string | undefined;
|
|
7
|
+
siteIds?: Array<string> | undefined;
|
|
8
|
+
siteName?: string | undefined;
|
|
9
|
+
siteCode?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface NamingRuleConditionColumns {
|
|
12
|
+
criteria?: unknown;
|
|
13
|
+
ipMatchTarget?: string | null | undefined;
|
|
14
|
+
discoveredNamePattern?: string | null | undefined;
|
|
15
|
+
macAddressPattern?: string | null | undefined;
|
|
16
|
+
vendorPattern?: string | null | undefined;
|
|
17
|
+
sites?: Array<unknown> | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function normalizeNamingAddressRange(value: string): string;
|
|
20
|
+
export declare function isValidNamingAddressRange(value: unknown): boolean;
|
|
21
|
+
export declare function addressIsInNamingRange(address: string | undefined, range: string): boolean;
|
|
22
|
+
export declare function getMacAddressSpellings(value: string | undefined): Array<string>;
|
|
23
|
+
export declare class NamingRuleMatcher {
|
|
24
|
+
static ruleMatches(rule: NamingRuleConditionColumns, facts: DeviceNamingFacts): boolean;
|
|
25
|
+
}
|
|
26
|
+
export default NamingRuleMatcher;
|