@oneuptime/common 12.0.22 → 12.0.24

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 (345) hide show
  1. package/Models/DatabaseModels/DetectionRule.ts +55 -0
  2. package/Models/DatabaseModels/Index.ts +2 -0
  3. package/Models/DatabaseModels/NetworkDevice.ts +44 -0
  4. package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +584 -0
  5. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +105 -0
  6. package/Models/DatabaseModels/Project.ts +68 -0
  7. package/Models/DatabaseModels/User.ts +68 -0
  8. package/Server/API/TelemetryAPI.ts +29 -0
  9. package/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddNetworkDeviceAutoImportRule.ts +60 -0
  10. package/Server/Infrastructure/Postgres/SchemaMigrations/1789200000000-AddSysObjectIdPatternToAutoImportRule.ts +26 -0
  11. package/Server/Infrastructure/Postgres/SchemaMigrations/1789300000000-AddAutoApplyVendorHealthTemplate.ts +26 -0
  12. package/Server/Infrastructure/Postgres/SchemaMigrations/1789400000000-AddNameToNetworkDeviceDiscoveryScan.ts +28 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/1789500000000-AddCampaignUtmFields.ts +49 -0
  14. package/Server/Infrastructure/Postgres/SchemaMigrations/1789512000000-AddDetectionRuleDistinctCountColumns.ts +33 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
  16. package/Server/Middleware/GzipRequestBody.ts +311 -0
  17. package/Server/Middleware/MultipartFormData.ts +87 -3
  18. package/Server/Services/DetectionRuleService.ts +73 -6
  19. package/Server/Services/Index.ts +207 -0
  20. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +917 -0
  21. package/Server/Services/NetworkDeviceAutoImportRuleService.ts +181 -0
  22. package/Server/Services/NetworkDeviceDiscoveryScanService.ts +59 -0
  23. package/Server/Services/NetworkDeviceService.ts +148 -0
  24. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +65 -0
  25. package/Server/Services/OnCallDutyPolicyFeedService.ts +1 -1
  26. package/Server/Services/ProjectService.ts +29 -19
  27. package/Server/Services/SecurityEventService.ts +90 -13
  28. package/Server/Services/StatusPageResourceService.ts +223 -0
  29. package/Server/Services/TelemetryAttributeService.ts +17 -0
  30. package/Server/Services/UserService.ts +4 -6
  31. package/Server/Types/Markdown.ts +161 -67
  32. package/Server/Utils/AI/Toolbox/OnCallTools.ts +12 -4
  33. package/Server/Utils/AnalyticsDatabase/Statement.ts +13 -1
  34. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +297 -6
  35. package/Server/Utils/Attribution.ts +4 -0
  36. package/Server/Utils/Marketing/MarketingEventUtil.ts +45 -7
  37. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +39 -1
  38. package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +55 -3
  39. package/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.ts +21 -0
  40. package/Server/Utils/StartServer.ts +12 -32
  41. package/Server/Utils/Telemetry/LlmCostBudgetEvaluator.ts +101 -4
  42. package/Server/Utils/Telemetry/LlmMetricSpend.ts +130 -0
  43. package/Server/Views/Partials/AnalyticsConsent.ejs +159 -102
  44. package/Server/Views/Partials/Head.ejs +2 -1
  45. package/Tests/App/Dashboard/AdminUserNotificationMethodsPage.test.tsx +776 -38
  46. package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +359 -0
  47. package/Tests/App/Dashboard/CorrelateGraph.test.tsx +865 -0
  48. package/Tests/App/Dashboard/CorrelationGraph.test.ts +346 -0
  49. package/Tests/App/Dashboard/CriteriaFilterConditionDropdown.test.tsx +256 -0
  50. package/Tests/App/Dashboard/CriteriaFilterDefaults.test.ts +738 -0
  51. package/Tests/App/Dashboard/CriteriaFilterMonitorTypeChange.test.ts +1122 -0
  52. package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +283 -0
  53. package/Tests/App/Dashboard/ExternalStatusPageCriteriaFilter.test.ts +407 -0
  54. package/Tests/App/Dashboard/MetricSeriesInvestigateMenu.test.tsx +5 -14
  55. package/Tests/App/Dashboard/MonitorCriteriaActionToggles.test.tsx +426 -0
  56. package/Tests/App/Dashboard/MonitorStepsCriteriaAlignmentWiring.test.tsx +352 -0
  57. package/Tests/App/Dashboard/OnCallLayerCardOverrides.test.tsx +278 -0
  58. package/Tests/App/Dashboard/OnCallLayerShiftPreviewOverrides.test.ts +237 -0
  59. package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +2 -2
  60. package/Tests/App/Dashboard/OnCallSchedulePreviewOverrides.test.tsx +460 -0
  61. package/Tests/App/Dashboard/SecurityEventAttributeUtil.test.ts +171 -0
  62. package/Tests/App/Dashboard/SecurityEventCorrelation.test.ts +857 -0
  63. package/Tests/App/Dashboard/SecurityEventDetailObservables.test.tsx +194 -0
  64. package/Tests/App/Dashboard/SecurityEventsDetectionRulesPage.test.tsx +124 -0
  65. package/Tests/App/Dashboard/SecurityEventsMonitorStepForm.test.tsx +79 -19
  66. package/Tests/App/Dashboard/SecurityEventsTableColumns.test.tsx +382 -0
  67. package/Tests/App/StatusPage/BulkAddStatusPageMonitors.test.ts +216 -0
  68. package/Tests/App/StatusPage/BulkAddStatusPageMonitorsModal.test.tsx +590 -11
  69. package/Tests/App/StatusPage/StatusPageResourceExplorer.test.tsx +757 -0
  70. package/Tests/Models/DiscoveryScanNameColumn.test.ts +293 -0
  71. package/Tests/Server/API/SecurityEventAttributesAPI.test.ts +564 -0
  72. package/Tests/Server/Infrastructure/Postgres/SchemaMigrationsOrdering.test.ts +120 -4
  73. package/Tests/Server/Middleware/GzipRequestBody.test.ts +725 -0
  74. package/Tests/Server/Middleware/MultipartFormData.test.ts +298 -0
  75. package/Tests/Server/Services/AddDetectionRuleDistinctCountColumnsMigration.test.ts +311 -0
  76. package/Tests/Server/Services/AutoImportScanCredentialSelect.test.ts +205 -0
  77. package/Tests/Server/Services/DetectionRuleService.test.ts +134 -2
  78. package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +7 -1
  79. package/Tests/Server/Services/FeedRetentionConsistency.test.ts +131 -0
  80. package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +933 -0
  81. package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +194 -0
  82. package/Tests/Server/Services/NetworkDeviceMonitorStatusStamp.test.ts +800 -0
  83. package/Tests/Server/Services/OnCallScheduleAttachRosterRefresh.test.ts +244 -0
  84. package/Tests/Server/Services/SecurityEventService.test.ts +376 -0
  85. package/Tests/Server/Services/StatusPageResourceDuplicates.test.ts +703 -0
  86. package/Tests/Server/Services/TelemetryAttributeServiceSecurityEvent.test.ts +256 -0
  87. package/Tests/Server/Types/Workflow/Components/ComponentRegistryParity.test.ts +417 -0
  88. package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorWhereOperators.test.ts +677 -0
  89. package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +43 -0
  90. package/Tests/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.test.ts +15 -11
  91. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +97 -1
  92. package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +369 -8
  93. package/Tests/Server/Utils/SecurityEvent/SigmaClickhouseCompiler.test.ts +35 -0
  94. package/Tests/Server/Utils/Telemetry/LlmCostBudgetEvaluator.test.ts +368 -4
  95. package/Tests/Server/Utils/Telemetry/LlmMetricSpend.test.ts +245 -0
  96. package/Tests/Server/Views/AnalyticsConsentPartial.test.ts +48 -5
  97. package/Tests/Types/Code/YamlSyntax.test.ts +396 -0
  98. package/Tests/Types/Monitor/MetricAndProfileDefaultCriteria.test.ts +957 -0
  99. package/Tests/Types/Monitor/MonitorCriteriaActionValidation.test.ts +598 -0
  100. package/Tests/Types/Monitor/MonitorCriteriaInstance.test.ts +49 -0
  101. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +6 -6
  102. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +4 -4
  103. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +4 -3
  104. package/Tests/Types/Telemetry/LlmMetricConventions.test.ts +193 -0
  105. package/Tests/UI/Components/AiInvestigationSettingsCard.test.tsx +0 -12
  106. package/Tests/UI/Components/CardModelDetailEdit.test.tsx +1 -17
  107. package/Tests/UI/Components/CodeEditor.test.tsx +474 -10
  108. package/Tests/UI/Components/Detail/YamlField.test.tsx +105 -0
  109. package/Tests/UI/Components/EntityDropdownLabelsBulkAdd.test.tsx +319 -0
  110. package/Tests/UI/Components/Forms/FormFieldYaml.test.tsx +231 -0
  111. package/Tests/UI/Components/Forms/Utils/FormFieldSchemaTypeUtil.test.ts +1 -0
  112. package/Tests/UI/Components/Forms/ValidationYAML.test.ts +234 -0
  113. package/Tests/UI/Components/ModelTable/AttributeColumns.test.tsx +573 -0
  114. package/Tests/UI/Components/ModelTable/BaseModelTableAttributeColumns.test.tsx +824 -0
  115. package/Tests/UI/Components/ModelTable/ColumnCustomizationModalAddableColumns.test.tsx +707 -0
  116. package/Tests/UI/Components/SideOver.test.tsx +1 -1
  117. package/Tests/UI/Components/StatusPage/ResourceGridSelection.test.tsx +294 -0
  118. package/Tests/UI/Components/StatusPage/ResourceListSelection.test.tsx +436 -0
  119. package/Tests/UI/Components/TableBulkCsvExport.test.tsx +6 -2
  120. package/Tests/UI/Components/Toggle.test.tsx +25 -0
  121. package/Tests/UI/Components/YamlEditor.test.tsx +847 -0
  122. package/Tests/Utils/NetworkDevice/DeviceReachabilityUtil.test.ts +252 -0
  123. package/Tests/Utils/NetworkDiscovery/AutoImportRuleMatcher.test.ts +516 -0
  124. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +272 -0
  125. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +221 -0
  126. package/Tests/Utils/NetworkDiscovery/ScanNameUtil.test.ts +312 -0
  127. package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +164 -0
  128. package/Tests/Utils/StatusPage/ResourceExplorer.test.ts +468 -0
  129. package/Tests/Utils/Telemetry/LlmMetricQuery.test.ts +472 -0
  130. package/Types/Code/YamlSyntax.ts +396 -0
  131. package/Types/Exception/ExceptionCode.ts +1 -0
  132. package/Types/Exception/PayloadTooLargeException.ts +8 -0
  133. package/Types/Marketing/Attribution.ts +10 -0
  134. package/Types/Marketing/MarketingEvent.ts +4 -0
  135. package/Types/Monitor/MonitorCriteriaInstance.ts +116 -56
  136. package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +2 -1
  137. package/Types/NetworkAutomation/RuleRunResult.ts +84 -0
  138. package/Types/Permission.ts +47 -0
  139. package/Types/SecurityEvent/DetectionFindingConstants.ts +11 -0
  140. package/Types/Telemetry/LlmMetricConventions.ts +124 -0
  141. package/UI/Components/AutocompleteTextInput/AutocompleteTextInput.tsx +3 -0
  142. package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +10 -1
  143. package/UI/Components/CodeEditor/CodeEditor.tsx +241 -79
  144. package/UI/Components/CodeEditor/YamlEditor.tsx +369 -0
  145. package/UI/Components/Detail/Detail.tsx +10 -0
  146. package/UI/Components/EntityDropdown/EntityDropdown.tsx +33 -0
  147. package/UI/Components/Forms/Fields/FormField.tsx +31 -0
  148. package/UI/Components/Forms/Types/Field.ts +8 -0
  149. package/UI/Components/Forms/Types/FormFieldSchemaType.ts +1 -0
  150. package/UI/Components/Forms/Utils/FormFieldSchemaTypeUtil.ts +2 -0
  151. package/UI/Components/Forms/Validation.ts +46 -0
  152. package/UI/Components/Input/Input.tsx +3 -0
  153. package/UI/Components/ModelTable/AttributeColumns.tsx +321 -0
  154. package/UI/Components/ModelTable/BaseModelTable.tsx +263 -14
  155. package/UI/Components/ModelTable/Column.ts +8 -0
  156. package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +310 -0
  157. package/UI/Components/ModelTable/ColumnPreference.ts +13 -1
  158. package/UI/Components/MonitorTemplateVariables/TemplateVariablesModal.tsx +2 -2
  159. package/UI/Components/SideOver/SideOver.tsx +5 -5
  160. package/UI/Components/StatusPage/ResourceGrid.tsx +82 -2
  161. package/UI/Components/StatusPage/ResourceList.tsx +197 -38
  162. package/UI/Components/Toggle/Toggle.tsx +9 -1
  163. package/UI/Components/Types/FieldType.ts +1 -0
  164. package/Utils/NetworkDevice/DeviceReachabilityUtil.ts +73 -1
  165. package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +257 -0
  166. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +183 -0
  167. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +95 -0
  168. package/Utils/NetworkDiscovery/DiscoveryImportEligibility.ts +66 -0
  169. package/Utils/NetworkDiscovery/ScanNameUtil.ts +181 -0
  170. package/Utils/NetworkDiscovery/ScanTargetUtil.ts +82 -0
  171. package/Utils/StatusPage/ResourceExplorer.ts +258 -0
  172. package/Utils/Telemetry/LlmMetricQuery.ts +204 -0
  173. package/build/dist/Models/DatabaseModels/DetectionRule.js +57 -0
  174. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
  175. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  176. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  177. package/build/dist/Models/DatabaseModels/NetworkDevice.js +45 -0
  178. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  179. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +609 -0
  180. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -0
  181. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +97 -0
  182. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  183. package/build/dist/Models/DatabaseModels/Project.js +76 -0
  184. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  185. package/build/dist/Models/DatabaseModels/User.js +76 -0
  186. package/build/dist/Models/DatabaseModels/User.js.map +1 -1
  187. package/build/dist/Server/API/TelemetryAPI.js +17 -0
  188. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  189. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddNetworkDeviceAutoImportRule.js +35 -0
  190. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddNetworkDeviceAutoImportRule.js.map +1 -0
  191. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789200000000-AddSysObjectIdPatternToAutoImportRule.js +19 -0
  192. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789200000000-AddSysObjectIdPatternToAutoImportRule.js.map +1 -0
  193. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789300000000-AddAutoApplyVendorHealthTemplate.js +19 -0
  194. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789300000000-AddAutoApplyVendorHealthTemplate.js.map +1 -0
  195. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789400000000-AddNameToNetworkDeviceDiscoveryScan.js +21 -0
  196. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789400000000-AddNameToNetworkDeviceDiscoveryScan.js.map +1 -0
  197. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789500000000-AddCampaignUtmFields.js +42 -0
  198. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789500000000-AddCampaignUtmFields.js.map +1 -0
  199. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789512000000-AddDetectionRuleDistinctCountColumns.js +22 -0
  200. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789512000000-AddDetectionRuleDistinctCountColumns.js.map +1 -0
  201. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +12 -0
  202. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  203. package/build/dist/Server/Middleware/GzipRequestBody.js +224 -0
  204. package/build/dist/Server/Middleware/GzipRequestBody.js.map +1 -0
  205. package/build/dist/Server/Middleware/MultipartFormData.js +71 -2
  206. package/build/dist/Server/Middleware/MultipartFormData.js.map +1 -1
  207. package/build/dist/Server/Services/DetectionRuleService.js +49 -4
  208. package/build/dist/Server/Services/DetectionRuleService.js.map +1 -1
  209. package/build/dist/Server/Services/Index.js +206 -0
  210. package/build/dist/Server/Services/Index.js.map +1 -1
  211. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +711 -0
  212. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -0
  213. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +155 -0
  214. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -0
  215. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +50 -0
  216. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
  217. package/build/dist/Server/Services/NetworkDeviceService.js +124 -0
  218. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  219. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +68 -13
  220. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  221. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +1 -1
  222. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
  223. package/build/dist/Server/Services/ProjectService.js +25 -45
  224. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  225. package/build/dist/Server/Services/SecurityEventService.js +57 -5
  226. package/build/dist/Server/Services/SecurityEventService.js.map +1 -1
  227. package/build/dist/Server/Services/StatusPageResourceService.js +140 -0
  228. package/build/dist/Server/Services/StatusPageResourceService.js.map +1 -1
  229. package/build/dist/Server/Services/TelemetryAttributeService.js +17 -0
  230. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  231. package/build/dist/Server/Services/UserService.js +2 -12
  232. package/build/dist/Server/Services/UserService.js.map +1 -1
  233. package/build/dist/Server/Types/Markdown.js +147 -61
  234. package/build/dist/Server/Types/Markdown.js.map +1 -1
  235. package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js +12 -4
  236. package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js.map +1 -1
  237. package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +12 -1
  238. package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
  239. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +246 -9
  240. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  241. package/build/dist/Server/Utils/Attribution.js.map +1 -1
  242. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js +27 -7
  243. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js.map +1 -1
  244. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +26 -0
  245. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  246. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +42 -7
  247. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -1
  248. package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js +18 -0
  249. package/build/dist/Server/Utils/SecurityEvent/Sigma/SigmaClickhouseCompiler.js.map +1 -1
  250. package/build/dist/Server/Utils/StartServer.js +12 -21
  251. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  252. package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js +76 -5
  253. package/build/dist/Server/Utils/Telemetry/LlmCostBudgetEvaluator.js.map +1 -1
  254. package/build/dist/Server/Utils/Telemetry/LlmMetricSpend.js +102 -0
  255. package/build/dist/Server/Utils/Telemetry/LlmMetricSpend.js.map +1 -0
  256. package/build/dist/Types/Code/YamlSyntax.js +212 -0
  257. package/build/dist/Types/Code/YamlSyntax.js.map +1 -0
  258. package/build/dist/Types/Exception/ExceptionCode.js +1 -0
  259. package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
  260. package/build/dist/Types/Exception/PayloadTooLargeException.js +8 -0
  261. package/build/dist/Types/Exception/PayloadTooLargeException.js.map +1 -0
  262. package/build/dist/Types/Marketing/Attribution.js +10 -0
  263. package/build/dist/Types/Marketing/Attribution.js.map +1 -1
  264. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +112 -51
  265. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
  266. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +2 -1
  267. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -1
  268. package/build/dist/Types/NetworkAutomation/RuleRunResult.js +24 -0
  269. package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
  270. package/build/dist/Types/Permission.js +41 -0
  271. package/build/dist/Types/Permission.js.map +1 -1
  272. package/build/dist/Types/SecurityEvent/DetectionFindingConstants.js +9 -0
  273. package/build/dist/Types/SecurityEvent/DetectionFindingConstants.js.map +1 -1
  274. package/build/dist/Types/Telemetry/LlmMetricConventions.js +98 -0
  275. package/build/dist/Types/Telemetry/LlmMetricConventions.js.map +1 -0
  276. package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js +1 -1
  277. package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js.map +1 -1
  278. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +5 -2
  279. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
  280. package/build/dist/UI/Components/CodeEditor/CodeEditor.js +206 -76
  281. package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
  282. package/build/dist/UI/Components/CodeEditor/YamlEditor.js +201 -0
  283. package/build/dist/UI/Components/CodeEditor/YamlEditor.js.map +1 -0
  284. package/build/dist/UI/Components/Detail/Detail.js +9 -0
  285. package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
  286. package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js +16 -1
  287. package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js.map +1 -1
  288. package/build/dist/UI/Components/Forms/Fields/FormField.js +14 -1
  289. package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
  290. package/build/dist/UI/Components/Forms/Types/Field.js.map +1 -1
  291. package/build/dist/UI/Components/Forms/Types/FormFieldSchemaType.js +1 -0
  292. package/build/dist/UI/Components/Forms/Types/FormFieldSchemaType.js.map +1 -1
  293. package/build/dist/UI/Components/Forms/Utils/FormFieldSchemaTypeUtil.js +2 -0
  294. package/build/dist/UI/Components/Forms/Utils/FormFieldSchemaTypeUtil.js.map +1 -1
  295. package/build/dist/UI/Components/Forms/Validation.js +27 -0
  296. package/build/dist/UI/Components/Forms/Validation.js.map +1 -1
  297. package/build/dist/UI/Components/Input/Input.js +1 -1
  298. package/build/dist/UI/Components/Input/Input.js.map +1 -1
  299. package/build/dist/UI/Components/ModelTable/AttributeColumns.js +159 -0
  300. package/build/dist/UI/Components/ModelTable/AttributeColumns.js.map +1 -0
  301. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +179 -17
  302. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  303. package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +133 -2
  304. package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -1
  305. package/build/dist/UI/Components/ModelTable/ColumnPreference.js +7 -1
  306. package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -1
  307. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesModal.js +2 -2
  308. package/build/dist/UI/Components/SideOver/SideOver.js +5 -5
  309. package/build/dist/UI/Components/StatusPage/ResourceGrid.js +28 -2
  310. package/build/dist/UI/Components/StatusPage/ResourceGrid.js.map +1 -1
  311. package/build/dist/UI/Components/StatusPage/ResourceList.js +87 -20
  312. package/build/dist/UI/Components/StatusPage/ResourceList.js.map +1 -1
  313. package/build/dist/UI/Components/Toggle/Toggle.js +9 -1
  314. package/build/dist/UI/Components/Toggle/Toggle.js.map +1 -1
  315. package/build/dist/UI/Components/Types/FieldType.js +1 -0
  316. package/build/dist/UI/Components/Types/FieldType.js.map +1 -1
  317. package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js +37 -1
  318. package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js.map +1 -1
  319. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js +149 -0
  320. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -0
  321. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +121 -0
  322. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -0
  323. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +75 -0
  324. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -0
  325. package/build/dist/Utils/NetworkDiscovery/DiscoveryImportEligibility.js +59 -0
  326. package/build/dist/Utils/NetworkDiscovery/DiscoveryImportEligibility.js.map +1 -0
  327. package/build/dist/Utils/NetworkDiscovery/ScanNameUtil.js +120 -0
  328. package/build/dist/Utils/NetworkDiscovery/ScanNameUtil.js.map +1 -0
  329. package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +60 -0
  330. package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -1
  331. package/build/dist/Utils/StatusPage/ResourceExplorer.js +171 -0
  332. package/build/dist/Utils/StatusPage/ResourceExplorer.js.map +1 -1
  333. package/build/dist/Utils/Telemetry/LlmMetricQuery.js +119 -0
  334. package/build/dist/Utils/Telemetry/LlmMetricQuery.js.map +1 -0
  335. package/jest.config.json +2 -0
  336. package/package.json +1 -1
  337. package/tsconfig.json +2 -1
  338. package/Tests/UI/Components/Toast.test.tsx +0 -197
  339. package/Tests/UI/Components/ToastStacking.test.tsx +0 -198
  340. package/UI/Components/Toast/Toast.tsx +0 -189
  341. package/UI/Components/Toast/ToastInit.tsx +0 -110
  342. package/build/dist/UI/Components/Toast/Toast.js +0 -123
  343. package/build/dist/UI/Components/Toast/Toast.js.map +0 -1
  344. package/build/dist/UI/Components/Toast/ToastInit.js +0 -53
  345. package/build/dist/UI/Components/Toast/ToastInit.js.map +0 -1
