@oneuptime/common 14.0.109 → 14.0.110
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/AnalyticsModels/SecurityEvent.js +1 -1
- package/Models/DatabaseModels/AIInsight.js +2 -2
- package/Models/DatabaseModels/Alert.js +2 -2
- package/Models/DatabaseModels/AlertEpisode.js +2 -2
- package/Models/DatabaseModels/AlertEpisodeOnCallRule.js +3 -3
- package/Models/DatabaseModels/AlertGroupingRule.d.mts +1 -0
- package/Models/DatabaseModels/AlertGroupingRule.d.ts +1 -0
- package/Models/DatabaseModels/AlertGroupingRule.js +48 -2
- package/Models/DatabaseModels/AlertOnCallRule.js +3 -3
- package/Models/DatabaseModels/AlertSeverity.js +13 -4
- package/Models/DatabaseModels/AlertState.js +1 -1
- package/Models/DatabaseModels/CallLog.js +12 -12
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.mts +2 -0
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.ts +2 -0
- package/Models/DatabaseModels/EmailLog.js +12 -12
- package/Models/DatabaseModels/FormSubmission.js +2 -2
- package/Models/DatabaseModels/GlobalConfig.d.mts +1 -0
- package/Models/DatabaseModels/GlobalConfig.d.ts +1 -0
- package/Models/DatabaseModels/GlobalConfig.js +28 -0
- package/Models/DatabaseModels/Incident.js +2 -2
- package/Models/DatabaseModels/IncidentEpisode.js +2 -2
- package/Models/DatabaseModels/IncidentEpisodeOnCallRule.js +3 -3
- package/Models/DatabaseModels/IncidentGroupingRule.d.mts +1 -0
- package/Models/DatabaseModels/IncidentGroupingRule.d.ts +1 -0
- package/Models/DatabaseModels/IncidentGroupingRule.js +48 -2
- package/Models/DatabaseModels/IncidentOnCallRule.js +3 -3
- package/Models/DatabaseModels/IncidentSeverity.js +13 -4
- package/Models/DatabaseModels/IncidentState.js +1 -1
- package/Models/DatabaseModels/IncidentTemplate.js +2 -2
- package/Models/DatabaseModels/Monitor.js +3 -3
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +41 -0
- package/Models/DatabaseModels/OnCallDutyPolicy.js +4 -2
- package/Models/DatabaseModels/OnCallDutyPolicyEscalationRule.js +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleSchedule.js +8 -5
- package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleTeam.js +5 -2
- package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleUser.js +5 -2
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +9 -6
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +10 -7
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +14 -11
- package/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.js +7 -4
- package/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.js +7 -4
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.js +6 -3
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +4 -4
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +3 -3
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +6 -6
- package/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js +9 -6
- package/Models/DatabaseModels/Project.d.mts +2 -0
- package/Models/DatabaseModels/Project.d.ts +2 -0
- package/Models/DatabaseModels/Project.js +96 -2
- package/Models/DatabaseModels/ProxmoxCluster.d.mts +1 -0
- package/Models/DatabaseModels/ProxmoxCluster.d.ts +1 -0
- package/Models/DatabaseModels/ProxmoxCluster.js +52 -3
- package/Models/DatabaseModels/PushNotificationLog.js +12 -12
- package/Models/DatabaseModels/Reseller.js +8 -2
- package/Models/DatabaseModels/ResellerPlan.js +8 -2
- package/Models/DatabaseModels/ScheduledMaintenance.js +6 -3
- package/Models/DatabaseModels/ScheduledMaintenanceInternalNote.js +7 -4
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +2 -2
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +7 -4
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -1
- package/Models/DatabaseModels/Service.js +1 -1
- package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +4 -4
- package/Models/DatabaseModels/ServiceLevelObjectiveErrorBudgetPolicyTier.js +4 -4
- package/Models/DatabaseModels/SmsLog.js +12 -12
- package/Models/DatabaseModels/StatusPage.js +5 -5
- package/Models/DatabaseModels/StatusPageSubscriber.js +2 -2
- package/Models/DatabaseModels/TelegramLog.js +12 -12
- package/Models/DatabaseModels/TelemetryIngestionKey.js +8 -5
- package/Models/DatabaseModels/TelemetryIngestionKeyRefusal.js +7 -4
- package/Models/DatabaseModels/User.d.mts +4 -0
- package/Models/DatabaseModels/User.d.ts +4 -0
- package/Models/DatabaseModels/User.js +100 -0
- package/Models/DatabaseModels/UserOnCallLog.js +6 -6
- package/Models/DatabaseModels/UserOnCallLogTimeline.js +3 -3
- package/Models/DatabaseModels/UserOnCallShiftReminderLog.js +2 -2
- package/Models/DatabaseModels/WebhookLog.js +12 -12
- package/Models/DatabaseModels/WhatsAppLog.js +12 -12
- package/Models/DatabaseModels/WorkspaceNotificationLog.js +12 -12
- package/Types/AI/AIChatTypes.d.mts +2 -1
- package/Types/AI/AIChatTypes.d.ts +2 -1
- package/Types/AI/AIChatTypes.js +5 -0
- package/Types/Analytics/ProductEvent.d.mts +6 -1
- package/Types/Analytics/ProductEvent.d.ts +6 -1
- package/Types/Analytics/ProductEvent.js +41 -0
- package/Types/AuditLog/AuditLogCoverage.d.mts +1 -0
- package/Types/AuditLog/AuditLogCoverage.d.ts +1 -0
- package/Types/AuditLog/AuditLogCoverage.js +4 -2
- package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
- package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
- package/Types/Cloud/CloudResourceCatalog.js +33 -3
- package/Types/Cloud/CloudResourceCatalog.mjs +1 -0
- package/Types/DataObservability/DataCheckSuggestions.d.mts +25 -0
- package/Types/DataObservability/DataCheckSuggestions.d.ts +25 -0
- package/Types/DataObservability/DataCheckSuggestions.js +102 -65
- package/Types/DataObservability/DataCheckSuggestions.mjs +1 -0
- package/Types/Database/TableMetadata.d.mts +2 -0
- package/Types/Database/TableMetadata.d.ts +2 -0
- package/Types/Database/TableMetadata.js +6 -0
- package/Types/Date.d.mts +20 -1
- package/Types/Date.d.ts +20 -1
- package/Types/Date.js +42 -2
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +44 -2
- package/Types/DateLanguage.mjs +2 -0
- package/Types/DirectionArrow.d.mts +7 -0
- package/Types/DirectionArrow.d.ts +7 -0
- package/Types/DirectionArrow.js +88 -0
- package/Types/DirectionArrow.mjs +7 -0
- package/Types/Docs/GlossaryTerm.d.mts +1 -0
- package/Types/Docs/GlossaryTerm.d.ts +1 -0
- package/Types/Docs/GlossaryTerm.js +2 -0
- package/Types/Docs/RetiredNames.d.mts +11 -0
- package/Types/Docs/RetiredNames.d.ts +11 -0
- package/Types/Docs/RetiredNames.js +139 -0
- package/Types/Docs/RetiredNames.mjs +3 -0
- package/Types/Exception/RefusalWithValues.d.mts +7 -0
- package/Types/Exception/RefusalWithValues.d.ts +7 -0
- package/Types/Exception/RefusalWithValues.js +76 -0
- package/Types/Exception/RefusalWithValues.mjs +3 -0
- package/Types/Exception/UnexplainedError.d.mts +13 -0
- package/Types/Exception/UnexplainedError.d.ts +13 -0
- package/Types/Exception/UnexplainedError.js +53 -1
- package/Types/Exception/UnexplainedError.mjs +1 -0
- package/Types/File/FileSize.d.mts +4 -1
- package/Types/File/FileSize.d.ts +4 -1
- package/Types/File/FileSize.js +18 -17
- package/Types/HostCollector/HostCollector.d.mts +1 -0
- package/Types/HostCollector/HostCollector.d.ts +1 -0
- package/Types/HostCollector/HostCollector.js +26 -10
- package/Types/HostCollector/HostCollector.mjs +1 -0
- package/Types/Monitor/MonitorCriteria.js +2 -2
- package/Types/Monitor/MonitorStep.js +1 -1
- package/Types/Monitor/MonitorTemplateSyncField.d.mts +6 -0
- package/Types/Monitor/MonitorTemplateSyncField.d.ts +6 -0
- package/Types/Monitor/MonitorTemplateSyncField.js +106 -64
- package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.mts +1 -0
- package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.ts +1 -0
- package/Types/Monitor/NtpMonitor/NtpMonitorUtil.js +11 -3
- package/Types/Monitor/WhoIsTold.d.mts +3 -1
- package/Types/Monitor/WhoIsTold.d.ts +3 -1
- package/Types/Monitor/WhoIsTold.js +2 -1
- package/Types/NotificationRule/PagingLadder.d.mts +137 -0
- package/Types/NotificationRule/PagingLadder.d.ts +137 -0
- package/Types/NotificationRule/PagingLadder.js +682 -0
- package/Types/NotificationRule/PagingLadder.mjs +28 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +1 -1
- package/Types/OnCallDutyPolicy/OnCallPageLine.d.mts +26 -0
- package/Types/OnCallDutyPolicy/OnCallPageLine.d.ts +26 -0
- package/Types/OnCallDutyPolicy/OnCallPageLine.js +136 -0
- package/Types/OnCallDutyPolicy/OnCallPageLine.mjs +18 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +44 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +44 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +96 -5
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.mts +19 -0
- package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.ts +19 -0
- package/Types/OnCallDutyPolicy/OnCallTestPageLine.js +222 -0
- package/Types/OnCallDutyPolicy/OnCallTestPageLine.mjs +6 -0
- package/Types/OnCallDutyPolicy/ScheduleLayerDefaults.js +5 -2
- package/Types/OnCallDutyPolicy/UserOverrideCoverRequest.js +9 -1
- package/Types/Permission.d.mts +2 -2
- package/Types/Permission.d.ts +2 -2
- package/Types/Permission.js +194 -193
- package/Types/Product/ProductCatalog.d.mts +10 -0
- package/Types/Product/ProductCatalog.d.ts +10 -0
- package/Types/Product/ProductCatalog.js +208 -0
- package/Types/Product/ProductCatalog.mjs +6 -0
- package/Types/Product/ProductOfTable.d.mts +3 -0
- package/Types/Product/ProductOfTable.d.ts +3 -0
- package/Types/Product/ProductOfTable.js +68 -0
- package/Types/Product/ProductOfTable.mjs +3 -0
- package/Types/Product/ProjectProductsAnswer.d.mts +3 -0
- package/Types/Product/ProjectProductsAnswer.d.ts +3 -0
- package/Types/Product/ProjectProductsAnswer.js +35 -2
- package/Types/Product/ProjectProductsAnswer.mjs +1 -0
- package/Types/Product/ServerProducts.d.mts +65 -0
- package/Types/Product/ServerProducts.d.ts +65 -0
- package/Types/Product/ServerProducts.js +383 -0
- package/Types/Product/ServerProducts.mjs +26 -0
- package/Types/Product/ServerProductsAnswer.d.mts +21 -0
- package/Types/Product/ServerProductsAnswer.d.ts +21 -0
- package/Types/Product/ServerProductsAnswer.js +78 -0
- package/Types/Product/ServerProductsAnswer.mjs +5 -0
- package/Types/ProductFeedback/ProductFeedback.d.mts +3 -1
- package/Types/ProductFeedback/ProductFeedback.d.ts +3 -1
- package/Types/ProductFeedback/ProductFeedback.js +8 -0
- package/Types/Rum/SessionReplayCustomEvents.d.mts +1 -0
- package/Types/Rum/SessionReplayCustomEvents.d.ts +1 -0
- package/Types/SampleProject/SampleProject.d.mts +54 -0
- package/Types/SampleProject/SampleProject.d.ts +54 -0
- package/Types/SampleProject/SampleProject.js +177 -0
- package/Types/SampleProject/SampleProject.mjs +22 -0
- package/Types/SampleProject/SampleProjectContent.d.mts +127 -0
- package/Types/SampleProject/SampleProjectContent.d.ts +127 -0
- package/Types/SampleProject/SampleProjectContent.js +397 -0
- package/Types/SampleProject/SampleProjectContent.mjs +18 -0
- package/Types/Telemetry/TelemetryIngestSurface.js +6 -5
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +40 -2
- package/Types/Translator.mjs +1 -0
- package/Types/UsedBy/UsedBy.d.mts +103 -0
- package/Types/UsedBy/UsedBy.d.ts +103 -0
- package/Types/UsedBy/UsedBy.js +389 -0
- package/Types/UsedBy/UsedBy.mjs +20 -0
- package/Types/UsedBy/UsedByServerProducts.d.mts +4 -0
- package/Types/UsedBy/UsedByServerProducts.d.ts +4 -0
- package/Types/UsedBy/UsedByServerProducts.js +48 -0
- package/Types/UsedBy/UsedByServerProducts.mjs +3 -0
- package/Types/WelcomeChecklist/WelcomeChecklist.d.mts +6 -0
- package/Types/WelcomeChecklist/WelcomeChecklist.d.ts +6 -0
- package/Types/WelcomeChecklist/WelcomeChecklist.js +54 -2
- package/Types/WelcomeChecklist/WelcomeChecklist.mjs +4 -0
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.mts +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.ts +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.js +3 -0
- package/Types/Workflow/PassedOnFields.js +2 -1
- package/Types/Workflow/Templates.js +1 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +2 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +2 -0
- package/Utils/AI/MeaningMatch.d.mts +36 -0
- package/Utils/AI/MeaningMatch.d.ts +36 -0
- package/Utils/AI/MeaningMatch.js +535 -0
- package/Utils/AI/MeaningMatch.mjs +7 -0
- package/Utils/ArchivableValues.js +1 -1
- package/Utils/AuditLog/AuditLogValues.js +2 -2
- package/Utils/Dashboard/ClockWidgetFormat.d.mts +14 -2
- package/Utils/Dashboard/ClockWidgetFormat.d.ts +14 -2
- package/Utils/Dashboard/ClockWidgetFormat.js +105 -2
- package/Utils/Dashboard/DashboardViewConfigSignature.d.mts +3 -0
- package/Utils/Dashboard/DashboardViewConfigSignature.d.ts +3 -0
- package/Utils/Dashboard/DashboardViewConfigSignature.js +45 -0
- package/Utils/Dashboard/DashboardViewConfigSignature.mjs +3 -0
- package/Utils/DataSecurity/TextScanner.js +2 -2
- package/Utils/DeveloperDocs/AiAssistantExamples.js +4 -4
- package/Utils/DeveloperDocs/CliCommands.d.mts +1 -0
- package/Utils/DeveloperDocs/CliCommands.d.ts +1 -0
- package/Utils/DeveloperDocs/CliCommands.js +2 -1
- package/Utils/DeveloperDocs/CliResources.js +2 -1
- package/Utils/DeveloperDocs/TerraformSchema.js +3 -1
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +8 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +8 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +1493 -131
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +1 -0
- package/Utils/Markdown/MarkdownTableCell.js +2 -1
- package/Utils/Markdown/OverLongText.js +523 -5
- package/Utils/Markdown/SlowMarkdown.d.mts +14 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +14 -0
- package/Utils/Markdown/SlowMarkdown.js +595 -11
- package/Utils/Markdown/SlowMarkdown.mjs +6 -0
- package/Utils/ModelApiName.d.mts +11 -0
- package/Utils/ModelApiName.d.ts +11 -0
- package/Utils/ModelApiName.js +72 -0
- package/Utils/ModelApiName.mjs +5 -0
- package/Utils/Monitor/DeviceMacLearningUtil.d.mts +2 -1
- package/Utils/Monitor/DeviceMacLearningUtil.d.ts +2 -1
- package/Utils/Monitor/DeviceMacLearningUtil.js +26 -0
- package/Utils/Monitor/EndpointAttachmentUtil.js +8 -3
- package/Utils/Monitor/ExternalStatusPageReading.d.mts +3 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.ts +3 -0
- package/Utils/Monitor/ExternalStatusPageReading.js +35 -1
- package/Utils/Monitor/ExternalStatusPageReading.mjs +2 -0
- package/Utils/Monitor/MonitorTemplateLinkRefusal.d.mts +9 -0
- package/Utils/Monitor/MonitorTemplateLinkRefusal.d.ts +9 -0
- package/Utils/Monitor/MonitorTemplateLinkRefusal.js +45 -0
- package/Utils/Monitor/MonitorTemplateLinkRefusal.mjs +6 -0
- package/Utils/OpenStack/OpenStackCheckName.js +2 -1
- package/Utils/OpenStack/OpenStackLogScrub.js +1 -1
- package/Utils/OpenStack/OpenStackLogs.js +3 -2
- package/Utils/OpenStack/OpenStackTraces.js +2 -1
- package/Utils/Project/NotificationChannels.js +5 -5
- package/Utils/Project/ProjectBalance.js +2 -2
- package/Utils/Project/TwilioAccount.js +2 -2
- package/Utils/ScheduledMaintenanceStart.d.mts +3 -0
- package/Utils/ScheduledMaintenanceStart.d.ts +3 -0
- package/Utils/ScheduledMaintenanceStart.js +9 -0
- package/Utils/Schema/ModelSchema.js +10 -1
- package/Utils/Uptime/UptimeMaintenanceUtil.js +2 -1
- package/Utils/ValueFormatter.d.mts +8 -6
- package/Utils/ValueFormatter.d.ts +8 -6
- package/Utils/ValueFormatter.js +145 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ModelNames {
|
|
2
|
+
tableName?: string | null | undefined;
|
|
3
|
+
singularName?: string | null | undefined;
|
|
4
|
+
pluralName?: string | null | undefined;
|
|
5
|
+
apiSingularName?: string | null | undefined;
|
|
6
|
+
apiPluralName?: string | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function getApiSingularName(model: ModelNames): string;
|
|
9
|
+
export declare function getApiPluralName(model: ModelNames): string;
|
|
10
|
+
export declare const KEPT_SINGULAR_NAMES: ReadonlyArray<string>;
|
|
11
|
+
export declare function getScreenSingularName(apiSingularName: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ModelNames {
|
|
2
|
+
tableName?: string | null | undefined;
|
|
3
|
+
singularName?: string | null | undefined;
|
|
4
|
+
pluralName?: string | null | undefined;
|
|
5
|
+
apiSingularName?: string | null | undefined;
|
|
6
|
+
apiPluralName?: string | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function getApiSingularName(model: ModelNames): string;
|
|
9
|
+
export declare function getApiPluralName(model: ModelNames): string;
|
|
10
|
+
export declare const KEPT_SINGULAR_NAMES: ReadonlyArray<string>;
|
|
11
|
+
export declare function getScreenSingularName(apiSingularName: string): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THE NAME A MODEL KEEPS OUTSIDE ITS SCREENS.
|
|
4
|
+
*
|
|
5
|
+
* A model's singularName and pluralName are words people read: list titles,
|
|
6
|
+
* empty states, buttons, the API reference. They are also, without anyone
|
|
7
|
+
* deciding it, names other things call or store the model by:
|
|
8
|
+
*
|
|
9
|
+
* - the OpenAPI spec tags every endpoint with the singular name, and the
|
|
10
|
+
* Terraform provider names its resource after the tag
|
|
11
|
+
* (oneuptime_on_call_policy_schedule);
|
|
12
|
+
* - the CLI names its command after it (oneuptime on-call-policy-schedule);
|
|
13
|
+
* - the MCP server names its tools after both (list_on_call_duty_policies);
|
|
14
|
+
* - the audit log stores the singular name as each entry's resource type.
|
|
15
|
+
*
|
|
16
|
+
* So renaming a thing on screen (#6817: one name per thing) must not rename
|
|
17
|
+
* it there: a Terraform configuration, a script, an agent's allowed tools
|
|
18
|
+
* and last year's audit entries all keep working. A renamed model says what
|
|
19
|
+
* it was called in @TableMetadata's apiSingularName and apiPluralName (both,
|
|
20
|
+
* when its singular name changed: ModelApiNames.test.ts), and everything
|
|
21
|
+
* above reads its names through these two functions.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.KEPT_SINGULAR_NAMES = void 0;
|
|
25
|
+
exports.getApiSingularName = getApiSingularName;
|
|
26
|
+
exports.getApiPluralName = getApiPluralName;
|
|
27
|
+
exports.getScreenSingularName = getScreenSingularName;
|
|
28
|
+
// The singular name the API, Terraform, the CLI, MCP and the audit log use.
|
|
29
|
+
function getApiSingularName(model) {
|
|
30
|
+
return model.apiSingularName || model.singularName || model.tableName || "";
|
|
31
|
+
}
|
|
32
|
+
/*
|
|
33
|
+
* The plural name the MCP server's list and count tools use. A model with no
|
|
34
|
+
* plural gets its singular name with an "s", as the tools always gave it.
|
|
35
|
+
*/
|
|
36
|
+
function getApiPluralName(model) {
|
|
37
|
+
return (model.apiPluralName || model.pluralName || `${getApiSingularName(model)}s`);
|
|
38
|
+
}
|
|
39
|
+
/*
|
|
40
|
+
* What each kept singular name is called on screen now. The audit log stores
|
|
41
|
+
* an entry's resource type by the kept name, and its pages show the type
|
|
42
|
+
* through getScreenSingularName, so an entry about an Ingestion Key says
|
|
43
|
+
* Ingestion Key, as last year's entries about it now do too. Plain words, so
|
|
44
|
+
* the Dashboard reads them without loading the models; ModelApiNames.test.ts
|
|
45
|
+
* holds them to every model's own names.
|
|
46
|
+
*/
|
|
47
|
+
const SCREEN_SINGULAR_NAMES = {
|
|
48
|
+
// #6817 part 1: On-Call.
|
|
49
|
+
"On-Call Policy Schedule": "On-Call Schedule",
|
|
50
|
+
"User's On-Call Duty Escalation Rule": "Escalation Rule User",
|
|
51
|
+
"Team On-Call Duty Escalation Rule": "Escalation Rule Team",
|
|
52
|
+
"Schedule's On-Call Duty Escalation Rule": "Escalation Rule Schedule",
|
|
53
|
+
"On-Call Duty Execution Log": "On-Call Policy Execution Log",
|
|
54
|
+
"On-Call Duty Execution Log Timeline": "On-Call Policy Execution Log Timeline",
|
|
55
|
+
"On Call Duty Policy Feed": "On-Call Policy Feed",
|
|
56
|
+
"On Call Time Log": "On-Call Time Log",
|
|
57
|
+
"OnCallDutyPolicy User Owner": "On-Call Policy User Owner",
|
|
58
|
+
"OnCallDutyPolicy Team Owner": "On-Call Policy Team Owner",
|
|
59
|
+
// #6817 part 2: Ingestion Keys.
|
|
60
|
+
"Telemetry Ingestion Key": "Ingestion Key",
|
|
61
|
+
"Telemetry Ingestion Key Refusal": "Ingestion Key Refusal",
|
|
62
|
+
// #6817 part 3: maintenance events.
|
|
63
|
+
"Scheduled Maintenance Event": "Maintenance Event",
|
|
64
|
+
"Scheduled Event Internal Note": "Maintenance Event Internal Note",
|
|
65
|
+
"Scheduled Event Public Note": "Maintenance Event Public Note",
|
|
66
|
+
};
|
|
67
|
+
// The kept singular names this table knows, for its test.
|
|
68
|
+
exports.KEPT_SINGULAR_NAMES = Object.keys(SCREEN_SINGULAR_NAMES);
|
|
69
|
+
// What a singular name the API keeps is called on screen; any other is itself.
|
|
70
|
+
function getScreenSingularName(apiSingularName) {
|
|
71
|
+
return SCREEN_SINGULAR_NAMES[apiSingularName] || apiSingularName;
|
|
72
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import commonJsModule from "./ModelApiName.js";
|
|
2
|
+
export const KEPT_SINGULAR_NAMES = commonJsModule.KEPT_SINGULAR_NAMES;
|
|
3
|
+
export const getApiPluralName = commonJsModule.getApiPluralName;
|
|
4
|
+
export const getApiSingularName = commonJsModule.getApiSingularName;
|
|
5
|
+
export const getScreenSingularName = commonJsModule.getScreenSingularName;
|
|
@@ -29,8 +29,9 @@ export declare function siteKeyOf(siteId: string | null | undefined): string;
|
|
|
29
29
|
export default class DeviceMacLearningUtil {
|
|
30
30
|
static planMacLearning(data: {
|
|
31
31
|
ipBindings: Array<MacLearningIpBinding>;
|
|
32
|
-
devices: Array<
|
|
32
|
+
devices: Array<MacObservationCandidateDevice>;
|
|
33
33
|
observingSiteId?: string | null | undefined;
|
|
34
|
+
now?: number | undefined;
|
|
34
35
|
}): Array<MacLearningPlanEntry>;
|
|
35
36
|
static planMacObservations(data: {
|
|
36
37
|
ipBindings: Array<MacLearningIpBinding>;
|
|
@@ -29,8 +29,9 @@ export declare function siteKeyOf(siteId: string | null | undefined): string;
|
|
|
29
29
|
export default class DeviceMacLearningUtil {
|
|
30
30
|
static planMacLearning(data: {
|
|
31
31
|
ipBindings: Array<MacLearningIpBinding>;
|
|
32
|
-
devices: Array<
|
|
32
|
+
devices: Array<MacObservationCandidateDevice>;
|
|
33
33
|
observingSiteId?: string | null | undefined;
|
|
34
|
+
now?: number | undefined;
|
|
34
35
|
}): Array<MacLearningPlanEntry>;
|
|
35
36
|
static planMacObservations(data: {
|
|
36
37
|
ipBindings: Array<MacLearningIpBinding>;
|
|
@@ -17,6 +17,17 @@ exports.MAC_OBSERVATION_REFRESH_INTERVAL_IN_MS = 60 * 60 * 1000;
|
|
|
17
17
|
function siteKeyOf(siteId) {
|
|
18
18
|
return (siteId || "").trim();
|
|
19
19
|
}
|
|
20
|
+
/*
|
|
21
|
+
* Whether the device holds a reading taken after `now`, when this table was
|
|
22
|
+
* read: by a newer poll of a router, processed before this one - a retried
|
|
23
|
+
* job, or one that waited longer in the queue than the poll after it
|
|
24
|
+
* (OneUptime issue #7389). The newer reading stands over an older table.
|
|
25
|
+
*/
|
|
26
|
+
function isReadAfter(device, now) {
|
|
27
|
+
return (now !== undefined &&
|
|
28
|
+
device.observedAt !== undefined &&
|
|
29
|
+
device.observedAt > now);
|
|
30
|
+
}
|
|
20
31
|
class DeviceMacLearningUtil {
|
|
21
32
|
/*
|
|
22
33
|
* Which devices get which MAC. The rules, every one of them a refusal:
|
|
@@ -37,6 +48,10 @@ class DeviceMacLearningUtil {
|
|
|
37
48
|
* - Only an address the ARP table binds to exactly one MAC. Proxy ARP
|
|
38
49
|
* and stale duplicates put two MACs behind one address; neither can
|
|
39
50
|
* be trusted.
|
|
51
|
+
* - A learned MAC is not corrected by a table read before the device's
|
|
52
|
+
* recorded reading (`now`, when given): that reading is newer evidence
|
|
53
|
+
* (see isReadAfter). A first learn is not about time: an empty column
|
|
54
|
+
* takes the first trusted answer.
|
|
40
55
|
*
|
|
41
56
|
* Output is sorted by device id, so a given input always plans the same
|
|
42
57
|
* writes in the same order.
|
|
@@ -61,6 +76,10 @@ class DeviceMacLearningUtil {
|
|
|
61
76
|
if (device.isMacAddressLearned !== true || storedMac === learnedMac) {
|
|
62
77
|
continue;
|
|
63
78
|
}
|
|
79
|
+
// A newer reading than this table stands (issue #7389).
|
|
80
|
+
if (isReadAfter(device, data.now)) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
64
83
|
plan.push({
|
|
65
84
|
deviceId: device.id,
|
|
66
85
|
macAddress: learnedMac,
|
|
@@ -94,12 +113,19 @@ class DeviceMacLearningUtil {
|
|
|
94
113
|
* nothing disagrees - unless an earlier reading disagreed, which is now
|
|
95
114
|
* replaced so the disagreement goes.
|
|
96
115
|
*
|
|
116
|
+
* And never over a reading taken after this table was read (`now`): an
|
|
117
|
+
* older poll of a router, processed after a newer one (OneUptime issue
|
|
118
|
+
* #7389), would put its older answer back. See isReadAfter.
|
|
119
|
+
*
|
|
97
120
|
* Sorted by device id, like the learning plan.
|
|
98
121
|
*/
|
|
99
122
|
static planMacObservations(data) {
|
|
100
123
|
const plan = [];
|
|
101
124
|
for (const binding of DeviceMacLearningUtil.getTrustedBindings(data)) {
|
|
102
125
|
const device = binding.device;
|
|
126
|
+
if (isReadAfter(device, data.now)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
103
129
|
const mac = binding.macAddress;
|
|
104
130
|
const recordedMac = (0, EndpointAttachmentUtil_1.normalizeMac)(device.observedMacAddress);
|
|
105
131
|
const storedMac = (0, EndpointAttachmentUtil_1.normalizeMac)(device.macAddress);
|
|
@@ -312,9 +312,14 @@ class EndpointAttachmentUtil {
|
|
|
312
312
|
* True when applying `decision` to `existing` would change nothing a
|
|
313
313
|
* reader can observe, and lastSeenAt is fresh enough that skipping the
|
|
314
314
|
* refresh is safe. Deliberately conservative — any doubt (a row that
|
|
315
|
-
* still needs the firstSeenAt backfill, a row
|
|
316
|
-
* the future because of clock skew, a row we have never seen a
|
|
315
|
+
* still needs the firstSeenAt backfill, a row we have never seen a
|
|
317
316
|
* timestamp for) falls through to a real write.
|
|
317
|
+
*
|
|
318
|
+
* A sighting older than the row's lastSeenAt refreshes nothing either.
|
|
319
|
+
* That is an older poll processed after a newer one (OneUptime issue
|
|
320
|
+
* #7389), or a row stamped by a clock a little ahead. The write never
|
|
321
|
+
* moves lastSeenAt backwards (NetworkEndpointService keeps the later of
|
|
322
|
+
* the two), so writing it would change nothing.
|
|
318
323
|
*/
|
|
319
324
|
static isUnchangedSighting(existing, decision, incomingDeviceId, context) {
|
|
320
325
|
var _a;
|
|
@@ -324,7 +329,7 @@ class EndpointAttachmentUtil {
|
|
|
324
329
|
}
|
|
325
330
|
const refreshMs = (_a = context.lastSeenRefreshMs) !== null && _a !== void 0 ? _a : exports.ENDPOINT_LAST_SEEN_REFRESH_MS;
|
|
326
331
|
const ageMs = context.now.getTime() - new Date(existing.lastSeenAt).getTime();
|
|
327
|
-
if (ageMs
|
|
332
|
+
if (ageMs >= refreshMs) {
|
|
328
333
|
return false;
|
|
329
334
|
}
|
|
330
335
|
if (decision.setIpAddress &&
|
|
@@ -6,6 +6,8 @@ export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN: string;
|
|
|
6
6
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED: string;
|
|
7
7
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE: string;
|
|
8
8
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF: string;
|
|
9
|
+
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE: string;
|
|
10
|
+
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE: string;
|
|
9
11
|
export interface ExternalStatusPageOneUptimeNote {
|
|
10
12
|
template: string;
|
|
11
13
|
values: Record<string, string>;
|
|
@@ -41,4 +43,5 @@ export default class ExternalStatusPageReading {
|
|
|
41
43
|
static readIncidentIo(json: unknown): ExternalStatusPageContents | null;
|
|
42
44
|
static readOneUptimeSummary(summary: StatusPageSummary): ExternalStatusPageContents;
|
|
43
45
|
static readOneUptimeNote(description: string | undefined): ExternalStatusPageOneUptimeNote | null;
|
|
46
|
+
static readOneUptimeFailureCause(failureCause: string | undefined): string | null;
|
|
44
47
|
}
|
|
@@ -6,6 +6,8 @@ export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN: string;
|
|
|
6
6
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED: string;
|
|
7
7
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE: string;
|
|
8
8
|
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF: string;
|
|
9
|
+
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE: string;
|
|
10
|
+
export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE: string;
|
|
9
11
|
export interface ExternalStatusPageOneUptimeNote {
|
|
10
12
|
template: string;
|
|
11
13
|
values: Record<string, string>;
|
|
@@ -41,4 +43,5 @@ export default class ExternalStatusPageReading {
|
|
|
41
43
|
static readIncidentIo(json: unknown): ExternalStatusPageContents | null;
|
|
42
44
|
static readOneUptimeSummary(summary: StatusPageSummary): ExternalStatusPageContents;
|
|
43
45
|
static readOneUptimeNote(description: string | undefined): ExternalStatusPageOneUptimeNote | null;
|
|
46
|
+
static readOneUptimeFailureCause(failureCause: string | undefined): string | null;
|
|
44
47
|
}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN = exports.EXTERNAL_STATUS_PAGE_UNNAMED_INCIDENT = exports.EXTERNAL_STATUS_PAGE_MAX_INCIDENTS = exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENTS = void 0;
|
|
6
|
+
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED = exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN = exports.EXTERNAL_STATUS_PAGE_UNNAMED_INCIDENT = exports.EXTERNAL_STATUS_PAGE_MAX_INCIDENTS = exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENTS = void 0;
|
|
7
7
|
const ExternalStatusPageComponentStatusUtil_1 = __importDefault(require("./ExternalStatusPageComponentStatusUtil"));
|
|
8
8
|
const TrailingRuns_1 = require("../TrailingRuns");
|
|
9
9
|
const Translator_1 = require("../../Types/Translator");
|
|
@@ -70,6 +70,26 @@ const ONEUPTIME_SENTENCE_NOTES = [
|
|
|
70
70
|
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN,
|
|
71
71
|
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED,
|
|
72
72
|
];
|
|
73
|
+
/*
|
|
74
|
+
* WHY A ONEUPTIME PAGE COULD NOT BE READ.
|
|
75
|
+
*
|
|
76
|
+
* With the OneUptime Status Page provider chosen, a page that answers but
|
|
77
|
+
* will not let the probe in fails the check, and the probe writes why as
|
|
78
|
+
* the check's failure cause (ExternalStatusPageMonitor's
|
|
79
|
+
* tryOneUptimeStatusPage): a private page (sign-in or password), or one
|
|
80
|
+
* whose IP allowlist leaves the probe out. Each is a translation key, as
|
|
81
|
+
* the notes above are, so the monitor's summary draws its Error in the
|
|
82
|
+
* reader's language (readOneUptimeFailureCause) while the probe stores the
|
|
83
|
+
* English: monitor criteria and logs compare that English, so it never
|
|
84
|
+
* changes.
|
|
85
|
+
*/
|
|
86
|
+
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE = (0, Translator_1.translationKey)("This status page is private: only people who sign in to it, or who know its password, can read it. Only a public status page can be watched.");
|
|
87
|
+
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE = (0, Translator_1.translationKey)("This status page lets in only the IP addresses on its allowlist, and this probe's address is not one of them. Add the probe's address to the allowlist, or watch the page from a probe inside that network.");
|
|
88
|
+
// The failure causes the probe writes in OneUptime's words, each a whole sentence.
|
|
89
|
+
const ONEUPTIME_FAILURE_CAUSES = [
|
|
90
|
+
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE,
|
|
91
|
+
exports.EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE,
|
|
92
|
+
];
|
|
73
93
|
const isRecord = (value) => {
|
|
74
94
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
75
95
|
};
|
|
@@ -445,5 +465,19 @@ class ExternalStatusPageReading {
|
|
|
445
465
|
}
|
|
446
466
|
return null;
|
|
447
467
|
}
|
|
468
|
+
/*
|
|
469
|
+
* One of OneUptime's failure causes, read back from a check's failure
|
|
470
|
+
* cause: its English, a translation key, when the cause is exactly one of
|
|
471
|
+
* them (a private page, a page whose IP allowlist leaves the probe out);
|
|
472
|
+
* null for any other cause - the network's, a provider's, an older
|
|
473
|
+
* probe's - which stays as written.
|
|
474
|
+
*
|
|
475
|
+
* Only a check of a OneUptime page is read this way (the caller asks for
|
|
476
|
+
* that provider).
|
|
477
|
+
*/
|
|
478
|
+
static readOneUptimeFailureCause(failureCause) {
|
|
479
|
+
const text = (failureCause || "").trim();
|
|
480
|
+
return ONEUPTIME_FAILURE_CAUSES.includes(text) ? text : null;
|
|
481
|
+
}
|
|
448
482
|
}
|
|
449
483
|
exports.default = ExternalStatusPageReading;
|
|
@@ -2,7 +2,9 @@ import commonJsModule from "./ExternalStatusPageReading.js";
|
|
|
2
2
|
export default commonJsModule.default;
|
|
3
3
|
export const EXTERNAL_STATUS_PAGE_MAX_COMPONENTS = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_COMPONENTS;
|
|
4
4
|
export const EXTERNAL_STATUS_PAGE_MAX_INCIDENTS = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_INCIDENTS;
|
|
5
|
+
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_IP_NOT_ALLOWED_MESSAGE;
|
|
5
6
|
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_NOT_MONITORED;
|
|
7
|
+
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_PRIVATE_MESSAGE;
|
|
6
8
|
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN;
|
|
7
9
|
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE;
|
|
8
10
|
export const EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF = commonJsModule.EXTERNAL_STATUS_PAGE_ONEUPTIME_UNDER_MAINTENANCE_OF;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefusalWithValues } from "../../Types/Exception/RefusalWithValues.mjs";
|
|
2
|
+
export declare const MONITOR_NOT_FOUND_REFUSAL: string;
|
|
3
|
+
export declare const MONITOR_IN_ANOTHER_PROJECT_REFUSAL: string;
|
|
4
|
+
export declare const MONITOR_NOT_LINKED_REFUSAL: string;
|
|
5
|
+
export declare const MONITOR_TYPE_MISMATCH_REFUSAL: RefusalWithValues;
|
|
6
|
+
export declare const getMonitorTypeMismatchRefusal: (data: {
|
|
7
|
+
monitorType: string;
|
|
8
|
+
templateType: string;
|
|
9
|
+
}) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefusalWithValues } from "../../Types/Exception/RefusalWithValues";
|
|
2
|
+
export declare const MONITOR_NOT_FOUND_REFUSAL: string;
|
|
3
|
+
export declare const MONITOR_IN_ANOTHER_PROJECT_REFUSAL: string;
|
|
4
|
+
export declare const MONITOR_NOT_LINKED_REFUSAL: string;
|
|
5
|
+
export declare const MONITOR_TYPE_MISMATCH_REFUSAL: RefusalWithValues;
|
|
6
|
+
export declare const getMonitorTypeMismatchRefusal: (data: {
|
|
7
|
+
monitorType: string;
|
|
8
|
+
templateType: string;
|
|
9
|
+
}) => string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMonitorTypeMismatchRefusal = exports.MONITOR_TYPE_MISMATCH_REFUSAL = exports.MONITOR_NOT_LINKED_REFUSAL = exports.MONITOR_IN_ANOTHER_PROJECT_REFUSAL = exports.MONITOR_NOT_FOUND_REFUSAL = void 0;
|
|
4
|
+
const RefusalWithValues_1 = require("../../Types/Exception/RefusalWithValues");
|
|
5
|
+
const Translator_1 = require("../../Types/Translator");
|
|
6
|
+
/*
|
|
7
|
+
* WHY A MONITOR CANNOT BE LINKED TO A TEMPLATE, SYNCED FROM IT OR UNLINKED
|
|
8
|
+
* (#7678).
|
|
9
|
+
*
|
|
10
|
+
* MonitorTemplateService refuses with these, and the template's page shows
|
|
11
|
+
* them: Link Existing Monitors says why each monitor it could not link was
|
|
12
|
+
* refused, and Sync from Template and Unlink from Template say why they did
|
|
13
|
+
* not finish. They were fragments ("Monitor not found", "Monitor and
|
|
14
|
+
* template belong to different projects") and a sentence with the two types
|
|
15
|
+
* inside it ("Monitor type "Ping" does not match template type "API""), so
|
|
16
|
+
* the page said them in English in every language. Each is a whole sentence
|
|
17
|
+
* now, and a key of the Dashboard's locales (this directory is a source of
|
|
18
|
+
* its string extractor). The type mismatch keeps its two types as
|
|
19
|
+
* placeholders (RefusalWithValues): the Dashboard reads them back out of
|
|
20
|
+
* the English and says the sentence with the reader's words for them.
|
|
21
|
+
*
|
|
22
|
+
* React-free and server-safe: the server throws these, the Dashboard reads
|
|
23
|
+
* them.
|
|
24
|
+
*/
|
|
25
|
+
// The monitor is gone, or the caller may not see it.
|
|
26
|
+
exports.MONITOR_NOT_FOUND_REFUSAL = (0, Translator_1.translationKey)("This monitor does not exist in this project, or you do not have access to it.");
|
|
27
|
+
exports.MONITOR_IN_ANOTHER_PROJECT_REFUSAL = (0, Translator_1.translationKey)("This monitor and this template are in different projects.");
|
|
28
|
+
// Sync from Template and Unlink from Template reach only the template's own monitors.
|
|
29
|
+
exports.MONITOR_NOT_LINKED_REFUSAL = (0, Translator_1.translationKey)("This monitor is not linked to this template.");
|
|
30
|
+
/*
|
|
31
|
+
* A template links only monitors of its own type: its criteria are written
|
|
32
|
+
* for that type.
|
|
33
|
+
*/
|
|
34
|
+
exports.MONITOR_TYPE_MISMATCH_REFUSAL = {
|
|
35
|
+
template: (0, Translator_1.translationKey)("This monitor's type is {{monitorType}}, and this template's type is {{templateType}}. Only monitors of the template's type can be linked to it."),
|
|
36
|
+
terms: ["monitorType", "templateType"],
|
|
37
|
+
};
|
|
38
|
+
// The type mismatch as the server answers it: in English, with the two types.
|
|
39
|
+
const getMonitorTypeMismatchRefusal = (data) => {
|
|
40
|
+
return (0, RefusalWithValues_1.getRefusalText)(exports.MONITOR_TYPE_MISMATCH_REFUSAL, {
|
|
41
|
+
monitorType: data.monitorType,
|
|
42
|
+
templateType: data.templateType,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
exports.getMonitorTypeMismatchRefusal = getMonitorTypeMismatchRefusal;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import commonJsModule from "./MonitorTemplateLinkRefusal.js";
|
|
2
|
+
export const MONITOR_IN_ANOTHER_PROJECT_REFUSAL = commonJsModule.MONITOR_IN_ANOTHER_PROJECT_REFUSAL;
|
|
3
|
+
export const MONITOR_NOT_FOUND_REFUSAL = commonJsModule.MONITOR_NOT_FOUND_REFUSAL;
|
|
4
|
+
export const MONITOR_NOT_LINKED_REFUSAL = commonJsModule.MONITOR_NOT_LINKED_REFUSAL;
|
|
5
|
+
export const MONITOR_TYPE_MISMATCH_REFUSAL = commonJsModule.MONITOR_TYPE_MISMATCH_REFUSAL;
|
|
6
|
+
export const getMonitorTypeMismatchRefusal = commonJsModule.getMonitorTypeMismatchRefusal;
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* part server, volume, sg or fip, so a volume with a server's name is not the check's
|
|
18
18
|
*
|
|
19
19
|
* Read with loops and fixed lengths, never a regular expression: names come from a cloud's API,
|
|
20
|
-
* where anyone with a project can write one (
|
|
20
|
+
* where anyone with a project can write one (Docs/notifications/README.md, "Megabyte-long
|
|
21
|
+
* values").
|
|
21
22
|
*
|
|
22
23
|
* Pure, for the probe that makes and deletes them and for the guide and tests that describe them.
|
|
23
24
|
*/
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* loop, never a regular expression with a quantifier, and never reads a stretch twice:
|
|
24
24
|
* the search for a word goes on from where its value stopped, so a thousand opening quotes
|
|
25
25
|
* cost what one does, and the time this takes is in line with the line, whatever the line
|
|
26
|
-
* holds (
|
|
26
|
+
* holds (Docs/notifications/README.md, "Megabyte-long values").
|
|
27
27
|
*/
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.OPENSTACK_SCRUBBED_VALUE = void 0;
|
|
@@ -38,8 +38,9 @@ const OpenStackLogScrub_1 = require("./OpenStackLogScrub");
|
|
|
38
38
|
*
|
|
39
39
|
* Logs are text anyone can write into. Nothing here runs a regular expression with a
|
|
40
40
|
* quantifier: lines are read with indexOf and loops, so the time this takes is in line
|
|
41
|
-
* with the record however long it is and whatever it holds
|
|
42
|
-
*
|
|
41
|
+
* with the record however long it is and whatever it holds
|
|
42
|
+
* (Docs/notifications/README.md, "Megabyte-long values", and the hostile shapes in
|
|
43
|
+
* OpenStackLogs.test.ts). The most this reads of one record is
|
|
43
44
|
* MAX_OPENSTACK_LOG_BODY_LENGTH, and what is past it is not stored: an unread stretch
|
|
44
45
|
* could hold what the scrub is there to take out.
|
|
45
46
|
*
|
|
@@ -68,7 +68,8 @@ const OpenStackLogScrub_1 = require("./OpenStackLogScrub");
|
|
|
68
68
|
* Common/Tests/Fixtures/OpenStack/traces/<release>, and OpenStackTracesRecordings.test.ts.
|
|
69
69
|
*
|
|
70
70
|
* Spans are text anyone holding the key can write into, so a value is read with indexOf and
|
|
71
|
-
* loops, never a regular expression with a quantifier (
|
|
71
|
+
* loops, never a regular expression with a quantifier (Docs/notifications/README.md,
|
|
72
|
+
* "Megabyte-long values").
|
|
72
73
|
*
|
|
73
74
|
* These attribute keys are stored in customers' traces: never rename one.
|
|
74
75
|
*/
|
|
@@ -56,7 +56,7 @@ exports.PROJECT_NOTIFICATION_CHANNEL_UPDATE_PERMISSIONS = [
|
|
|
56
56
|
Permission_1.default.ManageProjectBilling,
|
|
57
57
|
];
|
|
58
58
|
// The page that holds the switches (its Notification Channels card).
|
|
59
|
-
exports.PROJECT_NOTIFICATION_CHANNEL_SETTINGS_PAGE = "Project Settings > Notifications > Notification
|
|
59
|
+
exports.PROJECT_NOTIFICATION_CHANNEL_SETTINGS_PAGE = "Project Settings > Notifications > Notification Channels";
|
|
60
60
|
// Where that page is in the dashboard, under a project's own route.
|
|
61
61
|
exports.PROJECT_NOTIFICATION_CHANNEL_SETTINGS_PATH = "settings/notification-settings";
|
|
62
62
|
/*
|
|
@@ -81,7 +81,7 @@ const CHANNEL_WORDS = {
|
|
|
81
81
|
* Who can turn it on, and where, as the end of a sentence about a channel
|
|
82
82
|
* that is off ("it") or several ("them"): "a project owner, a Billing Admin
|
|
83
83
|
* or someone with Manage Billing can turn it on in Project Settings >
|
|
84
|
-
* Notifications > Notification
|
|
84
|
+
* Notifications > Notification Channels".
|
|
85
85
|
*/
|
|
86
86
|
const getWhoCanTurnOnClause = (pronoun) => {
|
|
87
87
|
return `${exports.WHO_MAY_TURN_THEM_ON} can turn ${pronoun} on in ${exports.PROJECT_NOTIFICATION_CHANNEL_SETTINGS_PAGE}`;
|
|
@@ -90,7 +90,7 @@ exports.getWhoCanTurnOnClause = getWhoCanTurnOnClause;
|
|
|
90
90
|
/*
|
|
91
91
|
* The same, as the sentence after one that says a channel is off: "A
|
|
92
92
|
* project owner, a Billing Admin or someone with Manage Billing can turn it
|
|
93
|
-
* on in Project Settings > Notifications > Notification
|
|
93
|
+
* on in Project Settings > Notifications > Notification Channels."
|
|
94
94
|
*/
|
|
95
95
|
const getWhoCanTurnOnSentence = (pronoun) => {
|
|
96
96
|
const clause = (0, exports.getWhoCanTurnOnClause)(pronoun);
|
|
@@ -104,7 +104,7 @@ const getPronoun = (channel) => {
|
|
|
104
104
|
* What the server says when something needs a channel the project has off:
|
|
105
105
|
* "SMS is off in this project. A project owner, a Billing Admin or someone
|
|
106
106
|
* with Manage Billing can turn it on in Project Settings > Notifications >
|
|
107
|
-
* Notification
|
|
107
|
+
* Notification Channels." Said to whoever asked - someone who may turn it on, or not -
|
|
108
108
|
* so it names who can rather than telling the reader to.
|
|
109
109
|
*/
|
|
110
110
|
const getProjectNotificationChannelOffMessage = (channel) => {
|
|
@@ -127,7 +127,7 @@ exports.STATUS_PAGE_SMS_SUBSCRIPTIONS_SMS_OFF_MESSAGE = `Visitors can't subscrib
|
|
|
127
127
|
* channel is off. They may turn it on, so it tells them to, and where (the
|
|
128
128
|
* email adds the link to that page): "SMS is off in this project. If it
|
|
129
129
|
* should be on, turn it on in Project Settings > Notifications > Notification
|
|
130
|
-
*
|
|
130
|
+
* Channels."
|
|
131
131
|
*/
|
|
132
132
|
const getProjectNotificationChannelOffOwnerSentence = (channel) => {
|
|
133
133
|
const words = CHANNEL_WORDS[channel];
|
|
@@ -73,7 +73,7 @@ const capitalize = (text) => {
|
|
|
73
73
|
* Who can add to a balance, and where, as the sentence after one that says
|
|
74
74
|
* it is too low - for whoever reads it, who may or may not be one of them:
|
|
75
75
|
* "A project owner or someone with Manage Billing can add balance in Project
|
|
76
|
-
* Settings > Notification
|
|
76
|
+
* Settings > Notification Channels."
|
|
77
77
|
*
|
|
78
78
|
* It does not offer Auto Recharge as the way out: most readers cannot turn
|
|
79
79
|
* it on, and where it is already on, it is what could not add more (its
|
|
@@ -118,7 +118,7 @@ const ONE_MESSAGE_WORDS = {
|
|
|
118
118
|
* verification code again, is refused because the project's balance is too
|
|
119
119
|
* low to pay for the code: "This project's balance is too low to send SMS.
|
|
120
120
|
* A project owner or someone with Manage Billing can add balance in Project
|
|
121
|
-
* Settings > Notification
|
|
121
|
+
* Settings > Notification Channels." Said to whoever asked, so it names who
|
|
122
122
|
* can rather than telling the reader to.
|
|
123
123
|
*/
|
|
124
124
|
const getProjectBalanceTooLowMessage = (channel) => {
|
|
@@ -11,7 +11,7 @@ const TwilioConfigUse_1 = __importDefault(require("../../Types/CallAndSMS/Twilio
|
|
|
11
11
|
*
|
|
12
12
|
* SMS and calls to the people in a project - on-call alerts, notifications, and
|
|
13
13
|
* the codes that verify their phone numbers - go through the project's default
|
|
14
|
-
* Twilio config (Project Settings > Notifications > Notification
|
|
14
|
+
* Twilio config (Project Settings > Notifications > Notification Channels), and
|
|
15
15
|
* through the Twilio account of the OneUptime server itself when the project
|
|
16
16
|
* has none (Admin Dashboard > Settings > Call and SMS). OneUptime Cloud always
|
|
17
17
|
* has the second. A self-hosted server has neither until somebody sets one up,
|
|
@@ -64,7 +64,7 @@ const WHAT_NEEDS_IT = {
|
|
|
64
64
|
* there is none: "The OneUptime server's administrator can add one in Admin
|
|
65
65
|
* Dashboard > Settings > Call and SMS, or a project owner, a project admin or
|
|
66
66
|
* someone with Create Call and SMS can add this project's own in Project
|
|
67
|
-
* Settings > Notification
|
|
67
|
+
* Settings > Notification Channels."
|
|
68
68
|
*/
|
|
69
69
|
exports.WHO_CAN_ADD_A_TWILIO_ACCOUNT_SENTENCE = `The OneUptime server's administrator can add one in ${exports.SERVER_TWILIO_SETTINGS_PAGE}, or ${exports.WHO_MAY_ADD_A_PROJECT_TWILIO_ACCOUNT} can add this project's own in ${exports.PROJECT_TWILIO_SETTINGS_PAGE}.`;
|
|
70
70
|
/*
|
|
@@ -57,6 +57,9 @@ export default class ScheduledMaintenanceStartUtil {
|
|
|
57
57
|
states: Array<unknown>;
|
|
58
58
|
state: unknown;
|
|
59
59
|
}): boolean;
|
|
60
|
+
static getScheduledState<T>(data: {
|
|
61
|
+
states: Array<T>;
|
|
62
|
+
}): T | null;
|
|
60
63
|
static getOngoingState<T>(data: {
|
|
61
64
|
states: Array<T>;
|
|
62
65
|
}): T | null;
|
|
@@ -57,6 +57,9 @@ export default class ScheduledMaintenanceStartUtil {
|
|
|
57
57
|
states: Array<unknown>;
|
|
58
58
|
state: unknown;
|
|
59
59
|
}): boolean;
|
|
60
|
+
static getScheduledState<T>(data: {
|
|
61
|
+
states: Array<T>;
|
|
62
|
+
}): T | null;
|
|
60
63
|
static getOngoingState<T>(data: {
|
|
61
64
|
states: Array<T>;
|
|
62
65
|
}): T | null;
|
|
@@ -292,6 +292,15 @@ class ScheduledMaintenanceStartUtil {
|
|
|
292
292
|
return ((0, StateOrder_1.getStateListReachedBuiltIn)(DEFINITION, placed.rows, placed.row) ===
|
|
293
293
|
COMPLETED_FLAG);
|
|
294
294
|
}
|
|
295
|
+
/*
|
|
296
|
+
* The project's scheduled state: the first state from the top flagged
|
|
297
|
+
* scheduled - the one a new event is created in, and the sample project's
|
|
298
|
+
* events start in. Null when the list has none (a project always keeps
|
|
299
|
+
* one; StateOrderGuard refuses deleting it).
|
|
300
|
+
*/
|
|
301
|
+
static getScheduledState(data) {
|
|
302
|
+
return this.getBuiltInState(data.states, SCHEDULED_FLAG);
|
|
303
|
+
}
|
|
295
304
|
/*
|
|
296
305
|
* The project's ongoing state: the first state from the top flagged
|
|
297
306
|
* ongoing - the one an event's start at its time, and Mark as Ongoing,
|
|
@@ -15,6 +15,7 @@ const MonitorSchemas_1 = require("./MonitorSchemas");
|
|
|
15
15
|
const MonitorType_1 = __importDefault(require("../../Types/Monitor/MonitorType"));
|
|
16
16
|
const WorkflowStatus_1 = __importDefault(require("../../Types/Workflow/WorkflowStatus"));
|
|
17
17
|
const CustomFieldType_1 = __importDefault(require("../../Types/CustomField/CustomFieldType"));
|
|
18
|
+
const ModelApiName_1 = require("../ModelApiName");
|
|
18
19
|
/*
|
|
19
20
|
* The text columns an encrypted secret is stored in. An encrypted JSON
|
|
20
21
|
* column holds a map of them, not one string, so it is left as it is.
|
|
@@ -638,8 +639,16 @@ class ModelSchema extends BaseSchema_1.BaseSchema {
|
|
|
638
639
|
if (!tableName) {
|
|
639
640
|
continue;
|
|
640
641
|
}
|
|
642
|
+
/*
|
|
643
|
+
* By the name the API keeps, the one OpenAPI.ts tags the model's
|
|
644
|
+
* endpoints with. A model renamed on screen (#6817: an On-Call Policy
|
|
645
|
+
* Schedule is an On-Call Schedule) keeps its tag, and its screen name
|
|
646
|
+
* here named a tag no endpoint has: the Terraform provider found no
|
|
647
|
+
* resource for the relation, and its docs example was not a list of
|
|
648
|
+
* ids.
|
|
649
|
+
*/
|
|
641
650
|
references[columnKey] = {
|
|
642
|
-
tag: target
|
|
651
|
+
tag: (0, ModelApiName_1.getApiSingularName)(target) || tableName,
|
|
643
652
|
tableName: tableName,
|
|
644
653
|
};
|
|
645
654
|
}
|
|
@@ -324,7 +324,8 @@ class UptimeMaintenanceUtil {
|
|
|
324
324
|
}),
|
|
325
325
|
],
|
|
326
326
|
options: {
|
|
327
|
-
|
|
327
|
+
// "5:14 ص" on a 12-hour clock, "05:14" on a 24-hour one.
|
|
328
|
+
hour: (0, DateLanguage_1.getHourOption)(use12HourFormat),
|
|
328
329
|
minute: "2-digit",
|
|
329
330
|
hour12: use12HourFormat,
|
|
330
331
|
},
|
|
@@ -3,16 +3,18 @@ export interface FormattedValue {
|
|
|
3
3
|
unit: string;
|
|
4
4
|
formatted: string;
|
|
5
5
|
}
|
|
6
|
+
export interface ValueFormatterOptions {
|
|
7
|
+
metricName?: string;
|
|
8
|
+
language?: string | undefined;
|
|
9
|
+
}
|
|
6
10
|
export default class ValueFormatter {
|
|
7
|
-
static formatValue(value: number, unit: string, options?:
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
static formatValue(value: number, unit: string, options?: ValueFormatterOptions): string;
|
|
12
|
+
static formatValueInParts(value: number, unit: string, options?: ValueFormatterOptions): FormattedValue;
|
|
13
|
+
static isUnitSetApart(parts: FormattedValue): boolean;
|
|
10
14
|
static getCompactUnit(unit: string, options?: {
|
|
11
15
|
metricName?: string;
|
|
12
16
|
}): string;
|
|
13
|
-
static formatValueCompact(value: number, unit: string, options?:
|
|
14
|
-
metricName?: string;
|
|
15
|
-
}): FormattedValue;
|
|
17
|
+
static formatValueCompact(value: number, unit: string, options?: ValueFormatterOptions): FormattedValue;
|
|
16
18
|
static isPercentUnit(unit: string | undefined): boolean;
|
|
17
19
|
static isFractionMetric(metricName: string | undefined): boolean;
|
|
18
20
|
static isHigherWorseMetric(metricName: string | undefined): boolean;
|