@oneuptime/common 12.0.34 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/GlobalConfig.ts +12 -12
- package/Models/DatabaseModels/InventoryItem.ts +44 -1
- package/Models/DatabaseModels/NetworkDevice.ts +126 -0
- package/Server/EnvironmentConfig.ts +47 -16
- package/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Infrastructure/Redis.ts +8 -8
- package/Server/Infrastructure/Status.ts +10 -4
- package/Server/Services/DatabaseService.ts +65 -13
- package/Server/Services/InventoryItemService.ts +31 -1
- package/Server/Services/MonitorTemplateService.ts +140 -19
- package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +349 -41
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +87 -2
- package/Server/Services/NetworkDeviceService.ts +69 -0
- package/Server/Services/UserNotificationRuleService.ts +76 -25
- package/Server/Types/Database/Permissions/ReadPermission.ts +45 -5
- package/Server/Types/Database/QueryUtil.ts +56 -0
- package/Server/Types/Markdown.ts +93 -1
- package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +82 -17
- package/Server/Utils/EmailRollup/EmailRollupFlushRunner.ts +10 -1
- package/Server/Utils/EmailRollup/EmailRollupRenderer.ts +2 -2
- package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +82 -35
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +31 -5
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +202 -37
- package/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.ts +82 -9
- package/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.ts +16 -7
- package/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.ts +29 -17
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +107 -48
- package/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.ts +158 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +27 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +11 -1
- package/Server/Utils/Telemetry/TelemetryEntity.ts +83 -9
- package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +32 -0
- package/Tests/App/Dashboard/AdoptedDeviceDrawer.test.tsx +374 -0
- package/Tests/App/Dashboard/DashboardLabelVariables.test.tsx +580 -0
- package/Tests/App/Dashboard/DashboardMonitorLabelVariable.test.tsx +438 -0
- package/Tests/App/Dashboard/DashboardVariableAllContract.test.tsx +5 -2
- package/Tests/App/Dashboard/DeviceAttachmentCard.test.tsx +273 -0
- package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +505 -0
- package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +163 -0
- package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +401 -0
- package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +232 -0
- package/Tests/App/Dashboard/InventoryItems.test.tsx +201 -0
- package/Tests/App/Dashboard/InventoryTypeAndStatusFacets.test.tsx +798 -0
- package/Tests/App/Dashboard/NetworkTopologyLiveView.test.tsx +320 -0
- package/Tests/App/Dashboard/NetworkTopologyToolbar.test.tsx +275 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedEmptyState.test.tsx +975 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedPlanGate.test.tsx +63 -0
- package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +626 -0
- package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +348 -0
- package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +331 -0
- package/Tests/App/Dashboard/UserSettingsEmailPreferences.test.tsx +603 -0
- package/Tests/App/Dashboard/UserSettingsNotificationSettings.test.tsx +324 -0
- package/Tests/App/PublicDashboard/DashboardVariableSelector.test.tsx +13 -4
- package/Tests/App/StatusPage/StatusPageOidcOrigin.test.tsx +223 -0
- package/Tests/Models/InventoryItemStatus.test.ts +147 -0
- package/Tests/Models/NetworkDeviceMacAddressColumn.test.ts +294 -0
- package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +129 -0
- package/Tests/Server/EnvironmentConfigValkey.test.ts +227 -0
- package/Tests/Server/Infrastructure/Postgres/AddMacAddressToNetworkDeviceMigration.test.ts +365 -0
- package/Tests/Server/Infrastructure/Postgres/CustomFieldValueMappingMigration.test.ts +62 -23
- package/Tests/Server/Infrastructure/ValkeyDeploymentConfig.test.ts +265 -0
- package/Tests/Server/Middleware/HttpMetricsMiddleware.test.ts +382 -0
- package/Tests/Server/Middleware/SCIMAuthorization.test.ts +525 -0
- package/Tests/Server/Services/DatabaseServiceAggregateBy.test.ts +291 -56
- package/Tests/Server/Services/DatabaseServiceSortTiebreaker.test.ts +151 -0
- package/Tests/Server/Services/InventoryItemManualCreate.test.ts +105 -0
- package/Tests/Server/Services/InventoryItemPromotionGate.test.ts +178 -0
- package/Tests/Server/Services/MonitorTemplateServiceCustomFieldSync.test.ts +502 -0
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +1133 -81
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanRegistration.test.ts +520 -0
- package/Tests/Server/Services/NetworkDeviceMacAddressNormalization.test.ts +572 -0
- package/Tests/Server/Types/Database/InventoryStatusPostgres.test.ts +368 -0
- package/Tests/Server/Types/Database/Permissions/ReadBlockPermission.test.ts +261 -14
- package/Tests/Server/Types/Database/QueryUtilIncludesAnyOfGroups.test.ts +169 -0
- package/Tests/Server/Types/Database/QueryUtilIncludesAnyOfGroupsPostgres.test.ts +297 -0
- package/Tests/Server/Types/Markdown.test.ts +194 -1
- package/Tests/Server/Types/Workflow/Components/IncomingWebhookUtils.test.ts +279 -0
- package/Tests/Server/Types/Workflow/Components/TextToJson.test.ts +212 -0
- package/Tests/Server/Utils/CustomField/CustomFieldMappingRegistry.test.ts +436 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +214 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupFlushRunnerBehaviour.test.ts +1 -1
- package/Tests/Server/Utils/EmailRollup/EmailRollupRenderer.test.ts +10 -3
- package/Tests/Server/Utils/EventLoop.test.ts +359 -0
- package/Tests/Server/Utils/JsonWebToken.test.ts +30 -0
- package/Tests/Server/Utils/Monitor/Criteria/CompareCriteria.test.ts +242 -0
- package/Tests/Server/Utils/Monitor/Criteria/CompareCriteriaAggregation.test.ts +13 -7
- package/Tests/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.test.ts +29 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +30 -6
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +246 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEmailEvalLogAgreement.test.ts +280 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +224 -10
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorMetricUnits.test.ts +570 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaExpectationBuilderUnits.test.ts +30 -5
- package/Tests/Server/Utils/Monitor/MonitorCriteriaMessageBuilderUnits.test.ts +68 -21
- package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +36 -19
- package/Tests/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.test.ts +573 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +317 -0
- package/Tests/Server/Utils/Telemetry/ContextSpanProcessor.test.ts +281 -0
- package/Tests/Server/Utils/Telemetry/InventoryDuplicateIdentity.test.ts +316 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +111 -8
- package/Tests/Types/Database/IncludesAnyOfGroups.test.ts +106 -0
- package/Tests/Types/JSONFunctions.test.ts +40 -0
- package/Tests/Types/NetworkAutomation/AutoImportRunMerge.test.ts +235 -0
- package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +66 -0
- package/Tests/Types/NetworkAutomation/RuleRunResultDescribe.test.ts +309 -1
- package/Tests/Types/Telemetry/InventoryLiveness.test.ts +99 -0
- package/Tests/UI/Components/CustomFields/CustomFieldsDetail.test.tsx +160 -0
- package/Tests/UI/ReactRouterSingletonBuild.test.ts +133 -0
- package/Tests/UI/Rum/ReplayHeader.test.tsx +10 -2
- package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +514 -0
- package/Tests/UI/Rum/ReplayTimeFormat.test.ts +94 -0
- package/Tests/UI/Rum/ReplayUi.test.tsx +559 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +1 -0
- package/Tests/Utils/Dashboard/Components/DashboardMonitorListComponent.test.ts +11 -1
- package/Tests/Utils/Dashboard/LabelVariable.test.ts +257 -0
- package/Tests/Utils/Dashboard/VariableUrlState.test.ts +144 -14
- package/Tests/Utils/MetricUnitUtil.test.ts +81 -0
- package/Tests/Utils/Monitor/DeviceMacLearningUtil.test.ts +497 -0
- package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +546 -0
- package/Tests/Utils/Monitor/MonitorTemplateCustomFieldUtil.test.ts +218 -0
- package/Tests/Utils/Monitor/NetworkTopologyEndpointAdoption.test.ts +1755 -0
- package/Tests/Utils/NetworkAutomation/AutoImportRunChain.test.ts +320 -0
- package/Types/BaseDatabase/IncludesAnyOfGroups.ts +77 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardMonitorListComponent.ts +1 -0
- package/Types/Dashboard/DashboardVariable.ts +8 -0
- package/Types/JSON.ts +4 -0
- package/Types/JSONFunctions.ts +16 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +13 -0
- package/Types/NetworkAutomation/RuleRunResult.ts +402 -13
- package/Types/SerializableObjectDictionary.ts +4 -0
- package/Types/Telemetry/InventoryLiveness.ts +56 -0
- package/UI/Components/CSVFileUpload/CSVFileUpload.tsx +9 -2
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +46 -21
- package/UI/Components/Dashboard/DashboardVariableControl.tsx +285 -0
- package/UI/esbuild-config.js +6 -0
- package/Utils/Dashboard/Components/DashboardMonitorListComponent.ts +12 -1
- package/Utils/Dashboard/LabelVariable.ts +152 -0
- package/Utils/Dashboard/VariableUrlState.ts +27 -5
- package/Utils/MetricUnitUtil.ts +34 -0
- package/Utils/Monitor/DeviceMacLearningUtil.ts +177 -0
- package/Utils/Monitor/MetricValueFormatter.ts +342 -0
- package/Utils/Monitor/MonitorTemplateCustomFieldUtil.ts +124 -0
- package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +7 -2
- package/Utils/Monitor/NetworkTopologyUtil.ts +693 -0
- package/Utils/NetworkAutomation/AutoImportRunChain.ts +138 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +12 -12
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/InventoryItem.js +34 -1
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +128 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +44 -12
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Redis.js +8 -8
- package/build/dist/Server/Infrastructure/Redis.js.map +1 -1
- package/build/dist/Server/Infrastructure/Status.js +10 -4
- package/build/dist/Server/Infrastructure/Status.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +58 -13
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +28 -1
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +116 -17
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +270 -37
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +65 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +54 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +60 -25
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/ReadPermission.js +29 -4
- package/build/dist/Server/Types/Database/Permissions/ReadPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryUtil.js +36 -0
- package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +75 -0
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +53 -18
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js +10 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js.map +1 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js +2 -2
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +58 -35
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +29 -5
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +166 -35
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js +58 -9
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js +9 -3
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js +26 -12
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +74 -33
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.js +114 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +25 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +9 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +70 -13
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Types/BaseDatabase/IncludesAnyOfGroups.js +54 -0
- package/build/dist/Types/BaseDatabase/IncludesAnyOfGroups.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardVariable.js +1 -0
- package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -1
- package/build/dist/Types/JSON.js +1 -0
- package/build/dist/Types/JSON.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +13 -0
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js +291 -6
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
- package/build/dist/Types/SerializableObjectDictionary.js +4 -0
- package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
- package/build/dist/Types/Telemetry/InventoryLiveness.js +37 -0
- package/build/dist/Types/Telemetry/InventoryLiveness.js.map +1 -0
- package/build/dist/UI/Components/CSVFileUpload/CSVFileUpload.js +7 -0
- package/build/dist/UI/Components/CSVFileUpload/CSVFileUpload.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +9 -2
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Dashboard/DashboardVariableControl.js +137 -0
- package/build/dist/UI/Components/Dashboard/DashboardVariableControl.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js +9 -1
- package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js.map +1 -1
- package/build/dist/Utils/Dashboard/LabelVariable.js +96 -0
- package/build/dist/Utils/Dashboard/LabelVariable.js.map +1 -0
- package/build/dist/Utils/Dashboard/VariableUrlState.js +19 -4
- package/build/dist/Utils/Dashboard/VariableUrlState.js.map +1 -1
- package/build/dist/Utils/MetricUnitUtil.js +26 -0
- package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/DeviceMacLearningUtil.js +112 -0
- package/build/dist/Utils/Monitor/DeviceMacLearningUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MetricValueFormatter.js +276 -0
- package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorTemplateCustomFieldUtil.js +101 -0
- package/build/dist/Utils/Monitor/MonitorTemplateCustomFieldUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +7 -2
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +484 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkAutomation/AutoImportRunChain.js +59 -0
- package/build/dist/Utils/NetworkAutomation/AutoImportRunChain.js.map +1 -0
- package/jest.config.json +2 -0
- package/package.json +1 -1
- package/test-setup.sh +9 -9
- package/tsconfig.json +51 -11
- package/Tests/App/Dashboard/NotificationEmailPreferences.test.tsx +0 -399
|
@@ -648,6 +648,16 @@ export class Service extends DatabaseService {
|
|
|
648
648
|
rootCause: true,
|
|
649
649
|
incidentNumber: true,
|
|
650
650
|
incidentNumberWithPrefix: true,
|
|
651
|
+
/*
|
|
652
|
+
* AcknowledgeIncident.hbs asks for a Resources Affected row and
|
|
653
|
+
* the generator had nothing to build it from, so the row was
|
|
654
|
+
* silently dropped — the same `{{#if}}` swallow that hid the
|
|
655
|
+
* alert's Root Cause.
|
|
656
|
+
*/
|
|
657
|
+
monitors: {
|
|
658
|
+
_id: true,
|
|
659
|
+
name: true,
|
|
660
|
+
},
|
|
651
661
|
},
|
|
652
662
|
});
|
|
653
663
|
}
|
|
@@ -675,6 +685,20 @@ export class Service extends DatabaseService {
|
|
|
675
685
|
},
|
|
676
686
|
alertNumber: true,
|
|
677
687
|
alertNumberWithPrefix: true,
|
|
688
|
+
/*
|
|
689
|
+
* AcknowledgeAlert.hbs has always asked for a Root Cause row, but
|
|
690
|
+
* this select never loaded the column and the template's
|
|
691
|
+
* `{{#if text}}` guard silently dropped the row — so the one
|
|
692
|
+
* person being woken up for the alert was the only one who could
|
|
693
|
+
* not see why it fired. The other three on-call templates already
|
|
694
|
+
* select it.
|
|
695
|
+
*/
|
|
696
|
+
rootCause: true,
|
|
697
|
+
// Same story for the template's Resources Affected row.
|
|
698
|
+
monitor: {
|
|
699
|
+
_id: true,
|
|
700
|
+
name: true,
|
|
701
|
+
},
|
|
678
702
|
},
|
|
679
703
|
});
|
|
680
704
|
}
|
|
@@ -3171,6 +3195,7 @@ export class Service extends DatabaseService {
|
|
|
3171
3195
|
};
|
|
3172
3196
|
}
|
|
3173
3197
|
async generateEmailTemplateForAlertCreated(to, alert, userOnCallLogTimelineId) {
|
|
3198
|
+
var _a;
|
|
3174
3199
|
const host = await DatabaseConfig.getHost();
|
|
3175
3200
|
const httpProtocol = await DatabaseConfig.getHttpProtocol();
|
|
3176
3201
|
const alertNumber = alert.alertNumberWithPrefix ||
|
|
@@ -3182,6 +3207,8 @@ export class Service extends DatabaseService {
|
|
|
3182
3207
|
currentState: alert.currentAlertState.name,
|
|
3183
3208
|
alertDescription: await Markdown.convertToHTML(alert.description || "", MarkdownContentType.Email),
|
|
3184
3209
|
alertSeverity: alert.alertSeverity.name,
|
|
3210
|
+
resourcesAffected: ((_a = alert.monitor) === null || _a === void 0 ? void 0 : _a.name) || "No resources identified",
|
|
3211
|
+
rootCause: await Markdown.convertToHTML(alert.rootCause || "No root cause identified for this alert", MarkdownContentType.Email),
|
|
3185
3212
|
alertViewLink: (await AlertService.getAlertLinkInDashboard(alert.projectId, alert.id)).toString(),
|
|
3186
3213
|
acknowledgeAlertLink: new URL(httpProtocol, host, new Route(AppApiRoute.toString())
|
|
3187
3214
|
.addRoute(new UserOnCallLogTimeline().crudApiPath)
|
|
@@ -3207,7 +3234,15 @@ export class Service extends DatabaseService {
|
|
|
3207
3234
|
currentState: incident.currentIncidentState.name,
|
|
3208
3235
|
incidentDescription: await Markdown.convertToHTML(incident.description || "", MarkdownContentType.Email),
|
|
3209
3236
|
incidentSeverity: incident.incidentSeverity.name,
|
|
3210
|
-
|
|
3237
|
+
resourcesAffected: (incident.monitors || [])
|
|
3238
|
+
.map((monitor) => {
|
|
3239
|
+
return monitor.name || "";
|
|
3240
|
+
})
|
|
3241
|
+
.filter((name) => {
|
|
3242
|
+
return name.length > 0;
|
|
3243
|
+
})
|
|
3244
|
+
.join(", ") || "No resources identified",
|
|
3245
|
+
rootCause: await Markdown.convertToHTML(incident.rootCause || "No root cause identified for this incident", MarkdownContentType.Email),
|
|
3211
3246
|
incidentViewLink: (await IncidentService.getIncidentLinkInDashboard(incident.projectId, incident.id)).toString(),
|
|
3212
3247
|
acknowledgeIncidentLink: new URL(httpProtocol, host, new Route(AppApiRoute.toString())
|
|
3213
3248
|
.addRoute(new UserOnCallLogTimeline().crudApiPath)
|
|
@@ -3285,23 +3320,23 @@ export class Service extends DatabaseService {
|
|
|
3285
3320
|
if (alerts.length > 0) {
|
|
3286
3321
|
const alertRows = [];
|
|
3287
3322
|
for (const alert of alerts) {
|
|
3288
|
-
const alertTitle = alert.title || "Untitled Alert";
|
|
3323
|
+
const alertTitle = Markdown.escapeHtml(alert.title || "Untitled Alert");
|
|
3289
3324
|
const alertNumber = alert.alertNumberWithPrefix ||
|
|
3290
3325
|
(alert.alertNumber ? `#${alert.alertNumber}` : "");
|
|
3291
3326
|
const alertLink = (await AlertService.getAlertLinkInDashboard(alertEpisode.projectId, alert.id)).toString();
|
|
3292
|
-
const monitorName = ((_b = alert.monitor) === null || _b === void 0 ? void 0 : _b.name) || "";
|
|
3327
|
+
const monitorName = Markdown.escapeHtml(((_b = alert.monitor) === null || _b === void 0 ? void 0 : _b.name) || "");
|
|
3293
3328
|
alertRows.push(`
|
|
3294
3329
|
<tr>
|
|
3295
|
-
<td style="padding:
|
|
3296
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
3330
|
+
<td style="padding: 16px 20px; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; word-break: break-word;">
|
|
3331
|
+
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="width: 100%; table-layout: fixed;">
|
|
3297
3332
|
<tr>
|
|
3298
3333
|
<td style="vertical-align: middle;">
|
|
3299
|
-
<span style="display: inline-block; background-color: #
|
|
3300
|
-
<a href="${alertLink}" style="color: #
|
|
3301
|
-
${monitorName ? `<span style="display: block; color: #64748b; font-size:
|
|
3334
|
+
<span style="display: inline-block; background-color: #f1f5f9; color: #111111; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; margin-right: 8px;">${alertNumber}</span>
|
|
3335
|
+
<a href="${alertLink}" style="color: #111111; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 24px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;">${alertTitle}</a>
|
|
3336
|
+
${monitorName ? `<span style="display: block; color: #64748b; font-size: 13px; line-height: 20px; margin-top: 6px;">Monitor: ${monitorName}</span>` : ""}
|
|
3302
3337
|
</td>
|
|
3303
|
-
<td style="text-align: right; vertical-align: middle;">
|
|
3304
|
-
<a href="${alertLink}" style="color: #
|
|
3338
|
+
<td width="52" style="text-align: right; vertical-align: middle; padding-left: 8px;">
|
|
3339
|
+
<a href="${alertLink}" style="color: #111111; font-size: 13px; line-height: 20px; text-decoration: underline;">View →</a>
|
|
3305
3340
|
</td>
|
|
3306
3341
|
</tr>
|
|
3307
3342
|
</table>
|
|
@@ -3311,7 +3346,7 @@ export class Service extends DatabaseService {
|
|
|
3311
3346
|
}
|
|
3312
3347
|
if (alertRows.length > 0) {
|
|
3313
3348
|
alertsListHtml = `
|
|
3314
|
-
<table cellpadding="0" cellspacing="0" width="100%" style="
|
|
3349
|
+
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="width: 100%; table-layout: fixed; background-color: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; margin: 8px 0 16px 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
|
|
3315
3350
|
<tbody>
|
|
3316
3351
|
${alertRows.join("")}
|
|
3317
3352
|
</tbody>
|
|
@@ -3329,8 +3364,8 @@ export class Service extends DatabaseService {
|
|
|
3329
3364
|
alertEpisodeDescription: await Markdown.convertToHTML(alertEpisode.description || "", MarkdownContentType.Email),
|
|
3330
3365
|
alertEpisodeSeverity: alertEpisode.alertSeverity.name,
|
|
3331
3366
|
resourcesAffected: resourcesAffected,
|
|
3332
|
-
rootCause: alertEpisode.rootCause ||
|
|
3333
|
-
"No root cause identified for this alert episode",
|
|
3367
|
+
rootCause: await Markdown.convertToHTML(alertEpisode.rootCause ||
|
|
3368
|
+
"No root cause identified for this alert episode", MarkdownContentType.Email),
|
|
3334
3369
|
alertsList: alertsListHtml,
|
|
3335
3370
|
alertsCount: alerts.length.toString(),
|
|
3336
3371
|
alertEpisodeViewLink: (await AlertEpisodeService.getEpisodeLinkInDashboard(alertEpisode.projectId, alertEpisode.id)).toString(),
|
|
@@ -3415,30 +3450,30 @@ export class Service extends DatabaseService {
|
|
|
3415
3450
|
if (incidents.length > 0) {
|
|
3416
3451
|
const incidentRows = [];
|
|
3417
3452
|
for (const incident of incidents) {
|
|
3418
|
-
const incidentTitle = incident.title || "Untitled Incident";
|
|
3453
|
+
const incidentTitle = Markdown.escapeHtml(incident.title || "Untitled Incident");
|
|
3419
3454
|
const incidentNumber = incident.incidentNumberWithPrefix ||
|
|
3420
3455
|
(incident.incidentNumber ? `#${incident.incidentNumber}` : "");
|
|
3421
3456
|
const incidentLink = (await IncidentService.getIncidentLinkInDashboard(incidentEpisode.projectId, incident.id)).toString();
|
|
3422
|
-
const monitorName = (incident.monitors || [])
|
|
3457
|
+
const monitorName = Markdown.escapeHtml((incident.monitors || [])
|
|
3423
3458
|
.map((monitor) => {
|
|
3424
3459
|
return monitor.name || "";
|
|
3425
3460
|
})
|
|
3426
3461
|
.filter((name) => {
|
|
3427
3462
|
return name.length > 0;
|
|
3428
3463
|
})
|
|
3429
|
-
.join(", ") || "";
|
|
3464
|
+
.join(", ") || "");
|
|
3430
3465
|
incidentRows.push(`
|
|
3431
3466
|
<tr>
|
|
3432
|
-
<td style="padding:
|
|
3433
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
3467
|
+
<td style="padding: 16px 20px; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; word-break: break-word;">
|
|
3468
|
+
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="width: 100%; table-layout: fixed;">
|
|
3434
3469
|
<tr>
|
|
3435
3470
|
<td style="vertical-align: middle;">
|
|
3436
3471
|
<span style="display: inline-block; background-color: #fee2e2; color: #991b1b; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; margin-right: 8px;">${incidentNumber}</span>
|
|
3437
|
-
<a href="${incidentLink}" style="color: #
|
|
3438
|
-
${monitorName ? `<span style="display: block; color: #64748b; font-size:
|
|
3472
|
+
<a href="${incidentLink}" style="color: #111111; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 24px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;">${incidentTitle}</a>
|
|
3473
|
+
${monitorName ? `<span style="display: block; color: #64748b; font-size: 13px; line-height: 20px; margin-top: 6px;">Monitor: ${monitorName}</span>` : ""}
|
|
3439
3474
|
</td>
|
|
3440
|
-
<td style="text-align: right; vertical-align: middle;">
|
|
3441
|
-
<a href="${incidentLink}" style="color: #
|
|
3475
|
+
<td width="52" style="text-align: right; vertical-align: middle; padding-left: 8px;">
|
|
3476
|
+
<a href="${incidentLink}" style="color: #111111; font-size: 13px; line-height: 20px; text-decoration: underline;">View →</a>
|
|
3442
3477
|
</td>
|
|
3443
3478
|
</tr>
|
|
3444
3479
|
</table>
|
|
@@ -3448,7 +3483,7 @@ export class Service extends DatabaseService {
|
|
|
3448
3483
|
}
|
|
3449
3484
|
if (incidentRows.length > 0) {
|
|
3450
3485
|
incidentsListHtml = `
|
|
3451
|
-
<table cellpadding="0" cellspacing="0" width="100%" style="
|
|
3486
|
+
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="width: 100%; table-layout: fixed; background-color: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; margin: 8px 0 16px 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
|
|
3452
3487
|
<tbody>
|
|
3453
3488
|
${incidentRows.join("")}
|
|
3454
3489
|
</tbody>
|
|
@@ -3468,8 +3503,8 @@ export class Service extends DatabaseService {
|
|
|
3468
3503
|
incidentEpisodeDescription: await Markdown.convertToHTML(incidentEpisode.description || "", MarkdownContentType.Email),
|
|
3469
3504
|
incidentEpisodeSeverity: incidentEpisode.incidentSeverity.name,
|
|
3470
3505
|
resourcesAffected: resourcesAffected,
|
|
3471
|
-
rootCause: incidentEpisode.rootCause ||
|
|
3472
|
-
"No root cause identified for this incident episode",
|
|
3506
|
+
rootCause: await Markdown.convertToHTML(incidentEpisode.rootCause ||
|
|
3507
|
+
"No root cause identified for this incident episode", MarkdownContentType.Email),
|
|
3473
3508
|
incidentsList: incidentsListHtml,
|
|
3474
3509
|
incidentsCount: incidents.length.toString(),
|
|
3475
3510
|
incidentEpisodeViewLink: (await IncidentEpisodeService.getEpisodeLinkInDashboard(incidentEpisode.projectId, incidentEpisode.id)).toString(),
|