@@ -68,7 +68,14 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
68
68
  filters: [
69
69
  {
70
70
  checkOn: CheckOn.IsOnline,
71
- filterType: undefined,
71
+ /*
72
+ * Seed the condition too, matching
73
+ * getNewMonitorCriteriaInstanceAsJSON. A filter with no filter
74
+ * type shows an empty "Filter Condition" dropdown in the form
75
+ * and never matches anything at evaluation time, because every
76
+ * comparator in CompareCriteria switches on the filter type.
77
+ */
78
+ filterType: FilterType.True,
72
79
  value: undefined,
73
80
  },
74
81
  ],
@@ -83,6 +90,35 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
83
90
  };
84
91
  }
85
92
 
93
+ /*
94
+ * The monitor types whose criteria MonitorCriteriaEvaluator hands to
95
+ * MetricMonitorCriteria. That evaluator reads exactly one thing -
96
+ * CheckOn.MetricValue - so these types share a single pair of defaults:
97
+ * a metric that is reporting a value means online, a metric that has
98
+ * gone to zero means offline.
99
+ *
100
+ * Kept in step with the routing list in MonitorCriteriaEvaluator and
101
+ * with the check-on narrowing in the dashboard's CriteriaFilter util,
102
+ * which offers these types the metric value and nothing else. A type
103
+ * missing here falls through to `new MonitorCriteriaInstance()` and
104
+ * ships an unnamed criteria whose "Is Online" filter no evaluator on
105
+ * this path reads - a rule that can never fire and cannot be saved,
106
+ * since getValidationError requires a name and a description.
107
+ */
108
+ public static isMetricBackedMonitorType(monitorType: MonitorType): boolean {
109
+ return (
110
+ monitorType === MonitorType.Metrics ||
111
+ monitorType === MonitorType.Kubernetes ||
112
+ monitorType === MonitorType.Docker ||
113
+ monitorType === MonitorType.Host ||
114
+ monitorType === MonitorType.Podman ||
115
+ monitorType === MonitorType.DockerSwarm ||
116
+ monitorType === MonitorType.Proxmox ||
117
+ monitorType === MonitorType.Ceph ||
118
+ monitorType === MonitorType.IoTDevice
119
+ );
120
+ }
121
+
86
122
  public static getDefaultOnlineMonitorCriteriaInstance(arg: {
87
123
  monitorType: MonitorType;
88
124
  monitorStatusId: ObjectID;
@@ -232,7 +268,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
232
268
  return monitorCriteriaInstance;
233
269
  }
234
270
 
235
- if (arg.monitorType === MonitorType.Metrics) {
271
+ if (MonitorCriteriaInstance.isMetricBackedMonitorType(arg.monitorType)) {
236
272
  const monitorCriteriaInstance: MonitorCriteriaInstance =
237
273
  new MonitorCriteriaInstance();
238
274
 
@@ -254,7 +290,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
254
290
  ? arg.metricOptions.metricAliases[0]
255
291
  : undefined,
256
292
  },
257
- value: 0, // if there are some logs then monitor is online.
293
+ value: 0, // the metric is reporting above zero, so the monitor is online.
258
294
  },
259
295
  ],
