@oneuptime/common 14.0.110 → 14.2.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 (527) 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.d.mts +1 -0
  6. package/Models/DatabaseModels/Alert.d.ts +1 -0
  7. package/Models/DatabaseModels/Alert.js +52 -2
  8. package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
  9. package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
  10. package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
  11. package/Models/DatabaseModels/DataStore.js +9 -0
  12. package/Models/DatabaseModels/EmailLog.js +2 -2
  13. package/Models/DatabaseModels/Form.js +3 -3
  14. package/Models/DatabaseModels/FormSubmission.js +4 -4
  15. package/Models/DatabaseModels/GlobalConfig.js +46 -45
  16. package/Models/DatabaseModels/Incident.d.mts +1 -0
  17. package/Models/DatabaseModels/Incident.d.ts +1 -0
  18. package/Models/DatabaseModels/Incident.js +53 -2
  19. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
  20. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
  21. package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
  22. package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
  23. package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
  24. package/Models/DatabaseModels/Index.js +6 -0
  25. package/Models/DatabaseModels/InventoryItem.js +11 -0
  26. package/Models/DatabaseModels/Monitor.js +51 -17
  27. package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
  28. package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
  29. package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
  30. package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
  31. package/Models/DatabaseModels/MonitorProbe.js +22 -5
  32. package/Models/DatabaseModels/NetworkDevice.js +23 -7
  33. package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
  34. package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
  35. package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
  36. package/Models/DatabaseModels/NetworkInterface.js +5 -5
  37. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +19 -5
  38. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
  39. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
  40. package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +2 -0
  41. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
  42. package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
  43. package/Models/DatabaseModels/Project.d.mts +1 -0
  44. package/Models/DatabaseModels/Project.d.ts +1 -0
  45. package/Models/DatabaseModels/Project.js +46 -3
  46. package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
  47. package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
  48. package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
  49. package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
  50. package/Models/DatabaseModels/RunbookExecution.js +2 -2
  51. package/Models/DatabaseModels/RunbookRule.js +6 -6
  52. package/Models/DatabaseModels/ScheduledMaintenance.js +3 -3
  53. package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
  54. package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
  55. package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
  56. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +1 -1
  57. package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
  58. package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
  59. package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
  60. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +3 -3
  61. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
  62. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +3 -3
  63. package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
  64. package/Models/DatabaseModels/TeamMember.js +10 -1
  65. package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
  66. package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
  67. package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
  68. package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
  69. package/Server/Services/DatabaseService.d.mts +4 -1
  70. package/Server/Services/DatabaseService.d.ts +4 -1
  71. package/Server/Types/Database/CountBy.d.mts +1 -0
  72. package/Server/Types/Database/CountBy.d.ts +1 -0
  73. package/Server/Types/Database/UpdateLimit.d.mts +6 -0
  74. package/Server/Types/Database/UpdateLimit.d.ts +6 -0
  75. package/Types/AI/AIActionWords.d.mts +28 -2
  76. package/Types/AI/AIActionWords.d.ts +28 -2
  77. package/Types/AI/AIActionWords.js +235 -3
  78. package/Types/AI/AIActionWords.mjs +8 -0
  79. package/Types/AI/AIChatTypes.d.mts +3 -1
  80. package/Types/AI/AIChatTypes.d.ts +3 -1
  81. package/Types/AI/AIReadTableWords.d.mts +192 -0
  82. package/Types/AI/AIReadTableWords.d.ts +192 -0
  83. package/Types/AI/AIReadTableWords.js +368 -0
  84. package/Types/AI/AIReadTableWords.mjs +18 -0
  85. package/Types/AI/AiOutcomes.d.mts +57 -0
  86. package/Types/AI/AiOutcomes.d.ts +57 -0
  87. package/Types/AI/AiOutcomes.js +67 -0
  88. package/Types/AI/AiOutcomes.mjs +10 -0
  89. package/Types/AI/AiRunRefusal.d.mts +48 -0
  90. package/Types/AI/AiRunRefusal.d.ts +48 -0
  91. package/Types/AI/AiRunRefusal.js +208 -0
  92. package/Types/AI/AiRunRefusal.mjs +12 -0
  93. package/Types/AI/InvestigationRecording.d.mts +46 -0
  94. package/Types/AI/InvestigationRecording.d.ts +46 -0
  95. package/Types/AI/InvestigationRecording.js +42 -0
  96. package/Types/AI/InvestigationRecording.mjs +7 -0
  97. package/Types/AI/ResourceAiAccessPermissions.js +7 -18
  98. package/Types/API/HTTPResponse.d.mts +3 -0
  99. package/Types/API/HTTPResponse.d.ts +3 -0
  100. package/Types/API/HTTPResponse.js +15 -0
  101. package/Types/AuditLog/AuditLogActionLabel.js +19 -9
  102. package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
  103. package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
  104. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +32 -1
  105. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +32 -1
  106. package/Types/BaseDatabase/AggregationIntervalUtil.js +199 -2
  107. package/Types/BaseDatabase/ListResult.d.mts +1 -0
  108. package/Types/BaseDatabase/ListResult.d.ts +1 -0
  109. package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
  110. package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
  111. package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
  112. package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
  113. package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
  114. package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
  115. package/Types/Cloud/CloudResourceHealth.js +405 -13
  116. package/Types/Cloud/CloudResourceHealth.mjs +28 -0
  117. package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
  118. package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
  119. package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
  120. package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
  121. package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
  122. package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
  123. package/Types/DataObservability/DataCheckRefusals.js +77 -0
  124. package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
  125. package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
  126. package/Types/Date.d.mts +8 -1
  127. package/Types/Date.d.ts +8 -1
  128. package/Types/Date.js +61 -7
  129. package/Types/Date.mjs +1 -0
  130. package/Types/DateLanguage.d.mts +2 -0
  131. package/Types/DateLanguage.d.ts +2 -0
  132. package/Types/DateLanguage.js +8 -5
  133. package/Types/Email/EmailTemplateType.d.mts +1 -0
  134. package/Types/Email/EmailTemplateType.d.ts +1 -0
  135. package/Types/Email/EmailTemplateType.js +2 -0
  136. package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
  137. package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
  138. package/Types/Email/ServerEmailEnvironment.js +793 -0
  139. package/Types/Email/ServerEmailEnvironment.mjs +14 -0
  140. package/Types/Exception/AiRunRefusalException.d.mts +6 -0
  141. package/Types/Exception/AiRunRefusalException.d.ts +6 -0
  142. package/Types/Exception/AiRunRefusalException.js +23 -0
  143. package/Types/Exception/AiRunRefusalException.mjs +2 -0
  144. package/Types/Exception/EgressGuardException.js +1 -1
  145. package/Types/Exception/ErrorMessageRule.d.mts +1 -0
  146. package/Types/Exception/ErrorMessageRule.d.ts +1 -0
  147. package/Types/Exception/ErrorMessageRule.js +67 -13
  148. package/Types/Exception/ErrorMessageRule.mjs +1 -0
  149. package/Types/Exception/ExceptionMessages.d.mts +2 -0
  150. package/Types/Exception/ExceptionMessages.d.ts +2 -0
  151. package/Types/Exception/ExceptionMessages.js +2 -0
  152. package/Types/Form/FormTargetCatalog.js +2 -2
  153. package/Types/Form/FormTargetType.js +2 -2
  154. package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
  155. package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
  156. package/Types/Incident/PostmortemActionItemStatus.js +74 -0
  157. package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
  158. package/Types/JSONFunctions.js +10 -3
  159. package/Types/Link.d.mts +1 -0
  160. package/Types/Link.d.ts +1 -0
  161. package/Types/ListData.d.mts +2 -0
  162. package/Types/ListData.d.ts +2 -0
  163. package/Types/ListData.js +4 -0
  164. package/Types/MeaningKeys.d.mts +4 -0
  165. package/Types/MeaningKeys.d.ts +4 -0
  166. package/Types/MeaningKeys.js +74 -0
  167. package/Types/MeaningKeys.mjs +5 -0
  168. package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
  169. package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
  170. package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
  171. package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
  172. package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
  173. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
  174. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
  175. package/Types/Monitor/UptimeHistoryLabels.js +2 -2
  176. package/Types/Monitor/WhoIsTold.d.mts +3 -0
  177. package/Types/Monitor/WhoIsTold.d.ts +3 -0
  178. package/Types/Monitor/WhoIsTold.js +63 -13
  179. package/Types/NoBreakSpaces.d.mts +16 -0
  180. package/Types/NoBreakSpaces.d.ts +16 -0
  181. package/Types/NoBreakSpaces.js +419 -0
  182. package/Types/NoBreakSpaces.mjs +9 -0
  183. package/Types/NotificationRule/PagingLadder.d.mts +12 -0
  184. package/Types/NotificationRule/PagingLadder.d.ts +12 -0
  185. package/Types/NotificationRule/PagingLadder.js +159 -11
  186. package/Types/NotificationRule/PagingLadder.mjs +3 -0
  187. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
  188. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
  189. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
  190. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
  191. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
  192. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
  193. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
  194. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
  195. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
  196. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
  197. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
  198. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
  199. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
  200. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
  201. package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
  202. package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
  203. package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
  204. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
  205. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
  206. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
  207. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
  208. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
  209. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
  210. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
  211. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
  212. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
  213. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
  214. package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
  215. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  216. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
  217. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
  218. package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
  219. package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
  220. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
  221. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
  222. package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
  223. package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
  224. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
  225. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
  226. package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
  227. package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
  228. package/Types/OpenStack/OpenStackCapacity.js +12 -5
  229. package/Types/Permission.d.mts +4 -0
  230. package/Types/Permission.d.ts +4 -0
  231. package/Types/Permission.js +66 -10
  232. package/Types/Probe/ProbeCapability.d.mts +2 -1
  233. package/Types/Probe/ProbeCapability.d.ts +2 -1
  234. package/Types/Probe/ProbeCapability.js +10 -0
  235. package/Types/Product/ProductUsage.js +2 -1
  236. package/Types/Product/ProjectProductsAnswer.js +2 -1
  237. package/Types/ReaderLanguage.d.mts +1 -0
  238. package/Types/ReaderLanguage.d.ts +1 -0
  239. package/Types/ReaderLanguage.js +13 -1
  240. package/Types/ReaderLanguage.mjs +1 -0
  241. package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
  242. package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
  243. package/Types/ResourceAiAgent/AiResourceType.js +12 -0
  244. package/Types/Rules/RuleRun.js +2 -2
  245. package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
  246. package/Types/Rum/ProductAnalyticsEvents.js +13 -1
  247. package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
  248. package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
  249. package/Types/Rum/SessionReplayCustomEvents.js +12 -0
  250. package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
  251. package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
  252. package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
  253. package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
  254. package/Types/ServerSending/ServerSendingStatus.js +49 -2
  255. package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
  256. package/Types/SetupHealth/SetupHealth.d.mts +1 -0
  257. package/Types/SetupHealth/SetupHealth.d.ts +1 -0
  258. package/Types/SetupHealth/SetupHealth.js +13 -5
  259. package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
  260. package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
  261. package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
  262. package/Types/StatusPage/DefaultStatusNames.js +74 -28
  263. package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
  264. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
  265. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
  266. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
  267. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
  268. package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
  269. package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
  270. package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
  271. package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
  272. package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
  273. package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
  274. package/Types/Telemetry/CompatibleIngest.js +123 -0
  275. package/Types/Telemetry/CompatibleIngest.mjs +21 -0
  276. package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
  277. package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
  278. package/Types/Telemetry/TelemetryIngestSurface.js +48 -7
  279. package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
  280. package/Types/TimezoneAlias.d.mts +1 -0
  281. package/Types/TimezoneAlias.d.ts +1 -0
  282. package/Types/TimezoneAlias.js +13 -0
  283. package/Types/Translator.d.mts +1 -0
  284. package/Types/Translator.d.ts +1 -0
  285. package/Types/Translator.js +470 -63
  286. package/Types/Translator.mjs +1 -0
  287. package/Types/UserSession/SessionLength.d.mts +33 -0
  288. package/Types/UserSession/SessionLength.d.ts +33 -0
  289. package/Types/UserSession/SessionLength.js +134 -5
  290. package/Types/UserSession/SessionLength.mjs +5 -0
  291. package/Types/Workflow/RunRecord.js +1 -1
  292. package/Types/Workflow/Templates.js +2 -2
  293. package/Types/Workflow/WorkflowStatus.js +21 -10
  294. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
  295. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
  296. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +26 -1
  297. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +26 -1
  298. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
  299. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
  300. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
  301. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
  302. package/Utils/AI/InvestigationReport.js +2 -2
  303. package/Utils/API.d.mts +0 -11
  304. package/Utils/API.d.ts +0 -11
  305. package/Utils/API.js +0 -432
  306. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
  307. package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
  308. package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
  309. package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
  310. package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
  311. package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
  312. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
  313. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
  314. package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
  315. package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
  316. package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
  317. package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
  318. package/Utils/DefaultRecordNames.d.mts +6 -0
  319. package/Utils/DefaultRecordNames.d.ts +6 -0
  320. package/Utils/DefaultRecordNames.js +122 -0
  321. package/Utils/DefaultRecordNames.mjs +6 -0
  322. package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
  323. package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
  324. package/Utils/Grok/Grok.js +7 -4
  325. package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
  326. package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
  327. package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
  328. package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
  329. package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
  330. package/Utils/HostAddressUtil.d.mts +1 -0
  331. package/Utils/HostAddressUtil.d.ts +1 -0
  332. package/Utils/HostAddressUtil.js +30 -0
  333. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
  334. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
  335. package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
  336. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
  337. package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
  338. package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
  339. package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
  340. package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
  341. package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
  342. package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
  343. package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
  344. package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
  345. package/Utils/LinearRegExp/LinearRegExp.js +5 -1
  346. package/Utils/LookupTable.d.mts +3 -0
  347. package/Utils/LookupTable.d.ts +3 -0
  348. package/Utils/LookupTable.js +61 -0
  349. package/Utils/LookupTable.mjs +3 -0
  350. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
  351. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
  352. package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
  353. package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
  354. package/Utils/Markdown/OverLongText.js +296 -2
  355. package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
  356. package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
  357. package/Utils/Markdown/SlowMarkdown.js +354 -4
  358. package/Utils/Markdown/SlowMarkdown.mjs +1 -0
  359. package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
  360. package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
  361. package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
  362. package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
  363. package/Utils/Metrics/MetricSeriesScope.js +5 -1
  364. package/Utils/Milliseconds.d.mts +7 -0
  365. package/Utils/Milliseconds.d.ts +7 -0
  366. package/Utils/Milliseconds.js +60 -0
  367. package/Utils/Milliseconds.mjs +4 -0
  368. package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
  369. package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
  370. package/Utils/Monitor/EndpointAttachmentUtil.js +91 -21
  371. package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
  372. package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
  373. package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
  374. package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
  375. package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
  376. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
  377. package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
  378. package/Utils/Monitor/MonitorRootCauseWording.d.mts +5 -0
  379. package/Utils/Monitor/MonitorRootCauseWording.d.ts +5 -0
  380. package/Utils/Monitor/MonitorRootCauseWording.js +148 -5
  381. package/Utils/Monitor/MonitoringOff.d.mts +2 -0
  382. package/Utils/Monitor/MonitoringOff.d.ts +2 -0
  383. package/Utils/Monitor/MonitoringOff.js +21 -0
  384. package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
  385. package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
  386. package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
  387. package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
  388. package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
  389. package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
  390. package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
  391. package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
  392. package/Utils/Monitor/ProbeAgreementRule.js +58 -0
  393. package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
  394. package/Utils/Monitor/ProbeFailureReading.d.mts +18 -0
  395. package/Utils/Monitor/ProbeFailureReading.d.ts +18 -0
  396. package/Utils/Monitor/ProbeFailureReading.js +166 -0
  397. package/Utils/Monitor/ProbeFailureReading.mjs +8 -0
  398. package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
  399. package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
  400. package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
  401. package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
  402. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
  403. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
  404. package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
  405. package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
  406. package/Utils/Project/NextNumber.js +1 -1
  407. package/Utils/PromQL/PromQLAst.d.mts +159 -0
  408. package/Utils/PromQL/PromQLAst.d.ts +159 -0
  409. package/Utils/PromQL/PromQLAst.js +118 -0
  410. package/Utils/PromQL/PromQLAst.mjs +12 -0
  411. package/Utils/PromQL/PromQLDuration.d.mts +2 -0
  412. package/Utils/PromQL/PromQLDuration.d.ts +2 -0
  413. package/Utils/PromQL/PromQLDuration.js +78 -0
  414. package/Utils/PromQL/PromQLDuration.mjs +3 -0
  415. package/Utils/PromQL/PromQLEngine.d.mts +15 -0
  416. package/Utils/PromQL/PromQLEngine.d.ts +15 -0
  417. package/Utils/PromQL/PromQLEngine.js +974 -0
  418. package/Utils/PromQL/PromQLEngine.mjs +7 -0
  419. package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
  420. package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
  421. package/Utils/PromQL/PromQLEngineTypes.js +10 -0
  422. package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
  423. package/Utils/PromQL/PromQLError.d.mts +11 -0
  424. package/Utils/PromQL/PromQLError.d.ts +11 -0
  425. package/Utils/PromQL/PromQLError.js +27 -0
  426. package/Utils/PromQL/PromQLError.mjs +3 -0
  427. package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
  428. package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
  429. package/Utils/PromQL/PromQLFunctionEvaluators.js +829 -0
  430. package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
  431. package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
  432. package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
  433. package/Utils/PromQL/PromQLFunctions.js +127 -0
  434. package/Utils/PromQL/PromQLFunctions.mjs +4 -0
  435. package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
  436. package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
  437. package/Utils/PromQL/PromQLLabelOrder.js +212 -0
  438. package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
  439. package/Utils/PromQL/PromQLLabels.d.mts +11 -0
  440. package/Utils/PromQL/PromQLLabels.d.ts +11 -0
  441. package/Utils/PromQL/PromQLLabels.js +219 -0
  442. package/Utils/PromQL/PromQLLabels.mjs +9 -0
  443. package/Utils/PromQL/PromQLLexer.d.mts +39 -0
  444. package/Utils/PromQL/PromQLLexer.d.ts +39 -0
  445. package/Utils/PromQL/PromQLLexer.js +391 -0
  446. package/Utils/PromQL/PromQLLexer.mjs +3 -0
  447. package/Utils/PromQL/PromQLMath.d.mts +19 -0
  448. package/Utils/PromQL/PromQLMath.d.ts +19 -0
  449. package/Utils/PromQL/PromQLMath.js +200 -0
  450. package/Utils/PromQL/PromQLMath.mjs +9 -0
  451. package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
  452. package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
  453. package/Utils/PromQL/PromQLMetricNames.js +205 -0
  454. package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
  455. package/Utils/PromQL/PromQLParser.d.mts +4 -0
  456. package/Utils/PromQL/PromQLParser.d.ts +4 -0
  457. package/Utils/PromQL/PromQLParser.js +836 -0
  458. package/Utils/PromQL/PromQLParser.mjs +4 -0
  459. package/Utils/PromQL/PromQLRegex.d.mts +20 -0
  460. package/Utils/PromQL/PromQLRegex.d.ts +20 -0
  461. package/Utils/PromQL/PromQLRegex.js +1014 -0
  462. package/Utils/PromQL/PromQLRegex.mjs +5 -0
  463. package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
  464. package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
  465. package/Utils/PromQL/PrometheusResponse.js +92 -0
  466. package/Utils/PromQL/PrometheusResponse.mjs +3 -0
  467. package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
  468. package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
  469. package/Utils/PromQL/RE2CharacterClass.js +532 -0
  470. package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
  471. package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
  472. package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
  473. package/Utils/RequestFailedDetailsUtil.js +452 -0
  474. package/Utils/RequestFailedDetailsUtil.mjs +2 -0
  475. package/Utils/Rum/PathInSentence.d.mts +5 -0
  476. package/Utils/Rum/PathInSentence.d.ts +5 -0
  477. package/Utils/Rum/PathInSentence.js +46 -0
  478. package/Utils/Rum/PathInSentence.mjs +6 -0
  479. package/Utils/Rum/UrlScrubber.d.mts +5 -1
  480. package/Utils/Rum/UrlScrubber.d.ts +5 -1
  481. package/Utils/Rum/UrlScrubber.js +153 -7
  482. package/Utils/Rum/UserFlow.d.mts +1 -1
  483. package/Utils/Rum/UserFlow.d.ts +1 -1
  484. package/Utils/Rum/UserFlow.js +202 -29
  485. package/Utils/Rum/UserFlow.mjs +1 -1
  486. package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
  487. package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
  488. package/Utils/Runbook/RunbookStepsSignature.js +30 -0
  489. package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
  490. package/Utils/Schema/TypeSchemas.js +6 -0
  491. package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
  492. package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
  493. package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
  494. package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
  495. package/Utils/Slo/SloDuration.d.mts +5 -2
  496. package/Utils/Slo/SloDuration.d.ts +5 -2
  497. package/Utils/Slo/SloDuration.js +11 -6
  498. package/Utils/Slo/SloHealth.js +1 -1
  499. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  500. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  501. package/Utils/Sms/OnCallPageSms.js +3 -1
  502. package/Utils/StateListType.d.mts +11 -0
  503. package/Utils/StateListType.d.ts +11 -0
  504. package/Utils/StateListType.js +21 -0
  505. package/Utils/StateListType.mjs +2 -0
  506. package/Utils/StateOrder.d.mts +8 -11
  507. package/Utils/StateOrder.d.ts +8 -11
  508. package/Utils/StateOrder.js +50 -88
  509. package/Utils/StateOrder.mjs +2 -0
  510. package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
  511. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
  512. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
  513. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
  514. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
  515. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
  516. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
  517. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
  518. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
  519. package/Utils/Syslog/SyslogMessageParser.js +16 -6
  520. package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
  521. package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
  522. package/Utils/Telemetry/HeartbeatAvailability.js +113 -26
  523. package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
  524. package/Utils/ValueFormatter.d.mts +1 -0
  525. package/Utils/ValueFormatter.d.ts +1 -0
  526. package/Utils/ValueFormatter.js +258 -18
  527. package/package.json +1 -1
