@oneuptime/common 12.0.30 → 12.0.32

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 (645) hide show
  1. package/Models/AnalyticsModels/SecurityEvent.ts +48 -16
  2. package/Models/AnalyticsModels/ThreatIntelIndicator.ts +10 -5
  3. package/Models/DatabaseModels/AlertSeverity.ts +44 -0
  4. package/Models/DatabaseModels/AlertState.ts +0 -2
  5. package/Models/DatabaseModels/DetectionRule.ts +16 -5
  6. package/Models/DatabaseModels/Domain.ts +1 -1
  7. package/Models/DatabaseModels/GoogleSecOpsConnection.ts +14 -5
  8. package/Models/DatabaseModels/Incident.ts +1 -1
  9. package/Models/DatabaseModels/IncidentSeverity.ts +44 -0
  10. package/Models/DatabaseModels/IncidentTemplate.ts +1 -1
  11. package/Models/DatabaseModels/Index.ts +4 -0
  12. package/Models/DatabaseModels/MetricType.ts +0 -2
  13. package/Models/DatabaseModels/MonitorStatusTimeline.ts +0 -2
  14. package/Models/DatabaseModels/MonitorTest.ts +0 -2
  15. package/Models/DatabaseModels/NetworkDevice.ts +234 -5
  16. package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +88 -0
  17. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +22 -0
  18. package/Models/DatabaseModels/NetworkDeviceOidTemplate.ts +501 -0
  19. package/Models/DatabaseModels/NetworkDeviceRole.ts +648 -0
  20. package/Models/DatabaseModels/ScheduledMaintenance.ts +1 -1
  21. package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -1
  22. package/Models/DatabaseModels/StatusPageAnnouncement.ts +0 -2
  23. package/Models/DatabaseModels/StatusPageAnnouncementTemplate.ts +0 -2
  24. package/Models/DatabaseModels/StatusPagePrivateUser.ts +0 -2
  25. package/Models/DatabaseModels/StatusPageResource.ts +0 -2
  26. package/Models/DatabaseModels/StatusPageSubscriber.ts +0 -2
  27. package/Models/DatabaseModels/ThreatIntelFeed.ts +16 -5
  28. package/Server/API/GlobalConfigAPI.ts +362 -183
  29. package/Server/API/TelemetryAPI.ts +42 -4
  30. package/Server/EnvironmentConfig.ts +112 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.ts +59 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.ts +25 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.ts +72 -0
  34. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
  35. package/Server/Middleware/MultipartFormData.ts +118 -32
  36. package/Server/Services/AlertEpisodeLabelRuleEngineService.ts +9 -1
  37. package/Server/Services/AlertEpisodeOnCallRuleEngineService.ts +9 -1
  38. package/Server/Services/AlertEpisodeOwnerRuleEngineService.ts +9 -1
  39. package/Server/Services/AlertEpisodePrivacyRuleEngineService.ts +9 -1
  40. package/Server/Services/AlertGroupingEngineService.ts +9 -1
  41. package/Server/Services/AlertLabelRuleEngineService.ts +9 -1
  42. package/Server/Services/AlertOnCallRuleEngineService.ts +9 -1
  43. package/Server/Services/AlertOwnerRuleEngineService.ts +9 -1
  44. package/Server/Services/AlertPrivacyRuleEngineService.ts +9 -1
  45. package/Server/Services/AlertReminderRuleService.ts +9 -1
  46. package/Server/Services/AutoRemediationRuleEngineService.ts +9 -1
  47. package/Server/Services/CephClusterLabelRuleEngineService.ts +9 -1
  48. package/Server/Services/CephClusterOwnerRuleEngineService.ts +9 -1
  49. package/Server/Services/CloudResourceLabelRuleEngineService.ts +9 -1
  50. package/Server/Services/CloudResourceOwnerRuleEngineService.ts +9 -1
  51. package/Server/Services/DashboardLabelRuleEngineService.ts +9 -1
  52. package/Server/Services/DashboardOwnerRuleEngineService.ts +9 -1
  53. package/Server/Services/DatabaseService.ts +39 -9
  54. package/Server/Services/DockerHostLabelRuleEngineService.ts +9 -1
  55. package/Server/Services/DockerHostOwnerRuleEngineService.ts +9 -1
  56. package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +9 -1
  57. package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +9 -1
  58. package/Server/Services/HostLabelRuleEngineService.ts +9 -1
  59. package/Server/Services/HostOwnerRuleEngineService.ts +9 -1
  60. package/Server/Services/IncidentEpisodeLabelRuleEngineService.ts +9 -1
  61. package/Server/Services/IncidentEpisodeOnCallRuleEngineService.ts +9 -1
  62. package/Server/Services/IncidentEpisodeOwnerRuleEngineService.ts +9 -1
  63. package/Server/Services/IncidentEpisodePrivacyRuleEngineService.ts +9 -1
  64. package/Server/Services/IncidentGroupingEngineService.ts +9 -1
  65. package/Server/Services/IncidentLabelRuleEngineService.ts +9 -1
  66. package/Server/Services/IncidentOnCallRuleEngineService.ts +9 -1
  67. package/Server/Services/IncidentOwnerRuleEngineService.ts +9 -1
  68. package/Server/Services/IncidentPrivacyRuleEngineService.ts +9 -1
  69. package/Server/Services/IncidentReminderRuleService.ts +9 -1
  70. package/Server/Services/IncidentSlaRuleService.ts +9 -1
  71. package/Server/Services/IncomingCallPolicyLabelRuleEngineService.ts +9 -1
  72. package/Server/Services/IncomingCallPolicyOwnerRuleEngineService.ts +9 -1
  73. package/Server/Services/Index.ts +4 -0
  74. package/Server/Services/IoTFleetLabelRuleEngineService.ts +9 -1
  75. package/Server/Services/IoTFleetOwnerRuleEngineService.ts +9 -1
  76. package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +9 -1
  77. package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +9 -1
  78. package/Server/Services/KubernetesResourceService.ts +5 -1
  79. package/Server/Services/MonitorLabelRuleEngineService.ts +9 -1
  80. package/Server/Services/MonitorOwnerRuleEngineService.ts +9 -1
  81. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +35 -0
  82. package/Server/Services/NetworkDeviceAutoImportRuleService.ts +96 -0
  83. package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +9 -1
  84. package/Server/Services/NetworkDeviceOidTemplateService.ts +201 -0
  85. package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +9 -1
  86. package/Server/Services/NetworkDeviceRoleService.ts +90 -0
  87. package/Server/Services/NetworkDeviceService.ts +209 -1
  88. package/Server/Services/OnCallDutyPolicyLabelRuleEngineService.ts +9 -1
  89. package/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.ts +9 -1
  90. package/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.ts +9 -1
  91. package/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.ts +9 -1
  92. package/Server/Services/PodmanHostLabelRuleEngineService.ts +9 -1
  93. package/Server/Services/PodmanHostOwnerRuleEngineService.ts +9 -1
  94. package/Server/Services/ProjectService.ts +85 -0
  95. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +9 -1
  96. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +9 -1
  97. package/Server/Services/RumApplicationLabelRuleEngineService.ts +9 -1
  98. package/Server/Services/RumApplicationOwnerRuleEngineService.ts +9 -1
  99. package/Server/Services/RunbookLabelRuleEngineService.ts +9 -1
  100. package/Server/Services/RunbookOwnerRuleEngineService.ts +9 -1
  101. package/Server/Services/RunbookRuleEngineService.ts +9 -1
  102. package/Server/Services/ScheduledMaintenanceLabelRuleEngineService.ts +9 -1
  103. package/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.ts +9 -1
  104. package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +9 -1
  105. package/Server/Services/ServerlessFunctionLabelRuleEngineService.ts +9 -1
  106. package/Server/Services/ServerlessFunctionOwnerRuleEngineService.ts +9 -1
  107. package/Server/Services/ServiceLabelRuleEngineService.ts +9 -1
  108. package/Server/Services/ServiceOwnerRuleEngineService.ts +9 -1
  109. package/Server/Services/StatusPageLabelRuleEngineService.ts +9 -1
  110. package/Server/Services/StatusPageMonitorRuleEngineService.ts +7 -0
  111. package/Server/Services/StatusPageOwnerRuleEngineService.ts +9 -1
  112. package/Server/Services/TelemetrySourceMapService.ts +266 -23
  113. package/Server/Services/UserNotificationSettingService.ts +0 -6
  114. package/Server/Services/UserService.ts +27 -0
  115. package/Server/Services/WorkflowLabelRuleEngineService.ts +9 -1
  116. package/Server/Services/WorkflowOwnerRuleEngineService.ts +9 -1
  117. package/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.ts +186 -0
  118. package/Server/Utils/Monitor/CapturedMetricAttributeUtil.ts +245 -0
  119. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +21 -2
  120. package/Server/Utils/Monitor/MonitorMetricUtil.ts +55 -21
  121. package/Server/Utils/Monitor/MonitorTemplateUtil.ts +32 -0
  122. package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +15 -2
  123. package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +18 -1
  124. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +10 -0
  125. package/Server/Utils/Monitor/SeriesResourceLabels.ts +34 -0
  126. package/Server/Utils/Rules/RuleEngineRuleRead.ts +48 -0
  127. package/Server/Utils/Telemetry/ExceptionSanitizer.ts +14 -1
  128. package/Server/Utils/Telemetry/LogExceptionExtractor.ts +14 -2
  129. package/Server/Utils/Telemetry/SourceMapResolver.ts +16 -5
  130. package/Server/Utils/Telemetry/StackTraceParser.ts +399 -0
  131. package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +31 -1
  132. package/Tests/App/Dashboard/DashboardChartWidgetZoom.test.tsx +35 -8
  133. package/Tests/App/Dashboard/DashboardCommandPalette.test.tsx +107 -3
  134. package/Tests/App/Dashboard/DashboardWideChartZoom.test.tsx +401 -0
  135. package/Tests/App/Dashboard/EventOverlayHook.test.tsx +125 -0
  136. package/Tests/App/Dashboard/HeaderImageAssets.test.tsx +93 -0
  137. package/Tests/App/Dashboard/MonitorTemplateColumnAndFacet.test.tsx +318 -0
  138. package/Tests/App/Dashboard/NetworkDeviceBulkDelete.test.tsx +357 -0
  139. package/Tests/App/Dashboard/NetworkSideMenu.test.tsx +590 -0
  140. package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3 -3
  141. package/Tests/App/Dashboard/SideMenuHarness.tsx +11 -3
  142. package/Tests/App/Dashboard/UserElementEmail.test.tsx +12 -4
  143. package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +1 -1
  144. package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +14 -0
  145. package/Tests/Models/DatabaseModels/ModelRegistryInvariants.test.ts +543 -0
  146. package/Tests/Models/SecurityDomainAccessControl.test.ts +429 -0
  147. package/Tests/Server/API/GlobalConfigLicense.test.ts +657 -0
  148. package/Tests/Server/API/SecurityEventAttributesAPI.test.ts +84 -6
  149. package/Tests/Server/API/TelemetryResolveStackTraceAPI.test.ts +805 -0
  150. package/Tests/Server/Infrastructure/Postgres/AddOnCallCalendarFeedsMigration.test.ts +32 -7
  151. package/Tests/Server/Infrastructure/Postgres/NetworkDeviceRoleTableMigration.test.ts +476 -0
  152. package/Tests/Server/Middleware/IdentityRateLimit.test.ts +1144 -0
  153. package/Tests/Server/Middleware/MultipartFormData.test.ts +618 -3
  154. package/Tests/Server/Services/DatabaseServiceGenerateSlug.test.ts +215 -0
  155. package/Tests/Server/Services/MonitorLabelRuleEngineScale.test.ts +520 -0
  156. package/Tests/Server/Services/NetworkDeviceOidTemplateService.test.ts +332 -0
  157. package/Tests/Server/Services/NetworkDeviceOidTemplateWriteGuards.test.ts +409 -0
  158. package/Tests/Server/Services/NetworkDeviceRoleModel.test.ts +672 -0
  159. package/Tests/Server/Services/NetworkDeviceRuleEngines.test.ts +1 -1
  160. package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +67 -4
  161. package/Tests/Server/Services/RuleEngineRuleFetchLimit.test.ts +239 -0
  162. package/Tests/Server/Services/ScheduledMaintenanceSubscriberEndTime.test.ts +369 -0
  163. package/Tests/Server/Services/TelemetrySourceMapService.test.ts +1210 -2
  164. package/Tests/Server/Services/UserNotificationSettingMonitorDefaults.test.ts +248 -0
  165. package/Tests/Server/Services/UserNotificationSettingWorkspaceChannels.test.ts +43 -2
  166. package/Tests/Server/Services/UserServiceSeatLimit.test.ts +182 -0
  167. package/Tests/Server/Types/AnalyticsDatabase/SecurityEventModelPermission.test.ts +255 -0
  168. package/Tests/Server/Types/Database/Permissions/ReadBlockPermission.test.ts +212 -0
  169. package/Tests/Server/Types/Database/Permissions/SecurityRoleAccess.test.ts +413 -0
  170. package/Tests/Server/Utils/BasicCron.test.ts +283 -0
  171. package/Tests/Server/Utils/CodeRepository.test.ts +689 -0
  172. package/Tests/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.test.ts +495 -0
  173. package/Tests/Server/Utils/ExceptionSanitizer.test.ts +77 -0
  174. package/Tests/Server/Utils/IncomingCallPhoneNumber.test.ts +174 -0
  175. package/Tests/Server/Utils/Monitor/CapturedMetricAttributeUtil.test.ts +284 -0
  176. package/Tests/Server/Utils/Monitor/MonitorCustomMetricAttributes.test.ts +503 -0
  177. package/Tests/Server/Utils/Monitor/MonitorTemplatePrototypePollution.test.ts +106 -0
  178. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkLogWritePath.test.ts +33 -4
  179. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +14 -4
  180. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +44 -0
  181. package/Tests/Server/Utils/OpenAPISpec.test.ts +536 -0
  182. package/Tests/Server/Utils/Rules/RuleEngineRuleRead.test.ts +115 -0
  183. package/Tests/Server/Utils/StackTraceParser.test.ts +610 -0
  184. package/Tests/Server/Utils/Telemetry/LogExceptionExtractor.test.ts +0 -0
  185. package/Tests/Server/Utils/Telemetry/SourceMapLimits.test.ts +656 -0
  186. package/Tests/Server/Utils/Telemetry/SourceMapResolver.test.ts +100 -0
  187. package/Tests/Types/Monitor/SnmpMonitor/SnmpOidListUtil.test.ts +454 -0
  188. package/Tests/Types/NetworkDevice/DefaultNetworkDeviceRole.test.ts +417 -0
  189. package/Tests/Types/SecurityRolePermissions.test.ts +193 -0
  190. package/Tests/UI/Components/Charts/AnnotationLayout.test.ts +773 -0
  191. package/Tests/UI/Components/Charts/ChartAnnotationRail.test.tsx +789 -0
  192. package/Tests/UI/Components/Charts/ChartBucketIdentity.test.ts +254 -0
  193. package/Tests/UI/Components/Charts/ChartClickDoubleClickDisambiguation.test.tsx +221 -0
  194. package/Tests/UI/Components/Charts/ChartDoubleClickReset.test.tsx +220 -0
  195. package/Tests/UI/Components/Charts/TimeAnnotation.test.ts +471 -0
  196. package/Tests/UI/Components/EditionLabelLicenseRefresh.test.tsx +405 -0
  197. package/Tests/UI/Components/ErrorMessageRefreshControl.test.tsx +83 -0
  198. package/Tests/UI/Components/MarkdownConverters.test.ts +686 -0
  199. package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +751 -0
  200. package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +475 -43
  201. package/Tests/UI/Components/ModelTable/BaseModelTableDeleteAndEmptyStates.test.tsx +341 -0
  202. package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +89 -0
  203. package/Tests/UI/Components/NavBarCommandKGating.test.tsx +103 -8
  204. package/Tests/UI/Components/OrderedStatesList.test.tsx +5 -5
  205. package/Tests/UI/Components/PendingProjectInvitations.test.tsx +1 -1
  206. package/Tests/UI/Components/SideMenuItem.test.tsx +30 -0
  207. package/Tests/UI/Components/TableSortAndMobileColumns.test.tsx +195 -0
  208. package/Tests/UI/Components/XAxis.test.ts +270 -5
  209. package/Tests/UI/Components/XAxisDaylightSaving.test.ts +113 -0
  210. package/Tests/UI/Styles/ChartFocusRing.test.ts +153 -0
  211. package/Tests/UI/Styles/ChartFocusRingCoverage.test.tsx +377 -0
  212. package/Tests/UI/Styles/ThemeStylesheet.ts +162 -0
  213. package/Tests/UI/Utils/TableColumnsToCsv.test.ts +30 -0
  214. package/Tests/UI/Utils/UseDashboardTimeRangeZoom.test.tsx +187 -0
  215. package/Tests/Utils/Dashboard/DashboardResourceListSharedArgs.test.ts +302 -0
  216. package/Tests/Utils/Dashboard/DashboardTimeRangeZoom.test.ts +242 -0
  217. package/Tests/Utils/EnterpriseLicenseSeats.test.ts +507 -0
  218. package/Tests/Utils/Monitor/NetworkDeviceRoleCatalog.test.ts +981 -0
  219. package/Tests/Utils/Monitor/NetworkTopologyRoleCatalog.test.ts +865 -0
  220. package/Tests/Utils/NetworkDevice/DeviceRoleKeyUtil.test.ts +538 -0
  221. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +951 -1
  222. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +238 -0
  223. package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +1056 -0
  224. package/Tests/Utils/NetworkDiscovery/ReverseDnsNameUtil.test.ts +882 -0
  225. package/Tests/Utils/Slo/SloEvaluation.test.ts +171 -0
  226. package/Tests/Utils/Slug.test.ts +61 -1
  227. package/Tests/jest.setup.ts +19 -0
  228. package/Types/Date.ts +39 -0
  229. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +61 -0
  230. package/Types/Monitor/SnmpMonitor/SnmpOidListUtil.ts +333 -0
  231. package/Types/NetworkDevice/DefaultNetworkDeviceRole.ts +145 -0
  232. package/Types/Permission.ts +141 -0
  233. package/Types/Rum/SessionReplay.ts +21 -0
  234. package/Types/Telemetry/SourceMap.ts +8 -0
  235. package/UI/Components/Charts/Area/AreaChart.tsx +7 -0
  236. package/UI/Components/Charts/Bar/BarChart.tsx +6 -0
  237. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +9 -1
  238. package/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.tsx +176 -0
  239. package/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.ts +745 -0
  240. package/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.tsx +576 -0
  241. package/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.tsx +204 -0
  242. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +554 -545
  243. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +337 -371
  244. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +549 -540
  245. package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +7 -3
  246. package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +14 -3
  247. package/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.ts +13 -0
  248. package/UI/Components/Charts/Line/LineChart.tsx +7 -0
  249. package/UI/Components/Charts/Types/ChartEventKind.ts +13 -0
  250. package/UI/Components/Charts/Types/ReferenceRegionProps.ts +6 -0
  251. package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +20 -3
  252. package/UI/Components/Charts/Utils/TimeAnnotation.ts +69 -35
  253. package/UI/Components/Charts/Utils/XAxis.ts +125 -18
  254. package/UI/Components/EditionLabel/EditionLabel.tsx +280 -26
  255. package/UI/Components/ErrorMessage/ErrorMessage.tsx +21 -10
  256. package/UI/Components/Feed/FeedItem.tsx +4 -5
  257. package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -2
  258. package/UI/Components/Header/UserProfile/UserProfile.tsx +1 -2
  259. package/UI/Components/Image/Image.tsx +20 -3
  260. package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
  261. package/UI/Components/MemberRoleAssignment/MemberRoleAssignment.tsx +1 -2
  262. package/UI/Components/ModelTable/BaseModelTable.tsx +200 -39
  263. package/UI/Components/Navbar/NavBar.tsx +62 -13
  264. package/UI/Components/Navbar/NavBarMenuModal.tsx +7 -2
  265. package/UI/Components/SideMenu/CountModelSideMenuItem.tsx +2 -0
  266. package/UI/Components/SideMenu/SideMenu.tsx +12 -2
  267. package/UI/Components/SideMenu/SideMenuItem.tsx +4 -1
  268. package/UI/Components/SideMenu/SideMenuSection.tsx +14 -2
  269. package/UI/Components/Table/TableHeader.tsx +64 -48
  270. package/UI/Components/Table/TableRow.tsx +13 -3
  271. package/UI/Styles/Theme.css +38 -0
  272. package/UI/Utils/UseDashboardTimeRangeZoom.ts +77 -0
  273. package/Utils/Dashboard/DashboardTimeRangeZoom.ts +118 -0
  274. package/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +271 -0
  275. package/Utils/Monitor/NetworkDeviceRoleCatalog.ts +232 -0
  276. package/Utils/Monitor/NetworkDeviceRoleUtil.ts +2 -1
  277. package/Utils/Monitor/NetworkTopologyUtil.ts +116 -33
  278. package/Utils/NetworkDevice/DeviceRoleKeyUtil.ts +137 -0
  279. package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +6 -0
  280. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +141 -10
  281. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +55 -3
  282. package/Utils/NetworkDiscovery/ReverseDnsNameUtil.ts +151 -0
  283. package/Utils/Rules/RuleEngineLimits.ts +32 -0
  284. package/Utils/Rules/RulePatternMatchUtil.ts +1 -1
  285. package/Utils/Slug.ts +34 -1
  286. package/build/dist/Models/AnalyticsModels/SecurityEvent.js +48 -16
  287. package/build/dist/Models/AnalyticsModels/SecurityEvent.js.map +1 -1
  288. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js +10 -5
  289. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js.map +1 -1
  290. package/build/dist/Models/DatabaseModels/AlertSeverity.js +46 -1
  291. package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
  292. package/build/dist/Models/DatabaseModels/AlertState.js +0 -2
  293. package/build/dist/Models/DatabaseModels/AlertState.js.map +1 -1
  294. package/build/dist/Models/DatabaseModels/DetectionRule.js +16 -5
  295. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
  296. package/build/dist/Models/DatabaseModels/Domain.js +1 -1
  297. package/build/dist/Models/DatabaseModels/Domain.js.map +1 -1
  298. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +14 -5
  299. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -1
  300. package/build/dist/Models/DatabaseModels/Incident.js +1 -1
  301. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  302. package/build/dist/Models/DatabaseModels/IncidentSeverity.js +46 -1
  303. package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
  304. package/build/dist/Models/DatabaseModels/IncidentTemplate.js +1 -1
  305. package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
  306. package/build/dist/Models/DatabaseModels/Index.js +4 -0
  307. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  308. package/build/dist/Models/DatabaseModels/MetricType.js +0 -2
  309. package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
  310. package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js +0 -2
  311. package/build/dist/Models/DatabaseModels/MonitorStatusTimeline.js.map +1 -1
  312. package/build/dist/Models/DatabaseModels/MonitorTest.js +0 -2
  313. package/build/dist/Models/DatabaseModels/MonitorTest.js.map +1 -1
  314. package/build/dist/Models/DatabaseModels/NetworkDevice.js +239 -6
  315. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  316. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +88 -0
  317. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -1
  318. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  319. package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js +521 -0
  320. package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js.map +1 -0
  321. package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js +677 -0
  322. package/build/dist/Models/DatabaseModels/NetworkDeviceRole.js.map +1 -0
  323. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +1 -1
  324. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  325. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -1
  326. package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
  327. package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +0 -2
  328. package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
  329. package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js +0 -2
  330. package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js.map +1 -1
  331. package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js +0 -2
  332. package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js.map +1 -1
  333. package/build/dist/Models/DatabaseModels/StatusPageResource.js +0 -2
  334. package/build/dist/Models/DatabaseModels/StatusPageResource.js.map +1 -1
  335. package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js +0 -2
  336. package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js.map +1 -1
  337. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +16 -5
  338. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js.map +1 -1
  339. package/build/dist/Server/API/GlobalConfigAPI.js +293 -176
  340. package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
  341. package/build/dist/Server/API/TelemetryAPI.js +31 -3
  342. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  343. package/build/dist/Server/EnvironmentConfig.js +83 -0
  344. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  345. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.js +26 -0
  346. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.js.map +1 -0
  347. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.js +14 -0
  348. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.js.map +1 -0
  349. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js +39 -0
  350. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790800000000-AddNetworkDeviceRoleTable.js.map +1 -0
  351. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
  352. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  353. package/build/dist/Server/Middleware/MultipartFormData.js +93 -28
  354. package/build/dist/Server/Middleware/MultipartFormData.js.map +1 -1
  355. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js +8 -1
  356. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js.map +1 -1
  357. package/build/dist/Server/Services/AlertEpisodeOnCallRuleEngineService.js +8 -1
  358. package/build/dist/Server/Services/AlertEpisodeOnCallRuleEngineService.js.map +1 -1
  359. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js +8 -1
  360. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js.map +1 -1
  361. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js +8 -1
  362. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js.map +1 -1
  363. package/build/dist/Server/Services/AlertGroupingEngineService.js +8 -1
  364. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  365. package/build/dist/Server/Services/AlertLabelRuleEngineService.js +8 -1
  366. package/build/dist/Server/Services/AlertLabelRuleEngineService.js.map +1 -1
  367. package/build/dist/Server/Services/AlertOnCallRuleEngineService.js +8 -1
  368. package/build/dist/Server/Services/AlertOnCallRuleEngineService.js.map +1 -1
  369. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js +8 -1
  370. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js.map +1 -1
  371. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js +8 -1
  372. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js.map +1 -1
  373. package/build/dist/Server/Services/AlertReminderRuleService.js +8 -1
  374. package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
  375. package/build/dist/Server/Services/AutoRemediationRuleEngineService.js +8 -1
  376. package/build/dist/Server/Services/AutoRemediationRuleEngineService.js.map +1 -1
  377. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +8 -1
  378. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
  379. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +8 -1
  380. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
  381. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +8 -1
  382. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
  383. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +8 -1
  384. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
  385. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js +8 -1
  386. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js.map +1 -1
  387. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js +8 -1
  388. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js.map +1 -1
  389. package/build/dist/Server/Services/DatabaseService.js +31 -5
  390. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  391. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +8 -1
  392. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
  393. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +8 -1
  394. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
  395. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +8 -1
  396. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
  397. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +8 -1
  398. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
  399. package/build/dist/Server/Services/HostLabelRuleEngineService.js +8 -1
  400. package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
  401. package/build/dist/Server/Services/HostOwnerRuleEngineService.js +8 -1
  402. package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
  403. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js +8 -1
  404. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js.map +1 -1
  405. package/build/dist/Server/Services/IncidentEpisodeOnCallRuleEngineService.js +8 -1
  406. package/build/dist/Server/Services/IncidentEpisodeOnCallRuleEngineService.js.map +1 -1
  407. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js +8 -1
  408. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js.map +1 -1
  409. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js +8 -1
  410. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js.map +1 -1
  411. package/build/dist/Server/Services/IncidentGroupingEngineService.js +8 -1
  412. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  413. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js +8 -1
  414. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js.map +1 -1
  415. package/build/dist/Server/Services/IncidentOnCallRuleEngineService.js +8 -1
  416. package/build/dist/Server/Services/IncidentOnCallRuleEngineService.js.map +1 -1
  417. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js +8 -1
  418. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js.map +1 -1
  419. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js +8 -1
  420. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js.map +1 -1
  421. package/build/dist/Server/Services/IncidentReminderRuleService.js +8 -1
  422. package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
  423. package/build/dist/Server/Services/IncidentSlaRuleService.js +8 -1
  424. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  425. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js +8 -1
  426. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js.map +1 -1
  427. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js +8 -1
  428. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js.map +1 -1
  429. package/build/dist/Server/Services/Index.js +4 -0
  430. package/build/dist/Server/Services/Index.js.map +1 -1
  431. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js +8 -1
  432. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js.map +1 -1
  433. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js +8 -1
  434. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js.map +1 -1
  435. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +8 -1
  436. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
  437. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +8 -1
  438. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
  439. package/build/dist/Server/Services/KubernetesResourceService.js +5 -1
  440. package/build/dist/Server/Services/KubernetesResourceService.js.map +1 -1
  441. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js +8 -1
  442. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js.map +1 -1
  443. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js +8 -1
  444. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js.map +1 -1
  445. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +30 -21
  446. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
  447. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +64 -0
  448. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
  449. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +8 -1
  450. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -1
  451. package/build/dist/Server/Services/NetworkDeviceOidTemplateService.js +180 -0
  452. package/build/dist/Server/Services/NetworkDeviceOidTemplateService.js.map +1 -0
  453. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +8 -1
  454. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -1
  455. package/build/dist/Server/Services/NetworkDeviceRoleService.js +70 -0
  456. package/build/dist/Server/Services/NetworkDeviceRoleService.js.map +1 -0
  457. package/build/dist/Server/Services/NetworkDeviceService.js +154 -1
  458. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  459. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js +8 -1
  460. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js.map +1 -1
  461. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js +8 -1
  462. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js.map +1 -1
  463. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js +8 -1
  464. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js.map +1 -1
  465. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js +8 -1
  466. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js.map +1 -1
  467. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +8 -1
  468. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
  469. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +8 -1
  470. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
  471. package/build/dist/Server/Services/ProjectService.js +65 -0
  472. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  473. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +8 -1
  474. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
  475. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +8 -1
  476. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
  477. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js +8 -1
  478. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js.map +1 -1
  479. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js +8 -1
  480. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js.map +1 -1
  481. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js +8 -1
  482. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js.map +1 -1
  483. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js +8 -1
  484. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js.map +1 -1
  485. package/build/dist/Server/Services/RunbookRuleEngineService.js +8 -1
  486. package/build/dist/Server/Services/RunbookRuleEngineService.js.map +1 -1
  487. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js +8 -1
  488. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js.map +1 -1
  489. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js +8 -1
  490. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js.map +1 -1
  491. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +8 -1
  492. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
  493. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js +8 -1
  494. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js.map +1 -1
  495. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js +8 -1
  496. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js.map +1 -1
  497. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +8 -1
  498. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
  499. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +8 -1
  500. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
  501. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js +8 -1
  502. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js.map +1 -1
  503. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js +6 -0
  504. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js.map +1 -1
  505. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js +8 -1
  506. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js.map +1 -1
  507. package/build/dist/Server/Services/TelemetrySourceMapService.js +213 -19
  508. package/build/dist/Server/Services/TelemetrySourceMapService.js.map +1 -1
  509. package/build/dist/Server/Services/UserNotificationSettingService.js +0 -1
  510. package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
  511. package/build/dist/Server/Services/UserService.js +25 -0
  512. package/build/dist/Server/Services/UserService.js.map +1 -1
  513. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js +8 -1
  514. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js.map +1 -1
  515. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js +8 -1
  516. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js.map +1 -1
  517. package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js +145 -0
  518. package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js.map +1 -0
  519. package/build/dist/Server/Utils/Monitor/CapturedMetricAttributeUtil.js +201 -0
  520. package/build/dist/Server/Utils/Monitor/CapturedMetricAttributeUtil.js.map +1 -0
  521. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +19 -2
  522. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  523. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +42 -23
  524. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
  525. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +29 -0
  526. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
  527. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +11 -2
  528. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -1
  529. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +16 -1
  530. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
  531. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +10 -0
  532. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  533. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +33 -0
  534. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  535. package/build/dist/Server/Utils/Rules/RuleEngineRuleRead.js +37 -0
  536. package/build/dist/Server/Utils/Rules/RuleEngineRuleRead.js.map +1 -0
  537. package/build/dist/Server/Utils/Telemetry/ExceptionSanitizer.js +12 -1
  538. package/build/dist/Server/Utils/Telemetry/ExceptionSanitizer.js.map +1 -1
  539. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +14 -2
  540. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
  541. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js +15 -5
  542. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js.map +1 -1
  543. package/build/dist/Server/Utils/Telemetry/StackTraceParser.js +307 -0
  544. package/build/dist/Server/Utils/Telemetry/StackTraceParser.js.map +1 -1
  545. package/build/dist/Types/Date.js +27 -0
  546. package/build/dist/Types/Date.js.map +1 -1
  547. package/build/dist/Types/Monitor/SnmpMonitor/SnmpOidListUtil.js +253 -0
  548. package/build/dist/Types/Monitor/SnmpMonitor/SnmpOidListUtil.js.map +1 -0
  549. package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js +105 -0
  550. package/build/dist/Types/NetworkDevice/DefaultNetworkDeviceRole.js.map +1 -0
  551. package/build/dist/Types/Permission.js +126 -0
  552. package/build/dist/Types/Permission.js.map +1 -1
  553. package/build/dist/Types/Rum/SessionReplay.js +19 -0
  554. package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
  555. package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
  556. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  557. package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
  558. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  559. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +6 -1
  560. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  561. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.js +83 -0
  562. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.js.map +1 -0
  563. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.js +531 -0
  564. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.js.map +1 -0
  565. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.js +264 -0
  566. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.js.map +1 -0
  567. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.js +122 -0
  568. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.js.map +1 -0
  569. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +262 -234
  570. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  571. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +146 -153
  572. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  573. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +261 -233
  574. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  575. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js +14 -0
  576. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js.map +1 -0
  577. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  578. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  579. package/build/dist/UI/Components/Charts/Types/ChartEventKind.js +14 -0
  580. package/build/dist/UI/Components/Charts/Types/ChartEventKind.js.map +1 -0
  581. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +57 -28
  582. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -1
  583. package/build/dist/UI/Components/Charts/Utils/XAxis.js +103 -17
  584. package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
  585. package/build/dist/UI/Components/EditionLabel/EditionLabel.js +198 -23
  586. package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
  587. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js +15 -5
  588. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js.map +1 -1
  589. package/build/dist/UI/Components/Feed/FeedItem.js +4 -5
  590. package/build/dist/UI/Components/Feed/FeedItem.js.map +1 -1
  591. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -2
  592. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  593. package/build/dist/UI/Components/Header/UserProfile/UserProfile.js.map +1 -1
  594. package/build/dist/UI/Components/Image/Image.js +6 -1
  595. package/build/dist/UI/Components/Image/Image.js.map +1 -1
  596. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js +0 -0
  597. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js.map +1 -1
  598. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js +1 -2
  599. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js.map +1 -1
  600. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +143 -36
  601. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  602. package/build/dist/UI/Components/Navbar/NavBar.js +44 -9
  603. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  604. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
  605. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  606. package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js +1 -1
  607. package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js.map +1 -1
  608. package/build/dist/UI/Components/SideMenu/SideMenu.js +9 -6
  609. package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
  610. package/build/dist/UI/Components/SideMenu/SideMenuItem.js +1 -1
  611. package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
  612. package/build/dist/UI/Components/SideMenu/SideMenuSection.js +7 -2
  613. package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
  614. package/build/dist/UI/Components/Table/TableHeader.js +20 -22
  615. package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
  616. package/build/dist/UI/Components/Table/TableRow.js +13 -4
  617. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  618. package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js +42 -0
  619. package/build/dist/UI/Utils/UseDashboardTimeRangeZoom.js.map +1 -0
  620. package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js +74 -0
  621. package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js.map +1 -0
  622. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js +153 -0
  623. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js.map +1 -0
  624. package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js +126 -0
  625. package/build/dist/Utils/Monitor/NetworkDeviceRoleCatalog.js.map +1 -0
  626. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +2 -1
  627. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -1
  628. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +67 -32
  629. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  630. package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js +114 -0
  631. package/build/dist/Utils/NetworkDevice/DeviceRoleKeyUtil.js.map +1 -0
  632. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
  633. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +127 -7
  634. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
  635. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +50 -3
  636. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
  637. package/build/dist/Utils/NetworkDiscovery/ReverseDnsNameUtil.js +132 -0
  638. package/build/dist/Utils/NetworkDiscovery/ReverseDnsNameUtil.js.map +1 -0
  639. package/build/dist/Utils/Rules/RuleEngineLimits.js +31 -0
  640. package/build/dist/Utils/Rules/RuleEngineLimits.js.map +1 -0
  641. package/build/dist/Utils/Rules/RulePatternMatchUtil.js +1 -1
  642. package/build/dist/Utils/Slug.js +31 -1
  643. package/build/dist/Utils/Slug.js.map +1 -1
  644. package/jest.config.json +1 -0
  645. package/package.json +2 -2