260
296
  incidents: [],
@@ -269,7 +305,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
269
305
  return monitorCriteriaInstance;
270
306
  }
271
307
 
272
- if (arg.monitorType === MonitorType.Kubernetes) {
308
+ if (arg.monitorType === MonitorType.Profiles) {
273
309
  const monitorCriteriaInstance: MonitorCriteriaInstance =
274
310
  new MonitorCriteriaInstance();
275
311
 
@@ -279,19 +315,9 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
279
315
  filterCondition: FilterCondition.Any,
280
316
  filters: [
281
317
  {
282
- checkOn: CheckOn.MetricValue,
318
+ checkOn: CheckOn.ProfileCount,
283
319
  filterType: FilterType.GreaterThan,
284
-
285
- metricMonitorOptions: {
286
- metricAggregationType: EvaluateOverTimeType.AnyValue,
287
- metricAlias:
288
- arg.metricOptions &&
289
- arg.metricOptions.metricAliases &&
290
- arg.metricOptions.metricAliases.length > 0
291
- ? arg.metricOptions.metricAliases[0]
292
- : undefined,
293
- },
294
- value: 0,
320
+ value: 0, // if profiles are arriving then the monitor is online.
295
321
  },
296
322
  ],
297
323
  incidents: [],
@@ -1130,7 +1156,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
1130
1156
  };
1131
1157
  }
