@oneuptime/common 14.1.0 → 14.2.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/Alert.d.mts +1 -0
- package/Models/DatabaseModels/Alert.d.ts +1 -0
- package/Models/DatabaseModels/Alert.js +34 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/Models/DatabaseModels/Incident.d.mts +1 -0
- package/Models/DatabaseModels/Incident.d.ts +1 -0
- package/Models/DatabaseModels/Incident.js +35 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
- package/Types/AI/AIActionWords.d.mts +3 -1
- package/Types/AI/AIActionWords.d.ts +3 -1
- package/Types/AI/AIActionWords.js +70 -1
- package/Types/AI/AIActionWords.mjs +2 -0
- package/Types/AI/AIChatTypes.d.mts +2 -1
- package/Types/AI/AIChatTypes.d.ts +2 -1
- package/Types/AI/AIReadTableWords.d.mts +192 -0
- package/Types/AI/AIReadTableWords.d.ts +192 -0
- package/Types/AI/AIReadTableWords.js +368 -0
- package/Types/AI/AIReadTableWords.mjs +18 -0
- package/Types/AI/AiRunRefusal.d.mts +3 -0
- package/Types/AI/AiRunRefusal.d.ts +3 -0
- package/Types/AI/AiRunRefusal.js +22 -1
- package/Types/AI/ResourceAiAccessPermissions.js +7 -18
- package/Types/AuditLog/AuditLogActionLabel.js +19 -9
- package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
- package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
- package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
- package/Types/Cloud/CloudResourceHealth.js +405 -13
- package/Types/Cloud/CloudResourceHealth.mjs +28 -0
- package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
- package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
- package/Types/DataObservability/DataCheckRefusals.js +77 -0
- package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
- package/Types/Date.d.mts +2 -0
- package/Types/Date.d.ts +2 -0
- package/Types/Date.js +22 -0
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +8 -5
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Exception/EgressGuardException.js +1 -1
- package/Types/Exception/ErrorMessageRule.d.mts +1 -0
- package/Types/Exception/ErrorMessageRule.d.ts +1 -0
- package/Types/Exception/ErrorMessageRule.js +67 -13
- package/Types/Exception/ErrorMessageRule.mjs +1 -0
- package/Types/Exception/ExceptionMessages.d.mts +2 -0
- package/Types/Exception/ExceptionMessages.d.ts +2 -0
- package/Types/Exception/ExceptionMessages.js +2 -0
- package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.js +74 -0
- package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
- package/Types/JSONFunctions.js +10 -3
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/MeaningKeys.d.mts +4 -0
- package/Types/MeaningKeys.d.ts +4 -0
- package/Types/MeaningKeys.js +74 -0
- package/Types/MeaningKeys.mjs +5 -0
- package/Types/Monitor/WhoIsTold.d.mts +3 -0
- package/Types/Monitor/WhoIsTold.d.ts +3 -0
- package/Types/Monitor/WhoIsTold.js +63 -13
- package/Types/NoBreakSpaces.d.mts +16 -0
- package/Types/NoBreakSpaces.d.ts +16 -0
- package/Types/NoBreakSpaces.js +419 -0
- package/Types/NoBreakSpaces.mjs +9 -0
- package/Types/NotificationRule/PagingLadder.d.mts +12 -0
- package/Types/NotificationRule/PagingLadder.d.ts +12 -0
- package/Types/NotificationRule/PagingLadder.js +159 -11
- package/Types/NotificationRule/PagingLadder.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OpenStack/OpenStackCapacity.js +12 -5
- package/Types/Permission.d.mts +4 -0
- package/Types/Permission.d.ts +4 -0
- package/Types/Permission.js +64 -8
- package/Types/Product/ProductUsage.js +2 -1
- package/Types/Product/ProjectProductsAnswer.js +2 -1
- package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.js +12 -0
- package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
- package/Types/Rum/ProductAnalyticsEvents.js +13 -1
- package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.js +12 -0
- package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
- package/Types/SetupHealth/SetupHealth.d.mts +1 -0
- package/Types/SetupHealth/SetupHealth.d.ts +1 -0
- package/Types/SetupHealth/SetupHealth.js +13 -5
- package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
- package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
- package/Types/StatusPage/DefaultStatusNames.js +74 -28
- package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
- package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +100 -19
- package/Types/Translator.mjs +1 -0
- package/Types/UserSession/SessionLength.d.mts +33 -0
- package/Types/UserSession/SessionLength.d.ts +33 -0
- package/Types/UserSession/SessionLength.js +134 -5
- package/Types/UserSession/SessionLength.mjs +5 -0
- package/Types/Workflow/WorkflowStatus.js +21 -10
- package/Utils/AI/InvestigationReport.js +2 -2
- package/Utils/API.d.mts +0 -11
- package/Utils/API.d.ts +0 -11
- package/Utils/API.js +0 -432
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
- package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
- package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
- package/Utils/DefaultRecordNames.d.mts +6 -0
- package/Utils/DefaultRecordNames.d.ts +6 -0
- package/Utils/DefaultRecordNames.js +122 -0
- package/Utils/DefaultRecordNames.mjs +6 -0
- package/Utils/Grok/Grok.js +7 -4
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
- package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
- package/Utils/LookupTable.d.mts +3 -0
- package/Utils/LookupTable.d.ts +3 -0
- package/Utils/LookupTable.js +61 -0
- package/Utils/LookupTable.mjs +3 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
- package/Utils/Markdown/OverLongText.js +296 -2
- package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
- package/Utils/Markdown/SlowMarkdown.js +354 -4
- package/Utils/Markdown/SlowMarkdown.mjs +1 -0
- package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
- package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
- package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
- package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
- package/Utils/Metrics/MetricSeriesScope.js +5 -1
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
- package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.js +58 -0
- package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
- package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
- package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
- package/Utils/Monitor/ProbeFailureReading.js +30 -1
- package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
- package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
- package/Utils/PromQL/PromQLEngine.js +18 -9
- package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
- package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.js +212 -0
- package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
- package/Utils/PromQL/PromQLLabels.js +4 -3
- package/Utils/PromQL/PromQLMetricNames.js +8 -2
- package/Utils/PromQL/PromQLParser.js +11 -6
- package/Utils/PromQL/PromQLRegex.d.mts +11 -0
- package/Utils/PromQL/PromQLRegex.d.ts +11 -0
- package/Utils/PromQL/PromQLRegex.js +990 -50
- package/Utils/PromQL/PromQLRegex.mjs +3 -0
- package/Utils/PromQL/PrometheusResponse.js +3 -1
- package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
- package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
- package/Utils/PromQL/RE2CharacterClass.js +532 -0
- package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
- package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
- package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
- package/Utils/RequestFailedDetailsUtil.js +452 -0
- package/Utils/RequestFailedDetailsUtil.mjs +2 -0
- package/Utils/Rum/UrlScrubber.d.mts +1 -1
- package/Utils/Rum/UrlScrubber.d.ts +1 -1
- package/Utils/Rum/UrlScrubber.js +10 -4
- package/Utils/Rum/UserFlow.js +22 -4
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
- package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +3 -1
- package/Utils/StateListType.d.mts +11 -0
- package/Utils/StateListType.d.ts +11 -0
- package/Utils/StateListType.js +21 -0
- package/Utils/StateListType.mjs +2 -0
- package/Utils/StateOrder.d.mts +8 -11
- package/Utils/StateOrder.d.ts +8 -11
- package/Utils/StateOrder.js +49 -84
- package/Utils/StateOrder.mjs +2 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
- package/Utils/Syslog/SyslogMessageParser.js +16 -6
- package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
- package/Utils/ValueFormatter.d.mts +1 -0
- package/Utils/ValueFormatter.d.ts +1 -0
- package/Utils/ValueFormatter.js +258 -18
- package/package.json +1 -1
package/Utils/API.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -44,32 +11,10 @@ const Route_1 = __importDefault(require("../Types/API/Route"));
|
|
|
44
11
|
const URL_1 = __importDefault(require("../Types/API/URL"));
|
|
45
12
|
const ApiException_1 = __importDefault(require("../Types/Exception/ApiException"));
|
|
46
13
|
const BadDataException_1 = __importDefault(require("../Types/Exception/BadDataException"));
|
|
47
|
-
const EgressGuardException_1 = __importStar(require("../Types/Exception/EgressGuardException"));
|
|
48
|
-
const RequestFailedDetails_1 = require("../Types/Probe/RequestFailedDetails");
|
|
49
14
|
const axios_1 = __importDefault(require("axios"));
|
|
50
15
|
const Sleep_1 = __importDefault(require("../Types/Sleep"));
|
|
51
16
|
const HTTPResponseBodyReader_1 = __importDefault(require("./HTTPResponseBodyReader"));
|
|
52
|
-
const HostAddressUtil_1 = __importDefault(require("./HostAddressUtil"));
|
|
53
17
|
const SameServerRedirect_1 = require("./SameServerRedirect");
|
|
54
|
-
const ProbeNetworkFailureUtil_1 = __importStar(require("./ProbeNetworkFailureUtil"));
|
|
55
|
-
// What a probe-side failure calls the target when the error has no request URL.
|
|
56
|
-
const UNKNOWN_REQUEST_HOST = "the server";
|
|
57
|
-
// How far down an error's `cause` / `errors` the connect addresses are read.
|
|
58
|
-
const MAX_CONNECT_ADDRESS_DEPTH = 5;
|
|
59
|
-
/*
|
|
60
|
-
* The code a probe-side failure is reported under. Taken from the
|
|
61
|
-
* classification rather than the thrown error because fetch's TypeError and
|
|
62
|
-
* the API monitor's APIException have no usable code of their own, and an
|
|
63
|
-
* aggregate carries only its first attempt's. NoRouteToHost never comes out
|
|
64
|
-
* of a TCP connect; it is listed so the map stays total.
|
|
65
|
-
*/
|
|
66
|
-
const PROBE_NETWORK_FAILURE_ERROR_CODES = {
|
|
67
|
-
[ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NoSourceAddress]: "EADDRNOTAVAIL",
|
|
68
|
-
[ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.AddressFamilyNotSupported]: "EAFNOSUPPORT",
|
|
69
|
-
[ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NetworkUnreachable]: "ENETUNREACH",
|
|
70
|
-
[ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NoRouteToHost]: "EHOSTUNREACH",
|
|
71
|
-
};
|
|
72
|
-
const NETWORK_UNREACHABLE_DESCRIPTION = "Network unreachable. There is no route to the network where the server resides. This is typically a routing or connectivity issue.";
|
|
73
18
|
class API {
|
|
74
19
|
static setOutgoingRequestTracer(tracer) {
|
|
75
20
|
API.outgoingRequestTracer = tracer;
|
|
@@ -710,383 +655,6 @@ class API {
|
|
|
710
655
|
}
|
|
711
656
|
return errorString;
|
|
712
657
|
}
|
|
713
|
-
/**
|
|
714
|
-
* Extracts detailed error information from an axios error or generic error.
|
|
715
|
-
* This provides more context about where and why a request failed.
|
|
716
|
-
*/
|
|
717
|
-
static getRequestFailedDetails(error) {
|
|
718
|
-
const axiosError = axios_1.default.isAxiosError(error)
|
|
719
|
-
? error
|
|
720
|
-
: null;
|
|
721
|
-
const nativeErrorCode = typeof error === "object" && error !== null && "code" in error
|
|
722
|
-
? error.code
|
|
723
|
-
: undefined;
|
|
724
|
-
const errorCode = typeof nativeErrorCode === "string" ? nativeErrorCode : undefined;
|
|
725
|
-
const rawErrorMessage = (error === null || error === void 0 ? void 0 : error.message) || String(error) || "Unknown error";
|
|
726
|
-
/*
|
|
727
|
-
* The egress guard refuses a target BEFORE any socket is opened, and for
|
|
728
|
-
* tenant-facing callers it sanitizes its message down to one sentence that
|
|
729
|
-
* matches none of the patterns below. Left to the fall-through, every such
|
|
730
|
-
* failure was reported as phase "Unknown" with the sanitized sentence
|
|
731
|
-
* echoed back as its own explanation — which is exactly what a monitor
|
|
732
|
-
* incident showed for a host whose DNS had hiccuped. Classify it here
|
|
733
|
-
* instead, from the exception TYPE rather than from its text.
|
|
734
|
-
*/
|
|
735
|
-
if (error instanceof EgressGuardException_1.default) {
|
|
736
|
-
return {
|
|
737
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TargetResolution,
|
|
738
|
-
errorCode: error.reason === EgressGuardException_1.EgressFailureReason.InvalidTarget
|
|
739
|
-
? "INVALID_TARGET"
|
|
740
|
-
: "TARGET_UNREACHABLE",
|
|
741
|
-
/*
|
|
742
|
-
* One constant description for every unreachable reason. It names all
|
|
743
|
-
* the possibilities without saying which occurred, so it stays useful
|
|
744
|
-
* without telling a tenant on a shared probe whether a hostname
|
|
745
|
-
* resolved — that difference is the enumeration oracle the guard's
|
|
746
|
-
* sanitized message exists to close.
|
|
747
|
-
*/
|
|
748
|
-
errorDescription: error.reason === EgressGuardException_1.EgressFailureReason.InvalidTarget
|
|
749
|
-
? `The monitor's target is not a valid HTTP or HTTPS destination, so no request was attempted. ${rawErrorMessage}`
|
|
750
|
-
: "The probe could not obtain a usable network address for this host, so no connection was attempted and the target was never contacted. Either DNS did not answer, answered with no records, or returned an address this probe is not allowed to dial. Check that the hostname resolves publicly and that its authoritative nameservers are healthy. If this monitor targets an internal host, run it from a self-hosted probe with PROBE_ALLOW_PRIVATE_NETWORK_MONITORS=true.",
|
|
751
|
-
rawErrorMessage,
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
/*
|
|
755
|
-
* The connect failed on the probe, before the request left it. Checked
|
|
756
|
-
* ahead of the string rules below because none of them describe it:
|
|
757
|
-
* EADDRNOTAVAIL matched nothing and fell through to "The request was sent
|
|
758
|
-
* but no response was returned", when nothing was sent at all, and a
|
|
759
|
-
* probe with no IPv6 was told there was no route to the network where the
|
|
760
|
-
* server resides. Still the TCP connection phase, since connect() is what
|
|
761
|
-
* failed. The failure cause the monitor reports alongside this already
|
|
762
|
-
* quotes the OS error (getProbeNetworkFailureDescription), so this only
|
|
763
|
-
* says what it means for the request.
|
|
764
|
-
*/
|
|
765
|
-
const probeSideFailure = API.getProbeSideRequestFailure(error);
|
|
766
|
-
if (probeSideFailure) {
|
|
767
|
-
return {
|
|
768
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
|
|
769
|
-
errorCode: PROBE_NETWORK_FAILURE_ERROR_CODES[probeSideFailure.failure.kind],
|
|
770
|
-
errorDescription: API.getProbeSideFailureDetails(probeSideFailure),
|
|
771
|
-
rawErrorMessage,
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
// Helper to determine the phase and description based on error code/message
|
|
775
|
-
const lowerMessage = rawErrorMessage.toLowerCase();
|
|
776
|
-
// DNS resolution failures
|
|
777
|
-
if (errorCode === "ENOTFOUND" || lowerMessage.includes("enotfound")) {
|
|
778
|
-
return {
|
|
779
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.DNSResolution,
|
|
780
|
-
errorCode: errorCode || "ENOTFOUND",
|
|
781
|
-
errorDescription: "DNS resolution failed. The hostname could not be resolved to an IP address. Please verify the hostname is correct and that DNS is working properly.",
|
|
782
|
-
rawErrorMessage,
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
// Connection refused
|
|
786
|
-
if (errorCode === "ECONNREFUSED" || lowerMessage.includes("econnrefused")) {
|
|
787
|
-
return {
|
|
788
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
|
|
789
|
-
errorCode: errorCode || "ECONNREFUSED",
|
|
790
|
-
errorDescription: "Connection refused. The server actively refused the connection. This usually means no service is listening on the specified port, or a firewall is blocking the connection.",
|
|
791
|
-
rawErrorMessage,
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
// Connection reset
|
|
795
|
-
if (errorCode === "ECONNRESET" ||
|
|
796
|
-
lowerMessage.includes("econnreset") ||
|
|
797
|
-
lowerMessage.includes("connection reset")) {
|
|
798
|
-
return {
|
|
799
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
|
|
800
|
-
errorCode: errorCode || "ECONNRESET",
|
|
801
|
-
errorDescription: "Connection reset. The connection was forcibly closed by the server or a network device. This can happen due to server restarts, load balancer timeouts, or network issues.",
|
|
802
|
-
rawErrorMessage,
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
// Connection aborted
|
|
806
|
-
if (errorCode === "ECONNABORTED" ||
|
|
807
|
-
lowerMessage.includes("econnaborted") ||
|
|
808
|
-
lowerMessage.includes("connection aborted")) {
|
|
809
|
-
return {
|
|
810
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.RequestAborted,
|
|
811
|
-
errorCode: errorCode || "ECONNABORTED",
|
|
812
|
-
errorDescription: "Connection aborted. The request was aborted, possibly due to a timeout or the connection being closed unexpectedly.",
|
|
813
|
-
rawErrorMessage,
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
// Timeout errors
|
|
817
|
-
if (errorCode === "ETIMEDOUT" ||
|
|
818
|
-
errorCode === "ESOCKETTIMEDOUT" ||
|
|
819
|
-
lowerMessage.includes("timeout") ||
|
|
820
|
-
lowerMessage.includes("exceeded")) {
|
|
821
|
-
return {
|
|
822
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.RequestTimeout,
|
|
823
|
-
errorCode: errorCode || "TIMEOUT",
|
|
824
|
-
errorDescription: "Request timed out. The server did not respond within the allowed time. This could be due to network latency, server overload, or the server being unresponsive.",
|
|
825
|
-
rawErrorMessage,
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
// SSL/TLS Certificate errors
|
|
829
|
-
if (errorCode === "CERT_REVOKED" ||
|
|
830
|
-
lowerMessage.includes("certificate has been revoked") ||
|
|
831
|
-
lowerMessage.includes("cert_revoked")) {
|
|
832
|
-
return {
|
|
833
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
|
|
834
|
-
errorCode: "CERT_REVOKED",
|
|
835
|
-
errorDescription: "SSL certificate has been revoked. The certificate's issuer has withdrawn it, so browsers refuse it even though it has not expired. Install a new certificate on the server.",
|
|
836
|
-
rawErrorMessage,
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
if (lowerMessage.includes("certificate has expired") ||
|
|
840
|
-
lowerMessage.includes("cert_has_expired")) {
|
|
841
|
-
return {
|
|
842
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
|
|
843
|
-
errorCode: "CERT_HAS_EXPIRED",
|
|
844
|
-
errorDescription: "SSL certificate has expired. The server's SSL certificate is no longer valid. The certificate needs to be renewed.",
|
|
845
|
-
rawErrorMessage,
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
if (lowerMessage.includes("self-signed certificate") ||
|
|
849
|
-
lowerMessage.includes("self signed certificate") ||
|
|
850
|
-
lowerMessage.includes("depth_zero_self_signed_cert")) {
|
|
851
|
-
return {
|
|
852
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
|
|
853
|
-
errorCode: "SELF_SIGNED_CERT",
|
|
854
|
-
errorDescription: "Self-signed certificate detected. The server is using a self-signed SSL certificate that is not trusted by default. Consider using a certificate from a trusted Certificate Authority.",
|
|
855
|
-
rawErrorMessage,
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
if (lowerMessage.includes("certificate signed by unknown authority") ||
|
|
859
|
-
lowerMessage.includes("unable_to_verify_leaf_signature") ||
|
|
860
|
-
lowerMessage.includes("unable to verify")) {
|
|
861
|
-
return {
|
|
862
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
|
|
863
|
-
errorCode: "CERT_UNKNOWN_AUTHORITY",
|
|
864
|
-
errorDescription: "SSL certificate signed by unknown authority. The certificate chain could not be verified against known Certificate Authorities.",
|
|
865
|
-
rawErrorMessage,
|
|
866
|
-
};
|
|
867
|
-
}
|
|
868
|
-
if (lowerMessage.includes("ssl") ||
|
|
869
|
-
lowerMessage.includes("tls") ||
|
|
870
|
-
lowerMessage.includes("certificate") ||
|
|
871
|
-
lowerMessage.includes("handshake")) {
|
|
872
|
-
return {
|
|
873
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TLSHandshake,
|
|
874
|
-
errorCode: errorCode || "TLS_ERROR",
|
|
875
|
-
errorDescription: "TLS/SSL handshake failed. There was an error establishing a secure connection to the server. This could be due to certificate issues, protocol mismatches, or the server not supporting HTTPS.",
|
|
876
|
-
rawErrorMessage,
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
// Network errors
|
|
880
|
-
if (lowerMessage.includes("network error") || errorCode === "ERR_NETWORK") {
|
|
881
|
-
return {
|
|
882
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.NetworkError,
|
|
883
|
-
errorCode: errorCode || "NETWORK_ERROR",
|
|
884
|
-
errorDescription: "Network error occurred. Unable to reach the server due to network connectivity issues. Please check your network connection and ensure the server is accessible.",
|
|
885
|
-
rawErrorMessage,
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
// Host unreachable
|
|
889
|
-
if (errorCode === "EHOSTUNREACH" ||
|
|
890
|
-
lowerMessage.includes("host unreachable")) {
|
|
891
|
-
return {
|
|
892
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
|
|
893
|
-
errorCode: errorCode || "EHOSTUNREACH",
|
|
894
|
-
errorDescription: "Host unreachable. The network path to the server could not be found. This may be due to routing issues or the host being offline.",
|
|
895
|
-
rawErrorMessage,
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
// Network unreachable
|
|
899
|
-
if (errorCode === "ENETUNREACH" ||
|
|
900
|
-
lowerMessage.includes("network unreachable")) {
|
|
901
|
-
return {
|
|
902
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
|
|
903
|
-
errorCode: errorCode || "ENETUNREACH",
|
|
904
|
-
errorDescription: NETWORK_UNREACHABLE_DESCRIPTION,
|
|
905
|
-
rawErrorMessage,
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
|
-
// Server responded with error status
|
|
909
|
-
if (axiosError === null || axiosError === void 0 ? void 0 : axiosError.response) {
|
|
910
|
-
const status = axiosError.response.status;
|
|
911
|
-
let description = `Server responded with HTTP status ${status}.`;
|
|
912
|
-
if (status >= 500) {
|
|
913
|
-
description += " This indicates a server-side error.";
|
|
914
|
-
}
|
|
915
|
-
else if (status === 404) {
|
|
916
|
-
description += " The requested resource was not found.";
|
|
917
|
-
}
|
|
918
|
-
else if (status === 403) {
|
|
919
|
-
description += " Access to the resource is forbidden.";
|
|
920
|
-
}
|
|
921
|
-
else if (status === 401) {
|
|
922
|
-
description += " Authentication is required or has failed.";
|
|
923
|
-
}
|
|
924
|
-
else if (status === 400) {
|
|
925
|
-
description += " The request was malformed or invalid.";
|
|
926
|
-
}
|
|
927
|
-
else if (status >= 400) {
|
|
928
|
-
description += " This indicates a client-side error.";
|
|
929
|
-
}
|
|
930
|
-
return {
|
|
931
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.ServerResponse,
|
|
932
|
-
errorCode: `HTTP_${status}`,
|
|
933
|
-
errorDescription: description,
|
|
934
|
-
rawErrorMessage,
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
// Request was made but no response received
|
|
938
|
-
if ((axiosError === null || axiosError === void 0 ? void 0 : axiosError.request) && !(axiosError === null || axiosError === void 0 ? void 0 : axiosError.response)) {
|
|
939
|
-
return {
|
|
940
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.NetworkError,
|
|
941
|
-
errorCode: errorCode || "NO_RESPONSE",
|
|
942
|
-
errorDescription: "No response received from the server. The request was sent but no response was returned. This could indicate the server is down, unreachable, or the request timed out.",
|
|
943
|
-
rawErrorMessage,
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
// Default/Unknown error
|
|
947
|
-
return {
|
|
948
|
-
failedPhase: RequestFailedDetails_1.RequestFailedPhase.Unknown,
|
|
949
|
-
errorCode: errorCode,
|
|
950
|
-
errorDescription: `Request failed: ${API.getFriendlyErrorMessage(error)}`,
|
|
951
|
-
rawErrorMessage,
|
|
952
|
-
};
|
|
953
|
-
}
|
|
954
|
-
/*
|
|
955
|
-
* The failure cause for a monitor request that failed on the probe itself,
|
|
956
|
-
* in the shared probe-side wording (which quotes the OS error), or null for
|
|
957
|
-
* any other failure. A probe with no usable IPv6 fails every IPv6 URL with
|
|
958
|
-
* a bare "connect EADDRNOTAVAIL ...", which reads as the customer's site
|
|
959
|
-
* being down while it may be answering perfectly well.
|
|
960
|
-
*
|
|
961
|
-
* ENETUNREACH from a TCP connect can also be a router's "no route" to the
|
|
962
|
-
* destination, so it is only reworded for an IPv6 destination, where the
|
|
963
|
-
* shared wording says "most likely". Otherwise it keeps its message.
|
|
964
|
-
*
|
|
965
|
-
* Separate from getFriendlyErrorMessage on purpose: that one is also used
|
|
966
|
-
* by the dashboard and by the server's own outbound requests, where "this
|
|
967
|
-
* probe" would be false. Only the Website and API monitors call this.
|
|
968
|
-
*/
|
|
969
|
-
static getProbeNetworkFailureDescription(error) {
|
|
970
|
-
const probeSideFailure = API.getProbeSideRequestFailure(error);
|
|
971
|
-
if (!probeSideFailure ||
|
|
972
|
-
(!probeSideFailure.failure.isCertain &&
|
|
973
|
-
!probeSideFailure.isIPv6Destination)) {
|
|
974
|
-
return null;
|
|
975
|
-
}
|
|
976
|
-
return ProbeNetworkFailureUtil_1.default.describe({
|
|
977
|
-
host: probeSideFailure.host,
|
|
978
|
-
failure: probeSideFailure.failure,
|
|
979
|
-
isIPv6Destination: probeSideFailure.isIPv6Destination,
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
/*
|
|
983
|
-
* Classifies a request error as a connect that failed on the probe, with
|
|
984
|
-
* the host to name and whether to word it as IPv6.
|
|
985
|
-
*
|
|
986
|
-
* IPv6 wording needs evidence. It is used when every address the probe
|
|
987
|
-
* tried to connect to was IPv6 or, when the error names no address, when
|
|
988
|
-
* the request URL's host is an IPv6 literal. A dual-stack name whose IPv4
|
|
989
|
-
* attempt failed as well is not an IPv6 problem, and neither is an IPv4
|
|
990
|
-
* proxy the probe could not reach on the way to an IPv6 target.
|
|
991
|
-
*/
|
|
992
|
-
static getProbeSideRequestFailure(error) {
|
|
993
|
-
// The guard refuses before any socket exists; its message is its own.
|
|
994
|
-
if (error instanceof EgressGuardException_1.default) {
|
|
995
|
-
return null;
|
|
996
|
-
}
|
|
997
|
-
/*
|
|
998
|
-
* The API monitor gets the AxiosError wrapped in an APIException (see
|
|
999
|
-
* getErrorResponse). The wrapper's own code is an ExceptionCode number
|
|
1000
|
-
* and its message carries the errno but not the OS text, so the
|
|
1001
|
-
* classifier would find nothing on it.
|
|
1002
|
-
*/
|
|
1003
|
-
const requestError = error instanceof ApiException_1.default && error.error ? error.error : error;
|
|
1004
|
-
const failure = ProbeNetworkFailureUtil_1.default.classifyError({
|
|
1005
|
-
error: requestError,
|
|
1006
|
-
operation: ProbeNetworkFailureUtil_1.ProbeNetworkOperation.TcpConnect,
|
|
1007
|
-
});
|
|
1008
|
-
if (!failure) {
|
|
1009
|
-
return null;
|
|
1010
|
-
}
|
|
1011
|
-
const requestHost = API.getRequestHost(requestError);
|
|
1012
|
-
const connectAddresses = [];
|
|
1013
|
-
API.collectConnectAddresses(requestError, 0, connectAddresses);
|
|
1014
|
-
const isIPv6Destination = connectAddresses.length > 0
|
|
1015
|
-
? connectAddresses.every((address) => {
|
|
1016
|
-
return HostAddressUtil_1.default.isIPv6(address);
|
|
1017
|
-
})
|
|
1018
|
-
: Boolean(requestHost && HostAddressUtil_1.default.isIPv6(requestHost));
|
|
1019
|
-
return {
|
|
1020
|
-
failure: failure,
|
|
1021
|
-
host: requestHost || UNKNOWN_REQUEST_HOST,
|
|
1022
|
-
isIPv6Destination: isIPv6Destination,
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
/*
|
|
1026
|
-
* The "Error Details" text for a probe-side failure. ENETUNREACH that is
|
|
1027
|
-
* not towards IPv6 keeps the family-neutral description it always had.
|
|
1028
|
-
*/
|
|
1029
|
-
static getProbeSideFailureDetails(probeSideFailure) {
|
|
1030
|
-
const failure = probeSideFailure.failure;
|
|
1031
|
-
if (!probeSideFailure.isIPv6Destination) {
|
|
1032
|
-
return failure.isCertain
|
|
1033
|
-
? "The probe could not open the connection from its own side, so the request was never sent and the server was never contacted. The failure is on the probe, not on the server."
|
|
1034
|
-
: NETWORK_UNREACHABLE_DESCRIPTION;
|
|
1035
|
-
}
|
|
1036
|
-
/*
|
|
1037
|
-
* EADDRNOTAVAIL from a TCP connect is also what a probe that has run
|
|
1038
|
-
* out of local ports gets, IPv6 or not, so it is not stated as missing
|
|
1039
|
-
* IPv6.
|
|
1040
|
-
*/
|
|
1041
|
-
if (failure.isCertain && failure.isCauseAmbiguous) {
|
|
1042
|
-
return "The probe could not open the IPv6 connection from its own side, so the request was never sent and the server was never contacted. The failure is on the probe, not on the server.";
|
|
1043
|
-
}
|
|
1044
|
-
if (failure.isCertain) {
|
|
1045
|
-
return "The probe cannot send IPv6 traffic, so the request was never sent and the server was never contacted. The failure is on the probe, not on the server.";
|
|
1046
|
-
}
|
|
1047
|
-
return "There was no IPv6 route to the server. Most likely the probe has no IPv6 route rather than the server being down.";
|
|
1048
|
-
}
|
|
1049
|
-
/*
|
|
1050
|
-
* The host of the URL an axios request was sent to, without IPv6
|
|
1051
|
-
* brackets, or null when the error is not an axios one or has no usable
|
|
1052
|
-
* URL. It is the hop that failed, which after a redirect is not
|
|
1053
|
-
* necessarily the monitor's own URL.
|
|
1054
|
-
*/
|
|
1055
|
-
static getRequestHost(error) {
|
|
1056
|
-
var _a;
|
|
1057
|
-
if (!axios_1.default.isAxiosError(error) || !((_a = error.config) === null || _a === void 0 ? void 0 : _a.url)) {
|
|
1058
|
-
return null;
|
|
1059
|
-
}
|
|
1060
|
-
try {
|
|
1061
|
-
const requestUrl = new globalThis.URL(error.config.url, error.config.baseURL || undefined);
|
|
1062
|
-
return HostAddressUtil_1.default.stripBrackets(requestUrl.hostname) || null;
|
|
1063
|
-
}
|
|
1064
|
-
catch (_b) {
|
|
1065
|
-
return null;
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
/*
|
|
1069
|
-
* Every `address` a socket error in the chain names: the error's own, its
|
|
1070
|
-
* cause's (axios and fetch keep the socket error there) and each attempt
|
|
1071
|
-
* of an aggregate (Node's happy-eyeballs connect, one error per address).
|
|
1072
|
-
*/
|
|
1073
|
-
static collectConnectAddresses(value, depth, addresses) {
|
|
1074
|
-
if (!value ||
|
|
1075
|
-
typeof value !== "object" ||
|
|
1076
|
-
depth > MAX_CONNECT_ADDRESS_DEPTH) {
|
|
1077
|
-
return;
|
|
1078
|
-
}
|
|
1079
|
-
const errorLike = value;
|
|
1080
|
-
if (typeof errorLike.address === "string" && errorLike.address) {
|
|
1081
|
-
addresses.push(HostAddressUtil_1.default.stripBrackets(errorLike.address));
|
|
1082
|
-
}
|
|
1083
|
-
if (Array.isArray(errorLike.errors)) {
|
|
1084
|
-
for (const attempt of errorLike.errors) {
|
|
1085
|
-
API.collectConnectAddresses(attempt, depth + 1, addresses);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
API.collectConnectAddresses(errorLike.cause, depth + 1, addresses);
|
|
1089
|
-
}
|
|
1090
658
|
}
|
|
1091
659
|
/*
|
|
1092
660
|
* Backstop ceiling for a single backoff sleep when the caller names none.
|
|
@@ -292,7 +292,7 @@ class ResourceCommandPolicy {
|
|
|
292
292
|
return `"${name}"`;
|
|
293
293
|
})
|
|
294
294
|
.join(", ");
|
|
295
|
-
return (0, ResourceCommandPolicyCore_1.deniedResult)(argv, `"${program}" is not a program the ${info.agentDisplayName} runs: a command for
|
|
295
|
+
return (0, ResourceCommandPolicyCore_1.deniedResult)(argv, `"${program}" is not a program the ${info.agentDisplayName} runs: a command for this ${info.sentenceName} starts with ${programList}${program.includes("/")
|
|
296
296
|
? " (write the program name without a path)"
|
|
297
297
|
: ""}`);
|
|
298
298
|
}
|
|
@@ -516,7 +516,7 @@ class ResourceCommandPolicy {
|
|
|
516
516
|
return `"${shown}" is denied by the command policy (${result.reason}), so it never runs.`;
|
|
517
517
|
}
|
|
518
518
|
if (data.allowWrites !== true) {
|
|
519
|
-
return `The ${agentName} for this ${info ? info.
|
|
519
|
+
return `The ${agentName} for this ${info ? info.sentenceName : "resource"} is read-only, so it refuses every change, including "${shown}". To let OneUptime AI change it, set ${ResourceAiAccess_1.RESOURCE_AI_ALLOW_WRITES_ENV}=true on the agent and restart it.`;
|
|
520
520
|
}
|
|
521
521
|
const targets = Array.isArray(result.targets)
|
|
522
522
|
? result.targets.filter((target) => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AiRemediationCommand, AiRemediationCommandPlan } from "../../Types/AutoRemediation/AiRemediationCommandPlan.mjs";
|
|
2
|
+
import AutoRemediationSuggestionType from "../../Types/AutoRemediation/AutoRemediationSuggestionType.mjs";
|
|
3
|
+
import AutoRemediationVerificationStatus from "../../Types/AutoRemediation/AutoRemediationVerificationStatus.mjs";
|
|
4
|
+
import { ExternalMcpToolCall, ExternalMcpToolCallPlan } from "../../Types/AutoRemediation/ExternalMcpToolCallPlan.mjs";
|
|
5
|
+
import { RunbookStep } from "../../Types/Runbook/RunbookStep.mjs";
|
|
6
|
+
export declare enum VerifiedFixRunbookRefusal {
|
|
7
|
+
NotVerified = "NotVerified",
|
|
8
|
+
RanARunbook = "RanARunbook",
|
|
9
|
+
NothingRan = "NothingRan",
|
|
10
|
+
AlreadySaved = "AlreadySaved"
|
|
11
|
+
}
|
|
12
|
+
export declare const VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES: Readonly<Record<VerifiedFixRunbookRefusal, string>>;
|
|
13
|
+
export interface VerifiedFixRunbookInput {
|
|
14
|
+
suggestionType: AutoRemediationSuggestionType | null | undefined;
|
|
15
|
+
verificationStatus: AutoRemediationVerificationStatus | null | undefined;
|
|
16
|
+
commandPlan: AiRemediationCommandPlan | null;
|
|
17
|
+
mcpToolCallPlan: ExternalMcpToolCallPlan | null;
|
|
18
|
+
savedAsRunbookId?: string | null | undefined;
|
|
19
|
+
subject: {
|
|
20
|
+
kind: "incident" | "alert";
|
|
21
|
+
handle: string;
|
|
22
|
+
title: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface VerifiedFixRunbookDraft {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
steps: Array<RunbookStep>;
|
|
29
|
+
}
|
|
30
|
+
export declare const MAX_VERIFIED_FIX_STEP_TITLE_LENGTH: number;
|
|
31
|
+
export declare function getSucceededCommands(plan: AiRemediationCommandPlan | null): Array<AiRemediationCommand>;
|
|
32
|
+
export declare function getSucceededMcpCalls(plan: ExternalMcpToolCallPlan | null): Array<ExternalMcpToolCall>;
|
|
33
|
+
export declare function getVerifiedFixRunbookRefusal(input: VerifiedFixRunbookInput): VerifiedFixRunbookRefusal | null;
|
|
34
|
+
export declare function toRunbookSteps(input: {
|
|
35
|
+
commands: Array<AiRemediationCommand>;
|
|
36
|
+
mcpCalls: Array<ExternalMcpToolCall>;
|
|
37
|
+
}): Array<RunbookStep>;
|
|
38
|
+
export declare function buildVerifiedFixRunbook(input: VerifiedFixRunbookInput): VerifiedFixRunbookDraft;
|
|
39
|
+
export declare function getUniqueRunbookName(name: string, takenNames: Array<string>): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AiRemediationCommand, AiRemediationCommandPlan } from "../../Types/AutoRemediation/AiRemediationCommandPlan";
|
|
2
|
+
import AutoRemediationSuggestionType from "../../Types/AutoRemediation/AutoRemediationSuggestionType";
|
|
3
|
+
import AutoRemediationVerificationStatus from "../../Types/AutoRemediation/AutoRemediationVerificationStatus";
|
|
4
|
+
import { ExternalMcpToolCall, ExternalMcpToolCallPlan } from "../../Types/AutoRemediation/ExternalMcpToolCallPlan";
|
|
5
|
+
import { RunbookStep } from "../../Types/Runbook/RunbookStep";
|
|
6
|
+
export declare enum VerifiedFixRunbookRefusal {
|
|
7
|
+
NotVerified = "NotVerified",
|
|
8
|
+
RanARunbook = "RanARunbook",
|
|
9
|
+
NothingRan = "NothingRan",
|
|
10
|
+
AlreadySaved = "AlreadySaved"
|
|
11
|
+
}
|
|
12
|
+
export declare const VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES: Readonly<Record<VerifiedFixRunbookRefusal, string>>;
|
|
13
|
+
export interface VerifiedFixRunbookInput {
|
|
14
|
+
suggestionType: AutoRemediationSuggestionType | null | undefined;
|
|
15
|
+
verificationStatus: AutoRemediationVerificationStatus | null | undefined;
|
|
16
|
+
commandPlan: AiRemediationCommandPlan | null;
|
|
17
|
+
mcpToolCallPlan: ExternalMcpToolCallPlan | null;
|
|
18
|
+
savedAsRunbookId?: string | null | undefined;
|
|
19
|
+
subject: {
|
|
20
|
+
kind: "incident" | "alert";
|
|
21
|
+
handle: string;
|
|
22
|
+
title: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface VerifiedFixRunbookDraft {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
steps: Array<RunbookStep>;
|
|
29
|
+
}
|
|
30
|
+
export declare const MAX_VERIFIED_FIX_STEP_TITLE_LENGTH: number;
|
|
31
|
+
export declare function getSucceededCommands(plan: AiRemediationCommandPlan | null): Array<AiRemediationCommand>;
|
|
32
|
+
export declare function getSucceededMcpCalls(plan: ExternalMcpToolCallPlan | null): Array<ExternalMcpToolCall>;
|
|
33
|
+
export declare function getVerifiedFixRunbookRefusal(input: VerifiedFixRunbookInput): VerifiedFixRunbookRefusal | null;
|
|
34
|
+
export declare function toRunbookSteps(input: {
|
|
35
|
+
commands: Array<AiRemediationCommand>;
|
|
36
|
+
mcpCalls: Array<ExternalMcpToolCall>;
|
|
37
|
+
}): Array<RunbookStep>;
|
|
38
|
+
export declare function buildVerifiedFixRunbook(input: VerifiedFixRunbookInput): VerifiedFixRunbookDraft;
|
|
39
|
+
export declare function getUniqueRunbookName(name: string, takenNames: Array<string>): string;
|