@oneuptime/common 11.7.1 → 11.7.3
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/KubernetesCostAllocation.ts +103 -0
- package/Models/DatabaseModels/DashboardDomain.ts +1 -0
- package/Models/DatabaseModels/Incident.ts +2 -0
- package/Models/DatabaseModels/IncidentEpisode.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodePublicNote.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentPublicNote.ts +1 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
- package/Models/DatabaseModels/Monitor.ts +1 -0
- package/Models/DatabaseModels/MonitorStatusTimeline.ts +1 -0
- package/Models/DatabaseModels/NetworkSite.ts +1 -0
- package/Models/DatabaseModels/NetworkSiteStatusTimeline.ts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +2 -0
- package/Models/DatabaseModels/Probe.ts +13 -13
- package/Models/DatabaseModels/ScheduledMaintenance.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -0
- package/Models/DatabaseModels/StatusPage.ts +1 -0
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +1 -0
- package/Models/DatabaseModels/StatusPageDomain.ts +1 -0
- package/Models/DatabaseModels/TableView.ts +40 -0
- package/Models/DatabaseModels/WorkspaceNotificationSummary.ts +1 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +11 -0
- package/Server/API/BaseAPI.ts +17 -1
- package/Server/API/CommonAPI.ts +32 -0
- package/Server/API/MicrosoftTeamsAPI.ts +99 -2
- package/Server/API/ProbeAPI.ts +2 -0
- package/Server/API/SlackAPI.ts +62 -0
- package/Server/API/StatusPageAPI.ts +157 -192
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785140242697-AddHotQueryIndexes.ts +89 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785148065137-AddHotQueryIndexesSecondPass.ts +61 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785240000000-RepairCrossProjectMonitorStatusReferences.ts +280 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.ts +13 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/DatabaseService.ts +11 -3
- package/Server/Services/MonitorGroupService.ts +145 -0
- package/Server/Services/MonitorService.ts +231 -30
- package/Server/Services/ProbeService.ts +319 -16
- package/Server/Services/StatusPageService.ts +72 -42
- package/Server/Services/WorkspaceNotificationRuleService.ts +232 -2
- package/Server/Utils/Database/PostgresErrorTranslator.ts +131 -0
- package/Server/Utils/Monitor/MonitorResource.ts +88 -35
- package/Server/Utils/Monitor/MonitorStatusTimeline.ts +21 -1
- package/Server/Utils/Monitor/MonitorStepsProjectValidator.ts +158 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +706 -6
- package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -0
- package/Tests/Models/DatabaseModels/ProbeColumnAccessControl.test.ts +103 -0
- package/Tests/Server/API/BaseAPIUpdateNoOp.test.ts +135 -0
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +317 -0
- package/Tests/Server/API/MicrosoftTeamsManifest.test.ts +228 -0
- package/Tests/Server/API/ProbeAPI.test.ts +6 -0
- package/Tests/Server/API/ZZVerifyChatsAuth.test.ts +167 -0
- package/Tests/Server/Services/AddHotQueryIndexesMigration.test.ts +255 -0
- package/Tests/Server/Services/AddHotQueryIndexesSecondPassMigration.test.ts +258 -0
- package/Tests/Server/Services/DatabaseServiceSanitizeUpdateData.test.ts +1 -1
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +121 -0
- package/Tests/Server/Services/HeartbeatWriteFastPathSafety.test.ts +200 -0
- package/Tests/Server/Services/HookFreeWriteSafetySecondPass.test.ts +181 -0
- package/Tests/Server/Services/MonitorGroupServiceBatchedStatuses.test.ts +513 -0
- package/Tests/Server/Services/MonitorResourceProbeAgreementReuse.test.ts +492 -0
- package/Tests/Server/Services/MonitorServiceProbeSelection.test.ts +401 -0
- package/Tests/Server/Services/MonitorStatusTimelineFastPath.test.ts +453 -0
- package/Tests/Server/Services/ProbeAuthKeyCacheAndHeartbeat.test.ts +679 -0
- package/Tests/Server/Services/ServiceLevelObjectiveService.test.ts +3 -3
- package/Tests/Server/Services/StatusPageDomainResolutionCache.test.ts +245 -0
- package/Tests/Server/Services/StatusPageOverviewTimelineWindow.test.ts +283 -0
- package/Tests/Server/Services/StatusPageServiceMcp.test.ts +17 -1
- package/Tests/Server/Services/StatusPageServiceMonitorGroupBatching.test.ts +331 -0
- package/Tests/Server/Services/UserOnCallLogClaimNotificationRule.test.ts +12 -12
- package/Tests/Server/Services/WorkspaceNotificationRuleChats.test.ts +1390 -0
- package/Tests/Server/Utils/AI/Insights/InsightFixRouting.test.ts +4 -4
- package/Tests/Server/Utils/AI/Insights/InsightScanner.test.ts +2 -2
- package/Tests/Server/Utils/AI/Insights/InsightStore.test.ts +1 -3
- package/Tests/Server/Utils/AI/Insights/InsightStoreHardening.test.ts +1 -3
- package/Tests/Server/Utils/AI/Insights/InsightTriage.test.ts +1 -1
- package/Tests/Server/Utils/AI/Insights/InsightTriageRunner.test.ts +5 -5
- package/Tests/Server/Utils/Alert/AlertPrivacyFilter.test.ts +187 -0
- package/Tests/Server/Utils/AlertEpisode/AlertEpisodePrivacyFilter.test.ts +170 -0
- package/Tests/Server/Utils/Database/PostgresErrorTranslator.test.ts +125 -0
- package/Tests/Server/Utils/Incident/IncidentPrivacyFilter.test.ts +264 -0
- package/Tests/Server/Utils/IncidentEpisode/IncidentEpisodePrivacyFilter.test.ts +175 -0
- package/Tests/Server/Utils/Monitor/MonitorStepsProjectValidator.test.ts +181 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +1 -1
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +2 -2
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsChannelsList.test.ts +341 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsChats.test.ts +2175 -0
- package/Tests/Server/Utils/Workspace/SlackChannelsList.test.ts +585 -0
- package/Tests/Types/Billing/MeteredPlan.test.ts +46 -0
- package/Tests/Types/JSONFunctions.test.ts +103 -1
- package/Tests/Types/Workspace/NotificationRules/NotificationRuleCondition.test.ts +219 -1
- package/Tests/UI/Components/BulkUpdateForm.test.tsx +174 -0
- package/Tests/UI/Components/CardModelDetailEdit.test.tsx +315 -0
- package/Tests/UI/Components/ModelDetailSelect.test.tsx +229 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkSelectAll.test.tsx +1258 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +679 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +572 -0
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -0
- package/Tests/UI/Components/ModelTableExportFromColumns.test.ts +153 -0
- package/Tests/UI/Components/MonacoLoader.test.ts +67 -0
- package/Tests/UI/Components/MonacoRuntime.test.ts +121 -0
- package/Tests/UI/Components/TableBulkCsvExport.test.tsx +212 -3
- package/Tests/UI/Utils/Project.test.ts +809 -0
- package/Tests/UI/Utils/TableColumnsToCsv.test.ts +360 -0
- package/Tests/Utils/Alerts/AlertMetricType.test.ts +143 -0
- package/Tests/Utils/Dashboard/VariableUrlState.test.ts +219 -0
- package/Tests/Utils/Incident/IncidentMetricType.test.ts +174 -0
- package/Tests/Utils/Monitor/MonitorProbeSelectionUtil.test.ts +145 -0
- package/Tests/Utils/StatusPage/ResourceUptime.test.ts +263 -0
- package/Tests/Utils/UserPreferences.test.ts +563 -0
- package/Types/JSONFunctions.ts +7 -2
- package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
- package/Types/Workspace/NotificationRules/BaseNotificationRule.ts +4 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +25 -10
- package/Types/Workspace/WorkspaceMessagePayload.ts +1 -0
- package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +63 -8
- package/UI/Components/CodeEditor/CodeEditor.tsx +3 -0
- package/UI/Components/CodeEditor/MonacoLoader.ts +36 -0
- package/UI/Components/Forms/ModelForm.tsx +41 -18
- package/UI/Components/MasterPage/MasterPage.tsx +65 -0
- package/UI/Components/ModelDetail/CardModelDetail.tsx +23 -1
- package/UI/Components/ModelDetail/ModelDetail.tsx +46 -1
- package/UI/Components/ModelTable/BaseModelTable.tsx +687 -34
- package/UI/Components/ModelTable/Column.ts +29 -0
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +420 -0
- package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
- package/UI/Components/ModelTable/ExportFromColumns.ts +57 -0
- package/UI/Components/ModelTable/TableView.tsx +24 -2
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
- package/UI/Components/Navbar/NavBar.tsx +66 -1
- package/UI/Components/SideMenu/SideMenu.tsx +24 -4
- package/UI/Components/Table/Table.tsx +66 -14
- package/UI/Components/Table/TableRow.tsx +180 -175
- package/UI/Components/Table/Types/Column.ts +20 -0
- package/UI/Utils/Project.ts +214 -18
- package/UI/Utils/TableColumnsToCsv.ts +86 -6
- package/UI/esbuild-config.js +34 -0
- package/Utils/Monitor/MonitorProbeSelectionUtil.ts +72 -0
- package/Utils/UserPreferences.ts +53 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DashboardDomain.js +1 -0
- package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js +2 -0
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisode.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisode.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodePublicNote.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodePublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +1 -0
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkSite.js +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +2 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Probe.js +13 -13
- package/build/dist/Models/DatabaseModels/Probe.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +1 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TableView.js +40 -0
- package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -0
- package/build/dist/Models/DatabaseModels/WorkspaceNotificationSummary.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +12 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +21 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +72 -2
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/ProbeAPI.js +2 -0
- package/build/dist/Server/API/ProbeAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +44 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +98 -152
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785140242697-AddHotQueryIndexes.js +36 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785140242697-AddHotQueryIndexes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785148065137-AddHotQueryIndexesSecondPass.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785148065137-AddHotQueryIndexesSecondPass.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785240000000-RepairCrossProjectMonitorStatusReferences.js +254 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785240000000-RepairCrossProjectMonitorStatusReferences.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +10 -2
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/MonitorGroupService.js +118 -0
- package/build/dist/Server/Services/MonitorGroupService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +198 -24
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +238 -9
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +46 -39
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +178 -3
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Utils/Database/PostgresErrorTranslator.js +80 -0
- package/build/dist/Server/Utils/Database/PostgresErrorTranslator.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +67 -29
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +31 -14
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js +117 -0
- package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +549 -7
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +8 -3
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +17 -7
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +37 -11
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +2 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/MonacoLoader.js +34 -0
- package/build/dist/UI/Components/CodeEditor/MonacoLoader.js.map +1 -0
- package/build/dist/UI/Components/Forms/ModelForm.js +37 -17
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js +50 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +22 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js +31 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +472 -27
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +189 -0
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ExportFromColumns.js +30 -0
- package/build/dist/UI/Components/ModelTable/ExportFromColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/Navbar/NavBar.js +39 -1
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +15 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +46 -13
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +11 -6
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Utils/Project.js +161 -15
- package/build/dist/UI/Utils/Project.js.map +1 -1
- package/build/dist/UI/Utils/TableColumnsToCsv.js +67 -6
- package/build/dist/UI/Utils/TableColumnsToCsv.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorProbeSelectionUtil.js +52 -0
- package/build/dist/Utils/Monitor/MonitorProbeSelectionUtil.js.map +1 -0
- package/build/dist/Utils/UserPreferences.js +33 -0
- package/build/dist/Utils/UserPreferences.js.map +1 -1
- package/package.json +4 -3
|
@@ -8,7 +8,6 @@ import IncidentPublicNoteService from "../Services/IncidentPublicNoteService";
|
|
|
8
8
|
import IncidentService from "../Services/IncidentService";
|
|
9
9
|
import IncidentStateService from "../Services/IncidentStateService";
|
|
10
10
|
import IncidentStateTimelineService from "../Services/IncidentStateTimelineService";
|
|
11
|
-
import MonitorGroupResourceService from "../Services/MonitorGroupResourceService";
|
|
12
11
|
import MonitorGroupService from "../Services/MonitorGroupService";
|
|
13
12
|
import MonitorStatusService from "../Services/MonitorStatusService";
|
|
14
13
|
import ScheduledMaintenancePublicNoteService from "../Services/ScheduledMaintenancePublicNoteService";
|
|
@@ -120,44 +119,19 @@ type ResolveStatusPageIdOrThrowFunction = (
|
|
|
120
119
|
const resolveStatusPageIdOrThrow: ResolveStatusPageIdOrThrowFunction = async (
|
|
121
120
|
statusPageIdOrDomain: string,
|
|
122
121
|
): Promise<ObjectID> => {
|
|
123
|
-
|
|
122
|
+
/*
|
|
123
|
+
* Delegates to the service resolver so every endpoint shares its
|
|
124
|
+
* custom-domain -> statusPageId cache (one Postgres lookup per domain per
|
|
125
|
+
* TTL instead of one per request).
|
|
126
|
+
*/
|
|
127
|
+
const statusPageId: ObjectID | null =
|
|
128
|
+
await StatusPageService.resolveStatusPageIdOrNull(statusPageIdOrDomain);
|
|
129
|
+
|
|
130
|
+
if (!statusPageId) {
|
|
124
131
|
throw new NotFoundException("Status Page not found");
|
|
125
132
|
}
|
|
126
133
|
|
|
127
|
-
|
|
128
|
-
const statusPageDomain: StatusPageDomain | null =
|
|
129
|
-
await StatusPageDomainService.findOneBy({
|
|
130
|
-
query: {
|
|
131
|
-
fullDomain: statusPageIdOrDomain,
|
|
132
|
-
domain: {
|
|
133
|
-
isVerified: true,
|
|
134
|
-
} as any,
|
|
135
|
-
},
|
|
136
|
-
select: {
|
|
137
|
-
statusPageId: true,
|
|
138
|
-
},
|
|
139
|
-
props: {
|
|
140
|
-
isRoot: true,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
if (!statusPageDomain || !statusPageDomain.statusPageId) {
|
|
145
|
-
throw new NotFoundException("Status Page not found");
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return statusPageDomain.statusPageId;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
try {
|
|
152
|
-
ObjectID.validateUUID(statusPageIdOrDomain);
|
|
153
|
-
return new ObjectID(statusPageIdOrDomain);
|
|
154
|
-
} catch (err) {
|
|
155
|
-
logger.error(
|
|
156
|
-
`Error converting statusPageIdOrDomain to ObjectID: ${statusPageIdOrDomain}`,
|
|
157
|
-
);
|
|
158
|
-
logger.error(err);
|
|
159
|
-
throw new NotFoundException("Status Page not found");
|
|
160
|
-
}
|
|
134
|
+
return statusPageId;
|
|
161
135
|
};
|
|
162
136
|
|
|
163
137
|
export default class StatusPageAPI extends BaseAPI<
|
|
@@ -176,52 +150,18 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
176
150
|
"statusPageIdOrDomain"
|
|
177
151
|
] as string;
|
|
178
152
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const statusPageDomain: StatusPageDomain | null =
|
|
185
|
-
await StatusPageDomainService.findOneBy({
|
|
186
|
-
query: {
|
|
187
|
-
fullDomain: statusPageIdOrDomain,
|
|
188
|
-
domain: {
|
|
189
|
-
isVerified: true,
|
|
190
|
-
} as any,
|
|
191
|
-
},
|
|
192
|
-
select: {
|
|
193
|
-
statusPageId: true,
|
|
194
|
-
},
|
|
195
|
-
props: {
|
|
196
|
-
isRoot: true,
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
if (!statusPageDomain || !statusPageDomain.statusPageId) {
|
|
201
|
-
return Response.sendErrorResponse(
|
|
202
|
-
req,
|
|
203
|
-
res,
|
|
204
|
-
new NotFoundException("Status Page not found"),
|
|
205
|
-
);
|
|
206
|
-
}
|
|
153
|
+
// Shares the service resolver's custom-domain -> statusPageId cache.
|
|
154
|
+
const statusPageId: ObjectID | null =
|
|
155
|
+
await StatusPageService.resolveStatusPageIdOrNull(
|
|
156
|
+
statusPageIdOrDomain,
|
|
157
|
+
);
|
|
207
158
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
logger.error(
|
|
215
|
-
`Error converting statusPageIdOrDomain to ObjectID: ${statusPageIdOrDomain}`,
|
|
216
|
-
getLogAttributesFromRequest(req as any),
|
|
217
|
-
);
|
|
218
|
-
logger.error(err, getLogAttributesFromRequest(req as any));
|
|
219
|
-
return Response.sendErrorResponse(
|
|
220
|
-
req,
|
|
221
|
-
res,
|
|
222
|
-
new NotFoundException("Status Page not found"),
|
|
223
|
-
);
|
|
224
|
-
}
|
|
159
|
+
if (!statusPageId) {
|
|
160
|
+
return Response.sendErrorResponse(
|
|
161
|
+
req,
|
|
162
|
+
res,
|
|
163
|
+
new NotFoundException("Status Page not found"),
|
|
164
|
+
);
|
|
225
165
|
}
|
|
226
166
|
|
|
227
167
|
const statusPage: StatusPage | null = await StatusPageService.findOneBy(
|
|
@@ -1530,34 +1470,13 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
1530
1470
|
req: req,
|
|
1531
1471
|
});
|
|
1532
1472
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
showUptimeHistoryInDays: true,
|
|
1541
|
-
},
|
|
1542
|
-
props: {
|
|
1543
|
-
isRoot: true,
|
|
1544
|
-
},
|
|
1545
|
-
});
|
|
1546
|
-
|
|
1547
|
-
let uptimeHistoryDays: number =
|
|
1548
|
-
statusPageForDays?.showUptimeHistoryInDays || 90;
|
|
1549
|
-
|
|
1550
|
-
if (uptimeHistoryDays > 90) {
|
|
1551
|
-
uptimeHistoryDays = 90;
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
if (uptimeHistoryDays < 1) {
|
|
1555
|
-
uptimeHistoryDays = 1;
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
const startDate: Date = OneUptimeDate.getSomeDaysAgo(uptimeHistoryDays);
|
|
1559
|
-
const endDate: Date = OneUptimeDate.getCurrentDate();
|
|
1560
|
-
|
|
1473
|
+
/*
|
|
1474
|
+
* The timeline window comes from the status page's configured
|
|
1475
|
+
* showUptimeHistoryInDays. getStatusPageResourcesAndTimelines
|
|
1476
|
+
* fetches the status page row anyway, so let it compute the window
|
|
1477
|
+
* (clamped to 1..90 days, ending now) instead of issuing a separate
|
|
1478
|
+
* StatusPage query here just to read that one column.
|
|
1479
|
+
*/
|
|
1561
1480
|
const {
|
|
1562
1481
|
monitorStatuses,
|
|
1563
1482
|
monitorGroupCurrentStatuses,
|
|
@@ -1567,10 +1486,10 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
1567
1486
|
monitorStatusTimelines,
|
|
1568
1487
|
statusPageGroups,
|
|
1569
1488
|
monitorsInGroup,
|
|
1570
|
-
} = await this.getStatusPageResourcesAndTimelines({
|
|
1571
|
-
statusPageId: statusPageId,
|
|
1572
1489
|
startDateForMonitorTimeline: startDate,
|
|
1573
1490
|
endDateForMonitorTimeline: endDate,
|
|
1491
|
+
} = await this.getStatusPageResourcesAndTimelines({
|
|
1492
|
+
statusPageId: statusPageId,
|
|
1574
1493
|
});
|
|
1575
1494
|
|
|
1576
1495
|
// check if status page has active incident.
|
|
@@ -1727,10 +1646,54 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
1727
1646
|
let episodePublicNotes: Array<IncidentEpisodePublicNote> = [];
|
|
1728
1647
|
let episodeStateTimelines: Array<IncidentEpisodeStateTimeline> = [];
|
|
1729
1648
|
|
|
1649
|
+
/*
|
|
1650
|
+
* Cheap guard before the expensive part: the block below scans every
|
|
1651
|
+
* incident ever attached to this page's monitors (a many-to-many
|
|
1652
|
+
* join, up to LIMIT_PER_PROJECT rows) just to discover episode
|
|
1653
|
+
* membership — on every overview view, even though most pages have
|
|
1654
|
+
* zero active episodes most of the time. One indexed COUNT of the
|
|
1655
|
+
* project's unresolved, visible episodes lets us skip all of it in
|
|
1656
|
+
* the common case. Behavior-preserving: the final activeEpisodes
|
|
1657
|
+
* query applies exactly these three constraints, so count == 0
|
|
1658
|
+
* implies the block's outputs stay empty.
|
|
1659
|
+
*/
|
|
1660
|
+
let unresolvedIncidentStateIds: Array<ObjectID> = [];
|
|
1661
|
+
let hasActiveEpisodes: boolean = false;
|
|
1662
|
+
|
|
1730
1663
|
if (
|
|
1731
1664
|
statusPage.showEpisodesOnStatusPage &&
|
|
1732
1665
|
monitorsOnStatusPage.length > 0
|
|
1733
1666
|
) {
|
|
1667
|
+
const unresolvedIncidentStates: Array<IncidentState> =
|
|
1668
|
+
await IncidentStateService.getUnresolvedIncidentStates(
|
|
1669
|
+
statusPage.projectId!,
|
|
1670
|
+
{ isRoot: true },
|
|
1671
|
+
);
|
|
1672
|
+
|
|
1673
|
+
unresolvedIncidentStateIds = unresolvedIncidentStates.map(
|
|
1674
|
+
(state: IncidentState) => {
|
|
1675
|
+
return state.id!;
|
|
1676
|
+
},
|
|
1677
|
+
);
|
|
1678
|
+
|
|
1679
|
+
const activeEpisodeCount: PositiveNumber =
|
|
1680
|
+
await IncidentEpisodeService.countBy({
|
|
1681
|
+
query: {
|
|
1682
|
+
projectId: statusPage.projectId!,
|
|
1683
|
+
isVisibleOnStatusPage: true,
|
|
1684
|
+
currentIncidentStateId: QueryHelper.any(
|
|
1685
|
+
unresolvedIncidentStateIds,
|
|
1686
|
+
),
|
|
1687
|
+
},
|
|
1688
|
+
props: {
|
|
1689
|
+
isRoot: true,
|
|
1690
|
+
},
|
|
1691
|
+
});
|
|
1692
|
+
|
|
1693
|
+
hasActiveEpisodes = activeEpisodeCount.toNumber() > 0;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
if (hasActiveEpisodes) {
|
|
1734
1697
|
// First, get incidents that have monitors on status page
|
|
1735
1698
|
const incidentsForEpisodes: Array<Incident> =
|
|
1736
1699
|
await IncidentService.findBy({
|
|
@@ -1784,17 +1747,7 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
1784
1747
|
|
|
1785
1748
|
// Fetch active (unresolved) episodes
|
|
1786
1749
|
if (episodeIdsFromMembers.size > 0) {
|
|
1787
|
-
|
|
1788
|
-
await IncidentStateService.getUnresolvedIncidentStates(
|
|
1789
|
-
statusPage.projectId!,
|
|
1790
|
-
{ isRoot: true },
|
|
1791
|
-
);
|
|
1792
|
-
|
|
1793
|
-
const unresolvedIncidentStateIds: Array<ObjectID> =
|
|
1794
|
-
unresolvedIncidentStates.map((state: IncidentState) => {
|
|
1795
|
-
return state.id!;
|
|
1796
|
-
});
|
|
1797
|
-
|
|
1750
|
+
// unresolvedIncidentStateIds was fetched by the guard above.
|
|
1798
1751
|
let selectEpisodes: Select<IncidentEpisode> = {
|
|
1799
1752
|
createdAt: true,
|
|
1800
1753
|
declaredAt: true,
|
|
@@ -3009,31 +2962,15 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
3009
2962
|
return Boolean(id); // remove nulls
|
|
3010
2963
|
});
|
|
3011
2964
|
|
|
2965
|
+
// Batched: one query for all monitor groups instead of one per group.
|
|
2966
|
+
const monitorIdsByGroupId: Dictionary<Array<ObjectID>> =
|
|
2967
|
+
await MonitorGroupService.getMonitorIdsInMonitorGroups(monitorGroupIds);
|
|
2968
|
+
|
|
3012
2969
|
for (const monitorGroupId of monitorGroupIds) {
|
|
3013
2970
|
// get monitors in the group.
|
|
3014
2971
|
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3017
|
-
query: {
|
|
3018
|
-
monitorGroupId: monitorGroupId,
|
|
3019
|
-
},
|
|
3020
|
-
select: {
|
|
3021
|
-
monitorId: true,
|
|
3022
|
-
},
|
|
3023
|
-
props: {
|
|
3024
|
-
isRoot: true,
|
|
3025
|
-
},
|
|
3026
|
-
limit: LIMIT_PER_PROJECT,
|
|
3027
|
-
skip: 0,
|
|
3028
|
-
});
|
|
3029
|
-
|
|
3030
|
-
const monitorsInGroupIds: Array<ObjectID> = groupResources
|
|
3031
|
-
.map((resource: MonitorGroupResource) => {
|
|
3032
|
-
return resource.monitorId!;
|
|
3033
|
-
})
|
|
3034
|
-
.filter((id: ObjectID) => {
|
|
3035
|
-
return Boolean(id); // remove nulls
|
|
3036
|
-
});
|
|
2972
|
+
const monitorsInGroupIds: Array<ObjectID> =
|
|
2973
|
+
monitorIdsByGroupId[monitorGroupId.toString()] || [];
|
|
3037
2974
|
|
|
3038
2975
|
for (const monitorId of monitorsInGroupIds) {
|
|
3039
2976
|
if (
|
|
@@ -3232,31 +3169,15 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
3232
3169
|
return Boolean(id); // remove nulls
|
|
3233
3170
|
});
|
|
3234
3171
|
|
|
3172
|
+
// Batched: one query for all monitor groups instead of one per group.
|
|
3173
|
+
const monitorIdsByGroupId: Dictionary<Array<ObjectID>> =
|
|
3174
|
+
await MonitorGroupService.getMonitorIdsInMonitorGroups(monitorGroupIds);
|
|
3175
|
+
|
|
3235
3176
|
for (const monitorGroupId of monitorGroupIds) {
|
|
3236
3177
|
// get monitors in the group.
|
|
3237
3178
|
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3240
|
-
query: {
|
|
3241
|
-
monitorGroupId: monitorGroupId,
|
|
3242
|
-
},
|
|
3243
|
-
select: {
|
|
3244
|
-
monitorId: true,
|
|
3245
|
-
},
|
|
3246
|
-
props: {
|
|
3247
|
-
isRoot: true,
|
|
3248
|
-
},
|
|
3249
|
-
limit: LIMIT_PER_PROJECT,
|
|
3250
|
-
skip: 0,
|
|
3251
|
-
});
|
|
3252
|
-
|
|
3253
|
-
const monitorsInGroupIds: Array<ObjectID> = groupResources
|
|
3254
|
-
.map((resource: MonitorGroupResource) => {
|
|
3255
|
-
return resource.monitorId!;
|
|
3256
|
-
})
|
|
3257
|
-
.filter((id: ObjectID) => {
|
|
3258
|
-
return Boolean(id); // remove nulls
|
|
3259
|
-
});
|
|
3179
|
+
const monitorsInGroupIds: Array<ObjectID> =
|
|
3180
|
+
monitorIdsByGroupId[monitorGroupId.toString()] || [];
|
|
3260
3181
|
|
|
3261
3182
|
for (const monitorId of monitorsInGroupIds) {
|
|
3262
3183
|
if (
|
|
@@ -4177,6 +4098,8 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
4177
4098
|
const { monitorsOnStatusPage, monitorsInGroup } =
|
|
4178
4099
|
await StatusPageService.getMonitorIdsOnStatusPage({
|
|
4179
4100
|
statusPageId: statusPageId,
|
|
4101
|
+
// reuse the resources fetched above instead of re-querying them
|
|
4102
|
+
statusPageResources: statusPageResources,
|
|
4180
4103
|
});
|
|
4181
4104
|
|
|
4182
4105
|
const today: Date = OneUptimeDate.getCurrentDate();
|
|
@@ -4453,6 +4376,8 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
4453
4376
|
const { monitorsOnStatusPage, monitorsInGroup } =
|
|
4454
4377
|
await StatusPageService.getMonitorIdsOnStatusPage({
|
|
4455
4378
|
statusPageId: statusPageId,
|
|
4379
|
+
// reuse the resources fetched above instead of re-querying them
|
|
4380
|
+
statusPageResources: statusPageResources,
|
|
4456
4381
|
});
|
|
4457
4382
|
|
|
4458
4383
|
const today: Date = OneUptimeDate.getCurrentDate();
|
|
@@ -4876,8 +4801,15 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
4876
4801
|
@CaptureSpan()
|
|
4877
4802
|
public async getStatusPageResourcesAndTimelines(data: {
|
|
4878
4803
|
statusPageId: ObjectID;
|
|
4879
|
-
|
|
4880
|
-
|
|
4804
|
+
/*
|
|
4805
|
+
* When omitted, the timeline window is computed from the status page's
|
|
4806
|
+
* own showUptimeHistoryInDays (clamped to 1..90 days, ending now) —
|
|
4807
|
+
* the status page row is fetched below anyway, so callers that want the
|
|
4808
|
+
* page-configured window (the overview endpoint) don't need their own
|
|
4809
|
+
* StatusPage query just to read that column.
|
|
4810
|
+
*/
|
|
4811
|
+
startDateForMonitorTimeline?: Date | undefined;
|
|
4812
|
+
endDateForMonitorTimeline?: Date | undefined;
|
|
4881
4813
|
}): Promise<{
|
|
4882
4814
|
statusPageResources: StatusPageResource[];
|
|
4883
4815
|
monitorStatuses: MonitorStatus[];
|
|
@@ -4887,6 +4819,8 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
4887
4819
|
statusPage: StatusPage;
|
|
4888
4820
|
monitorsOnStatusPage: ObjectID[];
|
|
4889
4821
|
monitorsInGroup: Dictionary<ObjectID[]>;
|
|
4822
|
+
startDateForMonitorTimeline: Date;
|
|
4823
|
+
endDateForMonitorTimeline: Date;
|
|
4890
4824
|
}> {
|
|
4891
4825
|
const objectId: ObjectID = data.statusPageId;
|
|
4892
4826
|
|
|
@@ -4923,6 +4857,27 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
4923
4857
|
throw new BadDataException("Status Page not found");
|
|
4924
4858
|
}
|
|
4925
4859
|
|
|
4860
|
+
let startDateForMonitorTimeline: Date | undefined =
|
|
4861
|
+
data.startDateForMonitorTimeline;
|
|
4862
|
+
let endDateForMonitorTimeline: Date | undefined =
|
|
4863
|
+
data.endDateForMonitorTimeline;
|
|
4864
|
+
|
|
4865
|
+
if (!startDateForMonitorTimeline || !endDateForMonitorTimeline) {
|
|
4866
|
+
let uptimeHistoryDays: number = statusPage.showUptimeHistoryInDays || 90;
|
|
4867
|
+
|
|
4868
|
+
if (uptimeHistoryDays > 90) {
|
|
4869
|
+
uptimeHistoryDays = 90;
|
|
4870
|
+
}
|
|
4871
|
+
|
|
4872
|
+
if (uptimeHistoryDays < 1) {
|
|
4873
|
+
uptimeHistoryDays = 1;
|
|
4874
|
+
}
|
|
4875
|
+
|
|
4876
|
+
startDateForMonitorTimeline =
|
|
4877
|
+
OneUptimeDate.getSomeDaysAgo(uptimeHistoryDays);
|
|
4878
|
+
endDateForMonitorTimeline = OneUptimeDate.getCurrentDate();
|
|
4879
|
+
}
|
|
4880
|
+
|
|
4926
4881
|
//get monitor statuses
|
|
4927
4882
|
|
|
4928
4883
|
const monitorStatuses: Array<MonitorStatus> =
|
|
@@ -5049,35 +5004,43 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
5049
5004
|
return Boolean(id); // remove nulls
|
|
5050
5005
|
});
|
|
5051
5006
|
|
|
5007
|
+
/*
|
|
5008
|
+
* Batched: this loop used to issue 4 queries per monitor group per page
|
|
5009
|
+
* view (3 inside MonitorGroupService.getCurrentStatus + one duplicate
|
|
5010
|
+
* group-resource fetch), on the hottest public endpoint in the product.
|
|
5011
|
+
* One shared fetch + the already-loaded `monitorStatuses` now serve every
|
|
5012
|
+
* group.
|
|
5013
|
+
*/
|
|
5014
|
+
const monitorGroupResourcesByGroupId: Dictionary<
|
|
5015
|
+
Array<MonitorGroupResource>
|
|
5016
|
+
> =
|
|
5017
|
+
await MonitorGroupService.getMonitorGroupResourcesByGroupIds(
|
|
5018
|
+
monitorGroupIds,
|
|
5019
|
+
);
|
|
5020
|
+
|
|
5021
|
+
const monitorGroupStatuses: Dictionary<MonitorStatus> =
|
|
5022
|
+
await MonitorGroupService.getCurrentStatusesForMonitorGroups({
|
|
5023
|
+
monitorGroupIds: monitorGroupIds,
|
|
5024
|
+
monitorStatuses: monitorStatuses,
|
|
5025
|
+
monitorGroupResources: monitorGroupResourcesByGroupId,
|
|
5026
|
+
});
|
|
5027
|
+
|
|
5052
5028
|
for (const monitorGroupId of monitorGroupIds) {
|
|
5053
5029
|
// get current status of monitors in the group.
|
|
5054
5030
|
|
|
5055
|
-
const currentStatus: MonitorStatus =
|
|
5056
|
-
|
|
5057
|
-
isRoot: true,
|
|
5058
|
-
});
|
|
5031
|
+
const currentStatus: MonitorStatus | undefined =
|
|
5032
|
+
monitorGroupStatuses[monitorGroupId.toString()];
|
|
5059
5033
|
|
|
5060
|
-
|
|
5061
|
-
|
|
5034
|
+
if (currentStatus) {
|
|
5035
|
+
monitorGroupCurrentStatuses[monitorGroupId.toString()] =
|
|
5036
|
+
currentStatus.id!;
|
|
5037
|
+
}
|
|
5062
5038
|
|
|
5063
5039
|
// get monitors in the group.
|
|
5064
5040
|
|
|
5065
|
-
const
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
monitorGroupId: monitorGroupId,
|
|
5069
|
-
},
|
|
5070
|
-
select: {
|
|
5071
|
-
monitorId: true,
|
|
5072
|
-
},
|
|
5073
|
-
props: {
|
|
5074
|
-
isRoot: true,
|
|
5075
|
-
},
|
|
5076
|
-
limit: LIMIT_PER_PROJECT,
|
|
5077
|
-
skip: 0,
|
|
5078
|
-
});
|
|
5079
|
-
|
|
5080
|
-
const monitorsInGroupIds: Array<ObjectID> = groupResources
|
|
5041
|
+
const monitorsInGroupIds: Array<ObjectID> = (
|
|
5042
|
+
monitorGroupResourcesByGroupId[monitorGroupId.toString()] || []
|
|
5043
|
+
)
|
|
5081
5044
|
.map((resource: MonitorGroupResource) => {
|
|
5082
5045
|
return resource.monitorId!;
|
|
5083
5046
|
})
|
|
@@ -5125,8 +5088,8 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
5125
5088
|
const monitorStatusTimelines: Array<MonitorStatusTimeline> =
|
|
5126
5089
|
await StatusPageService.getMonitorStatusTimelineForStatusPage({
|
|
5127
5090
|
monitorIds: monitorsOnStatusPageForTimeline,
|
|
5128
|
-
startDate:
|
|
5129
|
-
endDate:
|
|
5091
|
+
startDate: startDateForMonitorTimeline,
|
|
5092
|
+
endDate: endDateForMonitorTimeline,
|
|
5130
5093
|
});
|
|
5131
5094
|
|
|
5132
5095
|
// return everything.
|
|
@@ -5140,6 +5103,8 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
5140
5103
|
statusPage,
|
|
5141
5104
|
monitorsOnStatusPage,
|
|
5142
5105
|
monitorsInGroup,
|
|
5106
|
+
startDateForMonitorTimeline,
|
|
5107
|
+
endDateForMonitorTimeline,
|
|
5143
5108
|
};
|
|
5144
5109
|
}
|
|
5145
5110
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class AddHotQueryIndexes1785140242697 implements MigrationInterface {
|
|
4
|
+
public name = "AddHotQueryIndexes1785140242697";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE INDEX "IDX_ff92577021975c63c570943872" ON "Monitor" ("monitorType") `,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`CREATE INDEX "IDX_de21b5271b886e528ca36388be" ON "IncidentEpisode" ("subscriberNotificationStatusOnEpisodeCreated") `,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`CREATE INDEX "IDX_0a33db54e9454945d865a6461b" ON "Incident" ("subscriberNotificationStatusOnIncidentCreated") `,
|
|
15
|
+
);
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`CREATE INDEX "IDX_1319bc680d15900efa8f2caac6" ON "Incident" ("subscriberNotificationStatusOnPostmortemPublished") `,
|
|
18
|
+
);
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`CREATE INDEX "IDX_33865d2e485cb1b63cf6cb8b67" ON "ScheduledMaintenance" ("subscriberNotificationStatusOnEventScheduled") `,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`CREATE INDEX "IDX_1d37348eb2a0eab9ab6b739e1b" ON "StatusPageAnnouncement" ("subscriberNotificationStatus") `,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`CREATE INDEX "IDX_90c4580b2ad6fe6611f58975f7" ON "IncidentPublicNote" ("subscriberNotificationStatusOnNoteCreated") `,
|
|
27
|
+
);
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`CREATE INDEX "IDX_b64685d3d7303e1b62477b729e" ON "IncidentStateTimeline" ("subscriberNotificationStatus") `,
|
|
30
|
+
);
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`CREATE INDEX "IDX_c75caf0b6a8d66a7c64975c015" ON "OnCallDutyPolicyExecutionLog" ("status") `,
|
|
33
|
+
);
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`CREATE INDEX "IDX_13813da8afd9f7b4f3bdc27e68" ON "ScheduledMaintenancePublicNote" ("subscriberNotificationStatusOnNoteCreated") `,
|
|
36
|
+
);
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`CREATE INDEX "IDX_ae269b43b4d03e69ee3176477c" ON "ScheduledMaintenanceStateTimeline" ("subscriberNotificationStatus") `,
|
|
39
|
+
);
|
|
40
|
+
await queryRunner.query(
|
|
41
|
+
`CREATE INDEX "IDX_203246e9d08f4673386512ca29" ON "IncidentEpisodeStateTimeline" ("subscriberNotificationStatus") `,
|
|
42
|
+
);
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`CREATE INDEX "IDX_e8b681595d105b37012921df1b" ON "IncidentEpisodePublicNote" ("subscriberNotificationStatusOnNoteCreated") `,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
49
|
+
await queryRunner.query(
|
|
50
|
+
`DROP INDEX "public"."IDX_e8b681595d105b37012921df1b"`,
|
|
51
|
+
);
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`DROP INDEX "public"."IDX_203246e9d08f4673386512ca29"`,
|
|
54
|
+
);
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`DROP INDEX "public"."IDX_ae269b43b4d03e69ee3176477c"`,
|
|
57
|
+
);
|
|
58
|
+
await queryRunner.query(
|
|
59
|
+
`DROP INDEX "public"."IDX_13813da8afd9f7b4f3bdc27e68"`,
|
|
60
|
+
);
|
|
61
|
+
await queryRunner.query(
|
|
62
|
+
`DROP INDEX "public"."IDX_c75caf0b6a8d66a7c64975c015"`,
|
|
63
|
+
);
|
|
64
|
+
await queryRunner.query(
|
|
65
|
+
`DROP INDEX "public"."IDX_b64685d3d7303e1b62477b729e"`,
|
|
66
|
+
);
|
|
67
|
+
await queryRunner.query(
|
|
68
|
+
`DROP INDEX "public"."IDX_90c4580b2ad6fe6611f58975f7"`,
|
|
69
|
+
);
|
|
70
|
+
await queryRunner.query(
|
|
71
|
+
`DROP INDEX "public"."IDX_1d37348eb2a0eab9ab6b739e1b"`,
|
|
72
|
+
);
|
|
73
|
+
await queryRunner.query(
|
|
74
|
+
`DROP INDEX "public"."IDX_33865d2e485cb1b63cf6cb8b67"`,
|
|
75
|
+
);
|
|
76
|
+
await queryRunner.query(
|
|
77
|
+
`DROP INDEX "public"."IDX_1319bc680d15900efa8f2caac6"`,
|
|
78
|
+
);
|
|
79
|
+
await queryRunner.query(
|
|
80
|
+
`DROP INDEX "public"."IDX_0a33db54e9454945d865a6461b"`,
|
|
81
|
+
);
|
|
82
|
+
await queryRunner.query(
|
|
83
|
+
`DROP INDEX "public"."IDX_de21b5271b886e528ca36388be"`,
|
|
84
|
+
);
|
|
85
|
+
await queryRunner.query(
|
|
86
|
+
`DROP INDEX "public"."IDX_ff92577021975c63c570943872"`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class AddHotQueryIndexesSecondPass1785148065137
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
public name: string = "AddHotQueryIndexesSecondPass1785148065137";
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.query(
|
|
10
|
+
`CREATE INDEX "IDX_9ba5449f967cce45bfa9f79d72" ON "StatusPageDomain" ("fullDomain") `,
|
|
11
|
+
);
|
|
12
|
+
await queryRunner.query(
|
|
13
|
+
`CREATE INDEX "IDX_ea265f709c2e27ba37c8c91bb7" ON "DashboardDomain" ("fullDomain") `,
|
|
14
|
+
);
|
|
15
|
+
await queryRunner.query(
|
|
16
|
+
`CREATE INDEX "IDX_62a81ecebd87bb91860b8820ab" ON "StatusPage" ("sendNextReportBy") `,
|
|
17
|
+
);
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`CREATE INDEX "IDX_c382913dd4288e74af031d7110" ON "OnCallDutyPolicySchedule" ("rosterHandoffAt") `,
|
|
20
|
+
);
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`CREATE INDEX "IDX_814e5dbdcf3b61f3ae43e1da10" ON "OnCallDutyPolicySchedule" ("rosterNextStartAt") `,
|
|
23
|
+
);
|
|
24
|
+
await queryRunner.query(
|
|
25
|
+
`CREATE INDEX "IDX_7d9ec527863baaeb823af7ef04" ON "WorkspaceNotificationSummary" ("nextSendAt") `,
|
|
26
|
+
);
|
|
27
|
+
await queryRunner.query(
|
|
28
|
+
`CREATE INDEX "IDX_f799bfe4eeb42c29999e5df874" ON "ScheduledMaintenanceTemplate" ("scheduleNextEventAt") `,
|
|
29
|
+
);
|
|
30
|
+
await queryRunner.query(
|
|
31
|
+
`CREATE INDEX "IDX_14ff60254ae31509cb2ceeb814" ON "NetworkSite" ("lastRollupAt") `,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
36
|
+
await queryRunner.query(
|
|
37
|
+
`DROP INDEX "public"."IDX_14ff60254ae31509cb2ceeb814"`,
|
|
38
|
+
);
|
|
39
|
+
await queryRunner.query(
|
|
40
|
+
`DROP INDEX "public"."IDX_f799bfe4eeb42c29999e5df874"`,
|
|
41
|
+
);
|
|
42
|
+
await queryRunner.query(
|
|
43
|
+
`DROP INDEX "public"."IDX_7d9ec527863baaeb823af7ef04"`,
|
|
44
|
+
);
|
|
45
|
+
await queryRunner.query(
|
|
46
|
+
`DROP INDEX "public"."IDX_814e5dbdcf3b61f3ae43e1da10"`,
|
|
47
|
+
);
|
|
48
|
+
await queryRunner.query(
|
|
49
|
+
`DROP INDEX "public"."IDX_c382913dd4288e74af031d7110"`,
|
|
50
|
+
);
|
|
51
|
+
await queryRunner.query(
|
|
52
|
+
`DROP INDEX "public"."IDX_62a81ecebd87bb91860b8820ab"`,
|
|
53
|
+
);
|
|
54
|
+
await queryRunner.query(
|
|
55
|
+
`DROP INDEX "public"."IDX_ea265f709c2e27ba37c8c91bb7"`,
|
|
56
|
+
);
|
|
57
|
+
await queryRunner.query(
|
|
58
|
+
`DROP INDEX "public"."IDX_9ba5449f967cce45bfa9f79d72"`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|