@oneuptime/common 14.0.110 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/Models/DatabaseModels/AIRunRecording.d.mts +12 -0
  2. package/Models/DatabaseModels/AIRunRecording.d.ts +12 -0
  3. package/Models/DatabaseModels/AIRunRecording.js +181 -0
  4. package/Models/DatabaseModels/AIRunRecording.mjs +2 -0
  5. package/Models/DatabaseModels/Alert.js +18 -2
  6. package/Models/DatabaseModels/DataStore.js +9 -0
  7. package/Models/DatabaseModels/EmailLog.js +2 -2
  8. package/Models/DatabaseModels/Form.js +3 -3
  9. package/Models/DatabaseModels/FormSubmission.js +4 -4
  10. package/Models/DatabaseModels/GlobalConfig.js +46 -45
  11. package/Models/DatabaseModels/Incident.js +18 -2
  12. package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
  13. package/Models/DatabaseModels/Index.js +4 -0
  14. package/Models/DatabaseModels/InventoryItem.js +11 -0
  15. package/Models/DatabaseModels/Monitor.js +51 -17
  16. package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
  17. package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
  18. package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
  19. package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
  20. package/Models/DatabaseModels/MonitorProbe.js +22 -5
  21. package/Models/DatabaseModels/NetworkDevice.js +23 -7
  22. package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
  23. package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
  24. package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
  25. package/Models/DatabaseModels/NetworkInterface.js +5 -5
  26. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +19 -5
  27. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
  28. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
  29. package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +2 -0
  30. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
  31. package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
  32. package/Models/DatabaseModels/Project.d.mts +1 -0
  33. package/Models/DatabaseModels/Project.d.ts +1 -0
  34. package/Models/DatabaseModels/Project.js +46 -3
  35. package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
  36. package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
  37. package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
  38. package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
  39. package/Models/DatabaseModels/RunbookExecution.js +2 -2
  40. package/Models/DatabaseModels/RunbookRule.js +6 -6
  41. package/Models/DatabaseModels/ScheduledMaintenance.js +3 -3
  42. package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
  43. package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
  44. package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
  45. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +1 -1
  46. package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
  47. package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
  48. package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
  49. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +3 -3
  50. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
  51. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +3 -3
  52. package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
  53. package/Models/DatabaseModels/TeamMember.js +10 -1
  54. package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
  55. package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
  56. package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
  57. package/Server/Services/DatabaseService.d.mts +4 -1
  58. package/Server/Services/DatabaseService.d.ts +4 -1
  59. package/Server/Types/Database/CountBy.d.mts +1 -0
  60. package/Server/Types/Database/CountBy.d.ts +1 -0
  61. package/Server/Types/Database/UpdateLimit.d.mts +6 -0
  62. package/Server/Types/Database/UpdateLimit.d.ts +6 -0
  63. package/Types/AI/AIActionWords.d.mts +25 -1
  64. package/Types/AI/AIActionWords.d.ts +25 -1
  65. package/Types/AI/AIActionWords.js +166 -3
  66. package/Types/AI/AIActionWords.mjs +6 -0
  67. package/Types/AI/AIChatTypes.d.mts +2 -1
  68. package/Types/AI/AIChatTypes.d.ts +2 -1
  69. package/Types/AI/AiOutcomes.d.mts +57 -0
  70. package/Types/AI/AiOutcomes.d.ts +57 -0
  71. package/Types/AI/AiOutcomes.js +67 -0
  72. package/Types/AI/AiOutcomes.mjs +10 -0
  73. package/Types/AI/AiRunRefusal.d.mts +45 -0
  74. package/Types/AI/AiRunRefusal.d.ts +45 -0
  75. package/Types/AI/AiRunRefusal.js +187 -0
  76. package/Types/AI/AiRunRefusal.mjs +12 -0
  77. package/Types/AI/InvestigationRecording.d.mts +46 -0
  78. package/Types/AI/InvestigationRecording.d.ts +46 -0
  79. package/Types/AI/InvestigationRecording.js +42 -0
  80. package/Types/AI/InvestigationRecording.mjs +7 -0
  81. package/Types/API/HTTPResponse.d.mts +3 -0
  82. package/Types/API/HTTPResponse.d.ts +3 -0
  83. package/Types/API/HTTPResponse.js +15 -0
  84. package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
  85. package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
  86. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -1
  87. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -1
  88. package/Types/BaseDatabase/AggregationIntervalUtil.js +92 -2
  89. package/Types/BaseDatabase/ListResult.d.mts +1 -0
  90. package/Types/BaseDatabase/ListResult.d.ts +1 -0
  91. package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
  92. package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
  93. package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
  94. package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
  95. package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
  96. package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
  97. package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
  98. package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
  99. package/Types/Date.d.mts +6 -1
  100. package/Types/Date.d.ts +6 -1
  101. package/Types/Date.js +39 -7
  102. package/Types/Date.mjs +1 -0
  103. package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
  104. package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
  105. package/Types/Email/ServerEmailEnvironment.js +793 -0
  106. package/Types/Email/ServerEmailEnvironment.mjs +14 -0
  107. package/Types/Exception/AiRunRefusalException.d.mts +6 -0
  108. package/Types/Exception/AiRunRefusalException.d.ts +6 -0
  109. package/Types/Exception/AiRunRefusalException.js +23 -0
  110. package/Types/Exception/AiRunRefusalException.mjs +2 -0
  111. package/Types/Form/FormTargetCatalog.js +2 -2
  112. package/Types/Form/FormTargetType.js +2 -2
  113. package/Types/ListData.d.mts +2 -0
  114. package/Types/ListData.d.ts +2 -0
  115. package/Types/ListData.js +4 -0
  116. package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
  117. package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
  118. package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
  119. package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
  120. package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
  121. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
  122. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
  123. package/Types/Monitor/UptimeHistoryLabels.js +2 -2
  124. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
  125. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
  126. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
  127. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
  128. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
  129. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
  130. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
  131. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
  132. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
  133. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
  134. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
  135. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
  136. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
  137. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
  138. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
  139. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
  140. package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
  141. package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
  142. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
  143. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
  144. package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
  145. package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
  146. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
  147. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
  148. package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
  149. package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
  150. package/Types/Permission.js +2 -2
  151. package/Types/Probe/ProbeCapability.d.mts +2 -1
  152. package/Types/Probe/ProbeCapability.d.ts +2 -1
  153. package/Types/Probe/ProbeCapability.js +10 -0
  154. package/Types/ReaderLanguage.d.mts +1 -0
  155. package/Types/ReaderLanguage.d.ts +1 -0
  156. package/Types/ReaderLanguage.js +13 -1
  157. package/Types/ReaderLanguage.mjs +1 -0
  158. package/Types/Rules/RuleRun.js +2 -2
  159. package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
  160. package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
  161. package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
  162. package/Types/ServerSending/ServerSendingStatus.js +49 -2
  163. package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
  164. package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
  165. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
  166. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
  167. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
  168. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
  169. package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
  170. package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
  171. package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
  172. package/Types/Telemetry/CompatibleIngest.js +123 -0
  173. package/Types/Telemetry/CompatibleIngest.mjs +21 -0
  174. package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
  175. package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
  176. package/Types/Telemetry/TelemetryIngestSurface.js +48 -7
  177. package/Types/TimezoneAlias.d.mts +1 -0
  178. package/Types/TimezoneAlias.d.ts +1 -0
  179. package/Types/TimezoneAlias.js +13 -0
  180. package/Types/Translator.js +374 -48
  181. package/Types/Workflow/RunRecord.js +1 -1
  182. package/Types/Workflow/Templates.js +2 -2
  183. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
  184. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
  185. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +26 -1
  186. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +26 -1
  187. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
  188. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
  189. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
  190. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
  191. package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
  192. package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
  193. package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
  194. package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
  195. package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
  196. package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
  197. package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
  198. package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
  199. package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
  200. package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
  201. package/Utils/HostAddressUtil.d.mts +1 -0
  202. package/Utils/HostAddressUtil.d.ts +1 -0
  203. package/Utils/HostAddressUtil.js +30 -0
  204. package/Utils/LinearRegExp/LinearRegExp.js +5 -1
  205. package/Utils/Milliseconds.d.mts +7 -0
  206. package/Utils/Milliseconds.d.ts +7 -0
  207. package/Utils/Milliseconds.js +60 -0
  208. package/Utils/Milliseconds.mjs +4 -0
  209. package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
  210. package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
  211. package/Utils/Monitor/EndpointAttachmentUtil.js +91 -21
  212. package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
  213. package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
  214. package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
  215. package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
  216. package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
  217. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
  218. package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
  219. package/Utils/Monitor/MonitorRootCauseWording.d.mts +2 -0
  220. package/Utils/Monitor/MonitorRootCauseWording.d.ts +2 -0
  221. package/Utils/Monitor/MonitorRootCauseWording.js +58 -4
  222. package/Utils/Monitor/MonitoringOff.d.mts +2 -0
  223. package/Utils/Monitor/MonitoringOff.d.ts +2 -0
  224. package/Utils/Monitor/MonitoringOff.js +21 -0
  225. package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
  226. package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
  227. package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
  228. package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
  229. package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
  230. package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
  231. package/Utils/Monitor/ProbeFailureReading.d.mts +14 -0
  232. package/Utils/Monitor/ProbeFailureReading.d.ts +14 -0
  233. package/Utils/Monitor/ProbeFailureReading.js +137 -0
  234. package/Utils/Monitor/ProbeFailureReading.mjs +7 -0
  235. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
  236. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
  237. package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
  238. package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
  239. package/Utils/Project/NextNumber.js +1 -1
  240. package/Utils/PromQL/PromQLAst.d.mts +159 -0
  241. package/Utils/PromQL/PromQLAst.d.ts +159 -0
  242. package/Utils/PromQL/PromQLAst.js +118 -0
  243. package/Utils/PromQL/PromQLAst.mjs +12 -0
  244. package/Utils/PromQL/PromQLDuration.d.mts +2 -0
  245. package/Utils/PromQL/PromQLDuration.d.ts +2 -0
  246. package/Utils/PromQL/PromQLDuration.js +78 -0
  247. package/Utils/PromQL/PromQLDuration.mjs +3 -0
  248. package/Utils/PromQL/PromQLEngine.d.mts +15 -0
  249. package/Utils/PromQL/PromQLEngine.d.ts +15 -0
  250. package/Utils/PromQL/PromQLEngine.js +965 -0
  251. package/Utils/PromQL/PromQLEngine.mjs +7 -0
  252. package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
  253. package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
  254. package/Utils/PromQL/PromQLEngineTypes.js +10 -0
  255. package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
  256. package/Utils/PromQL/PromQLError.d.mts +11 -0
  257. package/Utils/PromQL/PromQLError.d.ts +11 -0
  258. package/Utils/PromQL/PromQLError.js +27 -0
  259. package/Utils/PromQL/PromQLError.mjs +3 -0
  260. package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
  261. package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
  262. package/Utils/PromQL/PromQLFunctionEvaluators.js +773 -0
  263. package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
  264. package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
  265. package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
  266. package/Utils/PromQL/PromQLFunctions.js +127 -0
  267. package/Utils/PromQL/PromQLFunctions.mjs +4 -0
  268. package/Utils/PromQL/PromQLLabels.d.mts +11 -0
  269. package/Utils/PromQL/PromQLLabels.d.ts +11 -0
  270. package/Utils/PromQL/PromQLLabels.js +218 -0
  271. package/Utils/PromQL/PromQLLabels.mjs +9 -0
  272. package/Utils/PromQL/PromQLLexer.d.mts +39 -0
  273. package/Utils/PromQL/PromQLLexer.d.ts +39 -0
  274. package/Utils/PromQL/PromQLLexer.js +391 -0
  275. package/Utils/PromQL/PromQLLexer.mjs +3 -0
  276. package/Utils/PromQL/PromQLMath.d.mts +19 -0
  277. package/Utils/PromQL/PromQLMath.d.ts +19 -0
  278. package/Utils/PromQL/PromQLMath.js +200 -0
  279. package/Utils/PromQL/PromQLMath.mjs +9 -0
  280. package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
  281. package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
  282. package/Utils/PromQL/PromQLMetricNames.js +199 -0
  283. package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
  284. package/Utils/PromQL/PromQLParser.d.mts +4 -0
  285. package/Utils/PromQL/PromQLParser.d.ts +4 -0
  286. package/Utils/PromQL/PromQLParser.js +831 -0
  287. package/Utils/PromQL/PromQLParser.mjs +4 -0
  288. package/Utils/PromQL/PromQLRegex.d.mts +9 -0
  289. package/Utils/PromQL/PromQLRegex.d.ts +9 -0
  290. package/Utils/PromQL/PromQLRegex.js +74 -0
  291. package/Utils/PromQL/PromQLRegex.mjs +2 -0
  292. package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
  293. package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
  294. package/Utils/PromQL/PrometheusResponse.js +90 -0
  295. package/Utils/PromQL/PrometheusResponse.mjs +3 -0
  296. package/Utils/Rum/PathInSentence.d.mts +5 -0
  297. package/Utils/Rum/PathInSentence.d.ts +5 -0
  298. package/Utils/Rum/PathInSentence.js +46 -0
  299. package/Utils/Rum/PathInSentence.mjs +6 -0
  300. package/Utils/Rum/UrlScrubber.d.mts +4 -0
  301. package/Utils/Rum/UrlScrubber.d.ts +4 -0
  302. package/Utils/Rum/UrlScrubber.js +143 -3
  303. package/Utils/Rum/UserFlow.d.mts +1 -1
  304. package/Utils/Rum/UserFlow.d.ts +1 -1
  305. package/Utils/Rum/UserFlow.js +180 -25
  306. package/Utils/Rum/UserFlow.mjs +1 -1
  307. package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
  308. package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
  309. package/Utils/Runbook/RunbookStepsSignature.js +30 -0
  310. package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
  311. package/Utils/Schema/TypeSchemas.js +6 -0
  312. package/Utils/Slo/SloDuration.d.mts +5 -2
  313. package/Utils/Slo/SloDuration.d.ts +5 -2
  314. package/Utils/Slo/SloDuration.js +11 -6
  315. package/Utils/Slo/SloHealth.js +1 -1
  316. package/Utils/StateOrder.js +1 -4
  317. package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
  318. package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
  319. package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
  320. package/Utils/Telemetry/HeartbeatAvailability.js +118 -26
  321. package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
  322. package/package.json +1 -1
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.buildGuidedStatusPageMonitor = exports.buildStatusPageResource = exports.buildGuidedStatusPage = exports.GUIDED_SETUP_RESOURCE_OPTIONS = exports.STATUS_PAGE_NAME_MIN_LENGTH = void 0;
6
+ exports.buildGuidedStatusPageMonitor = exports.buildStatusPageResource = exports.buildGuidedStatusPage = exports.GUIDED_SETUP_RESOURCE_OPTIONS = exports.getDefaultStatusPageName = exports.STATUS_PAGE_NAME_MIN_LENGTH = void 0;
7
7
  const StatusPage_1 = __importDefault(require("../../Models/DatabaseModels/StatusPage"));
