@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
@@ -4,7 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HeartbeatAvailabilityUtil = exports.MIN_SILENCE_EVIDENCE_MS = exports.HEARTBEAT_MAX_BACKDATE_MS = exports.HEARTBEAT_INGEST_LAG_MS = void 0;
7
+ const AggregationInterval_1 = __importDefault(require("../../Types/BaseDatabase/AggregationInterval"));
7
8
  const AggregationIntervalUtil_1 = __importDefault(require("../../Types/BaseDatabase/AggregationIntervalUtil"));
9
+ const Date_1 = __importDefault(require("../../Types/Date"));
10
+ const Timezone_1 = __importDefault(require("../../Types/Timezone"));
8
11
  const ReceivingGaps_1 = __importDefault(require("./ReceivingGaps"));
9
12
  /*
10
13
  * How long after a bucket closes we keep treating silence in it as
@@ -43,6 +46,18 @@ exports.HEARTBEAT_MAX_BACKDATE_MS = 2 * 60000;
43
46
  * down when the host stayed silent through minutes OneUptime was listening.
44
47
  */
45
48
  exports.MIN_SILENCE_EVIDENCE_MS = 2 * 60000;
49
+ /*
50
+ * The calendar unit of each bucket that is one. The server starts a day,
51
+ * week, month or year bucket at a midnight, a Monday, a 1st or a 1 January
52
+ * in the zone the request named (AggregateBy.timezone), or in UTC when it
53
+ * named none (issue #7277).
54
+ */
55
+ const CALENDAR_UNIT_OF_INTERVAL = {
56
+ [AggregationInterval_1.default.Day]: "day",
57
+ [AggregationInterval_1.default.Week]: "week",
58
+ [AggregationInterval_1.default.Month]: "month",
59
+ [AggregationInterval_1.default.Year]: "year",
60
+ };
46
61
  class HeartbeatAvailabilityUtil {
47
62
  static buildAvailabilitySeries(data) {
48
63
  const windowStartMs = data.windowStart.getTime();
@@ -69,31 +84,29 @@ class HeartbeatAvailabilityUtil {
69
84
  rowTimestamps.sort((a, b) => {
70
85
  return a - b;
71
86
  });
87
+ const slots = this.getSlots({
88
+ interval,
89
+ bucketMs,
90
+ rowTimestamps,
91
+ windowStartMs,
92
+ windowEndMs,
93
+ timezone: data.timezone,
94
+ });
95
+ const lastIndex = slots.length - 1;
96
+ if (lastIndex < 0) {
97
+ return { points: [], uptimePercent: null };
98
+ }
72
99
  /*
73
- * Anchor the grid to the first returned row rather than to the
74
- * window start: server buckets are `toStartOfInterval`-aligned and
75
- * the window start generally isn't, and anchoring to real data
76
- * also absorbs any constant offset introduced by timestamp
77
- * serialization. With no rows at all, anchor to the window start —
78
- * everything is down regardless of alignment.
79
- */
80
- const anchorMs = rowTimestamps.length > 0 ? rowTimestamps[0] : windowStartMs;
81
- const stepsBack = Math.ceil((anchorMs - windowStartMs) / bucketMs);
82
- const gridStartMs = anchorMs - stepsBack * bucketMs;
83
- const lastIndex = Math.floor((windowEndMs - gridStartMs) / bucketMs);
84
- /*
85
- * Snap each row to its nearest grid slot instead of requiring
86
- * exact equality. Minute/hour buckets land exactly; day buckets
87
- * can drift by an hour against a fixed 24h step when timestamps
88
- * cross a DST boundary in the rendering timezone, and Month/Year
89
- * widths are calendar-approximate — nearest-slot matching with a
90
- * half-bucket tolerance absorbs all of those without ever mapping
91
- * one row to two slots.
100
+ * Snap each row to the slot whose start is nearest it instead of
101
+ * requiring exact equality: a row a few seconds or an hour off its
102
+ * slot - a serialization offset, or day buckets the server cut in
103
+ * another zone than the one this was given - still lands on a slot
104
+ * of its own, and no row is ever mapped to two slots.
92
105
  */
93
106
  const presentSlots = new Set();
94
107
  for (const t of rowTimestamps) {
95
- const index = Math.round((t - gridStartMs) / bucketMs);
96
- if (index >= 0 && index <= lastIndex) {
108
+ const index = this.getNearestSlotIndex(slots, t);
109
+ if (index >= 0) {
97
110
  presentSlots.add(index);
98
111
  }
99
112
  }
@@ -103,12 +116,12 @@ class HeartbeatAvailabilityUtil {
103
116
  * they start before the window does (leading edge of the grid).
104
117
  */
105
118
  const evaluableEndMs = Math.min(windowEndMs, nowMs - exports.HEARTBEAT_INGEST_LAG_MS);
106
- const receivingGaps = ReceivingGaps_1.default.clip(data.receivingGaps || [], new Date(gridStartMs), new Date(gridStartMs + (lastIndex + 1) * bucketMs));
119
+ const receivingGaps = ReceivingGaps_1.default.clip(data.receivingGaps || [], new Date(slots[0].startMs), new Date(slots[lastIndex].endMs));
107
120
  const states = [];
108
121
  for (let index = 0; index <= lastIndex; index++) {
109
- const startMs = gridStartMs + index * bucketMs;
122
+ const { startMs, endMs } = slots[index];
110
123
  const up = presentSlots.has(index);
111
- const isPartial = startMs < windowStartMs || startMs + bucketMs > evaluableEndMs;
124
+ const isPartial = startMs < windowStartMs || endMs > evaluableEndMs;
112
125
  if (up) {
113
126
  states.push("up");
114
127
  }
@@ -118,7 +131,7 @@ class HeartbeatAvailabilityUtil {
118
131
  else if (this.isNotMonitored({
119
132
  receivingGaps,
120
133
  startMs,
121
- endMs: startMs + bucketMs,
134
+ endMs,
122
135
  })) {
123
136
  states.push("excluded");
124
137
  }
@@ -166,7 +179,7 @@ class HeartbeatAvailabilityUtil {
166
179
  }
167
180
  const up = state === "up" || isBridged(index);
168
181
  points.push({
169
- x: new Date(gridStartMs + index * bucketMs),
182
+ x: new Date(slots[index].startMs),
170
183
  y: up ? 100 : 0,
171
184
  });
172
185
  evaluatedCount++;
@@ -179,6 +192,85 @@ class HeartbeatAvailabilityUtil {
179
192
  uptimePercent: evaluatedCount > 0 ? (upCount / evaluatedCount) * 100 : null,
180
193
  };
181
194
  }
195
+ /*
196
+ * The server's buckets from the one holding the window's start to the one
197
+ * holding its end, in order.
198
+ */
199
+ static getSlots(data) {
200
+ const slots = [];
201
+ const unit = CALENDAR_UNIT_OF_INTERVAL[data.interval];
202
+ if (unit) {
203
+ /*
204
+ * Days, weeks, months and years are walked on the calendar of the
205
+ * zone the request named, as the server cut them: each slot runs from
206
+ * one midnight (Monday, 1st, 1 January) to the next, however long
207
+ * that was. A fixed step drifts off them - an hour a clock change for
208
+ * days, which put two slots on one day and the rest a day early, and
209
+ * days a month for months.
210
+ */
211
+ const timezone = data.timezone || Timezone_1.default.UTC;
212
+ let startMs = Date_1.default.getStartOfCalendarUnit(new Date(data.windowStartMs), unit, timezone).getTime();
213
+ while (startMs <= data.windowEndMs) {
214
+ /*
215
+ * The next unit is the one holding the instant a unit and a half
216
+ * on: no real unit is half a nominal one shorter or longer than it
217
+ * (a day is 23 to 25 hours, a month 28 to 31 days).
218
+ */
219
+ const endMs = Date_1.default.getStartOfCalendarUnit(new Date(startMs + data.bucketMs * 1.5), unit, timezone).getTime();
220
+ if (!(endMs > startMs)) {
221
+ break;
222
+ }
223
+ slots.push({ startMs, endMs });
224
+ startMs = endMs;
225
+ }
226
+ return slots;
227
+ }
228
+ /*
229
+ * Finer buckets are the same width in every zone. Anchor their grid to
230
+ * the first returned row rather than to the window start: server
231
+ * buckets are `toStartOfInterval`-aligned and the window start
232
+ * generally isn't, and anchoring to real data also absorbs any
233
+ * constant offset introduced by timestamp serialization. With no rows
234
+ * at all, anchor to the window start — everything is down regardless
235
+ * of alignment.
236
+ */
237
+ const anchorMs = data.rowTimestamps.length > 0
238
+ ? data.rowTimestamps[0]
239
+ : data.windowStartMs;
240
+ const stepsBack = Math.ceil((anchorMs - data.windowStartMs) / data.bucketMs);
241
+ const gridStartMs = anchorMs - stepsBack * data.bucketMs;
242
+ const lastIndex = Math.floor((data.windowEndMs - gridStartMs) / data.bucketMs);
243
+ for (let index = 0; index <= lastIndex; index++) {
244
+ const startMs = gridStartMs + index * data.bucketMs;
245
+ slots.push({ startMs, endMs: startMs + data.bucketMs });
246
+ }
247
+ return slots;
248
+ }
249
+ /*
250
+ * The slot whose start is nearest `t`: `t` is past the middle of the slot
251
+ * before it, and short of its own middle. Up to half a slot before the
252
+ * first slot still counts, as does anything short of the middle of the
253
+ * last one; further out is no slot (-1).
254
+ */
255
+ static getNearestSlotIndex(slots, t) {
256
+ const first = slots[0];
257
+ if (t < first.startMs - (first.endMs - first.startMs) / 2) {
258
+ return -1;
259
+ }
260
+ let low = 0;
261
+ let high = slots.length;
262
+ while (low < high) {
263
+ const middle = Math.floor((low + high) / 2);
264
+ const slot = slots[middle];
265
+ if (t < (slot.startMs + slot.endMs) / 2) {
266
+ high = middle;
267
+ }
268
+ else {
269
+ low = middle + 1;
270
+ }
271
+ }
272
+ return low < slots.length ? low : -1;
273
+ }
182
274
  /*
183
275
  * Rule 4: a silent bucket OneUptime was not receiving for, except for
184
276
  * less than MIN_SILENCE_EVIDENCE_MS of it, says nothing about the host.
@@ -138,8 +138,8 @@ class DayUptimeGraphUtil {
138
138
  });
139
139
  }
140
140
  /*
141
- * "1 scheduled maintenance event", "3 scheduled maintenance events": the
142
- * count a day's accessible name and its dialog read out.
141
+ * "1 maintenance event", "3 maintenance events": the count a day's
142
+ * accessible name and its dialog read out.
143
143
  */
144
144
  static getMaintenanceCountLabel(data) {
145
145
  const labels = data.labels || UptimeHistoryLabels_1.DefaultUptimeHistoryLabels;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneuptime/common",
3
- "version": "14.0.110",
3
+ "version": "14.1.0",
4
4
  "description": "OneUptime's shared types, utilities and data models, for Node.js and TypeScript.",
5
5
  "homepage": "https://oneuptime.com",
6
6
  "repository": {