@oneuptime/common 14.1.0 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/Alert.d.mts +1 -0
- package/Models/DatabaseModels/Alert.d.ts +1 -0
- package/Models/DatabaseModels/Alert.js +34 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/Models/DatabaseModels/Incident.d.mts +1 -0
- package/Models/DatabaseModels/Incident.d.ts +1 -0
- package/Models/DatabaseModels/Incident.js +35 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
- package/Types/AI/AIActionWords.d.mts +3 -1
- package/Types/AI/AIActionWords.d.ts +3 -1
- package/Types/AI/AIActionWords.js +70 -1
- package/Types/AI/AIActionWords.mjs +2 -0
- package/Types/AI/AIChatTypes.d.mts +2 -1
- package/Types/AI/AIChatTypes.d.ts +2 -1
- package/Types/AI/AIReadTableWords.d.mts +192 -0
- package/Types/AI/AIReadTableWords.d.ts +192 -0
- package/Types/AI/AIReadTableWords.js +368 -0
- package/Types/AI/AIReadTableWords.mjs +18 -0
- package/Types/AI/AiRunRefusal.d.mts +3 -0
- package/Types/AI/AiRunRefusal.d.ts +3 -0
- package/Types/AI/AiRunRefusal.js +22 -1
- package/Types/AI/ResourceAiAccessPermissions.js +7 -18
- package/Types/AuditLog/AuditLogActionLabel.js +19 -9
- package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
- package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
- package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
- package/Types/Cloud/CloudResourceHealth.js +405 -13
- package/Types/Cloud/CloudResourceHealth.mjs +28 -0
- package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
- package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
- package/Types/DataObservability/DataCheckRefusals.js +77 -0
- package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
- package/Types/Date.d.mts +2 -0
- package/Types/Date.d.ts +2 -0
- package/Types/Date.js +22 -0
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +8 -5
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Exception/EgressGuardException.js +1 -1
- package/Types/Exception/ErrorMessageRule.d.mts +1 -0
- package/Types/Exception/ErrorMessageRule.d.ts +1 -0
- package/Types/Exception/ErrorMessageRule.js +67 -13
- package/Types/Exception/ErrorMessageRule.mjs +1 -0
- package/Types/Exception/ExceptionMessages.d.mts +2 -0
- package/Types/Exception/ExceptionMessages.d.ts +2 -0
- package/Types/Exception/ExceptionMessages.js +2 -0
- package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.js +74 -0
- package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
- package/Types/JSONFunctions.js +10 -3
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/MeaningKeys.d.mts +4 -0
- package/Types/MeaningKeys.d.ts +4 -0
- package/Types/MeaningKeys.js +74 -0
- package/Types/MeaningKeys.mjs +5 -0
- package/Types/Monitor/WhoIsTold.d.mts +3 -0
- package/Types/Monitor/WhoIsTold.d.ts +3 -0
- package/Types/Monitor/WhoIsTold.js +63 -13
- package/Types/NoBreakSpaces.d.mts +16 -0
- package/Types/NoBreakSpaces.d.ts +16 -0
- package/Types/NoBreakSpaces.js +419 -0
- package/Types/NoBreakSpaces.mjs +9 -0
- package/Types/NotificationRule/PagingLadder.d.mts +12 -0
- package/Types/NotificationRule/PagingLadder.d.ts +12 -0
- package/Types/NotificationRule/PagingLadder.js +159 -11
- package/Types/NotificationRule/PagingLadder.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OpenStack/OpenStackCapacity.js +12 -5
- package/Types/Permission.d.mts +4 -0
- package/Types/Permission.d.ts +4 -0
- package/Types/Permission.js +64 -8
- package/Types/Product/ProductUsage.js +2 -1
- package/Types/Product/ProjectProductsAnswer.js +2 -1
- package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.js +12 -0
- package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
- package/Types/Rum/ProductAnalyticsEvents.js +13 -1
- package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.js +12 -0
- package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
- package/Types/SetupHealth/SetupHealth.d.mts +1 -0
- package/Types/SetupHealth/SetupHealth.d.ts +1 -0
- package/Types/SetupHealth/SetupHealth.js +13 -5
- package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
- package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
- package/Types/StatusPage/DefaultStatusNames.js +74 -28
- package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
- package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +100 -19
- package/Types/Translator.mjs +1 -0
- package/Types/UserSession/SessionLength.d.mts +33 -0
- package/Types/UserSession/SessionLength.d.ts +33 -0
- package/Types/UserSession/SessionLength.js +134 -5
- package/Types/UserSession/SessionLength.mjs +5 -0
- package/Types/Workflow/WorkflowStatus.js +21 -10
- package/Utils/AI/InvestigationReport.js +2 -2
- package/Utils/API.d.mts +0 -11
- package/Utils/API.d.ts +0 -11
- package/Utils/API.js +0 -432
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
- package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
- package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
- package/Utils/DefaultRecordNames.d.mts +6 -0
- package/Utils/DefaultRecordNames.d.ts +6 -0
- package/Utils/DefaultRecordNames.js +122 -0
- package/Utils/DefaultRecordNames.mjs +6 -0
- package/Utils/Grok/Grok.js +7 -4
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
- package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
- package/Utils/LookupTable.d.mts +3 -0
- package/Utils/LookupTable.d.ts +3 -0
- package/Utils/LookupTable.js +61 -0
- package/Utils/LookupTable.mjs +3 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
- package/Utils/Markdown/OverLongText.js +296 -2
- package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
- package/Utils/Markdown/SlowMarkdown.js +354 -4
- package/Utils/Markdown/SlowMarkdown.mjs +1 -0
- package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
- package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
- package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
- package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
- package/Utils/Metrics/MetricSeriesScope.js +5 -1
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
- package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.js +58 -0
- package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
- package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
- package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
- package/Utils/Monitor/ProbeFailureReading.js +30 -1
- package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
- package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
- package/Utils/PromQL/PromQLEngine.js +18 -9
- package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
- package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.js +212 -0
- package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
- package/Utils/PromQL/PromQLLabels.js +4 -3
- package/Utils/PromQL/PromQLMetricNames.js +8 -2
- package/Utils/PromQL/PromQLParser.js +11 -6
- package/Utils/PromQL/PromQLRegex.d.mts +11 -0
- package/Utils/PromQL/PromQLRegex.d.ts +11 -0
- package/Utils/PromQL/PromQLRegex.js +990 -50
- package/Utils/PromQL/PromQLRegex.mjs +3 -0
- package/Utils/PromQL/PrometheusResponse.js +3 -1
- package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
- package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
- package/Utils/PromQL/RE2CharacterClass.js +532 -0
- package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
- package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
- package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
- package/Utils/RequestFailedDetailsUtil.js +452 -0
- package/Utils/RequestFailedDetailsUtil.mjs +2 -0
- package/Utils/Rum/UrlScrubber.d.mts +1 -1
- package/Utils/Rum/UrlScrubber.d.ts +1 -1
- package/Utils/Rum/UrlScrubber.js +10 -4
- package/Utils/Rum/UserFlow.js +22 -4
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
- package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +3 -1
- package/Utils/StateListType.d.mts +11 -0
- package/Utils/StateListType.d.ts +11 -0
- package/Utils/StateListType.js +21 -0
- package/Utils/StateListType.mjs +2 -0
- package/Utils/StateOrder.d.mts +8 -11
- package/Utils/StateOrder.d.ts +8 -11
- package/Utils/StateOrder.js +49 -84
- package/Utils/StateOrder.mjs +2 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
- package/Utils/Syslog/SyslogMessageParser.js +16 -6
- package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
- package/Utils/ValueFormatter.d.mts +1 -0
- package/Utils/ValueFormatter.d.ts +1 -0
- package/Utils/ValueFormatter.js +258 -18
- package/package.json +1 -1
package/Types/JSONFunctions.js
CHANGED
|
@@ -12,6 +12,7 @@ const SerializableObject_1 = __importDefault(require("./SerializableObject"));
|
|
|
12
12
|
const SerializableObjectDictionary_1 = __importDefault(require("./SerializableObjectDictionary"));
|
|
13
13
|
const Typeof_1 = __importDefault(require("./Typeof"));
|
|
14
14
|
const json5_1 = __importDefault(require("json5"));
|
|
15
|
+
const LookupTable_1 = require("../Utils/LookupTable");
|
|
15
16
|
class JSONFunctions {
|
|
16
17
|
static createSafeJSONObject() {
|
|
17
18
|
return Object.create(null);
|
|
@@ -272,22 +273,28 @@ class JSONFunctions {
|
|
|
272
273
|
// this function serializes JSON with Common Objects to JSON that can be stringified.
|
|
273
274
|
static serialize(val) {
|
|
274
275
|
const newVal = {};
|
|
276
|
+
/*
|
|
277
|
+
* Each key is written as the copy's own (writeOwnValue). A value read
|
|
278
|
+
* from a store can hold a key named __proto__ - a log's attribute, a
|
|
279
|
+
* series' label - and assigning it dropped it from the JSON, or made an
|
|
280
|
+
* object under it the copy's prototype, which hid it the same way.
|
|
281
|
+
*/
|
|
275
282
|
for (const key in val) {
|
|
276
283
|
if (val[key] === undefined) {
|
|
277
284
|
continue;
|
|
278
285
|
}
|
|
279
286
|
if (val[key] === null) {
|
|
280
|
-
newVal
|
|
287
|
+
(0, LookupTable_1.writeOwnValue)(newVal, key, val[key]);
|
|
281
288
|
}
|
|
282
289
|
if (Array.isArray(val[key])) {
|
|
283
290
|
const arraySerialize = [];
|
|
284
291
|
for (const arrVal of val[key]) {
|
|
285
292
|
arraySerialize.push(this.serializeValue(arrVal));
|
|
286
293
|
}
|
|
287
|
-
newVal
|
|
294
|
+
(0, LookupTable_1.writeOwnValue)(newVal, key, arraySerialize);
|
|
288
295
|
}
|
|
289
296
|
else {
|
|
290
|
-
newVal
|
|
297
|
+
(0, LookupTable_1.writeOwnValue)(newVal, key, this.serializeValue(val[key]));
|
|
291
298
|
}
|
|
292
299
|
}
|
|
293
300
|
return newVal;
|
package/Types/Link.d.mts
CHANGED
package/Types/Link.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const MEANING_KEYS: ReadonlyArray<string>;
|
|
2
|
+
export declare const MEANING_KEY_PATTERN: RegExp;
|
|
3
|
+
export declare function getWordOfMeaningKey(text: string | undefined): string | undefined;
|
|
4
|
+
export declare function withMeaningKeyAsItsWord(text: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const MEANING_KEYS: ReadonlyArray<string>;
|
|
2
|
+
export declare const MEANING_KEY_PATTERN: RegExp;
|
|
3
|
+
export declare function getWordOfMeaningKey(text: string | undefined): string | undefined;
|
|
4
|
+
export declare function withMeaningKeyAsItsWord(text: string): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MEANING_KEY_PATTERN = exports.MEANING_KEYS = void 0;
|
|
4
|
+
exports.getWordOfMeaningKey = getWordOfMeaningKey;
|
|
5
|
+
exports.withMeaningKeyAsItsWord = withMeaningKeyAsItsWord;
|
|
6
|
+
/*
|
|
7
|
+
* KEYS THAT NAME THEIR MEANING.
|
|
8
|
+
*
|
|
9
|
+
* A key of the Dashboard's locales is its English text, so an English word
|
|
10
|
+
* that means two things is worded one way in each language, for every place
|
|
11
|
+
* that looks it up. "Open" is every Open button's verb, so an open invoice
|
|
12
|
+
* read "Abrir" ("open it") in Spanish; "View" is the View buttons' verb, so a
|
|
13
|
+
* database's view read "Ver"; "Change" is the Change buttons' verb, so a
|
|
14
|
+
* schema change read "Cambiar".
|
|
15
|
+
*
|
|
16
|
+
* Such a meaning takes a key of its own: the word, then what it means in
|
|
17
|
+
* brackets, for the translator - "Open (invoice status)", "View (database
|
|
18
|
+
* object)" - worded as that meaning in every language ("Pendiente",
|
|
19
|
+
* "Vista"). English reads the word alone, "Open" or "View", and so does a
|
|
20
|
+
* language whose locale has no wording of the key yet.
|
|
21
|
+
*
|
|
22
|
+
* The translator knows the keys listed here: wherever one is looked up with
|
|
23
|
+
* no wording of its own - Translator's translateText and translateTerm, a
|
|
24
|
+
* value of an English sentence, the front ends' translateString - it reads as
|
|
25
|
+
* its word. So such a key can be anything a key can be: a column's or a
|
|
26
|
+
* filter's title, a dropdown's option, a pill's text, drawn by any component.
|
|
27
|
+
*
|
|
28
|
+
* A key is listed here once its meaning is checked against every place that
|
|
29
|
+
* looks it up (App/Tests/Dashboard/OneMeaningPerKey). A key that only looks
|
|
30
|
+
* like one - "Description (optional)", "Retention (days)" - is not, and reads
|
|
31
|
+
* as its whole text.
|
|
32
|
+
*/
|
|
33
|
+
exports.MEANING_KEYS = [
|
|
34
|
+
// A data security issue that is still open (DataSecurityPills).
|
|
35
|
+
"Open (status)",
|
|
36
|
+
// An invoice that is issued and not paid yet (Settings > Invoices).
|
|
37
|
+
"Open (invoice status)",
|
|
38
|
+
// What an import did with a row (ImportResultWords).
|
|
39
|
+
"Created (import result)",
|
|
40
|
+
// A data asset's kind: a database's view and table (DataAssetKindWords).
|
|
41
|
+
"View (database object)",
|
|
42
|
+
"Table (database object)",
|
|
43
|
+
// The Schema Changes list's Change filter and column.
|
|
44
|
+
"Change (schema change)",
|
|
45
|
+
/*
|
|
46
|
+
* The storage array a hardware component or a volume is in: the storage
|
|
47
|
+
* widgets' column, a tile's row and the Sort setting's choice (#7522).
|
|
48
|
+
* The bare "Array" read as a programming array in six languages (配列,
|
|
49
|
+
* Matriz, Tableau, 배열, 数组, Matrise).
|
|
50
|
+
*/
|
|
51
|
+
"Array (storage array)",
|
|
52
|
+
];
|
|
53
|
+
// "<word> (<what it means>)": the word, and its meaning in brackets.
|
|
54
|
+
exports.MEANING_KEY_PATTERN = /^(\S(?:.*\S)?) \(([^()]+)\)$/;
|
|
55
|
+
const WORD_OF_MEANING_KEY = new Map(exports.MEANING_KEYS.map((key) => {
|
|
56
|
+
const match = key.match(exports.MEANING_KEY_PATTERN);
|
|
57
|
+
return [key, match ? match[1] : key];
|
|
58
|
+
}));
|
|
59
|
+
/*
|
|
60
|
+
* What a listed key reads as where the reader's language has no wording of
|
|
61
|
+
* its own: "Open" for "Open (invoice status)". Undefined for any other text,
|
|
62
|
+
* which reads as it is written.
|
|
63
|
+
*/
|
|
64
|
+
function getWordOfMeaningKey(text) {
|
|
65
|
+
if (typeof text !== "string" || text.length === 0) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
return WORD_OF_MEANING_KEY.get(text);
|
|
69
|
+
}
|
|
70
|
+
// The text as English draws it: a listed key's word, any other text itself.
|
|
71
|
+
function withMeaningKeyAsItsWord(text) {
|
|
72
|
+
var _a;
|
|
73
|
+
return (_a = getWordOfMeaningKey(text)) !== null && _a !== void 0 ? _a : text;
|
|
74
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import commonJsModule from "./MeaningKeys.js";
|
|
2
|
+
export const MEANING_KEYS = commonJsModule.MEANING_KEYS;
|
|
3
|
+
export const MEANING_KEY_PATTERN = commonJsModule.MEANING_KEY_PATTERN;
|
|
4
|
+
export const getWordOfMeaningKey = commonJsModule.getWordOfMeaningKey;
|
|
5
|
+
export const withMeaningKeyAsItsWord = commonJsModule.withMeaningKeyAsItsWord;
|
|
@@ -93,6 +93,7 @@ export declare enum WhoIsToldFix {
|
|
|
93
93
|
MonitorCriteria = "MonitorCriteria",
|
|
94
94
|
IncidentOnCallRules = "IncidentOnCallRules",
|
|
95
95
|
AlertOnCallRules = "AlertOnCallRules",
|
|
96
|
+
OnCallGuidedSetup = "OnCallGuidedSetup",
|
|
96
97
|
OnCallPolicy = "OnCallPolicy",
|
|
97
98
|
OnCallReadiness = "OnCallReadiness",
|
|
98
99
|
ProjectNotificationSettings = "ProjectNotificationSettings",
|
|
@@ -133,6 +134,7 @@ export declare function getWhoIsToldPersonReach(data: {
|
|
|
133
134
|
}>;
|
|
134
135
|
hasNoRule: boolean;
|
|
135
136
|
isOptedOut: boolean;
|
|
137
|
+
fallbackChannels: ReadonlyArray<OnCallPageChannel>;
|
|
136
138
|
verifiedChannels: ReadonlyArray<OnCallPageChannel>;
|
|
137
139
|
isFallbackEnabled: boolean;
|
|
138
140
|
channelsOff: ReadonlyArray<OnCallPageChannel>;
|
|
@@ -144,6 +146,7 @@ export declare function getWhoIsToldBreaks(data: {
|
|
|
144
146
|
channels: WhoIsToldChannels;
|
|
145
147
|
projectHasIncidentOnCallRules: boolean;
|
|
146
148
|
projectHasAlertOnCallRules: boolean;
|
|
149
|
+
projectHasOnCallPolicies: boolean;
|
|
147
150
|
}): Array<WhoIsToldBreak>;
|
|
148
151
|
export declare function redactWhoIsTold(data: {
|
|
149
152
|
result: WhoIsToldResult;
|
|
@@ -93,6 +93,7 @@ export declare enum WhoIsToldFix {
|
|
|
93
93
|
MonitorCriteria = "MonitorCriteria",
|
|
94
94
|
IncidentOnCallRules = "IncidentOnCallRules",
|
|
95
95
|
AlertOnCallRules = "AlertOnCallRules",
|
|
96
|
+
OnCallGuidedSetup = "OnCallGuidedSetup",
|
|
96
97
|
OnCallPolicy = "OnCallPolicy",
|
|
97
98
|
OnCallReadiness = "OnCallReadiness",
|
|
98
99
|
ProjectNotificationSettings = "ProjectNotificationSettings",
|
|
@@ -133,6 +134,7 @@ export declare function getWhoIsToldPersonReach(data: {
|
|
|
133
134
|
}>;
|
|
134
135
|
hasNoRule: boolean;
|
|
135
136
|
isOptedOut: boolean;
|
|
137
|
+
fallbackChannels: ReadonlyArray<OnCallPageChannel>;
|
|
136
138
|
verifiedChannels: ReadonlyArray<OnCallPageChannel>;
|
|
137
139
|
isFallbackEnabled: boolean;
|
|
138
140
|
channelsOff: ReadonlyArray<OnCallPageChannel>;
|
|
@@ -144,6 +146,7 @@ export declare function getWhoIsToldBreaks(data: {
|
|
|
144
146
|
channels: WhoIsToldChannels;
|
|
145
147
|
projectHasIncidentOnCallRules: boolean;
|
|
146
148
|
projectHasAlertOnCallRules: boolean;
|
|
149
|
+
projectHasOnCallPolicies: boolean;
|
|
147
150
|
}): Array<WhoIsToldBreak>;
|
|
148
151
|
export declare function redactWhoIsTold(data: {
|
|
149
152
|
result: WhoIsToldResult;
|
|
@@ -104,6 +104,12 @@ var WhoIsToldFix;
|
|
|
104
104
|
WhoIsToldFix["MonitorCriteria"] = "MonitorCriteria";
|
|
105
105
|
WhoIsToldFix["IncidentOnCallRules"] = "IncidentOnCallRules";
|
|
106
106
|
WhoIsToldFix["AlertOnCallRules"] = "AlertOnCallRules";
|
|
107
|
+
/*
|
|
108
|
+
* The project has no on-call policy yet, so an on-call rule would have
|
|
109
|
+
* nothing to page: the on-call guided setup makes the first policy, with
|
|
110
|
+
* the on-call rules that run it for every new incident and alert (#7369).
|
|
111
|
+
*/
|
|
112
|
+
WhoIsToldFix["OnCallGuidedSetup"] = "OnCallGuidedSetup";
|
|
107
113
|
WhoIsToldFix["OnCallPolicy"] = "OnCallPolicy";
|
|
108
114
|
WhoIsToldFix["OnCallReadiness"] = "OnCallReadiness";
|
|
109
115
|
WhoIsToldFix["ProjectNotificationSettings"] = "ProjectNotificationSettings";
|
|
@@ -161,9 +167,13 @@ function getChannelsSwitchedOff(channels) {
|
|
|
161
167
|
/*
|
|
162
168
|
* HOW A PAGE OF ONE SEVERITY REACHES ONE PERSON - as the real page does
|
|
163
169
|
* (UserOnCallLogService): through their rules for that kind and severity;
|
|
164
|
-
* with none,
|
|
165
|
-
*
|
|
166
|
-
*
|
|
170
|
+
* with none, unless the project turned the fallback off or they opted out
|
|
171
|
+
* of the severity, through what the fallback picks of their methods
|
|
172
|
+
* (UserNotificationRuleService.executeFallbackNotification): every free
|
|
173
|
+
* verified one, or else one paid one, or else a webhook (#7528). Listing
|
|
174
|
+
* every verified method there said a person with an email, a number and a
|
|
175
|
+
* phone was texted and called too, when a page only emails them. A channel
|
|
176
|
+
* the project switched off sends nothing.
|
|
167
177
|
*/
|
|
168
178
|
function getWhoIsToldPersonReach(data) {
|
|
169
179
|
if (data.hasNoRule && data.isOptedOut) {
|
|
@@ -182,9 +192,8 @@ function getWhoIsToldPersonReach(data) {
|
|
|
182
192
|
problem: WhoIsToldPersonProblem.NoRuleNoFallback,
|
|
183
193
|
};
|
|
184
194
|
}
|
|
185
|
-
const verified = [];
|
|
186
195
|
const candidates = data.hasNoRule
|
|
187
|
-
? data.
|
|
196
|
+
? data.fallbackChannels
|
|
188
197
|
: data.ruleMethods
|
|
189
198
|
.filter((method) => {
|
|
190
199
|
return method.isVerified;
|
|
@@ -192,12 +201,27 @@ function getWhoIsToldPersonReach(data) {
|
|
|
192
201
|
.map((method) => {
|
|
193
202
|
return method.channel;
|
|
194
203
|
});
|
|
195
|
-
|
|
196
|
-
if (!verified.includes(channel)) {
|
|
197
|
-
verified.push(channel);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
204
|
+
const verified = eachOnce(candidates);
|
|
200
205
|
if (verified.length === 0) {
|
|
206
|
+
/*
|
|
207
|
+
* The fallback picks nothing, while a method of theirs is verified on
|
|
208
|
+
* a channel the project switched off (a text number, with SMS off):
|
|
209
|
+
* the fallback skips a paid channel that is off, and would page them
|
|
210
|
+
* by it once it is on. That switch is the break, as it is for a rule.
|
|
211
|
+
*/
|
|
212
|
+
const switchedOff = data.hasNoRule
|
|
213
|
+
? eachOnce(data.verifiedChannels).filter((channel) => {
|
|
214
|
+
return data.channelsOff.includes(channel);
|
|
215
|
+
})
|
|
216
|
+
: [];
|
|
217
|
+
if (switchedOff.length > 0) {
|
|
218
|
+
return {
|
|
219
|
+
channels: switchedOff,
|
|
220
|
+
isFallback: true,
|
|
221
|
+
isReachable: false,
|
|
222
|
+
problem: WhoIsToldPersonProblem.ChannelsOff,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
201
225
|
return {
|
|
202
226
|
channels: [],
|
|
203
227
|
isFallback: data.hasNoRule,
|
|
@@ -222,6 +246,16 @@ function getWhoIsToldPersonReach(data) {
|
|
|
222
246
|
isReachable: true,
|
|
223
247
|
};
|
|
224
248
|
}
|
|
249
|
+
// Each channel once, in the order first met.
|
|
250
|
+
function eachOnce(channels) {
|
|
251
|
+
const once = [];
|
|
252
|
+
for (const channel of channels) {
|
|
253
|
+
if (!once.includes(channel)) {
|
|
254
|
+
once.push(channel);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return once;
|
|
258
|
+
}
|
|
225
259
|
// "incidents" or "alerts", in a sentence.
|
|
226
260
|
function recordsWord(kind) {
|
|
227
261
|
return kind === OnCallTestPage_1.OnCallTestPageRecordKind.Alert ? "alerts" : "incidents";
|
|
@@ -246,7 +280,9 @@ function getWhoIsToldBreakMessage(brk) {
|
|
|
246
280
|
case WhoIsToldBreakKind.NothingHappens:
|
|
247
281
|
return "No criteria of this monitor changes its status or opens an incident or an alert, so nobody is told when it goes down. Add one on the Criteria page.";
|
|
248
282
|
case WhoIsToldBreakKind.NobodyPaged:
|
|
249
|
-
return
|
|
283
|
+
return brk.fix === WhoIsToldFix.OnCallGuidedSetup
|
|
284
|
+
? "Nobody is paged: this project has no on-call policy yet. Set up paging to make one that pages someone for every new incident and alert."
|
|
285
|
+
: `Nobody is paged: no on-call rule matches ${recordsWord(brk.recordKind)} from this monitor, and its criteria names no on-call policy. Add an on-call rule for ${recordsWord(brk.recordKind)}.`;
|
|
250
286
|
case WhoIsToldBreakKind.OnlyIncidentsHaveRules:
|
|
251
287
|
return "Nobody is paged for this monitor's alerts: only incidents have on-call rules. Add an on-call rule for alerts, or have the criteria open an incident.";
|
|
252
288
|
case WhoIsToldBreakKind.PolicyHasNoLevels:
|
|
@@ -311,7 +347,10 @@ function getChannelsInUse(criteria) {
|
|
|
311
347
|
*
|
|
312
348
|
* `projectHasIncidentOnCallRules` tells a monitor that opens alerts while
|
|
313
349
|
* only incidents have on-call rules (the most common silent break) from one
|
|
314
|
-
* that has no rules at all.
|
|
350
|
+
* that has no rules at all. `projectHasOnCallPolicies` tells a project with
|
|
351
|
+
* no on-call policy yet - whose fix is the on-call guided setup, which
|
|
352
|
+
* makes the first one with the rules that run it - from one whose rules
|
|
353
|
+
* leave this monitor out (#7369): an on-call rule needs a policy to page.
|
|
315
354
|
*/
|
|
316
355
|
function getWhoIsToldBreaks(data) {
|
|
317
356
|
const breaks = [];
|
|
@@ -336,7 +375,18 @@ function getWhoIsToldBreaks(data) {
|
|
|
336
375
|
for (const item of data.criteria) {
|
|
337
376
|
for (const event of item.events) {
|
|
338
377
|
if (event.policies.length === 0) {
|
|
339
|
-
if (
|
|
378
|
+
if (!data.projectHasOnCallPolicies) {
|
|
379
|
+
/*
|
|
380
|
+
* No policy at all: whatever rules the project has page nothing,
|
|
381
|
+
* so the first policy is what is missing (#7369).
|
|
382
|
+
*/
|
|
383
|
+
add({
|
|
384
|
+
kind: WhoIsToldBreakKind.NobodyPaged,
|
|
385
|
+
fix: WhoIsToldFix.OnCallGuidedSetup,
|
|
386
|
+
recordKind: event.kind,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
else if (event.kind === OnCallTestPage_1.OnCallTestPageRecordKind.Alert &&
|
|
340
390
|
data.projectHasIncidentOnCallRules &&
|
|
341
391
|
!data.projectHasAlertOnCallRules) {
|
|
342
392
|
add({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const NO_BREAK_SPACE: string;
|
|
2
|
+
export declare const NARROW_NO_BREAK_SPACE: string;
|
|
3
|
+
export declare const setsPunctuationApart: (language: string | null | undefined) => boolean;
|
|
4
|
+
export declare const withFrenchSpacing: (words: string) => string;
|
|
5
|
+
export declare const withFrenchSpacingInHtml: (html: string) => string;
|
|
6
|
+
export declare const withNumbersKeptWithUnits: (words: string, english: string) => string;
|
|
7
|
+
export declare const withNoBreakSpaces: (words: string, english: string, language: string | null | undefined) => string;
|
|
8
|
+
export type NoBreakLocaleTree = {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
export interface NoBreakLocaleInput {
|
|
12
|
+
locale: NoBreakLocaleTree;
|
|
13
|
+
language: string;
|
|
14
|
+
english?: NoBreakLocaleTree | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare const withNoBreakSpacesInLocale: (input: NoBreakLocaleInput) => NoBreakLocaleTree;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const NO_BREAK_SPACE: string;
|
|
2
|
+
export declare const NARROW_NO_BREAK_SPACE: string;
|
|
3
|
+
export declare const setsPunctuationApart: (language: string | null | undefined) => boolean;
|
|
4
|
+
export declare const withFrenchSpacing: (words: string) => string;
|
|
5
|
+
export declare const withFrenchSpacingInHtml: (html: string) => string;
|
|
6
|
+
export declare const withNumbersKeptWithUnits: (words: string, english: string) => string;
|
|
7
|
+
export declare const withNoBreakSpaces: (words: string, english: string, language: string | null | undefined) => string;
|
|
8
|
+
export type NoBreakLocaleTree = {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
export interface NoBreakLocaleInput {
|
|
12
|
+
locale: NoBreakLocaleTree;
|
|
13
|
+
language: string;
|
|
14
|
+
english?: NoBreakLocaleTree | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare const withNoBreakSpacesInLocale: (input: NoBreakLocaleInput) => NoBreakLocaleTree;
|