8
8
  const StatusPageResource_1 = __importDefault(require("../../Models/DatabaseModels/StatusPageResource"));
9
+ const Translator_1 = require("../../Types/Translator");
9
10
  /*
10
11
  * THE STATUS PAGE A GUIDED SETUP PUBLISHES, AND THE MONITORS ON IT.
11
12
  *
@@ -16,7 +17,8 @@ const StatusPageResource_1 = __importDefault(require("../../Models/DatabaseModel
16
17
  * Monitors build them, so for the same answers they make the same records:
17
18
  *
18
19
  * - the page: its name and project, everything else the server's defaults
19
- * (public, at <host>/status-page/<id>);
20
+ * (public, at <host>/status-page/<id>); a page the person does not name
21
+ * is named after the project, in the person's language (below);
20
22
  * - each monitor: a resource named after the monitor, showing its current
21
23
  * status, its uptime and its history.
22
24
  *
@@ -26,6 +28,29 @@ const StatusPageResource_1 = __importDefault(require("../../Models/DatabaseModel
26
28
  */
27
29
  // Create Status Page's own rule (StatusPageCreateForm): at least two letters.
28
30
  exports.STATUS_PAGE_NAME_MIN_LENGTH = 2;
31
+ /*
32
+ * THE NAME A PAGE STARTS WITH: the project's, so a new project's owner can
33
+ * keep it and type nothing ("Acme Status"), in the language of the person
34
+ * it is made for - the Dashboard's translator in the guided setup, and the
35
+ * server's for the language the person reads the Dashboard in when Ask AI
36
+ * publishes it (#7247, ServerTranslation's getRecordWordsTranslator), so
37
+ * both name it "Status von Acme" for a reader of German. No translator is
38
+ * English. Empty when the project's name is not known: the person names it.
39
+ *
40
+ * The Dashboard's extractor reads this file as a "keys" root, and the
41
+ * server's locale set copies the Dashboard's wording of its sentences
42
+ * (Scripts/I18n/ServerLocales' DASHBOARD_SHARED_TEXT_SOURCES): after
43
+ * changing one, translate it in the Dashboard's files and run
44
+ * `npm run i18n:server-sync` from the repository's root.
45
+ */
46
+ const getDefaultStatusPageName = (data) => {
47
+ const projectName = (data.projectName || "").trim();
48
+ if (!projectName) {
49
+ return "";
50
+ }
51
+ return (data.translator || (0, Translator_1.createTranslator)(undefined)).translateTemplate("{{project}} Status", { project: projectName });
52
+ };
53
+ exports.getDefaultStatusPageName = getDefaultStatusPageName;
29
54
  // How a guided setup shows each monitor: its status, its uptime and its history.
