@oneuptime/common 14.1.0 → 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 (249) hide show
  1. package/Models/DatabaseModels/Alert.d.mts +1 -0
  2. package/Models/DatabaseModels/Alert.d.ts +1 -0
  3. package/Models/DatabaseModels/Alert.js +34 -0
  4. package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
  5. package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
  6. package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
  7. package/Models/DatabaseModels/Incident.d.mts +1 -0
  8. package/Models/DatabaseModels/Incident.d.ts +1 -0
  9. package/Models/DatabaseModels/Incident.js +35 -0
  10. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
  11. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
  12. package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
  13. package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
  14. package/Models/DatabaseModels/Index.js +2 -0
  15. package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
  16. package/Types/AI/AIActionWords.d.mts +3 -1
  17. package/Types/AI/AIActionWords.d.ts +3 -1
  18. package/Types/AI/AIActionWords.js +70 -1
  19. package/Types/AI/AIActionWords.mjs +2 -0
  20. package/Types/AI/AIChatTypes.d.mts +2 -1
  21. package/Types/AI/AIChatTypes.d.ts +2 -1
  22. package/Types/AI/AIReadTableWords.d.mts +192 -0
  23. package/Types/AI/AIReadTableWords.d.ts +192 -0
  24. package/Types/AI/AIReadTableWords.js +368 -0
  25. package/Types/AI/AIReadTableWords.mjs +18 -0
  26. package/Types/AI/AiRunRefusal.d.mts +3 -0
  27. package/Types/AI/AiRunRefusal.d.ts +3 -0
  28. package/Types/AI/AiRunRefusal.js +22 -1
  29. package/Types/AI/ResourceAiAccessPermissions.js +7 -18
  30. package/Types/AuditLog/AuditLogActionLabel.js +19 -9
  31. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
  32. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
  33. package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
  34. package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
  35. package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
  36. package/Types/Cloud/CloudResourceHealth.js +405 -13
  37. package/Types/Cloud/CloudResourceHealth.mjs +28 -0
  38. package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
  39. package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
  40. package/Types/DataObservability/DataCheckRefusals.js +77 -0
  41. package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
  42. package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
  43. package/Types/Date.d.mts +2 -0
  44. package/Types/Date.d.ts +2 -0
  45. package/Types/Date.js +22 -0
  46. package/Types/DateLanguage.d.mts +2 -0
  47. package/Types/DateLanguage.d.ts +2 -0
  48. package/Types/DateLanguage.js +8 -5
  49. package/Types/Email/EmailTemplateType.d.mts +1 -0
  50. package/Types/Email/EmailTemplateType.d.ts +1 -0
  51. package/Types/Email/EmailTemplateType.js +2 -0
  52. package/Types/Exception/EgressGuardException.js +1 -1
  53. package/Types/Exception/ErrorMessageRule.d.mts +1 -0
  54. package/Types/Exception/ErrorMessageRule.d.ts +1 -0
  55. package/Types/Exception/ErrorMessageRule.js +67 -13
  56. package/Types/Exception/ErrorMessageRule.mjs +1 -0
  57. package/Types/Exception/ExceptionMessages.d.mts +2 -0
  58. package/Types/Exception/ExceptionMessages.d.ts +2 -0
  59. package/Types/Exception/ExceptionMessages.js +2 -0
  60. package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
  61. package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
  62. package/Types/Incident/PostmortemActionItemStatus.js +74 -0
  63. package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
  64. package/Types/JSONFunctions.js +10 -3
  65. package/Types/Link.d.mts +1 -0
  66. package/Types/Link.d.ts +1 -0
  67. package/Types/MeaningKeys.d.mts +4 -0
  68. package/Types/MeaningKeys.d.ts +4 -0
  69. package/Types/MeaningKeys.js +74 -0
  70. package/Types/MeaningKeys.mjs +5 -0
  71. package/Types/Monitor/WhoIsTold.d.mts +3 -0
  72. package/Types/Monitor/WhoIsTold.d.ts +3 -0
  73. package/Types/Monitor/WhoIsTold.js +63 -13
  74. package/Types/NoBreakSpaces.d.mts +16 -0
  75. package/Types/NoBreakSpaces.d.ts +16 -0
  76. package/Types/NoBreakSpaces.js +419 -0
  77. package/Types/NoBreakSpaces.mjs +9 -0
  78. package/Types/NotificationRule/PagingLadder.d.mts +12 -0
  79. package/Types/NotificationRule/PagingLadder.d.ts +12 -0
  80. package/Types/NotificationRule/PagingLadder.js +159 -11
  81. package/Types/NotificationRule/PagingLadder.mjs +3 -0
  82. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
  83. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
  84. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
  85. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
  86. package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
  87. package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
  88. package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
  89. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
  90. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
  91. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
  92. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
  93. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
  94. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
  95. package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
  96. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  97. package/Types/OpenStack/OpenStackCapacity.js +12 -5
  98. package/Types/Permission.d.mts +4 -0
  99. package/Types/Permission.d.ts +4 -0
  100. package/Types/Permission.js +64 -8
  101. package/Types/Product/ProductUsage.js +2 -1
  102. package/Types/Product/ProjectProductsAnswer.js +2 -1
  103. package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
  104. package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
  105. package/Types/ResourceAiAgent/AiResourceType.js +12 -0
  106. package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
  107. package/Types/Rum/ProductAnalyticsEvents.js +13 -1
  108. package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
  109. package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
  110. package/Types/Rum/SessionReplayCustomEvents.js +12 -0
  111. package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
  112. package/Types/SetupHealth/SetupHealth.d.mts +1 -0
  113. package/Types/SetupHealth/SetupHealth.d.ts +1 -0
  114. package/Types/SetupHealth/SetupHealth.js +13 -5
  115. package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
  116. package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
  117. package/Types/StatusPage/DefaultStatusNames.js +74 -28
  118. package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
  119. package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
  120. package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
  121. package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
  122. package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
  123. package/Types/Translator.d.mts +1 -0
  124. package/Types/Translator.d.ts +1 -0
  125. package/Types/Translator.js +100 -19
  126. package/Types/Translator.mjs +1 -0
  127. package/Types/UserSession/SessionLength.d.mts +33 -0
  128. package/Types/UserSession/SessionLength.d.ts +33 -0
  129. package/Types/UserSession/SessionLength.js +134 -5
  130. package/Types/UserSession/SessionLength.mjs +5 -0
  131. package/Types/Workflow/WorkflowStatus.js +21 -10
  132. package/Utils/AI/InvestigationReport.js +2 -2
  133. package/Utils/API.d.mts +0 -11
  134. package/Utils/API.d.ts +0 -11
  135. package/Utils/API.js +0 -432
  136. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
  137. package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
  138. package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
  139. package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
  140. package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
  141. package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
  142. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
  143. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
  144. package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
  145. package/Utils/DefaultRecordNames.d.mts +6 -0
  146. package/Utils/DefaultRecordNames.d.ts +6 -0
  147. package/Utils/DefaultRecordNames.js +122 -0
  148. package/Utils/DefaultRecordNames.mjs +6 -0
  149. package/Utils/Grok/Grok.js +7 -4
  150. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
  151. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
  152. package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
  153. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
  154. package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
  155. package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
  156. package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
  157. package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
  158. package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
  159. package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
  160. package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
  161. package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
  162. package/Utils/LookupTable.d.mts +3 -0
  163. package/Utils/LookupTable.d.ts +3 -0
  164. package/Utils/LookupTable.js +61 -0
  165. package/Utils/LookupTable.mjs +3 -0
  166. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
  167. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
  168. package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
  169. package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
  170. package/Utils/Markdown/OverLongText.js +296 -2
  171. package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
  172. package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
  173. package/Utils/Markdown/SlowMarkdown.js +354 -4
  174. package/Utils/Markdown/SlowMarkdown.mjs +1 -0
  175. package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
  176. package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
  177. package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
  178. package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
  179. package/Utils/Metrics/MetricSeriesScope.js +5 -1
  180. package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
  181. package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
  182. package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
  183. package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
  184. package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
  185. package/Utils/Monitor/ProbeAgreementRule.js +58 -0
  186. package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
  187. package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
  188. package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
  189. package/Utils/Monitor/ProbeFailureReading.js +30 -1
  190. package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
  191. package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
  192. package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
  193. package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
  194. package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
  195. package/Utils/PromQL/PromQLEngine.js +18 -9
  196. package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
  197. package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
  198. package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
  199. package/Utils/PromQL/PromQLLabelOrder.js +212 -0
  200. package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
  201. package/Utils/PromQL/PromQLLabels.js +4 -3
  202. package/Utils/PromQL/PromQLMetricNames.js +8 -2
  203. package/Utils/PromQL/PromQLParser.js +11 -6
  204. package/Utils/PromQL/PromQLRegex.d.mts +11 -0
  205. package/Utils/PromQL/PromQLRegex.d.ts +11 -0
  206. package/Utils/PromQL/PromQLRegex.js +990 -50
  207. package/Utils/PromQL/PromQLRegex.mjs +3 -0
  208. package/Utils/PromQL/PrometheusResponse.js +3 -1
  209. package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
  210. package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
  211. package/Utils/PromQL/RE2CharacterClass.js +532 -0
  212. package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
  213. package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
  214. package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
  215. package/Utils/RequestFailedDetailsUtil.js +452 -0
  216. package/Utils/RequestFailedDetailsUtil.mjs +2 -0
  217. package/Utils/Rum/UrlScrubber.d.mts +1 -1
  218. package/Utils/Rum/UrlScrubber.d.ts +1 -1
  219. package/Utils/Rum/UrlScrubber.js +10 -4
  220. package/Utils/Rum/UserFlow.js +22 -4
  221. package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
  222. package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
  223. package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
  224. package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
  225. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  226. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  227. package/Utils/Sms/OnCallPageSms.js +3 -1
  228. package/Utils/StateListType.d.mts +11 -0
  229. package/Utils/StateListType.d.ts +11 -0
  230. package/Utils/StateListType.js +21 -0
  231. package/Utils/StateListType.mjs +2 -0
  232. package/Utils/StateOrder.d.mts +8 -11
  233. package/Utils/StateOrder.d.ts +8 -11
  234. package/Utils/StateOrder.js +49 -84
  235. package/Utils/StateOrder.mjs +2 -0
  236. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
  237. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
  238. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
  239. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
  240. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
  241. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
  242. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
  243. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
  244. package/Utils/Syslog/SyslogMessageParser.js +16 -6
  245. package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
  246. package/Utils/ValueFormatter.d.mts +1 -0
  247. package/Utils/ValueFormatter.d.ts +1 -0
  248. package/Utils/ValueFormatter.js +258 -18
  249. package/package.json +1 -1