@@ -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;
@@ -3,13 +3,89 @@ 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.INTERFACE_SATURATION_THRESHOLD_PERCENT = exports.INTERFACE_ERRORS_FLOOR_PER_SECOND = exports.INTERFACE_UTILIZATION_FLOOR_PERCENT = exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = exports.INTERFACE_READING_RELATIVE_CHANGE = exports.INTERFACE_REFRESH_GROUPS = exports.INTERFACE_LAST_SEEN_REFRESH_MS = void 0;
6
7
  const ColumnLength_1 = __importDefault(require("../../Types/Database/ColumnLength"));
8
+ /*
9
+ * Pure helpers that turn ONE device's IF-MIB walk into the exact rows the
10
+ * NetworkInterface inventory should insert and update, plus the set of
11
+ * interface indexes the user has muted. Everything here is deterministic and
12
+ * side-effect free so the column-by-column contract can be tested without a
13
+ * database; the batched SQL that applies it lives in NetworkInterfaceService.
14
+ *
15
+ * This mirrors EndpointAttachmentUtil.decideUpsert / NetworkEndpointService:
16
+ * the decision is pure, the persistence is one statement per chunk - and, as
17
+ * there, a row the walk would leave as it is costs no write at all.
18
+ */
19
+ /*
20
+ * How long a stored interface may go unwritten before a walk that found
21
+ * nothing new about it writes it anyway, to move its lastSeenAt.
22
+ *
23
+ * A walk used to rewrite every interface it saw, on every poll: 3 million
24
+ * interfaces on five-minute polls is 10,000 new row versions a second, each
25
+ * one WAL, a dead tuple and vacuum work, for rows that had not changed.
26
+ * Now an interface whose inventory and state are as stored, and whose rates
27
+ * have not moved noticeably (ratesMoved), is written once per this window:
28
+ * once in every three polls at the default five minutes.
29
+ *
30
+ * Nothing in the product reads an interface's lastSeenAt: the device list,
31
+ * the Interfaces tab, the topology and the alerting all read the device's
32
+ * own lastSeenAt / lastSnmpSeenAt, and the interface's state. So an
33
+ * interface's lastSeenAt is accurate to this window (and one poll), and the
34
+ * API says so.
35
+ */
36
+ exports.INTERFACE_LAST_SEEN_REFRESH_MS = 15 * 60 * 1000;
37
+ /*
38
+ * The refresh is spread across the window, not taken all at once: each
39
+ * interface counts its window on a clock of its own, offset by its ifIndex
40
+ * in steps of a fifteenth of the window (refreshSlot). A switch's ports then
41
+ * come due a few at a time - a third of them on each five-minute poll -
42
+ * rather than all of them on every third poll.
43
+ *
44
+ * That is what lets the refresh be a HOT update. A walk writes a device's
45
+ * ports in one statement, and its rows sit together on a page or two. A
46
+ * page takes a HOT update only into room it has free while the statement
47
+ * runs, because the rows it replaces are not dead until the statement
48
+ * commits: rewriting every port on a page at once needed half the page
49
+ * free, so most of each refresh left the page, wrote an entry into every
50
+ * index, and left dead ones for vacuum. A third of the ports needs a
51
+ * quarter of the page, which is about the room the table keeps (fillfactor,
52
+ * SetNetworkInterfaceFillfactor1809164000000).
53
+ */
54
+ exports.INTERFACE_REFRESH_GROUPS = 15;
55
+ /*
56
+ * When a walk writes an interface's readings again (ratesMoved). The stored
57
+ * readings are what the Interfaces tab, the device's interface preview and
58
+ * the topology's links show; their history is in the interface metrics,
59
+ * written on every poll. A reading is written again when it moves by at
60
+ * least a tenth of the larger of the two readings AND by more than noise:
61
+ *
62
+ * in / out rate 1% of the link's speed, 1 Mbps when it reports none
63
+ * utilization one percentage point
64
+ * errors / second 0.01, the resolution it is stored at
65
+ *
66
+ * and always when it crosses a line a reader draws: utilization reaching or
67
+ * leaving INTERFACE_SATURATION_THRESHOLD_PERCENT (a saturated link on the
68
+ * map, a highlighted row in the preview), errors starting or stopping (the
69
+ * preview's attention order), and a reading appearing or going away (a dash
70
+ * in the table).
71
+ */
72
+ exports.INTERFACE_READING_RELATIVE_CHANGE = 0.1;
73
+ exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = 0.01;
74
+ exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = 1;
75
+ exports.INTERFACE_UTILIZATION_FLOOR_PERCENT = 1;
76
+ exports.INTERFACE_ERRORS_FLOOR_PER_SECOND = 0.01;
77
+ /*
78
+ * Utilization at or above this reads as saturated: the topology's link state
79
+ * (LINK_SATURATION_THRESHOLD_PERCENT in the dashboard) and the interface
80
+ * preview's highlight both draw the line here.
81
+ */
82
+ exports.INTERFACE_SATURATION_THRESHOLD_PERCENT = 80;
7
83
  // Bits/sec on the wire; Mbps in the inventory.