30
55
  exports.GUIDED_SETUP_RESOURCE_OPTIONS = {
31
56
  showCurrentStatus: true,
@@ -4,3 +4,4 @@ export const STATUS_PAGE_NAME_MIN_LENGTH = commonJsModule.STATUS_PAGE_NAME_MIN_L
4
4
  export const buildGuidedStatusPage = commonJsModule.buildGuidedStatusPage;
5
5
  export const buildGuidedStatusPageMonitor = commonJsModule.buildGuidedStatusPageMonitor;
6
6
  export const buildStatusPageResource = commonJsModule.buildStatusPageResource;
7
+ export const getDefaultStatusPageName = commonJsModule.getDefaultStatusPageName;
@@ -177,6 +177,12 @@ exports.pickWebsiteMonitorSeeds = pickWebsiteMonitorSeeds;
177
177
  * minutes unless the person asked for another of Create Monitor's
178
178
  * intervals. The probes are left to the server, which adds the ones a new
179
179
  * monitor starts with when the create names none.
180
+ *
181
+ * The translator is the person's, both ways in (#7247): the guided setup
182
+ * hands the Dashboard's, and Ask AI the server's for the language the
183
+ * person reads the Dashboard in (ServerTranslation's
184
+ * getRecordWordsTranslator), which words every criteria as the
185
+ * Dashboard's does.
180
186
  */
181
187
  const buildWebsiteMonitor = (data) => {
182
188
  var _a, _b;
@@ -5,4 +5,5 @@ export default class HostAddressUtil {
5
5
  host: string;
6
6
  port?: string | number | undefined;
7
7
  }): string;
8
+ static stripPort(hostAndPort: string): string;
8
9
  }
