@oneuptime/common 14.0.92 → 14.0.94
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 +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +62 -1
- package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
- package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
- package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
- package/Models/DatabaseModels/CloudAccount.js +546 -0
- package/Models/DatabaseModels/CloudAccount.mjs +2 -0
- package/Models/DatabaseModels/CloudResource.d.mts +8 -0
- package/Models/DatabaseModels/CloudResource.d.ts +8 -0
- package/Models/DatabaseModels/CloudResource.js +169 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
- package/Models/DatabaseModels/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +54 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
- package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/LlmProvider.js +1 -1
- package/Models/DatabaseModels/Monitor.d.mts +2 -0
- package/Models/DatabaseModels/Monitor.d.ts +2 -0
- package/Models/DatabaseModels/Monitor.js +54 -0
- package/Models/DatabaseModels/MonitorTemplate.js +10 -4
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
- package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
- package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
- package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
- package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
- package/Models/DatabaseModels/StatusPage.d.mts +2 -0
- package/Models/DatabaseModels/StatusPage.d.ts +2 -0
- package/Models/DatabaseModels/StatusPage.js +100 -0
- package/Types/AI/AiAffectedResources.d.mts +40 -0
- package/Types/AI/AiAffectedResources.d.ts +40 -0
- package/Types/AI/AiAffectedResources.js +292 -0
- package/Types/AI/AiAffectedResources.mjs +10 -0
- package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
- package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
- package/Types/Cloud/CloudAccountSummary.js +114 -0
- package/Types/Cloud/CloudAccountSummary.mjs +5 -0
- package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
- package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
- package/Types/Cloud/CloudEndpointMatch.js +134 -0
- package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
- package/Types/Cloud/CloudInventory.d.mts +34 -0
- package/Types/Cloud/CloudInventory.d.ts +34 -0
- package/Types/Cloud/CloudInventory.js +362 -0
- package/Types/Cloud/CloudInventory.mjs +22 -0
- package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
- package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
- package/Types/Cloud/CloudResourceCatalog.js +29 -1
- package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
- package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
- package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
- package/Types/Cloud/CloudResourceIndex.js +191 -0
- package/Types/Cloud/CloudResourceIndex.mjs +4 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
- package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
- package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
- package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
- package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.js +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
- package/Types/Database/BlankColumnValue.d.mts +6 -0
- package/Types/Database/BlankColumnValue.d.ts +6 -0
- package/Types/Database/BlankColumnValue.js +77 -0
- package/Types/Database/BlankColumnValue.mjs +4 -0
- package/Types/Date.d.mts +1 -0
- package/Types/Date.d.ts +1 -0
- package/Types/Date.js +32 -6
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +67 -12
- package/Types/DateLanguage.mjs +2 -0
- package/Types/Domain.d.mts +2 -0
- package/Types/Domain.d.ts +2 -0
- package/Types/Domain.js +27 -0
- package/Types/Email/EmailTemplateType.d.mts +2 -0
- package/Types/Email/EmailTemplateType.d.ts +2 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email.d.mts +1 -0
- package/Types/Email.d.ts +1 -0
- package/Types/Email.js +16 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
- package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
- package/Types/Monitor/CriteriaFilter.d.mts +1 -0
- package/Types/Monitor/CriteriaFilter.d.ts +1 -0
- package/Types/Monitor/CriteriaFilter.js +9 -0
- package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
- package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
- package/Types/Monitor/MonitorType.js +12 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
- package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.js +5 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
- package/Types/ReadingDirection.d.mts +10 -0
- package/Types/ReadingDirection.d.ts +10 -0
- package/Types/ReadingDirection.js +171 -0
- package/Types/ReadingDirection.mjs +10 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
- package/Types/Runbook/HttpStepVariables.d.mts +8 -0
- package/Types/Runbook/HttpStepVariables.d.ts +8 -0
- package/Types/Runbook/HttpStepVariables.js +109 -0
- package/Types/Runbook/HttpStepVariables.mjs +5 -0
- package/Types/Runbook/RunbookStep.d.mts +1 -0
- package/Types/Runbook/RunbookStep.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.d.mts +1 -0
- package/Types/Runbook/RunnerFeatures.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.js +15 -3
- package/Types/Runbook/RunnerFeatures.mjs +1 -0
- package/Types/Runbook/SshHostKey.d.mts +22 -0
- package/Types/Runbook/SshHostKey.d.ts +22 -0
- package/Types/Runbook/SshHostKey.js +201 -0
- package/Types/Runbook/SshHostKey.mjs +10 -0
- package/Types/Runner/CodeRepositoryRunner.js +2 -3
- package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.js +19 -0
- package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
- package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
- package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
- package/Types/Runner/GlobalRunnerWork.js +21 -1
- package/Types/Runner/GlobalRunnerWork.mjs +1 -0
- package/Types/SSO/SignInMethods.d.mts +31 -0
- package/Types/SSO/SignInMethods.d.ts +31 -0
- package/Types/SSO/SignInMethods.js +160 -0
- package/Types/SSO/SignInMethods.mjs +8 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
- package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
- package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
- package/Types/StatusPage/StatusPageLanguage.js +17 -1
- package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
- package/Types/Workflow/Templates.js +2 -5
- package/Types/Workflow/WorkflowPlan.d.mts +7 -0
- package/Types/Workflow/WorkflowPlan.d.ts +7 -0
- package/Types/Workflow/WorkflowPlan.js +39 -0
- package/Types/Workflow/WorkflowPlan.mjs +3 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
- package/Utils/ColorContrast.d.mts +3 -0
- package/Utils/ColorContrast.d.ts +3 -0
- package/Utils/ColorContrast.js +41 -3
- package/Utils/ColorContrast.mjs +2 -0
- package/Utils/Dashboard/TableThresholds.d.mts +44 -0
- package/Utils/Dashboard/TableThresholds.d.ts +44 -0
- package/Utils/Dashboard/TableThresholds.js +288 -0
- package/Utils/Dashboard/TableThresholds.mjs +17 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
- package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
- package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
- package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
- package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
- package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
- package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
- package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
- package/Utils/Rules/RuleRunSummary.d.mts +1 -0
- package/Utils/Rules/RuleRunSummary.d.ts +1 -0
- package/Utils/Rules/RuleRunSummary.js +19 -1
- package/Utils/Rules/RuleRunSummary.mjs +1 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
- package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
- package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
- package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
- package/Utils/ScheduledMaintenanceStart.js +15 -0
- package/Utils/Sms/Gsm7Text.js +9 -1
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +19 -2
- package/Utils/Sms/OnCallPageSms.mjs +1 -0
- package/Utils/Sms/SubscriberSms.d.mts +2 -0
- package/Utils/Sms/SubscriberSms.d.ts +2 -0
- package/Utils/Sms/SubscriberSms.js +35 -0
- package/Utils/Sms/SubscriberSms.mjs +3 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
- package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
- package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
- package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
- package/Utils/Telemetry/ChangeEventFields.js +52 -1
- package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
- package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cannotHoldBlank = cannotHoldBlank;
|
|
7
|
+
exports.isBlankFormValue = isBlankFormValue;
|
|
8
|
+
exports.clearBlankColumnValues = clearBlankColumnValues;
|
|
9
|
+
const DateColumnValue_1 = require("./DateColumnValue");
|
|
10
|
+
const NumericColumnValue_1 = require("./NumericColumnValue");
|
|
11
|
+
const TableColumnType_1 = __importDefault(require("./TableColumnType"));
|
|
12
|
+
/*
|
|
13
|
+
* WHAT AN EMPTIED NUMBER, DATE OR PORT BOX IS SAVED AS.
|
|
14
|
+
*
|
|
15
|
+
* A form's number box is an <input type="number">, and a DOM input's value
|
|
16
|
+
* is a string: emptied, it hands the form "", and so does an emptied date
|
|
17
|
+
* or port box. A number, date or port column cannot hold "" - Postgres
|
|
18
|
+
* refuses it ("invalid input syntax for type integer"), so emptying an
|
|
19
|
+
* optional number on a form failed the save with an error about a column
|
|
20
|
+
* the reader did not know was wrong. The server leaves a blank alone on
|
|
21
|
+
* purpose (NumericColumnValue: turned into 0 or null there, it would write
|
|
22
|
+
* a value nobody chose, or defeat a column's default), so the form, which
|
|
23
|
+
* knows the reader emptied the box, says what the blank means:
|
|
24
|
+
*
|
|
25
|
+
* - a column that may be empty: none (null) - "Leave empty for no limit",
|
|
26
|
+
* "Leave empty to not track it" - on a Create form and an Edit form
|
|
27
|
+
* alike, whatever the box showed before (a default, a stored value);
|
|
28
|
+
* - a column that may not be empty: the column's default - a sample
|
|
29
|
+
* percentage's 100, a budget's 0 - which is what an untouched Create
|
|
30
|
+
* form would have saved;
|
|
31
|
+
* - a column that may not be empty and has no default: nothing is sent,
|
|
32
|
+
* so an Edit keeps what is stored and a Create is told what is missing.
|
|
33
|
+
*
|
|
34
|
+
* Only a blank: every other value, and every other column, is left exactly
|
|
35
|
+
* as it is. Run by ModelForm on what it is about to send, for every form in
|
|
36
|
+
* the product - it replaces the page-by-page fixes the SLA rules and the
|
|
37
|
+
* session replay policy carried.
|
|
38
|
+
*/
|
|
39
|
+
const COLUMN_TYPES_THAT_CANNOT_HOLD_A_BLANK = new Set([TableColumnType_1.default.Port]);
|
|
40
|
+
// Whether a column of this type can never store an empty string.
|
|
41
|
+
function cannotHoldBlank(type) {
|
|
42
|
+
if (!type) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return ((0, NumericColumnValue_1.isNumericTableColumnType)(type) ||
|
|
46
|
+
(0, DateColumnValue_1.isDateTableColumnType)(type) ||
|
|
47
|
+
COLUMN_TYPES_THAT_CANNOT_HOLD_A_BLANK.has(type));
|
|
48
|
+
}
|
|
49
|
+
// What an emptied box hands the form: a string with nothing in it.
|
|
50
|
+
function isBlankFormValue(value) {
|
|
51
|
+
return typeof value === "string" && value.trim().length === 0;
|
|
52
|
+
}
|
|
53
|
+
/*
|
|
54
|
+
* The blanks of a form's values, for the columns that cannot hold one,
|
|
55
|
+
* replaced with what they mean (see above). In place; returns the values.
|
|
56
|
+
*/
|
|
57
|
+
function clearBlankColumnValues(json, model) {
|
|
58
|
+
for (const key of Object.keys(json)) {
|
|
59
|
+
if (!isBlankFormValue(json[key])) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const metadata = model.getTableColumnMetadata(key);
|
|
63
|
+
if (!metadata || !cannotHoldBlank(metadata.type)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (!metadata.required) {
|
|
67
|
+
json[key] = null;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (metadata.defaultValue !== undefined && metadata.defaultValue !== null) {
|
|
71
|
+
json[key] = metadata.defaultValue;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
delete json[key];
|
|
75
|
+
}
|
|
76
|
+
return json;
|
|
77
|
+
}
|
package/Types/Date.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ export type CalendarUnit = "hour" | "day" | "week" | "month" | "year";
|
|
|
10
10
|
export default class OneUptimeDate {
|
|
11
11
|
private static userTimezone;
|
|
12
12
|
private static padDatePart;
|
|
13
|
+
private static inReaderDigits;
|
|
13
14
|
private static isUtcDateTimeString;
|
|
14
15
|
private static normalizeUtcDateTimeString;
|
|
15
16
|
private static getLocalShortMonthName;
|
package/Types/Date.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type CalendarUnit = "hour" | "day" | "week" | "month" | "year";
|
|
|
10
10
|
export default class OneUptimeDate {
|
|
11
11
|
private static userTimezone;
|
|
12
12
|
private static padDatePart;
|
|
13
|
+
private static inReaderDigits;
|
|
13
14
|
private static isUtcDateTimeString;
|
|
14
15
|
private static normalizeUtcDateTimeString;
|
|
15
16
|
private static getLocalShortMonthName;
|
package/Types/Date.js
CHANGED
|
@@ -66,6 +66,8 @@ const LOCALIZED_CUSTOM_DATE_FORMATS = {
|
|
|
66
66
|
"MMMM D, YYYY": { month: "long", day: "numeric", year: "numeric" },
|
|
67
67
|
"h:mm A": { hour: "numeric", minute: "2-digit", hour12: true },
|
|
68
68
|
"hh:mm A": { hour: "2-digit", minute: "2-digit", hour12: true },
|
|
69
|
+
// A 24-hour time of day, in the reader's digits: "۲۲:۲۷" on a Persian page.
|
|
70
|
+
"HH:mm": { hour: "2-digit", minute: "2-digit", hourCycle: "h23" },
|
|
69
71
|
};
|
|
70
72
|
// A whole number of nanoseconds, as fromUnixNano reads one exactly.
|
|
71
73
|
const UNIX_NANO_INTEGER_PATTERN = /^[+-]?\d+$/;
|
|
@@ -105,6 +107,21 @@ class OneUptimeDate {
|
|
|
105
107
|
static padDatePart(value) {
|
|
106
108
|
return value.toString().padStart(2, "0");
|
|
107
109
|
}
|
|
110
|
+
/*
|
|
111
|
+
* A time moment wrote ("09:05", "14:30:12") in the digits the reader's
|
|
112
|
+
* language writes: Persian's own on a Persian page, as every date Intl
|
|
113
|
+
* writes there (DateLanguage's getDateLocale), so a page never mixes
|
|
114
|
+
* "۲۶ اکتبر" with "21:16". Unchanged in every language that writes Latin
|
|
115
|
+
* digits, and remembered with its English as every localized date is.
|
|
116
|
+
*/
|
|
117
|
+
static inReaderDigits(write) {
|
|
118
|
+
return (0, DateLanguage_1.writeInDateDisplayLanguage)(write, (_language, locale) => {
|
|
119
|
+
const text = write();
|
|
120
|
+
const written = (0, DateLanguage_1.writeDigitsInLocale)(text, locale);
|
|
121
|
+
// Latin digits: the English as it is, with nothing to remember.
|
|
122
|
+
return written === text ? null : written;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
108
125
|
static isUtcDateTimeString(value) {
|
|
109
126
|
const utcDateTimePattern = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$/;
|
|
110
127
|
return utcDateTimePattern.test(value.trim());
|
|
@@ -337,7 +354,10 @@ class OneUptimeDate {
|
|
|
337
354
|
if (use12HourFormat) {
|
|
338
355
|
timeFormat += " A";
|
|
339
356
|
}
|
|
340
|
-
|
|
357
|
+
const instant = date;
|
|
358
|
+
return this.inReaderDigits(() => {
|
|
359
|
+
return this.inCurrentTimezone(instant).format(timeFormat);
|
|
360
|
+
});
|
|
341
361
|
}
|
|
342
362
|
static getDateAsLocalDayMonthString(date) {
|
|
343
363
|
const instant = this.fromString(date);
|
|
@@ -356,8 +376,11 @@ class OneUptimeDate {
|
|
|
356
376
|
});
|
|
357
377
|
}
|
|
358
378
|
static getDateAsLocalDayMonthHourString(date) {
|
|
359
|
-
|
|
360
|
-
|
|
379
|
+
const instant = this.fromString(date);
|
|
380
|
+
// The minutes it adds itself in the reader's digits too.
|
|
381
|
+
return this.inReaderDigits(() => {
|
|
382
|
+
return `${this.getDateAsLocalDayMonthString(instant)}, ${this.getLocalTimeString(instant, { includeMinutes: false })}:00`;
|
|
383
|
+
});
|
|
361
384
|
}
|
|
362
385
|
/**
|
|
363
386
|
* "02 Mar, 14:30" — a day-qualified wall clock, for chart axes whose
|
|
@@ -484,9 +507,12 @@ class OneUptimeDate {
|
|
|
484
507
|
return this.getLocalHourAndMinuteFromDate(date);
|
|
485
508
|
}
|
|
486
509
|
const use12HourFormat = this.getUserPrefers12HourFormat();
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
.
|
|
510
|
+
const instant = date;
|
|
511
|
+
return this.inReaderDigits(() => {
|
|
512
|
+
return moment_timezone_1.default
|
|
513
|
+
.tz(instant, timezone)
|
|
514
|
+
.format(use12HourFormat ? "h:mm A" : "HH:mm");
|
|
515
|
+
});
|
|
490
516
|
}
|
|
491
517
|
/**
|
|
492
518
|
* Format a single instant as a human-readable "weekday, month day, time"
|
package/Types/DateLanguage.d.mts
CHANGED
|
@@ -65,3 +65,5 @@ export declare const formatDecimal: (data: {
|
|
|
65
65
|
locale: string;
|
|
66
66
|
maximumFractionDigits: number;
|
|
67
67
|
}) => string | null;
|
|
68
|
+
export declare const getDigitsOf: (locale: string) => Array<string>;
|
|
69
|
+
export declare const writeDigitsInLocale: (text: string, locale: string) => string;
|
package/Types/DateLanguage.d.ts
CHANGED
|
@@ -65,3 +65,5 @@ export declare const formatDecimal: (data: {
|
|
|
65
65
|
locale: string;
|
|
66
66
|
maximumFractionDigits: number;
|
|
67
67
|
}) => string | null;
|
|
68
|
+
export declare const getDigitsOf: (locale: string) => Array<string>;
|
|
69
|
+
export declare const writeDigitsInLocale: (text: string, locale: string) => string;
|
package/Types/DateLanguage.js
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* reads (setDateDisplayLanguage, from its i18n set-up), and OneUptimeDate
|
|
9
9
|
* writes the words of a date in it: month and weekday names, "vor 5
|
|
10
10
|
* Stunden", "2 Tage, 3 Stunden", a decimal comma. The words come from the
|
|
11
|
-
* browser's Intl data, so no locale is shipped for them
|
|
12
|
-
* always the Gregorian one
|
|
13
|
-
*
|
|
11
|
+
* browser's Intl data, so no locale is shipped for them. The calendar is
|
|
12
|
+
* always the Gregorian one, the one every timestamp, log and export is
|
|
13
|
+
* written in; the digits are the language's own, so a Persian reader's
|
|
14
|
+
* dates, times and durations ("۲۶ اکتبر، ۱۵:۰۷") are written in the same
|
|
15
|
+
* digits as the counts and sentences around them.
|
|
14
16
|
*
|
|
15
17
|
* English is what nothing has set - the server, a worker, an email, a test -
|
|
16
18
|
* and every function writes it exactly as it always has.
|
|
@@ -31,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.formatDecimal = exports.formatDurationText = exports.formatDurationUnit = exports.formatRelativeDate = exports.getRelativeDistance = exports.formatDateText = exports.getDateTimeOptions = exports.getDateTimeFormat = exports.writeInDateDisplayLanguage = exports.forgetRememberedDateTexts = exports.getEnglishOf = exports.rememberEnglishOf = exports.MAX_REMEMBERED_DATE_TEXTS = exports.getDateLocale = exports.setDateDisplayLanguage = exports.getDateDisplayLanguage = exports.isEnglishDateLanguage = exports.ENGLISH_DATE_LANGUAGE = void 0;
|
|
36
|
+
exports.writeDigitsInLocale = exports.getDigitsOf = exports.formatDecimal = exports.formatDurationText = exports.formatDurationUnit = exports.formatRelativeDate = exports.getRelativeDistance = exports.formatDateText = exports.getDateTimeOptions = exports.getDateTimeFormat = exports.writeInDateDisplayLanguage = exports.forgetRememberedDateTexts = exports.getEnglishOf = exports.rememberEnglishOf = exports.MAX_REMEMBERED_DATE_TEXTS = exports.getDateLocale = exports.setDateDisplayLanguage = exports.getDateDisplayLanguage = exports.isEnglishDateLanguage = exports.ENGLISH_DATE_LANGUAGE = void 0;
|
|
35
37
|
exports.withDateDisplayLanguage = withDateDisplayLanguage;
|
|
36
38
|
exports.inEnglishDates = inEnglishDates;
|
|
37
39
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
@@ -88,11 +90,12 @@ function inEnglishDates(work) {
|
|
|
88
90
|
}
|
|
89
91
|
const localeCache = new Map();
|
|
90
92
|
/*
|
|
91
|
-
* The Intl locale a language writes dates in: its own words
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
93
|
+
* The Intl locale a language writes dates in: its own words, order and
|
|
94
|
+
* digits, on the Gregorian calendar ("fa" alone would give the Solar Hijri
|
|
95
|
+
* calendar). Persian writes its own digits - "۲۶ اکتبر، ۱۵:۰۷", as its counts
|
|
96
|
+
* are written (TranslateTemplate's formatNumber) - every other language of
|
|
97
|
+
* the product Latin ones. A language Intl does not know reads English,
|
|
98
|
+
* never the browser's own default, so a page never mixes two languages.
|
|
96
99
|
*/
|
|
97
100
|
const getDateLocale = (language) => {
|
|
98
101
|
const requested = normalizeLanguage(language);
|
|
@@ -100,19 +103,19 @@ const getDateLocale = (language) => {
|
|
|
100
103
|
if (cached) {
|
|
101
104
|
return cached;
|
|
102
105
|
}
|
|
103
|
-
let locale = `${exports.ENGLISH_DATE_LANGUAGE}-u-ca-gregory
|
|
106
|
+
let locale = `${exports.ENGLISH_DATE_LANGUAGE}-u-ca-gregory`;
|
|
104
107
|
try {
|
|
105
108
|
const supported = Intl.DateTimeFormat.supportedLocalesOf([
|
|
106
109
|
requested,
|
|
107
110
|
]);
|
|
108
111
|
if (supported.length > 0 && supported[0]) {
|
|
109
|
-
locale = `${supported[0]}-u-ca-gregory
|
|
112
|
+
locale = `${supported[0]}-u-ca-gregory`;
|
|
110
113
|
// Throws on a tag Intl cannot take an extension on.
|
|
111
114
|
new Intl.DateTimeFormat(locale);
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
catch (_a) {
|
|
115
|
-
locale = `${exports.ENGLISH_DATE_LANGUAGE}-u-ca-gregory
|
|
118
|
+
locale = `${exports.ENGLISH_DATE_LANGUAGE}-u-ca-gregory`;
|
|
116
119
|
}
|
|
117
120
|
localeCache.set(requested, locale);
|
|
118
121
|
return locale;
|
|
@@ -476,3 +479,55 @@ const formatDecimal = (data) => {
|
|
|
476
479
|
return format ? format.format(data.value) : null;
|
|
477
480
|
};
|
|
478
481
|
exports.formatDecimal = formatDecimal;
|
|
482
|
+
const ASCII_DIGIT_REGEX = /[0-9]/g;
|
|
483
|
+
const digitsCache = new Map();
|
|
484
|
+
// The ten digits `locale` writes, 0 to 9: Persian's ۰ to ۹, Latin elsewhere.
|
|
485
|
+
const getDigitsOf = (locale) => {
|
|
486
|
+
const cached = digitsCache.get(locale);
|
|
487
|
+
if (cached) {
|
|
488
|
+
return cached;
|
|
489
|
+
}
|
|
490
|
+
let digits = [
|
|
491
|
+
"0",
|
|
492
|
+
"1",
|
|
493
|
+
"2",
|
|
494
|
+
"3",
|
|
495
|
+
"4",
|
|
496
|
+
"5",
|
|
497
|
+
"6",
|
|
498
|
+
"7",
|
|
499
|
+
"8",
|
|
500
|
+
"9",
|
|
501
|
+
];
|
|
502
|
+
try {
|
|
503
|
+
const format = new Intl.NumberFormat(locale, {
|
|
504
|
+
useGrouping: false,
|
|
505
|
+
});
|
|
506
|
+
digits = digits.map((digit) => {
|
|
507
|
+
return format.format(Number(digit));
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
catch (_a) {
|
|
511
|
+
// Latin, as written.
|
|
512
|
+
}
|
|
513
|
+
digitsCache.set(locale, digits);
|
|
514
|
+
return digits;
|
|
515
|
+
};
|
|
516
|
+
exports.getDigitsOf = getDigitsOf;
|
|
517
|
+
/*
|
|
518
|
+
* A figure OneUptime wrote itself - a time of day "09:00", a minute "05" -
|
|
519
|
+
* in the digits `locale` writes: "۰۹:۰۰" in Persian, unchanged in every
|
|
520
|
+
* language that writes Latin digits. Only for text that is all figures and
|
|
521
|
+
* their marks; never for a name, an address or anything someone typed,
|
|
522
|
+
* whose digits are theirs.
|
|
523
|
+
*/
|
|
524
|
+
const writeDigitsInLocale = (text, locale) => {
|
|
525
|
+
const digits = (0, exports.getDigitsOf)(locale);
|
|
526
|
+
if (digits[0] === "0") {
|
|
527
|
+
return text;
|
|
528
|
+
}
|
|
529
|
+
return text.replace(ASCII_DIGIT_REGEX, (digit) => {
|
|
530
|
+
return digits[Number(digit)] || digit;
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
exports.writeDigitsInLocale = writeDigitsInLocale;
|
package/Types/DateLanguage.mjs
CHANGED
|
@@ -11,6 +11,7 @@ export const getDateDisplayLanguage = commonJsModule.getDateDisplayLanguage;
|
|
|
11
11
|
export const getDateLocale = commonJsModule.getDateLocale;
|
|
12
12
|
export const getDateTimeFormat = commonJsModule.getDateTimeFormat;
|
|
13
13
|
export const getDateTimeOptions = commonJsModule.getDateTimeOptions;
|
|
14
|
+
export const getDigitsOf = commonJsModule.getDigitsOf;
|
|
14
15
|
export const getEnglishOf = commonJsModule.getEnglishOf;
|
|
15
16
|
export const getRelativeDistance = commonJsModule.getRelativeDistance;
|
|
16
17
|
export const inEnglishDates = commonJsModule.inEnglishDates;
|
|
@@ -18,4 +19,5 @@ export const isEnglishDateLanguage = commonJsModule.isEnglishDateLanguage;
|
|
|
18
19
|
export const rememberEnglishOf = commonJsModule.rememberEnglishOf;
|
|
19
20
|
export const setDateDisplayLanguage = commonJsModule.setDateDisplayLanguage;
|
|
20
21
|
export const withDateDisplayLanguage = commonJsModule.withDateDisplayLanguage;
|
|
22
|
+
export const writeDigitsInLocale = commonJsModule.writeDigitsInLocale;
|
|
21
23
|
export const writeInDateDisplayLanguage = commonJsModule.writeInDateDisplayLanguage;
|
package/Types/Domain.d.mts
CHANGED
|
@@ -10,6 +10,8 @@ export default class Domain extends DatabaseProperty {
|
|
|
10
10
|
* These are reserved by IANA for documentation and testing purposes.
|
|
11
11
|
*/
|
|
12
12
|
static isTestDomain(domain: string): boolean;
|
|
13
|
+
static readonly RESERVED_NAMES: Array<string>;
|
|
14
|
+
static isReservedName(name: string): boolean;
|
|
13
15
|
private _domain;
|
|
14
16
|
get domain(): string;
|
|
15
17
|
set domain(v: string);
|
package/Types/Domain.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export default class Domain extends DatabaseProperty {
|
|
|
10
10
|
* These are reserved by IANA for documentation and testing purposes.
|
|
11
11
|
*/
|
|
12
12
|
static isTestDomain(domain: string): boolean;
|
|
13
|
+
static readonly RESERVED_NAMES: Array<string>;
|
|
14
|
+
static isReservedName(name: string): boolean;
|
|
13
15
|
private _domain;
|
|
14
16
|
get domain(): string;
|
|
15
17
|
set domain(v: string);
|
package/Types/Domain.js
CHANGED
|
@@ -20,6 +20,16 @@ class Domain extends DatabaseProperty_1.default {
|
|
|
20
20
|
return domainLower.endsWith(suffix);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
// Whether a name is one of RESERVED_NAMES or under one. Never throws.
|
|
24
|
+
static isReservedName(name) {
|
|
25
|
+
if (typeof name !== "string") {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const nameLower = name.trim().toLowerCase();
|
|
29
|
+
return Domain.RESERVED_NAMES.some((reserved) => {
|
|
30
|
+
return nameLower === reserved || nameLower.endsWith(`.${reserved}`);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
23
33
|
get domain() {
|
|
24
34
|
return this._domain;
|
|
25
35
|
}
|
|
@@ -133,4 +143,21 @@ Domain.TEST_DOMAIN_SUFFIXES = [
|
|
|
133
143
|
".example.net",
|
|
134
144
|
".test",
|
|
135
145
|
];
|
|
146
|
+
/*
|
|
147
|
+
* The names RFC 2606 reserves for testing and documentation: the .test,
|
|
148
|
+
* .example, .invalid and .localhost top-level domains, and example.com,
|
|
149
|
+
* example.net and example.org. Nobody can register them, so no mailbox or
|
|
150
|
+
* install on them, or on any name under them, belongs to anyone. A wider
|
|
151
|
+
* list than TEST_DOMAIN_SUFFIXES, which only says which domains may skip
|
|
152
|
+
* DNS verification.
|
|
153
|
+
*/
|
|
154
|
+
Domain.RESERVED_NAMES = [
|
|
155
|
+
"test",
|
|
156
|
+
"example",
|
|
157
|
+
"invalid",
|
|
158
|
+
"localhost",
|
|
159
|
+
"example.com",
|
|
160
|
+
"example.net",
|
|
161
|
+
"example.org",
|
|
162
|
+
];
|
|
136
163
|
exports.default = Domain;
|
|
@@ -48,6 +48,7 @@ declare enum EmailTemplateType {
|
|
|
48
48
|
IncidentOwnerResourceCreated = "IncidentOwnerResourceCreated.hbs",
|
|
49
49
|
IncidentMemberAdded = "IncidentMemberAdded.hbs",
|
|
50
50
|
IncidentOwnerUnresolvedReminder = "IncidentOwnerUnresolvedReminder.hbs",
|
|
51
|
+
IncidentOwnerSlaBreached = "IncidentOwnerSlaBreached.hbs",
|
|
51
52
|
AlertOwnerAdded = "AlertOwnerAdded.hbs",
|
|
52
53
|
AlertOwnerStateChanged = "AlertOwnerStateChanged.hbs",
|
|
53
54
|
AlertOwnerNotePosted = "AlertOwnerNotePosted.hbs",
|
|
@@ -98,6 +99,7 @@ declare enum EmailTemplateType {
|
|
|
98
99
|
RedisHealthWarning = "RedisHealthWarning.hbs",
|
|
99
100
|
PostgresHealthWarning = "PostgresHealthWarning.hbs",
|
|
100
101
|
BackupFailed = "BackupFailed.hbs",
|
|
102
|
+
AuditLogExportFailed = "AuditLogExportFailed.hbs",
|
|
101
103
|
EnterpriseLicenseUserLimitBreach = "EnterpriseLicenseUserLimitBreach.hbs",
|
|
102
104
|
EnterpriseLicenseExpiryReminder = "EnterpriseLicenseExpiryReminder.hbs",
|
|
103
105
|
NotificationRollup = "NotificationRollup.hbs",
|
|
@@ -48,6 +48,7 @@ declare enum EmailTemplateType {
|
|
|
48
48
|
IncidentOwnerResourceCreated = "IncidentOwnerResourceCreated.hbs",
|
|
49
49
|
IncidentMemberAdded = "IncidentMemberAdded.hbs",
|
|
50
50
|
IncidentOwnerUnresolvedReminder = "IncidentOwnerUnresolvedReminder.hbs",
|
|
51
|
+
IncidentOwnerSlaBreached = "IncidentOwnerSlaBreached.hbs",
|
|
51
52
|
AlertOwnerAdded = "AlertOwnerAdded.hbs",
|
|
52
53
|
AlertOwnerStateChanged = "AlertOwnerStateChanged.hbs",
|
|
53
54
|
AlertOwnerNotePosted = "AlertOwnerNotePosted.hbs",
|
|
@@ -98,6 +99,7 @@ declare enum EmailTemplateType {
|
|
|
98
99
|
RedisHealthWarning = "RedisHealthWarning.hbs",
|
|
99
100
|
PostgresHealthWarning = "PostgresHealthWarning.hbs",
|
|
100
101
|
BackupFailed = "BackupFailed.hbs",
|
|
102
|
+
AuditLogExportFailed = "AuditLogExportFailed.hbs",
|
|
101
103
|
EnterpriseLicenseUserLimitBreach = "EnterpriseLicenseUserLimitBreach.hbs",
|
|
102
104
|
EnterpriseLicenseExpiryReminder = "EnterpriseLicenseExpiryReminder.hbs",
|
|
103
105
|
NotificationRollup = "NotificationRollup.hbs",
|
|
@@ -51,6 +51,7 @@ var EmailTemplateType;
|
|
|
51
51
|
EmailTemplateType["IncidentOwnerResourceCreated"] = "IncidentOwnerResourceCreated.hbs";
|
|
52
52
|
EmailTemplateType["IncidentMemberAdded"] = "IncidentMemberAdded.hbs";
|
|
53
53
|
EmailTemplateType["IncidentOwnerUnresolvedReminder"] = "IncidentOwnerUnresolvedReminder.hbs";
|
|
54
|
+
EmailTemplateType["IncidentOwnerSlaBreached"] = "IncidentOwnerSlaBreached.hbs";
|
|
54
55
|
EmailTemplateType["AlertOwnerAdded"] = "AlertOwnerAdded.hbs";
|
|
55
56
|
EmailTemplateType["AlertOwnerStateChanged"] = "AlertOwnerStateChanged.hbs";
|
|
56
57
|
EmailTemplateType["AlertOwnerNotePosted"] = "AlertOwnerNotePosted.hbs";
|
|
@@ -103,6 +104,7 @@ var EmailTemplateType;
|
|
|
103
104
|
EmailTemplateType["PostgresHealthWarning"] = "PostgresHealthWarning.hbs";
|
|
104
105
|
// A backup or a restore of the instance failed (Enterprise, ee/Server/Backup).
|
|
105
106
|
EmailTemplateType["BackupFailed"] = "BackupFailed.hbs";
|
|
107
|
+
EmailTemplateType["AuditLogExportFailed"] = "AuditLogExportFailed.hbs";
|
|
106
108
|
EmailTemplateType["EnterpriseLicenseUserLimitBreach"] = "EnterpriseLicenseUserLimitBreach.hbs";
|
|
107
109
|
EmailTemplateType["EnterpriseLicenseExpiryReminder"] = "EnterpriseLicenseExpiryReminder.hbs";
|
|
108
110
|
EmailTemplateType["NotificationRollup"] = "NotificationRollup.hbs";
|
package/Types/Email.d.mts
CHANGED
|
@@ -21,6 +21,7 @@ export default class Email extends DatabaseProperty {
|
|
|
21
21
|
toString(): string;
|
|
22
22
|
getEmailDomain(): Hostname;
|
|
23
23
|
isBusinessEmail(): boolean;
|
|
24
|
+
static isOnReservedDomain(value: string): boolean;
|
|
24
25
|
static toDatabase(value: Email | FindOperator<Email>): string | null;
|
|
25
26
|
static fromDatabase(_value: string): Email | null;
|
|
26
27
|
static getSchema(): ZodSchema;
|
package/Types/Email.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export default class Email extends DatabaseProperty {
|
|
|
21
21
|
toString(): string;
|
|
22
22
|
getEmailDomain(): Hostname;
|
|
23
23
|
isBusinessEmail(): boolean;
|
|
24
|
+
static isOnReservedDomain(value: string): boolean;
|
|
24
25
|
static toDatabase(value: Email | FindOperator<Email>): string | null;
|
|
25
26
|
static fromDatabase(_value: string): Email | null;
|
|
26
27
|
static getSchema(): ZodSchema;
|
package/Types/Email.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.MAX_EMAIL_ADDRESS_LENGTH = void 0;
|
|
7
7
|
const Hostname_1 = __importDefault(require("./API/Hostname"));
|
|
8
8
|
const DatabaseProperty_1 = __importDefault(require("./Database/DatabaseProperty"));
|
|
9
|
+
const Domain_1 = __importDefault(require("./Domain"));
|
|
9
10
|
const BadDataException_1 = __importDefault(require("./Exception/BadDataException"));
|
|
10
11
|
const JSON_1 = require("./JSON");
|
|
11
12
|
const Zod_1 = __importDefault(require("../Utils/Schema/Zod"));
|
|
@@ -223,6 +224,21 @@ class Email extends DatabaseProperty_1.default {
|
|
|
223
224
|
}
|
|
224
225
|
return true;
|
|
225
226
|
}
|
|
227
|
+
/*
|
|
228
|
+
* Whether a value is an address on a name RFC 2606 reserves for testing
|
|
229
|
+
* (Domain.isReservedName): a test's or an example's address, never a
|
|
230
|
+
* person's. Reads any value, an address or not, and never throws.
|
|
231
|
+
*/
|
|
232
|
+
static isOnReservedDomain(value) {
|
|
233
|
+
if (typeof value !== "string") {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
const at = value.lastIndexOf("@");
|
|
237
|
+
if (at < 0) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
return Domain_1.default.isReservedName(value.slice(at + 1));
|
|
241
|
+
}
|
|
226
242
|
static toDatabase(value) {
|
|
227
243
|
if (value) {
|
|
228
244
|
if (typeof value === "string") {
|
|
@@ -3,3 +3,9 @@ export interface IncomingCallPolicyRepeatSettings {
|
|
|
3
3
|
repeatPolicyIfNoOneAnswersTimes?: number | null | undefined;
|
|
4
4
|
}
|
|
5
5
|
export declare function getIncomingCallPolicyRepeatsAllowed(policy: IncomingCallPolicyRepeatSettings | null | undefined): number;
|
|
6
|
+
export declare const INCOMING_CALL_POLICY_REPEAT_COLUMNS: ReadonlyArray<string>;
|
|
7
|
+
export declare const INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL: string;
|
|
8
|
+
export declare function getIncomingCallPolicyRepeatRefusal(policy: {
|
|
9
|
+
repeatPolicyIfNoOneAnswers?: unknown;
|
|
10
|
+
repeatPolicyIfNoOneAnswersTimes?: unknown;
|
|
11
|
+
}): string | null;
|
|
@@ -3,3 +3,9 @@ export interface IncomingCallPolicyRepeatSettings {
|
|
|
3
3
|
repeatPolicyIfNoOneAnswersTimes?: number | null | undefined;
|
|
4
4
|
}
|
|
5
5
|
export declare function getIncomingCallPolicyRepeatsAllowed(policy: IncomingCallPolicyRepeatSettings | null | undefined): number;
|
|
6
|
+
export declare const INCOMING_CALL_POLICY_REPEAT_COLUMNS: ReadonlyArray<string>;
|
|
7
|
+
export declare const INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL: string;
|
|
8
|
+
export declare function getIncomingCallPolicyRepeatRefusal(policy: {
|
|
9
|
+
repeatPolicyIfNoOneAnswers?: unknown;
|
|
10
|
+
repeatPolicyIfNoOneAnswersTimes?: unknown;
|
|
11
|
+
}): string | null;
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* How many more times an incoming call policy rings its escalation rules
|
|
4
|
-
* from the first one, after the last one rang and nobody answered.
|
|
5
|
-
*
|
|
6
|
-
* A policy stores it in two columns: repeatPolicyIfNoOneAnswers (the switch)
|
|
7
|
-
* and repeatPolicyIfNoOneAnswersTimes (how many times). The call handler
|
|
8
|
-
* (Notification/API/IncomingCall: dial-status) starts the rules again while
|
|
9
|
-
* the call's repeatCount is below this, and the policy's Settings page says
|
|
10
|
-
* the same in words (its "Repeat Policy" card). So both read it here.
|
|
11
|
-
*
|
|
12
|
-
* Unlike an on-call policy's repeats (OnCallDutyPolicyRepeat), a number left
|
|
13
|
-
* at 0, or never set, counts as 1 while the switch is on: the call handler
|
|
14
|
-
* has always read `times || 1`. A negative number never repeats.
|
|
15
|
-
*/
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL = exports.INCOMING_CALL_POLICY_REPEAT_COLUMNS = void 0;
|
|
17
4
|
exports.getIncomingCallPolicyRepeatsAllowed = getIncomingCallPolicyRepeatsAllowed;
|
|
5
|
+
exports.getIncomingCallPolicyRepeatRefusal = getIncomingCallPolicyRepeatRefusal;
|
|
6
|
+
const OnCallDutyPolicyRepeat_1 = require("../OnCallDutyPolicy/OnCallDutyPolicyRepeat");
|
|
18
7
|
/*
|
|
19
8
|
* The number of times the rules start again from the first: 0 while the
|
|
20
9
|
* switch is off, otherwise the number - 1 when it is 0 or not set.
|
|
@@ -37,3 +26,41 @@ function getIncomingCallPolicyRepeatsAllowed(policy) {
|
|
|
37
26
|
*/
|
|
38
27
|
return Math.ceil(times);
|
|
39
28
|
}
|
|
29
|
+
/*
|
|
30
|
+
* A POLICY THAT SAYS IT RINGS AGAIN SAYS HOW MANY TIMES: 1 OR MORE.
|
|
31
|
+
*
|
|
32
|
+
* The call handler reads the switch on with 0 as "ring again once" (above),
|
|
33
|
+
* a quirk kept for the policies stored that way. The Dashboard's Repeat
|
|
34
|
+
* Policy card never makes it - its "How many more times?" box takes a whole
|
|
35
|
+
* number of 1 or more - and the server holds the API, Terraform, MCP and
|
|
36
|
+
* workflows to the same (IncomingCallPolicyService, through
|
|
37
|
+
* Server/Utils/Database/ColumnRuleCheck): 0, a negative number or a part of
|
|
38
|
+
* one is refused while the switch is on. A policy stored that way before
|
|
39
|
+
* keeps ringing as it did, and an edit that leaves the pair as it is still
|
|
40
|
+
* saves.
|
|
41
|
+
*
|
|
42
|
+
* A number not given is the column's default, 1: turning the switch on
|
|
43
|
+
* alone rings again once, as it always did.
|
|
44
|
+
*/
|
|
45
|
+
exports.INCOMING_CALL_POLICY_REPEAT_COLUMNS = [
|
|
46
|
+
"repeatPolicyIfNoOneAnswers",
|
|
47
|
+
"repeatPolicyIfNoOneAnswersTimes",
|
|
48
|
+
];
|
|
49
|
+
exports.INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL = "An incoming call policy that repeats must ring again at least once: set Repeat Policy Times to a whole number of 1 or more, or turn off Repeat Policy If No One Answers.";
|
|
50
|
+
/*
|
|
51
|
+
* The refusal for a pair that says it rings again without a whole number of
|
|
52
|
+
* times of 1 or more, or null: the switch off, on with the number not given,
|
|
53
|
+
* or on with 1 or more.
|
|
54
|
+
*/
|
|
55
|
+
function getIncomingCallPolicyRepeatRefusal(policy) {
|
|
56
|
+
if (policy.repeatPolicyIfNoOneAnswers !== true) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
// Not given: the column's default, 1.
|
|
60
|
+
if (policy.repeatPolicyIfNoOneAnswersTimes === undefined) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return (0, OnCallDutyPolicyRepeat_1.isRepeatCountOfAtLeastOne)(policy.repeatPolicyIfNoOneAnswersTimes)
|
|
64
|
+
? null
|
|
65
|
+
: exports.INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL;
|
|
66
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import commonJsModule from "./IncomingCallPolicyRepeat.js";
|
|
2
|
+
export const INCOMING_CALL_POLICY_REPEAT_COLUMNS = commonJsModule.INCOMING_CALL_POLICY_REPEAT_COLUMNS;
|
|
3
|
+
export const INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL = commonJsModule.INCOMING_CALL_POLICY_REPEAT_TIMES_REFUSAL;
|
|
4
|
+
export const getIncomingCallPolicyRepeatRefusal = commonJsModule.getIncomingCallPolicyRepeatRefusal;
|
|
2
5
|
export const getIncomingCallPolicyRepeatsAllowed = commonJsModule.getIncomingCallPolicyRepeatsAllowed;
|
|
@@ -58,6 +58,7 @@ export declare enum CheckOn {
|
|
|
58
58
|
EmailReceivedAt = "Email Received",
|
|
59
59
|
SnmpOidValue = "SNMP OID Value",
|
|
60
60
|
SnmpOidExists = "SNMP OID Exists",
|
|
61
|
+
SnmpOidRatePerSecond = "SNMP OID Rate (per second)",
|
|
61
62
|
SnmpResponseTime = "SNMP Response Time (in ms)",
|
|
62
63
|
SnmpIsOnline = "SNMP Device Is Online",
|
|
63
64
|
SnmpWalkIsSucceeding = "SNMP Walk Is Succeeding",
|
|
@@ -58,6 +58,7 @@ export declare enum CheckOn {
|
|
|
58
58
|
EmailReceivedAt = "Email Received",
|
|
59
59
|
SnmpOidValue = "SNMP OID Value",
|
|
60
60
|
SnmpOidExists = "SNMP OID Exists",
|
|
61
|
+
SnmpOidRatePerSecond = "SNMP OID Rate (per second)",
|
|
61
62
|
SnmpResponseTime = "SNMP Response Time (in ms)",
|
|
62
63
|
SnmpIsOnline = "SNMP Device Is Online",
|
|
63
64
|
SnmpWalkIsSucceeding = "SNMP Walk Is Succeeding",
|
|
@@ -83,6 +83,15 @@ var CheckOn;
|
|
|
83
83
|
// SNMP monitors.
|
|
84
84
|
CheckOn["SnmpOidValue"] = "SNMP OID Value";
|
|
85
85
|
CheckOn["SnmpOidExists"] = "SNMP OID Exists";
|
|
86
|
+
/*
|
|
87
|
+
* How fast a counter OID (Counter32, Counter64) grew, per second, between
|
|
88
|
+
* the device's last two polls that read it. A counter only ever grows
|
|
89
|
+
* until it wraps or the device restarts, so its value against a threshold
|
|
90
|
+
* stays crossed once crossed: its rate is what says how busy, how lossy
|
|
91
|
+
* or how full of errors something is now. Not evaluated until the device
|
|
92
|
+
* has been polled twice, nor on a poll whose counter went backwards.
|
|
93
|
+
*/
|
|
94
|
+
CheckOn["SnmpOidRatePerSecond"] = "SNMP OID Rate (per second)";
|
|
86
95
|
CheckOn["SnmpResponseTime"] = "SNMP Response Time (in ms)";
|
|
87
96
|
/*
|
|
88
97
|
* Device reachability: true when the device answered ping OR its SNMP
|
|
@@ -206,7 +206,7 @@ const databaseMetricCatalog = [
|
|
|
206
206
|
id: "database-rollback-percent",
|
|
207
207
|
metricType: MonitorMetricType_1.default.DatabaseRollbackPercent,
|
|
208
208
|
friendlyName: "Rollback Ratio",
|
|
209
|
-
description: "Share of transactions that rolled back rather than committed. A step change usually means the application started throwing where it used to succeed.",
|
|
209
|
+
description: "Share of transactions since the previous check that rolled back rather than committed. A step change usually means the application started throwing where it used to succeed.",
|
|
210
210
|
category: DatabaseMetricCategory.Throughput,
|
|
211
211
|
group: DatabaseMetricGroup.Throughput,
|
|
212
212
|
defaultAggregation: AggregationType_1.default.Avg,
|
|
@@ -296,7 +296,7 @@ const databaseMetricCatalog = [
|
|
|
296
296
|
id: "database-cache-hit-percent",
|
|
297
297
|
metricType: MonitorMetricType_1.default.DatabaseCacheHitPercent,
|
|
298
298
|
friendlyName: "Cache Hit Ratio",
|
|
299
|
-
description: "Share of block reads served from the buffer cache instead of disk. A sustained fall means the working set no longer fits in memory.",
|
|
299
|
+
description: "Share of block reads since the previous check served from the buffer cache instead of disk. A sustained fall means the working set no longer fits in memory.",
|
|
300
300
|
category: DatabaseMetricCategory.CacheAndIo,
|
|
301
301
|
group: DatabaseMetricGroup.Throughput,
|
|
302
302
|
defaultAggregation: AggregationType_1.default.Avg,
|
|
@@ -15,6 +15,10 @@ export default interface ExternalStatusPageMonitorResponse {
|
|
|
15
15
|
provider?: string | undefined;
|
|
16
16
|
componentGroupName?: string | undefined;
|
|
17
17
|
componentName?: string | undefined;
|
|
18
|
+
componentNames?: Array<string> | undefined;
|
|
19
|
+
unmatchedComponentNames?: Array<string> | undefined;
|
|
20
|
+
incidentsOutsideScopeCount?: number | undefined;
|
|
21
|
+
activeIncidentNames?: Array<string> | undefined;
|
|
18
22
|
rawBody?: string | undefined;
|
|
19
23
|
isTimeout?: boolean | undefined;
|
|
20
24
|
probeAttempts?: Array<ProbeAttempt> | undefined;
|