8
84
  const BITS_PER_MEGABIT = 1000000;
9
85
  /*
10
86
  * Rate columns are stored rounded to three decimals (kbps resolution). The
11
- * rounding is part of the stored value, not presentation: it keeps a rate
12
- * that wobbles in the ninth decimal from writing a new row version every poll.
87
+ * rounding is part of the stored value, not presentation. Whether a moved
88
+ * rate is written at all is ratesMoved's call.
13
89
  */
14
90
  const RATE_DECIMAL_SCALE = 1000;
15
91
  /*
@@ -30,17 +106,21 @@ function truncateShortText(value) {
30
106
  class InterfaceInventoryUtil {
31
107
  /*
32
108
  * (walked interfaces, stored rows, walk timestamp) -> (rows to insert,
33
- * rows to update, muted indexes).
109
+ * rows to update, rows left as they are, muted indexes).
34
110
  *
35
111
  * lastSeenAt is stamped from the caller's single `now` for every row, so a
36
112
  * 400-port chassis does not end up with 400 slightly different timestamps
37
113
  * that make "which ports answered on this walk" unanswerable.
114
+ *
115
+ * A known interface is updated only when needsWrite says so; otherwise it
116
+ * is listed as unchanged and costs nothing. `refreshMs` is for tests.
38
117
  */
