@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
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withNoBreakSpacesInLocale = exports.withNoBreakSpaces = exports.withNumbersKeptWithUnits = exports.withFrenchSpacingInHtml = exports.withFrenchSpacing = exports.setsPunctuationApart = exports.NARROW_NO_BREAK_SPACE = exports.NO_BREAK_SPACE = void 0;
|
|
4
|
+
const RegExpEscape_1 = require("../Utils/RegExpEscape");
|
|
5
|
+
/*
|
|
6
|
+
* WHERE A LINE MAY NOT BREAK.
|
|
7
|
+
*
|
|
8
|
+
* A browser may break a line at any plain space. Two kinds of space in
|
|
9
|
+
* OneUptime's words read wrong when it does:
|
|
10
|
+
*
|
|
11
|
+
* - French sets its punctuation apart: it writes a space before » ? ! : and
|
|
12
|
+
* ; and after «. Every French text OneUptime writes puts a plain space
|
|
13
|
+
* there (as DashboardFrenchPunctuation holds it to), so a narrow line
|
|
14
|
+
* could start with the mark: the empty Archived Workflows page wrapped as
|
|
15
|
+
* "... dans la liste « Flux de travail" over "» et choisissez « Archiver
|
|
16
|
+
* »" (#8032). French typography writes a no-break space there: the narrow
|
|
17
|
+
* one (U+202F) before ; ! and ?, the full one (U+00A0) before : and »
|
|
18
|
+
* and after «.
|
|
19
|
+
* - A number and its unit are one quantity. English writes "Uptime (24h)",
|
|
20
|
+
* German "Verfügbarkeit (24 Std.)", and on a phone the German tile's title
|
|
21
|
+
* broke inside its brackets: "Verfügbarkeit (24" over "Std.)" (#8043).
|
|
22
|
+
* Where the English text writes a number beside its unit - "{{hours}}h",
|
|
23
|
+
* "{{minutes}} min", "{{percent}}%", "24h", "10 MB" - the space a
|
|
24
|
+
* translation writes after that number is a no-break space (U+00A0).
|
|
25
|
+
*
|
|
26
|
+
* The locale files keep their plain spaces, as translators type them and as
|
|
27
|
+
* the checks that read the files expect them. The words are set with
|
|
28
|
+
* no-break spaces where they are drawn: the Translator sets every wording
|
|
29
|
+
* a locale gives it (Types/Translator, so the server's messages too), each
|
|
30
|
+
* frontend sets its locale as i18next loads it (withNoBreakSpacesInLocale),
|
|
31
|
+
* and the docs set their French pages and labels. Only OneUptime's own
|
|
32
|
+
* words are set: a value - a monitor's name, a number someone typed - goes
|
|
33
|
+
* into a sentence as it is written, and so does an English text left in a
|
|
34
|
+
* locale for a translation still to come.
|
|
35
|
+
*
|
|
36
|
+
* Code in backticks and an HTML tag are left as they are written: a space
|
|
37
|
+
* there is the code's.
|
|
38
|
+
*
|
|
39
|
+
* Pure: no Node or browser APIs. Linear in the text's length.
|
|
40
|
+
*/
|
|
41
|
+
// A space no line breaks at.
|
|
42
|
+
exports.NO_BREAK_SPACE = "\u00A0";
|
|
43
|
+
// A narrow space no line breaks at: French's before ; ! and ?.
|
|
44
|
+
exports.NARROW_NO_BREAK_SPACE = "\u202F";
|
|
45
|
+
/*
|
|
46
|
+
* A run of the spaces a line may break at: the space and the fixed-width
|
|
47
|
+
* spaces, but not the figure space (U+2007), which already holds.
|
|
48
|
+
*/
|
|
49
|
+
const BREAKING_SPACES = "[\\u0020\\u2000-\\u2006\\u2008-\\u200A\\u205F]+";
|
|
50
|
+
const HAS_A_BREAKING_SPACE = /[ \u2000-\u2006\u2008-\u200A\u205F]/;
|
|
51
|
+
/*
|
|
52
|
+
* What a text holds as it is written: code in backticks and an HTML tag.
|
|
53
|
+
* A space inside one is left alone.
|
|
54
|
+
*/
|
|
55
|
+
const AS_WRITTEN_IN_TEXT = /`[^`]*`|<\/?[A-Za-z][^<>]*>/g;
|
|
56
|
+
/*
|
|
57
|
+
* What a page's HTML holds as it is written: its code, its preformatted
|
|
58
|
+
* text, its scripts and styles, and every tag.
|
|
59
|
+
*/
|
|
60
|
+
const AS_WRITTEN_IN_HTML = /<(pre|code|kbd|samp|script|style|textarea)\b[^>]*>[\s\S]*?<\/\1\s*>|<!--[\s\S]*?-->|<\/?[A-Za-z][^<>]*>/gi;
|
|
61
|
+
// The base of a language tag: "fr" for "fr-CA".
|
|
62
|
+
const getBaseLanguage = (language) => {
|
|
63
|
+
var _a;
|
|
64
|
+
return ((_a = (language || "").split(/[-_]/)[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "";
|
|
65
|
+
};
|
|
66
|
+
/*
|
|
67
|
+
* Whether `language` sets its punctuation apart with a space: French, in
|
|
68
|
+
* every region it is written in.
|
|
69
|
+
*/
|
|
70
|
+
const setsPunctuationApart = (language) => {
|
|
71
|
+
return getBaseLanguage(language) === "fr";
|
|
72
|
+
};
|
|
73
|
+
exports.setsPunctuationApart = setsPunctuationApart;
|
|
74
|
+
// The ranges of `text` that `asWritten` matches: [start, end) pairs, in order.
|
|
75
|
+
const findRanges = (text, asWritten) => {
|
|
76
|
+
var _a;
|
|
77
|
+
const ranges = [];
|
|
78
|
+
for (const match of text.matchAll(asWritten)) {
|
|
79
|
+
const start = (_a = match.index) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
+
ranges.push([start, start + match[0].length]);
|
|
81
|
+
}
|
|
82
|
+
return ranges;
|
|
83
|
+
};
|
|
84
|
+
// Whether `at` falls inside one of `ranges`, which are in order and apart.
|
|
85
|
+
const isInside = (ranges, at) => {
|
|
86
|
+
let low = 0;
|
|
87
|
+
let high = ranges.length - 1;
|
|
88
|
+
while (low <= high) {
|
|
89
|
+
const middle = (low + high) >> 1;
|
|
90
|
+
const [start, end] = ranges[middle];
|
|
91
|
+
if (at < start) {
|
|
92
|
+
high = middle - 1;
|
|
93
|
+
}
|
|
94
|
+
else if (at >= end) {
|
|
95
|
+
low = middle + 1;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
};
|
|
103
|
+
/*
|
|
104
|
+
* `text` with each run of spaces `pattern` finds - its last group, which
|
|
105
|
+
* ends its match - put in place by `replace` (null leaves it), unless it
|
|
106
|
+
* is held as written (`asWritten`).
|
|
107
|
+
*/
|
|
108
|
+
const replaceSpaces = (text, pattern, asWritten, replace) => {
|
|
109
|
+
var _a;
|
|
110
|
+
let ranges = null;
|
|
111
|
+
let result = "";
|
|
112
|
+
let at = 0;
|
|
113
|
+
for (const match of text.matchAll(pattern)) {
|
|
114
|
+
const spaces = match[match.length - 1] || "";
|
|
115
|
+
const spacesStart = ((_a = match.index) !== null && _a !== void 0 ? _a : 0) + match[0].length - spaces.length;
|
|
116
|
+
ranges = ranges || findRanges(text, asWritten);
|
|
117
|
+
if (isInside(ranges, spacesStart)) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const replacement = replace(match);
|
|
121
|
+
if (replacement === null) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
result += text.slice(at, spacesStart) + replacement;
|
|
125
|
+
at = spacesStart + spaces.length;
|
|
126
|
+
}
|
|
127
|
+
return at === 0 ? text : result + text.slice(at);
|
|
128
|
+
};
|
|
129
|
+
// What a no-break space puts in place of every run of spaces it is handed.
|
|
130
|
+
const always = (space) => {
|
|
131
|
+
return () => {
|
|
132
|
+
return space;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/*
|
|
136
|
+
* FRENCH'S MARKS.
|
|
137
|
+
*
|
|
138
|
+
* A question mark, an exclamation mark, a colon and a semicolon end the
|
|
139
|
+
* word before them: a letter, a digit, a closing quote or bracket, a
|
|
140
|
+
* placeholder's braces, Markdown's emphasis, code, an HTML tag or an
|
|
141
|
+
* entity ("""). After the mark comes a space, the end, a closing mark
|
|
142
|
+
* or more punctuation. Anything else is no French punctuation and keeps
|
|
143
|
+
* its space: "MR !{{number}}" (a merge request), "à :{{minute}}" (a minute
|
|
144
|
+
* past the hour), "Essayez !, @, # ou $" (what a password may hold),
|
|
145
|
+
* "texte, ? un caractère" (a wildcard).
|
|
146
|
+
*/
|
|
147
|
+
const BEFORE_A_MARK = "(?<=[\\p{L}\\p{M}\\p{N}»›”’\"')\\]}*_`%….>]|&#?\\w+;)";
|
|
148
|
+
const AFTER_A_MARK = "(?:$|\\s|[»›”’\"')\\]*_<.…?!`])";
|
|
149
|
+
// The spaces before a question mark, an exclamation mark or a semicolon.
|
|
150
|
+
const SPACES_BEFORE_A_NARROW_MARK = new RegExp(`${BEFORE_A_MARK}(${BREAKING_SPACES})(?=[?!;]${AFTER_A_MARK})`, "gu");
|
|
151
|
+
// The spaces before a colon.
|
|
152
|
+
const SPACES_BEFORE_A_COLON = new RegExp(`${BEFORE_A_MARK}(${BREAKING_SPACES})(?=:${AFTER_A_MARK})`, "gu");
|
|
153
|
+
// The spaces before a closing guillemet, after the words it closes.
|
|
154
|
+
const SPACES_BEFORE_A_CLOSING_GUILLEMET = new RegExp(`(?<=\\S)(${BREAKING_SPACES})(?=[»›])`, "gu");
|
|
155
|
+
// The spaces after an opening guillemet, before the words it opens.
|
|
156
|
+
const SPACES_AFTER_AN_OPENING_GUILLEMET = new RegExp(`(?<=[«‹])(${BREAKING_SPACES})(?=\\S)`, "gu");
|
|
157
|
+
// Whether a text has a space French may set with a no-break one.
|
|
158
|
+
const HAS_A_FRENCH_SPACE = new RegExp(`${BREAKING_SPACES}[»›?!:;]|[«‹]${BREAKING_SPACES}`, "u");
|
|
159
|
+
// `text` with French's no-break spaces, leaving what `asWritten` matches.
|
|
160
|
+
const setFrenchSpacing = (text, asWritten) => {
|
|
161
|
+
if (!text || !HAS_A_FRENCH_SPACE.test(text)) {
|
|
162
|
+
return text;
|
|
163
|
+
}
|
|
164
|
+
let result = replaceSpaces(text, SPACES_BEFORE_A_NARROW_MARK, asWritten, always(exports.NARROW_NO_BREAK_SPACE));
|
|
165
|
+
result = replaceSpaces(result, SPACES_BEFORE_A_COLON, asWritten, always(exports.NO_BREAK_SPACE));
|
|
166
|
+
result = replaceSpaces(result, SPACES_BEFORE_A_CLOSING_GUILLEMET, asWritten, always(exports.NO_BREAK_SPACE));
|
|
167
|
+
return replaceSpaces(result, SPACES_AFTER_AN_OPENING_GUILLEMET, asWritten, always(exports.NO_BREAK_SPACE));
|
|
168
|
+
};
|
|
169
|
+
/*
|
|
170
|
+
* `words` - French - with a no-break space where French sets a mark apart:
|
|
171
|
+
* a narrow one before ; ! and ?, a full one before : and » and after «.
|
|
172
|
+
* A run of spaces there is one no-break space. Code in backticks and HTML
|
|
173
|
+
* tags are left as written.
|
|
174
|
+
*/
|
|
175
|
+
const withFrenchSpacing = (words) => {
|
|
176
|
+
return setFrenchSpacing(words, AS_WRITTEN_IN_TEXT);
|
|
177
|
+
};
|
|
178
|
+
exports.withFrenchSpacing = withFrenchSpacing;
|
|
179
|
+
/*
|
|
180
|
+
* A French page's HTML with French's no-break spaces in its text: never in
|
|
181
|
+
* a tag, its code, its preformatted text, a script or a style.
|
|
182
|
+
*/
|
|
183
|
+
const withFrenchSpacingInHtml = (html) => {
|
|
184
|
+
return setFrenchSpacing(html, AS_WRITTEN_IN_HTML);
|
|
185
|
+
};
|
|
186
|
+
exports.withFrenchSpacingInHtml = withFrenchSpacingInHtml;
|
|
187
|
+
/*
|
|
188
|
+
* NUMBERS AND THEIR UNITS.
|
|
189
|
+
*
|
|
190
|
+
* The units English writes beside a number, as their symbols: a share, a
|
|
191
|
+
* time, a size, a rate, a signal, a temperature. A word ("5 minutes", "3
|
|
192
|
+
* days") is no unit here: a line may break before it as before any word.
|
|
193
|
+
*/
|
|
194
|
+
const ENGLISH_UNITS = [
|
|
195
|
+
"%",
|
|
196
|
+
"‰",
|
|
197
|
+
"°C",
|
|
198
|
+
"°F",
|
|
199
|
+
"ns",
|
|
200
|
+
"µs",
|
|
201
|
+
"μs",
|
|
202
|
+
"ms",
|
|
203
|
+
"s",
|
|
204
|
+
"sec",
|
|
205
|
+
"secs",
|
|
206
|
+
"m",
|
|
207
|
+
"min",
|
|
208
|
+
"mins",
|
|
209
|
+
"h",
|
|
210
|
+
"hr",
|
|
211
|
+
"hrs",
|
|
212
|
+
"d",
|
|
213
|
+
"w",
|
|
214
|
+
"wk",
|
|
215
|
+
"wks",
|
|
216
|
+
"mo",
|
|
217
|
+
"y",
|
|
218
|
+
"yr",
|
|
219
|
+
"yrs",
|
|
220
|
+
"B",
|
|
221
|
+
"kB",
|
|
222
|
+
"KB",
|
|
223
|
+
"MB",
|
|
224
|
+
"GB",
|
|
225
|
+
"TB",
|
|
226
|
+
"PB",
|
|
227
|
+
"KiB",
|
|
228
|
+
"MiB",
|
|
229
|
+
"GiB",
|
|
230
|
+
"TiB",
|
|
231
|
+
"PiB",
|
|
232
|
+
"bps",
|
|
233
|
+
"Kbps",
|
|
234
|
+
"Mbps",
|
|
235
|
+
"Gbps",
|
|
236
|
+
"dB",
|
|
237
|
+
"dBm",
|
|
238
|
+
"Hz",
|
|
239
|
+
"kHz",
|
|
240
|
+
"MHz",
|
|
241
|
+
"GHz",
|
|
242
|
+
"ppm",
|
|
243
|
+
"rpm",
|
|
244
|
+
];
|
|
245
|
+
const UNIT_PATTERN = [...ENGLISH_UNITS]
|
|
246
|
+
.sort((a, b) => {
|
|
247
|
+
return b.length - a.length;
|
|
248
|
+
})
|
|
249
|
+
.map((unit) => {
|
|
250
|
+
return (0, RegExpEscape_1.escapeRegExp)(unit);
|
|
251
|
+
})
|
|
252
|
+
.join("|");
|
|
253
|
+
/*
|
|
254
|
+
* A number beside a unit in an English text: a {{placeholder}} or written
|
|
255
|
+
* digits, then a unit, joined or after one space, and not the start of a
|
|
256
|
+
* longer word ("{{count}} more", "{{count}} days").
|
|
257
|
+
*/
|
|
258
|
+
const ENGLISH_NUMBER_WITH_UNIT = new RegExp(`(?:\\{\\{\\s*([\\w.]+)\\s*\\}\\}|(?<![\\p{L}\\p{N}_.,])(\\p{Nd}+(?:[.,]\\p{Nd}+)*))[ ]?(?:${UNIT_PATTERN})(?![\\p{L}\\p{N}_])`, "gu");
|
|
259
|
+
// A placeholder, then the spaces after it, before more words.
|
|
260
|
+
const PLACEHOLDER_BEFORE_SPACES = new RegExp(`\\{\\{\\s*([\\w.]+)\\s*\\}\\}(${BREAKING_SPACES})(?=\\S)`, "gu");
|
|
261
|
+
/*
|
|
262
|
+
* Written digits, then the spaces after them, before more words. Not the
|
|
263
|
+
* end of a name in Latin, Cyrillic or Greek letters ("p95", "v2"); a word
|
|
264
|
+
* of another script may run into its number, as Arabic's "and" does
|
|
265
|
+
* ("و10") and Chinese writes "超过5".
|
|
266
|
+
*/
|
|
267
|
+
const DIGITS_BEFORE_SPACES = new RegExp(`(?<![\\p{Script=Latin}\\p{Script=Cyrillic}\\p{Script=Greek}\\p{N}_.,\\u066B])(\\p{Nd}+(?:[.,\\u066B]\\p{Nd}+)*)(${BREAKING_SPACES})(?=\\S)`, "gu");
|
|
268
|
+
// The zero of each run of digits a locale writes numbers in.
|
|
269
|
+
const DIGIT_ZEROS = [
|
|
270
|
+
0x30, // 0
|
|
271
|
+
0x660, // Arabic-Indic ٠
|
|
272
|
+
0x6f0, // Persian ۰
|
|
273
|
+
0x966, // Devanagari ०
|
|
274
|
+
0x9e6, // Bengali ০
|
|
275
|
+
0xff10, // Full-width 0
|
|
276
|
+
];
|
|
277
|
+
/*
|
|
278
|
+
* A number as its digits alone, in Latin digits: "99,9", "99.9" and "۹۹٫۹"
|
|
279
|
+
* are all "999", so a translation's number is found whichever digits and
|
|
280
|
+
* decimal sign its language writes.
|
|
281
|
+
*/
|
|
282
|
+
const toDigits = (number) => {
|
|
283
|
+
let digits = "";
|
|
284
|
+
for (const character of number) {
|
|
285
|
+
const code = character.codePointAt(0);
|
|
286
|
+
const zero = DIGIT_ZEROS.find((start) => {
|
|
287
|
+
return code >= start && code <= start + 9;
|
|
288
|
+
});
|
|
289
|
+
if (zero !== undefined) {
|
|
290
|
+
digits += String(code - zero);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return digits;
|
|
294
|
+
};
|
|
295
|
+
// The numbers an English text writes beside a unit, remembered per text.
|
|
296
|
+
const MOST_REMEMBERED_TEXTS = 5000;
|
|
297
|
+
const numbersWithUnitsOf = new Map();
|
|
298
|
+
const HAS_A_NUMBER = /\}\}|\p{Nd}/u;
|
|
299
|
+
/*
|
|
300
|
+
* The numbers `english` writes beside a unit: the placeholders by name,
|
|
301
|
+
* written numbers by their digits. Null when it writes none.
|
|
302
|
+
*/
|
|
303
|
+
const findNumbersWithUnits = (english) => {
|
|
304
|
+
if (!english || !HAS_A_NUMBER.test(english)) {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
const remembered = numbersWithUnitsOf.get(english);
|
|
308
|
+
if (remembered !== undefined) {
|
|
309
|
+
return remembered;
|
|
310
|
+
}
|
|
311
|
+
const placeholders = new Set();
|
|
312
|
+
const digits = new Set();
|
|
313
|
+
for (const match of english.matchAll(ENGLISH_NUMBER_WITH_UNIT)) {
|
|
314
|
+
if (match[1]) {
|
|
315
|
+
placeholders.add(match[1]);
|
|
316
|
+
}
|
|
317
|
+
else if (match[2]) {
|
|
318
|
+
digits.add(toDigits(match[2]));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const found = placeholders.size > 0 || digits.size > 0 ? { placeholders, digits } : null;
|
|
322
|
+
if (numbersWithUnitsOf.size >= MOST_REMEMBERED_TEXTS) {
|
|
323
|
+
numbersWithUnitsOf.clear();
|
|
324
|
+
}
|
|
325
|
+
numbersWithUnitsOf.set(english, found);
|
|
326
|
+
return found;
|
|
327
|
+
};
|
|
328
|
+
/*
|
|
329
|
+
* `words` - the wording of `english` in any language, or `english` itself
|
|
330
|
+
* - with a no-break space after each number `english` writes beside its
|
|
331
|
+
* unit: "Verfügbarkeit ({{hours}} Std.)" for "Uptime ({{hours}}h)",
|
|
332
|
+
* "Letzte 24 Std." for "Last 24h". A number is found by its placeholder,
|
|
333
|
+
* or by its digits in whichever digits the language writes. Code in
|
|
334
|
+
* backticks and HTML tags are left as written.
|
|
335
|
+
*/
|
|
336
|
+
const withNumbersKeptWithUnits = (words, english) => {
|
|
337
|
+
if (!words || !HAS_A_BREAKING_SPACE.test(words)) {
|
|
338
|
+
return words;
|
|
339
|
+
}
|
|
340
|
+
const numbers = findNumbersWithUnits(english);
|
|
341
|
+
if (!numbers) {
|
|
342
|
+
return words;
|
|
343
|
+
}
|
|
344
|
+
let result = words;
|
|
345
|
+
if (numbers.placeholders.size > 0) {
|
|
346
|
+
result = replaceSpaces(result, PLACEHOLDER_BEFORE_SPACES, AS_WRITTEN_IN_TEXT, (match) => {
|
|
347
|
+
return numbers.placeholders.has(match[1] || "") ? exports.NO_BREAK_SPACE : null;
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
if (numbers.digits.size > 0) {
|
|
351
|
+
result = replaceSpaces(result, DIGITS_BEFORE_SPACES, AS_WRITTEN_IN_TEXT, (match) => {
|
|
352
|
+
return numbers.digits.has(toDigits(match[1] || ""))
|
|
353
|
+
? exports.NO_BREAK_SPACE
|
|
354
|
+
: null;
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return result;
|
|
358
|
+
};
|
|
359
|
+
exports.withNumbersKeptWithUnits = withNumbersKeptWithUnits;
|
|
360
|
+
/*
|
|
361
|
+
* `words`, a wording of `english` in `language`, as the language sets a
|
|
362
|
+
* line: each number with its unit, and French's marks with the words
|
|
363
|
+
* before and after them.
|
|
364
|
+
*/
|
|
365
|
+
const withNoBreakSpaces = (words, english, language) => {
|
|
366
|
+
const kept = (0, exports.withNumbersKeptWithUnits)(words, english);
|
|
367
|
+
return (0, exports.setsPunctuationApart)(language) ? (0, exports.withFrenchSpacing)(kept) : kept;
|
|
368
|
+
};
|
|
369
|
+
exports.withNoBreakSpaces = withNoBreakSpaces;
|
|
370
|
+
// The suffixes a plural form's key carries: "_one", and a form's mark.
|
|
371
|
+
const PLURAL_SUFFIX = /(?:_(?:zero|one|two|few|many|other))?(?:_sameAsEnglish)?$/;
|
|
372
|
+
const isLocaleTree = (node) => {
|
|
373
|
+
return typeof node === "object" && node !== null && !Array.isArray(node);
|
|
374
|
+
};
|
|
375
|
+
/*
|
|
376
|
+
* A locale with each of its own wordings set as its language sets a line
|
|
377
|
+
* (withNoBreakSpaces). An entry that is still the English - a placeholder
|
|
378
|
+
* for a translation to come - is left as it is: the lookup reads it as no
|
|
379
|
+
* translation at all, and so it stays. English itself, and a locale with
|
|
380
|
+
* nothing to set, come back as they went in; any other comes back a new
|
|
381
|
+
* object, the one handed in unchanged.
|
|
382
|
+
*/
|
|
383
|
+
const withNoBreakSpacesInLocale = (input) => {
|
|
384
|
+
const language = input.language;
|
|
385
|
+
if (getBaseLanguage(language) === "en" || !isLocaleTree(input.locale)) {
|
|
386
|
+
return input.locale;
|
|
387
|
+
}
|
|
388
|
+
const setTree = (tree, english) => {
|
|
389
|
+
let result = null;
|
|
390
|
+
for (const key of Object.keys(tree)) {
|
|
391
|
+
const value = tree[key];
|
|
392
|
+
const englishValue = english && Object.prototype.hasOwnProperty.call(english, key)
|
|
393
|
+
? english[key]
|
|
394
|
+
: undefined;
|
|
395
|
+
let set = value;
|
|
396
|
+
if (isLocaleTree(value)) {
|
|
397
|
+
set = setTree(value, isLocaleTree(englishValue) ? englishValue : undefined);
|
|
398
|
+
}
|
|
399
|
+
else if (typeof value === "string") {
|
|
400
|
+
const englishText = typeof englishValue === "string"
|
|
401
|
+
? englishValue
|
|
402
|
+
: key.replace(PLURAL_SUFFIX, "");
|
|
403
|
+
set =
|
|
404
|
+
value === englishText || value === key
|
|
405
|
+
? value
|
|
406
|
+
: (0, exports.withNoBreakSpaces)(value, englishText, language);
|
|
407
|
+
}
|
|
408
|
+
if (set !== value && !result) {
|
|
409
|
+
result = Object.assign({}, tree);
|
|
410
|
+
}
|
|
411
|
+
if (result) {
|
|
412
|
+
result[key] = set;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return result || tree;
|
|
416
|
+
};
|
|
417
|
+
return setTree(input.locale, input.english);
|
|
418
|
+
};
|
|
419
|
+
exports.withNoBreakSpacesInLocale = withNoBreakSpacesInLocale;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import commonJsModule from "./NoBreakSpaces.js";
|
|
2
|
+
export const NARROW_NO_BREAK_SPACE = commonJsModule.NARROW_NO_BREAK_SPACE;
|
|
3
|
+
export const NO_BREAK_SPACE = commonJsModule.NO_BREAK_SPACE;
|
|
4
|
+
export const setsPunctuationApart = commonJsModule.setsPunctuationApart;
|
|
5
|
+
export const withFrenchSpacing = commonJsModule.withFrenchSpacing;
|
|
6
|
+
export const withFrenchSpacingInHtml = commonJsModule.withFrenchSpacingInHtml;
|
|
7
|
+
export const withNoBreakSpaces = commonJsModule.withNoBreakSpaces;
|
|
8
|
+
export const withNoBreakSpacesInLocale = commonJsModule.withNoBreakSpacesInLocale;
|
|
9
|
+
export const withNumbersKeptWithUnits = commonJsModule.withNumbersKeptWithUnits;
|
|
@@ -7,6 +7,7 @@ export declare const PAGING_LADDER_APPLY_ROUTE: string;
|
|
|
7
7
|
export type PagingMethodColumn = keyof OnCallPageNotificationMethods;
|
|
8
8
|
export type PagingSeverityColumn = "incidentSeverityId" | "alertSeverityId";
|
|
9
9
|
export declare const getSeverityColumnForOnCallRuleKind: (kind: OnCallRuleKind) => PagingSeverityColumn;
|
|
10
|
+
export declare const getSeverityColumnForRuleType: (ruleType: NotificationRuleType | string) => PagingSeverityColumn | null;
|
|
10
11
|
export declare const PAGING_LADDER_WAITS_IN_MINUTES: ReadonlyArray<number>;
|
|
11
12
|
export declare const MAX_PAGING_LADDER_WAIT_IN_MINUTES: number;
|
|
12
13
|
export declare const PAGING_METHOD_COLUMNS: ReadonlyArray<PagingMethodColumn>;
|
|
@@ -63,6 +64,7 @@ export declare const getPagingLadderMethodKey: (step: {
|
|
|
63
64
|
export declare const getPagingLadderStepKey: (step: PagingLadderStep) => string;
|
|
64
65
|
export declare const comparePagingLadderSteps: (a: PagingLadderStep, b: PagingLadderStep) => number;
|
|
65
66
|
export declare const normalizePagingLadderSteps: (steps: ReadonlyArray<PagingLadderStep>) => Array<PagingLadderStep>;
|
|
67
|
+
export declare const getPagingLadderStepsFromRule: (rule: PagingLadderRule) => Array<PagingLadderStep>;
|
|
66
68
|
export declare const getPagingLadderStepFromRule: (rule: PagingLadderRule) => PagingLadderStep | null;
|
|
67
69
|
export interface PagingLadderCellReading {
|
|
68
70
|
cell: PagingLadderCell;
|
|
@@ -132,6 +134,16 @@ export declare const getPagingLadderRules: (data: {
|
|
|
132
134
|
cells: ReadonlyArray<PagingLadderCell>;
|
|
133
135
|
steps: ReadonlyArray<PagingLadderStep>;
|
|
134
136
|
}) => Array<PagingLadderRuleToCreate>;
|
|
137
|
+
export interface PagingLadderNewCell {
|
|
138
|
+
steps: Array<PagingLadderStep>;
|
|
139
|
+
isMuted: boolean;
|
|
140
|
+
}
|
|
141
|
+
export declare const getPagingLadderStepsForNewCell: (data: {
|
|
142
|
+
cells: ReadonlyArray<PagingLadderCell>;
|
|
143
|
+
ruleType: NotificationRuleType | string;
|
|
144
|
+
severityId: string;
|
|
145
|
+
rules: ReadonlyArray<PagingLadderRule>;
|
|
146
|
+
}) => PagingLadderNewCell | null;
|
|
135
147
|
export declare const isEmptyPagingLadderPlan: (plan: PagingLadderPlan) => boolean;
|
|
136
148
|
export declare const getPagingLadderStepsProblem: (steps: ReadonlyArray<unknown>) => string | null;
|
|
137
149
|
export declare const readPagingLadderSteps: (steps: ReadonlyArray<unknown>) => Array<PagingLadderStep>;
|
|
@@ -7,6 +7,7 @@ export declare const PAGING_LADDER_APPLY_ROUTE: string;
|
|
|
7
7
|
export type PagingMethodColumn = keyof OnCallPageNotificationMethods;
|
|
8
8
|
export type PagingSeverityColumn = "incidentSeverityId" | "alertSeverityId";
|
|
9
9
|
export declare const getSeverityColumnForOnCallRuleKind: (kind: OnCallRuleKind) => PagingSeverityColumn;
|
|
10
|
+
export declare const getSeverityColumnForRuleType: (ruleType: NotificationRuleType | string) => PagingSeverityColumn | null;
|
|
10
11
|
export declare const PAGING_LADDER_WAITS_IN_MINUTES: ReadonlyArray<number>;
|
|
11
12
|
export declare const MAX_PAGING_LADDER_WAIT_IN_MINUTES: number;
|
|
12
13
|
export declare const PAGING_METHOD_COLUMNS: ReadonlyArray<PagingMethodColumn>;
|
|
@@ -63,6 +64,7 @@ export declare const getPagingLadderMethodKey: (step: {
|
|
|
63
64
|
export declare const getPagingLadderStepKey: (step: PagingLadderStep) => string;
|
|
64
65
|
export declare const comparePagingLadderSteps: (a: PagingLadderStep, b: PagingLadderStep) => number;
|
|
65
66
|
export declare const normalizePagingLadderSteps: (steps: ReadonlyArray<PagingLadderStep>) => Array<PagingLadderStep>;
|
|
67
|
+
export declare const getPagingLadderStepsFromRule: (rule: PagingLadderRule) => Array<PagingLadderStep>;
|
|
66
68
|
export declare const getPagingLadderStepFromRule: (rule: PagingLadderRule) => PagingLadderStep | null;
|
|
67
69
|
export interface PagingLadderCellReading {
|
|
68
70
|
cell: PagingLadderCell;
|
|
@@ -132,6 +134,16 @@ export declare const getPagingLadderRules: (data: {
|
|
|
132
134
|
cells: ReadonlyArray<PagingLadderCell>;
|
|
133
135
|
steps: ReadonlyArray<PagingLadderStep>;
|
|
134
136
|
}) => Array<PagingLadderRuleToCreate>;
|
|
137
|
+
export interface PagingLadderNewCell {
|
|
138
|
+
steps: Array<PagingLadderStep>;
|
|
139
|
+
isMuted: boolean;
|
|
140
|
+
}
|
|
141
|
+
export declare const getPagingLadderStepsForNewCell: (data: {
|
|
142
|
+
cells: ReadonlyArray<PagingLadderCell>;
|
|
143
|
+
ruleType: NotificationRuleType | string;
|
|
144
|
+
severityId: string;
|
|
145
|
+
rules: ReadonlyArray<PagingLadderRule>;
|
|
146
|
+
}) => PagingLadderNewCell | null;
|
|
135
147
|
export declare const isEmptyPagingLadderPlan: (plan: PagingLadderPlan) => boolean;
|
|
136
148
|
export declare const getPagingLadderStepsProblem: (steps: ReadonlyArray<unknown>) => string | null;
|
|
137
149
|
export declare const readPagingLadderSteps: (steps: ReadonlyArray<unknown>) => Array<PagingLadderStep>;
|