@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,397 @@
|
|
|
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.SAMPLE_DASHBOARD = exports.SAMPLE_SLO = exports.SAMPLE_SERVICE = exports.SAMPLE_MAINTENANCE = exports.SAMPLE_ON_CALL = exports.SAMPLE_ALERTS = exports.SampleAlertSeverity = exports.SampleAlertState = exports.SAMPLE_INCIDENTS = exports.SampleIncidentSeverity = exports.SampleIncidentState = exports.SAMPLE_STATUS_PAGE = exports.SAMPLE_STATUS_PAGE_GROUPS = exports.SAMPLE_MONITORS = exports.SampleMonitorStatus = exports.SAMPLE_MONITOR_HISTORY_DAYS = exports.MINUTES_IN_A_DAY = void 0;
|
|
7
|
+
const MonitorType_1 = __importDefault(require("../Monitor/MonitorType"));
|
|
8
|
+
/*
|
|
9
|
+
* WHAT A SAMPLE PROJECT HOLDS (issue #6808): "Acme Shop", a small online
|
|
10
|
+
* shop, with one story told through every Essentials product and the
|
|
11
|
+
* telemetry of one service.
|
|
12
|
+
*
|
|
13
|
+
* Ten minutes ago its checkout got slow. A monitor went Degraded, an
|
|
14
|
+
* incident was declared, the on-call policy paged the engineer on call,
|
|
15
|
+
* Maya, who acknowledged it four minutes later and is looking into it;
|
|
16
|
+
* the status page says so to customers. The service behind checkout shows
|
|
17
|
+
* it too: its latency and errors climb in its metrics, its traces and its
|
|
18
|
+
* logs. Two earlier incidents were resolved, one with a postmortem; a few
|
|
19
|
+
* alerts fired; a database upgrade is scheduled; an SLO counts what the
|
|
20
|
+
* slow checkout costs.
|
|
21
|
+
*
|
|
22
|
+
* Every moment is a number of minutes before the sample is made, so it
|
|
23
|
+
* always reads as now, whenever it is made (SampleProjectSeeder adds them
|
|
24
|
+
* to the moment it runs). Pure: the server and the tests read it.
|
|
25
|
+
*/
|
|
26
|
+
exports.MINUTES_IN_A_DAY = 24 * 60;
|
|
27
|
+
// How far back the monitors' history reaches.
|
|
28
|
+
exports.SAMPLE_MONITOR_HISTORY_DAYS = 30;
|
|
29
|
+
var SampleMonitorStatus;
|
|
30
|
+
(function (SampleMonitorStatus) {
|
|
31
|
+
SampleMonitorStatus["Operational"] = "Operational";
|
|
32
|
+
SampleMonitorStatus["Degraded"] = "Degraded";
|
|
33
|
+
SampleMonitorStatus["Offline"] = "Offline";
|
|
34
|
+
})(SampleMonitorStatus || (exports.SampleMonitorStatus = SampleMonitorStatus = {}));
|
|
35
|
+
exports.SAMPLE_MONITORS = [
|
|
36
|
+
{
|
|
37
|
+
key: "storefront",
|
|
38
|
+
name: "Storefront",
|
|
39
|
+
description: "The shop's home page.",
|
|
40
|
+
monitorType: MonitorType_1.default.Website,
|
|
41
|
+
destination: "https://shop.example.com",
|
|
42
|
+
port: null,
|
|
43
|
+
outages: [],
|
|
44
|
+
statusPageGroup: "Website",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "checkout",
|
|
48
|
+
name: "Checkout",
|
|
49
|
+
description: "The page customers pay on.",
|
|
50
|
+
monitorType: MonitorType_1.default.Website,
|
|
51
|
+
destination: "https://shop.example.com/checkout",
|
|
52
|
+
port: null,
|
|
53
|
+
outages: [
|
|
54
|
+
{
|
|
55
|
+
status: SampleMonitorStatus.Offline,
|
|
56
|
+
startsMinutesAgo: 3 * exports.MINUTES_IN_A_DAY + 2,
|
|
57
|
+
endsMinutesAgo: 3 * exports.MINUTES_IN_A_DAY - 40,
|
|
58
|
+
rootCause: "Checkout answered 502 Bad Gateway after release 2.14 went out.",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
status: SampleMonitorStatus.Degraded,
|
|
62
|
+
startsMinutesAgo: 27,
|
|
63
|
+
endsMinutesAgo: null,
|
|
64
|
+
rootCause: "Checkout took longer than 2 seconds to answer.",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
statusPageGroup: "Website",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "product-images",
|
|
71
|
+
name: "Product Images",
|
|
72
|
+
description: "The CDN that serves product photos.",
|
|
73
|
+
monitorType: MonitorType_1.default.Website,
|
|
74
|
+
destination: "https://images.shop.example.com",
|
|
75
|
+
port: null,
|
|
76
|
+
outages: [],
|
|
77
|
+
statusPageGroup: "Website",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "payments-api",
|
|
81
|
+
name: "Payments API",
|
|
82
|
+
description: "Takes card payments for checkout.",
|
|
83
|
+
monitorType: MonitorType_1.default.API,
|
|
84
|
+
destination: "https://api.shop.example.com/payments/health",
|
|
85
|
+
port: null,
|
|
86
|
+
outages: [
|
|
87
|
+
{
|
|
88
|
+
status: SampleMonitorStatus.Degraded,
|
|
89
|
+
startsMinutesAgo: 9 * exports.MINUTES_IN_A_DAY + 4,
|
|
90
|
+
endsMinutesAgo: 9 * exports.MINUTES_IN_A_DAY - 56,
|
|
91
|
+
rootCause: "The card processor took more than 5 seconds to answer.",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
statusPageGroup: "API",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: "search-api",
|
|
98
|
+
name: "Search API",
|
|
99
|
+
description: "Answers product searches.",
|
|
100
|
+
monitorType: MonitorType_1.default.API,
|
|
101
|
+
destination: "https://api.shop.example.com/search/health",
|
|
102
|
+
port: null,
|
|
103
|
+
outages: [],
|
|
104
|
+
statusPageGroup: "API",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "database",
|
|
108
|
+
name: "Database Host",
|
|
109
|
+
description: "The primary PostgreSQL server.",
|
|
110
|
+
monitorType: MonitorType_1.default.Ping,
|
|
111
|
+
destination: "db-1.shop.example.com",
|
|
112
|
+
port: null,
|
|
113
|
+
outages: [],
|
|
114
|
+
statusPageGroup: null,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "cache",
|
|
118
|
+
name: "Redis Cache",
|
|
119
|
+
description: "Sessions and carts.",
|
|
120
|
+
monitorType: MonitorType_1.default.Port,
|
|
121
|
+
destination: "cache-1.shop.example.com",
|
|
122
|
+
port: 6379,
|
|
123
|
+
outages: [],
|
|
124
|
+
statusPageGroup: null,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: "certificate",
|
|
128
|
+
name: "Shop Certificate",
|
|
129
|
+
description: "The TLS certificate of shop.example.com.",
|
|
130
|
+
monitorType: MonitorType_1.default.SSLCertificate,
|
|
131
|
+
destination: "https://shop.example.com",
|
|
132
|
+
port: null,
|
|
133
|
+
outages: [],
|
|
134
|
+
statusPageGroup: null,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: "dns",
|
|
138
|
+
name: "Shop DNS",
|
|
139
|
+
description: "Resolves shop.example.com.",
|
|
140
|
+
monitorType: MonitorType_1.default.DNS,
|
|
141
|
+
destination: "shop.example.com",
|
|
142
|
+
port: null,
|
|
143
|
+
outages: [],
|
|
144
|
+
statusPageGroup: null,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: "nightly-backup",
|
|
148
|
+
name: "Nightly Backup",
|
|
149
|
+
description: "The backup job reports here when it finishes.",
|
|
150
|
+
monitorType: MonitorType_1.default.IncomingRequest,
|
|
151
|
+
destination: null,
|
|
152
|
+
port: null,
|
|
153
|
+
outages: [],
|
|
154
|
+
statusPageGroup: null,
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
// The groups of the sample's status page, in order.
|
|
158
|
+
exports.SAMPLE_STATUS_PAGE_GROUPS = [
|
|
159
|
+
"Website",
|
|
160
|
+
"API",
|
|
161
|
+
];
|
|
162
|
+
exports.SAMPLE_STATUS_PAGE = {
|
|
163
|
+
name: "Acme Shop Status",
|
|
164
|
+
description: "What customers see: the shop, its checkout and its APIs.",
|
|
165
|
+
pageTitle: "Acme Shop Status",
|
|
166
|
+
pageDescription: "Live status of the Acme Shop website and APIs.",
|
|
167
|
+
};
|
|
168
|
+
var SampleIncidentState;
|
|
169
|
+
(function (SampleIncidentState) {
|
|
170
|
+
SampleIncidentState["Identified"] = "Identified";
|
|
171
|
+
SampleIncidentState["Acknowledged"] = "Acknowledged";
|
|
172
|
+
SampleIncidentState["Resolved"] = "Resolved";
|
|
173
|
+
})(SampleIncidentState || (exports.SampleIncidentState = SampleIncidentState = {}));
|
|
174
|
+
var SampleIncidentSeverity;
|
|
175
|
+
(function (SampleIncidentSeverity) {
|
|
176
|
+
SampleIncidentSeverity["Critical"] = "Critical Incident";
|
|
177
|
+
SampleIncidentSeverity["Major"] = "Major Incident";
|
|
178
|
+
SampleIncidentSeverity["Minor"] = "Minor Incident";
|
|
179
|
+
})(SampleIncidentSeverity || (exports.SampleIncidentSeverity = SampleIncidentSeverity = {}));
|
|
180
|
+
exports.SAMPLE_INCIDENTS = [
|
|
181
|
+
{
|
|
182
|
+
key: "payments-timeouts",
|
|
183
|
+
title: "Payments API timing out",
|
|
184
|
+
description: "Card payments took more than 5 seconds, and some checkouts failed.",
|
|
185
|
+
severity: SampleIncidentSeverity.Major,
|
|
186
|
+
monitorKeys: ["payments-api"],
|
|
187
|
+
declaredMinutesAgo: 9 * exports.MINUTES_IN_A_DAY + 2,
|
|
188
|
+
states: [
|
|
189
|
+
{
|
|
190
|
+
state: SampleIncidentState.Identified,
|
|
191
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY + 2,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
state: SampleIncidentState.Acknowledged,
|
|
195
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY - 4,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
state: SampleIncidentState.Resolved,
|
|
199
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY - 56,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
internalNotes: [
|
|
203
|
+
{
|
|
204
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY - 10,
|
|
205
|
+
authorHandle: "sam.okafor",
|
|
206
|
+
note: "The card processor's status page shows degraded performance in our region. Raising our timeout will not help; switching traffic to the backup processor.",
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
publicNotes: [
|
|
210
|
+
{
|
|
211
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY - 8,
|
|
212
|
+
authorHandle: "sam.okafor",
|
|
213
|
+
note: "Some card payments are slow or failing. We are moving payments to our backup processor.",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
minutesAgo: 9 * exports.MINUTES_IN_A_DAY - 56,
|
|
217
|
+
authorHandle: "sam.okafor",
|
|
218
|
+
note: "Payments are working normally again.",
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
rootCause: "The card processor was slow in our region, and checkout waited for it with no fallback.",
|
|
222
|
+
postmortemNote: [
|
|
223
|
+
"## Summary",
|
|
224
|
+
"",
|
|
225
|
+
"For 58 minutes, card payments took more than 5 seconds and about 4% of checkouts failed.",
|
|
226
|
+
"",
|
|
227
|
+
"## What happened",
|
|
228
|
+
"",
|
|
229
|
+
"- The card processor slowed down in our region.",
|
|
230
|
+
"- The Payments API monitor went Degraded and paged the on-call engineer.",
|
|
231
|
+
"- We switched payments to the backup processor, and they recovered.",
|
|
232
|
+
"",
|
|
233
|
+
"## What we will change",
|
|
234
|
+
"",
|
|
235
|
+
"- Fall back to the backup processor automatically after 2 seconds.",
|
|
236
|
+
"- Alert on payment latency, not only on the health check.",
|
|
237
|
+
].join("\n"),
|
|
238
|
+
isPagedByOnCall: false,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
key: "checkout-release-errors",
|
|
242
|
+
title: "Checkout errors after release 2.14",
|
|
243
|
+
description: "Checkout answered 502 Bad Gateway for every customer after release 2.14.",
|
|
244
|
+
severity: SampleIncidentSeverity.Critical,
|
|
245
|
+
monitorKeys: ["checkout"],
|
|
246
|
+
declaredMinutesAgo: 3 * exports.MINUTES_IN_A_DAY + 1,
|
|
247
|
+
states: [
|
|
248
|
+
{
|
|
249
|
+
state: SampleIncidentState.Identified,
|
|
250
|
+
minutesAgo: 3 * exports.MINUTES_IN_A_DAY + 1,
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
state: SampleIncidentState.Acknowledged,
|
|
254
|
+
minutesAgo: 3 * exports.MINUTES_IN_A_DAY - 2,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
state: SampleIncidentState.Resolved,
|
|
258
|
+
minutesAgo: 3 * exports.MINUTES_IN_A_DAY - 40,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
internalNotes: [
|
|
262
|
+
{
|
|
263
|
+
minutesAgo: 3 * exports.MINUTES_IN_A_DAY - 12,
|
|
264
|
+
authorHandle: "lena.fischer",
|
|
265
|
+
note: "Release 2.14 changed the checkout service's port. Rolling back.",
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
publicNotes: [
|
|
269
|
+
{
|
|
270
|
+
minutesAgo: 3 * exports.MINUTES_IN_A_DAY - 5,
|
|
271
|
+
authorHandle: "lena.fischer",
|
|
272
|
+
note: "Checkout is failing for every customer. We have found the cause and are rolling back.",
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
rootCause: "Release 2.14 moved checkout to a port the load balancer did not know.",
|
|
276
|
+
postmortemNote: null,
|
|
277
|
+
isPagedByOnCall: false,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
key: "checkout-slow",
|
|
281
|
+
title: "Checkout is slow for some customers",
|
|
282
|
+
description: "Checkout takes more than 2 seconds for about one customer in five. Payments still go through.",
|
|
283
|
+
severity: SampleIncidentSeverity.Major,
|
|
284
|
+
monitorKeys: ["checkout"],
|
|
285
|
+
declaredMinutesAgo: 25,
|
|
286
|
+
states: [
|
|
287
|
+
{ state: SampleIncidentState.Identified, minutesAgo: 25 },
|
|
288
|
+
{ state: SampleIncidentState.Acknowledged, minutesAgo: 21 },
|
|
289
|
+
],
|
|
290
|
+
internalNotes: [
|
|
291
|
+
{
|
|
292
|
+
minutesAgo: 18,
|
|
293
|
+
authorHandle: "maya.chen",
|
|
294
|
+
note: "checkout-api's p95 latency went from 300 ms to 1.8 s at the same time as a spike in database connections. Looking at the slow query log.",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
minutesAgo: 9,
|
|
298
|
+
authorHandle: "maya.chen",
|
|
299
|
+
note: "Found it: the new discount query scans the whole orders table. Adding an index now.",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
publicNotes: [
|
|
303
|
+
{
|
|
304
|
+
minutesAgo: 15,
|
|
305
|
+
authorHandle: "maya.chen",
|
|
306
|
+
note: "Checkout is slow for some customers. Payments still go through, and we are working on a fix.",
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
rootCause: null,
|
|
310
|
+
postmortemNote: null,
|
|
311
|
+
isPagedByOnCall: true,
|
|
312
|
+
},
|
|
313
|
+
];
|
|
314
|
+
var SampleAlertState;
|
|
315
|
+
(function (SampleAlertState) {
|
|
316
|
+
SampleAlertState["Identified"] = "Identified";
|
|
317
|
+
SampleAlertState["Acknowledged"] = "Acknowledged";
|
|
318
|
+
SampleAlertState["Resolved"] = "Resolved";
|
|
319
|
+
})(SampleAlertState || (exports.SampleAlertState = SampleAlertState = {}));
|
|
320
|
+
var SampleAlertSeverity;
|
|
321
|
+
(function (SampleAlertSeverity) {
|
|
322
|
+
SampleAlertSeverity["High"] = "High";
|
|
323
|
+
SampleAlertSeverity["Low"] = "Low";
|
|
324
|
+
})(SampleAlertSeverity || (exports.SampleAlertSeverity = SampleAlertSeverity = {}));
|
|
325
|
+
exports.SAMPLE_ALERTS = [
|
|
326
|
+
{
|
|
327
|
+
key: "checkout-error-rate",
|
|
328
|
+
title: "Error rate above 2% on checkout-api",
|
|
329
|
+
description: "checkout-api answered 5xx to more than 2% of requests for 5 minutes.",
|
|
330
|
+
severity: SampleAlertSeverity.High,
|
|
331
|
+
monitorKey: "checkout",
|
|
332
|
+
states: [
|
|
333
|
+
{ state: SampleAlertState.Identified, minutesAgo: 28 },
|
|
334
|
+
{ state: SampleAlertState.Acknowledged, minutesAgo: 22 },
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
key: "checkout-latency",
|
|
339
|
+
title: "p95 latency above 800 ms on checkout-api",
|
|
340
|
+
description: "checkout-api's p95 latency stayed above 800 ms for 5 minutes.",
|
|
341
|
+
severity: SampleAlertSeverity.High,
|
|
342
|
+
monitorKey: "checkout",
|
|
343
|
+
states: [{ state: SampleAlertState.Identified, minutesAgo: 26 }],
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
key: "database-disk",
|
|
347
|
+
title: "Disk space below 15% on db-1",
|
|
348
|
+
description: "The database host's data disk had less than 15% free.",
|
|
349
|
+
severity: SampleAlertSeverity.Low,
|
|
350
|
+
monitorKey: "database",
|
|
351
|
+
states: [
|
|
352
|
+
{ state: SampleAlertState.Identified, minutesAgo: 2 * exports.MINUTES_IN_A_DAY },
|
|
353
|
+
{
|
|
354
|
+
state: SampleAlertState.Resolved,
|
|
355
|
+
minutesAgo: 2 * exports.MINUTES_IN_A_DAY - 35,
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
];
|
|
360
|
+
exports.SAMPLE_ON_CALL = {
|
|
361
|
+
policyName: "Acme Shop Production",
|
|
362
|
+
policyDescription: "Pages whoever is on call for the shop, then the engineering manager.",
|
|
363
|
+
scheduleName: "Shop Engineers",
|
|
364
|
+
scheduleDescription: "A weekly rotation of the shop's engineers.",
|
|
365
|
+
layerName: "Weekly Rotation",
|
|
366
|
+
// The engineers of the rotation, in turn: the first is on call this week.
|
|
367
|
+
rotationHandles: ["maya.chen", "sam.okafor", "lena.fischer"],
|
|
368
|
+
firstLevelName: "Engineer on call",
|
|
369
|
+
secondLevelName: "Engineering manager",
|
|
370
|
+
secondLevelHandle: "diego.alvarez",
|
|
371
|
+
escalateAfterInMinutes: 10,
|
|
372
|
+
// How long the engineer on call took to acknowledge the open incident.
|
|
373
|
+
acknowledgedAfterMinutes: 4,
|
|
374
|
+
};
|
|
375
|
+
exports.SAMPLE_MAINTENANCE = {
|
|
376
|
+
title: "Database upgrade to PostgreSQL 17",
|
|
377
|
+
description: "Checkout may be slow for up to 15 minutes while the database fails over.",
|
|
378
|
+
// From 3 days after the sample is made, for an hour.
|
|
379
|
+
startsInMinutes: 3 * exports.MINUTES_IN_A_DAY,
|
|
380
|
+
durationInMinutes: 60,
|
|
381
|
+
monitorKeys: ["checkout", "database"],
|
|
382
|
+
};
|
|
383
|
+
exports.SAMPLE_SERVICE = {
|
|
384
|
+
name: "checkout-api",
|
|
385
|
+
description: "Takes the cart, prices it and asks the Payments API to charge it.",
|
|
386
|
+
};
|
|
387
|
+
exports.SAMPLE_SLO = {
|
|
388
|
+
name: "Checkout availability",
|
|
389
|
+
description: "Checkout is up 99.9% of the time, over 30 days.",
|
|
390
|
+
monitorKey: "checkout",
|
|
391
|
+
targetPercentage: 99.9,
|
|
392
|
+
windowDays: 30,
|
|
393
|
+
};
|
|
394
|
+
exports.SAMPLE_DASHBOARD = {
|
|
395
|
+
name: "Checkout Service",
|
|
396
|
+
description: "Request rate, latency, errors and resources of checkout-api.",
|
|
397
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import commonJsModule from "./SampleProjectContent.js";
|
|
2
|
+
export const MINUTES_IN_A_DAY = commonJsModule.MINUTES_IN_A_DAY;
|
|
3
|
+
export const SAMPLE_ALERTS = commonJsModule.SAMPLE_ALERTS;
|
|
4
|
+
export const SAMPLE_DASHBOARD = commonJsModule.SAMPLE_DASHBOARD;
|
|
5
|
+
export const SAMPLE_INCIDENTS = commonJsModule.SAMPLE_INCIDENTS;
|
|
6
|
+
export const SAMPLE_MAINTENANCE = commonJsModule.SAMPLE_MAINTENANCE;
|
|
7
|
+
export const SAMPLE_MONITORS = commonJsModule.SAMPLE_MONITORS;
|
|
8
|
+
export const SAMPLE_MONITOR_HISTORY_DAYS = commonJsModule.SAMPLE_MONITOR_HISTORY_DAYS;
|
|
9
|
+
export const SAMPLE_ON_CALL = commonJsModule.SAMPLE_ON_CALL;
|
|
10
|
+
export const SAMPLE_SERVICE = commonJsModule.SAMPLE_SERVICE;
|
|
11
|
+
export const SAMPLE_SLO = commonJsModule.SAMPLE_SLO;
|
|
12
|
+
export const SAMPLE_STATUS_PAGE = commonJsModule.SAMPLE_STATUS_PAGE;
|
|
13
|
+
export const SAMPLE_STATUS_PAGE_GROUPS = commonJsModule.SAMPLE_STATUS_PAGE_GROUPS;
|
|
14
|
+
export const SampleAlertSeverity = commonJsModule.SampleAlertSeverity;
|
|
15
|
+
export const SampleAlertState = commonJsModule.SampleAlertState;
|
|
16
|
+
export const SampleIncidentSeverity = commonJsModule.SampleIncidentSeverity;
|
|
17
|
+
export const SampleIncidentState = commonJsModule.SampleIncidentState;
|
|
18
|
+
export const SampleMonitorStatus = commonJsModule.SampleMonitorStatus;
|
|
@@ -74,11 +74,12 @@ var TelemetryIngestSurface;
|
|
|
74
74
|
TelemetryIngestSurface["ResourceAiAgent"] = "resource-ai-agent";
|
|
75
75
|
/*
|
|
76
76
|
* The OpAMP supervisor OneUptime's host installer puts on a host
|
|
77
|
-
* (POST /opamp/v1
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* collector
|
|
81
|
-
*
|
|
77
|
+
* (POST /telemetry/opamp/v1, or /opamp/v1 from a host installed before
|
|
78
|
+
* the installers moved to /telemetry): it reports the collector's state
|
|
79
|
+
* and receives the config the host runs. Server keys only - a page never
|
|
80
|
+
* manages a collector - and a key pinned to one service is refused there:
|
|
81
|
+
* a host's collector sends the host's telemetry, not one service's. Not
|
|
82
|
+
* an identity registration surface (below): one key serves a whole fleet,
|
|
82
83
|
* each host polling every 30 seconds, which that surfaces' default
|
|
83
84
|
* requests-per-minute ceiling would refuse.
|
|
84
85
|
*/
|
package/Types/Translator.d.mts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const isComposedValue: (value: unknown) => value is ComposedValue
|
|
|
26
26
|
export declare const translationKey: <T extends string>(text: T) => T;
|
|
27
27
|
export declare const DEFAULT_LANGUAGE: string;
|
|
28
28
|
export declare const toSentenceTerm: (text: string, language?: string) => string;
|
|
29
|
+
export declare const toLabelTerm: (text: string, language?: string) => string;
|
|
29
30
|
export declare const getPluralCategory: (language: string, count: number) => string;
|
|
30
31
|
export declare const getTemplatePlaceholders: (template: string) => Array<string>;
|
|
31
32
|
export declare const isOneFormOnlyForOne: (template: PluralTemplate) => boolean;
|
package/Types/Translator.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const isComposedValue: (value: unknown) => value is ComposedValue
|
|
|
26
26
|
export declare const translationKey: <T extends string>(text: T) => T;
|
|
27
27
|
export declare const DEFAULT_LANGUAGE: string;
|
|
28
28
|
export declare const toSentenceTerm: (text: string, language?: string) => string;
|
|
29
|
+
export declare const toLabelTerm: (text: string, language?: string) => string;
|
|
29
30
|
export declare const getPluralCategory: (language: string, count: number) => string;
|
|
30
31
|
export declare const getTemplatePlaceholders: (template: string) => Array<string>;
|
|
31
32
|
export declare const isOneFormOnlyForOne: (template: PluralTemplate) => boolean;
|
package/Types/Translator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTemplateAround = exports.getSentencePartsAndLanguage = exports.getSentenceParts = exports.translateNamedAction = exports.getSentenceLanguage = exports.formatInline = exports.formatList = exports.getListSeparator = exports.createTranslator = exports.getInlineSeparator = exports.writesZeroAsADot = exports.DOT_ZERO_INLINE_SEPARATOR = exports.INLINE_SEPARATOR = exports.fillTemplate = exports.isOneFormOnlyForOne = exports.getTemplatePlaceholders = exports.getPluralCategory = exports.toSentenceTerm = exports.DEFAULT_LANGUAGE = exports.translationKey = exports.isComposedValue = exports.composedValue = exports.isTranslatableTerm = exports.translatableTerm = void 0;
|
|
3
|
+
exports.getTemplateAround = exports.getSentencePartsAndLanguage = exports.getSentenceParts = exports.translateNamedAction = exports.getSentenceLanguage = exports.formatInline = exports.formatList = exports.getListSeparator = exports.createTranslator = exports.getInlineSeparator = exports.writesZeroAsADot = exports.DOT_ZERO_INLINE_SEPARATOR = exports.INLINE_SEPARATOR = exports.fillTemplate = exports.isOneFormOnlyForOne = exports.getTemplatePlaceholders = exports.getPluralCategory = exports.toLabelTerm = exports.toSentenceTerm = exports.DEFAULT_LANGUAGE = exports.translationKey = exports.isComposedValue = exports.composedValue = exports.isTranslatableTerm = exports.translatableTerm = void 0;
|
|
4
4
|
const DateLanguage_1 = require("./DateLanguage");
|
|
5
5
|
const ReadingDirection_1 = require("./ReadingDirection");
|
|
6
6
|
const translatableTerm = (text, options) => {
|
|
@@ -63,6 +63,7 @@ const PROPER_NOUNS = [
|
|
|
63
63
|
"Jira",
|
|
64
64
|
"Kubernetes",
|
|
65
65
|
"Linux",
|
|
66
|
+
"Mattermost",
|
|
66
67
|
"Microsoft",
|
|
67
68
|
"Okta",
|
|
68
69
|
"OpenTelemetry",
|
|
@@ -81,7 +82,10 @@ const PROPER_NOUNS = [
|
|
|
81
82
|
* Proper nouns of two words: the second keeps its capital after the first
|
|
82
83
|
* ("Google Cloud project", but "cloud resources").
|
|
83
84
|
*/
|
|
84
|
-
const PROPER_NOUN_PAIRS = [
|
|
85
|
+
const PROPER_NOUN_PAIRS = [
|
|
86
|
+
["Google", "Cloud"],
|
|
87
|
+
["Microsoft", "Teams"],
|
|
88
|
+
];
|
|
85
89
|
// "API", "SLOs": two capitals in a row.
|
|
86
90
|
const ACRONYM_PATTERN = /\p{Lu}{2,}/u;
|
|
87
91
|
// "OneUptime", "GitHub", "iOS": a capital after the first letter.
|
|
@@ -134,6 +138,40 @@ const toSentenceTerm = (text, language) => {
|
|
|
134
138
|
.join(" ");
|
|
135
139
|
};
|
|
136
140
|
exports.toSentenceTerm = toSentenceTerm;
|
|
141
|
+
// A lower-case letter at the very start: the "c" of "clúster de Kubernetes".
|
|
142
|
+
const LOWER_CASE_START = /^\p{Ll}/u;
|
|
143
|
+
/*
|
|
144
|
+
* A word or name as it starts a label - a row's name, a chip, a line of a
|
|
145
|
+
* card - in `language`: its first letter upper-cased the way the language
|
|
146
|
+
* writes a capital. A locale words a name the way the sentences that say it
|
|
147
|
+
* take it ("Este clúster de Kubernetes...", "Этот кластер Kubernetes..."),
|
|
148
|
+
* so where the same key names a row it starts lower-case; drawn through
|
|
149
|
+
* this, it reads "Clúster de Kubernetes", "Кластер Kubernetes". The
|
|
150
|
+
* counterpart of toSentenceTerm, which writes a label for the middle of a
|
|
151
|
+
* sentence.
|
|
152
|
+
*
|
|
153
|
+
* Unchanged when the text starts with anything but a lower-case letter - a
|
|
154
|
+
* capital, a digit, a sign, a letter of a script without case (Chinese,
|
|
155
|
+
* Japanese, Korean, Persian, Arabic, Hindi) - and when its first word keeps
|
|
156
|
+
* its own case ("vCenter", "iOS", "eBPF"). For a label of words, never a
|
|
157
|
+
* code or a name someone typed.
|
|
158
|
+
*/
|
|
159
|
+
const toLabelTerm = (text, language) => {
|
|
160
|
+
var _a;
|
|
161
|
+
const first = (_a = LOWER_CASE_START.exec(text)) === null || _a === void 0 ? void 0 : _a[0];
|
|
162
|
+
if (!first || keepsItsCase(text.split(/[\s-]/)[0] || "")) {
|
|
163
|
+
return text;
|
|
164
|
+
}
|
|
165
|
+
let capital;
|
|
166
|
+
try {
|
|
167
|
+
capital = first.toLocaleUpperCase(language || exports.DEFAULT_LANGUAGE);
|
|
168
|
+
}
|
|
169
|
+
catch (_b) {
|
|
170
|
+
capital = first.toUpperCase();
|
|
171
|
+
}
|
|
172
|
+
return `${capital}${text.slice(first.length)}`;
|
|
173
|
+
};
|
|
174
|
+
exports.toLabelTerm = toLabelTerm;
|
|
137
175
|
/*
|
|
138
176
|
* The CLDR plural category of `count` in `language` - "one", "few",
|
|
139
177
|
* "many", "other"... - which is also i18next's key suffix for that form.
|
package/Types/Translator.mjs
CHANGED
|
@@ -18,6 +18,7 @@ export const getTemplatePlaceholders = commonJsModule.getTemplatePlaceholders;
|
|
|
18
18
|
export const isComposedValue = commonJsModule.isComposedValue;
|
|
19
19
|
export const isOneFormOnlyForOne = commonJsModule.isOneFormOnlyForOne;
|
|
20
20
|
export const isTranslatableTerm = commonJsModule.isTranslatableTerm;
|
|
21
|
+
export const toLabelTerm = commonJsModule.toLabelTerm;
|
|
21
22
|
export const toSentenceTerm = commonJsModule.toSentenceTerm;
|
|
22
23
|
export const translatableTerm = commonJsModule.translatableTerm;
|
|
23
24
|
export const translateNamedAction = commonJsModule.translateNamedAction;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export declare enum UsedByRecordKind {
|
|
2
|
+
Monitor = "monitor",
|
|
3
|
+
OnCallSchedule = "on-call-schedule",
|
|
4
|
+
Service = "service",
|
|
5
|
+
StatusPage = "status-page",
|
|
6
|
+
Team = "team",
|
|
7
|
+
Label = "label"
|
|
8
|
+
}
|
|
9
|
+
export declare enum UsedByRowKind {
|
|
10
|
+
Monitor = "Monitor",
|
|
11
|
+
MonitorGroup = "MonitorGroup",
|
|
12
|
+
StatusPage = "StatusPage",
|
|
13
|
+
ServiceLevelObjective = "ServiceLevelObjective",
|
|
14
|
+
ScheduledMaintenance = "ScheduledMaintenance",
|
|
15
|
+
Workflow = "Workflow",
|
|
16
|
+
Dashboard = "Dashboard",
|
|
17
|
+
OnCallDutyPolicy = "OnCallDutyPolicy",
|
|
18
|
+
OnCallSchedule = "OnCallSchedule",
|
|
19
|
+
Service = "Service",
|
|
20
|
+
Incident = "Incident",
|
|
21
|
+
Alert = "Alert"
|
|
22
|
+
}
|
|
23
|
+
export declare enum UsedByRelation {
|
|
24
|
+
MonitorStatusPages = "MonitorStatusPages",
|
|
25
|
+
MonitorGroups = "MonitorGroups",
|
|
26
|
+
MonitorSlos = "MonitorSlos",
|
|
27
|
+
MonitorScheduledMaintenance = "MonitorScheduledMaintenance",
|
|
28
|
+
MonitorDependents = "MonitorDependents",
|
|
29
|
+
MonitorWorkflows = "MonitorWorkflows",
|
|
30
|
+
MonitorDashboards = "MonitorDashboards",
|
|
31
|
+
ScheduleOnCallPolicies = "ScheduleOnCallPolicies",
|
|
32
|
+
ServiceMonitors = "ServiceMonitors",
|
|
33
|
+
ServiceSlos = "ServiceSlos",
|
|
34
|
+
StatusPageOpenIncidents = "StatusPageOpenIncidents",
|
|
35
|
+
StatusPageMaintenance = "StatusPageMaintenance",
|
|
36
|
+
TeamOnCallPolicies = "TeamOnCallPolicies",
|
|
37
|
+
TeamOwnedMonitors = "TeamOwnedMonitors",
|
|
38
|
+
TeamOwnedStatusPages = "TeamOwnedStatusPages",
|
|
39
|
+
TeamOwnedServices = "TeamOwnedServices",
|
|
40
|
+
TeamOwnedOnCallPolicies = "TeamOwnedOnCallPolicies",
|
|
41
|
+
TeamOwnedSchedules = "TeamOwnedSchedules",
|
|
42
|
+
LabelMonitors = "LabelMonitors",
|
|
43
|
+
LabelMonitorGroups = "LabelMonitorGroups",
|
|
44
|
+
LabelStatusPages = "LabelStatusPages",
|
|
45
|
+
LabelServices = "LabelServices",
|
|
46
|
+
LabelIncidents = "LabelIncidents",
|
|
47
|
+
LabelAlerts = "LabelAlerts",
|
|
48
|
+
LabelScheduledMaintenance = "LabelScheduledMaintenance",
|
|
49
|
+
LabelOnCallPolicies = "LabelOnCallPolicies",
|
|
50
|
+
LabelOnCallSchedules = "LabelOnCallSchedules",
|
|
51
|
+
LabelSlos = "LabelSlos",
|
|
52
|
+
LabelWorkflows = "LabelWorkflows",
|
|
53
|
+
LabelDashboards = "LabelDashboards"
|
|
54
|
+
}
|
|
55
|
+
export interface UsedByRelationDescription {
|
|
56
|
+
relation: UsedByRelation;
|
|
57
|
+
rowKind: UsedByRowKind;
|
|
58
|
+
}
|
|
59
|
+
export declare const USED_BY_RELATIONS: Readonly<Record<UsedByRecordKind, ReadonlyArray<UsedByRelationDescription>>>;
|
|
60
|
+
export declare const USED_BY_PREVIEW_ROW_COUNT: number;
|
|
61
|
+
export declare const USED_BY_PAGE_SIZE: number;
|
|
62
|
+
export declare const USED_BY_MAX_PAGE_SIZE: number;
|
|
63
|
+
export interface UsedByRow {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
number?: string | undefined;
|
|
67
|
+
detail?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
export interface UsedByGroup {
|
|
70
|
+
relation: UsedByRelation;
|
|
71
|
+
rowKind: UsedByRowKind;
|
|
72
|
+
count: number;
|
|
73
|
+
hiddenCount: number;
|
|
74
|
+
rows: Array<UsedByRow>;
|
|
75
|
+
}
|
|
76
|
+
export interface UsedBySummary {
|
|
77
|
+
recordKind: UsedByRecordKind;
|
|
78
|
+
recordId: string;
|
|
79
|
+
groups: Array<UsedByGroup>;
|
|
80
|
+
}
|
|
81
|
+
export interface UsedByPage {
|
|
82
|
+
recordKind: UsedByRecordKind;
|
|
83
|
+
recordId: string;
|
|
84
|
+
relation: UsedByRelation;
|
|
85
|
+
rowKind: UsedByRowKind;
|
|
86
|
+
count: number;
|
|
87
|
+
hiddenCount: number;
|
|
88
|
+
pageStart: number;
|
|
89
|
+
pageSize: number;
|
|
90
|
+
rows: Array<UsedByRow>;
|
|
91
|
+
}
|
|
92
|
+
export declare function isUsedByRecordKind(value: unknown): value is UsedByRecordKind;
|
|
93
|
+
export declare function isUsedByRelation(value: unknown): value is UsedByRelation;
|
|
94
|
+
export declare function getUsedByRelations(recordKind: UsedByRecordKind): ReadonlyArray<UsedByRelationDescription>;
|
|
95
|
+
export declare function getUsedByRecordKindOfRelation(relation: UsedByRelation): UsedByRecordKind | null;
|
|
96
|
+
export declare function getUsedByRowKind(relation: UsedByRelation): UsedByRowKind | null;
|
|
97
|
+
export declare function getUsedByGroupTotal(group: Pick<UsedByGroup, "count" | "hiddenCount">): number;
|
|
98
|
+
export declare function getUsedByGroupsInUse(summary: Pick<UsedBySummary, "groups">, leaveOut?: ReadonlyArray<UsedByRelation> | undefined): Array<UsedByGroup>;
|
|
99
|
+
export declare function isUsedByNothing(summary: Pick<UsedBySummary, "groups">): boolean;
|
|
100
|
+
export declare function isUsedBySummary(value: unknown): value is UsedBySummary;
|
|
101
|
+
export declare function isUsedByPage(value: unknown): value is UsedByPage;
|
|
102
|
+
export declare function normalizeUsedByPageSize(value: unknown): number;
|
|
103
|
+
export declare function normalizeUsedBySkip(value: unknown): number;
|