39
118
  static planWalkUpsert(data) {
40
119
  var _a, _b, _c, _d;
41
120
  const plan = {
42
121
  inserts: [],
43
122
  updates: [],
123
+ unchangedInterfaceIndexes: [],
44
124
  unmonitoredInterfaceIndexes: [],
45
125
  };
46
126
  /*
@@ -75,7 +155,7 @@ class InterfaceInventoryUtil {
75
155
  plan.unmonitoredInterfaceIndexes.push(walked.interfaceIndex);
76
156
  }
77
157
  if (existing) {
78
- plan.updates.push({
158
+ const update = {
79
159
  interfaceIndex: walked.interfaceIndex,
80
160
  name: InterfaceInventoryUtil.interfaceName(walked),
81
161
  alias: truncateShortText(walked.alias),
@@ -89,7 +169,18 @@ class InterfaceInventoryUtil {
89
169
  utilizationPercent: (_b = walked.utilizationPercent) !== null && _b !== void 0 ? _b : null,
90
170
  errorsPerSecond: (_c = walked.errorsPerSecond) !== null && _c !== void 0 ? _c : null,
91
171
  lastSeenAt: data.now,
92
- });
172
+ };
173
+ if (InterfaceInventoryUtil.needsWrite({
174
+ stored: existing,
175
+ update: update,
176
+ now: data.now,
177
+ refreshMs: data.refreshMs,
178
+ })) {
179
+ plan.updates.push(update);
180
+ }
181
+ else {
182
+ plan.unchangedInterfaceIndexes.push(walked.interfaceIndex);
183
+ }
93
184
  }
94
185
  else {
95
186
  plan.inserts.push({
@@ -108,6 +199,127 @@ class InterfaceInventoryUtil {
108
199
  }
109
200
  return plan;
110
201
  }
202
+ /*
203
+ * Whether a walk writes a stored interface again, given the row the walk
204
+ * would write. In order:
205
+ *
206
+ * 1. Never when the row was last seen at or after this walk. A newer walk
207
+ * wrote it, and the UPDATE's own WHERE would refuse it anyway (an older
208
+ * poll processed after a newer one, OneUptime issue #7389).
209
+ * 2. Always when the row has no lastSeenAt, or was last written in an
210
+ * earlier refresh slot of its own (refreshSlot: a window of
211
+ * INTERFACE_LAST_SEEN_REFRESH_MS, offset by its ifIndex): its
212
+ * lastSeenAt moves, and so does any reading that moved too little to
213
+ * be written on its own. So an answering interface's lastSeenAt is
214
+ * never more than one window and one poll old.
215
+ * 3. Always when anything the walk reads about the port changed: its
216
+ * name, alias, MAC, type, speed, or its operational or administrative
217
+ * state. Compared exactly, after the same truncation and unit
218
+ * conversion the write applies.
219
+ * 4. When a reading moved noticeably (ratesMoved).
220
+ *
221
+ * Otherwise the row is left as it is. isMonitored plays no part: the walk
222
+ * never writes it.
223
+ */
224
+ static needsWrite(data) {
225
+ var _a;
226
+ const stored = data.stored;
227
+ const update = data.update;
228
+ const lastSeenAt = InterfaceInventoryUtil.toTime(stored.lastSeenAt);
229
+ if (lastSeenAt !== null && lastSeenAt >= data.now.getTime()) {
230
+ return false;
231
+ }
232
+ if (lastSeenAt === null) {
233
+ return true;
234
+ }
235
+ const refreshMs = (_a = data.refreshMs) !== null && _a !== void 0 ? _a : exports.INTERFACE_LAST_SEEN_REFRESH_MS;
236
+ if (InterfaceInventoryUtil.refreshSlot({
237
+ time: data.now.getTime(),
238
+ interfaceIndex: update.interfaceIndex,
239
+ refreshMs: refreshMs,
240
+ }) >
241
+ InterfaceInventoryUtil.refreshSlot({
242
+ time: lastSeenAt,
243
+ interfaceIndex: update.interfaceIndex,
244
+ refreshMs: refreshMs,
245
+ })) {
246
+ return true;
247
+ }
248
+ if (!InterfaceInventoryUtil.isSame(stored.name, update.name) ||
249
+ !InterfaceInventoryUtil.isSame(stored.alias, update.alias) ||
250
+ !InterfaceInventoryUtil.isSame(stored.macAddress, update.macAddress) ||
251
+ !InterfaceInventoryUtil.isSame(stored.interfaceType, update.interfaceType) ||
252
+ !InterfaceInventoryUtil.isSame(stored.isOperationallyUp, update.isOperationallyUp) ||
253
+ !InterfaceInventoryUtil.isSame(stored.isAdministrativelyUp, update.isAdministrativelyUp) ||
254
+ !InterfaceInventoryUtil.isSame(stored.speedInMbps, update.speedInMbps)) {
255
+ return true;
256
+ }
257
+ return InterfaceInventoryUtil.ratesMoved({ stored, update });
258
+ }
259
+ /*
260
+ * Which refresh window of its own a time falls in, for one interface:
261
+ * windows of `refreshMs`, offset by the interface's ifIndex in steps of
262
+ * 1/INTERFACE_REFRESH_GROUPS of a window. Interfaces whose ifIndex differs
263
+ * by one come due a fifteenth of a window apart, so a device's ports are
264
+ * spread evenly across it (see INTERFACE_REFRESH_GROUPS for why).
265
+ */
266
+ static refreshSlot(data) {
267
+ const group = ((Math.trunc(data.interfaceIndex) % exports.INTERFACE_REFRESH_GROUPS) +
268
+ exports.INTERFACE_REFRESH_GROUPS) %
269
+ exports.INTERFACE_REFRESH_GROUPS;
270
+ return Math.floor((data.time + (group * data.refreshMs) / exports.INTERFACE_REFRESH_GROUPS) /
271
+ data.refreshMs);
272
+ }
273
+ /*
274
+ * Whether any of the four readings moved enough to be written on its own
275
+ * (see INTERFACE_READING_RELATIVE_CHANGE for the rule and why).
276
+ */
277
+ static ratesMoved(data) {
278
+ const stored = data.stored;
279
+ const update = data.update;
280
+ const rateFloorMbps = update.speedInMbps !== null && update.speedInMbps > 0
281
+ ? update.speedInMbps * exports.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED
282
+ : exports.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED;
283
+ const isSaturated = (utilization) => {
284
+ return (utilization !== null && utilization !== void 0 ? utilization : 0) >= exports.INTERFACE_SATURATION_THRESHOLD_PERCENT;
285
+ };
286
+ const hasErrors = (errorsPerSecond) => {
287
+ return (errorsPerSecond !== null && errorsPerSecond !== void 0 ? errorsPerSecond : 0) > 0;
288
+ };
289
+ return (InterfaceInventoryUtil.readingMoved(stored.inRateMbps, update.inRateMbps, rateFloorMbps) ||
290
+ InterfaceInventoryUtil.readingMoved(stored.outRateMbps, update.outRateMbps, rateFloorMbps) ||
291
+ InterfaceInventoryUtil.readingMoved(stored.utilizationPercent, update.utilizationPercent, exports.INTERFACE_UTILIZATION_FLOOR_PERCENT) ||
292
+ isSaturated(stored.utilizationPercent) !==
293
+ isSaturated(update.utilizationPercent) ||
294
+ InterfaceInventoryUtil.readingMoved(stored.errorsPerSecond, update.errorsPerSecond, exports.INTERFACE_ERRORS_FLOOR_PER_SECOND) ||
295
+ hasErrors(stored.errorsPerSecond) !== hasErrors(update.errorsPerSecond));
296
+ }
297
+ /*
298
+ * A reading that appeared or went away moved; two readings moved when
299
+ * they are at least `floor` apart and at least a tenth of the larger one.
300
+ */
301
+ static readingMoved(stored, current, floor) {
302
+ const before = stored !== null && stored !== void 0 ? stored : null;
303
+ if (before === null || current === null) {
304
+ return before !== current;
305
+ }
306
+ const change = Math.abs(current - before);
307
+ return (change >= floor &&
308
+ change >=
309
+ exports.INTERFACE_READING_RELATIVE_CHANGE *
310
+ Math.max(Math.abs(before), Math.abs(current)));
311
+ }
312
+ // Null and undefined are both "nothing stored".
313
+ static isSame(stored, current) {
314
+ return (stored !== null && stored !== void 0 ? stored : null) === current;
315
+ }
316
+ static toTime(value) {
317
+ if (value === null || value === undefined) {
318
+ return null;
319
+ }
320
+ const time = new Date(value).getTime();
321
+ return isNaN(time) ? null : time;
322
+ }
111
323
  /*
112
324
  * `name` is NOT NULL in the schema, and some agents return an empty
113
325
  * ifDescr for tunnel/loopback pseudo-interfaces — hence the empty-string
@@ -1,2 +1,10 @@
1
1
  import commonJsModule from "./InterfaceInventoryUtil.js";
2
2
  export default commonJsModule.default;
3
+ export const INTERFACE_ERRORS_FLOOR_PER_SECOND = commonJsModule.INTERFACE_ERRORS_FLOOR_PER_SECOND;
4
+ export const INTERFACE_LAST_SEEN_REFRESH_MS = commonJsModule.INTERFACE_LAST_SEEN_REFRESH_MS;
5
+ export const INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED = commonJsModule.INTERFACE_RATE_FLOOR_MBPS_WITHOUT_SPEED;
6
+ export const INTERFACE_RATE_FLOOR_SHARE_OF_SPEED = commonJsModule.INTERFACE_RATE_FLOOR_SHARE_OF_SPEED;
7
+ export const INTERFACE_READING_RELATIVE_CHANGE = commonJsModule.INTERFACE_READING_RELATIVE_CHANGE;
8
+ export const INTERFACE_REFRESH_GROUPS = commonJsModule.INTERFACE_REFRESH_GROUPS;
9
+ export const INTERFACE_SATURATION_THRESHOLD_PERCENT = commonJsModule.INTERFACE_SATURATION_THRESHOLD_PERCENT;
10
+ export const INTERFACE_UTILIZATION_FLOOR_PERCENT = commonJsModule.INTERFACE_UTILIZATION_FLOOR_PERCENT;