@@ -9,9 +9,12 @@ import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
9
9
  import { AppVersion, DisableUpdateCheck, EnterpriseLicenseValidationUrl, Host, } from "../EnvironmentConfig";
10
10
  import VersionUtil from "../../Utils/VersionUtil";
11
11
  import UserMiddleware from "../Middleware/UserAuthorization";
12
+ import MasterAdminAuthorization from "../Middleware/MasterAdminAuthorization";
13
+ import EnterpriseLicenseSeatUtil from "../Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil";
14
+ import UserService from "../Services/UserService";
12
15
  export default class GlobalConfigAPI extends BaseAPI {
13
16
  constructor() {
14
- var _a, _b, _c;
17
+ var _a, _b, _c, _d;
15
18
  super(GlobalConfig, GlobalConfigService);
16
19
  this.router.get(`${(_a = new this.entityType().getCrudApiPath()) === null || _a === void 0 ? void 0 : _a.toString()}/vars`, async (req, res, next) => {
17
20
  try {
@@ -66,62 +69,61 @@ export default class GlobalConfigAPI extends BaseAPI {
66
69
  const licenseValid = Boolean((config === null || config === void 0 ? void 0 : config.enterpriseLicenseToken) &&
67
70
  (config === null || config === void 0 ? void 0 : config.enterpriseLicenseExpiresAt) &&
68
71
  config.enterpriseLicenseExpiresAt.getTime() > Date.now());
69
- const responseBody = {
70
- companyName: (config === null || config === void 0 ? void 0 : config.enterpriseCompanyName) || null,
71
- expiresAt: (config === null || config === void 0 ? void 0 : config.enterpriseLicenseExpiresAt)
72
+ /*
73
+ * What the seat limit actually means on this installation right now,
74
+ * as opposed to what oneuptime.com last reported. Only for signed-in
75
+ * callers: it is derived from the live User table, and an anonymous
76
+ * visitor on the login page has no business being told how close this
77
+ * server is to refusing new accounts.
78
+ */
79
+ const seatUsage = isAuthenticatedUser
80
+ ? await EnterpriseLicenseSeatUtil.getSeatUsageForLoadedGlobalConfig({
81
+ config: config,
82
+ getLocalUserCount: GlobalConfigAPI.getLocalUserCount,
83
+ })
84
+ : null;
85
+ const responseBody = Object.assign({ companyName: (config === null || config === void 0 ? void 0 : config.enterpriseCompanyName) || null, expiresAt: (config === null || config === void 0 ? void 0 : config.enterpriseLicenseExpiresAt)
72
86
  ? config.enterpriseLicenseExpiresAt.toISOString()
73
- : null,
74
- licenseKey: isAuthenticatedUser
87
+ : null, licenseKey: isAuthenticatedUser
75
88
  ? (config === null || config === void 0 ? void 0 : config.enterpriseLicenseKey) || null
76
- : null,
77
- token: isAuthenticatedUser
89
+ : null, token: isAuthenticatedUser
78
90
  ? (config === null || config === void 0 ? void 0 : config.enterpriseLicenseToken) || null
79
- : null,
80
- licenseValid: licenseValid,
91
+ : null, licenseValid: licenseValid,
81
92
  /*
82
93
  * Whether this is an evaluation/testing license. Benign like the
83
94
  * company name and expiry, so it is not gated behind sign-in — the
84
95
  * edition modal shows the evaluation notice to anyone who opens it.
85
96
  */
86
- isEvaluationLicense: Boolean(config === null || config === void 0 ? void 0 : config.enterpriseLicenseIsEvaluation),
87
- userLimit: typeof (config === null || config === void 0 ? void 0 : config.enterpriseLicenseUserLimit) === "number"
97
+ isEvaluationLicense: Boolean(config === null || config === void 0 ? void 0 : config.enterpriseLicenseIsEvaluation), userLimit: typeof (config === null || config === void 0 ? void 0 : config.enterpriseLicenseUserLimit) === "number"
88
98
  ? config.enterpriseLicenseUserLimit
89
- : null,
90
- currentUserCount: typeof (config === null || config === void 0 ? void 0 : config.enterpriseLicenseCurrentUserCount) === "number"
99
+ : null, currentUserCount: typeof (config === null || config === void 0 ? void 0 : config.enterpriseLicenseCurrentUserCount) === "number"
91
100
  ? config.enterpriseLicenseCurrentUserCount
92
- : null,
93
- userCountUpdatedAt: (config === null || config === void 0 ? void 0 : config.enterpriseLicenseUserCountUpdatedAt)
101
+ : null, userCountUpdatedAt: (config === null || config === void 0 ? void 0 : config.enterpriseLicenseUserCountUpdatedAt)
94
102
  ? config.enterpriseLicenseUserCountUpdatedAt.toISOString()
95
- : null,
96
- instances: isAuthenticatedUser &&
103
+ : null, instances: isAuthenticatedUser &&
97
104
  Array.isArray(config === null || config === void 0 ? void 0 : config.enterpriseLicenseInstances)
98
105
  ? config.enterpriseLicenseInstances
99
- : [],
100
- instanceId: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.instanceId)
106
+ : [], instanceId: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.instanceId)
101
107
  ? config.instanceId.toString()
102
- : null,
108
+ : null,
103
109
  /*
104
110
  * Which build this installation runs, and whether a newer one has
105
111
  * been released, are gated the same way as the instance topology:
106
112
  * telling an anonymous visitor on the login page that this server
107
113
  * is behind on patches advertises an unpatched target.
108
114
  */
109
- currentVersion: isAuthenticatedUser ? AppVersion : null,
110
- latestVersion: isAuthenticatedUser
115
+ currentVersion: isAuthenticatedUser ? AppVersion : null, latestVersion: isAuthenticatedUser
111
116
  ? (config === null || config === void 0 ? void 0 : config.latestReleaseVersion) || null
112
- : null,
113
- latestVersionPublishedAt: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.latestReleasePublishedAt)
117
+ : null, latestVersionPublishedAt: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.latestReleasePublishedAt)
114
118
  ? config.latestReleasePublishedAt.toISOString()
115
- : null,
116
- latestVersionCheckedAt: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.latestReleaseCheckedAt)
119
+ : null, latestVersionCheckedAt: isAuthenticatedUser && (config === null || config === void 0 ? void 0 : config.latestReleaseCheckedAt)
117
120
  ? config.latestReleaseCheckedAt.toISOString()
118
- : null,
119
- isUpdateAvailable: isAuthenticatedUser
121
+ : null, isUpdateAvailable: isAuthenticatedUser
120
122
  ? VersionUtil.isUpdateAvailable({
121
123
  currentVersion: AppVersion,
122
124
  latestVersion: config === null || config === void 0 ? void 0 : config.latestReleaseVersion,
123
125
  })
124
- : false,
126
+ : false,
125
127
  /*
126
128
  * Lets the modal say "update checks are off" instead of "has not
127
129
  * checked yet", which would be a promise the installation is never
@@ -129,175 +131,290 @@ export default class GlobalConfigAPI extends BaseAPI {
129
131
  */
130
132
  isUpdateCheckDisabled: isAuthenticatedUser
131
133
  ? DisableUpdateCheck
132
- : false,
133
- };
134
+ : false }, GlobalConfigAPI.getSeatUsageResponseFields(seatUsage));
134
135
  return Response.sendJsonObjectResponse(req, res, responseBody);
135
136
  }
