@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,32 @@
|
|
|
1
|
+
import { RefusalWithValues } from "../Exception/RefusalWithValues";
|
|
2
|
+
export declare const DataCheckFromSentenceRefusal: {
|
|
3
|
+
noRule: string;
|
|
4
|
+
tableNotFound: string;
|
|
5
|
+
engineNotChecked: string;
|
|
6
|
+
answerNotACheck: string;
|
|
7
|
+
queryNamesNoValue: string;
|
|
8
|
+
pipelineNamesNoValue: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const RULE_NOT_A_CHECK_REFUSAL: RefusalWithValues;
|
|
11
|
+
export declare const CHECK_NOT_WRITTEN_REFUSAL: RefusalWithValues;
|
|
12
|
+
export declare const CustomSqlRefusal: {
|
|
13
|
+
noQuery: string;
|
|
14
|
+
tooLong: string;
|
|
15
|
+
notSingleQuery: string;
|
|
16
|
+
notARead: string;
|
|
17
|
+
writes: string;
|
|
18
|
+
dataverseNoWith: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const MongoPipelineRefusal: {
|
|
21
|
+
noPipeline: string;
|
|
22
|
+
tooLong: string;
|
|
23
|
+
notJson: string;
|
|
24
|
+
writes: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const DataReconciliationRefusal: {
|
|
27
|
+
notFound: string;
|
|
28
|
+
sourceNeedsTable: string;
|
|
29
|
+
targetNeedsTable: string;
|
|
30
|
+
missingStatuses: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const DATA_CHECK_REFUSALS_WITH_VALUES: ReadonlyArray<RefusalWithValues>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DATA_CHECK_REFUSALS_WITH_VALUES = exports.DataReconciliationRefusal = exports.MongoPipelineRefusal = exports.CustomSqlRefusal = exports.CHECK_NOT_WRITTEN_REFUSAL = exports.RULE_NOT_A_CHECK_REFUSAL = exports.DataCheckFromSentenceRefusal = void 0;
|
|
4
|
+
const Translator_1 = require("../Translator");
|
|
5
|
+
/*
|
|
6
|
+
* WHY A DATA CHECK OR A RECONCILIATION WAS NOT WRITTEN, ADDED OR SET UP
|
|
7
|
+
* (#7530).
|
|
8
|
+
*
|
|
9
|
+
* The server refuses in these English sentences: an API client, the CLI
|
|
10
|
+
* and Terraform read them as they are. Write a Check from a Sentence,
|
|
11
|
+
* Suggested Checks and the Reconciliations page show them under their
|
|
12
|
+
* buttons, where they read English on every page. Each is a key of the
|
|
13
|
+
* Dashboard's locales now (this file is a "keys" root of its string
|
|
14
|
+
* extractor), so the Dashboard says it in the reader's language
|
|
15
|
+
* (ErrorLine, Common/UI/Utils/ErrorInSentence).
|
|
16
|
+
*
|
|
17
|
+
* Two carry a value: why the model could not make the rule a check, and
|
|
18
|
+
* why its answer could not be run. They are RefusalWithValues: the
|
|
19
|
+
* Dashboard reads the value back out of the English and says the sentence
|
|
20
|
+
* in the reader's language around it. The model writes its own why in the
|
|
21
|
+
* reader's language (DataCheckFromSentence's language line), and a why of
|
|
22
|
+
* OneUptime's own - one of the sentences below - is looked up as a key.
|
|
23
|
+
*
|
|
24
|
+
* React-free and server-safe: the server throws these, the Dashboard reads
|
|
25
|
+
* them.
|
|
26
|
+
*/
|
|
27
|
+
// Write a Check from a Sentence (DataCheckFromSentence).
|
|
28
|
+
exports.DataCheckFromSentenceRefusal = {
|
|
29
|
+
noRule: (0, Translator_1.translationKey)("Say the rule the check should hold to."),
|
|
30
|
+
tableNotFound: (0, Translator_1.translationKey)("The table was not found."),
|
|
31
|
+
engineNotChecked: (0, Translator_1.translationKey)("Data Observability does not run checks on this table's database."),
|
|
32
|
+
answerNotACheck: (0, Translator_1.translationKey)("The AI's answer was not a check. Say the rule another way, or write the check yourself."),
|
|
33
|
+
queryNamesNoValue: (0, Translator_1.translationKey)("The AI's query does not name its number value. Say the rule another way, or write the check yourself."),
|
|
34
|
+
pipelineNamesNoValue: (0, Translator_1.translationKey)("The AI's pipeline does not name its number value. Say the rule another way, or write the check yourself."),
|
|
35
|
+
};
|
|
36
|
+
/*
|
|
37
|
+
* The model said the rule cannot be checked with the table's columns, and
|
|
38
|
+
* why: in the reader's language, as it was asked to write it.
|
|
39
|
+
*/
|
|
40
|
+
exports.RULE_NOT_A_CHECK_REFUSAL = {
|
|
41
|
+
template: (0, Translator_1.translationKey)("The rule could not be made a check: {{reason}}"),
|
|
42
|
+
terms: [],
|
|
43
|
+
};
|
|
44
|
+
/*
|
|
45
|
+
* The model answered twice with something OneUptime cannot run. The reason
|
|
46
|
+
* is OneUptime's own sentence for what was wrong with the last answer (one
|
|
47
|
+
* of the sentences in this file), said in the reader's language too.
|
|
48
|
+
*/
|
|
49
|
+
exports.CHECK_NOT_WRITTEN_REFUSAL = {
|
|
50
|
+
template: (0, Translator_1.translationKey)("OneUptime AI could not write a check OneUptime can run for that rule ({{reason}}) Say it another way, or write the check yourself."),
|
|
51
|
+
terms: ["reason"],
|
|
52
|
+
};
|
|
53
|
+
// Why a Custom SQL check's query is refused before it is sent (checkCustomSql).
|
|
54
|
+
exports.CustomSqlRefusal = {
|
|
55
|
+
noQuery: (0, Translator_1.translationKey)("Custom SQL needs a query."),
|
|
56
|
+
tooLong: (0, Translator_1.translationKey)("Custom SQL is too long."),
|
|
57
|
+
notSingleQuery: (0, Translator_1.translationKey)("Custom SQL must be a single query."),
|
|
58
|
+
notARead: (0, Translator_1.translationKey)("Custom SQL must start with SELECT or WITH."),
|
|
59
|
+
writes: (0, Translator_1.translationKey)("Custom SQL may only read."),
|
|
60
|
+
dataverseNoWith: (0, Translator_1.translationKey)("Dataverse's SQL has no WITH: write the query as one SELECT, with a subquery where it needs one."),
|
|
61
|
+
};
|
|
62
|
+
// Why a MongoDB custom check's pipeline is refused (checkMongoPipeline).
|
|
63
|
+
exports.MongoPipelineRefusal = {
|
|
64
|
+
noPipeline: (0, Translator_1.translationKey)("A custom check needs an aggregation pipeline."),
|
|
65
|
+
tooLong: (0, Translator_1.translationKey)("The aggregation pipeline is too long."),
|
|
66
|
+
notJson: (0, Translator_1.translationKey)('A MongoDB custom check is an aggregation pipeline as JSON: [{ "$match": ... }, { "$count": "value" }].'),
|
|
67
|
+
writes: (0, Translator_1.translationKey)("The aggregation pipeline may only read: no $out, $merge, $function, $accumulator or $where."),
|
|
68
|
+
};
|
|
69
|
+
// Why a reconciliation's checks and monitor were not set up (DataReconciliationSync).
|
|
70
|
+
exports.DataReconciliationRefusal = {
|
|
71
|
+
notFound: (0, Translator_1.translationKey)("Reconciliation not found."),
|
|
72
|
+
sourceNeedsTable: (0, Translator_1.translationKey)("The reconciliation's source needs a table."),
|
|
73
|
+
targetNeedsTable: (0, Translator_1.translationKey)("The reconciliation's target needs a table."),
|
|
74
|
+
missingStatuses: (0, Translator_1.translationKey)("This project is missing an operational or offline monitor status, or an incident or alert severity. Add them in Settings, then save the reconciliation again."),
|
|
75
|
+
};
|
|
76
|
+
// The refusals with a value in them, for the Dashboard to read back.
|
|
77
|
+
exports.DATA_CHECK_REFUSALS_WITH_VALUES = [exports.RULE_NOT_A_CHECK_REFUSAL, exports.CHECK_NOT_WRITTEN_REFUSAL];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import commonJsModule from "./DataCheckRefusals.js";
|
|
2
|
+
export const CHECK_NOT_WRITTEN_REFUSAL = commonJsModule.CHECK_NOT_WRITTEN_REFUSAL;
|
|
3
|
+
export const CustomSqlRefusal = commonJsModule.CustomSqlRefusal;
|
|
4
|
+
export const DATA_CHECK_REFUSALS_WITH_VALUES = commonJsModule.DATA_CHECK_REFUSALS_WITH_VALUES;
|
|
5
|
+
export const DataCheckFromSentenceRefusal = commonJsModule.DataCheckFromSentenceRefusal;
|
|
6
|
+
export const DataReconciliationRefusal = commonJsModule.DataReconciliationRefusal;
|
|
7
|
+
export const MongoPipelineRefusal = commonJsModule.MongoPipelineRefusal;
|
|
8
|
+
export const RULE_NOT_A_CHECK_REFUSAL = commonJsModule.RULE_NOT_A_CHECK_REFUSAL;
|
|
@@ -123,6 +123,7 @@ const NARROWED_BY_LABELS_AND_OWNERS = [
|
|
|
123
123
|
Permission_1.default.CreateIncidentMember,
|
|
124
124
|
Permission_1.default.CreateIncidentOwnerTeam,
|
|
125
125
|
Permission_1.default.CreateIncidentOwnerUser,
|
|
126
|
+
Permission_1.default.CreateIncidentPostmortemActionItem,
|
|
126
127
|
Permission_1.default.CreateIncidentPublicNote,
|
|
127
128
|
Permission_1.default.CreateIncidentSla,
|
|
128
129
|
Permission_1.default.CreateIncidentStateTimeline,
|
|
@@ -309,6 +310,7 @@ const NARROWED_BY_LABELS_AND_OWNERS = [
|
|
|
309
310
|
Permission_1.default.DeleteIncidentMember,
|
|
310
311
|
Permission_1.default.DeleteIncidentOwnerTeam,
|
|
311
312
|
Permission_1.default.DeleteIncidentOwnerUser,
|
|
313
|
+
Permission_1.default.DeleteIncidentPostmortemActionItem,
|
|
312
314
|
Permission_1.default.DeleteIncidentPublicNote,
|
|
313
315
|
Permission_1.default.DeleteIncidentSla,
|
|
314
316
|
Permission_1.default.DeleteIncidentStateTimeline,
|
|
@@ -482,6 +484,7 @@ const NARROWED_BY_LABELS_AND_OWNERS = [
|
|
|
482
484
|
Permission_1.default.EditIncidentMember,
|
|
483
485
|
Permission_1.default.EditIncidentOwnerTeam,
|
|
484
486
|
Permission_1.default.EditIncidentOwnerUser,
|
|
487
|
+
Permission_1.default.EditIncidentPostmortemActionItem,
|
|
485
488
|
Permission_1.default.EditIncidentPublicNote,
|
|
486
489
|
Permission_1.default.EditIncidentSla,
|
|
487
490
|
Permission_1.default.EditIncidentStateTimeline,
|
|
@@ -651,6 +654,7 @@ const NARROWED_BY_LABELS_AND_OWNERS = [
|
|
|
651
654
|
Permission_1.default.ReadIncidentInternalNote,
|
|
652
655
|
Permission_1.default.ReadIncidentMeasurementValue,
|
|
653
656
|
Permission_1.default.ReadIncidentMember,
|
|
657
|
+
Permission_1.default.ReadIncidentPostmortemActionItem,
|
|
654
658
|
Permission_1.default.ReadIncidentPublicNote,
|
|
655
659
|
Permission_1.default.ReadIncidentSla,
|
|
656
660
|
Permission_1.default.ReadIncidentStateTimeline,
|
package/Types/Date.d.mts
CHANGED
|
@@ -334,6 +334,7 @@ export default class OneUptimeDate {
|
|
|
334
334
|
static areOnTheSameWeek(date1: Date, date2: Date): boolean;
|
|
335
335
|
static addRemoveMinutes(date: Date, minutes: number): Date;
|
|
336
336
|
static addRemoveDays(date: Date, days: number, timezone?: string | undefined): Date;
|
|
337
|
+
static addRemoveDurationInDays(date: Date, days: number): Date;
|
|
337
338
|
static addRemoveHours(date: Date, hours: number): Date;
|
|
338
339
|
static addRemoveYears(date: Date, years: number, timezone?: string | undefined): Date;
|
|
339
340
|
static addRemoveMonths(date: Date, months: number, timezone?: string | undefined): Date;
|
|
@@ -371,6 +372,7 @@ export default class OneUptimeDate {
|
|
|
371
372
|
static getStartOfDay(date: Date, timezone?: string | undefined): Date;
|
|
372
373
|
static getEndOfDay(date: Date, timezone?: string | undefined): Date;
|
|
373
374
|
static getStartOfMinute(date: Date | string): Date;
|
|
375
|
+
static getEndOfMinute(date: Date | string): Date;
|
|
374
376
|
private static toMomentCalendarUnit;
|
|
375
377
|
private static inTimezone;
|
|
376
378
|
static getStartOfCalendarUnit(date: Date, unit: CalendarUnit, timezone?: string | undefined): Date;
|
package/Types/Date.d.ts
CHANGED
|
@@ -334,6 +334,7 @@ export default class OneUptimeDate {
|
|
|
334
334
|
static areOnTheSameWeek(date1: Date, date2: Date): boolean;
|
|
335
335
|
static addRemoveMinutes(date: Date, minutes: number): Date;
|
|
336
336
|
static addRemoveDays(date: Date, days: number, timezone?: string | undefined): Date;
|
|
337
|
+
static addRemoveDurationInDays(date: Date, days: number): Date;
|
|
337
338
|
static addRemoveHours(date: Date, hours: number): Date;
|
|
338
339
|
static addRemoveYears(date: Date, years: number, timezone?: string | undefined): Date;
|
|
339
340
|
static addRemoveMonths(date: Date, months: number, timezone?: string | undefined): Date;
|
|
@@ -371,6 +372,7 @@ export default class OneUptimeDate {
|
|
|
371
372
|
static getStartOfDay(date: Date, timezone?: string | undefined): Date;
|
|
372
373
|
static getEndOfDay(date: Date, timezone?: string | undefined): Date;
|
|
373
374
|
static getStartOfMinute(date: Date | string): Date;
|
|
375
|
+
static getEndOfMinute(date: Date | string): Date;
|
|
374
376
|
private static toMomentCalendarUnit;
|
|
375
377
|
private static inTimezone;
|
|
376
378
|
static getStartOfCalendarUnit(date: Date, unit: CalendarUnit, timezone?: string | undefined): Date;
|
package/Types/Date.js
CHANGED
|
@@ -1415,6 +1415,18 @@ class OneUptimeDate {
|
|
|
1415
1415
|
}
|
|
1416
1416
|
return (0, moment_timezone_1.default)(date).add(days, "days").toDate();
|
|
1417
1417
|
}
|
|
1418
|
+
/*
|
|
1419
|
+
* `days` days as a length of time: days x 24 hours, the same in every
|
|
1420
|
+
* zone. For a range such as "the last 7 days" of a read, which is a span
|
|
1421
|
+
* of time rather than calendar days somewhere. addRemoveDays without a
|
|
1422
|
+
* zone steps the server's calendar, so on a server outside UTC a week
|
|
1423
|
+
* that crosses a clock change comes out an hour short or long (issue
|
|
1424
|
+
* #7623).
|
|
1425
|
+
*/
|
|
1426
|
+
static addRemoveDurationInDays(date, days) {
|
|
1427
|
+
date = this.fromString(date);
|
|
1428
|
+
return new Date(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1429
|
+
}
|
|
1418
1430
|
static addRemoveHours(date, hours) {
|
|
1419
1431
|
date = this.fromString(date);
|
|
1420
1432
|
return (0, moment_timezone_1.default)(date).add(hours, "hours").toDate();
|
|
@@ -1682,6 +1694,16 @@ class OneUptimeDate {
|
|
|
1682
1694
|
return new Date(Math.floor(instant.getTime() / millisecondsInAMinute) *
|
|
1683
1695
|
millisecondsInAMinute);
|
|
1684
1696
|
}
|
|
1697
|
+
/*
|
|
1698
|
+
* The last millisecond of the minute `date` falls in: 11:15:59.999 for
|
|
1699
|
+
* anything from 11:15:00.000 on, as getEndOfDay is a day's 23:59:59.999.
|
|
1700
|
+
* With getStartOfMinute, the whole minute a field shows (11:15), so a
|
|
1701
|
+
* filter on "11:15" holds a row stamped 11:15:42 (#7719).
|
|
1702
|
+
*/
|
|
1703
|
+
static getEndOfMinute(date) {
|
|
1704
|
+
const millisecondsInAMinute = 60 * 1000;
|
|
1705
|
+
return new Date(this.getStartOfMinute(date).getTime() + millisecondsInAMinute - 1);
|
|
1706
|
+
}
|
|
1685
1707
|
/*
|
|
1686
1708
|
* Calendar arithmetic - "the previous calendar month", "add 3 calendar
|
|
1687
1709
|
* months" - as opposed to the fixed-length arithmetic the rest of this class
|
package/Types/DateLanguage.d.mts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const formatDateText: (data: {
|
|
|
46
46
|
shape: DateTextShape;
|
|
47
47
|
}) => string | null;
|
|
48
48
|
export type RelativeDateUnit = "second" | "minute" | "hour" | "day" | "month" | "year";
|
|
49
|
+
export type RelativeDateStyle = "long" | "short" | "narrow";
|
|
49
50
|
export interface RelativeDistance {
|
|
50
51
|
isNow: boolean;
|
|
51
52
|
count: number;
|
|
@@ -63,6 +64,7 @@ export declare const formatRelativeAmount: (data: {
|
|
|
63
64
|
unit: RelativeDateUnit;
|
|
64
65
|
isFuture: boolean;
|
|
65
66
|
locale: string;
|
|
67
|
+
style?: RelativeDateStyle | undefined;
|
|
66
68
|
}) => string | null;
|
|
67
69
|
export type DurationTextUnit = "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond";
|
|
68
70
|
export interface DurationTextPart {
|
package/Types/DateLanguage.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const formatDateText: (data: {
|
|
|
46
46
|
shape: DateTextShape;
|
|
47
47
|
}) => string | null;
|
|
48
48
|
export type RelativeDateUnit = "second" | "minute" | "hour" | "day" | "month" | "year";
|
|
49
|
+
export type RelativeDateStyle = "long" | "short" | "narrow";
|
|
49
50
|
export interface RelativeDistance {
|
|
50
51
|
isNow: boolean;
|
|
51
52
|
count: number;
|
|
@@ -63,6 +64,7 @@ export declare const formatRelativeAmount: (data: {
|
|
|
63
64
|
unit: RelativeDateUnit;
|
|
64
65
|
isFuture: boolean;
|
|
65
66
|
locale: string;
|
|
67
|
+
style?: RelativeDateStyle | undefined;
|
|
66
68
|
}) => string | null;
|
|
67
69
|
export type DurationTextUnit = "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond";
|
|
68
70
|
export interface DurationTextPart {
|
package/Types/DateLanguage.js
CHANGED
|
@@ -474,8 +474,8 @@ const formatDateText = (data) => {
|
|
|
474
474
|
};
|
|
475
475
|
exports.formatDateText = formatDateText;
|
|
476
476
|
const relativeTimeFormatCache = new Map();
|
|
477
|
-
const getRelativeTimeFormatter = (locale, numeric) => {
|
|
478
|
-
const key = `${locale}|${numeric}`;
|
|
477
|
+
const getRelativeTimeFormatter = (locale, numeric, style = "long") => {
|
|
478
|
+
const key = `${locale}|${numeric}|${style}`;
|
|
479
479
|
if (relativeTimeFormatCache.has(key)) {
|
|
480
480
|
return relativeTimeFormatCache.get(key) || null;
|
|
481
481
|
}
|
|
@@ -485,7 +485,7 @@ const getRelativeTimeFormatter = (locale, numeric) => {
|
|
|
485
485
|
if (RelativeTimeFormat) {
|
|
486
486
|
formatter = new RelativeTimeFormat((0, exports.getNumberLocale)(locale) || locale, {
|
|
487
487
|
numeric: numeric,
|
|
488
|
-
style:
|
|
488
|
+
style: style,
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
491
|
}
|
|
@@ -574,10 +574,13 @@ exports.formatRelativeDate = formatRelativeDate;
|
|
|
574
574
|
* "in 2 Stunden", "قبل 3 أيام" - `count` `unit`s ahead of now, or behind it
|
|
575
575
|
* when `isFuture` is false, in `locale`: for a caller that counts its own
|
|
576
576
|
* units (a maintenance window's "in 2 hours", its minutes floored). Null
|
|
577
|
-
* when this engine has no Intl.RelativeTimeFormat.
|
|
577
|
+
* when this engine has no Intl.RelativeTimeFormat. `style` "short" writes
|
|
578
|
+
* the unit as its language shortens it, for a narrow column: "vor 5 Min.",
|
|
579
|
+
* "il y a 5 min"; "long" when left out. A count of 0 behind now is the
|
|
580
|
+
* past: "vor 0 Sek.", never "in 0 Sek.".
|
|
578
581
|
*/
|
|
579
582
|
const formatRelativeAmount = (data) => {
|
|
580
|
-
const always = getRelativeTimeFormatter(data.locale, "always");
|
|
583
|
+
const always = getRelativeTimeFormatter(data.locale, "always", data.style || "long");
|
|
581
584
|
if (!always) {
|
|
582
585
|
return null;
|
|
583
586
|
}
|
|
@@ -4,6 +4,7 @@ declare enum EmailTemplateType {
|
|
|
4
4
|
MagicLink = "MagicLink.hbs",
|
|
5
5
|
ProbeOffline = "ProbeOffline.hbs",
|
|
6
6
|
SignupWelcomeEmail = "SignupWelcomeEmail.hbs",
|
|
7
|
+
SignupAccountReadyEmail = "SignupAccountReadyEmail.hbs",
|
|
7
8
|
CompleteRegistration = "CompleteRegistration.hbs",
|
|
8
9
|
ConfirmProjectSsoSignIn = "ConfirmProjectSsoSignIn.hbs",
|
|
9
10
|
ProbeConnectionStatusChange = "ProbeConnectionStatusChange.hbs",
|
|
@@ -4,6 +4,7 @@ declare enum EmailTemplateType {
|
|
|
4
4
|
MagicLink = "MagicLink.hbs",
|
|
5
5
|
ProbeOffline = "ProbeOffline.hbs",
|
|
6
6
|
SignupWelcomeEmail = "SignupWelcomeEmail.hbs",
|
|
7
|
+
SignupAccountReadyEmail = "SignupAccountReadyEmail.hbs",
|
|
7
8
|
CompleteRegistration = "CompleteRegistration.hbs",
|
|
8
9
|
ConfirmProjectSsoSignIn = "ConfirmProjectSsoSignIn.hbs",
|
|
9
10
|
ProbeConnectionStatusChange = "ProbeConnectionStatusChange.hbs",
|
|
@@ -8,6 +8,8 @@ var EmailTemplateType;
|
|
|
8
8
|
EmailTemplateType["MagicLink"] = "MagicLink.hbs";
|
|
9
9
|
EmailTemplateType["ProbeOffline"] = "ProbeOffline.hbs";
|
|
10
10
|
EmailTemplateType["SignupWelcomeEmail"] = "SignupWelcomeEmail.hbs";
|
|
11
|
+
// The welcome of an account that is ready at sign-up (self-hosted): nothing to verify.
|
|
12
|
+
EmailTemplateType["SignupAccountReadyEmail"] = "SignupAccountReadyEmail.hbs";
|
|
11
13
|
EmailTemplateType["CompleteRegistration"] = "CompleteRegistration.hbs";
|
|
12
14
|
EmailTemplateType["ConfirmProjectSsoSignIn"] = "ConfirmProjectSsoSignIn.hbs";
|
|
13
15
|
EmailTemplateType["ProbeConnectionStatusChange"] = "ProbeConnectionStatusChange.hbs";
|
|
@@ -15,7 +15,7 @@ const BadDataException_1 = __importDefault(require("./BadDataException"));
|
|
|
15
15
|
* names. That is correct, and this type does not weaken it.
|
|
16
16
|
*
|
|
17
17
|
* What it fixes is the collateral damage. Callers downstream had nothing but
|
|
18
|
-
* that sanitized string to reason about, so
|
|
18
|
+
* that sanitized string to reason about, so RequestFailedDetailsUtil.getRequestFailedDetails matched
|
|
19
19
|
* none of its patterns and reported monitor failures as "Unknown" with no
|
|
20
20
|
* actionable detail. Carrying the STAGE on the exception restores the one bit
|
|
21
21
|
* every caller legitimately needs without reopening the oracle: when detail is
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const EMPTY_ERROR_PHRASES: ReadonlyArray<string>;
|
|
2
2
|
export declare const isEmptyErrorPhrase: (message: string | undefined | null) => boolean;
|
|
3
|
+
export declare const isErrorPage: (message: string | undefined | null) => boolean;
|
|
3
4
|
export declare const isErrorSentence: (message: string | undefined | null) => boolean;
|
|
4
5
|
export declare const meetsErrorMessageRule: (message: string | undefined | null) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const EMPTY_ERROR_PHRASES: ReadonlyArray<string>;
|
|
2
2
|
export declare const isEmptyErrorPhrase: (message: string | undefined | null) => boolean;
|
|
3
|
+
export declare const isErrorPage: (message: string | undefined | null) => boolean;
|
|
3
4
|
export declare const isErrorSentence: (message: string | undefined | null) => boolean;
|
|
4
5
|
export declare const meetsErrorMessageRule: (message: string | undefined | null) => boolean;
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The UI uses the first to treat an empty answer from the server as one the
|
|
14
14
|
* server did not explain (API.getFriendlyMessage), and ErrorMessagesGuard
|
|
15
|
-
* holds every message the code throws to both.
|
|
15
|
+
* holds every message the code throws to both. Both read a message in any
|
|
16
|
+
* script: a message in Persian, Japanese or Hindi says something (#7536).
|
|
17
|
+
* React-free and server-safe.
|
|
16
18
|
*/
|
|
17
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.meetsErrorMessageRule = exports.isErrorSentence = exports.isEmptyErrorPhrase = exports.EMPTY_ERROR_PHRASES = void 0;
|
|
20
|
+
exports.meetsErrorMessageRule = exports.isErrorSentence = exports.isErrorPage = exports.isEmptyErrorPhrase = exports.EMPTY_ERROR_PHRASES = void 0;
|
|
19
21
|
/*
|
|
20
22
|
* The phrases that say only that something failed. Compared without case,
|
|
21
23
|
* without the punctuation around them and without a trailing "Please try
|
|
@@ -48,18 +50,40 @@ const TRAILING_TRY_AGAIN = [
|
|
|
48
50
|
"try again later",
|
|
49
51
|
"try again",
|
|
50
52
|
];
|
|
53
|
+
/*
|
|
54
|
+
* A letter of any script (#7536). It used to be a character whose upper and
|
|
55
|
+
* lower case differ, which only Latin, Greek, Cyrillic and a few other
|
|
56
|
+
* scripts have: a message written in Arabic, Persian, Hebrew, Chinese,
|
|
57
|
+
* Japanese, Korean, Hindi or Thai had no letters at all, so it read as an
|
|
58
|
+
* empty message and was replaced with the English sentence for a failure
|
|
59
|
+
* nobody explained. Each test reads one character, in linear time.
|
|
60
|
+
*/
|
|
61
|
+
const LETTER = /^\p{L}$/u;
|
|
62
|
+
// A digit of any script: "404", Arabic-Indic "٤٠٤", full-width "503".
|
|
63
|
+
const DIGIT = /^\p{Nd}$/u;
|
|
64
|
+
/*
|
|
65
|
+
* What else a word is written with: any other number ("½", "Ⅻ") and the
|
|
66
|
+
* marks a letter carries (Hindi's and Thai's vowel signs, Arabic's
|
|
67
|
+
* harakat), so a word in those scripts is not cut in pieces.
|
|
68
|
+
*/
|
|
69
|
+
const NUMBER_OR_MARK = /^[\p{N}\p{M}]$/u;
|
|
51
70
|
const isLetter = (character) => {
|
|
52
|
-
return
|
|
71
|
+
return LETTER.test(character);
|
|
72
|
+
};
|
|
73
|
+
const isDigit = (character) => {
|
|
74
|
+
return DIGIT.test(character);
|
|
53
75
|
};
|
|
54
76
|
/*
|
|
55
77
|
* The words of a message, lower case, with everything that is not a letter,
|
|
56
|
-
* a
|
|
57
|
-
* something went wrong." reads "oops something went wrong".
|
|
78
|
+
* a number, a mark or a space turned into a space and the spaces squeezed:
|
|
79
|
+
* "Oops, something went wrong." reads "oops something went wrong". A message
|
|
80
|
+
* of punctuation and symbols alone ("...", "—", "❌") has no words, so it
|
|
81
|
+
* says nothing in any language.
|
|
58
82
|
*/
|
|
59
83
|
const toWords = (message) => {
|
|
60
84
|
let words = "";
|
|
61
85
|
for (const character of message.toLowerCase()) {
|
|
62
|
-
const isWordCharacter = isLetter(character) || (character
|
|
86
|
+
const isWordCharacter = isLetter(character) || NUMBER_OR_MARK.test(character);
|
|
63
87
|
words += isWordCharacter ? character : " ";
|
|
64
88
|
}
|
|
65
89
|
return words.split(" ").filter(Boolean).join(" ");
|
|
@@ -83,19 +107,47 @@ const isEmptyErrorPhrase = (message) => {
|
|
|
83
107
|
return words.length === 0 || exports.EMPTY_ERROR_PHRASES.includes(words);
|
|
84
108
|
};
|
|
85
109
|
exports.isEmptyErrorPhrase = isEmptyErrorPhrase;
|
|
110
|
+
/*
|
|
111
|
+
* Whether the "message" is a page rather than a message: the HTML (or XML)
|
|
112
|
+
* a gateway, a proxy or a web server answers with - nginx's "<html><head>
|
|
113
|
+
* <title>502 Bad Gateway</title>...", a load balancer's 503, a CDN's error
|
|
114
|
+
* page, the app's own index.html on a route that is not the API's. It
|
|
115
|
+
* starts with a tag or a doctype and ends with a tag. Its words are markup
|
|
116
|
+
* and a server's name, nothing a person can act on, so the UI says what
|
|
117
|
+
* happened instead (API.getFriendlyMessage). A message that only starts
|
|
118
|
+
* with a tag ("<script> is not allowed in a name.") is a message.
|
|
119
|
+
*/
|
|
120
|
+
const isErrorPage = (message) => {
|
|
121
|
+
const text = (message || "").trim();
|
|
122
|
+
if (!text.startsWith("<") || !text.endsWith(">")) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
const second = text.charAt(1);
|
|
126
|
+
return (second === "!" ||
|
|
127
|
+
second === "?" ||
|
|
128
|
+
(second.toLowerCase() >= "a" && second.toLowerCase() <= "z"));
|
|
129
|
+
};
|
|
130
|
+
exports.isErrorPage = isErrorPage;
|
|
86
131
|
// What may close a sentence after its full stop: a quote or a bracket.
|
|
87
|
-
const CLOSING_MARKS = `"'”’)]
|
|
132
|
+
const CLOSING_MARKS = `"'”’)]»」』`;
|
|
88
133
|
// What may open a sentence before its first word.
|
|
89
|
-
const OPENING_MARKS = `"'
|
|
90
|
-
|
|
91
|
-
|
|
134
|
+
const OPENING_MARKS = `"'“‘„([«¿¡「『`;
|
|
135
|
+
/*
|
|
136
|
+
* The marks a sentence may end with, in the scripts OneUptime is read in:
|
|
137
|
+
* also Japanese's and Chinese's full stops, Arabic's and Persian's question
|
|
138
|
+
* mark, Urdu's full stop and Hindi's danda.
|
|
139
|
+
*/
|
|
140
|
+
const SENTENCE_ENDS = ".!?…。!?.。؟۔।॥";
|
|
92
141
|
/*
|
|
93
142
|
* Whether the message is a sentence: it starts with a capital letter, a
|
|
94
143
|
* digit or a value, and ends with a full stop, a question mark or an
|
|
95
144
|
* exclamation mark (a closing quote or bracket may follow it). A value is
|
|
96
145
|
* written as {{name}} or ${...}: "{{name}} is already taken." is a sentence.
|
|
97
146
|
* A message that is several sentences counts as one when its first starts
|
|
98
|
-
* and its last ends that way.
|
|
147
|
+
* and its last ends that way. A letter of a script with no capitals (Arabic,
|
|
148
|
+
* Chinese, Hindi) starts a sentence as a capital does (#7536):
|
|
149
|
+
* ErrorMessagesGuard still holds OneUptime's own English messages to a
|
|
150
|
+
* capital, since a lower-case Latin letter is not one.
|
|
99
151
|
*/
|
|
100
152
|
const isErrorSentence = (message) => {
|
|
101
153
|
const text = (message || "").trim();
|
|
@@ -109,9 +161,11 @@ const isErrorSentence = (message) => {
|
|
|
109
161
|
}
|
|
110
162
|
const rest = text.substring(start);
|
|
111
163
|
const startsWithValue = rest.startsWith("{{") || rest.startsWith("${");
|
|
112
|
-
|
|
164
|
+
// The whole first character, also one outside the Basic Multilingual Plane.
|
|
165
|
+
const firstCodePoint = rest.codePointAt(0);
|
|
166
|
+
const first = firstCodePoint === undefined ? "" : String.fromCodePoint(firstCodePoint);
|
|
113
167
|
const startsRight = startsWithValue ||
|
|
114
|
-
(first
|
|
168
|
+
isDigit(first) ||
|
|
115
169
|
(isLetter(first) && first === first.toUpperCase());
|
|
116
170
|
if (!startsRight) {
|
|
117
171
|
return false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import commonJsModule from "./ErrorMessageRule.js";
|
|
2
2
|
export const EMPTY_ERROR_PHRASES = commonJsModule.EMPTY_ERROR_PHRASES;
|
|
3
3
|
export const isEmptyErrorPhrase = commonJsModule.isEmptyErrorPhrase;
|
|
4
|
+
export const isErrorPage = commonJsModule.isErrorPage;
|
|
4
5
|
export const isErrorSentence = commonJsModule.isErrorSentence;
|
|
5
6
|
export const meetsErrorMessageRule = commonJsModule.meetsErrorMessageRule;
|
|
@@ -2,6 +2,8 @@ declare enum ExceptionMessages {
|
|
|
2
2
|
MonitorNotFound = "Monitor not found.",
|
|
3
3
|
MonitorDisabled = "Monitor is disabled. Please enable it to start monitoring again.",
|
|
4
4
|
MonitorArchived = "Monitor is archived. Unarchive it to start monitoring again.",
|
|
5
|
+
MonitorDisabledBecauseOfManualIncident = "Monitor is disabled because an incident which is created manually is not resolved. Please resolve the incident to start monitoring again.",
|
|
6
|
+
MonitorDisabledBecauseOfScheduledMaintenanceEvent = "Monitor is disabled because one of the maintenance events this monitor is attached to has not ended. Please end that maintenance event to start monitoring again.",
|
|
5
7
|
ProbeNotAssignedToMonitor = "Probe is not assigned to this monitor",
|
|
6
8
|
UserBlocked = "Your account has been blocked. Please contact your administrator.",
|
|
7
9
|
ProjectBlocked = "This project has been blocked. Please contact your administrator."
|
|
@@ -2,6 +2,8 @@ declare enum ExceptionMessages {
|
|
|
2
2
|
MonitorNotFound = "Monitor not found.",
|
|
3
3
|
MonitorDisabled = "Monitor is disabled. Please enable it to start monitoring again.",
|
|
4
4
|
MonitorArchived = "Monitor is archived. Unarchive it to start monitoring again.",
|
|
5
|
+
MonitorDisabledBecauseOfManualIncident = "Monitor is disabled because an incident which is created manually is not resolved. Please resolve the incident to start monitoring again.",
|
|
6
|
+
MonitorDisabledBecauseOfScheduledMaintenanceEvent = "Monitor is disabled because one of the maintenance events this monitor is attached to has not ended. Please end that maintenance event to start monitoring again.",
|
|
5
7
|
ProbeNotAssignedToMonitor = "Probe is not assigned to this monitor",
|
|
6
8
|
UserBlocked = "Your account has been blocked. Please contact your administrator.",
|
|
7
9
|
ProjectBlocked = "This project has been blocked. Please contact your administrator."
|
|
@@ -5,6 +5,8 @@ var ExceptionMessages;
|
|
|
5
5
|
ExceptionMessages["MonitorNotFound"] = "Monitor not found.";
|
|
6
6
|
ExceptionMessages["MonitorDisabled"] = "Monitor is disabled. Please enable it to start monitoring again.";
|
|
7
7
|
ExceptionMessages["MonitorArchived"] = "Monitor is archived. Unarchive it to start monitoring again.";
|
|
8
|
+
ExceptionMessages["MonitorDisabledBecauseOfManualIncident"] = "Monitor is disabled because an incident which is created manually is not resolved. Please resolve the incident to start monitoring again.";
|
|
9
|
+
ExceptionMessages["MonitorDisabledBecauseOfScheduledMaintenanceEvent"] = "Monitor is disabled because one of the maintenance events this monitor is attached to has not ended. Please end that maintenance event to start monitoring again.";
|
|
8
10
|
ExceptionMessages["ProbeNotAssignedToMonitor"] = "Probe is not assigned to this monitor";
|
|
9
11
|
ExceptionMessages["UserBlocked"] = "Your account has been blocked. Please contact your administrator.";
|
|
10
12
|
ExceptionMessages["ProjectBlocked"] = "This project has been blocked. Please contact your administrator.";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare enum PostmortemActionItemStatus {
|
|
2
|
+
Open = "Open",
|
|
3
|
+
Done = "Done",
|
|
4
|
+
WontDo = "WontDo"
|
|
5
|
+
}
|
|
6
|
+
export default PostmortemActionItemStatus;
|
|
7
|
+
export declare const ALL_POSTMORTEM_ACTION_ITEM_STATUSES: ReadonlyArray<PostmortemActionItemStatus>;
|
|
8
|
+
export declare const POSTMORTEM_ACTION_ITEM_STATUS_NAMES: Readonly<Record<PostmortemActionItemStatus, string>>;
|
|
9
|
+
export declare class PostmortemActionItemStatusUtil {
|
|
10
|
+
static parse(value: unknown): PostmortemActionItemStatus;
|
|
11
|
+
static isClosed(status: PostmortemActionItemStatus | undefined): boolean;
|
|
12
|
+
static isOverdue(data: {
|
|
13
|
+
status: PostmortemActionItemStatus | undefined;
|
|
14
|
+
dueDate: Date | string | null | undefined;
|
|
15
|
+
now: Date;
|
|
16
|
+
}): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare enum PostmortemActionItemStatus {
|
|
2
|
+
Open = "Open",
|
|
3
|
+
Done = "Done",
|
|
4
|
+
WontDo = "WontDo"
|
|
5
|
+
}
|
|
6
|
+
export default PostmortemActionItemStatus;
|
|
7
|
+
export declare const ALL_POSTMORTEM_ACTION_ITEM_STATUSES: ReadonlyArray<PostmortemActionItemStatus>;
|
|
8
|
+
export declare const POSTMORTEM_ACTION_ITEM_STATUS_NAMES: Readonly<Record<PostmortemActionItemStatus, string>>;
|
|
9
|
+
export declare class PostmortemActionItemStatusUtil {
|
|
10
|
+
static parse(value: unknown): PostmortemActionItemStatus;
|
|
11
|
+
static isClosed(status: PostmortemActionItemStatus | undefined): boolean;
|
|
12
|
+
static isOverdue(data: {
|
|
13
|
+
status: PostmortemActionItemStatus | undefined;
|
|
14
|
+
dueDate: Date | string | null | undefined;
|
|
15
|
+
now: Date;
|
|
16
|
+
}): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostmortemActionItemStatusUtil = exports.POSTMORTEM_ACTION_ITEM_STATUS_NAMES = exports.ALL_POSTMORTEM_ACTION_ITEM_STATUSES = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* WHERE A POSTMORTEM'S ACTION ITEM STANDS (issue #6801).
|
|
6
|
+
*
|
|
7
|
+
* - Open: still to do. A new action item starts open, and so does one
|
|
8
|
+
* reopened.
|
|
9
|
+
* - Done: done - ticked off by a person, or by OneUptime when the pull
|
|
10
|
+
* request OneUptime AI opened for it merges, or the monitor made for it
|
|
11
|
+
* is created.
|
|
12
|
+
* - Won't Do: the team decided not to do it. It is no longer owed, and
|
|
13
|
+
* says so instead of being deleted, so the postmortem keeps the
|
|
14
|
+
* decision.
|
|
15
|
+
*
|
|
16
|
+
* Done and Won't Do both close the item: who closed it and when are
|
|
17
|
+
* OneUptime's to write (IncidentPostmortemActionItemService), and reopening
|
|
18
|
+
* it clears them. "In progress" is not a status: a pull request OneUptime AI
|
|
19
|
+
* is writing or has opened says so on the item itself.
|
|
20
|
+
*/
|
|
21
|
+
var PostmortemActionItemStatus;
|
|
22
|
+
(function (PostmortemActionItemStatus) {
|
|
23
|
+
PostmortemActionItemStatus["Open"] = "Open";
|
|
24
|
+
PostmortemActionItemStatus["Done"] = "Done";
|
|
25
|
+
PostmortemActionItemStatus["WontDo"] = "WontDo";
|
|
26
|
+
})(PostmortemActionItemStatus || (PostmortemActionItemStatus = {}));
|
|
27
|
+
exports.default = PostmortemActionItemStatus;
|
|
28
|
+
const ONE_DAY_IN_MS = 24 * 60 * 60 * 1000;
|
|
29
|
+
exports.ALL_POSTMORTEM_ACTION_ITEM_STATUSES = [
|
|
30
|
+
PostmortemActionItemStatus.Open,
|
|
31
|
+
PostmortemActionItemStatus.Done,
|
|
32
|
+
PostmortemActionItemStatus.WontDo,
|
|
33
|
+
];
|
|
34
|
+
/*
|
|
35
|
+
* Each status as people read it, in English: the Dashboard looks each up in
|
|
36
|
+
* the reader's language. Open reads "To Do": in many languages "Open" is
|
|
37
|
+
* the verb, a button's word, and a status that says "Open!" is a command.
|
|
38
|
+
*/
|
|
39
|
+
exports.POSTMORTEM_ACTION_ITEM_STATUS_NAMES = {
|
|
40
|
+
[PostmortemActionItemStatus.Open]: "To Do",
|
|
41
|
+
[PostmortemActionItemStatus.Done]: "Done",
|
|
42
|
+
[PostmortemActionItemStatus.WontDo]: "Won't Do",
|
|
43
|
+
};
|
|
44
|
+
class PostmortemActionItemStatusUtil {
|
|
45
|
+
// Reads a status off the wire: anything this build does not know is Open.
|
|
46
|
+
static parse(value) {
|
|
47
|
+
if (typeof value === "string" &&
|
|
48
|
+
exports.ALL_POSTMORTEM_ACTION_ITEM_STATUSES.includes(value)) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
return PostmortemActionItemStatus.Open;
|
|
52
|
+
}
|
|
53
|
+
// Done or Won't Do: no longer owed.
|
|
54
|
+
static isClosed(status) {
|
|
55
|
+
return (status === PostmortemActionItemStatus.Done ||
|
|
56
|
+
status === PostmortemActionItemStatus.WontDo);
|
|
57
|
+
}
|
|
58
|
+
/*
|
|
59
|
+
* Whether an item is past its due date: open, and its due day is over. A
|
|
60
|
+
* due date is the start of its day in the time zone of whoever set it
|
|
61
|
+
* (the Due Date picker), so the day is over a day after it.
|
|
62
|
+
*/
|
|
63
|
+
static isOverdue(data) {
|
|
64
|
+
if (PostmortemActionItemStatusUtil.isClosed(data.status) || !data.dueDate) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const due = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate);
|
|
68
|
+
if (isNaN(due.getTime())) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return data.now.getTime() >= due.getTime() + ONE_DAY_IN_MS;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.PostmortemActionItemStatusUtil = PostmortemActionItemStatusUtil;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import commonJsModule from "./PostmortemActionItemStatus.js";
|
|
2
|
+
export default commonJsModule.default;
|
|
3
|
+
export const ALL_POSTMORTEM_ACTION_ITEM_STATUSES = commonJsModule.ALL_POSTMORTEM_ACTION_ITEM_STATUSES;
|
|
4
|
+
export const POSTMORTEM_ACTION_ITEM_STATUS_NAMES = commonJsModule.POSTMORTEM_ACTION_ITEM_STATUS_NAMES;
|
|
5
|
+
export const PostmortemActionItemStatusUtil = commonJsModule.PostmortemActionItemStatusUtil;
|