1132
1158
 
1133
- if (arg.monitorType === MonitorType.Metrics) {
1159
+ if (MonitorCriteriaInstance.isMetricBackedMonitorType(arg.monitorType)) {
1134
1160
  monitorCriteriaInstance.data = {
1135
1161
  id: ObjectID.generate().toString(),
1136
1162
  monitorStatusId: arg.monitorStatusId,
@@ -1148,7 +1174,15 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
1148
1174
  ? arg.metricOptions.metricAliases[0]
1149
1175
  : undefined,
1150
1176
  },
1151
- value: 0, // if there are no logs then the monitor is offline
1177
+ /*
1178
+ * A reported value of zero, not an absent one. When the window
1179
+ * holds no samples at all the evaluator honours
1180
+ * metricMonitorOptions.onNoDataPolicy, which defaults to
1181
+ * Ignore, so silence alone does not fire this - a user who
1182
+ * wants "stopped reporting" to page has to opt into
1183
+ * NoDataPolicy.Trigger or TreatAsZero on the filter.
1184
+ */
1185
+ value: 0,
1152
1186
  },
1153
1187
  ],
1154
1188
  incidents: [
@@ -1179,25 +1213,16 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
1179
1213
  };
1180
1214
  }
1181
1215
 
1182
- if (arg.monitorType === MonitorType.Kubernetes) {
1216
+ if (arg.monitorType === MonitorType.Profiles) {
1183
1217
  monitorCriteriaInstance.data = {
1184
1218
  id: ObjectID.generate().toString(),
1185
1219
  monitorStatusId: arg.monitorStatusId,
1186
1220
  filterCondition: FilterCondition.Any,
1187
1221
  filters: [
1188
1222
  {
1189
- checkOn: CheckOn.MetricValue,
1223
+ checkOn: CheckOn.ProfileCount,
1190
1224
  filterType: FilterType.EqualTo,
1191
- metricMonitorOptions: {
1192
- metricAggregationType: EvaluateOverTimeType.AnyValue,
1193
- metricAlias:
1194
- arg.metricOptions &&
1195
- arg.metricOptions.metricAliases &&
1196
- arg.metricOptions.metricAliases.length > 0
1197
- ? arg.metricOptions.metricAliases[0]
1198
- : undefined,
1199
- },
1200
- value: 0,
1225
+ value: 0, // if no profiles are arriving then the monitor is offline
1201
1226
  },
1202
1227
  ],
1203
1228
  incidents: [
@@ -1482,39 +1507,62 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
1482
1507
  return `Description is required for criteria "${value.data.name}"`;
1483
1508
  }
1484
1509
 
1485
- for (const incident of value.data.incidents) {
1486
- if (!incident) {
1487
- continue;
1488
- }
1489
-
1490
- if (!incident.title) {
1491
- return `Incident title is required for criteria "${value.data.name}"`;
1492
- }
1510
+ /*
1511
+ * Each "when filters match, ..." action is validated only while its own
1512
+ * switch is on.
1513
+ *
1514
+ * The criteria form keeps the incident / alert rows it seeded when a
1515
+ * switch was turned on, so that turning the switch back on restores what
1516
+ * was typed - the same retained-but-inert config that
1517
+ * MonitorStepsReferenceExtractor documents for project references. The
1518
+ * evaluator ignores those rows entirely while the flag is off
1519
+ * (MonitorIncident.criteriaMetCreateIncidentsAndUpdateMonitorStatus,
1520
+ * MonitorAlert.criteriaMetCreateAlertsAndUpdateMonitorStatus), so
1521
+ * validating them anyway only blocked the form: the row is rendered only
1522
+ * while its switch is on, which left the user staring at "Incident title
1523
+ * is required" with no field on screen to type it into and no way past
1524
+ * Next (issues #3410, #3413).
1525
+ *
1526
+ * The predicate is the falsy one the evaluator uses, not `!== false`, so
1527
+ * a criteria saved before these flags existed - populated rows, no flag -
1528
+ * is treated as off here exactly as it already is at runtime.
1529
+ *
1530
+ * Title and severity are the two fields the form marks required; the
1531
+ * description is not one of them. It sits in a collapsed section labelled
1532
+ * "Optional incident description" / "Optional alert description", and both
1533
+ * Incident.description and Alert.description are nullable columns. So it is
1534
+ * not required here either - demanding it stuck the form on a field the UI
1535
+ * calls optional and keeps folded away, which is the second half of #3410.
1536
+ */
1537
+ if (value.data.createIncidents) {
1538
+ for (const incident of value.data.incidents) {
1539
+ if (!incident) {
1540
+ continue;
1541
+ }
1493
1542
 
1494
- if (!incident.description) {
1495
- return `Incident description is required for criteria "${value.data.name}"`;
1496
- }
1543
+ if (!incident.title) {
1544
+ return `Incident title is required for criteria "${value.data.name}"`;
1545
+ }
1497
1546
 
1498
- if (!incident.incidentSeverityId) {
1499
- return `Incident severity is required for criteria "${value.data.name}"`;
1547
+ if (!incident.incidentSeverityId) {
1548
+ return `Incident severity is required for criteria "${value.data.name}"`;
1549
+ }
1500
1550
  }
1501
1551
  }
1502
1552
 
1503
- for (const alert of value.data.alerts) {
1504
- if (!alert) {
1505
- continue;
1506
- }
1507
-
1508
- if (!alert.title) {
1509
- return `Alert title is required for criteria "${value.data.name}"`;
1510
- }
1553
+ if (value.data.createAlerts) {
1554
+ for (const alert of value.data.alerts) {
1555
+ if (!alert) {
1556
+ continue;
1557
+ }
1511
1558
 
1512
- if (!alert.description) {
1513
- return `Alert description is required for criteria "${value.data.name}"`;
1514
- }
1559
+ if (!alert.title) {
1560
+ return `Alert title is required for criteria "${value.data.name}"`;
1561
+ }
1515
1562
 
1516
- if (!alert.alertSeverityId) {
1517
- return `Alert severity is required for criteria "${value.data.name}"`;
1563
+ if (!alert.alertSeverityId) {
1564
+ return `Alert severity is required for criteria "${value.data.name}"`;
1565
+ }
1518
1566
  }
1519
1567
  }
1520
1568
 
@@ -1523,6 +1571,18 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
1523
1571
  return `Filter Type is required for criteria "${value.data.name}"`;
1524
1572
  }
1525
1573
 
1574
+ /*
1575
+ * A filter with no condition is silently dead: every comparator in
1576
+ * CompareCriteria switches on the filter type and returns "no
1577
+ * match" for one it does not recognise, so the criteria never
1578
+ * fires. The empty dropdown is easy to walk past when every field
1579
+ * around it is filled in, so refuse the save instead of accepting
1580
+ * a rule that can never be true.
1581
+ */
1582
+ if (!filter.filterType) {
1583
+ return `Filter Condition is required for criteria "${value.data.name}" on filter type: ${filter.checkOn}`;
1584
+ }
1585
+
1526
1586
  if (
1527
1587
  monitorType === MonitorType.Ping &&
1528
1588
  filter.checkOn !== CheckOn.IsOnline &&
@@ -108,7 +108,8 @@ export default class MonitorRecommendationSeverityMapper {
108
108
  *
109
109
  * Returns undefined when the mapping has no entry, which callers must treat
110
110
  * as "leave the template's own severity alone" rather than as "no severity"
111
- * — a criteria instance with a populated incident and no severity id fails
111
+ * — a criteria instance that creates incidents (`createIncidents`) and has a
112
+ * populated incident with no severity id fails
112
113
  * `MonitorCriteriaInstance.getValidationError` and the whole create fails.
113
114
  */
114
115
  public static resolveSeverityId(data: {
@@ -65,6 +65,58 @@ export interface LabelRuleRunResult {
65
65
  isTruncated: boolean;
66
66
  }
67
67
 
68
+ /*
69
+ * One run of a network device auto-import rule — automatic (the worker
70
+ * processing a completed scan) or manual ("Run Now" against the project's
71
+ * completed scans, optionally as a dry run that writes nothing).
72
+ *
73
+ * Every discovered host the run looked at lands in a bucket for the same
74
+ * reason as above: "nothing matched", "everything that matched is already in
75
+ * the inventory", and "an exclusion rule vetoed it" are very different
76
+ * answers to "why did this import zero devices".
77
+ */
78
+ export interface AutoImportRuleRunResult {
79
+ // Discovered hosts the run evaluated, across every scan it read.
80
+ hostsEvaluated: number;
81
+ // Of those, the ones an import rule matched (exclusions already applied).
82
+ hostsMatched: number;
83
+ // Hosts an exclusion rule vetoed.
84
+ hostsExcluded: number;
85
+ /*
86
+ * Matched hosts skipped because a device with that address already exists
87
+ * — including one created earlier in this same run from a duplicate row or
88
+ * an overlapping scan. Re-running a rule is idempotent, not additive.
89
+ */
90
+ hostsSkippedAlreadyRegistered: number;
91
+ // Devices actually created. Always zero on a dry run.
92
+ devicesCreated: number;
93
+ // Matched hosts whose create threw. Logged server-side, never fatal.
94
+ devicesFailed: number;
95
+ /*
96
+ * True when the run stopped at the DEVICE cap with matched hosts left
97
+ * over. Running again continues: already-imported hosts are skipped.
98
+ */
99
+ isTruncated: boolean;
100
+ /*
101
+ * True when the project has more completed scans than one manual run
102
+ * reads (the newest MAX_SCANS_PER_AUTO_IMPORT_RULE_RUN). Distinct from
103
+ * isTruncated because the advice differs: re-running re-reads the same
104
+ * newest scans, so hosts that appear ONLY in older scans stay unread.
105
+ */
106
+ hasMoreScans: boolean;
107
+ // True when this run was a dry run: full evaluation, no writes.
108
+ isDryRun: boolean;
109
+ /*
110
+ * Up to MAX_MATCHED_IP_SAMPLE addresses the run imported (or, on a dry
111
+ * run, would import) — the operator's "which hosts is this rule actually
112
+ * claiming" answer, without shipping a 30k-element array.
113
+ */
114
+ matchedIpAddressSample: Array<string>;
115
+ }
116
+
117
+ // How many addresses matchedIpAddressSample carries at most.
118
+ export const MAX_MATCHED_IP_SAMPLE: number = 50;
119
+
68
120
  /*
69
121
  * A count off the wire. An absent or non-numeric field reads as zero rather
70
122
  * than as NaN: a summary line that says "NaN devices" is worse than one that
@@ -118,4 +170,36 @@ export class RuleRunResultUtil {
118
170
  isTruncated: source["isTruncated"] === true,
119
171
  };
120
172
  }
173
+
174
+ public static parseAutoImportRuleRunResult(
175
+ json: JSONObject | undefined | null,
176
+ ): AutoImportRuleRunResult {
177
+ const source: JSONObject = json || {};
178
+
179
+ const sample: Array<string> = Array.isArray(
180
+ source["matchedIpAddressSample"],
181
+ )
182
+ ? (source["matchedIpAddressSample"] as Array<unknown>)
183
+ .filter((value: unknown) => {
184
+ return typeof value === "string";
185
+ })
186
+ .slice(0, MAX_MATCHED_IP_SAMPLE)
187
+ : [];
188
+
189
+ return {
190
+ hostsEvaluated: readCount(source, "hostsEvaluated"),
191
+ hostsMatched: readCount(source, "hostsMatched"),
192
+ hostsExcluded: readCount(source, "hostsExcluded"),
193
+ hostsSkippedAlreadyRegistered: readCount(
194
+ source,
195
+ "hostsSkippedAlreadyRegistered",
196
+ ),
197
+ devicesCreated: readCount(source, "devicesCreated"),
198
+ devicesFailed: readCount(source, "devicesFailed"),
199
+ isTruncated: source["isTruncated"] === true,
200
+ hasMoreScans: source["hasMoreScans"] === true,
201
+ isDryRun: source["isDryRun"] === true,
202
+ matchedIpAddressSample: sample as Array<string>,
203
+ };
204
+ }
121
205
  }
@@ -600,6 +600,11 @@ enum Permission {
600
600
  EditNetworkDeviceLabelRule = "EditNetworkDeviceLabelRule",
601
601
  ReadNetworkDeviceLabelRule = "ReadNetworkDeviceLabelRule",
602
602
 
603
+ CreateNetworkDeviceAutoImportRule = "CreateNetworkDeviceAutoImportRule",
604
+ DeleteNetworkDeviceAutoImportRule = "DeleteNetworkDeviceAutoImportRule",
605
+ EditNetworkDeviceAutoImportRule = "EditNetworkDeviceAutoImportRule",
606
+ ReadNetworkDeviceAutoImportRule = "ReadNetworkDeviceAutoImportRule",
607
+
603
608
  // Podman Host Label Rule Permissions
604
609
  CreatePodmanHostLabelRule = "CreatePodmanHostLabelRule",
605
610
  DeletePodmanHostLabelRule = "DeletePodmanHostLabelRule",
@@ -11883,6 +11888,48 @@ export class PermissionHelper {
11883
11888
  group: PermissionGroup.Telemetry,
11884
11889
  },
11885
11890
 
11891
+ // Network Device Auto Import Rule Permissions
11892
+ {
11893
+ permission: Permission.CreateNetworkDeviceAutoImportRule,
11894
+ title: "Create Network Device Auto Import Rule",
11895
+ description:
11896
+ "This permission can create Network Device Auto Import Rules in this project.",
11897
+ isAssignableToTenant: true,
11898
+ isAccessControlPermission: false,
11899
+ isRolePermission: false,
11900
+ group: PermissionGroup.Telemetry,
11901
+ },
11902
+ {
11903
+ permission: Permission.DeleteNetworkDeviceAutoImportRule,
11904
+ title: "Delete Network Device Auto Import Rule",
11905
+ description:
11906
+ "This permission can delete Network Device Auto Import Rules of this project.",
11907
+ isAssignableToTenant: true,
11908
+ isAccessControlPermission: false,
11909
+ isRolePermission: false,
11910
+ group: PermissionGroup.Telemetry,
11911
+ },
11912
+ {
11913
+ permission: Permission.EditNetworkDeviceAutoImportRule,
11914
+ title: "Edit Network Device Auto Import Rule",
11915
+ description:
11916
+ "This permission can edit Network Device Auto Import Rules of this project.",
11917
+ isAssignableToTenant: true,
11918
+ isAccessControlPermission: false,
11919
+ isRolePermission: false,
11920
+ group: PermissionGroup.Telemetry,
11921
+ },
11922
+ {
11923
+ permission: Permission.ReadNetworkDeviceAutoImportRule,
11924
+ title: "Read Network Device Auto Import Rule",
11925
+ description:
11926
+ "This permission can read Network Device Auto Import Rules of this project.",
11927
+ isAssignableToTenant: true,
11928
+ isAccessControlPermission: false,
11929
+ isRolePermission: false,
11930
+ group: PermissionGroup.Telemetry,
11931
+ },
11932
+
11886
11933
  // Podman Host Label Rule Permissions
11887
11934
  {
11888
11935
  permission: Permission.CreatePodmanHostLabelRule,
@@ -18,6 +18,17 @@ export const DETECTION_RULE_NAME_ATTRIBUTE: string =
18
18
  "oneuptime.detection.rule_name";
19
19
  export const DETECTION_MATCH_COUNT_ATTRIBUTE: string =
20
20
  "oneuptime.detection.match_count";
21
+ // Present only on findings from rules with a distinctCountField set.
22
+ export const DETECTION_DISTINCT_COUNT_ATTRIBUTE: string =
23
+ "oneuptime.detection.distinct_count";
24
+
25
+ /*
26
+ * Save-time bounds for DetectionRule.matchCountThreshold — one home for
27
+ * the server validator and the dashboard form, so the two ranges cannot
28
+ * drift apart.
29
+ */
30
+ export const DETECTION_MATCH_COUNT_THRESHOLD_MIN: number = 1;
31
+ export const DETECTION_MATCH_COUNT_THRESHOLD_MAX: number = 1000000;
21
32
  export const DETECTION_GROUP_VALUE_ATTRIBUTE: string =
22
33
  "oneuptime.detection.group_value";
23
34
  export const DETECTION_SIGMA_ID_ATTRIBUTE: string =
@@ -0,0 +1,124 @@
1
+ /*
2
+ * Single source of truth for the OpenTelemetry GenAI **metric** names and
3
+ * attribute keys OneUptime recognizes — the metric-side sibling of
4
+ * Common/Types/Telemetry/LlmConventions.ts, which does the same job for span
5
+ * attributes.
6
+ *
7
+ * Why this exists: the LLM feature was originally span-only. A span carries
8
+ * model, tokens and cost together, so one row answers every question. But a
9
+ * large class of emitters never produce GenAI spans at all:
10
+ *
11
+ * - Native OpenTelemetry GenAI metrics (gen_ai.client.token.usage) emitted
12
+ * by an SDK configured for metrics without tracing.
13
+ * - AI gateways and vendor exporters that publish spend/usage counters only.
14
+ *
15
+ * For those, token and cost totals have to come off the metric stream instead.
16
+ * Both the budget evaluator (Common/Server/Utils/Telemetry/LlmMetricSpend.ts)
17
+ * and anything else that needs metric-sourced LLM figures import these lists,
18
+ * so a newly recognized metric name is added HERE, once.
19
+ *
20
+ * Order matters: within each list the preferred convention comes first.
21
+ */
22
+
23
+ /*
24
+ * Metric names carrying token counts. `gen_ai.client.token.usage` is the OTel
25
+ * semantic convention (a histogram whose `sum` is the token total); the rest
26
+ * are the spellings the dominant instrumentations shipped before/alongside it.
27
+ */
28
+ export const LlmTokenUsageMetricNames: Array<string> = [
29
+ "gen_ai.client.token.usage",
30
+ "gen_ai.client.token.count",
31
+ "llm.token.usage",
32
+ "llm.usage.tokens",
33
+ ];
34
+
35
+ /*
36
+ * Metric names carrying spend in USD.
37
+ *
38
+ * There is no OTel semantic convention for LLM cost — every entry below is a
39
+ * vendor spelling. That is precisely why metric-sourced cost is worth
40
+ * supporting: the emitters that publish a cost metric are generally the ones
41
+ * that publish no spans, so this list is the only way their spend is visible.
42
+ */
43
+ export const LlmCostMetricNames: Array<string> = [
44
+ "gen_ai.client.cost",
45
+ "gen_ai.client.cost.usd",
46
+ "gen_ai.usage.cost",
47
+ // LiteLLM proxy.
48
+ "litellm_spend_metric",
49
+ "litellm.cost.total",
50
+ ];
51
+
52
+ /*
53
+ * Attribute keys naming which side of the exchange a token datapoint counts.
54
+ * The OTel convention is `gen_ai.token.type`; the others are pre-convention
55
+ * spellings still in the wild.
56
+ */
57
+ export const LlmTokenTypeAttributeKeys: Array<string> = [
58
+ "gen_ai.token.type",
59
+ "llm.token.type",
60
+ ];
61
+
62
+ /*
63
+ * Attribute values that mean "tokens sent to the model". `prompt` is the
64
+ * pre-1.27 semconv spelling that several instrumentations still emit.
65
+ */
66
+ export const LlmInputTokenTypeValues: Array<string> = ["input", "prompt"];
67
+
68
+ /*
69
+ * Attribute values that mean "tokens produced by the model".
70
+ *
71
+ * Note what is deliberately absent: cache_read / cache_creation. Those are
72
+ * real token counts, but they are neither input nor output in the sense the
73
+ * span columns (llmInputTokens / llmOutputTokens) use, and folding them in
74
+ * would silently inflate the metric-sourced totals relative to the
75
+ * span-sourced ones they stand in for.
76
+ */
77
+ export const LlmOutputTokenTypeValues: Array<string> = ["output", "completion"];
78
+
79
+ /**
80
+ * Which side of the exchange a `gen_ai.token.type` value denotes, or null
81
+ * when the value is one we deliberately do not count (cache_read,
82
+ * cache_creation) or do not recognize at all.
83
+ *
84
+ * Comparison is case-insensitive and whitespace-trimmed: the value reaches us
85
+ * as a free-form OTLP string attribute, and emitters are inconsistent about
86
+ * casing.
87
+ */
88
+ export type LlmTokenDirection = "input" | "output";
89
+
90
+ export function getLlmTokenDirection(
91
+ attributeValue: string | undefined | null,
92
+ ): LlmTokenDirection | null {
93
+ if (typeof attributeValue !== "string") {
94
+ return null;
95
+ }
96
+
97
+ const normalized: string = attributeValue.trim().toLowerCase();
98
+
99
+ if (!normalized) {
100
+ return null;
101
+ }
102
+
103
+ if (LlmInputTokenTypeValues.includes(normalized)) {
104
+ return "input";
105
+ }
106
+
107
+ if (LlmOutputTokenTypeValues.includes(normalized)) {
108
+ return "output";
109
+ }
110
+
111
+ return null;
112
+ }
113
+
114
+ /**
115
+ * The attribute values to match for a direction. Exposed so query builders
116
+ * and tests share one definition of "what counts as input".
117
+ */
118
+ export function getLlmTokenTypeValues(
119
+ direction: LlmTokenDirection,
120
+ ): Array<string> {
121
+ return direction === "input"
122
+ ? LlmInputTokenTypeValues
123
+ : LlmOutputTokenTypeValues;
124
+ }
@@ -27,6 +27,8 @@ export interface ComponentProps {
27
27
  isLoadingSuggestions?: boolean | undefined;
28
28
  loadingMessage?: string | undefined;
29
29
  noSuggestionsMessage?: string | undefined;
30
+ // For inputs with no visible label element to point ariaLabelledby at.
31
+ ariaLabel?: string | undefined;
30
32
  /*
31
33
  * The id of the element that names this input. Without it a picker that draws
32
34
  * its own label - the workflow record editor, where the field's name sits in
@@ -464,6 +466,7 @@ const AutocompleteTextInput: FunctionComponent<ComponentProps> = (
464
466
  className={getInputClassName()}
465
467
  data-testid={props.dataTestId}
466
468
  disabled={props.disabled}
469
+ aria-label={props.ariaLabel}
467
470
  aria-labelledby={props.ariaLabelledby}
468
471
  aria-autocomplete="list"
469
472
  aria-controls={listboxIdRef.current}
@@ -358,7 +358,16 @@ const BulkUpdateForm: <T extends GenericObject>(
358
358
  className="h-4 w-4 text-indigo-600"
359
359
  />
360
360
  <span>
361
- {props.selectedItems.length} {props.pluralLabel} Selected
361
+ {props.selectedItems.length}{" "}
362
+ {/*
363
+ * The singular when there is one of them. The badge is the
364
+ * one sentence in this bar that is always on screen, and
365
+ * "1 resources Selected" reads as a bug in the count.
366
+ */}
367
+ {props.selectedItems.length === 1
368
+ ? props.singularLabel
369
+ : props.pluralLabel}{" "}
370
+ Selected
362
371
  </span>
363
372
  </div>
364
373