@oneuptime/common 11.7.2 → 11.7.4

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.
Files changed (414) hide show
  1. package/Models/AnalyticsModels/KubernetesCostAllocation.ts +103 -0
  2. package/Models/DatabaseModels/AlertEpisodeStateTimeline.ts +1 -0
  3. package/Models/DatabaseModels/AlertStateTimeline.ts +1 -0
  4. package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
  5. package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
  6. package/Models/DatabaseModels/Index.ts +5 -0
  7. package/Models/DatabaseModels/LogDropFilter.ts +89 -0
  8. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +13 -3
  9. package/Models/DatabaseModels/RecommendationDismissal.ts +463 -0
  10. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
  11. package/Models/DatabaseModels/StatusPageGroup.ts +95 -0
  12. package/Models/DatabaseModels/TableView.ts +40 -0
  13. package/Models/DatabaseModels/TraceDropFilter.ts +89 -0
  14. package/Models/DatabaseModels/WorkflowVariable.ts +5 -1
  15. package/Server/API/AlertAPI.ts +32 -17
  16. package/Server/API/BaseAPI.ts +31 -2
  17. package/Server/API/BaseAnalyticsAPI.ts +36 -2
  18. package/Server/API/CommonAPI.ts +57 -0
  19. package/Server/API/IncidentAPI.ts +60 -33
  20. package/Server/API/IncidentEpisodeAPI.ts +31 -16
  21. package/Server/API/MonitorAPI.ts +30 -0
  22. package/Server/API/MonitorTemplateAPI.ts +8 -0
  23. package/Server/API/ProbeAPI.ts +196 -15
  24. package/Server/API/ProjectAPI.ts +79 -1
  25. package/Server/API/ScheduledMaintenanceAPI.ts +33 -18
  26. package/Server/API/StatusPageAPI.ts +74 -37
  27. package/Server/API/WorkspaceNotificationRuleAPI.ts +34 -4
  28. package/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.ts +13 -0
  29. package/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.ts +527 -0
  30. package/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.ts +31 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.ts +55 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.ts +53 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +10 -0
  34. package/Server/Services/AlertEpisodeService.ts +47 -0
  35. package/Server/Services/AlertService.ts +125 -0
  36. package/Server/Services/BillingService.ts +98 -0
  37. package/Server/Services/DatabaseService.ts +184 -20
  38. package/Server/Services/IncidentEpisodeService.ts +47 -0
  39. package/Server/Services/IncidentService.ts +123 -0
  40. package/Server/Services/IncidentTemplateService.ts +123 -1
  41. package/Server/Services/Index.ts +2 -0
  42. package/Server/Services/LogDropFilterService.ts +133 -0
  43. package/Server/Services/MonitorProbeService.ts +94 -4
  44. package/Server/Services/MonitorService.ts +48 -43
  45. package/Server/Services/NetworkDeviceDiscoveryScanService.ts +70 -0
  46. package/Server/Services/ProbeService.ts +66 -0
  47. package/Server/Services/ProjectService.ts +131 -7
  48. package/Server/Services/RecommendationDismissalService.ts +52 -0
  49. package/Server/Services/RunbookAgentJobService.ts +68 -7
  50. package/Server/Services/ScheduledMaintenanceService.ts +103 -0
  51. package/Server/Services/ScheduledMaintenanceTemplateService.ts +90 -0
  52. package/Server/Services/StatusPageGroupService.ts +186 -0
  53. package/Server/Services/TraceDropFilterService.ts +133 -0
  54. package/Server/Types/Workflow/Components/API/Delete.ts +12 -0
  55. package/Server/Types/Workflow/Components/API/Get.ts +12 -0
  56. package/Server/Types/Workflow/Components/API/Patch.ts +12 -0
  57. package/Server/Types/Workflow/Components/API/Post.ts +12 -0
  58. package/Server/Types/Workflow/Components/API/Put.ts +13 -0
  59. package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +212 -0
  60. package/Server/Utils/DropFilterValidation.ts +127 -0
  61. package/Server/Utils/Errors.ts +5 -0
  62. package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
  63. package/Server/Utils/Monitor/MonitorIncident.ts +31 -2
  64. package/Server/Utils/Telemetry/AppMetrics.ts +31 -0
  65. package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -0
  66. package/Tests/Models/DatabaseModels/MonitorProbeColumnAccessControl.test.ts +196 -0
  67. package/Tests/Models/RecommendationDismissalModel.test.ts +269 -0
  68. package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +320 -0
  69. package/Tests/Server/API/BaseAnalyticsAPIUpdatePayloadValidation.test.ts +293 -0
  70. package/Tests/Server/API/CommonAPIAuthGuard.test.ts +164 -0
  71. package/Tests/Server/API/ProbeAPI.test.ts +422 -53
  72. package/Tests/Server/API/ProjectAPI.test.ts +180 -0
  73. package/Tests/Server/API/ProjectAPIExtendTrialBillingDisabled.test.ts +138 -0
  74. package/Tests/Server/API/ProjectScopedCustomRouteAuth.test.ts +458 -0
  75. package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +359 -0
  76. package/Tests/Server/Infrastructure/ProcessSignalDelivery.test.ts +427 -0
  77. package/Tests/Server/Services/BillingServiceExtendTrial.test.ts +439 -0
  78. package/Tests/Server/Services/CrossProjectReferenceWriteGuard.test.ts +810 -0
  79. package/Tests/Server/Services/DatabaseServiceAtomicAddToColumns.test.ts +269 -0
  80. package/Tests/Server/Services/DatabaseServiceEmptyUpdate.test.ts +277 -0
  81. package/Tests/Server/Services/DatabaseServiceSortColumnSelect.test.ts +201 -0
  82. package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +81 -23
  83. package/Tests/Server/Services/DropFilterSaveValidation.test.ts +398 -0
  84. package/Tests/Server/Services/MonitorProbeDeleteHooks.test.ts +280 -0
  85. package/Tests/Server/Services/MonitorProbeServiceProbeTenancy.test.ts +304 -0
  86. package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +262 -0
  87. package/Tests/Server/Services/ProjectServiceExtendTrial.test.ts +614 -0
  88. package/Tests/Server/Services/RecommendationDismissalService.test.ts +306 -0
  89. package/Tests/Server/Services/RepairCrossProjectIncidentReferencesMigration.test.ts +528 -0
  90. package/Tests/Server/Services/StatusPageGroupNesting.test.ts +395 -0
  91. package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +26 -21
  92. package/Tests/Server/Types/Database/Permissions/WorkflowVariableColumnPermission.test.ts +227 -0
  93. package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +285 -0
  94. package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +463 -0
  95. package/Tests/Server/Utils/DropFilterValidation.test.ts +269 -0
  96. package/Tests/Server/Utils/Telemetry/SpanUtil.test.ts +94 -0
  97. package/Tests/Types/DateUserTimezone.test.ts +52 -0
  98. package/Tests/Types/JSONFunctions.test.ts +103 -1
  99. package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +177 -9
  100. package/Tests/Types/Monitor/MonitorStepDnsMonitor.test.ts +105 -0
  101. package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +131 -0
  102. package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +60 -0
  103. package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +82 -0
  104. package/Tests/Types/Monitor/MonitorStepInfrastructureMonitors.test.ts +268 -0
  105. package/Tests/Types/Monitor/MonitorStepMetricMonitor.test.ts +386 -0
  106. package/Tests/Types/Monitor/MonitorStepProfileMonitor.test.ts +185 -0
  107. package/Tests/Types/Monitor/MonitorStepSnmpMonitor.test.ts +156 -0
  108. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +371 -0
  109. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +901 -0
  110. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +607 -0
  111. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +754 -0
  112. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +960 -0
  113. package/Tests/Types/RollingTime/RollingTimeUtil.test.ts +186 -0
  114. package/Tests/Types/Runbook/RunbookStepTimeout.test.ts +410 -0
  115. package/Tests/Types/Telemetry/DropFilterSampling.test.ts +241 -0
  116. package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +353 -0
  117. package/Tests/Types/Workspace/NotificationRuleUtil.test.ts +566 -0
  118. package/Tests/UI/Components/CodeEditor.test.tsx +174 -0
  119. package/Tests/UI/Components/ErrorBoundary.test.tsx +555 -24
  120. package/Tests/UI/Components/InfoCard.test.tsx +358 -0
  121. package/Tests/UI/Components/LogTimeRangePicker.test.tsx +138 -0
  122. package/Tests/UI/Components/Modal.test.tsx +43 -5
  123. package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +679 -0
  124. package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
  125. package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +999 -0
  126. package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
  127. package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -0
  128. package/Tests/UI/Components/Runbook/StepTimeoutInput.test.tsx +386 -0
  129. package/Tests/UI/Components/StatusPage/ResourceGroupSection.test.tsx +671 -0
  130. package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +404 -0
  131. package/Tests/UI/Utils/DropdownAlignment.test.ts +306 -0
  132. package/Tests/UI/Utils/TableFilterUrlState.test.ts +292 -0
  133. package/Tests/Utils/Monitor/MonitorSummaryProbeUtil.test.ts +263 -0
  134. package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +583 -0
  135. package/Tests/Utils/StatusPage/GroupNestingLayout.test.ts +1072 -0
  136. package/Tests/Utils/StatusPage/GroupTree.test.ts +583 -0
  137. package/Tests/Utils/StatusPage/ResourceUptime.test.ts +411 -0
  138. package/Tests/Utils/UserPreferences.test.ts +563 -0
  139. package/Types/Date.ts +15 -6
  140. package/Types/JSONFunctions.ts +7 -2
  141. package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
  142. package/Types/Monitor/KubernetesAlertTemplates.ts +205 -0
  143. package/Types/Monitor/MonitorStep.ts +10 -1
  144. package/Types/Monitor/MonitorStepMetricMonitor.ts +46 -1
  145. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +413 -0
  146. package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +168 -0
  147. package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +175 -0
  148. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +743 -0
  149. package/Types/Permission.ts +45 -0
  150. package/Types/Recommendation/RecommendationType.ts +20 -0
  151. package/Types/Runbook/RunbookExecutionDeadline.ts +129 -0
  152. package/Types/Runbook/RunbookStepTimeout.ts +202 -0
  153. package/Types/Telemetry/DropFilterSampling.ts +92 -0
  154. package/UI/Components/AI/GenerateFromAIModal.tsx +0 -2
  155. package/UI/Components/Accordion/Accordion.tsx +10 -2
  156. package/UI/Components/BulkUpdate/BulkLabelActions.tsx +0 -1
  157. package/UI/Components/CodeEditor/CodeEditor.tsx +34 -20
  158. package/UI/Components/Date/RangeStartAndEndDateView.tsx +0 -1
  159. package/UI/Components/EditionLabel/EditionLabel.tsx +1 -27
  160. package/UI/Components/Error/PageError.tsx +0 -4
  161. package/UI/Components/ErrorBoundary.tsx +252 -15
  162. package/UI/Components/InfoCard/InfoCard.tsx +58 -1
  163. package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +34 -1
  164. package/UI/Components/MasterPage/MasterPage.tsx +65 -0
  165. package/UI/Components/Modal/Modal.tsx +16 -60
  166. package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
  167. package/UI/Components/ModelTable/BaseModelTable.tsx +503 -71
  168. package/UI/Components/ModelTable/Column.ts +17 -0
  169. package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +523 -0
  170. package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
  171. package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
  172. package/UI/Components/ModelTable/TableView.tsx +24 -2
  173. package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
  174. package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
  175. package/UI/Components/SideMenu/SideMenu.tsx +24 -4
  176. package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
  177. package/UI/Components/Table/Table.tsx +14 -1
  178. package/UI/Components/Table/TableRow.tsx +180 -175
  179. package/UI/Components/Table/Types/Column.ts +2 -0
  180. package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +34 -1
  181. package/UI/Utils/DropdownAlignment.ts +162 -0
  182. package/UI/Utils/TableFilterUrlState.ts +59 -20
  183. package/Utils/API.ts +106 -2
  184. package/Utils/Monitor/MonitorSummaryProbeUtil.ts +130 -0
  185. package/Utils/NetworkDiscovery/ScanTargetUtil.ts +434 -0
  186. package/Utils/StatusPage/GroupNestingLayout.ts +343 -0
  187. package/Utils/StatusPage/GroupTree.ts +307 -0
  188. package/Utils/StatusPage/ResourceUptime.ts +90 -17
  189. package/Utils/UserPreferences.ts +53 -0
  190. package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
  191. package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
  192. package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +1 -0
  193. package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -1
  194. package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +1 -0
  195. package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
  196. package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
  197. package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
  198. package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
  199. package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
  200. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  201. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  202. package/build/dist/Models/DatabaseModels/LogDropFilter.js +91 -0
  203. package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
  204. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +14 -4
  205. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  206. package/build/dist/Models/DatabaseModels/RecommendationDismissal.js +484 -0
  207. package/build/dist/Models/DatabaseModels/RecommendationDismissal.js.map +1 -0
  208. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
  209. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
  210. package/build/dist/Models/DatabaseModels/StatusPageGroup.js +94 -0
  211. package/build/dist/Models/DatabaseModels/StatusPageGroup.js.map +1 -1
  212. package/build/dist/Models/DatabaseModels/TableView.js +40 -0
  213. package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
  214. package/build/dist/Models/DatabaseModels/TraceDropFilter.js +91 -0
  215. package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
  216. package/build/dist/Models/DatabaseModels/WorkflowVariable.js +5 -1
  217. package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
  218. package/build/dist/Server/API/AlertAPI.js +22 -13
  219. package/build/dist/Server/API/AlertAPI.js.map +1 -1
  220. package/build/dist/Server/API/BaseAPI.js +22 -1
  221. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  222. package/build/dist/Server/API/BaseAnalyticsAPI.js +24 -1
  223. package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
  224. package/build/dist/Server/API/CommonAPI.js +42 -0
  225. package/build/dist/Server/API/CommonAPI.js.map +1 -1
  226. package/build/dist/Server/API/IncidentAPI.js +43 -26
  227. package/build/dist/Server/API/IncidentAPI.js.map +1 -1
  228. package/build/dist/Server/API/IncidentEpisodeAPI.js +21 -12
  229. package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
  230. package/build/dist/Server/API/MonitorAPI.js +23 -0
  231. package/build/dist/Server/API/MonitorAPI.js.map +1 -1
  232. package/build/dist/Server/API/MonitorTemplateAPI.js +4 -0
  233. package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -1
  234. package/build/dist/Server/API/ProbeAPI.js +131 -15
  235. package/build/dist/Server/API/ProbeAPI.js.map +1 -1
  236. package/build/dist/Server/API/ProjectAPI.js +62 -3
  237. package/build/dist/Server/API/ProjectAPI.js.map +1 -1
  238. package/build/dist/Server/API/ScheduledMaintenanceAPI.js +23 -14
  239. package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
  240. package/build/dist/Server/API/StatusPageAPI.js +61 -33
  241. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  242. package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js +26 -2
  243. package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js.map +1 -1
  244. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js +12 -0
  245. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
  246. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js +397 -0
  247. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js.map +1 -0
  248. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js +16 -0
  249. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js.map +1 -0
  250. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js +30 -0
  251. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js.map +1 -0
  252. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js +34 -0
  253. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js.map +1 -0
  254. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +10 -0
  255. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  256. package/build/dist/Server/Services/AlertEpisodeService.js +39 -0
  257. package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
  258. package/build/dist/Server/Services/AlertService.js +95 -0
  259. package/build/dist/Server/Services/AlertService.js.map +1 -1
  260. package/build/dist/Server/Services/BillingService.js +71 -0
  261. package/build/dist/Server/Services/BillingService.js.map +1 -1
  262. package/build/dist/Server/Services/DatabaseService.js +140 -17
  263. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  264. package/build/dist/Server/Services/IncidentEpisodeService.js +39 -0
  265. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  266. package/build/dist/Server/Services/IncidentService.js +100 -0
  267. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  268. package/build/dist/Server/Services/IncidentTemplateService.js +97 -0
  269. package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
  270. package/build/dist/Server/Services/Index.js +2 -0
  271. package/build/dist/Server/Services/Index.js.map +1 -1
  272. package/build/dist/Server/Services/LogDropFilterService.js +93 -0
  273. package/build/dist/Server/Services/LogDropFilterService.js.map +1 -1
  274. package/build/dist/Server/Services/MonitorProbeService.js +73 -5
  275. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  276. package/build/dist/Server/Services/MonitorService.js +34 -39
  277. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  278. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +71 -0
  279. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
  280. package/build/dist/Server/Services/ProbeService.js +64 -0
  281. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  282. package/build/dist/Server/Services/ProjectService.js +103 -7
  283. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  284. package/build/dist/Server/Services/RecommendationDismissalService.js +50 -0
  285. package/build/dist/Server/Services/RecommendationDismissalService.js.map +1 -0
  286. package/build/dist/Server/Services/RunbookAgentJobService.js +63 -5
  287. package/build/dist/Server/Services/RunbookAgentJobService.js.map +1 -1
  288. package/build/dist/Server/Services/ScheduledMaintenanceService.js +83 -0
  289. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  290. package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js +65 -0
  291. package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js.map +1 -1
  292. package/build/dist/Server/Services/StatusPageGroupService.js +136 -0
  293. package/build/dist/Server/Services/StatusPageGroupService.js.map +1 -1
  294. package/build/dist/Server/Services/TraceDropFilterService.js +93 -0
  295. package/build/dist/Server/Services/TraceDropFilterService.js.map +1 -1
  296. package/build/dist/Server/Types/Workflow/Components/API/Delete.js +11 -0
  297. package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
  298. package/build/dist/Server/Types/Workflow/Components/API/Get.js +11 -0
  299. package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
  300. package/build/dist/Server/Types/Workflow/Components/API/Patch.js +11 -0
  301. package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
  302. package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -0
  303. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  304. package/build/dist/Server/Types/Workflow/Components/API/Put.js +12 -0
  305. package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
  306. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +132 -0
  307. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -0
  308. package/build/dist/Server/Utils/DropFilterValidation.js +80 -0
  309. package/build/dist/Server/Utils/DropFilterValidation.js.map +1 -0
  310. package/build/dist/Server/Utils/Errors.js +3 -0
  311. package/build/dist/Server/Utils/Errors.js.map +1 -1
  312. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +30 -12
  313. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  314. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +38 -18
  315. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  316. package/build/dist/Server/Utils/Telemetry/AppMetrics.js +26 -0
  317. package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
  318. package/build/dist/Types/Date.js +14 -4
  319. package/build/dist/Types/Date.js.map +1 -1
  320. package/build/dist/Types/JSONFunctions.js +8 -3
  321. package/build/dist/Types/JSONFunctions.js.map +1 -1
  322. package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -1
  323. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +192 -0
  324. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  325. package/build/dist/Types/Monitor/MonitorStep.js +6 -1
  326. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  327. package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js +32 -1
  328. package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js.map +1 -1
  329. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +294 -0
  330. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -0
  331. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +110 -0
  332. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -0
  333. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +58 -0
  334. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -0
  335. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +451 -0
  336. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -0
  337. package/build/dist/Types/Permission.js +40 -0
  338. package/build/dist/Types/Permission.js.map +1 -1
  339. package/build/dist/Types/Recommendation/RecommendationType.js +21 -0
  340. package/build/dist/Types/Recommendation/RecommendationType.js.map +1 -0
  341. package/build/dist/Types/Runbook/RunbookExecutionDeadline.js +93 -0
  342. package/build/dist/Types/Runbook/RunbookExecutionDeadline.js.map +1 -0
  343. package/build/dist/Types/Runbook/RunbookStepTimeout.js +142 -0
  344. package/build/dist/Types/Runbook/RunbookStepTimeout.js.map +1 -0
  345. package/build/dist/Types/Telemetry/DropFilterSampling.js +75 -0
  346. package/build/dist/Types/Telemetry/DropFilterSampling.js.map +1 -0
  347. package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -2
  348. package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
  349. package/build/dist/UI/Components/Accordion/Accordion.js +9 -2
  350. package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
  351. package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +1 -1
  352. package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
  353. package/build/dist/UI/Components/CodeEditor/CodeEditor.js +27 -14
  354. package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
  355. package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js +1 -1
  356. package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js.map +1 -1
  357. package/build/dist/UI/Components/EditionLabel/EditionLabel.js +2 -20
  358. package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
  359. package/build/dist/UI/Components/Error/PageError.js +1 -3
  360. package/build/dist/UI/Components/Error/PageError.js.map +1 -1
  361. package/build/dist/UI/Components/ErrorBoundary.js +145 -11
  362. package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
  363. package/build/dist/UI/Components/InfoCard/InfoCard.js +28 -1
  364. package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
  365. package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +13 -2
  366. package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
  367. package/build/dist/UI/Components/MasterPage/MasterPage.js +50 -1
  368. package/build/dist/UI/Components/MasterPage/MasterPage.js.map +1 -1
  369. package/build/dist/UI/Components/Modal/Modal.js +4 -32
  370. package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
  371. package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
  372. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +308 -40
  373. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  374. package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +230 -0
  375. package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
  376. package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
  377. package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
  378. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
  379. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
  380. package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
  381. package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
  382. package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
  383. package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
  384. package/build/dist/UI/Components/Runbook/StepTimeoutInput.js +101 -0
  385. package/build/dist/UI/Components/Runbook/StepTimeoutInput.js.map +1 -0
  386. package/build/dist/UI/Components/SideMenu/SideMenu.js +15 -5
  387. package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
  388. package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js +73 -0
  389. package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
  390. package/build/dist/UI/Components/Table/Table.js +15 -2
  391. package/build/dist/UI/Components/Table/Table.js.map +1 -1
  392. package/build/dist/UI/Components/Table/TableRow.js +11 -6
  393. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  394. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +13 -2
  395. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
  396. package/build/dist/UI/Utils/DropdownAlignment.js +98 -0
  397. package/build/dist/UI/Utils/DropdownAlignment.js.map +1 -0
  398. package/build/dist/UI/Utils/TableFilterUrlState.js +48 -15
  399. package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
  400. package/build/dist/Utils/API.js +39 -2
  401. package/build/dist/Utils/API.js.map +1 -1
  402. package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js +97 -0
  403. package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js.map +1 -0
  404. package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +330 -0
  405. package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -0
  406. package/build/dist/Utils/StatusPage/GroupNestingLayout.js +280 -0
  407. package/build/dist/Utils/StatusPage/GroupNestingLayout.js.map +1 -0
  408. package/build/dist/Utils/StatusPage/GroupTree.js +214 -0
  409. package/build/dist/Utils/StatusPage/GroupTree.js.map +1 -0
  410. package/build/dist/Utils/StatusPage/ResourceUptime.js +60 -16
  411. package/build/dist/Utils/StatusPage/ResourceUptime.js.map +1 -1
  412. package/build/dist/Utils/UserPreferences.js +33 -0
  413. package/build/dist/Utils/UserPreferences.js.map +1 -1
  414. package/package.json +1 -1