@@ -31,10 +31,14 @@
31
31
  * Both are counted by the server, from the session's own facts
32
32
  * (SessionFacts): when it signed in, and when its person was last active. A
33
33
  * browser says how long its person has not clicked, typed or scrolled when
34
- * it renews the session; anything else (the mobile app, an older page) is
35
- * active whenever it renews. The server decides at every renewal and on
36
- * every request (getSessionEnd), never the browser, and a change applies to
37
- * the sessions there are: a shorter length signs out everyone it is past.
34
+ * it renews the session, and the longest time they went without since its
35
+ * last renewal - a browser closed, a computer asleep - so opening
36
+ * OneUptime again after the idle timeout does not bring the session back
37
+ * (issue #6789); anything else (the mobile app, an older page) is active
38
+ * whenever it renews. The server decides at every renewal
39
+ * (decideSessionRenewal) and on every request (getSessionEnd), never the
40
+ * browser, and a change applies to the sessions there are: a shorter
41
+ * length signs out everyone it is past.
38
42
  *
39
43
  * The values live in the GlobalConfig columns below, the lengths in whole
40
44
  * minutes. The Enterprise module hands core what they hold (EnterpriseEdition.
@@ -42,7 +46,8 @@
42
46
  * as it always has.
43
47
  */
44
48
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.getActivityAtRenewal = exports.readReportedInactivityInSeconds = exports.MAX_REPORTED_INACTIVITY_IN_SECONDS = exports.getSessionEndReachedBy = exports.getSessionEnd = exports.INACTIVE_FOR_IN_SECONDS_FIELD = exports.readSessionEndReason = exports.SESSION_ENDED_QUERY_PARAM = exports.isSessionEndReason = exports.SessionEndReason = exports.doesShortenAnySession = exports.getIdleTimeoutInMinutes = exports.getSessionLengthRule = exports.hasSessionLimits = exports.isSessionLengthRuleSet = exports.sanitizeSessionLengths = exports.readSessionLengths = exports.toSessionLengths = exports.readSessionLengthSettings = exports.NO_SESSION_LENGTH_SETTINGS = exports.NO_SESSION_LENGTHS = exports.NO_SESSION_LENGTH_RULE = exports.readSessionLengthValue = exports.getSessionLengthSettingProblem = exports.getSeparateSsoSessionLengthsProblem = exports.getSessionLengthProblem = exports.getSessionLengthRange = exports.SEPARATE_SSO_SESSION_LENGTHS_PROBLEM = exports.SESSION_IDLE_TIMEOUT_PROBLEM = exports.SESSION_LENGTH_PROBLEM = exports.SESSION_IDLE_TIMEOUT_CHOICES_IN_MINUTES = exports.SESSION_LENGTH_CHOICES_IN_MINUTES = exports.MAX_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.DEFAULT_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.DEFAULT_SESSION_IDLE_DAYS = exports.MAX_SESSION_LENGTH_IN_MINUTES = exports.MIN_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.MIN_SESSION_LENGTH_IN_MINUTES = exports.MINUTES_IN_A_DAY = exports.MINUTES_IN_AN_HOUR = exports.getSessionLengthColumnKind = exports.SessionLengthKind = exports.SESSION_LENGTH_SETTING_COLUMNS = exports.SESSION_LENGTH_COLUMNS = exports.SEPARATE_SSO_SESSION_LENGTHS_COLUMN = exports.SSO_SESSION_IDLE_TIMEOUT_COLUMN = exports.SSO_SESSION_LENGTH_COLUMN = exports.SESSION_IDLE_TIMEOUT_COLUMN = exports.SESSION_LENGTH_COLUMN = void 0;
49
+ exports.LONGEST_INACTIVITY_FIELD = exports.getActivityAtRenewal = exports.readReportedInactivityInSeconds = exports.MAX_REPORTED_INACTIVITY_IN_SECONDS = exports.getSessionEndReachedBy = exports.getSessionEnd = exports.INACTIVE_FOR_IN_SECONDS_FIELD = exports.readSessionEndReason = exports.SESSION_ENDED_QUERY_PARAM = exports.isSessionEndReason = exports.SessionEndReason = exports.doesShortenAnySession = exports.getIdleTimeoutInMinutes = exports.getSessionLengthRule = exports.hasSessionLimits = exports.isSessionLengthRuleSet = exports.sanitizeSessionLengths = exports.readSessionLengths = exports.toSessionLengths = exports.readSessionLengthSettings = exports.NO_SESSION_LENGTH_SETTINGS = exports.NO_SESSION_LENGTHS = exports.NO_SESSION_LENGTH_RULE = exports.readSessionLengthValue = exports.getSessionLengthSettingProblem = exports.getSeparateSsoSessionLengthsProblem = exports.getSessionLengthProblem = exports.getSessionLengthRange = exports.SEPARATE_SSO_SESSION_LENGTHS_PROBLEM = exports.SESSION_IDLE_TIMEOUT_PROBLEM = exports.SESSION_LENGTH_PROBLEM = exports.SESSION_IDLE_TIMEOUT_CHOICES_IN_MINUTES = exports.SESSION_LENGTH_CHOICES_IN_MINUTES = exports.MAX_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.DEFAULT_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.DEFAULT_SESSION_IDLE_DAYS = exports.MAX_SESSION_LENGTH_IN_MINUTES = exports.MIN_SESSION_IDLE_TIMEOUT_IN_MINUTES = exports.MIN_SESSION_LENGTH_IN_MINUTES = exports.MINUTES_IN_A_DAY = exports.MINUTES_IN_AN_HOUR = exports.getSessionLengthColumnKind = exports.SessionLengthKind = exports.SESSION_LENGTH_SETTING_COLUMNS = exports.SESSION_LENGTH_COLUMNS = exports.SEPARATE_SSO_SESSION_LENGTHS_COLUMN = exports.SSO_SESSION_IDLE_TIMEOUT_COLUMN = exports.SSO_SESSION_LENGTH_COLUMN = exports.SESSION_IDLE_TIMEOUT_COLUMN = exports.SESSION_LENGTH_COLUMN = void 0;
50
+ exports.decideSessionRenewal = exports.getUnknownInactivity = exports.NO_RENEWAL_REPORT = exports.readReportedLongestInactivity = void 0;
46
51
  exports.SESSION_LENGTH_COLUMN = "sessionLengthInMinutes";
47
52
  exports.SESSION_IDLE_TIMEOUT_COLUMN = "sessionIdleTimeoutInMinutes";
48
53
  exports.SSO_SESSION_LENGTH_COLUMN = "ssoSessionLengthInMinutes";
@@ -411,3 +416,127 @@ const getActivityAtRenewal = (data) => {
411
416
  return new Date(Math.min(data.now.getTime(), Math.max(data.storedLastActiveAt.getTime(), reportedMs)));
412
417
  };
413
418
  exports.getActivityAtRenewal = getActivityAtRenewal;
419
+ /*
420
+ * THE LONGEST TIME WITHOUT USE SINCE THE LAST RENEWAL (issue #6789).
421
+ *
422
+ * How long the person has not used OneUptime now (inactiveForInSeconds) is
423
+ * not enough on its own. Someone who closes the browser, or whose computer
424
+ * sleeps, and opens OneUptime again hours later clicks before the session
425
+ * is renewed - opening the page is a click's worth of activity - so that
426
+ * renewal says they were active a moment ago. A tab left in the background
427
+ * that nobody brought back does the same the moment they do. So the
428
+ * Dashboard and the Admin Dashboard say, too, the longest time that ended
429
+ * since the session was last renewed during which nobody used OneUptime in
430
+ * any tab of the browser (Common/UI/Utils/UserActivity): how long it
431
+ * lasted, and how long ago it ended, in whole seconds - durations, never
432
+ * the browser's clock. The server ends the session when it reached the
433
+ * idle timeout, counting it only from what the session knew of its
434
+ * person's activity already: activity the server heard of cuts it short.
435
+ */
436
+ exports.LONGEST_INACTIVITY_FIELD = "longestInactivity";
437
+ /*
438
+ * The time without use a renewal reports (LONGEST_INACTIVITY_FIELD), or
439
+ * null when it reports none it can read: an object whose two durations are
440
+ * each read as inactiveForInSeconds is (readReportedInactivityInSeconds) -
441
+ * a whole, non-negative number of seconds, no more than
442
+ * MAX_REPORTED_INACTIVITY_IN_SECONDS. Anything else is no report, and
443
+ * never a reason to end a session.
444
+ */
445
+ const readReportedLongestInactivity = (value) => {
446
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
447
+ return null;
448
+ }
449
+ const report = value;
450
+ const forSeconds = (0, exports.readReportedInactivityInSeconds)(report["forSeconds"]);
451
+ const endedSecondsAgo = (0, exports.readReportedInactivityInSeconds)(report["endedSecondsAgo"]);
452
+ if (forSeconds === null || endedSecondsAgo === null) {
453
+ return null;
454
+ }
455
+ return { forSeconds, endedSecondsAgo };
456
+ };
457
+ exports.readReportedLongestInactivity = readReportedLongestInactivity;
458
+ exports.NO_RENEWAL_REPORT = {
459
+ inactiveForInSeconds: null,
460
+ longestInactivity: null,
461
+ };
462
+ /*
463
+ * The part of a reported time without use that the session did not know of
464
+ * already, in milliseconds since 1970, or null when there is none: it ends
465
+ * where the browser says, and starts where the browser says or at the
466
+ * session's last activity, whichever is later. Activity the server heard of
467
+ * - a renewal in another tab, the sign-in itself - is never counted as
468
+ * time without use, so a browser that kept an older time (a previous
469
+ * sign-in's, say) can end no session with it.
470
+ */
471
+ const getUnknownInactivity = (data) => {
472
+ if (!data.longestInactivity) {
473
+ return null;
474
+ }
475
+ const toMs = data.now.getTime() - data.longestInactivity.endedSecondsAgo * 1000;
476
+ const fromMs = Math.max(toMs - data.longestInactivity.forSeconds * 1000, data.storedLastActiveAt.getTime());
477
+ if (toMs <= fromMs) {
478
+ return null;
479
+ }
480
+ return { fromMs, toMs };
481
+ };
482
+ exports.getUnknownInactivity = getUnknownInactivity;
483
+ /*
484
+ * Whether a renewal at `now` may go ahead under the lengths (null: none
485
+ * set), and when its person was last active - the one place a renewal of
486
+ * a session decides (UserSessionService.decideRenewal):
487
+ *
488
+ * - its kind's session length counts from its sign-in, however active
489
+ * its person is;
490
+ * - its kind's idle timeout counts from its person's last activity. While
491
+ * one is set, what the browser reports counts: how long its person has
492
+ * not used OneUptime now (never further back than what the session
493
+ * knew, never after now - getActivityAtRenewal), and the longest time
494
+ * they went without since the last renewal, which ends the session
495
+ * when the part the session did not know of reached the idle timeout
496
+ * (getUnknownInactivity). Without a report of how long it has been, the
497
+ * session's own last activity decides, and the renewal is the activity
498
+ * - as every renewal has always been. Without an idle timeout set,
499
+ * nothing the browser says is asked.
500
+ *
501
+ * A session that ended says why: whichever of the two came first, the
502
+ * length where both fall at the same moment (getSessionEnd).
503
+ */
504
+ const decideSessionRenewal = (data) => {
505
+ const rule = (0, exports.getSessionLengthRule)(data.lengths, data.facts.isSsoSignIn);
506
+ const isReportAsked = rule.idleTimeoutInMinutes !== null;
507
+ const report = isReportAsked ? data.report : exports.NO_RENEWAL_REPORT;
508
+ const lastActiveAt = (0, exports.getActivityAtRenewal)({
509
+ storedLastActiveAt: data.facts.lastActiveAt,
510
+ reportedInactivityInSeconds: report.inactiveForInSeconds,
511
+ now: data.now,
512
+ });
513
+ // Without a report of how long it has been, inactivity is what the session knew of it.
514
+ let idleFrom = report.inactiveForInSeconds === null
515
+ ? data.facts.lastActiveAt
516
+ : lastActiveAt;
517
+ // An earlier time without use that already reached the idle timeout ended the session then.
518
+ const unknownInactivity = (0, exports.getUnknownInactivity)({
519
+ storedLastActiveAt: data.facts.lastActiveAt,
520
+ longestInactivity: report.longestInactivity,
521
+ now: data.now,
522
+ });
523
+ if (unknownInactivity &&
524
+ unknownInactivity.toMs - unknownInactivity.fromMs >=
525
+ (0, exports.getIdleTimeoutInMinutes)(rule) * MS_IN_A_MINUTE &&
526
+ unknownInactivity.fromMs < idleFrom.getTime()) {
527
+ idleFrom = new Date(unknownInactivity.fromMs);
528
+ }
529
+ const end = (0, exports.getSessionEnd)(Object.assign(Object.assign({}, data.facts), { lastActiveAt: idleFrom }), data.lengths);
530
+ if (end.endsAt.getTime() <= data.now.getTime()) {
531
+ return {
532
+ hasEnded: true,
533
+ reason: end.reason,
534
+ // Activity the browser saw after the session ended is not the session's.
535
+ lastActiveAt: idleFrom.getTime() <= end.endsAt.getTime()
536
+ ? idleFrom
537
+ : data.facts.lastActiveAt,
538
+ };
539
+ }
540
+ return { hasEnded: false, lastActiveAt: lastActiveAt };
541
+ };
542
+ exports.decideSessionRenewal = decideSessionRenewal;
@@ -2,6 +2,7 @@ import commonJsModule from "./SessionLength.js";
2
2
  export const DEFAULT_SESSION_IDLE_DAYS = commonJsModule.DEFAULT_SESSION_IDLE_DAYS;
3
3
  export const DEFAULT_SESSION_IDLE_TIMEOUT_IN_MINUTES = commonJsModule.DEFAULT_SESSION_IDLE_TIMEOUT_IN_MINUTES;
4
4
  export const INACTIVE_FOR_IN_SECONDS_FIELD = commonJsModule.INACTIVE_FOR_IN_SECONDS_FIELD;
5
+ export const LONGEST_INACTIVITY_FIELD = commonJsModule.LONGEST_INACTIVITY_FIELD;
5
6
  export const MAX_REPORTED_INACTIVITY_IN_SECONDS = commonJsModule.MAX_REPORTED_INACTIVITY_IN_SECONDS;
6
7
  export const MAX_SESSION_IDLE_TIMEOUT_IN_MINUTES = commonJsModule.MAX_SESSION_IDLE_TIMEOUT_IN_MINUTES;
7
8
  export const MAX_SESSION_LENGTH_IN_MINUTES = commonJsModule.MAX_SESSION_LENGTH_IN_MINUTES;
@@ -9,6 +10,7 @@ export const MINUTES_IN_AN_HOUR = commonJsModule.MINUTES_IN_AN_HOUR;
9
10
  export const MINUTES_IN_A_DAY = commonJsModule.MINUTES_IN_A_DAY;
10
11
  export const MIN_SESSION_IDLE_TIMEOUT_IN_MINUTES = commonJsModule.MIN_SESSION_IDLE_TIMEOUT_IN_MINUTES;
11
12
  export const MIN_SESSION_LENGTH_IN_MINUTES = commonJsModule.MIN_SESSION_LENGTH_IN_MINUTES;
13
+ export const NO_RENEWAL_REPORT = commonJsModule.NO_RENEWAL_REPORT;
12
14
  export const NO_SESSION_LENGTHS = commonJsModule.NO_SESSION_LENGTHS;
13
15
  export const NO_SESSION_LENGTH_RULE = commonJsModule.NO_SESSION_LENGTH_RULE;
14
16
  export const NO_SESSION_LENGTH_SETTINGS = commonJsModule.NO_SESSION_LENGTH_SETTINGS;
@@ -27,6 +29,7 @@ export const SSO_SESSION_IDLE_TIMEOUT_COLUMN = commonJsModule.SSO_SESSION_IDLE_T
27
29
  export const SSO_SESSION_LENGTH_COLUMN = commonJsModule.SSO_SESSION_LENGTH_COLUMN;
28
30
  export const SessionEndReason = commonJsModule.SessionEndReason;
29
31
  export const SessionLengthKind = commonJsModule.SessionLengthKind;
32
+ export const decideSessionRenewal = commonJsModule.decideSessionRenewal;
30
33
  export const doesShortenAnySession = commonJsModule.doesShortenAnySession;
31
34
  export const getActivityAtRenewal = commonJsModule.getActivityAtRenewal;
32
35
  export const getIdleTimeoutInMinutes = commonJsModule.getIdleTimeoutInMinutes;
@@ -38,10 +41,12 @@ export const getSessionLengthProblem = commonJsModule.getSessionLengthProblem;
38
41
  export const getSessionLengthRange = commonJsModule.getSessionLengthRange;
39
42
  export const getSessionLengthRule = commonJsModule.getSessionLengthRule;
40
43
  export const getSessionLengthSettingProblem = commonJsModule.getSessionLengthSettingProblem;
44
+ export const getUnknownInactivity = commonJsModule.getUnknownInactivity;
41
45
  export const hasSessionLimits = commonJsModule.hasSessionLimits;
42
46
  export const isSessionEndReason = commonJsModule.isSessionEndReason;
43
47
  export const isSessionLengthRuleSet = commonJsModule.isSessionLengthRuleSet;
44
48
  export const readReportedInactivityInSeconds = commonJsModule.readReportedInactivityInSeconds;
49
+ export const readReportedLongestInactivity = commonJsModule.readReportedLongestInactivity;
45
50
  export const readSessionEndReason = commonJsModule.readSessionEndReason;
46
51
  export const readSessionLengthSettings = commonJsModule.readSessionLengthSettings;
47
52
  export const readSessionLengthValue = commonJsModule.readSessionLengthValue;
@@ -11,23 +11,34 @@ var WorkflowStatus;
11
11
  WorkflowStatus["Timeout"] = "Timeout";
12
12
  WorkflowStatus["WorkflowCountExceeded"] = "Workflow Count Exceeded";
13
13
  })(WorkflowStatus || (WorkflowStatus = {}));
