@oneuptime/common 14.0.106 → 14.0.107
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 +3 -0
- package/Models/DatabaseModels/DataBiConnection.d.ts +3 -0
- package/Models/DatabaseModels/DataBiConnection.js +47 -1
- 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 +6 -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/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/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/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/CodeRepository/CodeFileSeen.d.mts +3 -0
- package/Types/CodeRepository/CodeFileSeen.d.ts +3 -0
- package/Types/CodeRepository/CodeFileSeen.js +61 -3
- 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 +7 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.ts +7 -0
- package/Types/DataObservability/DataObservabilityApiTypes.js +2 -0
- package/Types/DataObservability/DataTableLineage.d.mts +87 -0
- package/Types/DataObservability/DataTableLineage.d.ts +87 -0
- package/Types/DataObservability/DataTableLineage.js +111 -0
- package/Types/DataObservability/DataTableLineage.mjs +19 -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/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/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/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 +243 -194
- 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/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/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/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/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/SessionReplay.d.mts +4 -0
- package/Types/Rum/SessionReplay.d.ts +4 -0
- package/Types/Rum/SessionReplayHealth.js +1 -1
- 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/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/Dashboard/TableThresholds.js +5 -2
- 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 +242 -0
- package/Utils/Monitor/MonitorRootCauseWording.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/StatusPage/ResourceExplorer.js +9 -8
- 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,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NamingRuleMatcher = void 0;
|
|
7
|
+
exports.normalizeNamingAddressRange = normalizeNamingAddressRange;
|
|
8
|
+
exports.isValidNamingAddressRange = isValidNamingAddressRange;
|
|
9
|
+
exports.addressIsInNamingRange = addressIsInNamingRange;
|
|
10
|
+
exports.getMacAddressSpellings = getMacAddressSpellings;
|
|
11
|
+
const RuleCriteriaMatcher_1 = __importDefault(require("../../Rules/RuleCriteriaMatcher"));
|
|
12
|
+
const RulePatternMatchUtil_1 = __importDefault(require("../../Rules/RulePatternMatchUtil"));
|
|
13
|
+
const ScanTargetUtil_1 = __importDefault(require("../../NetworkDiscovery/ScanTargetUtil"));
|
|
14
|
+
const PatternWork_1 = require("../../LinearRegExp/PatternWork");
|
|
15
|
+
const RuleCriteria_1 = require("../../../Types/Rules/RuleCriteria");
|
|
16
|
+
const NamePattern_1 = require("./NamePattern");
|
|
17
|
+
/*
|
|
18
|
+
* The longest text a pattern is matched against. Names and vendors are far
|
|
19
|
+
* shorter; a longer one came from a payload nobody checked, and patterns run
|
|
20
|
+
* on the linear-time matcher anyway.
|
|
21
|
+
*/
|
|
22
|
+
const MAX_PATTERN_SUBJECT_LENGTH = 500;
|
|
23
|
+
function clampSubject(value) {
|
|
24
|
+
if (typeof value !== "string") {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return value.length > MAX_PATTERN_SUBJECT_LENGTH
|
|
28
|
+
? value.substring(0, MAX_PATTERN_SUBJECT_LENGTH)
|
|
29
|
+
: value;
|
|
30
|
+
}
|
|
31
|
+
/*
|
|
32
|
+
* An IP condition as ScanTargetUtil reads it: each "*" octet is 0-255, so
|
|
33
|
+
* "10.*.*.51" is "10.0-255.0-255.51". A CIDR is left as written.
|
|
34
|
+
*/
|
|
35
|
+
function normalizeNamingAddressRange(value) {
|
|
36
|
+
const trimmed = value.trim();
|
|
37
|
+
if (trimmed.includes("/")) {
|
|
38
|
+
return trimmed;
|
|
39
|
+
}
|
|
40
|
+
return trimmed
|
|
41
|
+
.split(".")
|
|
42
|
+
.map((octet) => {
|
|
43
|
+
return octet.trim() === "*" ? "0-255" : octet.trim();
|
|
44
|
+
})
|
|
45
|
+
.join(".");
|
|
46
|
+
}
|
|
47
|
+
// True when the value is an IP condition a naming rule can match with.
|
|
48
|
+
function isValidNamingAddressRange(value) {
|
|
49
|
+
return (typeof value === "string" &&
|
|
50
|
+
value.trim().length > 0 &&
|
|
51
|
+
ScanTargetUtil_1.default.isValid(normalizeNamingAddressRange(value)));
|
|
52
|
+
}
|
|
53
|
+
function addressIsInNamingRange(address, range) {
|
|
54
|
+
if (!address) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return ScanTargetUtil_1.default.contains(normalizeNamingAddressRange(range), address);
|
|
58
|
+
}
|
|
59
|
+
/*
|
|
60
|
+
* Every spelling of a MAC a condition may be written against: with colons,
|
|
61
|
+
* with dashes, Cisco's dotted groups and bare digits, all lower case. A
|
|
62
|
+
* condition matches when it matches any of them; a negated one, when it
|
|
63
|
+
* matches none.
|
|
64
|
+
*/
|
|
65
|
+
function getMacAddressSpellings(value) {
|
|
66
|
+
const digits = (0, NamePattern_1.readMacAddressDigits)(value);
|
|
67
|
+
if (!digits) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
const lower = digits.toLowerCase();
|
|
71
|
+
const pairs = [];
|
|
72
|
+
for (let index = 0; index < lower.length; index += 2) {
|
|
73
|
+
pairs.push(lower.substring(index, index + 2));
|
|
74
|
+
}
|
|
75
|
+
return [
|
|
76
|
+
pairs.join(":"),
|
|
77
|
+
pairs.join("-"),
|
|
78
|
+
`${lower.substring(0, 4)}.${lower.substring(4, 8)}.${lower.substring(8)}`,
|
|
79
|
+
lower,
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
// The ids of a relation column: model rows, id stubs or plain ids.
|
|
83
|
+
function readRelationIds(values) {
|
|
84
|
+
const ids = [];
|
|
85
|
+
for (const value of values) {
|
|
86
|
+
if (typeof value === "string" && value.trim()) {
|
|
87
|
+
ids.push(value.trim());
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (!value || typeof value !== "object") {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const record = value;
|
|
94
|
+
for (const key of ["_id", "id"]) {
|
|
95
|
+
const candidate = record[key];
|
|
96
|
+
if (typeof candidate === "string" && candidate.trim()) {
|
|
97
|
+
ids.push(candidate.trim());
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (candidate &&
|
|
101
|
+
typeof candidate.toString ===
|
|
102
|
+
"function") {
|
|
103
|
+
const text = String(candidate);
|
|
104
|
+
if (text && text !== "[object Object]") {
|
|
105
|
+
ids.push(text);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return ids;
|
|
112
|
+
}
|
|
113
|
+
/*
|
|
114
|
+
* The rule's columns against the device, for a rule an API client wrote
|
|
115
|
+
* without conditions: every column that is set must match - an address
|
|
116
|
+
* range, a pattern for each text column, any one of the sites - and a rule
|
|
117
|
+
* with none set matches every device.
|
|
118
|
+
*/
|
|
119
|
+
function matchesColumns(rule, facts) {
|
|
120
|
+
var _a;
|
|
121
|
+
const ipMatchTarget = (rule.ipMatchTarget || "").trim();
|
|
122
|
+
if (ipMatchTarget &&
|
|
123
|
+
!addressIsInNamingRange(facts.ipAddress, ipMatchTarget)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const discoveredNamePattern = (rule.discoveredNamePattern || "").trim();
|
|
127
|
+
if (discoveredNamePattern &&
|
|
128
|
+
!RulePatternMatchUtil_1.default.matches(clampSubject(facts.discoveredName), discoveredNamePattern)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
const macAddressPattern = (rule.macAddressPattern || "").trim();
|
|
132
|
+
if (macAddressPattern) {
|
|
133
|
+
const spellings = getMacAddressSpellings(facts.macAddress);
|
|
134
|
+
const matchesAny = spellings.some((spelling) => {
|
|
135
|
+
return RulePatternMatchUtil_1.default.matches(spelling, macAddressPattern);
|
|
136
|
+
});
|
|
137
|
+
if (!matchesAny) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const vendorPattern = (rule.vendorPattern || "").trim();
|
|
142
|
+
if (vendorPattern &&
|
|
143
|
+
!RulePatternMatchUtil_1.default.matches(clampSubject(facts.vendor), vendorPattern)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const siteIds = Array.isArray(rule.sites)
|
|
147
|
+
? readRelationIds(rule.sites)
|
|
148
|
+
: [];
|
|
149
|
+
if (siteIds.length > 0) {
|
|
150
|
+
const deviceSiteIds = ((_a = facts.siteIds) === null || _a === void 0 ? void 0 : _a.length)
|
|
151
|
+
? facts.siteIds
|
|
152
|
+
: facts.siteId
|
|
153
|
+
? [facts.siteId]
|
|
154
|
+
: [];
|
|
155
|
+
if (!siteIds.some((siteId) => {
|
|
156
|
+
return deviceSiteIds.includes(siteId);
|
|
157
|
+
})) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
/*
|
|
164
|
+
* A text condition over the values a device has for its field - one name, or
|
|
165
|
+
* every spelling of its MAC. A positive operator holds when any value
|
|
166
|
+
* satisfies it; a negated one when none does ("does not contain 00-05-0b"
|
|
167
|
+
* is false for a MAC that contains it in any spelling). Compared without
|
|
168
|
+
* case, as every rule kind compares text.
|
|
169
|
+
*/
|
|
170
|
+
function matchesTextCondition(data) {
|
|
171
|
+
const expectedLower = data.expected.toLocaleLowerCase();
|
|
172
|
+
const anyValue = (test) => {
|
|
173
|
+
return data.values.some((value) => {
|
|
174
|
+
return test(value);
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
switch (data.operator) {
|
|
178
|
+
case RuleCriteria_1.RuleCriteriaOperator.Equals:
|
|
179
|
+
return anyValue((value) => {
|
|
180
|
+
return value.toLocaleLowerCase() === expectedLower;
|
|
181
|
+
});
|
|
182
|
+
case RuleCriteria_1.RuleCriteriaOperator.NotEquals:
|
|
183
|
+
return !anyValue((value) => {
|
|
184
|
+
return value.toLocaleLowerCase() === expectedLower;
|
|
185
|
+
});
|
|
186
|
+
case RuleCriteria_1.RuleCriteriaOperator.Contains:
|
|
187
|
+
return anyValue((value) => {
|
|
188
|
+
return value.toLocaleLowerCase().includes(expectedLower);
|
|
189
|
+
});
|
|
190
|
+
case RuleCriteria_1.RuleCriteriaOperator.DoesNotContain:
|
|
191
|
+
return !anyValue((value) => {
|
|
192
|
+
return value.toLocaleLowerCase().includes(expectedLower);
|
|
193
|
+
});
|
|
194
|
+
case RuleCriteria_1.RuleCriteriaOperator.StartsWith:
|
|
195
|
+
return anyValue((value) => {
|
|
196
|
+
return value.toLocaleLowerCase().startsWith(expectedLower);
|
|
197
|
+
});
|
|
198
|
+
case RuleCriteria_1.RuleCriteriaOperator.EndsWith:
|
|
199
|
+
return anyValue((value) => {
|
|
200
|
+
return value.toLocaleLowerCase().endsWith(expectedLower);
|
|
201
|
+
});
|
|
202
|
+
case RuleCriteria_1.RuleCriteriaOperator.MatchesPattern:
|
|
203
|
+
return anyValue((value) => {
|
|
204
|
+
return data.matchesPattern(value, data.expected);
|
|
205
|
+
});
|
|
206
|
+
case RuleCriteria_1.RuleCriteriaOperator.DoesNotMatchPattern: {
|
|
207
|
+
const stoppedBefore = (0, PatternWork_1.getStoppedPatternQuestions)();
|
|
208
|
+
const matches = anyValue((value) => {
|
|
209
|
+
return data.matchesPattern(value, data.expected);
|
|
210
|
+
});
|
|
211
|
+
/*
|
|
212
|
+
* A pattern question with no answer - it needed more work than the
|
|
213
|
+
* evaluation may take (LinearRegExp/PatternWork.ts) - may have
|
|
214
|
+
* matched: "matches none" is not known, so the condition does not
|
|
215
|
+
* hold.
|
|
216
|
+
*/
|
|
217
|
+
if (!matches && (0, PatternWork_1.getStoppedPatternQuestions)() > stoppedBefore) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
return !matches;
|
|
221
|
+
}
|
|
222
|
+
default:
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// One value, as the list of values a text condition reads.
|
|
227
|
+
function asValues(value) {
|
|
228
|
+
const clamped = clampSubject(value);
|
|
229
|
+
return clamped ? [clamped] : [];
|
|
230
|
+
}
|
|
231
|
+
function matchesSiteCondition(filter, facts) {
|
|
232
|
+
var _a;
|
|
233
|
+
const wanted = Array.isArray(filter.value)
|
|
234
|
+
? readRelationIds(filter.value)
|
|
235
|
+
: [];
|
|
236
|
+
const deviceSiteIds = ((_a = facts.siteIds) === null || _a === void 0 ? void 0 : _a.length)
|
|
237
|
+
? facts.siteIds
|
|
238
|
+
: facts.siteId
|
|
239
|
+
? [facts.siteId]
|
|
240
|
+
: [];
|
|
241
|
+
switch (filter.operator) {
|
|
242
|
+
case RuleCriteria_1.RuleCriteriaOperator.HasAnyOf:
|
|
243
|
+
return wanted.some((siteId) => {
|
|
244
|
+
return deviceSiteIds.includes(siteId);
|
|
245
|
+
});
|
|
246
|
+
case RuleCriteria_1.RuleCriteriaOperator.HasAllOf:
|
|
247
|
+
return (wanted.length > 0 &&
|
|
248
|
+
wanted.every((siteId) => {
|
|
249
|
+
return deviceSiteIds.includes(siteId);
|
|
250
|
+
}));
|
|
251
|
+
case RuleCriteria_1.RuleCriteriaOperator.HasNoneOf:
|
|
252
|
+
return !wanted.some((siteId) => {
|
|
253
|
+
return deviceSiteIds.includes(siteId);
|
|
254
|
+
});
|
|
255
|
+
default:
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/*
|
|
260
|
+
* One condition of a rule saved with conditions. The IP field takes only
|
|
261
|
+
* "is in" and "is not in" (an address range is its own syntax, not text),
|
|
262
|
+
* the site field only the list operators, the rest every text operator.
|
|
263
|
+
*/
|
|
264
|
+
function matchesConfiguredFilter(filter, facts) {
|
|
265
|
+
const expected = Array.isArray(filter.value)
|
|
266
|
+
? ""
|
|
267
|
+
: String(filter.value);
|
|
268
|
+
switch (filter.field) {
|
|
269
|
+
case "ipMatchTarget": {
|
|
270
|
+
const isIn = addressIsInNamingRange(facts.ipAddress, expected);
|
|
271
|
+
if (filter.operator === RuleCriteria_1.RuleCriteriaOperator.MatchesPattern) {
|
|
272
|
+
return isIn;
|
|
273
|
+
}
|
|
274
|
+
if (filter.operator === RuleCriteria_1.RuleCriteriaOperator.DoesNotMatchPattern) {
|
|
275
|
+
return !isIn;
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
case "discoveredNamePattern":
|
|
280
|
+
return matchesTextCondition({
|
|
281
|
+
values: asValues(facts.discoveredName),
|
|
282
|
+
operator: filter.operator,
|
|
283
|
+
expected: expected,
|
|
284
|
+
matchesPattern: RulePatternMatchUtil_1.default.matches,
|
|
285
|
+
});
|
|
286
|
+
case "macAddressPattern":
|
|
287
|
+
return matchesTextCondition({
|
|
288
|
+
values: getMacAddressSpellings(facts.macAddress),
|
|
289
|
+
operator: filter.operator,
|
|
290
|
+
expected: expected,
|
|
291
|
+
matchesPattern: RulePatternMatchUtil_1.default.matches,
|
|
292
|
+
});
|
|
293
|
+
case "vendorPattern":
|
|
294
|
+
return matchesTextCondition({
|
|
295
|
+
values: asValues(facts.vendor),
|
|
296
|
+
operator: filter.operator,
|
|
297
|
+
expected: expected,
|
|
298
|
+
matchesPattern: RulePatternMatchUtil_1.default.matches,
|
|
299
|
+
});
|
|
300
|
+
case "sites":
|
|
301
|
+
return matchesSiteCondition(filter, facts);
|
|
302
|
+
default:
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
class NamingRuleMatcher {
|
|
307
|
+
/*
|
|
308
|
+
* True when the rule's conditions match the device: its conditions when
|
|
309
|
+
* it was saved with them, else its columns, as an API client may write
|
|
310
|
+
* them. Conditions win - a rule saved from the form keeps no meaning in a
|
|
311
|
+
* column it left behind.
|
|
312
|
+
*/
|
|
313
|
+
static ruleMatches(rule, facts) {
|
|
314
|
+
if (rule.criteria !== undefined && rule.criteria !== null) {
|
|
315
|
+
return RuleCriteriaMatcher_1.default.matchesSync({
|
|
316
|
+
criteria: rule.criteria,
|
|
317
|
+
emptyResult: true,
|
|
318
|
+
matchesFilter: (filter) => {
|
|
319
|
+
return matchesConfiguredFilter(filter, facts);
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
return matchesColumns(rule, facts);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
exports.NamingRuleMatcher = NamingRuleMatcher;
|
|
327
|
+
exports.default = NamingRuleMatcher;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import commonJsModule from "./NamingRuleMatcher.js";
|
|
2
|
+
export default commonJsModule.default;
|
|
3
|
+
export const NamingRuleMatcher = commonJsModule.NamingRuleMatcher;
|
|
4
|
+
export const addressIsInNamingRange = commonJsModule.addressIsInNamingRange;
|
|
5
|
+
export const getMacAddressSpellings = commonJsModule.getMacAddressSpellings;
|
|
6
|
+
export const isValidNamingAddressRange = commonJsModule.isValidNamingAddressRange;
|
|
7
|
+
export const normalizeNamingAddressRange = commonJsModule.normalizeNamingAddressRange;
|
|
@@ -10,6 +10,7 @@ export interface DiscoveredNameDeviceRow {
|
|
|
10
10
|
dnsName?: string | null | undefined;
|
|
11
11
|
discoveredName?: string | null | undefined;
|
|
12
12
|
discoveredNameSource?: string | null | undefined;
|
|
13
|
+
ruleAssignedName?: string | null | undefined;
|
|
13
14
|
createdAt?: Date | string | null | undefined;
|
|
14
15
|
}
|
|
15
16
|
export interface DiscoveredNameUpgrade {
|
|
@@ -10,6 +10,7 @@ export interface DiscoveredNameDeviceRow {
|
|
|
10
10
|
dnsName?: string | null | undefined;
|
|
11
11
|
discoveredName?: string | null | undefined;
|
|
12
12
|
discoveredNameSource?: string | null | undefined;
|
|
13
|
+
ruleAssignedName?: string | null | undefined;
|
|
13
14
|
createdAt?: Date | string | null | undefined;
|
|
14
15
|
}
|
|
15
16
|
export interface DiscoveredNameUpgrade {
|
|
@@ -8,6 +8,7 @@ exports.isHostStillTheDevice = isHostStillTheDevice;
|
|
|
8
8
|
exports.planDiscoveredNameUpgrades = planDiscoveredNameUpgrades;
|
|
9
9
|
const DeviceNameSource_1 = require("../../Types/NetworkDevice/DeviceNameSource");
|
|
10
10
|
const DeviceNameRule_1 = require("../NetworkDevice/DeviceNameRule");
|
|
11
|
+
const DeviceNaming_1 = require("../../Types/NetworkDevice/DeviceNaming");
|
|
11
12
|
const DiscoveredDeviceBuilder_1 = require("./DiscoveredDeviceBuilder");
|
|
12
13
|
const DiscoveredHostUtil_1 = require("./DiscoveredHostUtil");
|
|
13
14
|
const ReverseDnsNameUtil_1 = require("./ReverseDnsNameUtil");
|
|
@@ -224,6 +225,13 @@ function planDiscoveredNameUpgrades(data) {
|
|
|
224
225
|
if (!(0, DeviceNameRule_1.isDeviceStillNamedByDiscovery)(row)) {
|
|
225
226
|
continue;
|
|
226
227
|
}
|
|
228
|
+
/*
|
|
229
|
+
* ...and not by a naming rule (issue #6619): the rules decide such a
|
|
230
|
+
* device's name, and applying them again is what renames it.
|
|
231
|
+
*/
|
|
232
|
+
if ((0, DeviceNaming_1.isDeviceStillNamedByRule)(row)) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
227
235
|
const fromSource = (0, DeviceNameSource_1.readDeviceNameSource)(row.discoveredNameSource);
|
|
228
236
|
// (d) A strictly better source.
|
|
229
237
|
if (!(0, DeviceNameSource_1.isBetterDeviceNameSource)(named.source, fromSource)) {
|
|
@@ -3,6 +3,7 @@ import { DiscoveredNetworkDevice } from "../../Models/DatabaseModels/NetworkDevi
|
|
|
3
3
|
import Hostname from "../../Types/API/Hostname.mjs";
|
|
4
4
|
import IP from "../../Types/IP/IP.mjs";
|
|
5
5
|
import ObjectID from "../../Types/ObjectID.mjs";
|
|
6
|
+
import { Translator } from "../../Types/Translator.mjs";
|
|
6
7
|
export declare const MAX_PING_MONITOR_NAME_LENGTH: number;
|
|
7
8
|
export declare const PING_MONITOR_INTERVAL: string;
|
|
8
9
|
/**
|
|
@@ -40,6 +41,7 @@ export interface BuildPingMonitorForAddressData {
|
|
|
40
41
|
deviceName: string;
|
|
41
42
|
seedIds: MonitorCriteriaSeedIds;
|
|
42
43
|
origin: PingMonitorOrigin;
|
|
44
|
+
translator?: Translator | undefined;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* The monitor's name: "Ping <device name>", clamped to the column.
|
|
@@ -3,6 +3,7 @@ import { DiscoveredNetworkDevice } from "../../Models/DatabaseModels/NetworkDevi
|
|
|
3
3
|
import Hostname from "../../Types/API/Hostname";
|
|
4
4
|
import IP from "../../Types/IP/IP";
|
|
5
5
|
import ObjectID from "../../Types/ObjectID";
|
|
6
|
+
import { Translator } from "../../Types/Translator";
|
|
6
7
|
export declare const MAX_PING_MONITOR_NAME_LENGTH: number;
|
|
7
8
|
export declare const PING_MONITOR_INTERVAL: string;
|
|
8
9
|
/**
|
|
@@ -40,6 +41,7 @@ export interface BuildPingMonitorForAddressData {
|
|
|
40
41
|
deviceName: string;
|
|
41
42
|
seedIds: MonitorCriteriaSeedIds;
|
|
42
43
|
origin: PingMonitorOrigin;
|
|
44
|
+
translator?: Translator | undefined;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* The monitor's name: "Ping <device name>", clamped to the column.
|
|
@@ -200,6 +200,7 @@ function buildPingMonitorForAddress(data) {
|
|
|
200
200
|
offlineMonitorStatusId: data.seedIds.offlineMonitorStatusId,
|
|
201
201
|
defaultIncidentSeverityId: data.seedIds.defaultIncidentSeverityId,
|
|
202
202
|
defaultAlertSeverityId: data.seedIds.defaultAlertSeverityId,
|
|
203
|
+
translator: data.translator,
|
|
203
204
|
});
|
|
204
205
|
/*
|
|
205
206
|
* The destination is what makes the step valid: MonitorStep's validation
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { RecordingHealthDiagnosis, RecordingHealthStatus, SessionReplayRefusalCount } from "../../Types/Rum/SessionReplayHealth.mjs";
|
|
2
|
+
import { Translator } from "../../Types/Translator.mjs";
|
|
2
3
|
export declare const SESSION_REPLAY_REFUSAL_ALERT_THRESHOLD: number;
|
|
3
4
|
export declare const SESSION_REPLAY_STALE_CHUNK_MS: number;
|
|
4
5
|
export declare const SESSION_REPLAY_RECORDER_ACTIVE_WINDOW_MS: number;
|
|
5
|
-
export declare function formatRelativeAge(fromUnixMs: number, nowUnixMs: number): string;
|
|
6
|
-
export declare function formatDurationForCopy(durationMs: number): string;
|
|
7
|
-
export declare function formatCountForCopy(count: number | null): string;
|
|
8
|
-
export declare function formatBytesForCopy(bytes: number): string;
|
|
6
|
+
export declare function formatRelativeAge(fromUnixMs: number, nowUnixMs: number, translator?: Translator): string;
|
|
7
|
+
export declare function formatDurationForCopy(durationMs: number, translator?: Translator): string;
|
|
8
|
+
export declare function formatCountForCopy(count: number | null, translator?: Translator): string;
|
|
9
|
+
export declare function formatBytesForCopy(bytes: number, translator?: Translator): string;
|
|
9
10
|
export declare function parseHealthTimestamp(value: string | null): number | null;
|
|
10
11
|
export declare function parseRecordingHealthStatus(raw: unknown): RecordingHealthStatus | null;
|
|
11
12
|
export declare function getTopRefusal(refusals: Array<SessionReplayRefusalCount> | null): SessionReplayRefusalCount | null;
|
|
12
|
-
export declare function describeRefusalReason(reason: string): string | null;
|
|
13
|
-
export declare function diagnoseRecordingHealth(status: RecordingHealthStatus | null, nowUnixMs: number): RecordingHealthDiagnosis;
|
|
13
|
+
export declare function describeRefusalReason(reason: string, translator?: Translator): string | null;
|
|
14
|
+
export declare function diagnoseRecordingHealth(status: RecordingHealthStatus | null, nowUnixMs: number, translator?: Translator): RecordingHealthDiagnosis;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { RecordingHealthDiagnosis, RecordingHealthStatus, SessionReplayRefusalCount } from "../../Types/Rum/SessionReplayHealth";
|
|
2
|
+
import { Translator } from "../../Types/Translator";
|
|
2
3
|
export declare const SESSION_REPLAY_REFUSAL_ALERT_THRESHOLD: number;
|
|
3
4
|
export declare const SESSION_REPLAY_STALE_CHUNK_MS: number;
|
|
4
5
|
export declare const SESSION_REPLAY_RECORDER_ACTIVE_WINDOW_MS: number;
|
|
5
|
-
export declare function formatRelativeAge(fromUnixMs: number, nowUnixMs: number): string;
|
|
6
|
-
export declare function formatDurationForCopy(durationMs: number): string;
|
|
7
|
-
export declare function formatCountForCopy(count: number | null): string;
|
|
8
|
-
export declare function formatBytesForCopy(bytes: number): string;
|
|
6
|
+
export declare function formatRelativeAge(fromUnixMs: number, nowUnixMs: number, translator?: Translator): string;
|
|
7
|
+
export declare function formatDurationForCopy(durationMs: number, translator?: Translator): string;
|
|
8
|
+
export declare function formatCountForCopy(count: number | null, translator?: Translator): string;
|
|
9
|
+
export declare function formatBytesForCopy(bytes: number, translator?: Translator): string;
|
|
9
10
|
export declare function parseHealthTimestamp(value: string | null): number | null;
|
|
10
11
|
export declare function parseRecordingHealthStatus(raw: unknown): RecordingHealthStatus | null;
|
|
11
12
|
export declare function getTopRefusal(refusals: Array<SessionReplayRefusalCount> | null): SessionReplayRefusalCount | null;
|
|
12
|
-
export declare function describeRefusalReason(reason: string): string | null;
|
|
13
|
-
export declare function diagnoseRecordingHealth(status: RecordingHealthStatus | null, nowUnixMs: number): RecordingHealthDiagnosis;
|
|
13
|
+
export declare function describeRefusalReason(reason: string, translator?: Translator): string | null;
|
|
14
|
+
export declare function diagnoseRecordingHealth(status: RecordingHealthStatus | null, nowUnixMs: number, translator?: Translator): RecordingHealthDiagnosis;
|