@@ -0,0 +1,451 @@
1
+ import MonitorSteps from "../MonitorSteps";
2
+ import MonitorRecommendationSeverityMapper from "./MonitorRecommendationSeverityMapper";
3
+ import { MonitorRecommendationNotificationMode, } from "./MonitorRecommendationTypes";
4
+ export default class MonitorRecommendationUtil {
5
+ /*
6
+ * Deterministic monitor name for a recommendation applied to a resource.
7
+ *
8
+ * Used both as the created monitor's name and as the `monitorName` arg the
9
+ * template modules interpolate into their incident/alert titles.
10
+ */
11
+ static getMonitorName(data) {
12
+ const resourceName = data.resourceDisplayName.trim();
13
+ if (!resourceName) {
14
+ return data.recommendation.name;
15
+ }
16
+ return `${resourceName} - ${data.recommendation.name}`;
17
+ }
18
+ /*
19
+ * Push the user's chosen on-call policies, owners, labels, severities and
20
+ * incident-vs-alert choice into every criteria instance in a step.
21
+ *
22
+ * This is the whole reason the create form asks for on-call policies: every
23
+ * shipped template hardcodes `onCallPolicyIds: []`, so a template-created
24
+ * monitor would open incidents that page nobody. Templates are the source
25
+ * of the thresholds; this is the source of "who hears about it, how loudly,
26
+ * and through which record".
27
+ *
28
+ * `severity` is the RECOMMENDATION's severity (`Critical` / `Warning`), not
29
+ * a project severity. It selects which project severity to write, via the
30
+ * caller's mapping — see `MonitorRecommendationSeverityMapper`.
31
+ *
32
+ * Mutates and returns the step (the step was just built by the template and
33
+ * is not shared with anything else).
34
+ */
35
+ static applyNotificationSettingsToMonitorStep(data) {
36
+ var _a, _b, _c;
37
+ const settings = data.notificationSettings;
38
+ const incidentSeverityId = MonitorRecommendationSeverityMapper.resolveSeverityId({
39
+ severity: data.severity,
40
+ severityMap: settings.incidentSeverityIdBySeverity,
41
+ });
42
+ const alertSeverityId = MonitorRecommendationSeverityMapper.resolveSeverityId({
43
+ severity: data.severity,
44
+ severityMap: settings.alertSeverityIdBySeverity,
45
+ });
46
+ const criteriaInstances = ((_c = (_b = (_a = data.monitorStep.data) === null || _a === void 0 ? void 0 : _a.monitorCriteria) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.monitorCriteriaInstanceArray) || [];
47
+ for (const criteriaInstance of criteriaInstances) {
48
+ if (!criteriaInstance.data) {
49
+ continue;
50
+ }
51
+ for (const incident of criteriaInstance.data.incidents || []) {
52
+ this.applyToCriteriaIncident(incident, settings, incidentSeverityId);
53
+ }
54
+ for (const alert of criteriaInstance.data.alerts || []) {
55
+ this.applyToCriteriaAlert(alert, settings, alertSeverityId);
56
+ }
57
+ this.applyNotificationModeToCriteriaInstance(criteriaInstance, settings.notificationMode);
58
+ }
59
+ return data.monitorStep;
60
+ }
61
+ /*
62
+ * Turn the user's Alert / Incident / Both choice into the two flags the
63
+ * monitor evaluator actually reads (`MonitorIncident.ts` and
64
+ * `MonitorAlert.ts` both early-return unless the flag is true).
65
+ *
66
+ * Two things this deliberately does NOT do:
67
+ *
68
+ * 1. It never flips a flag on a criteria instance whose corresponding
69
+ * array is empty. Every template ships a "Healthy" recovery criteria
70
+ * with `incidents: []` and `createIncidents: false`; setting the flag
71
+ * there would mark it as incident-creating, which the auto-resolve path
72
+ * reads as "this criteria contributes breaches" and would stop
73
+ * recovered monitors from resolving their own incidents.
74
+ *
75
+ * 2. It never empties the arrays of the mode that was NOT chosen. The
76
+ * config stays on the monitor, inert, exactly like the monitor criteria
77
+ * form's own toggles behave — so a user who later decides they do want
78
+ * incidents flips one switch on the monitor instead of re-authoring the
79
+ * incident title, description and severity.
80
+ */
81
+ static applyNotificationModeToCriteriaInstance(criteriaInstance, notificationMode) {
82
+ if (!notificationMode || !criteriaInstance.data) {
83
+ return;
84
+ }
85
+ const shouldCreateIncidents = notificationMode === MonitorRecommendationNotificationMode.Incident ||
86
+ notificationMode === MonitorRecommendationNotificationMode.Both;
87
+ const shouldCreateAlerts = notificationMode === MonitorRecommendationNotificationMode.Alert ||
88
+ notificationMode === MonitorRecommendationNotificationMode.Both;
89
+ if ((criteriaInstance.data.incidents || []).length > 0) {
90
+ criteriaInstance.data.createIncidents = shouldCreateIncidents;
91
+ }
92
+ if ((criteriaInstance.data.alerts || []).length > 0) {
93
+ criteriaInstance.data.createAlerts = shouldCreateAlerts;
94
+ }
95
+ }
96
+ static applyToCriteriaIncident(incident, settings, incidentSeverityId) {
97
+ if (settings.onCallPolicyIds && settings.onCallPolicyIds.length > 0) {
98
+ incident.onCallPolicyIds = [...settings.onCallPolicyIds];
99
+ }
100
+ if (settings.labelIds && settings.labelIds.length > 0) {
101
+ incident.labelIds = [...settings.labelIds];
102
+ }
103
+ if (settings.ownerTeamIds && settings.ownerTeamIds.length > 0) {
104
+ incident.ownerTeamIds = [...settings.ownerTeamIds];
105
+ }
106
+ if (settings.ownerUserIds && settings.ownerUserIds.length > 0) {
107
+ incident.ownerUserIds = [...settings.ownerUserIds];
108
+ }
109
+ if (incidentSeverityId) {
110
+ incident.incidentSeverityId = incidentSeverityId;
111
+ }
112
+ }
113
+ static applyToCriteriaAlert(alert, settings, alertSeverityId) {
114
+ if (settings.onCallPolicyIds && settings.onCallPolicyIds.length > 0) {
115
+ alert.onCallPolicyIds = [...settings.onCallPolicyIds];
116
+ }
117
+ if (settings.labelIds && settings.labelIds.length > 0) {
118
+ alert.labelIds = [...settings.labelIds];
119
+ }
120
+ if (settings.ownerTeamIds && settings.ownerTeamIds.length > 0) {
121
+ alert.ownerTeamIds = [...settings.ownerTeamIds];
122
+ }
123
+ if (settings.ownerUserIds && settings.ownerUserIds.length > 0) {
124
+ alert.ownerUserIds = [...settings.ownerUserIds];
125
+ }
126
+ if (alertSeverityId) {
127
+ alert.alertSeverityId = alertSeverityId;
128
+ }
129
+ }
130
+ /*
131
+ * Build the complete `MonitorSteps` for one recommendation, ready to hang
132
+ * off a `Monitor` and POST.
133
+ *
134
+ * `defaultMonitorStatusId` is separate from the online/offline ids in
135
+ * `args` because `MonitorSteps.getValidationError` requires it and the
136
+ * template modules never set it — they only produce the inner step.
137
+ */
138
+ static buildMonitorSteps(data) {
139
+ const monitorStep = data.recommendation.getMonitorStep(data.args);
140
+ if (data.notificationSettings) {
141
+ this.applyNotificationSettingsToMonitorStep({
142
+ monitorStep: monitorStep,
143
+ notificationSettings: data.notificationSettings,
144
+ severity: data.recommendation.severity,
145
+ });
146
+ }
147
+ const monitorSteps = new MonitorSteps();
148
+ monitorSteps.data = {
149
+ monitorStepsInstanceArray: [monitorStep],
150
+ defaultMonitorStatusId: data.defaultMonitorStatusId,
151
+ };
152
+ return monitorSteps;
153
+ }
154
+ /*
155
+ * Reduce a monitor step to what it watches. Returns undefined for steps that
156
+ * carry no infrastructure config (an HTTP monitor step, say) — those can
157
+ * never match a recommendation.
158
+ *
159
+ * See `MonitorRecommendationFingerprint` for why each component is here.
160
+ */
161
+ static getFingerprintFromMonitorStep(monitorStep) {
162
+ var _a, _b, _c;
163
+ const configKind = this.getInfrastructureConfigKind(monitorStep);
164
+ if (!configKind) {
165
+ return undefined;
166
+ }
167
+ const config = monitorStep.data[configKind];
168
+ const resourceIdentifier = config.clusterIdentifier ||
169
+ config.hostIdentifier ||
170
+ config.fleetIdentifier ||
171
+ "";
172
+ const metricNames = [];
173
+ const metricAliases = [];
174
+ const queryAttributes = [];
175
+ const formulas = [];
176
+ for (const queryConfig of ((_a = config.metricViewConfig) === null || _a === void 0 ? void 0 : _a.queryConfigs) || []) {
177
+ const metricName = this.getMetricNameFromQueryConfig(queryConfig);
178
+ if (metricName) {
179
+ metricNames.push(metricName);
180
+ }
181
+ const metricAlias = (_b = queryConfig.metricAliasData) === null || _b === void 0 ? void 0 : _b.metricVariable;
182
+ if (metricAlias) {
183
+ metricAliases.push(metricAlias);
184
+ }
185
+ queryAttributes.push(this.getQueryAttributeKey(queryConfig));
186
+ }
187
+ for (const formulaConfig of ((_c = config.metricViewConfig) === null || _c === void 0 ? void 0 : _c.formulaConfigs) || []) {
188
+ const formula = this.getFormulaFromFormulaConfig(formulaConfig);
189
+ if (formula) {
190
+ formulas.push(formula);
191
+ }
192
+ }
193
+ return {
194
+ resourceIdentifier: resourceIdentifier,
195
+ configKind: configKind,
196
+ /*
197
+ * Every list is sorted so that declaration order inside a template is
198
+ * not part of the identity — a template author reordering two queries
199
+ * must not orphan every monitor already created from it.
200
+ */
201
+ metricNames: metricNames.sort(),
202
+ formulas: formulas.sort(),
203
+ metricAliases: metricAliases.sort(),
204
+ queryAttributes: queryAttributes.sort(),
205
+ criteriaFilters: this.getCriteriaFilterKeys(monitorStep).sort(),
206
+ };
207
+ }
208
+ /*
209
+ * Which infrastructure config the step carries, as the property name.
210
+ *
211
+ * Returned instead of the config object itself because the NAME is part of
212
+ * the fingerprint: Docker, Docker Swarm and Podman ship structurally
213
+ * identical metric configs, so a Docker monitor and a Podman monitor
214
+ * watching container CPU are indistinguishable by contents alone.
215
+ */
216
+ static getInfrastructureConfigKind(monitorStep) {
217
+ if (!monitorStep.data) {
218
+ return undefined;
219
+ }
220
+ const kinds = [
221
+ "kubernetesMonitor",
222
+ "hostMonitor",
223
+ "dockerMonitor",
224
+ "dockerSwarmMonitor",
225
+ "podmanMonitor",
226
+ "proxmoxMonitor",
227
+ "cephMonitor",
228
+ "iotMonitor",
229
+ ];
230
+ const data = monitorStep.data;
231
+ return kinds.find((kind) => {
232
+ return Boolean(data[kind]);
233
+ });
234
+ }
235
+ /*
236
+ * The attribute filter on one query, as a stable string.
237
+ *
238
+ * Keys are sorted before serializing: `{ name: "X", severity: "Y" }` and
239
+ * `{ severity: "Y", name: "X" }` describe the same query, and JSON.stringify
240
+ * alone would call them different.
241
+ */
242
+ static getQueryAttributeKey(queryConfig) {
243
+ var _a, _b;
244
+ const attributes = (_b = (_a = queryConfig.metricQueryData) === null || _a === void 0 ? void 0 : _a.filterData) === null || _b === void 0 ? void 0 : _b["attributes"];
245
+ if (!attributes || typeof attributes !== "object") {
246
+ return "";
247
+ }
248
+ const record = attributes;
249
+ return Object.keys(record)
250
+ .sort()
251
+ .map((key) => {
252
+ return `${key}=${String(record[key])}`;
253
+ })
254
+ .join(",");
255
+ }
256
+ /*
257
+ * Every threshold the step evaluates, as stable strings.
258
+ *
259
+ * Covers all criteria instances, healthy and unhealthy alike: the recovery
260
+ * criteria's own threshold is equally part of what the step watches, and two
261
+ * templates that differ only in their recovery bound are still two different
262
+ * monitors.
263
+ *
264
+ * `metricAlias` is included because a multi-query step's filters are only
265
+ * meaningful against the series they name.
266
+ */
267
+ static getCriteriaFilterKeys(monitorStep) {
268
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
269
+ const keys = [];
270
+ const criteriaInstances = ((_c = (_b = (_a = monitorStep.data) === null || _a === void 0 ? void 0 : _a.monitorCriteria) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.monitorCriteriaInstanceArray) ||
271
+ [];
272
+ for (const criteriaInstance of criteriaInstances) {
273
+ for (const filter of ((_d = criteriaInstance.data) === null || _d === void 0 ? void 0 : _d.filters) || []) {
274
+ keys.push([
275
+ String((_e = filter.checkOn) !== null && _e !== void 0 ? _e : ""),
276
+ String((_f = filter.filterType) !== null && _f !== void 0 ? _f : ""),
277
+ String((_g = filter.value) !== null && _g !== void 0 ? _g : ""),
278
+ String((_j = (_h = filter.metricMonitorOptions) === null || _h === void 0 ? void 0 : _h.metricAlias) !== null && _j !== void 0 ? _j : ""),
279
+ ].join("|"));
280
+ }
281
+ }
282
+ return keys;
283
+ }
284
+ static getMetricNameFromQueryConfig(queryConfig) {
285
+ var _a, _b;
286
+ const metricName = (_b = (_a = queryConfig.metricQueryData) === null || _a === void 0 ? void 0 : _a.filterData) === null || _b === void 0 ? void 0 : _b["metricName"];
287
+ if (typeof metricName === "string" && metricName) {
288
+ return metricName;
289
+ }
290
+ return undefined;
291
+ }
292
+ static getFormulaFromFormulaConfig(formulaConfig) {
293
+ var _a;
294
+ const formula = (_a = formulaConfig.metricFormulaData) === null || _a === void 0 ? void 0 : _a.metricFormula;
295
+ if (typeof formula === "string" && formula) {
296
+ return formula;
297
+ }
298
+ return undefined;
299
+ }
300
+ /*
301
+ * A positional array rather than the object, so the serialization is stable
302
+ * regardless of the order the fields were written in. Every component of
303
+ * `MonitorRecommendationFingerprint` must appear here — a field added to the
304
+ * interface but forgotten below is invisible: the type checker is satisfied
305
+ * and the fingerprint silently keeps ignoring it, which is exactly the class
306
+ * of bug the interface's own comment describes.
307
+ */
308
+ static serializeFingerprint(fingerprint) {
309
+ return JSON.stringify([
310
+ fingerprint.resourceIdentifier,
311
+ fingerprint.configKind,
312
+ fingerprint.metricNames,
313
+ fingerprint.formulas,
314
+ fingerprint.metricAliases,
315
+ fingerprint.queryAttributes,
316
+ fingerprint.criteriaFilters,
317
+ ]);
318
+ }
319
+ static areFingerprintsEqual(a, b) {
320
+ if (!a || !b) {
321
+ return false;
322
+ }
323
+ return this.serializeFingerprint(a) === this.serializeFingerprint(b);
324
+ }
325
+ /*
326
+ * Which recommendations are already covered by monitors that exist.
327
+ *
328
+ * `existingMonitorSteps` is every step of every monitor already attached to
329
+ * this resource. A recommendation counts as covered when its freshly-built
330
+ * step fingerprints identically to one of them — i.e. same resource, same
331
+ * metrics, same formulas.
332
+ *
333
+ * `args` must use the same resource identifier the existing monitors were
334
+ * created with, otherwise nothing will ever match.
335
+ */
336
+ static getCoveredRecommendationIds(data) {
337
+ const existingFingerprints = new Set();
338
+ for (const monitorStep of data.existingMonitorSteps) {
339
+ const fingerprint = this.getFingerprintFromMonitorStep(monitorStep);
340
+ if (fingerprint) {
341
+ existingFingerprints.add(this.serializeFingerprint(fingerprint));
342
+ }
343
+ }
344
+ const covered = new Set();
345
+ if (existingFingerprints.size === 0) {
346
+ return covered;
347
+ }
348
+ for (const recommendation of data.recommendations) {
349
+ const fingerprint = this.getSerializedFingerprintForRecommendation({
350
+ recommendation: recommendation,
351
+ args: data.args,
352
+ });
353
+ if (fingerprint && existingFingerprints.has(fingerprint)) {
354
+ covered.add(recommendation.recommendationId);
355
+ }
356
+ }
357
+ return covered;
358
+ }
359
+ /*
360
+ * Same diff as `getCoveredRecommendationIds`, but keeps WHICH monitor
361
+ * covers each recommendation instead of only that one does.
362
+ *
363
+ * The set-only version is enough to grey a card out, and that is all the
364
+ * page could do with it: a user looking at "Already created" had no way to
365
+ * get from the card to the monitor to check its thresholds, its on-call
366
+ * policy, or whether it is even enabled. Returning the id lets the card link
367
+ * there.
368
+ *
369
+ * When several monitors fingerprint identically — which happens when someone
370
+ * creates the same recommendation twice by hand — the FIRST is kept, matching
371
+ * the order the caller passed them in (the API sorts monitors, so this is
372
+ * stable across loads rather than whichever row Postgres returned first).
373
+ */
374
+ static getCoveredRecommendationMonitorIds(data) {
375
+ const monitorIdByFingerprint = new Map();
376
+ for (const existingMonitor of data.existingMonitors) {
377
+ for (const monitorStep of existingMonitor.monitorSteps) {
378
+ const fingerprint = this.getFingerprintFromMonitorStep(monitorStep);
379
+ if (!fingerprint) {
380
+ continue;
381
+ }
382
+ const serialized = this.serializeFingerprint(fingerprint);
383
+ if (!monitorIdByFingerprint.has(serialized)) {
384
+ monitorIdByFingerprint.set(serialized, existingMonitor.monitorId);
385
+ }
386
+ }
387
+ }
388
+ const covered = new Map();
389
+ if (monitorIdByFingerprint.size === 0) {
390
+ return covered;
391
+ }
392
+ for (const recommendation of data.recommendations) {
393
+ const fingerprint = this.getSerializedFingerprintForRecommendation({
394
+ recommendation: recommendation,
395
+ args: data.args,
396
+ });
397
+ if (!fingerprint) {
398
+ continue;
399
+ }
400
+ const monitorId = monitorIdByFingerprint.get(fingerprint);
401
+ if (monitorId) {
402
+ covered.set(recommendation.recommendationId, monitorId);
403
+ }
404
+ }
405
+ return covered;
406
+ }
407
+ /*
408
+ * Build a recommendation's step exactly as the create flow would, and reduce
409
+ * it to its serialized fingerprint.
410
+ *
411
+ * The `monitorName` recomputation matters: templates interpolate the monitor
412
+ * name into incident titles, and while the name is not part of the
413
+ * fingerprint, building the step with a different name than the create flow
414
+ * uses would be an easy way for the two paths to drift apart later.
415
+ */
416
+ static getSerializedFingerprintForRecommendation(data) {
417
+ const fingerprint = this.getFingerprintFromMonitorStep(data.recommendation.getMonitorStep(Object.assign(Object.assign({}, data.args), { monitorName: this.getMonitorName({
418
+ recommendation: data.recommendation,
419
+ resourceDisplayName: data.args.monitorName,
420
+ }) })));
421
+ if (!fingerprint) {
422
+ return undefined;
423
+ }
424
+ return this.serializeFingerprint(fingerprint);
425
+ }
426
+ /*
427
+ * The recommendations worth showing first: not yet covered, Critical before
428
+ * Warning, otherwise the module's own declaration order (which puts the
429
+ * most important templates first).
430
+ */
431
+ static sortRecommendations(data) {
432
+ const indexOf = new Map();
433
+ data.recommendations.forEach((recommendation, index) => {
434
+ indexOf.set(recommendation.recommendationId, index);
435
+ });
436
+ return [...data.recommendations].sort((a, b) => {
437
+ var _a, _b;
438
+ const aCovered = data.coveredRecommendationIds.has(a.recommendationId);
439
+ const bCovered = data.coveredRecommendationIds.has(b.recommendationId);
440
+ if (aCovered !== bCovered) {
441
+ return aCovered ? 1 : -1;
442
+ }
443
+ if (a.severity !== b.severity) {
444
+ return a.severity === "Critical" ? -1 : 1;
445
+ }
446
+ return (((_a = indexOf.get(a.recommendationId)) !== null && _a !== void 0 ? _a : 0) -
447
+ ((_b = indexOf.get(b.recommendationId)) !== null && _b !== void 0 ? _b : 0));
448
+ });
449
+ }
450
+ }
451
+ //# sourceMappingURL=MonitorRecommendationUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonitorRecommendationUtil.js","sourceRoot":"","sources":["../../../../../Types/Monitor/Recommendation/MonitorRecommendationUtil.ts"],"names":[],"mappings":"AAKA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAI3C,OAAO,mCAAmC,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAGL,qCAAqC,GAGtC,MAAM,8BAA8B,CAAC;AA2EtC,MAAM,CAAC,OAAO,OAAO,yBAAyB;IAC5C;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAAC,IAG5B;QACC,MAAM,YAAY,GAAW,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;QAE7D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;QAClC,CAAC;QAED,OAAO,GAAG,YAAY,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;;;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CAAC,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,CACL,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,mCAAI,CAAC,CAAC;gBACtC,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,mCAAI,CAAC,CAAC,CACvC,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -962,6 +962,10 @@ var Permission;
962
962
  Permission["DeleteNetworkSiteType"] = "DeleteNetworkSiteType";
963
963
  Permission["EditNetworkSiteType"] = "EditNetworkSiteType";
964
964
  Permission["ReadNetworkSiteType"] = "ReadNetworkSiteType";
965
+ Permission["CreateRecommendationDismissal"] = "CreateRecommendationDismissal";
966
+ Permission["DeleteRecommendationDismissal"] = "DeleteRecommendationDismissal";
967
+ Permission["EditRecommendationDismissal"] = "EditRecommendationDismissal";
968
+ Permission["ReadRecommendationDismissal"] = "ReadRecommendationDismissal";
965
969
  Permission["CreateNetworkEndpoint"] = "CreateNetworkEndpoint";
966
970
  Permission["DeleteNetworkEndpoint"] = "DeleteNetworkEndpoint";
967
971
  Permission["EditNetworkEndpoint"] = "EditNetworkEndpoint";
@@ -6769,6 +6773,42 @@ export class PermissionHelper {
6769
6773
  isRolePermission: false,
6770
6774
  group: PermissionGroup.Monitor,
6771
6775
  },
6776
+ {
6777
+ permission: Permission.CreateRecommendationDismissal,
6778
+ title: "Create Recommendation Dismissal",
6779
+ description: "This permission can dismiss recommendations in this project.",
6780
+ isAssignableToTenant: true,
6781
+ isAccessControlPermission: false,
6782
+ isRolePermission: false,
6783
+ group: PermissionGroup.Monitor,
6784
+ },
6785
+ {
6786
+ permission: Permission.DeleteRecommendationDismissal,
6787
+ title: "Delete Recommendation Dismissal",
6788
+ description: "This permission can restore dismissed recommendations of this project.",
6789
+ isAssignableToTenant: true,
6790
+ isAccessControlPermission: true,
6791
+ isRolePermission: false,
6792
+ group: PermissionGroup.Monitor,
6793
+ },
6794
+ {
6795
+ permission: Permission.EditRecommendationDismissal,
6796
+ title: "Edit Recommendation Dismissal",
6797
+ description: "This permission can edit dismissed recommendations of this project.",
6798
+ isAssignableToTenant: true,
6799
+ isAccessControlPermission: true,
6800
+ isRolePermission: false,
6801
+ group: PermissionGroup.Monitor,
6802
+ },
6803
+ {
6804
+ permission: Permission.ReadRecommendationDismissal,
6805
+ title: "Read Recommendation Dismissal",
6806
+ description: "This permission can read dismissed recommendations of this project.",
6807
+ isAssignableToTenant: true,
6808
+ isAccessControlPermission: true,
6809
+ isRolePermission: false,
6810
+ group: PermissionGroup.Monitor,
6811
+ },
6772
6812
  {
6773
6813
  permission: Permission.CreateNetworkEndpoint,
6774
6814
  title: "Create Network Endpoint",