14
+ /*
15
+ * Marks an English text as a key of the Dashboard's locales - the same
16
+ * marker as Common/UI/Utils/TranslateTemplate's translationKey, kept here
17
+ * so this file stays free of the UI. It returns the text unchanged.
18
+ */
19
+ const translationKey = (text) => {
20
+ return text;
21
+ };
14
22
  /*
15
23
  * A run's status in the words the dashboard shows it in. Two of them read
16
24
  * differently from their stored value: a run that worked is "Executed", and a
17
25
  * run the plan did not allow is "Execution Exceeded Current Plan". The status
18
- * pill and a downloaded run both read from here, so a log someone downloads
19
- * says what the list they downloaded it from said.
26
+ * pill, the runs' Status filter and a downloaded run all read from here, so a
27
+ * log someone downloads says what the list they downloaded it from said. Each
28
+ * is a key of the Dashboard's locales (its extractor reads this file as a
29
+ * "keys" root): the pill and the filter look it up in the reader's language,
30
+ * while a downloaded run keeps the English.
20
31
  */
21
32
  const WORKFLOW_STATUS_LABELS = {
22
- [WorkflowStatus.Scheduled]: "Scheduled",
23
- [WorkflowStatus.Running]: "Running",
24
- [WorkflowStatus.Waiting]: "Waiting",
25
- [WorkflowStatus.Success]: "Executed",
26
- [WorkflowStatus.Error]: "Error",
27
- [WorkflowStatus.Timeout]: "Timeout",
28
- [WorkflowStatus.WorkflowCountExceeded]: "Execution Exceeded Current Plan",
33
+ [WorkflowStatus.Scheduled]: translationKey("Scheduled"),
34
+ [WorkflowStatus.Running]: translationKey("Running"),
35
+ [WorkflowStatus.Waiting]: translationKey("Waiting"),
36
+ [WorkflowStatus.Success]: translationKey("Executed"),
37
+ [WorkflowStatus.Error]: translationKey("Error"),
38
+ [WorkflowStatus.Timeout]: translationKey("Timeout"),
39
+ [WorkflowStatus.WorkflowCountExceeded]: translationKey("Execution Exceeded Current Plan"),
29
40
  };
