@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
|
@@ -200,7 +200,7 @@ class NetworkDeviceAlertPackUtil {
|
|
|
200
200
|
filterCondition: FilterCondition_1.default.All,
|
|
201
201
|
filters: [
|
|
202
202
|
{
|
|
203
|
-
checkOn: CriteriaFilter_1.CheckOn.SnmpOidValue,
|
|
203
|
+
checkOn: data.checkOn || CriteriaFilter_1.CheckOn.SnmpOidValue,
|
|
204
204
|
filterType: data.filterType,
|
|
205
205
|
value: data.value,
|
|
206
206
|
snmpMonitorOptions: { oid: oid },
|
|
@@ -213,7 +213,8 @@ class NetworkDeviceAlertPackUtil {
|
|
|
213
213
|
changeMonitorStatus: false,
|
|
214
214
|
isEnabled: true,
|
|
215
215
|
name: data.name,
|
|
216
|
-
description:
|
|
216
|
+
description: data.description ||
|
|
217
|
+
`The value the device reports for ${data.name === oid ? oid : `${data.name} (${oid})`}.`,
|
|
217
218
|
};
|
|
218
219
|
return instance;
|
|
219
220
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Color from "../Color.mjs";
|
|
2
|
+
import ObjectID from "../ObjectID.mjs";
|
|
3
|
+
import { ScheduledMaintenancePhaseOfState } from "../../Utils/ScheduledMaintenanceStart.mjs";
|
|
4
|
+
export default interface UptimeBarTooltipMaintenance {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
startsAt: Date;
|
|
8
|
+
endsAt: Date;
|
|
9
|
+
currentState?: {
|
|
10
|
+
name: string;
|
|
11
|
+
color: Color;
|
|
12
|
+
} | undefined;
|
|
13
|
+
phase: ScheduledMaintenancePhaseOfState | null;
|
|
14
|
+
monitorIds: Array<ObjectID>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Color from "../Color";
|
|
2
|
+
import ObjectID from "../ObjectID";
|
|
3
|
+
import { ScheduledMaintenancePhaseOfState } from "../../Utils/ScheduledMaintenanceStart";
|
|
4
|
+
export default interface UptimeBarTooltipMaintenance {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
startsAt: Date;
|
|
8
|
+
endsAt: Date;
|
|
9
|
+
currentState?: {
|
|
10
|
+
name: string;
|
|
11
|
+
color: Color;
|
|
12
|
+
} | undefined;
|
|
13
|
+
phase: ScheduledMaintenancePhaseOfState | null;
|
|
14
|
+
monitorIds: Array<ObjectID>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./UptimeBarTooltipMaintenance.js";
|
|
@@ -13,5 +13,10 @@ export default interface UptimeHistoryLabels {
|
|
|
13
13
|
incidentsOnThisDay: string;
|
|
14
14
|
declared: string;
|
|
15
15
|
close: string;
|
|
16
|
+
scheduledMaintenance: string;
|
|
17
|
+
dayLabelWithMaintenance: string;
|
|
18
|
+
oneMaintenanceEvent: string;
|
|
19
|
+
maintenanceEvents: string;
|
|
20
|
+
moreMaintenance: string;
|
|
16
21
|
}
|
|
17
22
|
export declare const DefaultUptimeHistoryLabels: UptimeHistoryLabels;
|
|
@@ -13,5 +13,10 @@ export default interface UptimeHistoryLabels {
|
|
|
13
13
|
incidentsOnThisDay: string;
|
|
14
14
|
declared: string;
|
|
15
15
|
close: string;
|
|
16
|
+
scheduledMaintenance: string;
|
|
17
|
+
dayLabelWithMaintenance: string;
|
|
18
|
+
oneMaintenanceEvent: string;
|
|
19
|
+
maintenanceEvents: string;
|
|
20
|
+
moreMaintenance: string;
|
|
16
21
|
}
|
|
17
22
|
export declare const DefaultUptimeHistoryLabels: UptimeHistoryLabels;
|
|
@@ -16,4 +16,9 @@ exports.DefaultUptimeHistoryLabels = {
|
|
|
16
16
|
incidentsOnThisDay: "{{total}} incidents reported on this day",
|
|
17
17
|
declared: "Declared",
|
|
18
18
|
close: "Close",
|
|
19
|
+
scheduledMaintenance: "Scheduled maintenance",
|
|
20
|
+
dayLabelWithMaintenance: "{{label}}, {{maintenance}}",
|
|
21
|
+
oneMaintenanceEvent: "1 scheduled maintenance event",
|
|
22
|
+
maintenanceEvents: "{{total}} scheduled maintenance events",
|
|
23
|
+
moreMaintenance: "+{{total}} more",
|
|
19
24
|
};
|
|
@@ -86,6 +86,8 @@ exports.ROLLUP_CATEGORY_BY_EVENT_TYPE = {
|
|
|
86
86
|
[NotificationSettingEventType_1.default.SEND_INCIDENT_OWNER_ADDED_NOTIFICATION]: RollupCategory.Incidents,
|
|
87
87
|
[NotificationSettingEventType_1.default.SEND_INCIDENT_MEMBER_ADDED_NOTIFICATION]: RollupCategory.Incidents,
|
|
88
88
|
[NotificationSettingEventType_1.default.SEND_INCIDENT_REMINDER_OWNER_NOTIFICATION]: RollupCategory.Incidents,
|
|
89
|
+
// Never held back (NEVER_ROLLED_UP_EVENT_TYPES): filed here all the same.
|
|
90
|
+
[NotificationSettingEventType_1.default.SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION]: RollupCategory.Incidents,
|
|
89
91
|
// Alerts
|
|
90
92
|
[NotificationSettingEventType_1.default.SEND_ALERT_CREATED_OWNER_NOTIFICATION]: RollupCategory.Alerts,
|
|
91
93
|
[NotificationSettingEventType_1.default.SEND_ALERT_NOTE_POSTED_OWNER_NOTIFICATION]: RollupCategory.Alerts,
|
|
@@ -15,8 +15,8 @@ const NotificationSettingEventType_1 = __importDefault(require("./NotificationSe
|
|
|
15
15
|
* between them.
|
|
16
16
|
*/
|
|
17
17
|
/*
|
|
18
|
-
* Time-critical
|
|
19
|
-
*
|
|
18
|
+
* Time-critical mail. Never held back, never counted, never written to the
|
|
19
|
+
* queue table at all.
|
|
20
20
|
*
|
|
21
21
|
* A five-minute coalescing window eats a thirty-minute shift lead time, which
|
|
22
22
|
* is the entire value of "your shift starts soon". And "you are on call now",
|
|
@@ -24,6 +24,12 @@ const NotificationSettingEventType_1 = __importDefault(require("./NotificationSe
|
|
|
24
24
|
* allowed to have. The saving from rolling these up would be nil anyway: they
|
|
25
25
|
* fire once per roster transition, not per resource, so they are not what
|
|
26
26
|
* floods anyone's inbox.
|
|
27
|
+
*
|
|
28
|
+
* An SLA breach is a deadline that has already passed: holding it back five
|
|
29
|
+
* minutes to batch it with the incident chatter that caused it is exactly
|
|
30
|
+
* backwards, and it fires once per deadline. It borrowed "Incident created"
|
|
31
|
+
* until it had an event of its own, so its sender asked for the bypass
|
|
32
|
+
* (forceImmediate) every time; now the event type says it.
|
|
27
33
|
*/
|
|
28
34
|
exports.NEVER_ROLLED_UP_EVENT_TYPES = new Set([
|
|
29
35
|
NotificationSettingEventType_1.default.SEND_WHEN_USER_IS_ON_CALL_ROSTER,
|
|
@@ -31,6 +37,7 @@ exports.NEVER_ROLLED_UP_EVENT_TYPES = new Set([
|
|
|
31
37
|
NotificationSettingEventType_1.default.SEND_WHEN_USER_IS_NO_LONGER_ACTIVE_ON_ON_CALL_ROSTER,
|
|
32
38
|
NotificationSettingEventType_1.default.SEND_BEFORE_USER_ON_CALL_SHIFT_STARTS,
|
|
33
39
|
NotificationSettingEventType_1.default.SEND_WHEN_USER_ON_CALL_SHIFT_IS_REASSIGNED,
|
|
40
|
+
NotificationSettingEventType_1.default.SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION,
|
|
34
41
|
]);
|
|
35
42
|
/*
|
|
36
43
|
* SHRINK-ONLY. These two carry ON_CALL in their member name and are still
|
|
@@ -63,7 +70,7 @@ exports.ROLLUP_ELIGIBLE_ON_CALL_ADMIN_EVENT_TYPES = new Set([
|
|
|
63
70
|
NotificationSettingEventType_1.default.SEND_WHEN_USER_IS_REMOVED_FROM_ON_CALL_POLICY,
|
|
64
71
|
]);
|
|
65
72
|
/*
|
|
66
|
-
* Everything else -
|
|
73
|
+
* Everything else - every other member. Derived from the enum by exclusion
|
|
67
74
|
* rather than listed by hand, so the two sets are a partition by construction
|
|
68
75
|
* and cannot drift: there is no edit that adds a member to both, and no edit
|
|
69
76
|
* that drops one from both.
|
|
@@ -5,6 +5,7 @@ declare enum NotificationSettingEventType {
|
|
|
5
5
|
SEND_INCIDENT_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the incident",
|
|
6
6
|
SEND_INCIDENT_MEMBER_ADDED_NOTIFICATION = "Send notification when I am assigned to an incident as a member",
|
|
7
7
|
SEND_INCIDENT_REMINDER_OWNER_NOTIFICATION = "Send reminder notification when an incident I own is still open",
|
|
8
|
+
SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION = "Send notification when an incident I own misses an SLA deadline",
|
|
8
9
|
SEND_ALERT_CREATED_OWNER_NOTIFICATION = "Send alert created notification when I am the owner of the alert",
|
|
9
10
|
SEND_ALERT_NOTE_POSTED_OWNER_NOTIFICATION = "Send alert note posted notification when I am the owner of the alert",
|
|
10
11
|
SEND_ALERT_STATE_CHANGED_OWNER_NOTIFICATION = "Send alert state changed notification when I am the owner of the alert",
|
|
@@ -5,6 +5,7 @@ declare enum NotificationSettingEventType {
|
|
|
5
5
|
SEND_INCIDENT_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the incident",
|
|
6
6
|
SEND_INCIDENT_MEMBER_ADDED_NOTIFICATION = "Send notification when I am assigned to an incident as a member",
|
|
7
7
|
SEND_INCIDENT_REMINDER_OWNER_NOTIFICATION = "Send reminder notification when an incident I own is still open",
|
|
8
|
+
SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION = "Send notification when an incident I own misses an SLA deadline",
|
|
8
9
|
SEND_ALERT_CREATED_OWNER_NOTIFICATION = "Send alert created notification when I am the owner of the alert",
|
|
9
10
|
SEND_ALERT_NOTE_POSTED_OWNER_NOTIFICATION = "Send alert note posted notification when I am the owner of the alert",
|
|
10
11
|
SEND_ALERT_STATE_CHANGED_OWNER_NOTIFICATION = "Send alert state changed notification when I am the owner of the alert",
|
|
@@ -9,6 +9,13 @@ var NotificationSettingEventType;
|
|
|
9
9
|
NotificationSettingEventType["SEND_INCIDENT_OWNER_ADDED_NOTIFICATION"] = "Send notification when I am added as a owner to the incident";
|
|
10
10
|
NotificationSettingEventType["SEND_INCIDENT_MEMBER_ADDED_NOTIFICATION"] = "Send notification when I am assigned to an incident as a member";
|
|
11
11
|
NotificationSettingEventType["SEND_INCIDENT_REMINDER_OWNER_NOTIFICATION"] = "Send reminder notification when an incident I own is still open";
|
|
12
|
+
/*
|
|
13
|
+
* An incident SLA rule's response or resolution deadline passed
|
|
14
|
+
* (Workers IncidentSla/CheckSlaBreaches). Its own event since it had
|
|
15
|
+
* borrowed SEND_INCIDENT_CREATED_OWNER_NOTIFICATION, so switching off
|
|
16
|
+
* "Incident created" silenced SLA breaches too.
|
|
17
|
+
*/
|
|
18
|
+
NotificationSettingEventType["SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION"] = "Send notification when an incident I own misses an SLA deadline";
|
|
12
19
|
// Alerts
|
|
13
20
|
NotificationSettingEventType["SEND_ALERT_CREATED_OWNER_NOTIFICATION"] = "Send alert created notification when I am the owner of the alert";
|
|
14
21
|
NotificationSettingEventType["SEND_ALERT_NOTE_POSTED_OWNER_NOTIFICATION"] = "Send alert note posted notification when I am the owner of the alert";
|
|
@@ -3,3 +3,10 @@ export interface OnCallDutyPolicyRepeatSettings {
|
|
|
3
3
|
repeatPolicyIfNoOneAcknowledgesNoOfTimes?: number | null | undefined;
|
|
4
4
|
}
|
|
5
5
|
export declare function getOnCallPolicyRepeatsAllowed(policy: OnCallDutyPolicyRepeatSettings | null | undefined): number;
|
|
6
|
+
export declare const ON_CALL_POLICY_REPEAT_COLUMNS: ReadonlyArray<string>;
|
|
7
|
+
export declare const ON_CALL_POLICY_REPEAT_TIMES_REFUSAL: string;
|
|
8
|
+
export declare function isRepeatCountOfAtLeastOne(value: unknown): boolean;
|
|
9
|
+
export declare function getOnCallPolicyRepeatRefusal(policy: {
|
|
10
|
+
repeatPolicyIfNoOneAcknowledges?: unknown;
|
|
11
|
+
repeatPolicyIfNoOneAcknowledgesNoOfTimes?: unknown;
|
|
12
|
+
}): string | null;
|
|
@@ -3,3 +3,10 @@ export interface OnCallDutyPolicyRepeatSettings {
|
|
|
3
3
|
repeatPolicyIfNoOneAcknowledgesNoOfTimes?: number | null | undefined;
|
|
4
4
|
}
|
|
5
5
|
export declare function getOnCallPolicyRepeatsAllowed(policy: OnCallDutyPolicyRepeatSettings | null | undefined): number;
|
|
6
|
+
export declare const ON_CALL_POLICY_REPEAT_COLUMNS: ReadonlyArray<string>;
|
|
7
|
+
export declare const ON_CALL_POLICY_REPEAT_TIMES_REFUSAL: string;
|
|
8
|
+
export declare function isRepeatCountOfAtLeastOne(value: unknown): boolean;
|
|
9
|
+
export declare function getOnCallPolicyRepeatRefusal(policy: {
|
|
10
|
+
repeatPolicyIfNoOneAcknowledges?: unknown;
|
|
11
|
+
repeatPolicyIfNoOneAcknowledgesNoOfTimes?: unknown;
|
|
12
|
+
}): string | null;
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
* Slack and Microsoft Teams message of a run (OnCallPolicyRunMessage).
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ON_CALL_POLICY_REPEAT_TIMES_REFUSAL = exports.ON_CALL_POLICY_REPEAT_COLUMNS = void 0;
|
|
21
22
|
exports.getOnCallPolicyRepeatsAllowed = getOnCallPolicyRepeatsAllowed;
|
|
23
|
+
exports.isRepeatCountOfAtLeastOne = isRepeatCountOfAtLeastOne;
|
|
24
|
+
exports.getOnCallPolicyRepeatRefusal = getOnCallPolicyRepeatRefusal;
|
|
22
25
|
/*
|
|
23
26
|
* The number of repeats a run may make: 0 while "Repeat if no one
|
|
24
27
|
* acknowledges" is off, otherwise "Number of times to repeat" - a whole
|
|
@@ -35,3 +38,51 @@ function getOnCallPolicyRepeatsAllowed(policy) {
|
|
|
35
38
|
}
|
|
36
39
|
return Math.floor(times);
|
|
37
40
|
}
|
|
41
|
+
/*
|
|
42
|
+
* A POLICY THAT SAYS IT REPEATS MUST REPEAT AT LEAST ONCE.
|
|
43
|
+
*
|
|
44
|
+
* "Repeat if no one acknowledges" on with "Number of times to repeat" at 0
|
|
45
|
+
* (or below it, or not a whole number) says the policy starts again and
|
|
46
|
+
* never does: the run reads 0 repeats (above), and every screen reads the
|
|
47
|
+
* pair as "Stop paging". The Dashboard's Repeat Policy card cannot make it -
|
|
48
|
+
* its "How many more times?" box takes a whole number of 1 or more - and the
|
|
49
|
+
* server holds the API, Terraform, MCP and workflows to the same
|
|
50
|
+
* (OnCallDutyPolicyService, through Server/Utils/Database/ColumnRuleCheck).
|
|
51
|
+
* A policy stored that way before keeps running as it did, once, and an edit
|
|
52
|
+
* that leaves the pair as it is still saves.
|
|
53
|
+
*
|
|
54
|
+
* A number not given is the column's default, 0: a create that turns the
|
|
55
|
+
* switch on must say how many times.
|
|
56
|
+
*/
|
|
57
|
+
exports.ON_CALL_POLICY_REPEAT_COLUMNS = [
|
|
58
|
+
"repeatPolicyIfNoOneAcknowledges",
|
|
59
|
+
"repeatPolicyIfNoOneAcknowledgesNoOfTimes",
|
|
60
|
+
];
|
|
61
|
+
exports.ON_CALL_POLICY_REPEAT_TIMES_REFUSAL = "An on-call policy that repeats must start again at least once: set Repeat Policy Times If No One Acknowledges to a whole number of 1 or more, or turn off Repeat Policy If No One Acknowledges.";
|
|
62
|
+
/*
|
|
63
|
+
* Whether a count, as a write sends it, is a whole number of at least 1. A
|
|
64
|
+
* number or its digits; anything else - nothing, an empty box, a part of a
|
|
65
|
+
* number, 0 or below - is not.
|
|
66
|
+
*/
|
|
67
|
+
function isRepeatCountOfAtLeastOne(value) {
|
|
68
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if (typeof value === "string" && !value.trim()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const times = Number(value);
|
|
75
|
+
return Number.isFinite(times) && Number.isInteger(times) && times >= 1;
|
|
76
|
+
}
|
|
77
|
+
/*
|
|
78
|
+
* The refusal for a pair that says it repeats and never does, or null: the
|
|
79
|
+
* switch off (the number then means nothing), or on with 1 or more.
|
|
80
|
+
*/
|
|
81
|
+
function getOnCallPolicyRepeatRefusal(policy) {
|
|
82
|
+
if (policy.repeatPolicyIfNoOneAcknowledges !== true) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return isRepeatCountOfAtLeastOne(policy.repeatPolicyIfNoOneAcknowledgesNoOfTimes)
|
|
86
|
+
? null
|
|
87
|
+
: exports.ON_CALL_POLICY_REPEAT_TIMES_REFUSAL;
|
|
88
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import commonJsModule from "./OnCallDutyPolicyRepeat.js";
|
|
2
|
+
export const ON_CALL_POLICY_REPEAT_COLUMNS = commonJsModule.ON_CALL_POLICY_REPEAT_COLUMNS;
|
|
3
|
+
export const ON_CALL_POLICY_REPEAT_TIMES_REFUSAL = commonJsModule.ON_CALL_POLICY_REPEAT_TIMES_REFUSAL;
|
|
4
|
+
export const getOnCallPolicyRepeatRefusal = commonJsModule.getOnCallPolicyRepeatRefusal;
|
|
2
5
|
export const getOnCallPolicyRepeatsAllowed = commonJsModule.getOnCallPolicyRepeatsAllowed;
|
|
6
|
+
export const isRepeatCountOfAtLeastOne = commonJsModule.isRepeatCountOfAtLeastOne;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ReadingDirection = "ltr" | "rtl";
|
|
2
|
+
export declare const LEFT_TO_RIGHT: ReadingDirection;
|
|
3
|
+
export declare const RIGHT_TO_LEFT: ReadingDirection;
|
|
4
|
+
export declare const RIGHT_TO_LEFT_LANGUAGES: ReadonlyArray<string>;
|
|
5
|
+
export declare const RIGHT_TO_LEFT_SCRIPTS: ReadonlyArray<string>;
|
|
6
|
+
export declare const getReadingDirection: (language: string | null | undefined) => ReadingDirection;
|
|
7
|
+
export declare const isRightToLeftLanguage: (language: string | null | undefined) => boolean;
|
|
8
|
+
export declare const TEXT_DIRECTION_SCAN_LENGTH: number;
|
|
9
|
+
export declare const getTextReadingDirectionByMostLetters: (text: string | null | undefined) => ReadingDirection | null;
|
|
10
|
+
export declare const getTextReadingDirection: (text: string | null | undefined) => ReadingDirection | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ReadingDirection = "ltr" | "rtl";
|
|
2
|
+
export declare const LEFT_TO_RIGHT: ReadingDirection;
|
|
3
|
+
export declare const RIGHT_TO_LEFT: ReadingDirection;
|
|
4
|
+
export declare const RIGHT_TO_LEFT_LANGUAGES: ReadonlyArray<string>;
|
|
5
|
+
export declare const RIGHT_TO_LEFT_SCRIPTS: ReadonlyArray<string>;
|
|
6
|
+
export declare const getReadingDirection: (language: string | null | undefined) => ReadingDirection;
|
|
7
|
+
export declare const isRightToLeftLanguage: (language: string | null | undefined) => boolean;
|
|
8
|
+
export declare const TEXT_DIRECTION_SCAN_LENGTH: number;
|
|
9
|
+
export declare const getTextReadingDirectionByMostLetters: (text: string | null | undefined) => ReadingDirection | null;
|
|
10
|
+
export declare const getTextReadingDirection: (text: string | null | undefined) => ReadingDirection | null;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* WHICH WAY A LANGUAGE IS READ.
|
|
4
|
+
*
|
|
5
|
+
* Persian - the one such language OneUptime is translated into today - is
|
|
6
|
+
* written from right to left, like Arabic, Hebrew and Urdu; every other
|
|
7
|
+
* language of the product from left to right. A page says which on <html
|
|
8
|
+
* dir> (Common/UI/Utils/PageLanguage), and its layout follows: rows and
|
|
9
|
+
* grids run from the right, and Tailwind's left and right utilities mean
|
|
10
|
+
* the start and the end of the line (Common/UI/Styles/
|
|
11
|
+
* TailwindReadingDirection.js).
|
|
12
|
+
*
|
|
13
|
+
* Read from the language tag alone, so a server, a test and every frontend
|
|
14
|
+
* agree without Intl: the script when the tag names one ("az-Arab",
|
|
15
|
+
* "ku-Latn"), the language otherwise.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getTextReadingDirection = exports.getTextReadingDirectionByMostLetters = exports.TEXT_DIRECTION_SCAN_LENGTH = exports.isRightToLeftLanguage = exports.getReadingDirection = exports.RIGHT_TO_LEFT_SCRIPTS = exports.RIGHT_TO_LEFT_LANGUAGES = exports.RIGHT_TO_LEFT = exports.LEFT_TO_RIGHT = void 0;
|
|
19
|
+
exports.LEFT_TO_RIGHT = "ltr";
|
|
20
|
+
exports.RIGHT_TO_LEFT = "rtl";
|
|
21
|
+
// Languages written from right to left, by their primary subtag.
|
|
22
|
+
exports.RIGHT_TO_LEFT_LANGUAGES = [
|
|
23
|
+
"ar", // Arabic
|
|
24
|
+
"arc", // Aramaic
|
|
25
|
+
"azb", // South Azerbaijani
|
|
26
|
+
"ckb", // Central Kurdish (Sorani)
|
|
27
|
+
"dv", // Dhivehi
|
|
28
|
+
"fa", // Persian
|
|
29
|
+
"glk", // Gilaki
|
|
30
|
+
"he", // Hebrew
|
|
31
|
+
"iw", // Hebrew, the old code
|
|
32
|
+
"ks", // Kashmiri
|
|
33
|
+
"lrc", // Northern Luri
|
|
34
|
+
"mzn", // Mazanderani
|
|
35
|
+
"nqo", // N'Ko
|
|
36
|
+
"prs", // Dari
|
|
37
|
+
"ps", // Pashto
|
|
38
|
+
"sd", // Sindhi
|
|
39
|
+
"syr", // Syriac
|
|
40
|
+
"ug", // Uyghur
|
|
41
|
+
"ur", // Urdu
|
|
42
|
+
"yi", // Yiddish
|
|
43
|
+
];
|
|
44
|
+
// Scripts written from right to left, by their ISO 15924 code.
|
|
45
|
+
exports.RIGHT_TO_LEFT_SCRIPTS = [
|
|
46
|
+
"adlm", // Adlam
|
|
47
|
+
"arab", // Arabic
|
|
48
|
+
"hebr", // Hebrew
|
|
49
|
+
"mand", // Mandaic
|
|
50
|
+
"nkoo", // N'Ko
|
|
51
|
+
"rohg", // Hanifi Rohingya
|
|
52
|
+
"samr", // Samaritan
|
|
53
|
+
"syrc", // Syriac
|
|
54
|
+
"thaa", // Thaana
|
|
55
|
+
];
|
|
56
|
+
const SUBTAG_SEPARATOR_REGEX = /[-_]/;
|
|
57
|
+
// A script subtag is four letters ("Arab", "Latn").
|
|
58
|
+
const SCRIPT_SUBTAG_REGEX = /^[a-z]{4}$/;
|
|
59
|
+
// "fa", "fa-IR", "fa_IR", "az-Arab-IR": a language's subtags, lowercased.
|
|
60
|
+
const getSubtags = (language) => {
|
|
61
|
+
return language
|
|
62
|
+
.trim()
|
|
63
|
+
.toLowerCase()
|
|
64
|
+
.split(SUBTAG_SEPARATOR_REGEX)
|
|
65
|
+
.filter((subtag) => {
|
|
66
|
+
return subtag.length > 0;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
// Which way `language` is read: left to right unless it is written from the right.
|
|
70
|
+
const getReadingDirection = (language) => {
|
|
71
|
+
if (!language) {
|
|
72
|
+
return exports.LEFT_TO_RIGHT;
|
|
73
|
+
}
|
|
74
|
+
const subtags = getSubtags(language);
|
|
75
|
+
const primary = subtags[0];
|
|
76
|
+
if (!primary) {
|
|
77
|
+
return exports.LEFT_TO_RIGHT;
|
|
78
|
+
}
|
|
79
|
+
// A script subtag, right after the language, decides.
|
|
80
|
+
const script = subtags[1];
|
|
81
|
+
if (script && SCRIPT_SUBTAG_REGEX.test(script)) {
|
|
82
|
+
return exports.RIGHT_TO_LEFT_SCRIPTS.includes(script)
|
|
83
|
+
? exports.RIGHT_TO_LEFT
|
|
84
|
+
: exports.LEFT_TO_RIGHT;
|
|
85
|
+
}
|
|
86
|
+
return exports.RIGHT_TO_LEFT_LANGUAGES.includes(primary)
|
|
87
|
+
? exports.RIGHT_TO_LEFT
|
|
88
|
+
: exports.LEFT_TO_RIGHT;
|
|
89
|
+
};
|
|
90
|
+
exports.getReadingDirection = getReadingDirection;
|
|
91
|
+
const isRightToLeftLanguage = (language) => {
|
|
92
|
+
return (0, exports.getReadingDirection)(language) === exports.RIGHT_TO_LEFT;
|
|
93
|
+
};
|
|
94
|
+
exports.isRightToLeftLanguage = isRightToLeftLanguage;
|
|
95
|
+
/*
|
|
96
|
+
* WHICH WAY A TEXT SOMEONE WROTE IS READ.
|
|
97
|
+
*
|
|
98
|
+
* A team's note, a description or an answer from OneUptime AI is written
|
|
99
|
+
* in whatever language its author wrote it in - an English note on a
|
|
100
|
+
* Persian page, a Persian one on an English page. While it is being typed
|
|
101
|
+
* it reads the way its first letter does, as a browser decides
|
|
102
|
+
* dir="auto": a letter of a right-to-left script makes it right to left,
|
|
103
|
+
* any other letter left to right, and the line does not turn round as the
|
|
104
|
+
* words come. Digits, punctuation and Markdown's own marks ("## ", "- ",
|
|
105
|
+
* "**") decide nothing. Null when there is no letter to go by, so the text
|
|
106
|
+
* follows the page.
|
|
107
|
+
*
|
|
108
|
+
* Only the start of the text is read (TEXT_DIRECTION_SCAN_LENGTH): a log
|
|
109
|
+
* of megabytes is decided by its first letter, not scanned to its end.
|
|
110
|
+
*/
|
|
111
|
+
exports.TEXT_DIRECTION_SCAN_LENGTH = 4096;
|
|
112
|
+
const FIRST_LETTER_REGEX = /\p{L}/u;
|
|
113
|
+
const RIGHT_TO_LEFT_LETTER_REGEX = /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}\p{Script=Adlam}\p{Script=Hanifi_Rohingya}\p{Script=Mandaic}\p{Script=Samaritan}]/u;
|
|
114
|
+
// One letter, of any script.
|
|
115
|
+
const LETTER_REGEX = /^\p{L}$/u;
|
|
116
|
+
/*
|
|
117
|
+
* WHICH WAY A TEXT SHOWN ON A PAGE IS READ: the way most of its letters
|
|
118
|
+
* read. A name, a description or a paragraph of a note is shown, not typed,
|
|
119
|
+
* so it can be read as a whole: "`kubectl` را اجرا کنید" and "API پرداخت از
|
|
120
|
+
* کار افتاده" are Persian sentences that start with an English word, and
|
|
121
|
+
* laid out from that first letter their Persian words came out in the
|
|
122
|
+
* wrong order. "Checkout API (EU)" and "Rolled back v2.4.1." read left to
|
|
123
|
+
* right, their full stop at their end. A tie goes to the first letter.
|
|
124
|
+
* Null when there is no letter, so the text follows the page; only the
|
|
125
|
+
* first TEXT_DIRECTION_SCAN_LENGTH characters are read.
|
|
126
|
+
*/
|
|
127
|
+
const getTextReadingDirectionByMostLetters = (text) => {
|
|
128
|
+
if (!text) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
let rightToLeftLetters = 0;
|
|
132
|
+
let leftToRightLetters = 0;
|
|
133
|
+
let firstLetterDirection = null;
|
|
134
|
+
// By code point, so a letter outside the Basic Multilingual Plane counts once.
|
|
135
|
+
for (const character of text.slice(0, exports.TEXT_DIRECTION_SCAN_LENGTH)) {
|
|
136
|
+
if (!LETTER_REGEX.test(character)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const direction = RIGHT_TO_LEFT_LETTER_REGEX.test(character)
|
|
140
|
+
? exports.RIGHT_TO_LEFT
|
|
141
|
+
: exports.LEFT_TO_RIGHT;
|
|
142
|
+
if (direction === exports.RIGHT_TO_LEFT) {
|
|
143
|
+
rightToLeftLetters++;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
leftToRightLetters++;
|
|
147
|
+
}
|
|
148
|
+
firstLetterDirection = firstLetterDirection || direction;
|
|
149
|
+
}
|
|
150
|
+
if (rightToLeftLetters === leftToRightLetters) {
|
|
151
|
+
return firstLetterDirection;
|
|
152
|
+
}
|
|
153
|
+
return rightToLeftLetters > leftToRightLetters
|
|
154
|
+
? exports.RIGHT_TO_LEFT
|
|
155
|
+
: exports.LEFT_TO_RIGHT;
|
|
156
|
+
};
|
|
157
|
+
exports.getTextReadingDirectionByMostLetters = getTextReadingDirectionByMostLetters;
|
|
158
|
+
const getTextReadingDirection = (text) => {
|
|
159
|
+
if (!text) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const start = text.slice(0, exports.TEXT_DIRECTION_SCAN_LENGTH);
|
|
163
|
+
const letter = FIRST_LETTER_REGEX.exec(start);
|
|
164
|
+
if (!letter) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
return RIGHT_TO_LEFT_LETTER_REGEX.test(letter[0])
|
|
168
|
+
? exports.RIGHT_TO_LEFT
|
|
169
|
+
: exports.LEFT_TO_RIGHT;
|
|
170
|
+
};
|
|
171
|
+
exports.getTextReadingDirection = getTextReadingDirection;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import commonJsModule from "./ReadingDirection.js";
|
|
2
|
+
export const LEFT_TO_RIGHT = commonJsModule.LEFT_TO_RIGHT;
|
|
3
|
+
export const RIGHT_TO_LEFT = commonJsModule.RIGHT_TO_LEFT;
|
|
4
|
+
export const RIGHT_TO_LEFT_LANGUAGES = commonJsModule.RIGHT_TO_LEFT_LANGUAGES;
|
|
5
|
+
export const RIGHT_TO_LEFT_SCRIPTS = commonJsModule.RIGHT_TO_LEFT_SCRIPTS;
|
|
6
|
+
export const TEXT_DIRECTION_SCAN_LENGTH = commonJsModule.TEXT_DIRECTION_SCAN_LENGTH;
|
|
7
|
+
export const getReadingDirection = commonJsModule.getReadingDirection;
|
|
8
|
+
export const getTextReadingDirection = commonJsModule.getTextReadingDirection;
|
|
9
|
+
export const getTextReadingDirectionByMostLetters = commonJsModule.getTextReadingDirectionByMostLetters;
|
|
10
|
+
export const isRightToLeftLanguage = commonJsModule.isRightToLeftLanguage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS: ReadonlyArray<string>;
|
|
2
|
+
export interface ScheduledMaintenanceReminderTimingValues {
|
|
3
|
+
remindWhileScheduled?: unknown;
|
|
4
|
+
stopRemindersOnState?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare function doesScheduledMaintenanceReminderRuleNeverRemind(values: ScheduledMaintenanceReminderTimingValues): boolean;
|
|
7
|
+
export declare const SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL: string;
|
|
8
|
+
export declare function getScheduledMaintenanceReminderRuleRefusal(values: ScheduledMaintenanceReminderTimingValues): string | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS: ReadonlyArray<string>;
|
|
2
|
+
export interface ScheduledMaintenanceReminderTimingValues {
|
|
3
|
+
remindWhileScheduled?: unknown;
|
|
4
|
+
stopRemindersOnState?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare function doesScheduledMaintenanceReminderRuleNeverRemind(values: ScheduledMaintenanceReminderTimingValues): boolean;
|
|
7
|
+
export declare const SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL: string;
|
|
8
|
+
export declare function getScheduledMaintenanceReminderRuleRefusal(values: ScheduledMaintenanceReminderTimingValues): string | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
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.SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL = exports.SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS = void 0;
|
|
7
|
+
exports.doesScheduledMaintenanceReminderRuleNeverRemind = doesScheduledMaintenanceReminderRuleNeverRemind;
|
|
8
|
+
exports.getScheduledMaintenanceReminderRuleRefusal = getScheduledMaintenanceReminderRuleRefusal;
|
|
9
|
+
const ScheduledMaintenanceReminderStopState_1 = __importDefault(require("./ScheduledMaintenanceReminderStopState"));
|
|
10
|
+
/*
|
|
11
|
+
* A SCHEDULED MAINTENANCE REMINDER RULE THAT WOULD NEVER REMIND.
|
|
12
|
+
*
|
|
13
|
+
* A reminder rule says when it reminds an event's owners with two columns:
|
|
14
|
+
* "Remind While Event is Scheduled" (remindWhileScheduled) and "Stop
|
|
15
|
+
* Reminders When" (stopRemindersOnState). With the switch off, the worker
|
|
16
|
+
* holds the first reminder back until the event starts
|
|
17
|
+
* (Workers/Jobs/ScheduledMaintenanceOwners/SendUnresolvedReminderNotification);
|
|
18
|
+
* with Ongoing, the start is where reminders stop. Together they wait for
|
|
19
|
+
* the start and stop at it: the rule matches every event it is meant for
|
|
20
|
+
* and reminds nobody.
|
|
21
|
+
*
|
|
22
|
+
* The Dashboard's form never makes that pair - it asks one question with
|
|
23
|
+
* three answers (Dashboard Components/Reminders/MaintenanceReminderTiming) -
|
|
24
|
+
* and the server holds every other way of saving a rule to the same: the
|
|
25
|
+
* API, Terraform, MCP and workflows (ScheduledMaintenanceReminderRuleService,
|
|
26
|
+
* through Server/Utils/Database/ColumnRuleCheck). A rule stored that way
|
|
27
|
+
* before the server refused it keeps working as it did: the rules list marks
|
|
28
|
+
* it "Never reminds", and an edit that leaves the pair as it is (a rename)
|
|
29
|
+
* still saves.
|
|
30
|
+
*
|
|
31
|
+
* Server-free and React-free: the server, the Dashboard and the tests read
|
|
32
|
+
* the same rule.
|
|
33
|
+
*/
|
|
34
|
+
// The two columns the rule reads, as the model names them.
|
|
35
|
+
exports.SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS = ["remindWhileScheduled", "stopRemindersOnState"];
|
|
36
|
+
/*
|
|
37
|
+
* Whether the pair waits for the event to start and stops when it starts. A
|
|
38
|
+
* column not given is what a new rule stores: the switch off, Completed.
|
|
39
|
+
*/
|
|
40
|
+
function doesScheduledMaintenanceReminderRuleNeverRemind(values) {
|
|
41
|
+
return (values.remindWhileScheduled !== true &&
|
|
42
|
+
values.stopRemindersOnState ===
|
|
43
|
+
ScheduledMaintenanceReminderStopState_1.default.Ongoing);
|
|
44
|
+
}
|
|
45
|
+
/*
|
|
46
|
+
* What saving that pair is refused with, in the API's own column names:
|
|
47
|
+
* what each of the two columns does to the rule, then the two ways out.
|
|
48
|
+
*/
|
|
49
|
+
exports.SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL = "This reminder rule would never send a reminder: Remind While Event is Scheduled is off, so it waits for the event to start, and Stop Reminders When is Ongoing, so it stops when the event starts. Turn on Remind While Event is Scheduled, or set Stop Reminders When to Completed.";
|
|
50
|
+
// The refusal for a pair that never reminds, or null for one that reminds.
|
|
51
|
+
function getScheduledMaintenanceReminderRuleRefusal(values) {
|
|
52
|
+
return doesScheduledMaintenanceReminderRuleNeverRemind(values)
|
|
53
|
+
? exports.SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL
|
|
54
|
+
: null;
|
|
55
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import commonJsModule from "./ScheduledMaintenanceReminderNeverReminds.js";
|
|
2
|
+
export const SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL = commonJsModule.SCHEDULED_MAINTENANCE_REMINDER_NEVER_REMINDS_REFUSAL;
|
|
3
|
+
export const SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS = commonJsModule.SCHEDULED_MAINTENANCE_REMINDER_TIMING_COLUMNS;
|
|
4
|
+
export const doesScheduledMaintenanceReminderRuleNeverRemind = commonJsModule.doesScheduledMaintenanceReminderRuleNeverRemind;
|
|
5
|
+
export const getScheduledMaintenanceReminderRuleRefusal = commonJsModule.getScheduledMaintenanceReminderRuleRefusal;
|
|
@@ -129,11 +129,13 @@ exports.RULE_CRITERIA_FIELDS_BY_MODEL = {
|
|
|
129
129
|
"matchLabels",
|
|
130
130
|
"nameRegexPattern",
|
|
131
131
|
"descriptionRegexPattern",
|
|
132
|
+
"cloudTagPattern",
|
|
132
133
|
],
|
|
133
134
|
CloudResourceOwnerRule: [
|
|
134
135
|
"matchLabels",
|
|
135
136
|
"nameRegexPattern",
|
|
136
137
|
"descriptionRegexPattern",
|
|
138
|
+
"cloudTagPattern",
|
|
137
139
|
],
|
|
138
140
|
DashboardLabelRule: [
|
|
139
141
|
"dashboardLabels",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpRequestStepConfig } from "./RunbookStep.mjs";
|
|
2
|
+
import { RunbookVariableReference } from "./RunbookVariableReference.mjs";
|
|
3
|
+
export declare function getHttpStepVariableTexts(config: Pick<HttpRequestStepConfig, "url" | "headersJson" | "body">): Array<string>;
|
|
4
|
+
type GetValueFunction = (reference: RunbookVariableReference) => string | undefined;
|
|
5
|
+
export declare function fillHttpStepJsonText(text: string, getValue: GetValueFunction): string;
|
|
6
|
+
export declare function fillHttpStepConfig<T extends HttpRequestStepConfig>(config: T, getValue: GetValueFunction): T;
|
|
7
|
+
export declare function redactHttpStepSecrets(text: string, secretValues: Array<string>): string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpRequestStepConfig } from "./RunbookStep";
|
|
2
|
+
import { RunbookVariableReference } from "./RunbookVariableReference";
|
|
3
|
+
export declare function getHttpStepVariableTexts(config: Pick<HttpRequestStepConfig, "url" | "headersJson" | "body">): Array<string>;
|
|
4
|
+
type GetValueFunction = (reference: RunbookVariableReference) => string | undefined;
|
|
5
|
+
export declare function fillHttpStepJsonText(text: string, getValue: GetValueFunction): string;
|
|
6
|
+
export declare function fillHttpStepConfig<T extends HttpRequestStepConfig>(config: T, getValue: GetValueFunction): T;
|
|
7
|
+
export declare function redactHttpStepSecrets(text: string, secretValues: Array<string>): string;
|
|
8
|
+
export {};
|