@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,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;
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* "USED BY": WHAT REFERS TO A RECORD (#6813).
|
|
4
|
+
*
|
|
5
|
+
* OneUptime's records point at each other - a status page lists monitors,
|
|
6
|
+
* an escalation rule names a schedule, an SLO measures a monitor - and
|
|
7
|
+
* each record shows what it points to. This is the other direction: given
|
|
8
|
+
* a record, the records that point at it, so "which status pages show
|
|
9
|
+
* this monitor?", "does any policy use this schedule?" and "can I delete
|
|
10
|
+
* this?" are answered on the record's own page instead of by opening
|
|
11
|
+
* every status page, policy and SLO in turn.
|
|
12
|
+
*
|
|
13
|
+
* One step only: a monitor shows the status pages that list it, not the
|
|
14
|
+
* subscribers of those pages. Two exceptions, each because it is what a
|
|
15
|
+
* person means by the question: a status page that shows the monitor
|
|
16
|
+
* through one of its monitor groups shows the monitor, and a service's
|
|
17
|
+
* SLOs are the SLOs that measure the monitors watching it (no SLO names a
|
|
18
|
+
* service).
|
|
19
|
+
*
|
|
20
|
+
* The server (Server/Services/UsedByService) keeps, in one place, how each
|
|
21
|
+
* relation is read, and reads every one through the models' own services
|
|
22
|
+
* with the reader's permissions: a reader is shown only the records they
|
|
23
|
+
* may read, and told how many more there are that they may not, without
|
|
24
|
+
* their names. Counts come first, a few rows with them, and the rest of a
|
|
25
|
+
* relation's rows on request, a page at a time - so a record used by
|
|
26
|
+
* thousands of others still loads in a handful of bounded reads.
|
|
27
|
+
*
|
|
28
|
+
* Pure, with no server or browser APIs: the Dashboard and the server read
|
|
29
|
+
* the same kinds, relations and shapes.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.USED_BY_MAX_PAGE_SIZE = exports.USED_BY_PAGE_SIZE = exports.USED_BY_PREVIEW_ROW_COUNT = exports.USED_BY_RELATIONS = exports.UsedByRelation = exports.UsedByRowKind = exports.UsedByRecordKind = void 0;
|
|
33
|
+
exports.isUsedByRecordKind = isUsedByRecordKind;
|
|
34
|
+
exports.isUsedByRelation = isUsedByRelation;
|
|
35
|
+
exports.getUsedByRelations = getUsedByRelations;
|
|
36
|
+
exports.getUsedByRecordKindOfRelation = getUsedByRecordKindOfRelation;
|
|
37
|
+
exports.getUsedByRowKind = getUsedByRowKind;
|
|
38
|
+
exports.getUsedByGroupTotal = getUsedByGroupTotal;
|
|
39
|
+
exports.getUsedByGroupsInUse = getUsedByGroupsInUse;
|
|
40
|
+
exports.isUsedByNothing = isUsedByNothing;
|
|
41
|
+
exports.isUsedBySummary = isUsedBySummary;
|
|
42
|
+
exports.isUsedByPage = isUsedByPage;
|
|
43
|
+
exports.normalizeUsedByPageSize = normalizeUsedByPageSize;
|
|
44
|
+
exports.normalizeUsedBySkip = normalizeUsedBySkip;
|
|
45
|
+
// The records that answer "what uses this?" on their own page.
|
|
46
|
+
var UsedByRecordKind;
|
|
47
|
+
(function (UsedByRecordKind) {
|
|
48
|
+
UsedByRecordKind["Monitor"] = "monitor";
|
|
49
|
+
UsedByRecordKind["OnCallSchedule"] = "on-call-schedule";
|
|
50
|
+
UsedByRecordKind["Service"] = "service";
|
|
51
|
+
UsedByRecordKind["StatusPage"] = "status-page";
|
|
52
|
+
UsedByRecordKind["Team"] = "team";
|
|
53
|
+
UsedByRecordKind["Label"] = "label";
|
|
54
|
+
})(UsedByRecordKind || (exports.UsedByRecordKind = UsedByRecordKind = {}));
|
|
55
|
+
// What one row of a relation is: what the Dashboard opens when it is clicked.
|
|
56
|
+
var UsedByRowKind;
|
|
57
|
+
(function (UsedByRowKind) {
|
|
58
|
+
UsedByRowKind["Monitor"] = "Monitor";
|
|
59
|
+
UsedByRowKind["MonitorGroup"] = "MonitorGroup";
|
|
60
|
+
UsedByRowKind["StatusPage"] = "StatusPage";
|
|
61
|
+
UsedByRowKind["ServiceLevelObjective"] = "ServiceLevelObjective";
|
|
62
|
+
UsedByRowKind["ScheduledMaintenance"] = "ScheduledMaintenance";
|
|
63
|
+
UsedByRowKind["Workflow"] = "Workflow";
|
|
64
|
+
UsedByRowKind["Dashboard"] = "Dashboard";
|
|
65
|
+
UsedByRowKind["OnCallDutyPolicy"] = "OnCallDutyPolicy";
|
|
66
|
+
UsedByRowKind["OnCallSchedule"] = "OnCallSchedule";
|
|
67
|
+
UsedByRowKind["Service"] = "Service";
|
|
68
|
+
UsedByRowKind["Incident"] = "Incident";
|
|
69
|
+
UsedByRowKind["Alert"] = "Alert";
|
|
70
|
+
})(UsedByRowKind || (exports.UsedByRowKind = UsedByRowKind = {}));
|
|
71
|
+
// One way records refer to a record of a kind.
|
|
72
|
+
var UsedByRelation;
|
|
73
|
+
(function (UsedByRelation) {
|
|
74
|
+
// Status pages that list the monitor, directly or through a monitor group.
|
|
75
|
+
UsedByRelation["MonitorStatusPages"] = "MonitorStatusPages";
|
|
76
|
+
// Monitor groups the monitor is in.
|
|
77
|
+
UsedByRelation["MonitorGroups"] = "MonitorGroups";
|
|
78
|
+
// SLOs that measure the monitor (archived ones left out).
|
|
79
|
+
UsedByRelation["MonitorSlos"] = "MonitorSlos";
|
|
80
|
+
// Scheduled maintenance coming up or in progress that names the monitor.
|
|
81
|
+
UsedByRelation["MonitorScheduledMaintenance"] = "MonitorScheduledMaintenance";
|
|
82
|
+
// Monitors that depend on it: their alerts wait while it is down.
|
|
83
|
+
UsedByRelation["MonitorDependents"] = "MonitorDependents";
|
|
84
|
+
// Workflows whose steps name the monitor.
|
|
85
|
+
UsedByRelation["MonitorWorkflows"] = "MonitorWorkflows";
|
|
86
|
+
// Dashboards whose widgets name the monitor.
|
|
87
|
+
UsedByRelation["MonitorDashboards"] = "MonitorDashboards";
|
|
88
|
+
// On-call policies with an escalation rule that pages the schedule.
|
|
89
|
+
UsedByRelation["ScheduleOnCallPolicies"] = "ScheduleOnCallPolicies";
|
|
90
|
+
// Monitors that watch the service (its Linked Resources).
|
|
91
|
+
UsedByRelation["ServiceMonitors"] = "ServiceMonitors";
|
|
92
|
+
// SLOs that measure a monitor watching the service.
|
|
93
|
+
UsedByRelation["ServiceSlos"] = "ServiceSlos";
|
|
94
|
+
// Open incidents the status page shows right now.
|
|
95
|
+
UsedByRelation["StatusPageOpenIncidents"] = "StatusPageOpenIncidents";
|
|
96
|
+
// Scheduled maintenance in progress or coming up that the page shows.
|
|
97
|
+
UsedByRelation["StatusPageMaintenance"] = "StatusPageMaintenance";
|
|
98
|
+
// On-call policies with an escalation rule that pages the team.
|
|
99
|
+
UsedByRelation["TeamOnCallPolicies"] = "TeamOnCallPolicies";
|
|
100
|
+
// What the team owns.
|
|
101
|
+
UsedByRelation["TeamOwnedMonitors"] = "TeamOwnedMonitors";
|
|
102
|
+
UsedByRelation["TeamOwnedStatusPages"] = "TeamOwnedStatusPages";
|
|
103
|
+
UsedByRelation["TeamOwnedServices"] = "TeamOwnedServices";
|
|
104
|
+
UsedByRelation["TeamOwnedOnCallPolicies"] = "TeamOwnedOnCallPolicies";
|
|
105
|
+
UsedByRelation["TeamOwnedSchedules"] = "TeamOwnedSchedules";
|
|
106
|
+
// The records of each kind that carry the label.
|
|
107
|
+
UsedByRelation["LabelMonitors"] = "LabelMonitors";
|
|
108
|
+
UsedByRelation["LabelMonitorGroups"] = "LabelMonitorGroups";
|
|
109
|
+
UsedByRelation["LabelStatusPages"] = "LabelStatusPages";
|
|
110
|
+
UsedByRelation["LabelServices"] = "LabelServices";
|
|
111
|
+
UsedByRelation["LabelIncidents"] = "LabelIncidents";
|
|
112
|
+
UsedByRelation["LabelAlerts"] = "LabelAlerts";
|
|
113
|
+
UsedByRelation["LabelScheduledMaintenance"] = "LabelScheduledMaintenance";
|
|
114
|
+
UsedByRelation["LabelOnCallPolicies"] = "LabelOnCallPolicies";
|
|
115
|
+
UsedByRelation["LabelOnCallSchedules"] = "LabelOnCallSchedules";
|
|
116
|
+
UsedByRelation["LabelSlos"] = "LabelSlos";
|
|
117
|
+
UsedByRelation["LabelWorkflows"] = "LabelWorkflows";
|
|
118
|
+
UsedByRelation["LabelDashboards"] = "LabelDashboards";
|
|
119
|
+
})(UsedByRelation || (exports.UsedByRelation = UsedByRelation = {}));
|
|
120
|
+
/*
|
|
121
|
+
* Each record's relations, in the order its card lists them: what most
|
|
122
|
+
* people ask about first. Adding a relation is a line here, its reading in
|
|
123
|
+
* UsedByService's definitions, and its words in the Dashboard's
|
|
124
|
+
* UsedByWords - each of the three tested to hold every relation.
|
|
125
|
+
*/
|
|
126
|
+
exports.USED_BY_RELATIONS = {
|
|
127
|
+
[UsedByRecordKind.Monitor]: [
|
|
128
|
+
{
|
|
129
|
+
relation: UsedByRelation.MonitorStatusPages,
|
|
130
|
+
rowKind: UsedByRowKind.StatusPage,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
relation: UsedByRelation.MonitorGroups,
|
|
134
|
+
rowKind: UsedByRowKind.MonitorGroup,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
relation: UsedByRelation.MonitorSlos,
|
|
138
|
+
rowKind: UsedByRowKind.ServiceLevelObjective,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
relation: UsedByRelation.MonitorScheduledMaintenance,
|
|
142
|
+
rowKind: UsedByRowKind.ScheduledMaintenance,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
relation: UsedByRelation.MonitorDependents,
|
|
146
|
+
rowKind: UsedByRowKind.Monitor,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
relation: UsedByRelation.MonitorWorkflows,
|
|
150
|
+
rowKind: UsedByRowKind.Workflow,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
relation: UsedByRelation.MonitorDashboards,
|
|
154
|
+
rowKind: UsedByRowKind.Dashboard,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
[UsedByRecordKind.OnCallSchedule]: [
|
|
158
|
+
{
|
|
159
|
+
relation: UsedByRelation.ScheduleOnCallPolicies,
|
|
160
|
+
rowKind: UsedByRowKind.OnCallDutyPolicy,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
[UsedByRecordKind.Service]: [
|
|
164
|
+
{
|
|
165
|
+
relation: UsedByRelation.ServiceMonitors,
|
|
166
|
+
rowKind: UsedByRowKind.Monitor,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
relation: UsedByRelation.ServiceSlos,
|
|
170
|
+
rowKind: UsedByRowKind.ServiceLevelObjective,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
[UsedByRecordKind.StatusPage]: [
|
|
174
|
+
{
|
|
175
|
+
relation: UsedByRelation.StatusPageOpenIncidents,
|
|
176
|
+
rowKind: UsedByRowKind.Incident,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
relation: UsedByRelation.StatusPageMaintenance,
|
|
180
|
+
rowKind: UsedByRowKind.ScheduledMaintenance,
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
[UsedByRecordKind.Team]: [
|
|
184
|
+
{
|
|
185
|
+
relation: UsedByRelation.TeamOnCallPolicies,
|
|
186
|
+
rowKind: UsedByRowKind.OnCallDutyPolicy,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
relation: UsedByRelation.TeamOwnedMonitors,
|
|
190
|
+
rowKind: UsedByRowKind.Monitor,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
relation: UsedByRelation.TeamOwnedStatusPages,
|
|
194
|
+
rowKind: UsedByRowKind.StatusPage,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
relation: UsedByRelation.TeamOwnedServices,
|
|
198
|
+
rowKind: UsedByRowKind.Service,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
relation: UsedByRelation.TeamOwnedOnCallPolicies,
|
|
202
|
+
rowKind: UsedByRowKind.OnCallDutyPolicy,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
relation: UsedByRelation.TeamOwnedSchedules,
|
|
206
|
+
rowKind: UsedByRowKind.OnCallSchedule,
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
[UsedByRecordKind.Label]: [
|
|
210
|
+
{
|
|
211
|
+
relation: UsedByRelation.LabelMonitors,
|
|
212
|
+
rowKind: UsedByRowKind.Monitor,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
relation: UsedByRelation.LabelMonitorGroups,
|
|
216
|
+
rowKind: UsedByRowKind.MonitorGroup,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
relation: UsedByRelation.LabelStatusPages,
|
|
220
|
+
rowKind: UsedByRowKind.StatusPage,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
relation: UsedByRelation.LabelServices,
|
|
224
|
+
rowKind: UsedByRowKind.Service,
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
relation: UsedByRelation.LabelIncidents,
|
|
228
|
+
rowKind: UsedByRowKind.Incident,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
relation: UsedByRelation.LabelAlerts,
|
|
232
|
+
rowKind: UsedByRowKind.Alert,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
relation: UsedByRelation.LabelScheduledMaintenance,
|
|
236
|
+
rowKind: UsedByRowKind.ScheduledMaintenance,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
relation: UsedByRelation.LabelOnCallPolicies,
|
|
240
|
+
rowKind: UsedByRowKind.OnCallDutyPolicy,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
relation: UsedByRelation.LabelOnCallSchedules,
|
|
244
|
+
rowKind: UsedByRowKind.OnCallSchedule,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
relation: UsedByRelation.LabelSlos,
|
|
248
|
+
rowKind: UsedByRowKind.ServiceLevelObjective,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
relation: UsedByRelation.LabelWorkflows,
|
|
252
|
+
rowKind: UsedByRowKind.Workflow,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
relation: UsedByRelation.LabelDashboards,
|
|
256
|
+
rowKind: UsedByRowKind.Dashboard,
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
};
|
|
260
|
+
// The rows a card shows of each relation, beside its count.
|
|
261
|
+
exports.USED_BY_PREVIEW_ROW_COUNT = 3;
|
|
262
|
+
// The rows one page of "See all" reads.
|
|
263
|
+
exports.USED_BY_PAGE_SIZE = 50;
|
|
264
|
+
// The most rows one page may ask for.
|
|
265
|
+
exports.USED_BY_MAX_PAGE_SIZE = 100;
|
|
266
|
+
function isUsedByRecordKind(value) {
|
|
267
|
+
return Object.values(UsedByRecordKind).includes(value);
|
|
268
|
+
}
|
|
269
|
+
function isUsedByRelation(value) {
|
|
270
|
+
return Object.values(UsedByRelation).includes(value);
|
|
271
|
+
}
|
|
272
|
+
// The relations of a kind, in its card's order.
|
|
273
|
+
function getUsedByRelations(recordKind) {
|
|
274
|
+
return exports.USED_BY_RELATIONS[recordKind] || [];
|
|
275
|
+
}
|
|
276
|
+
// The kind a relation belongs to, or null for one no kind lists.
|
|
277
|
+
function getUsedByRecordKindOfRelation(relation) {
|
|
278
|
+
for (const recordKind of Object.values(UsedByRecordKind)) {
|
|
279
|
+
if (getUsedByRelations(recordKind).some((description) => {
|
|
280
|
+
return description.relation === relation;
|
|
281
|
+
})) {
|
|
282
|
+
return recordKind;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
// What a relation's rows are, or null for one no kind lists.
|
|
288
|
+
function getUsedByRowKind(relation) {
|
|
289
|
+
for (const recordKind of Object.values(UsedByRecordKind)) {
|
|
290
|
+
for (const description of getUsedByRelations(recordKind)) {
|
|
291
|
+
if (description.relation === relation) {
|
|
292
|
+
return description.rowKind;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
// Every record that refers to it, seen or not.
|
|
299
|
+
function getUsedByGroupTotal(group) {
|
|
300
|
+
return group.count + group.hiddenCount;
|
|
301
|
+
}
|
|
302
|
+
/*
|
|
303
|
+
* The groups with anything in them - seen or hidden - in the kind's order:
|
|
304
|
+
* what a card and a delete dialog list. `leaveOut` drops relations a page
|
|
305
|
+
* says otherwise (a monitor's Delete page has the SLOs' own warning).
|
|
306
|
+
*/
|
|
307
|
+
function getUsedByGroupsInUse(summary, leaveOut) {
|
|
308
|
+
return summary.groups.filter((group) => {
|
|
309
|
+
return (getUsedByGroupTotal(group) > 0 &&
|
|
310
|
+
!(leaveOut || []).includes(group.relation));
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
// Whether nothing refers to the record, among what the summary read.
|
|
314
|
+
function isUsedByNothing(summary) {
|
|
315
|
+
return getUsedByGroupsInUse(summary).length === 0;
|
|
316
|
+
}
|
|
317
|
+
function isNonNegativeInteger(value) {
|
|
318
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
319
|
+
}
|
|
320
|
+
function isUsedByRow(value) {
|
|
321
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
const row = value;
|
|
325
|
+
return (typeof row.id === "string" &&
|
|
326
|
+
typeof row.name === "string" &&
|
|
327
|
+
(row.number === undefined || typeof row.number === "string") &&
|
|
328
|
+
(row.detail === undefined || typeof row.detail === "string"));
|
|
329
|
+
}
|
|
330
|
+
function isUsedByRows(value) {
|
|
331
|
+
return Array.isArray(value) && value.every(isUsedByRow);
|
|
332
|
+
}
|
|
333
|
+
function isUsedByGroup(value) {
|
|
334
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
const group = value;
|
|
338
|
+
return (isUsedByRelation(group.relation) &&
|
|
339
|
+
Object.values(UsedByRowKind).includes(group.rowKind) &&
|
|
340
|
+
isNonNegativeInteger(group.count) &&
|
|
341
|
+
isNonNegativeInteger(group.hiddenCount) &&
|
|
342
|
+
isUsedByRows(group.rows));
|
|
343
|
+
}
|
|
344
|
+
/*
|
|
345
|
+
* Whether an answer has the shape the Dashboard reads: a server that
|
|
346
|
+
* answers something else (an older one, a proxy's page) is an error to
|
|
347
|
+
* show, never a list to draw.
|
|
348
|
+
*/
|
|
349
|
+
function isUsedBySummary(value) {
|
|
350
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
const summary = value;
|
|
354
|
+
return (isUsedByRecordKind(summary.recordKind) &&
|
|
355
|
+
typeof summary.recordId === "string" &&
|
|
356
|
+
Array.isArray(summary.groups) &&
|
|
357
|
+
summary.groups.every(isUsedByGroup));
|
|
358
|
+
}
|
|
359
|
+
function isUsedByPage(value) {
|
|
360
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
const page = value;
|
|
364
|
+
return (isUsedByRecordKind(page.recordKind) &&
|
|
365
|
+
typeof page.recordId === "string" &&
|
|
366
|
+
isUsedByRelation(page.relation) &&
|
|
367
|
+
Object.values(UsedByRowKind).includes(page.rowKind) &&
|
|
368
|
+
isNonNegativeInteger(page.count) &&
|
|
369
|
+
isNonNegativeInteger(page.hiddenCount) &&
|
|
370
|
+
isNonNegativeInteger(page.pageStart) &&
|
|
371
|
+
isNonNegativeInteger(page.pageSize) &&
|
|
372
|
+
isUsedByRows(page.rows));
|
|
373
|
+
}
|
|
374
|
+
// A page size a request may ask for: the default, or at most the maximum.
|
|
375
|
+
function normalizeUsedByPageSize(value) {
|
|
376
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
377
|
+
if (!Number.isFinite(parsed) || parsed < 1) {
|
|
378
|
+
return exports.USED_BY_PAGE_SIZE;
|
|
379
|
+
}
|
|
380
|
+
return Math.min(Math.floor(parsed), exports.USED_BY_MAX_PAGE_SIZE);
|
|
381
|
+
}
|
|
382
|
+
// Where a page starts: 0, or a whole number of rows past it.
|
|
383
|
+
function normalizeUsedBySkip(value) {
|
|
384
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
385
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
386
|
+
return 0;
|
|
387
|
+
}
|
|
388
|
+
return Math.floor(parsed);
|
|
389
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import commonJsModule from "./UsedBy.js";
|
|
2
|
+
export const USED_BY_MAX_PAGE_SIZE = commonJsModule.USED_BY_MAX_PAGE_SIZE;
|
|
3
|
+
export const USED_BY_PAGE_SIZE = commonJsModule.USED_BY_PAGE_SIZE;
|
|
4
|
+
export const USED_BY_PREVIEW_ROW_COUNT = commonJsModule.USED_BY_PREVIEW_ROW_COUNT;
|
|
5
|
+
export const USED_BY_RELATIONS = commonJsModule.USED_BY_RELATIONS;
|
|
6
|
+
export const UsedByRecordKind = commonJsModule.UsedByRecordKind;
|
|
7
|
+
export const UsedByRelation = commonJsModule.UsedByRelation;
|
|
8
|
+
export const UsedByRowKind = commonJsModule.UsedByRowKind;
|
|
9
|
+
export const getUsedByGroupTotal = commonJsModule.getUsedByGroupTotal;
|
|
10
|
+
export const getUsedByGroupsInUse = commonJsModule.getUsedByGroupsInUse;
|
|
11
|
+
export const getUsedByRecordKindOfRelation = commonJsModule.getUsedByRecordKindOfRelation;
|
|
12
|
+
export const getUsedByRelations = commonJsModule.getUsedByRelations;
|
|
13
|
+
export const getUsedByRowKind = commonJsModule.getUsedByRowKind;
|
|
14
|
+
export const isUsedByNothing = commonJsModule.isUsedByNothing;
|
|
15
|
+
export const isUsedByPage = commonJsModule.isUsedByPage;
|
|
16
|
+
export const isUsedByRecordKind = commonJsModule.isUsedByRecordKind;
|
|
17
|
+
export const isUsedByRelation = commonJsModule.isUsedByRelation;
|
|
18
|
+
export const isUsedBySummary = commonJsModule.isUsedBySummary;
|
|
19
|
+
export const normalizeUsedByPageSize = commonJsModule.normalizeUsedByPageSize;
|
|
20
|
+
export const normalizeUsedBySkip = commonJsModule.normalizeUsedBySkip;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import ProductKey from "../Product/ProductKey.mjs";
|
|
2
|
+
import { UsedByRowKind, UsedBySummary } from "./UsedBy.mjs";
|
|
3
|
+
export declare const USED_BY_ROW_KIND_PRODUCTS: Readonly<Record<UsedByRowKind, ProductKey>>;
|
|
4
|
+
export declare const withoutGroupsOfProductsOff: (summary: UsedBySummary, offProducts: ReadonlyArray<ProductKey>) => UsedBySummary;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import ProductKey from "../Product/ProductKey";
|
|
2
|
+
import { UsedByRowKind, UsedBySummary } from "./UsedBy";
|
|
3
|
+
export declare const USED_BY_ROW_KIND_PRODUCTS: Readonly<Record<UsedByRowKind, ProductKey>>;
|
|
4
|
+
export declare const withoutGroupsOfProductsOff: (summary: UsedBySummary, offProducts: ReadonlyArray<ProductKey>) => UsedBySummary;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.withoutGroupsOfProductsOff = exports.USED_BY_ROW_KIND_PRODUCTS = void 0;
|
|
7
|
+
const ProductKey_1 = __importDefault(require("../Product/ProductKey"));
|
|
8
|
+
const UsedBy_1 = require("./UsedBy");
|
|
9
|
+
/*
|
|
10
|
+
* "USED BY" AND THE PRODUCTS A SERVER SWITCHED OFF (#6815, #6813).
|
|
11
|
+
*
|
|
12
|
+
* The Used by card lists and links what refers to a record - a monitor's
|
|
13
|
+
* status pages, SLOs, workflows. A product switched off on the server has no
|
|
14
|
+
* pages to link to, so the card leaves its line out (UsedByCard).
|
|
15
|
+
*
|
|
16
|
+
* The Delete and Archive dialogs read the same summary and keep every line
|
|
17
|
+
* (UsedByImpact): deleting a monitor still takes it off a status page while
|
|
18
|
+
* Status Pages is off, and that page is back, without it, once the server
|
|
19
|
+
* switches Status Pages on again - nothing is deleted when a product is off,
|
|
20
|
+
* so what a delete does to it still counts.
|
|
21
|
+
*
|
|
22
|
+
* Pure: the Dashboard and its tests read it.
|
|
23
|
+
*/
|
|
24
|
+
// The product each kind of row is a record of.
|
|
25
|
+
exports.USED_BY_ROW_KIND_PRODUCTS = {
|
|
26
|
+
[UsedBy_1.UsedByRowKind.Monitor]: ProductKey_1.default.Monitors,
|
|
27
|
+
[UsedBy_1.UsedByRowKind.MonitorGroup]: ProductKey_1.default.Monitors,
|
|
28
|
+
[UsedBy_1.UsedByRowKind.StatusPage]: ProductKey_1.default.StatusPages,
|
|
29
|
+
[UsedBy_1.UsedByRowKind.ServiceLevelObjective]: ProductKey_1.default.Slos,
|
|
30
|
+
[UsedBy_1.UsedByRowKind.ScheduledMaintenance]: ProductKey_1.default.ScheduledMaintenance,
|
|
31
|
+
[UsedBy_1.UsedByRowKind.Workflow]: ProductKey_1.default.Workflows,
|
|
32
|
+
[UsedBy_1.UsedByRowKind.Dashboard]: ProductKey_1.default.Dashboards,
|
|
33
|
+
[UsedBy_1.UsedByRowKind.OnCallDutyPolicy]: ProductKey_1.default.OnCall,
|
|
34
|
+
[UsedBy_1.UsedByRowKind.OnCallSchedule]: ProductKey_1.default.OnCall,
|
|
35
|
+
[UsedBy_1.UsedByRowKind.Service]: ProductKey_1.default.Services,
|
|
36
|
+
[UsedBy_1.UsedByRowKind.Incident]: ProductKey_1.default.Incidents,
|
|
37
|
+
[UsedBy_1.UsedByRowKind.Alert]: ProductKey_1.default.Alerts,
|
|
38
|
+
};
|
|
39
|
+
// The summary without the lines of products switched off on the server.
|
|
40
|
+
const withoutGroupsOfProductsOff = (summary, offProducts) => {
|
|
41
|
+
if (offProducts.length === 0) {
|
|
42
|
+
return summary;
|
|
43
|
+
}
|
|
44
|
+
return Object.assign(Object.assign({}, summary), { groups: summary.groups.filter((group) => {
|
|
45
|
+
return !offProducts.includes(exports.USED_BY_ROW_KIND_PRODUCTS[group.rowKind]);
|
|
46
|
+
}) });
|
|
47
|
+
};
|
|
48
|
+
exports.withoutGroupsOfProductsOff = withoutGroupsOfProductsOff;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ActivationMilestone from "../Analytics/ActivationMilestone.mjs";
|
|
2
2
|
import { PlanType } from "../Billing/SubscriptionPlan.mjs";
|
|
3
3
|
import ProjectGoal from "./ProjectGoal.mjs";
|
|
4
|
+
import ProductKey from "../Product/ProductKey.mjs";
|
|
4
5
|
export declare enum WelcomeStep {
|
|
5
6
|
ServerEmail = "server_email",
|
|
6
7
|
Import = "import",
|
|
@@ -15,6 +16,10 @@ export declare const WELCOME_STEP_ORDER: ReadonlyArray<WelcomeStep>;
|
|
|
15
16
|
export declare const isWelcomeStep: (value: unknown) => value is WelcomeStep;
|
|
16
17
|
export declare const STEPS_OF_GOAL: Readonly<Record<ProjectGoal, ReadonlyArray<WelcomeStep>>>;
|
|
17
18
|
export declare const DEFAULT_WELCOME_STEPS: ReadonlyArray<WelcomeStep>;
|
|
19
|
+
export declare const WELCOME_STEP_PRODUCTS: Readonly<Record<WelcomeStep, ReadonlyArray<ProductKey>>>;
|
|
20
|
+
export declare const GOAL_PRODUCTS: Readonly<Record<ProjectGoal, ReadonlyArray<ProductKey>>>;
|
|
21
|
+
export declare const isWelcomeStepOffOnServer: (step: WelcomeStep, offProducts: ReadonlyArray<ProductKey>) => boolean;
|
|
22
|
+
export declare const isGoalOffOnServer: (goal: ProjectGoal, offProducts: ReadonlyArray<ProductKey>) => boolean;
|
|
18
23
|
export declare const getStepsForGoals: (goals: ReadonlyArray<ProjectGoal> | null) => Array<WelcomeStep>;
|
|
19
24
|
export declare const STEP_DONE_BY_MILESTONES: Readonly<Record<WelcomeStep, ReadonlyArray<ActivationMilestone>>>;
|
|
20
25
|
export interface WelcomeOutcomeFacts {
|
|
@@ -50,6 +55,7 @@ export declare const buildWelcomeChecklist: (data: {
|
|
|
50
55
|
facts: WelcomeOutcomeFacts;
|
|
51
56
|
plan: WelcomePlanFacts;
|
|
52
57
|
readerIsServerAdmin: boolean;
|
|
58
|
+
offProducts?: ReadonlyArray<ProductKey> | undefined;
|
|
53
59
|
}) => WelcomeChecklist;
|
|
54
60
|
export declare const PROJECT_IN_USE_MILESTONES: ReadonlyArray<ActivationMilestone>;
|
|
55
61
|
export declare const isProjectInUse: (reached: ReadonlyArray<ActivationMilestone> | Set<ActivationMilestone>) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ActivationMilestone from "../Analytics/ActivationMilestone";
|
|
2
2
|
import { PlanType } from "../Billing/SubscriptionPlan";
|
|
3
3
|
import ProjectGoal from "./ProjectGoal";
|
|
4
|
+
import ProductKey from "../Product/ProductKey";
|
|
4
5
|
export declare enum WelcomeStep {
|
|
5
6
|
ServerEmail = "server_email",
|
|
6
7
|
Import = "import",
|
|
@@ -15,6 +16,10 @@ export declare const WELCOME_STEP_ORDER: ReadonlyArray<WelcomeStep>;
|
|
|
15
16
|
export declare const isWelcomeStep: (value: unknown) => value is WelcomeStep;
|
|
16
17
|
export declare const STEPS_OF_GOAL: Readonly<Record<ProjectGoal, ReadonlyArray<WelcomeStep>>>;
|
|
17
18
|
export declare const DEFAULT_WELCOME_STEPS: ReadonlyArray<WelcomeStep>;
|
|
19
|
+
export declare const WELCOME_STEP_PRODUCTS: Readonly<Record<WelcomeStep, ReadonlyArray<ProductKey>>>;
|
|
20
|
+
export declare const GOAL_PRODUCTS: Readonly<Record<ProjectGoal, ReadonlyArray<ProductKey>>>;
|
|
21
|
+
export declare const isWelcomeStepOffOnServer: (step: WelcomeStep, offProducts: ReadonlyArray<ProductKey>) => boolean;
|
|
22
|
+
export declare const isGoalOffOnServer: (goal: ProjectGoal, offProducts: ReadonlyArray<ProductKey>) => boolean;
|
|
18
23
|
export declare const getStepsForGoals: (goals: ReadonlyArray<ProjectGoal> | null) => Array<WelcomeStep>;
|
|
19
24
|
export declare const STEP_DONE_BY_MILESTONES: Readonly<Record<WelcomeStep, ReadonlyArray<ActivationMilestone>>>;
|
|
20
25
|
export interface WelcomeOutcomeFacts {
|
|
@@ -50,6 +55,7 @@ export declare const buildWelcomeChecklist: (data: {
|
|
|
50
55
|
facts: WelcomeOutcomeFacts;
|
|
51
56
|
plan: WelcomePlanFacts;
|
|
52
57
|
readerIsServerAdmin: boolean;
|
|
58
|
+
offProducts?: ReadonlyArray<ProductKey> | undefined;
|
|
53
59
|
}) => WelcomeChecklist;
|
|
54
60
|
export declare const PROJECT_IN_USE_MILESTONES: ReadonlyArray<ActivationMilestone>;
|
|
55
61
|
export declare const isProjectInUse: (reached: ReadonlyArray<ActivationMilestone> | Set<ActivationMilestone>) => boolean;
|