@@ -5,4 +5,5 @@ export default class HostAddressUtil {
5
5
  host: string;
6
6
  port?: string | number | undefined;
7
7
  }): string;
8
+ static stripPort(hostAndPort: string): string;
8
9
  }
@@ -81,5 +81,35 @@ class HostAddressUtil {
81
81
  ? `[${bare}]:${port}`
82
82
  : `${bare}:${port}`;
83
83
  }
84
+ /*
85
+ * A host with an optional port, without the port: what a server name, a
86
+ * certificate's name or a comparison of hosts takes from a HOST such as
87
+ * "oneuptime.example.com:8080".
88
+ *
89
+ * Cutting at the first ":" is wrong for IPv6, whose colons are its own
90
+ * (problem 2 above): "[2001:db8::1]:8080" became "[2001". So:
91
+ * - a bracketed address is everything up to its closing bracket, and
92
+ * keeps the brackets: "[2001:db8::1]:8080" is "[2001:db8::1]", which is
93
+ * how nginx and Express name the host of such a request;
94
+ * - an address without brackets has no port to take off, as its colons
95
+ * are all its own: "2001:db8::1" stays as it is;
96
+ * - a name or an IPv4 address loses what follows its one ":".
97
+ *
98
+ * The ingress's scripts (packages/Nginx: envsubst-on-templates.sh's
99
+ * HOST_WITHOUT_PORT, run.sh's PRIMARY_DOMAIN) take the port off by this
100
+ * same rule, so the ingress and the app agree on which host is their own.
101
+ */
102
+ static stripPort(hostAndPort) {
103
+ const value = (hostAndPort || "").trim();
104
+ const closingBracket = value.indexOf("]");
105
+ if (value.startsWith("[") && closingBracket !== -1) {
106
+ return value.substring(0, closingBracket + 1);
107
+ }
108
+ const colon = value.indexOf(":");
109
+ if (colon === -1 || colon !== value.lastIndexOf(":")) {
110
+ return value;
111
+ }
112
+ return value.substring(0, colon);
113
+ }
84
114
  }
85
115
  exports.default = HostAddressUtil;
