@oneuptime/common 14.0.95 → 14.0.97
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/NetworkFlow.d.mts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.d.ts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.js +50 -0
- package/Models/DatabaseModels/Alert.d.mts +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +63 -0
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
- package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
- package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
- package/Models/DatabaseModels/DetectionRuleException.js +412 -0
- package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
- package/Models/DatabaseModels/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +63 -0
- package/Models/DatabaseModels/Index.js +12 -0
- package/Models/DatabaseModels/NetworkAddressName.d.mts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.d.ts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.js +300 -0
- package/Models/DatabaseModels/NetworkAddressName.mjs +2 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +38 -0
- package/Models/DatabaseModels/SecurityCase.d.mts +8 -0
- package/Models/DatabaseModels/SecurityCase.d.ts +8 -0
- package/Models/DatabaseModels/SecurityCase.js +145 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.mts +28 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.ts +28 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.js +489 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.mjs +2 -0
- package/Models/DatabaseModels/SecurityCaseFeed.d.mts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.d.ts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.js +6 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.mts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.ts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.js +44 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.mts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.ts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.js +467 -0
- package/Models/DatabaseModels/SecurityCaseTask.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.mts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.ts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.js +411 -0
- package/Models/DatabaseModels/SecurityWatchlist.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.mts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.ts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.js +321 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.mjs +2 -0
- package/Types/AI/AiAffectedResources.d.mts +2 -1
- package/Types/AI/AiAffectedResources.d.ts +2 -1
- package/Types/AI/AiAffectedResources.js +12 -1
- package/Types/AffectedResources/AffectedResourceSearch.d.mts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.d.ts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.js +224 -0
- package/Types/AffectedResources/AffectedResourceSearch.mjs +11 -0
- package/Types/ArchivableValue/ArchivableValueUsage.d.mts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.d.ts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.js +91 -12
- package/Types/ArchivableValue/ArchivableValueUsage.mjs +1 -0
- package/Types/Color.d.mts +0 -2
- package/Types/Color.d.ts +0 -2
- package/Types/Color.js +0 -14
- package/Types/Database/DatabaseProperty.d.mts +0 -2
- package/Types/Database/DatabaseProperty.d.ts +0 -2
- package/Types/Database/DatabaseProperty.js +0 -3
- package/Types/Database/TableColumn.d.mts +8 -0
- package/Types/Database/TableColumn.d.ts +8 -0
- package/Types/Database/TableColumn.js +69 -23
- package/Types/Database/TableColumn.mjs +1 -0
- package/Types/Date.d.mts +0 -2
- package/Types/Date.d.ts +0 -2
- package/Types/Date.js +0 -23
- package/Types/Domain.d.mts +0 -2
- package/Types/Domain.d.ts +0 -2
- package/Types/Domain.js +0 -14
- package/Types/Email/EmailTemplateType.d.mts +2 -0
- package/Types/Email/EmailTemplateType.d.ts +2 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email.d.mts +0 -2
- package/Types/Email.d.ts +0 -2
- package/Types/Email.js +0 -15
- package/Types/IP/IP.d.mts +0 -2
- package/Types/IP/IP.d.ts +0 -2
- package/Types/IP/IP.js +0 -14
- package/Types/JSONFunctions.js +16 -1
- package/Types/Monitor/CriteriaAlert.d.mts +0 -2
- package/Types/Monitor/CriteriaAlert.d.ts +0 -2
- package/Types/Monitor/CriteriaAlert.js +0 -18
- package/Types/Monitor/CriteriaAlert.mjs +1 -2
- package/Types/Monitor/CriteriaFilter.d.mts +0 -2
- package/Types/Monitor/CriteriaFilter.d.ts +0 -2
- package/Types/Monitor/CriteriaFilter.js +1 -42
- package/Types/Monitor/CriteriaFilter.mjs +0 -1
- package/Types/Monitor/CriteriaIncident.d.mts +0 -2
- package/Types/Monitor/CriteriaIncident.d.ts +0 -2
- package/Types/Monitor/CriteriaIncident.js +0 -23
- package/Types/Monitor/CriteriaIncident.mjs +1 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.mts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.ts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.js +0 -11
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.mjs +1 -2
- package/Types/Monitor/MonitorCriteria.d.mts +0 -2
- package/Types/Monitor/MonitorCriteria.d.ts +0 -2
- package/Types/Monitor/MonitorCriteria.js +0 -21
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.js +0 -54
- package/Types/Monitor/MonitorStep.d.mts +0 -2
- package/Types/Monitor/MonitorStep.d.ts +0 -2
- package/Types/Monitor/MonitorStep.js +0 -80
- package/Types/Monitor/MonitorSteps.d.mts +0 -2
- package/Types/Monitor/MonitorSteps.d.ts +0 -2
- package/Types/Monitor/MonitorSteps.js +0 -31
- package/Types/Monitor/MonitorType.js +5 -4
- package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
- package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
- package/Types/Monitor/TelemetryAlertRule.js +886 -0
- package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
- package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
- package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
- package/Types/Monitor/TelemetryRulePreview.js +190 -0
- package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
- package/Types/Name.d.mts +0 -2
- package/Types/Name.d.ts +0 -2
- package/Types/Name.js +0 -14
- package/Types/NetFlow/NetworkAddressName.d.mts +30 -0
- package/Types/NetFlow/NetworkAddressName.d.ts +30 -0
- package/Types/NetFlow/NetworkAddressName.js +149 -0
- package/Types/NetFlow/NetworkAddressName.mjs +6 -0
- package/Types/NetFlow/NetworkTraffic.d.mts +20 -0
- package/Types/NetFlow/NetworkTraffic.d.ts +20 -0
- package/Types/NetFlow/NetworkTraffic.js +5 -1
- package/Types/NetFlow/NetworkTraffic.mjs +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.mts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.ts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +173 -8
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +3 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +6 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +9 -0
- package/Types/ObjectID.d.mts +0 -1
- package/Types/ObjectID.d.ts +0 -1
- package/Types/ObjectID.js +0 -9
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.js +25 -1
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.mts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.ts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.js +118 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.mjs +9 -0
- package/Types/Permission.d.mts +8 -0
- package/Types/Permission.d.ts +8 -0
- package/Types/Permission.js +87 -3
- package/Types/Phone.d.mts +0 -2
- package/Types/Phone.d.ts +0 -2
- package/Types/Phone.js +0 -14
- package/Types/Port.d.mts +0 -2
- package/Types/Port.d.ts +0 -2
- package/Types/Port.js +0 -14
- package/Types/ProviderLogo/ProviderLogo.d.mts +24 -1
- package/Types/ProviderLogo/ProviderLogo.d.ts +24 -1
- package/Types/ProviderLogo/ProviderLogo.js +47 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.mts +7 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.ts +7 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.js +24 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.mjs +4 -0
- package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
- package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
- package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
- package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
- package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
- package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
- package/Types/SecurityEvent/DetectionRuleException.js +441 -0
- package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
- package/Types/SecurityEvent/SecurityWatchlist.d.mts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.d.ts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.js +648 -0
- package/Types/SecurityEvent/SecurityWatchlist.mjs +51 -0
- package/Types/SecurityEvent/SigmaRule.d.mts +2 -0
- package/Types/SecurityEvent/SigmaRule.d.ts +2 -0
- package/Types/SecurityEvent/SigmaRule.js +5 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.js +591 -0
- package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
- package/Types/Version.d.mts +0 -2
- package/Types/Version.d.ts +0 -2
- package/Types/Version.js +0 -14
- package/Types/Workflow/AffectedResourcesSetting.d.mts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.d.ts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.js +120 -0
- package/Types/Workflow/AffectedResourcesSetting.mjs +8 -0
- package/Types/Workflow/Components/BaseModel.js +15 -3
- package/Types/Workflow/Documentation/DatabaseDocumentation.js +36 -0
- package/Utils/Inventory/AssetFactSource.d.mts +6 -2
- package/Utils/Inventory/AssetFactSource.d.ts +6 -2
- package/Utils/Inventory/AssetFactSource.js +18 -1
- package/Utils/Inventory/AssetFactSource.mjs +1 -0
- package/Utils/Markdown/FeedLead.d.mts +10 -0
- package/Utils/Markdown/FeedLead.d.ts +10 -0
- package/Utils/Markdown/FeedLead.js +198 -0
- package/Utils/Markdown/FeedLead.mjs +8 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +139 -18
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.mts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.ts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.js +232 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.mjs +16 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.mts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.ts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.js +264 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.mjs +3 -0
- package/Utils/Schema/MonitorSchemas.d.mts +9 -0
- package/Utils/Schema/MonitorSchemas.d.ts +9 -0
- package/Utils/Schema/MonitorSchemas.js +291 -0
- package/Utils/Schema/MonitorSchemas.mjs +9 -0
- package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
- package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
- package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
- package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
- package/Utils/Schema/TypeSchemas.d.mts +12 -0
- package/Utils/Schema/TypeSchemas.d.ts +12 -0
- package/Utils/Schema/TypeSchemas.js +176 -0
- package/Utils/Schema/TypeSchemas.mjs +11 -0
- package/Utils/Schema/Zod.js +23 -17
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +34 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +34 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.js +69 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +9 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.mts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.ts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.js +15 -1
- package/Utils/SecurityCase/SecurityCaseTargets.d.mts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.d.ts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.js +482 -0
- package/Utils/SecurityCase/SecurityCaseTargets.mjs +28 -0
- package/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +22 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.mts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.ts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.js +183 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.mjs +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
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.shouldOfferEveryNewEventRules = exports.EVERY_NEW_ALERT_RULE_DESCRIPTION = exports.EVERY_NEW_INCIDENT_RULE_DESCRIPTION = exports.getEveryNewAlertRuleName = exports.getEveryNewIncidentRuleName = exports.RULE_NAME_MAX_LENGTH = exports.readPageForEveryNewIncidentAndAlert = exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = void 0;
|
|
7
|
+
const ColumnLength_1 = __importDefault(require("../Database/ColumnLength"));
|
|
8
|
+
const BadDataException_1 = __importDefault(require("../Exception/BadDataException"));
|
|
9
|
+
/*
|
|
10
|
+
* A NEW PROJECT'S FIRST ON-CALL POLICY PAGES FOR EVERY INCIDENT AND ALERT.
|
|
11
|
+
*
|
|
12
|
+
* An on-call policy pages nobody until something runs it: an on-call rule
|
|
13
|
+
* under Incidents or Alerts > Rules > On-Call Rules, a monitor's criteria, a
|
|
14
|
+
* template, or someone by hand. Someone new followed the Home checklist's
|
|
15
|
+
* "Set up an on-call policy", picked themselves under "Who gets paged
|
|
16
|
+
* first?", saw the step ticked off - and was never paged, because no rule
|
|
17
|
+
* named the policy. Paging it for every incident took a second trip, to a
|
|
18
|
+
* folded Rules section of another product.
|
|
19
|
+
*
|
|
20
|
+
* Create On-Call Policy now offers, while the project has no on-call policy
|
|
21
|
+
* and no on-call rule yet, "Page this policy for every new incident and
|
|
22
|
+
* alert" - on to start with. The choice travels with the create as misc
|
|
23
|
+
* data under PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY, and the server, once
|
|
24
|
+
* the policy exists, adds two on-call rules naming it: one for incidents,
|
|
25
|
+
* one for alerts, each matching everything (OnCallDutyPolicyService.create).
|
|
26
|
+
* They are ordinary rules, listed and changed where every on-call rule is.
|
|
27
|
+
*
|
|
28
|
+
* React-free and server-safe: the server, the dashboard and their tests
|
|
29
|
+
* read it.
|
|
30
|
+
*/
|
|
31
|
+
exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = "pageForEveryNewIncidentAndAlert";
|
|
32
|
+
/**
|
|
33
|
+
* Whether a policy create asks for the two rules, read from its misc data.
|
|
34
|
+
*
|
|
35
|
+
* Only `true` (or the text "true") asks. Nothing sent, null or false asks
|
|
36
|
+
* nothing - an API caller, Terraform or an import gets the policy alone, as
|
|
37
|
+
* before. Anything else is refused rather than read as no: a caller who
|
|
38
|
+
* meant to page the policy must not get one that silently pages nobody.
|
|
39
|
+
*/
|
|
40
|
+
const readPageForEveryNewIncidentAndAlert = (miscDataProps) => {
|
|
41
|
+
if (!miscDataProps ||
|
|
42
|
+
typeof miscDataProps !== "object" ||
|
|
43
|
+
Array.isArray(miscDataProps)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const value = miscDataProps[exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY];
|
|
47
|
+
if (value === undefined || value === null || value === false) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (value === true) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value === "string") {
|
|
54
|
+
const text = value.trim().toLowerCase();
|
|
55
|
+
if (text === "true") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (text === "false" || text === "") {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
throw new BadDataException_1.default(`${exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY} must be true or false.`);
|
|
63
|
+
};
|
|
64
|
+
exports.readPageForEveryNewIncidentAndAlert = readPageForEveryNewIncidentAndAlert;
|
|
65
|
+
// What the two rules are called, and the longest name a rule column holds.
|
|
66
|
+
exports.RULE_NAME_MAX_LENGTH = ColumnLength_1.default.ShortText;
|
|
67
|
+
const ELLIPSIS = "…";
|
|
68
|
+
const WHITESPACE_RUN = /\s+/g;
|
|
69
|
+
/*
|
|
70
|
+
* "Page <policy> for every <what>", cut to fit a rule's name column: the
|
|
71
|
+
* policy's name gives way, ending in "…", so the words around it stay
|
|
72
|
+
* whole. A policy with no name is "the new on-call policy".
|
|
73
|
+
*/
|
|
74
|
+
const getRuleName = (policyName, what) => {
|
|
75
|
+
const prefix = "Page ";
|
|
76
|
+
const suffix = ` for every ${what}`;
|
|
77
|
+
const name = (policyName || "").replace(WHITESPACE_RUN, " ").trim() ||
|
|
78
|
+
"the new on-call policy";
|
|
79
|
+
const room = exports.RULE_NAME_MAX_LENGTH - prefix.length - suffix.length;
|
|
80
|
+
const shown = Array.from(name).length <= room
|
|
81
|
+
? name
|
|
82
|
+
: `${Array.from(name)
|
|
83
|
+
.slice(0, room - ELLIPSIS.length)
|
|
84
|
+
.join("")
|
|
85
|
+
.trimEnd()}${ELLIPSIS}`;
|
|
86
|
+
return `${prefix}${shown}${suffix}`;
|
|
87
|
+
};
|
|
88
|
+
const getEveryNewIncidentRuleName = (policyName) => {
|
|
89
|
+
return getRuleName(policyName, "incident");
|
|
90
|
+
};
|
|
91
|
+
exports.getEveryNewIncidentRuleName = getEveryNewIncidentRuleName;
|
|
92
|
+
const getEveryNewAlertRuleName = (policyName) => {
|
|
93
|
+
return getRuleName(policyName, "alert");
|
|
94
|
+
};
|
|
95
|
+
exports.getEveryNewAlertRuleName = getEveryNewAlertRuleName;
|
|
96
|
+
// Each rule's description: what it does, and where it came from.
|
|
97
|
+
exports.EVERY_NEW_INCIDENT_RULE_DESCRIPTION = "Pages this on-call policy for every new incident. Added when the policy was created.";
|
|
98
|
+
exports.EVERY_NEW_ALERT_RULE_DESCRIPTION = "Pages this on-call policy for every new alert. Added when the policy was created.";
|
|
99
|
+
const shouldOfferEveryNewEventRules = (facts) => {
|
|
100
|
+
return (facts.mayAddRules &&
|
|
101
|
+
facts.policyCount === 0 &&
|
|
102
|
+
facts.incidentRuleCount === 0 &&
|
|
103
|
+
facts.alertRuleCount === 0);
|
|
104
|
+
};
|
|
105
|
+
exports.shouldOfferEveryNewEventRules = shouldOfferEveryNewEventRules;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import commonJsModule from "./EveryNewEventRules.js";
|
|
2
|
+
export const EVERY_NEW_ALERT_RULE_DESCRIPTION = commonJsModule.EVERY_NEW_ALERT_RULE_DESCRIPTION;
|
|
3
|
+
export const EVERY_NEW_INCIDENT_RULE_DESCRIPTION = commonJsModule.EVERY_NEW_INCIDENT_RULE_DESCRIPTION;
|
|
4
|
+
export const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = commonJsModule.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY;
|
|
5
|
+
export const RULE_NAME_MAX_LENGTH = commonJsModule.RULE_NAME_MAX_LENGTH;
|
|
6
|
+
export const getEveryNewAlertRuleName = commonJsModule.getEveryNewAlertRuleName;
|
|
7
|
+
export const getEveryNewIncidentRuleName = commonJsModule.getEveryNewIncidentRuleName;
|
|
8
|
+
export const readPageForEveryNewIncidentAndAlert = commonJsModule.readPageForEveryNewIncidentAndAlert;
|
|
9
|
+
export const shouldOfferEveryNewEventRules = commonJsModule.shouldOfferEveryNewEventRules;
|
|
@@ -2,6 +2,10 @@ export declare const ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE: string;
|
|
|
2
2
|
export declare const ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE: string;
|
|
3
3
|
export declare const LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE: string;
|
|
4
4
|
export declare function isOnCallPolicyRunEverybodyPassedOnMessage(message: string | undefined | null): boolean;
|
|
5
|
+
export declare const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX: string;
|
|
6
|
+
export declare const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE: string;
|
|
7
|
+
export declare const LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE: string;
|
|
8
|
+
export declare function isOnCallPolicyRunNobodyNotifiedMessage(message: string | undefined | null): boolean;
|
|
5
9
|
export declare const ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START: string;
|
|
6
10
|
export declare function getOnCallPolicyRunRecordHandledMessage(recordKind: string): string;
|
|
7
11
|
export declare function getOnCallPolicyRunRecordResolvedMessage(recordKind: string): string;
|
|
@@ -2,6 +2,10 @@ export declare const ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE: string;
|
|
|
2
2
|
export declare const ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE: string;
|
|
3
3
|
export declare const LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE: string;
|
|
4
4
|
export declare function isOnCallPolicyRunEverybodyPassedOnMessage(message: string | undefined | null): boolean;
|
|
5
|
+
export declare const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX: string;
|
|
6
|
+
export declare const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE: string;
|
|
7
|
+
export declare const LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE: string;
|
|
8
|
+
export declare function isOnCallPolicyRunNobodyNotifiedMessage(message: string | undefined | null): boolean;
|
|
5
9
|
export declare const ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START: string;
|
|
6
10
|
export declare function getOnCallPolicyRunRecordHandledMessage(recordKind: string): string;
|
|
7
11
|
export declare function getOnCallPolicyRunRecordResolvedMessage(recordKind: string): string;
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* it from here.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START = exports.LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = exports.ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = exports.ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE = void 0;
|
|
15
|
+
exports.ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START = exports.LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX = exports.LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = exports.ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = exports.ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE = void 0;
|
|
16
16
|
exports.isOnCallPolicyRunEverybodyPassedOnMessage = isOnCallPolicyRunEverybodyPassedOnMessage;
|
|
17
|
+
exports.isOnCallPolicyRunNobodyNotifiedMessage = isOnCallPolicyRunNobodyNotifiedMessage;
|
|
17
18
|
exports.getOnCallPolicyRunRecordHandledMessage = getOnCallPolicyRunRecordHandledMessage;
|
|
18
19
|
exports.getOnCallPolicyRunRecordResolvedMessage = getOnCallPolicyRunRecordResolvedMessage;
|
|
19
20
|
// A run that went through every escalation rule, and every repeat.
|
|
@@ -36,6 +37,29 @@ function isOnCallPolicyRunEverybodyPassedOnMessage(message) {
|
|
|
36
37
|
return (trimmed === exports.ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE ||
|
|
37
38
|
trimmed === exports.LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE);
|
|
38
39
|
}
|
|
40
|
+
/*
|
|
41
|
+
* A RUN THAT PAGED NOBODY AT ALL: no escalation rule of its policy had
|
|
42
|
+
* anybody it could page - no responders, empty teams, nobody on call,
|
|
43
|
+
* everybody away, gone or unreachable. Such a run stops as soon as it has
|
|
44
|
+
* gone through its rules, since every rule that pages nobody is passed at
|
|
45
|
+
* once (OnCallEmptyLevel), and it ends as "Completed - No One Notified".
|
|
46
|
+
*
|
|
47
|
+
* Its message says who can put it right: the people who look after the
|
|
48
|
+
* policy - its owners, who are also the ones emailed about a page that
|
|
49
|
+
* could not be delivered. The record's feed says the second sentence alone
|
|
50
|
+
* after its own (OnCallFeedText): "went through every escalation rule and
|
|
51
|
+
* paged nobody" is the first.
|
|
52
|
+
*/
|
|
53
|
+
exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX = "This policy's owners should add responders to its escalation rules, or check who is on call in its schedules.";
|
|
54
|
+
exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = `Execution completed, but no one was notified: no escalation rule of this policy had anybody to page. ${exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX}`;
|
|
55
|
+
// The same ending as runs wrote it before it said who can put it right.
|
|
56
|
+
exports.LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = "Execution completed, but no one was notified. Every escalation rule in this policy reached no one - usually because the on-call schedules it targets had nobody on call.";
|
|
57
|
+
// Whether a run ended having paged nobody at all - in either words.
|
|
58
|
+
function isOnCallPolicyRunNobodyNotifiedMessage(message) {
|
|
59
|
+
const trimmed = (message || "").trim();
|
|
60
|
+
return (trimmed === exports.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE ||
|
|
61
|
+
trimmed === exports.LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE);
|
|
62
|
+
}
|
|
39
63
|
// How the message of a run that stopped because its record was handled starts.
|
|
40
64
|
exports.ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START = "Execution completed because ";
|
|
41
65
|
// "Execution completed because incident is acknowledged or resolved."
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import commonJsModule from "./OnCallDutyPolicyRunEnding.js";
|
|
2
2
|
export const LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = commonJsModule.LEGACY_ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE;
|
|
3
|
+
export const LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = commonJsModule.LEGACY_ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE;
|
|
3
4
|
export const ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE = commonJsModule.ON_CALL_POLICY_RUN_EVERYBODY_PASSED_ON_MESSAGE;
|
|
5
|
+
export const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX = commonJsModule.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_FIX;
|
|
6
|
+
export const ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE = commonJsModule.ON_CALL_POLICY_RUN_NOBODY_NOTIFIED_MESSAGE;
|
|
4
7
|
export const ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START = commonJsModule.ON_CALL_POLICY_RUN_RECORD_HANDLED_MESSAGE_START;
|
|
5
8
|
export const ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE = commonJsModule.ON_CALL_POLICY_RUN_WENT_THROUGH_EVERY_RULE_MESSAGE;
|
|
6
9
|
export const getOnCallPolicyRunRecordHandledMessage = commonJsModule.getOnCallPolicyRunRecordHandledMessage;
|
|
7
10
|
export const getOnCallPolicyRunRecordResolvedMessage = commonJsModule.getOnCallPolicyRunRecordResolvedMessage;
|
|
8
11
|
export const isOnCallPolicyRunEverybodyPassedOnMessage = commonJsModule.isOnCallPolicyRunEverybodyPassedOnMessage;
|
|
12
|
+
export const isOnCallPolicyRunNobodyNotifiedMessage = commonJsModule.isOnCallPolicyRunNobodyNotifiedMessage;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import OnCallDutyExecutionLogTimelineStatus from "./OnCalDutyExecutionLogTimelineStatus.mjs";
|
|
2
|
+
export declare const ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE: string;
|
|
3
|
+
export declare const ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE: string;
|
|
4
|
+
export declare const LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE: string;
|
|
5
|
+
export declare enum OnCallEmptyLevelLine {
|
|
6
|
+
NoResponders = "NoResponders",
|
|
7
|
+
PagedNobody = "PagedNobody",
|
|
8
|
+
Legacy = "Legacy"
|
|
9
|
+
}
|
|
10
|
+
export declare function readOnCallEmptyLevelLine(statusMessage: string | undefined | null): OnCallEmptyLevelLine | null;
|
|
11
|
+
export declare function isOnCallEmptyLevelMovedOnAtOnce(statusMessage: string | undefined | null): boolean;
|
|
12
|
+
export declare function getOnCallEmptyLevelTimelineMessage(data: {
|
|
13
|
+
namesAnybody: boolean;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function isOnCallPageLineReached(status: OnCallDutyExecutionLogTimelineStatus | string | undefined | null): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import OnCallDutyExecutionLogTimelineStatus from "./OnCalDutyExecutionLogTimelineStatus";
|
|
2
|
+
export declare const ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE: string;
|
|
3
|
+
export declare const ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE: string;
|
|
4
|
+
export declare const LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE: string;
|
|
5
|
+
export declare enum OnCallEmptyLevelLine {
|
|
6
|
+
NoResponders = "NoResponders",
|
|
7
|
+
PagedNobody = "PagedNobody",
|
|
8
|
+
Legacy = "Legacy"
|
|
9
|
+
}
|
|
10
|
+
export declare function readOnCallEmptyLevelLine(statusMessage: string | undefined | null): OnCallEmptyLevelLine | null;
|
|
11
|
+
export declare function isOnCallEmptyLevelMovedOnAtOnce(statusMessage: string | undefined | null): boolean;
|
|
12
|
+
export declare function getOnCallEmptyLevelTimelineMessage(data: {
|
|
13
|
+
namesAnybody: boolean;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function isOnCallPageLineReached(status: OnCallDutyExecutionLogTimelineStatus | string | undefined | null): boolean;
|
|
@@ -0,0 +1,118 @@
|
|
|
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.OnCallEmptyLevelLine = exports.LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE = exports.ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE = exports.ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE = void 0;
|
|
7
|
+
exports.readOnCallEmptyLevelLine = readOnCallEmptyLevelLine;
|
|
8
|
+
exports.isOnCallEmptyLevelMovedOnAtOnce = isOnCallEmptyLevelMovedOnAtOnce;
|
|
9
|
+
exports.getOnCallEmptyLevelTimelineMessage = getOnCallEmptyLevelTimelineMessage;
|
|
10
|
+
exports.isOnCallPageLineReached = isOnCallPageLineReached;
|
|
11
|
+
const OnCalDutyExecutionLogTimelineStatus_1 = __importDefault(require("./OnCalDutyExecutionLogTimelineStatus"));
|
|
12
|
+
/*
|
|
13
|
+
* A LEVEL WITH NOBODY TO PAGE DOES NOT HOLD THE PAGE UP.
|
|
14
|
+
*
|
|
15
|
+
* An escalation rule - a level of an on-call policy - waits its "Escalate
|
|
16
|
+
* after" for the people it paged to acknowledge, then the next level is
|
|
17
|
+
* paged. A level that pages nobody has nobody to wait for: waiting out its
|
|
18
|
+
* wait would only keep the next level from hearing of the incident or alert.
|
|
19
|
+
* So a run moves on from such a level at once - to the next level, to the
|
|
20
|
+
* policy's first level again when it repeats, or to its end - in the one
|
|
21
|
+
* way a run moves on (OnCallEscalationAdvance).
|
|
22
|
+
*
|
|
23
|
+
* A level pages nobody when, at the moment it is reached:
|
|
24
|
+
*
|
|
25
|
+
* - it names nobody: no person, team or on-call schedule;
|
|
26
|
+
* - its teams have no members;
|
|
27
|
+
* - nobody is on call in its schedules - a gap between layers, an override
|
|
28
|
+
* that leaves nobody - or nobody is next in a rotation whose next person
|
|
29
|
+
* it pages;
|
|
30
|
+
* - everybody it names is away with nobody named to cover, has left the
|
|
31
|
+
* project, or has escalated this run's page already;
|
|
32
|
+
* - nobody it named can be reached at all: each one's page was skipped or
|
|
33
|
+
* failed as it went out - they opted out of this severity, or have no
|
|
34
|
+
* notification rule for it and no verified method to fall back on.
|
|
35
|
+
*
|
|
36
|
+
* The last is a choice, and this is why: a level's wait is the time its
|
|
37
|
+
* people get to acknowledge, and somebody whose page never went out can
|
|
38
|
+
* neither see it nor acknowledge it. Whether a page went out is known when
|
|
39
|
+
* it is sent - each person's notification log is written then, and says
|
|
40
|
+
* "skipped" or "error" at once for a page that cannot go anywhere - so the
|
|
41
|
+
* level is counted as empty only on what is certain. A page that is on its
|
|
42
|
+
* way, or that a person's own rules send a few minutes later, counts as
|
|
43
|
+
* reaching them, and the level waits as it always has.
|
|
44
|
+
*
|
|
45
|
+
* A level that pages nobody writes one line of its own on the run's timeline
|
|
46
|
+
* (after a line for each person, team or schedule it found nobody in), in
|
|
47
|
+
* the words below: the Execution Timeline, the record's feed and the run's
|
|
48
|
+
* Slack and Microsoft Teams message read it back to say that the policy
|
|
49
|
+
* moved on at once, and why.
|
|
50
|
+
*
|
|
51
|
+
* React-free and server-safe: the server, the dashboard and their tests read
|
|
52
|
+
* it.
|
|
53
|
+
*/
|
|
54
|
+
// The level's line, when the level names nobody at all.
|
|
55
|
+
exports.ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE = "This level has no responders, so the policy moved on at once.";
|
|
56
|
+
/*
|
|
57
|
+
* The level's line, when it names somebody but paged nobody: each person,
|
|
58
|
+
* team or schedule has a line of its own before it, saying why.
|
|
59
|
+
*/
|
|
60
|
+
exports.ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE = "Nobody at this level could be paged, so the policy moved on at once.";
|
|
61
|
+
/*
|
|
62
|
+
* The line runs wrote before a level with nobody to page was passed at once:
|
|
63
|
+
* those runs waited out the level's wait. Kept so their lines read as what
|
|
64
|
+
* they were.
|
|
65
|
+
*/
|
|
66
|
+
exports.LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE = "Skipped because no users in this rule.";
|
|
67
|
+
// Which of the lines above a timeline line is.
|
|
68
|
+
var OnCallEmptyLevelLine;
|
|
69
|
+
(function (OnCallEmptyLevelLine) {
|
|
70
|
+
// The level names nobody; the run moved on at once.
|
|
71
|
+
OnCallEmptyLevelLine["NoResponders"] = "NoResponders";
|
|
72
|
+
// The level named somebody and paged nobody; the run moved on at once.
|
|
73
|
+
OnCallEmptyLevelLine["PagedNobody"] = "PagedNobody";
|
|
74
|
+
// Written before levels were passed at once: the run waited out the level.
|
|
75
|
+
OnCallEmptyLevelLine["Legacy"] = "Legacy";
|
|
76
|
+
})(OnCallEmptyLevelLine || (exports.OnCallEmptyLevelLine = OnCallEmptyLevelLine = {}));
|
|
77
|
+
/*
|
|
78
|
+
* Which level line a timeline line's status message is, or null for any
|
|
79
|
+
* other line. Compared as written, spaces trimmed.
|
|
80
|
+
*/
|
|
81
|
+
function readOnCallEmptyLevelLine(statusMessage) {
|
|
82
|
+
const message = (statusMessage || "").trim();
|
|
83
|
+
if (message === exports.ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE) {
|
|
84
|
+
return OnCallEmptyLevelLine.NoResponders;
|
|
85
|
+
}
|
|
86
|
+
if (message === exports.ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE) {
|
|
87
|
+
return OnCallEmptyLevelLine.PagedNobody;
|
|
88
|
+
}
|
|
89
|
+
if (message === exports.LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE) {
|
|
90
|
+
return OnCallEmptyLevelLine.Legacy;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
/*
|
|
95
|
+
* Whether a timeline line says its level paged nobody and the run moved on
|
|
96
|
+
* from it at once: not a legacy line, whose run waited.
|
|
97
|
+
*/
|
|
98
|
+
function isOnCallEmptyLevelMovedOnAtOnce(statusMessage) {
|
|
99
|
+
const line = readOnCallEmptyLevelLine(statusMessage);
|
|
100
|
+
return (line === OnCallEmptyLevelLine.NoResponders ||
|
|
101
|
+
line === OnCallEmptyLevelLine.PagedNobody);
|
|
102
|
+
}
|
|
103
|
+
// The line a level that paged nobody writes: whether it names anybody at all.
|
|
104
|
+
function getOnCallEmptyLevelTimelineMessage(data) {
|
|
105
|
+
return data.namesAnybody
|
|
106
|
+
? exports.ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE
|
|
107
|
+
: exports.ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE;
|
|
108
|
+
}
|
|
109
|
+
/*
|
|
110
|
+
* Whether a person's line on a run's timeline says their page went out - is
|
|
111
|
+
* being sent, was sent, was acknowledged or was escalated - rather than
|
|
112
|
+
* skipped or failed. A line whose status is not known counts as reaching
|
|
113
|
+
* them: a level is only counted as empty on what is certain.
|
|
114
|
+
*/
|
|
115
|
+
function isOnCallPageLineReached(status) {
|
|
116
|
+
return (status !== OnCalDutyExecutionLogTimelineStatus_1.default.Skipped &&
|
|
117
|
+
status !== OnCalDutyExecutionLogTimelineStatus_1.default.Error);
|
|
118
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import commonJsModule from "./OnCallEmptyLevel.js";
|
|
2
|
+
export const LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE = commonJsModule.LEGACY_ON_CALL_LEVEL_NO_USERS_TIMELINE_MESSAGE;
|
|
3
|
+
export const ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE = commonJsModule.ON_CALL_LEVEL_HAS_NO_RESPONDERS_TIMELINE_MESSAGE;
|
|
4
|
+
export const ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE = commonJsModule.ON_CALL_LEVEL_PAGED_NOBODY_TIMELINE_MESSAGE;
|
|
5
|
+
export const OnCallEmptyLevelLine = commonJsModule.OnCallEmptyLevelLine;
|
|
6
|
+
export const getOnCallEmptyLevelTimelineMessage = commonJsModule.getOnCallEmptyLevelTimelineMessage;
|
|
7
|
+
export const isOnCallEmptyLevelMovedOnAtOnce = commonJsModule.isOnCallEmptyLevelMovedOnAtOnce;
|
|
8
|
+
export const isOnCallPageLineReached = commonJsModule.isOnCallPageLineReached;
|
|
9
|
+
export const readOnCallEmptyLevelLine = commonJsModule.readOnCallEmptyLevelLine;
|
package/Types/Permission.d.mts
CHANGED
|
@@ -136,6 +136,14 @@ declare enum Permission {
|
|
|
136
136
|
EditSecurityCaseNote = "EditSecurityCaseNote",
|
|
137
137
|
ReadSecurityCaseNote = "ReadSecurityCaseNote",
|
|
138
138
|
ReadSecurityCaseFeed = "ReadSecurityCaseFeed",
|
|
139
|
+
CreateSecurityCaseTask = "CreateSecurityCaseTask",
|
|
140
|
+
DeleteSecurityCaseTask = "DeleteSecurityCaseTask",
|
|
141
|
+
EditSecurityCaseTask = "EditSecurityCaseTask",
|
|
142
|
+
ReadSecurityCaseTask = "ReadSecurityCaseTask",
|
|
143
|
+
CreateSecurityCaseEvidence = "CreateSecurityCaseEvidence",
|
|
144
|
+
DeleteSecurityCaseEvidence = "DeleteSecurityCaseEvidence",
|
|
145
|
+
EditSecurityCaseEvidence = "EditSecurityCaseEvidence",
|
|
146
|
+
ReadSecurityCaseEvidence = "ReadSecurityCaseEvidence",
|
|
139
147
|
CreateSecurityCaseStatus = "CreateSecurityCaseStatus",
|
|
140
148
|
DeleteSecurityCaseStatus = "DeleteSecurityCaseStatus",
|
|
141
149
|
EditSecurityCaseStatus = "EditSecurityCaseStatus",
|
package/Types/Permission.d.ts
CHANGED
|
@@ -136,6 +136,14 @@ declare enum Permission {
|
|
|
136
136
|
EditSecurityCaseNote = "EditSecurityCaseNote",
|
|
137
137
|
ReadSecurityCaseNote = "ReadSecurityCaseNote",
|
|
138
138
|
ReadSecurityCaseFeed = "ReadSecurityCaseFeed",
|
|
139
|
+
CreateSecurityCaseTask = "CreateSecurityCaseTask",
|
|
140
|
+
DeleteSecurityCaseTask = "DeleteSecurityCaseTask",
|
|
141
|
+
EditSecurityCaseTask = "EditSecurityCaseTask",
|
|
142
|
+
ReadSecurityCaseTask = "ReadSecurityCaseTask",
|
|
143
|
+
CreateSecurityCaseEvidence = "CreateSecurityCaseEvidence",
|
|
144
|
+
DeleteSecurityCaseEvidence = "DeleteSecurityCaseEvidence",
|
|
145
|
+
EditSecurityCaseEvidence = "EditSecurityCaseEvidence",
|
|
146
|
+
ReadSecurityCaseEvidence = "ReadSecurityCaseEvidence",
|
|
139
147
|
CreateSecurityCaseStatus = "CreateSecurityCaseStatus",
|
|
140
148
|
DeleteSecurityCaseStatus = "DeleteSecurityCaseStatus",
|
|
141
149
|
EditSecurityCaseStatus = "EditSecurityCaseStatus",
|
package/Types/Permission.js
CHANGED
|
@@ -196,6 +196,16 @@ var Permission;
|
|
|
196
196
|
Permission["ReadSecurityCaseNote"] = "ReadSecurityCaseNote";
|
|
197
197
|
// Security Case Feed (what happened on a case, written by OneUptime)
|
|
198
198
|
Permission["ReadSecurityCaseFeed"] = "ReadSecurityCaseFeed";
|
|
199
|
+
// Security Case Tasks (what has to be done on a case, and who does it)
|
|
200
|
+
Permission["CreateSecurityCaseTask"] = "CreateSecurityCaseTask";
|
|
201
|
+
Permission["DeleteSecurityCaseTask"] = "DeleteSecurityCaseTask";
|
|
202
|
+
Permission["EditSecurityCaseTask"] = "EditSecurityCaseTask";
|
|
203
|
+
Permission["ReadSecurityCaseTask"] = "ReadSecurityCaseTask";
|
|
204
|
+
// Security Case Evidence (files and links kept on a case)
|
|
205
|
+
Permission["CreateSecurityCaseEvidence"] = "CreateSecurityCaseEvidence";
|
|
206
|
+
Permission["DeleteSecurityCaseEvidence"] = "DeleteSecurityCaseEvidence";
|
|
207
|
+
Permission["EditSecurityCaseEvidence"] = "EditSecurityCaseEvidence";
|
|
208
|
+
Permission["ReadSecurityCaseEvidence"] = "ReadSecurityCaseEvidence";
|
|
199
209
|
// Security Case Statuses (the statuses a project's cases move through)
|
|
200
210
|
Permission["CreateSecurityCaseStatus"] = "CreateSecurityCaseStatus";
|
|
201
211
|
Permission["DeleteSecurityCaseStatus"] = "DeleteSecurityCaseStatus";
|
|
@@ -2246,7 +2256,7 @@ class PermissionHelper {
|
|
|
2246
2256
|
{
|
|
2247
2257
|
permission: Permission.SecurityAdmin,
|
|
2248
2258
|
title: "Security Admin",
|
|
2249
|
-
description: "Full control over security operations: security events, cases with their detections and
|
|
2259
|
+
description: "Full control over security operations: security events, cases with their detections, notes, tasks and evidence, response playbooks and their runs, Sigma detection rules, threat intelligence feeds and their indicators, and security event connections (Google SecOps, Microsoft Sentinel, CrowdStrike Falcon and other sources). Outside the Security roles, only Project Owner and Project Admin read security data.",
|
|
2250
2260
|
isAssignableToTenant: true,
|
|
2251
2261
|
isAccessControlPermission: false,
|
|
2252
2262
|
isRolePermission: true,
|
|
@@ -2255,7 +2265,7 @@ class PermissionHelper {
|
|
|
2255
2265
|
{
|
|
2256
2266
|
permission: Permission.SecurityMember,
|
|
2257
2267
|
title: "Security Member",
|
|
2258
|
-
description: "Reads security events and threat intelligence, sends security events, works security cases (opens, assigns, changes and closes them
|
|
2268
|
+
description: "Reads security events and threat intelligence, sends security events, works security cases (opens, assigns, changes and closes them, writes their notes, works their tasks and adds evidence), runs playbooks and approves their steps, and creates, changes and deletes detection rules and threat intel feeds. Cannot configure playbooks or security event connections, or delete security data.",
|
|
2259
2269
|
isAssignableToTenant: true,
|
|
2260
2270
|
isAccessControlPermission: false,
|
|
2261
2271
|
isRolePermission: true,
|
|
@@ -2264,7 +2274,7 @@ class PermissionHelper {
|
|
|
2264
2274
|
{
|
|
2265
2275
|
permission: Permission.SecurityViewer,
|
|
2266
2276
|
title: "Security Viewer",
|
|
2267
|
-
description: "Read-only access to security events, cases with their detections and
|
|
2277
|
+
description: "Read-only access to security events, cases with their detections, notes, tasks and evidence, playbooks and their runs, detection rules, threat intelligence feeds and indicators, and security event connections.",
|
|
2268
2278
|
isAssignableToTenant: true,
|
|
2269
2279
|
isAccessControlPermission: false,
|
|
2270
2280
|
isRolePermission: true,
|
|
@@ -7205,6 +7215,80 @@ class PermissionHelper {
|
|
|
7205
7215
|
isRolePermission: false,
|
|
7206
7216
|
group: PermissionGroup.Security,
|
|
7207
7217
|
},
|
|
7218
|
+
// Security Case Task Permissions
|
|
7219
|
+
{
|
|
7220
|
+
permission: Permission.CreateSecurityCaseTask,
|
|
7221
|
+
title: "Create Security Case Task",
|
|
7222
|
+
description: "This permission can add tasks to Security Cases of this project.",
|
|
7223
|
+
isAssignableToTenant: true,
|
|
7224
|
+
isAccessControlPermission: false,
|
|
7225
|
+
isRolePermission: false,
|
|
7226
|
+
group: PermissionGroup.Security,
|
|
7227
|
+
},
|
|
7228
|
+
{
|
|
7229
|
+
permission: Permission.DeleteSecurityCaseTask,
|
|
7230
|
+
title: "Delete Security Case Task",
|
|
7231
|
+
description: "This permission can delete tasks of Security Cases of this project.",
|
|
7232
|
+
isAssignableToTenant: true,
|
|
7233
|
+
isAccessControlPermission: false,
|
|
7234
|
+
isRolePermission: false,
|
|
7235
|
+
group: PermissionGroup.Security,
|
|
7236
|
+
},
|
|
7237
|
+
{
|
|
7238
|
+
permission: Permission.EditSecurityCaseTask,
|
|
7239
|
+
title: "Edit Security Case Task",
|
|
7240
|
+
description: "This permission can edit tasks of Security Cases of this project: rename them, assign them and mark them done.",
|
|
7241
|
+
isAssignableToTenant: true,
|
|
7242
|
+
isAccessControlPermission: false,
|
|
7243
|
+
isRolePermission: false,
|
|
7244
|
+
group: PermissionGroup.Security,
|
|
7245
|
+
},
|
|
7246
|
+
{
|
|
7247
|
+
permission: Permission.ReadSecurityCaseTask,
|
|
7248
|
+
title: "Read Security Case Task",
|
|
7249
|
+
description: "This permission can read tasks of Security Cases of this project.",
|
|
7250
|
+
isAssignableToTenant: true,
|
|
7251
|
+
isAccessControlPermission: false,
|
|
7252
|
+
isRolePermission: false,
|
|
7253
|
+
group: PermissionGroup.Security,
|
|
7254
|
+
},
|
|
7255
|
+
// Security Case Evidence Permissions
|
|
7256
|
+
{
|
|
7257
|
+
permission: Permission.CreateSecurityCaseEvidence,
|
|
7258
|
+
title: "Create Security Case Evidence",
|
|
7259
|
+
description: "This permission can add evidence - files and links - to Security Cases of this project.",
|
|
7260
|
+
isAssignableToTenant: true,
|
|
7261
|
+
isAccessControlPermission: false,
|
|
7262
|
+
isRolePermission: false,
|
|
7263
|
+
group: PermissionGroup.Security,
|
|
7264
|
+
},
|
|
7265
|
+
{
|
|
7266
|
+
permission: Permission.DeleteSecurityCaseEvidence,
|
|
7267
|
+
title: "Delete Security Case Evidence",
|
|
7268
|
+
description: "This permission can remove evidence from Security Cases of this project.",
|
|
7269
|
+
isAssignableToTenant: true,
|
|
7270
|
+
isAccessControlPermission: false,
|
|
7271
|
+
isRolePermission: false,
|
|
7272
|
+
group: PermissionGroup.Security,
|
|
7273
|
+
},
|
|
7274
|
+
{
|
|
7275
|
+
permission: Permission.EditSecurityCaseEvidence,
|
|
7276
|
+
title: "Edit Security Case Evidence",
|
|
7277
|
+
description: "This permission can rename the evidence of Security Cases of this project and change its description. What a piece of evidence holds never changes.",
|
|
7278
|
+
isAssignableToTenant: true,
|
|
7279
|
+
isAccessControlPermission: false,
|
|
7280
|
+
isRolePermission: false,
|
|
7281
|
+
group: PermissionGroup.Security,
|
|
7282
|
+
},
|
|
7283
|
+
{
|
|
7284
|
+
permission: Permission.ReadSecurityCaseEvidence,
|
|
7285
|
+
title: "Read Security Case Evidence",
|
|
7286
|
+
description: "This permission can read and download the evidence of Security Cases of this project.",
|
|
7287
|
+
isAssignableToTenant: true,
|
|
7288
|
+
isAccessControlPermission: false,
|
|
7289
|
+
isRolePermission: false,
|
|
7290
|
+
group: PermissionGroup.Security,
|
|
7291
|
+
},
|
|
7208
7292
|
// Security Case Status Permissions
|
|
7209
7293
|
{
|
|
7210
7294
|
permission: Permission.CreateSecurityCaseStatus,
|
package/Types/Phone.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import DatabaseProperty from "./Database/DatabaseProperty.mjs";
|
|
2
2
|
import { JSONObject } from "./JSON.mjs";
|
|
3
3
|
import { FindOperator } from "typeorm";
|
|
4
|
-
import { ZodSchema } from "../Utils/Schema/Zod.mjs";
|
|
5
4
|
export default class Phone extends DatabaseProperty {
|
|
6
5
|
private _phone;
|
|
7
6
|
get phone(): string;
|
|
@@ -18,7 +17,6 @@ export default class Phone extends DatabaseProperty {
|
|
|
18
17
|
static fromJSON(json: JSONObject): Phone;
|
|
19
18
|
protected static toDatabase(value: Phone | FindOperator<Phone>): string | null;
|
|
20
19
|
protected static fromDatabase(_value: string): Phone | null;
|
|
21
|
-
static getSchema(): ZodSchema;
|
|
22
20
|
private static readonly CALLING_CODE_TO_COUNTRY_MAP;
|
|
23
21
|
/**
|
|
24
22
|
* Extract ISO country code from a phone number
|
package/Types/Phone.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import DatabaseProperty from "./Database/DatabaseProperty";
|
|
2
2
|
import { JSONObject } from "./JSON";
|
|
3
3
|
import { FindOperator } from "typeorm";
|
|
4
|
-
import { ZodSchema } from "../Utils/Schema/Zod";
|
|
5
4
|
export default class Phone extends DatabaseProperty {
|
|
6
5
|
private _phone;
|
|
7
6
|
get phone(): string;
|
|
@@ -18,7 +17,6 @@ export default class Phone extends DatabaseProperty {
|
|
|
18
17
|
static fromJSON(json: JSONObject): Phone;
|
|
19
18
|
protected static toDatabase(value: Phone | FindOperator<Phone>): string | null;
|
|
20
19
|
protected static fromDatabase(_value: string): Phone | null;
|
|
21
|
-
static getSchema(): ZodSchema;
|
|
22
20
|
private static readonly CALLING_CODE_TO_COUNTRY_MAP;
|
|
23
21
|
/**
|
|
24
22
|
* Extract ISO country code from a phone number
|
package/Types/Phone.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const DatabaseProperty_1 = __importDefault(require("./Database/DatabaseProperty"));
|
|
7
7
|
const BadDataException_1 = __importDefault(require("./Exception/BadDataException"));
|
|
8
8
|
const JSON_1 = require("./JSON");
|
|
9
|
-
const Zod_1 = __importDefault(require("../Utils/Schema/Zod"));
|
|
10
9
|
const RefusedValue_1 = require("../Utils/RefusedValue");
|
|
11
10
|
class Phone extends DatabaseProperty_1.default {
|
|
12
11
|
get phone() {
|
|
@@ -115,19 +114,6 @@ class Phone extends DatabaseProperty_1.default {
|
|
|
115
114
|
}
|
|
116
115
|
return null;
|
|
117
116
|
}
|
|
118
|
-
static getSchema() {
|
|
119
|
-
return Zod_1.default.object({
|
|
120
|
-
_type: Zod_1.default.literal(JSON_1.ObjectType.Phone),
|
|
121
|
-
value: Zod_1.default.string().openapi({
|
|
122
|
-
type: "string",
|
|
123
|
-
example: "+1-555-123-4567",
|
|
124
|
-
}),
|
|
125
|
-
}).openapi({
|
|
126
|
-
type: "object",
|
|
127
|
-
description: "Phone object",
|
|
128
|
-
example: { _type: JSON_1.ObjectType.Phone, value: "+1-555-123-4567" },
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
117
|
/**
|
|
132
118
|
* Extract ISO country code from a phone number
|
|
133
119
|
* @param phoneNumber - The phone number (e.g., "+15551234567")
|
package/Types/Port.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import DatabaseProperty from "./Database/DatabaseProperty.mjs";
|
|
|
2
2
|
import { JSONObject } from "./JSON.mjs";
|
|
3
3
|
import PositiveNumber from "./PositiveNumber.mjs";
|
|
4
4
|
import { FindOperator } from "typeorm/find-options/FindOperator.js";
|
|
5
|
-
import { ZodSchema } from "../Utils/Schema/Zod.mjs";
|
|
6
5
|
export default class Port extends DatabaseProperty {
|
|
7
6
|
private _port;
|
|
8
7
|
get port(): PositiveNumber;
|
|
@@ -15,5 +14,4 @@ export default class Port extends DatabaseProperty {
|
|
|
15
14
|
static fromDatabase(_value: string | number): Port | null;
|
|
16
15
|
toString(): string;
|
|
17
16
|
toNumber(): number;
|
|
18
|
-
static getSchema(): ZodSchema;
|
|
19
17
|
}
|
package/Types/Port.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import DatabaseProperty from "./Database/DatabaseProperty";
|
|
|
2
2
|
import { JSONObject } from "./JSON";
|
|
3
3
|
import PositiveNumber from "./PositiveNumber";
|
|
4
4
|
import { FindOperator } from "typeorm/find-options/FindOperator";
|
|
5
|
-
import { ZodSchema } from "../Utils/Schema/Zod";
|
|
6
5
|
export default class Port extends DatabaseProperty {
|
|
7
6
|
private _port;
|
|
8
7
|
get port(): PositiveNumber;
|
|
@@ -15,5 +14,4 @@ export default class Port extends DatabaseProperty {
|
|
|
15
14
|
static fromDatabase(_value: string | number): Port | null;
|
|
16
15
|
toString(): string;
|
|
17
16
|
toNumber(): number;
|
|
18
|
-
static getSchema(): ZodSchema;
|
|
19
17
|
}
|
package/Types/Port.js
CHANGED
|
@@ -8,7 +8,6 @@ const BadDataException_1 = __importDefault(require("./Exception/BadDataException
|
|
|
8
8
|
const JSON_1 = require("./JSON");
|
|
9
9
|
const PositiveNumber_1 = __importDefault(require("./PositiveNumber"));
|
|
10
10
|
const Typeof_1 = __importDefault(require("./Typeof"));
|
|
11
|
-
const Zod_1 = __importDefault(require("../Utils/Schema/Zod"));
|
|
12
11
|
class Port extends DatabaseProperty_1.default {
|
|
13
12
|
get port() {
|
|
14
13
|
return this._port;
|
|
@@ -89,18 +88,5 @@ class Port extends DatabaseProperty_1.default {
|
|
|
89
88
|
toNumber() {
|
|
90
89
|
return this.port.toNumber();
|
|
91
90
|
}
|
|
92
|
-
static getSchema() {
|
|
93
|
-
return Zod_1.default.object({
|
|
94
|
-
_type: Zod_1.default.literal(JSON_1.ObjectType.Port),
|
|
95
|
-
value: Zod_1.default.number().int().min(0).max(65535).openapi({
|
|
96
|
-
type: "number",
|
|
97
|
-
example: 8080,
|
|
98
|
-
}),
|
|
99
|
-
}).openapi({
|
|
100
|
-
type: "object",
|
|
101
|
-
description: "Port object",
|
|
102
|
-
example: { _type: JSON_1.ObjectType.Port, value: 8080 },
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
91
|
}
|
|
106
92
|
exports.default = Port;
|