136
137
  catch (err) {
137
138
  next(err);
138
139
  }
139
140
  });
140
- this.router.post(`${(_c = new this.entityType().getCrudApiPath()) === null || _c === void 0 ? void 0 : _c.toString()}/license`, UserMiddleware.getUserMiddleware, async (req, res, next) => {
141
- var _a, _b, _c;
141
+ /*
142
+ * Activating (or replacing) the license key for the whole installation.
143
+ *
144
+ * Master admin only. This writes the terms that bound how many users the
145
+ * installation may have, so anyone who can reach it can change the seat
146
+ * limit UserService now enforces. It used to run on
147
+ * UserMiddleware.getUserMiddleware, which lets anonymous callers through
148
+ * (it has to — the GET above serves the signed-out login page), so the
149
+ * route was in practice unauthenticated.
150
+ */
151
+ this.router.post(`${(_c = new this.entityType().getCrudApiPath()) === null || _c === void 0 ? void 0 : _c.toString()}/license`, MasterAdminAuthorization.isAuthorizedMasterAdminMiddleware, async (req, res, next) => {
152
+ var _a;
142
153
  try {
143
154
  const licenseKey = ((_a = req.body["licenseKey"]) === null || _a === void 0 ? void 0 : _a.trim()) || "";
144
155
  if (!licenseKey) {
145
156
  throw new BadDataException("License key is required");
146
157
  }
147
- const globalConfigId = ObjectID.getZeroObjectID();
148
- const existingConfig = await GlobalConfigService.findOneById({
149
- id: globalConfigId,
158
+ const responseBody = await this.validateAndStoreLicenseKey(licenseKey);
159
+ return Response.sendJsonObjectResponse(req, res, responseBody);
160
+ }
161
+ catch (err) {
162
+ next(err);
163
+ }
164
+ });
165
+ /*
166
+ * Re-fetch the license this installation already holds.
167
+ *
168
+ * The seat limit and the expiry live on oneuptime.com and can change on
169
+ * any day — a customer buys ten more seats at noon. The daily report job
170
+ * picks that up eventually; this is the button an administrator presses
171
+ * when "eventually" is not good enough, and it is the only way to apply a
172
+ * change without re-typing the key.
173
+ *
174
+ * Deliberately takes no license key: it uses the stored one. A refresh
175
+ * that accepted a key would be an activation with a friendlier name, and
176
+ * would let a mistyped key replace a working license by accident.
177
+ */
178
+ this.router.post(`${(_d = new this.entityType().getCrudApiPath()) === null || _d === void 0 ? void 0 : _d.toString()}/license/refresh`, MasterAdminAuthorization.isAuthorizedMasterAdminMiddleware, async (req, res, next) => {
179
+ var _a;
180
+ try {
181
+ const config = await GlobalConfigService.findOneById({
182
+ id: ObjectID.getZeroObjectID(),
150
183
  select: {
151
- _id: true,
152
- instanceId: true,
184
+ enterpriseLicenseKey: true,
153
185
  },
154
186
  props: {
155
187
  isRoot: true,
156
- ignoreHooks: true,
157
- },
158
- });
159
- /*
160
- * Send this instance's id and host along with the key so the
161
- * license server registers this instance against the license and
162
- * it shows up in the instance list on all instances that share
163
- * the license.
164
- */
165
- const instanceId = (existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.instanceId) || ObjectID.generate();
166
- const validationResponse = await API.post({
167
- url: EnterpriseLicenseValidationUrl,
168
- data: {
169
- licenseKey,
170
- instanceId: instanceId.toString(),
171
- host: Host,
172
- /*
173
- * Sent here as well as from the daily report job so the version
174
- * lands on the license server the moment the key is validated,
175
- * rather than up to 24 hours later.
176
- */
177
- version: AppVersion,
178
188
  },
179
189
  });
180
- if (!validationResponse.isSuccess()) {
181
- const errorMessage = validationResponse instanceof HTTPErrorResponse
182
- ? validationResponse.message ||
183
- "Failed to validate license key."
184
- : "Failed to validate license key.";
185
- throw new BadDataException(errorMessage);
186
- }
187
- const payload = validationResponse.data;
188
- const companyNameRaw = ((_b = payload["companyName"]) === null || _b === void 0 ? void 0 : _b.trim()) || "";
189
- const expiresAtRaw = payload["expiresAt"] || "";
190
- const licenseKeyRaw = ((_c = payload["licenseKey"]) === null || _c === void 0 ? void 0 : _c.trim()) || licenseKey;
191
- const licenseToken = payload["token"] || "";
192
- let licenseExpiry = undefined;
193
- if (expiresAtRaw) {
194
- const parsedDate = new Date(expiresAtRaw);
195
- if (Number.isNaN(parsedDate.getTime())) {
196
- throw new BadDataException("License expiration returned from server is invalid.");
197
- }
198
- licenseExpiry = parsedDate;
199
- }
200
- const userLimitRaw = payload["userLimit"];
201
- const userLimit = typeof userLimitRaw === "number" && Number.isFinite(userLimitRaw)
202
- ? userLimitRaw
203
- : null;
204
- const currentUserCountRaw = payload["currentUserCount"];
205
- const currentUserCount = typeof currentUserCountRaw === "number" &&
206
- Number.isFinite(currentUserCountRaw)
207
- ? currentUserCountRaw
208
- : null;
209
- const userCountUpdatedAtRaw = payload["userCountUpdatedAt"];
210
- let userCountUpdatedAt = null;
211
- if (userCountUpdatedAtRaw) {
212
- const parsedReportedAt = new Date(userCountUpdatedAtRaw);
213
- if (!Number.isNaN(parsedReportedAt.getTime())) {
214
- userCountUpdatedAt = parsedReportedAt;
215
- }
216
- }
217
- const isEvaluationLicense = payload["isEvaluationLicense"] === true;
218
- const instances = Array.isArray(payload["instances"])
219
- ? payload["instances"]
220
- : [];
221
- const updatePayload = {
222
- enterpriseCompanyName: companyNameRaw || null,
223
- enterpriseLicenseKey: licenseKeyRaw || null,
224
- enterpriseLicenseExpiresAt: licenseExpiry || null,
225
- enterpriseLicenseToken: licenseToken || null,
226
- enterpriseLicenseIsEvaluation: isEvaluationLicense,
227
- enterpriseLicenseUserLimit: userLimit,
228
- enterpriseLicenseCurrentUserCount: currentUserCount,
229
- enterpriseLicenseUserCountUpdatedAt: userCountUpdatedAt,
230
- enterpriseLicenseInstances: instances,
231
- };
232
- if (!(existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.instanceId)) {
233
- // Installs that predate instance ids: persist the one we generated.
234
- updatePayload.instanceId = instanceId;
235
- }
236
- if (existingConfig) {
237
- await GlobalConfigService.updateOneById({
238
- id: globalConfigId,
239
- data: updatePayload,
240
- props: {
241
- isRoot: true,
242
- ignoreHooks: true,
243
- },
244
- });
245
- }
246
- else {
247
- const newConfig = new GlobalConfig();
248
- newConfig.id = globalConfigId;
249
- if (companyNameRaw) {
250
- newConfig.enterpriseCompanyName = companyNameRaw;
251
- }
252
- if (licenseKeyRaw) {
253
- newConfig.enterpriseLicenseKey = licenseKeyRaw;
254
- }
255
- if (licenseToken) {
256
- newConfig.enterpriseLicenseToken = licenseToken;
257
- }
258
- newConfig.enterpriseLicenseIsEvaluation = isEvaluationLicense;
259
- if (licenseExpiry) {
260
- newConfig.enterpriseLicenseExpiresAt = licenseExpiry;
261
- }
262
- if (userLimit !== null) {
263
- newConfig.enterpriseLicenseUserLimit = userLimit;
264
- }
265
- if (currentUserCount !== null) {
266
- newConfig.enterpriseLicenseCurrentUserCount = currentUserCount;
267
- }
268
- if (userCountUpdatedAt) {
269
- newConfig.enterpriseLicenseUserCountUpdatedAt =
270
- userCountUpdatedAt;
271
- }
272
- newConfig.enterpriseLicenseInstances = instances;
273
- newConfig.instanceId = instanceId;
274
- await GlobalConfigService.create({
275
- data: newConfig,
276
- props: {
277
- isRoot: true,
278
- ignoreHooks: true,
279
- },
280
- });
190
+ const licenseKey = ((_a = config === null || config === void 0 ? void 0 : config.enterpriseLicenseKey) === null || _a === void 0 ? void 0 : _a.trim()) || "";
191
+ if (!licenseKey) {
192
+ throw new BadDataException("This installation does not have an enterprise license key yet. Enter a license key to activate it first.");
281
193
  }
282
- return Response.sendJsonObjectResponse(req, res, {
283
- companyName: companyNameRaw || null,
284
- expiresAt: licenseExpiry ? licenseExpiry.toISOString() : null,
285
- licenseKey: licenseKeyRaw || null,
286
- token: licenseToken || null,
287
- isEvaluationLicense: isEvaluationLicense,
288
- userLimit: userLimit,
289
- currentUserCount: currentUserCount,
290
- userCountUpdatedAt: userCountUpdatedAt
291
- ? userCountUpdatedAt.toISOString()
292
- : null,
293
- instances: instances,
294
- instanceId: instanceId.toString(),
295
- });
194
+ const responseBody = await this.validateAndStoreLicenseKey(licenseKey);
195
+ return Response.sendJsonObjectResponse(req, res, responseBody);
296
196
  }
297
197
  catch (err) {
298
198
  next(err);
299
199
  }
300
200
  });
301
201
  }
202
+ /*
203
+ * Ask oneuptime.com what this license key is worth today, and mirror the
204
+ * answer into GlobalConfig.
205
+ *
206
+ * Shared by activation and refresh so the two cannot drift: the whole point
207
+ * of refresh is that it applies exactly what activation would have applied,
208
+ * and a second hand-written copy of this mapping is how the seat limit came
209
+ * to be dropped on the floor by the daily report job before.
210
+ */
211
+ async validateAndStoreLicenseKey(licenseKey) {
212
+ var _a, _b;
213
+ const globalConfigId = ObjectID.getZeroObjectID();
214
+ const existingConfig = await GlobalConfigService.findOneById({
215
+ id: globalConfigId,
216
+ select: {
217
+ _id: true,
218
+ instanceId: true,
219
+ },
220
+ props: {
221
+ isRoot: true,
222
+ ignoreHooks: true,
223
+ },
224
+ });
225
+ /*
226
+ * Send this instance's id and host along with the key so the
227
+ * license server registers this instance against the license and
228
+ * it shows up in the instance list on all instances that share
229
+ * the license.
230
+ */
231
+ const instanceId = (existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.instanceId) || ObjectID.generate();
232
+ const validationResponse = await API.post({
233
+ url: EnterpriseLicenseValidationUrl,
234
+ data: {
235
+ licenseKey,
236
+ instanceId: instanceId.toString(),
237
+ host: Host,
238
+ /*
239
+ * Sent here as well as from the daily report job so the version
240
+ * lands on the license server the moment the key is validated,
241
+ * rather than up to 24 hours later.
242
+ */
243
+ version: AppVersion,
244
+ },
245
+ });
246
+ if (!validationResponse.isSuccess()) {
247
+ const errorMessage = validationResponse instanceof HTTPErrorResponse
248
+ ? validationResponse.message || "Failed to validate license key."
249
+ : "Failed to validate license key.";
250
+ throw new BadDataException(errorMessage);
251
+ }
252
+ const payload = validationResponse.data;
253
+ const companyNameRaw = ((_a = payload["companyName"]) === null || _a === void 0 ? void 0 : _a.trim()) || "";
254
+ const expiresAtRaw = payload["expiresAt"] || "";
255
+ const licenseKeyRaw = ((_b = payload["licenseKey"]) === null || _b === void 0 ? void 0 : _b.trim()) || licenseKey;
256
+ const licenseToken = payload["token"] || "";
257
+ let licenseExpiry = undefined;
258
+ if (expiresAtRaw) {
259
+ const parsedDate = new Date(expiresAtRaw);
260
+ if (Number.isNaN(parsedDate.getTime())) {
261
+ throw new BadDataException("License expiration returned from server is invalid.");
262
+ }
263
+ licenseExpiry = parsedDate;
264
+ }
265
+ const userLimitRaw = payload["userLimit"];
266
+ const userLimit = typeof userLimitRaw === "number" && Number.isFinite(userLimitRaw)
267
+ ? userLimitRaw
268
+ : null;
269
+ const currentUserCountRaw = payload["currentUserCount"];
270
+ const currentUserCount = typeof currentUserCountRaw === "number" &&
271
+ Number.isFinite(currentUserCountRaw)
272
+ ? currentUserCountRaw
273
+ : null;
274
+ const userCountUpdatedAtRaw = payload["userCountUpdatedAt"];
275
+ let userCountUpdatedAt = null;
276
+ if (userCountUpdatedAtRaw) {
277
+ const parsedReportedAt = new Date(userCountUpdatedAtRaw);
278
+ if (!Number.isNaN(parsedReportedAt.getTime())) {
279
+ userCountUpdatedAt = parsedReportedAt;
280
+ }
281
+ }
282
+ const isEvaluationLicense = payload["isEvaluationLicense"] === true;
283
+ const instances = Array.isArray(payload["instances"])
284
+ ? payload["instances"]
285
+ : [];
286
+ const updatePayload = {
287
+ enterpriseCompanyName: companyNameRaw || null,
288
+ enterpriseLicenseKey: licenseKeyRaw || null,
289
+ enterpriseLicenseExpiresAt: licenseExpiry || null,
290
+ enterpriseLicenseToken: licenseToken || null,
291
+ enterpriseLicenseIsEvaluation: isEvaluationLicense,
292
+ enterpriseLicenseUserLimit: userLimit,
293
+ enterpriseLicenseCurrentUserCount: currentUserCount,
294
+ enterpriseLicenseUserCountUpdatedAt: userCountUpdatedAt,
295
+ enterpriseLicenseInstances: instances,
296
+ };
297
+ if (!(existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.instanceId)) {
298
+ // Installs that predate instance ids: persist the one we generated.
299
+ updatePayload.instanceId = instanceId;
300
+ }
301
+ if (existingConfig) {
302
+ await GlobalConfigService.updateOneById({
303
+ id: globalConfigId,
304
+ data: updatePayload,
305
+ props: {
306
+ isRoot: true,
307
+ ignoreHooks: true,
308
+ },
309
+ });
310
+ }
311
+ else {
312
+ const newConfig = new GlobalConfig();
313
+ newConfig.id = globalConfigId;
314
+ if (companyNameRaw) {
315
+ newConfig.enterpriseCompanyName = companyNameRaw;
316
+ }
317
+ if (licenseKeyRaw) {
318
+ newConfig.enterpriseLicenseKey = licenseKeyRaw;
319
+ }
320
+ if (licenseToken) {
321
+ newConfig.enterpriseLicenseToken = licenseToken;
322
+ }
323
+ newConfig.enterpriseLicenseIsEvaluation = isEvaluationLicense;
324
+ if (licenseExpiry) {
325
+ newConfig.enterpriseLicenseExpiresAt = licenseExpiry;
326
+ }
327
+ if (userLimit !== null) {
328
+ newConfig.enterpriseLicenseUserLimit = userLimit;
329
+ }
330
+ if (currentUserCount !== null) {
331
+ newConfig.enterpriseLicenseCurrentUserCount = currentUserCount;
332
+ }
333
+ if (userCountUpdatedAt) {
334
+ newConfig.enterpriseLicenseUserCountUpdatedAt = userCountUpdatedAt;
335
+ }
336
+ newConfig.enterpriseLicenseInstances = instances;
337
+ newConfig.instanceId = instanceId;
338
+ await GlobalConfigService.create({
339
+ data: newConfig,
340
+ props: {
341
+ isRoot: true,
342
+ ignoreHooks: true,
343
+ },
344
+ });
345
+ }
346
+ /*
347
+ * Seat usage recomputed from what was just stored, so the dialog that
348
+ * triggered this can show the new limit against the real user count
349
+ * without a second round trip - and so an administrator who just bought
350
+ * seats sees them land.
351
+ */
352
+ const seatUsage = await GlobalConfigAPI.getSeatUsageForResponse({
353
+ userLimit: userLimit,
354
+ currentUserCount: currentUserCount,
355
+ instances: instances,
356
+ instanceId: instanceId,
357
+ });
358
+ return Object.assign({ companyName: companyNameRaw || null, expiresAt: licenseExpiry ? licenseExpiry.toISOString() : null, licenseKey: licenseKeyRaw || null, token: licenseToken || null, isEvaluationLicense: isEvaluationLicense, userLimit: userLimit, currentUserCount: currentUserCount, userCountUpdatedAt: userCountUpdatedAt
359
+ ? userCountUpdatedAt.toISOString()
360
+ : null, instances: instances, instanceId: instanceId.toString() }, GlobalConfigAPI.getSeatUsageResponseFields(seatUsage));
361
+ }
362
+ /*
363
+ * Seat usage built from license terms held in memory rather than re-read
364
+ * from the database. Used right after a write, where re-reading would race
365
+ * the write it is describing.
366
+ */
367
+ static async getSeatUsageForResponse(data) {
368
+ const config = new GlobalConfig();
369
+ config.instanceId = data.instanceId;
370
+ config.enterpriseLicenseInstances = data.instances;
371
+ if (data.userLimit !== null) {
372
+ config.enterpriseLicenseUserLimit = data.userLimit;
373
+ }
374
+ if (data.currentUserCount !== null) {
375
+ config.enterpriseLicenseCurrentUserCount = data.currentUserCount;
376
+ }
377
+ return EnterpriseLicenseSeatUtil.getSeatUsageForLoadedGlobalConfig({
378
+ config: config,
379
+ getLocalUserCount: GlobalConfigAPI.getLocalUserCount,
380
+ });
381
+ }
382
+ /*
383
+ * How many users exist on this installation right now. Deliberately the live
384
+ * count rather than the last reported one: the number an administrator is
385
+ * about to act on is the number that decides whether the next invitation
386
+ * goes through.
387
+ */
388
+ static async getLocalUserCount() {
389
+ const userCount = await UserService.countBy({
390
+ query: {},
391
+ props: {
392
+ isRoot: true,
393
+ },
394
+ });
395
+ return userCount.toNumber();
396
+ }
397
+ /*
398
+ * The seat-enforcement half of a license response. Always the same keys, so
399
+ * a client never has to tell "this build does not report seats" apart from
400
+ * "this installation does not enforce them" by which fields are missing:
401
+ * isSeatLimitEnforced is the single flag that answers that.
402
+ */
403
+ static getSeatUsageResponseFields(seatUsage) {
404
+ if (!seatUsage || !seatUsage.isEnforced) {
405
+ return {
406
+ isSeatLimitEnforced: false,
407
+ seatsInUse: null,
408
+ seatsRemaining: null,
409
+ canAddMoreUsers: true,
410
+ };
411
+ }
412
+ return {
413
+ isSeatLimitEnforced: true,
414
+ seatsInUse: seatUsage.seatsInUse,
415
+ seatsRemaining: seatUsage.seatsRemaining,
416
+ canAddMoreUsers: seatUsage.hasSeatForNewUser,
417
+ };
418
+ }
302
419
  }
303
420
  //# sourceMappingURL=GlobalConfigAPI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalConfigAPI.js","sourceRoot":"","sources":["../../../../Server/API/GlobalConfigAPI.ts"],"names":[],"mappings":"AAAA,OAAO,mBAEN,MAAM,iCAAiC,CAAC;AAOzC,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,YAAY,MAAM,0CAA0C,CAAC;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AAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,KAAK,CAAC,iBAAiB;QACpC,MAAM,SAAS,GAAmB,MAAM,WAAW,CAAC,OAAO,CAAC;YAC1D,KAAK,EAAE,EAAE;YACT,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;aACb;SACF,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,0BAA0B,CACvC,SAA2B;QAE3B,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YACxC,OAAO;gBACL,mBAAmB,EAAE,KAAK;gBAC1B,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,IAAI;gBACpB,eAAe,EAAE,IAAI;aACtB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,mBAAmB,EAAE,IAAI;YACzB,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,eAAe,EAAE,SAAS,CAAC,iBAAiB;SAC7C,CAAC;IACJ,CAAC;CACF"}
@@ -6,7 +6,7 @@ import CommonAPI from "./CommonAPI";
6
6
  import TelemetryType from "../../Types/Telemetry/TelemetryType";
7
7
  import TelemetryAttributeService from "../Services/TelemetryAttributeService";
8
8
  import TelemetrySourceMapService from "../Services/TelemetrySourceMapService";
9
- import SourceMapResolver from "../Utils/Telemetry/SourceMapResolver";
9
+ import SourceMapResolver, { MAX_FRAMES_PER_RESOLVE_REQUEST, } from "../Utils/Telemetry/SourceMapResolver";
10
10
  import LogAggregationService from "../Services/LogAggregationService";
11
11
  import TraceAggregationService from "../Services/TraceAggregationService";
12
12
  import ExceptionAggregationService from "../Services/ExceptionAggregationService";
@@ -79,9 +79,28 @@ const requireExceptionReadAccess = createTelemetryReadAccessGuard(Permission.Rea
79
79
  const requireProfileReadAccess = createTelemetryReadAccessGuard(Permission.ReadTelemetryServiceProfiles);
80
80
  /*
81
81
  * Mirrors the read access control declared on the SecurityEvent analytics
82
- * model.
82
+ * model - which, unlike every other signal above, is NOT the telemetry list.
83
+ * Security events read through the Security tiers only, so this route cannot
84
+ * be built from createTelemetryReadAccessGuard: doing so would leave the
85
+ * attribute endpoints open to ProjectMember and the Telemetry tiers while the
86
+ * model-backed CRUD API refused them, and the attribute keys and values of a
87
+ * SIEM table are themselves the sensitive part - usernames, hostnames, source
88
+ * IPs, and every value seen for them.
83
89
  */
84
- const requireSecurityEventReadAccess = createTelemetryReadAccessGuard(Permission.ReadSecurityEvent);
90
+ const requireSecurityEventReadAccess = [
91
+ UserMiddleware.getUserMiddleware,
92
+ UserMiddleware.requireUserAuthentication,
93
+ UserMiddleware.requirePermission({
94
+ permissions: [
95
+ Permission.ProjectOwner,
96
+ Permission.ProjectAdmin,
97
+ Permission.SecurityAdmin,
98
+ Permission.SecurityMember,
99
+ Permission.SecurityViewer,
100
+ Permission.ReadSecurityEvent,
101
+ ],
102
+ }),
103
+ ];
85
104
  router.post("/telemetry/metrics/get-attributes", ...requireMetricReadAccess, async (req, res, next) => {
86
105
  return getAttributes(req, res, next, TelemetryType.Metric);
87
106
  });
@@ -141,6 +160,15 @@ router.post("/telemetry/exceptions/resolve-stack-trace", ...requireExceptionRead
141
160
  if (!Array.isArray(body["frames"])) {
142
161
  return Response.sendErrorResponse(req, res, new BadDataException("frames must be an array of stack frames"));
143
162
  }
163
+ /*
164
+ * Bound the array before sanitizing it. sanitizeMinifiedStackFrames
165
+ * never throws and never truncates, so without this the only limit on
166
+ * the work a caller can ask for is the body-size cap.
167
+ */
168
+ if (body["frames"].length >
169
+ MAX_FRAMES_PER_RESOLVE_REQUEST) {
170
+ return Response.sendErrorResponse(req, res, new BadDataException(`frames must contain at most ${MAX_FRAMES_PER_RESOLVE_REQUEST} stack frames.`));
171
+ }
144
172
  const frames = SourceMapResolver.sanitizeMinifiedStackFrames(body["frames"]);
145
173
  const result = await TelemetrySourceMapService.resolveFramesForService({
146
174
  projectId: databaseProps.tenantId,