@@ -257,7 +257,11 @@ class LinearRegExp {
257
257
  const index = slots[0];
258
258
  const end = slots[1];
259
259
  const captures = [];
260
- const groups = {};
260
+ /*
261
+ * With no prototype, as JavaScript's own: a group may be named
262
+ * constructor or toString, and a name no group has reads undefined.
263
+ */
264
+ const groups = Object.create(null);
261
265
  if (this.capturesGroups) {
262
266
  for (let group = 1; group <= this.compiled.captureCount; group++) {
263
267
  const start = slots[group * 2];
@@ -0,0 +1,7 @@
1
+ import { Translator } from "../Types/Translator.mjs";
2
+ export declare const MILLISECONDS_TEMPLATE: string;
3
+ export interface MillisecondsOptions {
4
+ maximumFractionDigits?: number | undefined;
5
+ }
6
+ export declare const roundMilliseconds: (milliseconds: number, maximumFractionDigits?: number | undefined) => number;
7
+ export declare const formatMilliseconds: (translator: Translator, milliseconds: number, options?: MillisecondsOptions) => string;
@@ -0,0 +1,7 @@
1
+ import { Translator } from "../Types/Translator";
2
+ export declare const MILLISECONDS_TEMPLATE: string;
3
+ export interface MillisecondsOptions {
4
+ maximumFractionDigits?: number | undefined;
5
+ }
6
+ export declare const roundMilliseconds: (milliseconds: number, maximumFractionDigits?: number | undefined) => number;
7
+ export declare const formatMilliseconds: (translator: Translator, milliseconds: number, options?: MillisecondsOptions) => string;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatMilliseconds = exports.roundMilliseconds = exports.MILLISECONDS_TEMPLATE = void 0;
4
+ const Translator_1 = require("../Types/Translator");
5
+ /*
6
+ * A DURATION IN MILLISECONDS, IN THE READER'S LANGUAGE.
7
+ *
8
+ * Every monitor type's summary - the monitor's Summary card, Test Monitor's
9
+ * result, Monitoring Logs' View Summary, the incident and alert pages'
10
+ * evaluation - built its Response Time (and a ping's jitter and round
11
+ * trips, a port's and a request's phases, a script's execution time) as
12
+ * `responseTimeInMs + " ms"`, and the monitor overview's Latest result and
13
+ * its Probes card did the same (issues #7224, #7416). On an Arabic or
14
+ * Persian page the browser lays that English text out from the right, so it
15
+ * read "ms 411", and in Persian its digits stayed Latin (411, not ۴۱۱)
16
+ * beside the card's own Persian date.
17
+ *
18
+ * Each is now one key, "{{value}} ms", which every language words with its
19
+ * own unit, in its own order ("411 ms", "411 мс", "411 毫秒", "۴۱۱
20
+ * میلی‌ثانیه", "411 ملي ث": Intl's short unit, as Locales/ARABIC.md says a
21
+ * duration is written), with the figure as the reader's language writes a
22
+ * number (translator.formatNumber: "1,234" / "1.234" / "۱٬۲۳۴", Latin
23
+ * digits in Arabic). English reads "411 ms" as before; a figure of a
24
+ * thousand or more takes its thousands separator ("1,234 ms"), as the
25
+ * Retry Attempts lines under it already wrote it.
26
+ *
27
+ * It lives in Common, React-free, so a shared helper that writes a page's
28
+ * words with the reader's Translator (MonitorOverviewPresentationUtil, for
29
+ * the overview's hero) writes a duration exactly as the Dashboard's views
30
+ * do. The Dashboard's Utils/Milliseconds re-exports it: one helper, never
31
+ * two copies. Without a translator's own wording (the server, a unit test)
32
+ * it writes English.
33
+ *
34
+ * A guard (Common Tests/UI/MillisecondsInReadersLanguageGuard) refuses a
35
+ * duration built as `x + " ms"` anywhere in the Dashboard, and any "ms"
36
+ * written beside a figure in the monitor summaries and the overview.
37
+ */
38
+ exports.MILLISECONDS_TEMPLATE = (0, Translator_1.translationKey)("{{value}} ms");
39
+ // A duration's figure, rounded to the decimals asked for.
40
+ const roundMilliseconds = (milliseconds, maximumFractionDigits) => {
41
+ if (maximumFractionDigits === undefined) {
42
+ return milliseconds;
43
+ }
44
+ const scale = Math.pow(10, Math.max(0, Math.min(3, Math.floor(maximumFractionDigits))));
45
+ return Math.round(milliseconds * scale) / scale;
46
+ };
47
+ exports.roundMilliseconds = roundMilliseconds;
48
+ /*
49
+ * "411 ms" in the reader's language. A value that is not a number (a
50
+ * reading the probe did not make) reads "-", as every missing fact does.
51
+ */
52
+ const formatMilliseconds = (translator, milliseconds, options) => {
53
+ if (typeof milliseconds !== "number" || !Number.isFinite(milliseconds)) {
54
+ return "-";
55
+ }
56
+ return translator.translateTemplate(exports.MILLISECONDS_TEMPLATE, {
57
+ value: translator.formatNumber((0, exports.roundMilliseconds)(milliseconds, options === null || options === void 0 ? void 0 : options.maximumFractionDigits)),
58
+ });
59
+ };
60
+ exports.formatMilliseconds = formatMilliseconds;
@@ -0,0 +1,4 @@
1
+ import commonJsModule from "./Milliseconds.js";
2
+ export const MILLISECONDS_TEMPLATE = commonJsModule.MILLISECONDS_TEMPLATE;
3
+ export const formatMilliseconds = commonJsModule.formatMilliseconds;
4
+ export const roundMilliseconds = commonJsModule.roundMilliseconds;
@@ -62,7 +62,15 @@ export interface EndpointExistingRowSnapshot {
62
62
  firstSeenAt?: Date | undefined;
63
63
  lastSeenAt?: Date | undefined;
64
64
  }
65
+ export declare const ENDPOINT_WALK_WINDOW_MS: number;
65
66
  export declare const ENDPOINT_LAST_SEEN_REFRESH_MS: number;
67
+ export declare const ENDPOINT_REFRESH_GROUPS: number;
68
+ export declare const COARSE_LAST_SEEN_STEP_SQL: string;
69
+ export declare function endpointRefreshSlot(data: {
70
+ time: number;
71
+ macAddress: string;
72
+ refreshMs: number;
73
+ }): number;
66
74
  export declare const CONTROLLER_SIGHTING_CURRENT_FOR_MS: number;
67
75
  export interface EndpointUpsertContext {
68
76
  now: Date;
@@ -62,7 +62,15 @@ export interface EndpointExistingRowSnapshot {
62
62
  firstSeenAt?: Date | undefined;
63
63
  lastSeenAt?: Date | undefined;
64
64
  }
65
+ export declare const ENDPOINT_WALK_WINDOW_MS: number;
65
66
  export declare const ENDPOINT_LAST_SEEN_REFRESH_MS: number;
67
+ export declare const ENDPOINT_REFRESH_GROUPS: number;
68
+ export declare const COARSE_LAST_SEEN_STEP_SQL: string;
69
+ export declare function endpointRefreshSlot(data: {
70
+ time: number;
71
+ macAddress: string;
72
+ refreshMs: number;
73
+ }): number;
66
74
  export declare const CONTROLLER_SIGHTING_CURRENT_FOR_MS: number;
67
75
  export interface EndpointUpsertContext {
68
76
  now: Date;
@@ -1,21 +1,81 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeMac = exports.CONTROLLER_SIGHTING_CURRENT_FOR_MS = exports.ENDPOINT_LAST_SEEN_REFRESH_MS = void 0;
6
+ exports.normalizeMac = exports.CONTROLLER_SIGHTING_CURRENT_FOR_MS = exports.COARSE_LAST_SEEN_STEP_SQL = exports.ENDPOINT_REFRESH_GROUPS = exports.ENDPOINT_LAST_SEEN_REFRESH_MS = exports.ENDPOINT_WALK_WINDOW_MS = void 0;
7
+ exports.endpointRefreshSlot = endpointRefreshSlot;
8
+ const DeviceReachabilityUtil_1 = __importDefault(require("../NetworkDevice/DeviceReachabilityUtil"));
4
9
  /*
5
10
  * How stale a row's lastSeenAt is allowed to get before an otherwise
6
11
  * unchanged observation is written purely to refresh it.
7
12
  *
8
- * Freshness is load-bearing: NetworkTopologyUtil calls an endpoint
9
- * "down" once lastSeenAt is older than 15 minutes. Suppressing the
10
- * refresh entirely would mark every stable endpoint down, so the real
11
- * bound is that stored lastSeenAt may lag reality by at most
12
- * (refresh threshold + poll interval). At 5 minutes that stays inside
13
- * the 15-minute window for any poll interval up to 10 minutes, and for
14
- * slower polls the threshold simply stops suppressing anything (age is
15
- * always past it) and the behaviour degrades back to write-every-poll —
16
- * so the optimisation can never make a device look down.
13
+ * Freshness is load-bearing: the map draws an endpoint "down", the Discovered
14
+ * Devices list stops counting it, and the "Connected to" card stops matching
15
+ * a device by its address once lastSeenAt is older than the walk window
16
+ * (ENDPOINT_WALK_WINDOW_MS, the shared device staleness window at the default
17
+ * interval - 60 minutes). Suppressing the refresh entirely would mark every
18
+ * stable endpoint down, so the real bound is that stored lastSeenAt may lag
19
+ * reality by at most (refresh window + poll interval).
20
+ *
21
+ * It was a flat 5 minutes - the default poll interval itself - so every
22
+ * ARP/FDB walk rewrote every endpoint it saw; then just under two polls, so
23
+ * an unchanged endpoint was written every other poll. It is now 15 minutes,
24
+ * as an interface's refresh is (InterfaceInventoryUtil), counted on a clock
25
+ * of the endpoint's own (endpointRefreshSlot): at 5-minute polls a stable
26
+ * endpoint is written every third poll. The window plus a poll stays inside
27
+ * the walk window for every interval up to 45 minutes, and a device polled
28
+ * less often than the window writes on every poll, as before, so the refresh
29
+ * can never make an endpoint look gone.
17
30
  */
18
- exports.ENDPOINT_LAST_SEEN_REFRESH_MS = 5 * 60 * 1000;
31
+ exports.ENDPOINT_WALK_WINDOW_MS = DeviceReachabilityUtil_1.default.getStaleWindowInMinutes(undefined) * 60 * 1000;
32
+ exports.ENDPOINT_LAST_SEEN_REFRESH_MS = 15 * 60 * 1000;
33
+ /*
34
+ * The refresh is spread across the window, not taken all at once: each
35
+ * endpoint counts its window on a clock of its own, offset by its MAC in
36
+ * steps of a fifteenth of the window (endpointRefreshSlot). A switch's
37
+ * endpoints then come due a few at a time - a third of them on each
38
+ * five-minute poll - rather than all of them on the same poll.
39
+ *
40
+ * That is what lets the refresh be a HOT update. A walk writes a device's
41
+ * endpoints in one statement, and the rows of a device's endpoints sit
42
+ * together, since its walk inserted them together. A page takes a HOT
43
+ * update only into room it has free while the statement runs, because the
44
+ * rows it replaces are not dead until the statement commits: rewriting every
45
+ * endpoint on a page at once needs half the page free. A third of them needs
46
+ * a quarter of the page, which is about the room the table keeps
47
+ * (fillfactor, SetNetworkEndpointFillfactor). The refresh also writes no
48
+ * indexed column: lastSeenAt is in no index (coarseLastSeenAt is the age-out's
49
+ * copy, and moves once a day).
50
+ */
51
+ exports.ENDPOINT_REFRESH_GROUPS = 15;
52
+ /*
53
+ * How far an endpoint's lastSeenAt gets ahead of its coarseLastSeenAt before
54
+ * a write moves the coarse one up to it, as SQL: so coarseLastSeenAt <=
55
+ * lastSeenAt < coarseLastSeenAt + this. NetworkEndpointService writes by it
56
+ * and the age-out of discovered devices (DiscoveredDeviceAgeOut) narrows by
57
+ * it, so both must read this one. Hours, not '1 day': a day added to a
58
+ * timestamptz follows the session's time zone, and is 23 or 25 hours across
59
+ * a change of clocks.
60
+ */
61
+ exports.COARSE_LAST_SEEN_STEP_SQL = `interval '24 hours'`;
62
+ /*
63
+ * Which refresh window of its own a time falls in, for one endpoint: windows
64
+ * of `refreshMs`, offset by the endpoint's MAC in steps of
65
+ * 1/ENDPOINT_REFRESH_GROUPS of a window. The group is the MAC's twelve hex
66
+ * digits as a number, modulo the groups: MACs that differ by one, as a batch
67
+ * of terminals from one vendor often do, come due a fifteenth of a window
68
+ * apart.
69
+ */
70
+ function endpointRefreshSlot(data) {
71
+ const hex = data.macAddress.toLowerCase().replace(/[^0-9a-f]/g, "");
72
+ const value = hex ? parseInt(hex.slice(-12), 16) : 0;
73
+ const group = Number.isFinite(value)
74
+ ? value % exports.ENDPOINT_REFRESH_GROUPS
75
+ : 0;
76
+ return Math.floor((data.time + (group * data.refreshMs) / exports.ENDPOINT_REFRESH_GROUPS) /
77
+ data.refreshMs);
78
+ }
19
79
  /*
20
80
  * How long a sighting a network controller reported stays current. A walk
21
81
  * sees an endpoint every few minutes; a controller's client list is read
@@ -226,8 +286,8 @@ class EndpointAttachmentUtil {
226
286
  * over; lastSeenAt is not refreshed meanwhile, or it never could.
227
287
  *
228
288
  * When `context` is supplied, an update that would write nothing but a
229
- * lastSeenAt already refreshed within lastSeenRefreshMs collapses to
230
- * "none" — a stable 4096-MAC switch must not issue 4096 writes a poll
289
+ * lastSeenAt whose refresh is not due yet (endpointRefreshSlot) collapses
290
+ * to "none" — a stable 4096-MAC switch must not issue 4096 writes a poll
231
291
  * just to bump a timestamp nobody reads that precisely.
232
292
  */
233
293
  static decideUpsert(existing, incoming, context) {
@@ -299,7 +359,7 @@ class EndpointAttachmentUtil {
299
359
  }
300
360
  if (existing &&
301
361
  context &&
302
- EndpointAttachmentUtil.isUnchangedSighting(existing, decision, incoming.deviceId, context)) {
362
+ EndpointAttachmentUtil.isUnchangedSighting(existing, decision, incoming, context)) {
303
363
  return {
304
364
  action: "none",
305
365
  setAttachment: false,
@@ -310,10 +370,11 @@ class EndpointAttachmentUtil {
310
370
  }
311
371
  /*
312
372
  * True when applying `decision` to `existing` would change nothing a
313
- * reader can observe, and lastSeenAt is fresh enough that skipping the
314
- * refresh is safe. Deliberately conservative — any doubt (a row that
315
- * still needs the firstSeenAt backfill, a row we have never seen a
316
- * timestamp for) falls through to a real write.
373
+ * reader can observe, and the row's refresh is not due yet: the sighting
374
+ * falls in the same refresh window of the endpoint's own as the row's
375
+ * lastSeenAt (endpointRefreshSlot). Deliberately conservative — any doubt
376
+ * (a row that still needs the firstSeenAt backfill, a row we have never
377
+ * seen a timestamp for) falls through to a real write.
317
378
  *
318
379
  * A sighting older than the row's lastSeenAt refreshes nothing either.
319
380
  * That is an older poll processed after a newer one (OneUptime issue
@@ -321,15 +382,24 @@ class EndpointAttachmentUtil {
321
382
  * moves lastSeenAt backwards (NetworkEndpointService keeps the later of
322
383
  * the two), so writing it would change nothing.
323
384
  */
324
- static isUnchangedSighting(existing, decision, incomingDeviceId, context) {
385
+ static isUnchangedSighting(existing, decision, incoming, context) {
325
386
  var _a;
387
+ const incomingDeviceId = incoming.deviceId;
326
388
  // Rows predating first-seen tracking still owe us a backfill.
327
389
  if (!existing.firstSeenAt || !existing.lastSeenAt) {
328
390
  return false;
329
391
  }
330
392
  const refreshMs = (_a = context.lastSeenRefreshMs) !== null && _a !== void 0 ? _a : exports.ENDPOINT_LAST_SEEN_REFRESH_MS;
331
- const ageMs = context.now.getTime() - new Date(existing.lastSeenAt).getTime();
332
- if (ageMs >= refreshMs) {
393
+ if (endpointRefreshSlot({
394
+ time: context.now.getTime(),
395
+ macAddress: incoming.macAddress,
396
+ refreshMs: refreshMs,
397
+ }) >
398
+ endpointRefreshSlot({
399
+ time: new Date(existing.lastSeenAt).getTime(),
400
+ macAddress: incoming.macAddress,
401
+ refreshMs: refreshMs,
402
+ })) {
333
403
  return false;
334
404
  }
335
405
  if (decision.setIpAddress &&
@@ -1,5 +1,9 @@
1
1
  import commonJsModule from "./EndpointAttachmentUtil.js";
2
2
  export default commonJsModule.default;
3
+ export const COARSE_LAST_SEEN_STEP_SQL = commonJsModule.COARSE_LAST_SEEN_STEP_SQL;
3
4
  export const CONTROLLER_SIGHTING_CURRENT_FOR_MS = commonJsModule.CONTROLLER_SIGHTING_CURRENT_FOR_MS;
4
5
  export const ENDPOINT_LAST_SEEN_REFRESH_MS = commonJsModule.ENDPOINT_LAST_SEEN_REFRESH_MS;
6
+ export const ENDPOINT_REFRESH_GROUPS = commonJsModule.ENDPOINT_REFRESH_GROUPS;
7
+ export const ENDPOINT_WALK_WINDOW_MS = commonJsModule.ENDPOINT_WALK_WINDOW_MS;
8
+ export const endpointRefreshSlot = commonJsModule.endpointRefreshSlot;
5
9
  export const normalizeMac = commonJsModule.normalizeMac;
@@ -1,7 +1,27 @@
1
1
  import SnmpInterface from "../../Types/Monitor/SnmpMonitor/SnmpInterface.mjs";
2
+ export declare const INTERFACE_LAST_SEEN_REFRESH_MS: number;
3
+ export declare const INTERFACE_REFRESH_GROUPS: number;
4
+ export declare const INTERFACE_READING_RELATIVE_CHANGE: number;
5
+ export declare const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED: number;
6
+ export declare const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED: number;
7
+ export declare const INTERFACE_UTILIZATION_FLOOR_PERCENT: number;
8
+ export declare const INTERFACE_ERRORS_FLOOR_PER_SECOND: number;
9
+ export declare const INTERFACE_SATURATION_THRESHOLD_PERCENT: number;
2
10
  export interface InterfaceExistingRowSnapshot {
3
11
  interfaceIndex?: number | undefined;
4
12
  isMonitored?: boolean | undefined;
13
+ name?: string | null | undefined;
14
+ alias?: string | null | undefined;
15
+ macAddress?: string | null | undefined;
16
+ interfaceType?: number | null | undefined;
17
+ isOperationallyUp?: boolean | null | undefined;
18
+ isAdministrativelyUp?: boolean | null | undefined;
19
+ speedInMbps?: number | null | undefined;
20
+ inRateMbps?: number | null | undefined;
21
+ outRateMbps?: number | null | undefined;
22
+ utilizationPercent?: number | null | undefined;
23
+ errorsPerSecond?: number | null | undefined;
24
+ lastSeenAt?: Date | string | null | undefined;
5
25
  }
6
26
  export interface InterfaceInsertRow {
7
27
  interfaceIndex: number;
@@ -33,6 +53,7 @@ export interface InterfaceUpdateRow {
33
53
  export interface InterfaceUpsertPlan {
34
54
  inserts: Array<InterfaceInsertRow>;
35
55
  updates: Array<InterfaceUpdateRow>;
56
+ unchangedInterfaceIndexes: Array<number>;
36
57
  unmonitoredInterfaceIndexes: Array<number>;
37
58
  }
38
59
  export default class InterfaceInventoryUtil {
@@ -40,7 +61,26 @@ export default class InterfaceInventoryUtil {
40
61
  walkedInterfaces: Array<SnmpInterface>;
41
62
  existingRows: Array<InterfaceExistingRowSnapshot>;
42
63
  now: Date;
64
+ refreshMs?: number | undefined;
43
65
  }): InterfaceUpsertPlan;
66
+ static needsWrite(data: {
67
+ stored: InterfaceExistingRowSnapshot;
68
+ update: InterfaceUpdateRow;
69
+ now: Date;
70
+ refreshMs?: number | undefined;
71
+ }): boolean;
72
+ static refreshSlot(data: {
73
+ time: number;
74
+ interfaceIndex: number;
75
+ refreshMs: number;
76
+ }): number;
77
+ static ratesMoved(data: {
78
+ stored: InterfaceExistingRowSnapshot;
79
+ update: InterfaceUpdateRow;
80
+ }): boolean;
81
+ private static readingMoved;
82
+ private static isSame;
83
+ private static toTime;
44
84
  private static interfaceName;
45
85
  private static toMbps;
46
86
  private static toRoundedMbps;
@@ -1,7 +1,27 @@
1
1
  import SnmpInterface from "../../Types/Monitor/SnmpMonitor/SnmpInterface";
2
+ export declare const INTERFACE_LAST_SEEN_REFRESH_MS: number;
3
+ export declare const INTERFACE_REFRESH_GROUPS: number;
4
+ export declare const INTERFACE_READING_RELATIVE_CHANGE: number;
5
+ export declare const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED: number;
6
+ export declare const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED: number;
7
+ export declare const INTERFACE_UTILIZATION_FLOOR_PERCENT: number;
8
+ export declare const INTERFACE_ERRORS_FLOOR_PER_SECOND: number;
9
+ export declare const INTERFACE_SATURATION_THRESHOLD_PERCENT: number;
2
10
  export interface InterfaceExistingRowSnapshot {
3
11
  interfaceIndex?: number | undefined;
4
12
  isMonitored?: boolean | undefined;
13
+ name?: string | null | undefined;
14
+ alias?: string | null | undefined;
15
+ macAddress?: string | null | undefined;
16
+ interfaceType?: number | null | undefined;
17
+ isOperationallyUp?: boolean | null | undefined;
18
+ isAdministrativelyUp?: boolean | null | undefined;
19
+ speedInMbps?: number | null | undefined;
20
+ inRateMbps?: number | null | undefined;
21
+ outRateMbps?: number | null | undefined;
22
+ utilizationPercent?: number | null | undefined;
23
+ errorsPerSecond?: number | null | undefined;
24
+ lastSeenAt?: Date | string | null | undefined;
5
25
  }
6
26
  export interface InterfaceInsertRow {
7
27
  interfaceIndex: number;
@@ -33,6 +53,7 @@ export interface InterfaceUpdateRow {
33
53
  export interface InterfaceUpsertPlan {
34
54
  inserts: Array<InterfaceInsertRow>;
35
55
  updates: Array<InterfaceUpdateRow>;
56
+ unchangedInterfaceIndexes: Array<number>;
36
57
  unmonitoredInterfaceIndexes: Array<number>;
37
58
  }
38
59
  export default class InterfaceInventoryUtil {
@@ -40,7 +61,26 @@ export default class InterfaceInventoryUtil {
40
61
  walkedInterfaces: Array<SnmpInterface>;
41
62
  existingRows: Array<InterfaceExistingRowSnapshot>;
42
63
  now: Date;
64
+ refreshMs?: number | undefined;
43
65
  }): InterfaceUpsertPlan;
66
+ static needsWrite(data: {
67
+ stored: InterfaceExistingRowSnapshot;
68
+ update: InterfaceUpdateRow;
69
+ now: Date;
70
+ refreshMs?: number | undefined;
71
+ }): boolean;
72
+ static refreshSlot(data: {
73
+ time: number;
74
+ interfaceIndex: number;
75
+ refreshMs: number;
76
+ }): number;
77
+ static ratesMoved(data: {
78
+ stored: InterfaceExistingRowSnapshot;
79
+ update: InterfaceUpdateRow;
80
+ }): boolean;
81
+ private static readingMoved;
82
+ private static isSame;
83
+ private static toTime;
44
84
  private static interfaceName;
45
85
  private static toMbps;
46
86
  private static toRoundedMbps;