30
- exports.UNKNOWN_WORKFLOW_STATUS_LABEL = "Unknown";
41
+ exports.UNKNOWN_WORKFLOW_STATUS_LABEL = translationKey("Unknown");
31
42
  const getWorkflowStatusLabel = (status) => {
32
43
  if (!status) {
33
44
  return exports.UNKNOWN_WORKFLOW_STATUS_LABEL;
@@ -48,8 +48,8 @@ exports.AI_SECURITY_CASE_TRIAGE_HEADING_TEXT = "AI — Security Case Triage";
48
48
  * How the runner's own first line of a follow-up check's report starts: the
49
49
  * report OneUptime AI writes when it checks an incident again after an alert
50
50
  * opened on its linked infrastructure ("**Checked again** after alert #12
51
- * (High CPU on web-1) opened on Host web-1, 2 minutes after this incident was
52
- * declared." - IncidentFollowUpCheck.buildReportLead). The server puts it
51
+ * opened on host web-1, 2 minutes after this incident was declared: High CPU
52
+ * on web-1." - IncidentFollowUpCheck.buildReportLead). The server puts it
53
53
  * right under the brand heading, before the model's analysis.
54
54
  */
55
55
  exports.FOLLOW_UP_REPORT_LEAD_PREFIX = "**Checked again**";
package/Utils/API.d.mts CHANGED
@@ -11,7 +11,6 @@ import URL from "../Types/API/URL.mjs";
11
11
  import Dictionary from "../Types/Dictionary.mjs";
12
12
  import APIException from "../Types/Exception/ApiException.mjs";
13
13
  import { JSONArray, JSONObject } from "../Types/JSON.mjs";
14
- import RequestFailedDetails from "../Types/Probe/RequestFailedDetails.mjs";
15
14
  import { AxiosError, AxiosProgressEvent } from "axios";
16
15
  import { HTTPResponseBodyBudget } from "./HTTPResponseBodyReader.mjs";
17
16
  import type { Agent as HttpAgent } from "http";
@@ -147,14 +146,4 @@ export default class API {
147
146
  private static getRetryAfterInMs;
148
147
  private static getErrorResponse;
149
148
  static getFriendlyErrorMessage(error: AxiosError | Error | HTTPErrorResponse): string;
150
- /**
151
- * Extracts detailed error information from an axios error or generic error.
152
- * This provides more context about where and why a request failed.
153
- */
154
- static getRequestFailedDetails(error: AxiosError | Error | unknown): RequestFailedDetails;
155
- static getProbeNetworkFailureDescription(error: unknown): string | null;
156
- private static getProbeSideRequestFailure;
157
- private static getProbeSideFailureDetails;
158
- private static getRequestHost;
159
- private static collectConnectAddresses;
160
149
  }
package/Utils/API.d.ts CHANGED
@@ -11,7 +11,6 @@ import URL from "../Types/API/URL";
11
11
  import Dictionary from "../Types/Dictionary";
12
12
  import APIException from "../Types/Exception/ApiException";
13
13
  import { JSONArray, JSONObject } from "../Types/JSON";
14
- import RequestFailedDetails from "../Types/Probe/RequestFailedDetails";
15
14
  import { AxiosError, AxiosProgressEvent } from "axios";
16
15
  import { HTTPResponseBodyBudget } from "./HTTPResponseBodyReader";
17
16
  import type { Agent as HttpAgent } from "http";
@@ -147,14 +146,4 @@ export default class API {
147
146
  private static getRetryAfterInMs;
148
147
  private static getErrorResponse;
149
148
  static getFriendlyErrorMessage(error: AxiosError | Error | HTTPErrorResponse): string;
150
- /**
151
- * Extracts detailed error information from an axios error or generic error.
152
- * This provides more context about where and why a request failed.
153
- */
154
- static getRequestFailedDetails(error: AxiosError | Error | unknown): RequestFailedDetails;
155
- static getProbeNetworkFailureDescription(error: unknown): string | null;
156
- private static getProbeSideRequestFailure;
157
- private static getProbeSideFailureDetails;
158
- private static getRequestHost;
159
- private static collectConnectAddresses;
160
149
  }