@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
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = exports.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = exports.VerifiedFixRunbookRefusal = void 0;
7
+ exports.getSucceededCommands = getSucceededCommands;
8
+ exports.getSucceededMcpCalls = getSucceededMcpCalls;
9
+ exports.getVerifiedFixRunbookRefusal = getVerifiedFixRunbookRefusal;
10
+ exports.toRunbookSteps = toRunbookSteps;
11
+ exports.buildVerifiedFixRunbook = buildVerifiedFixRunbook;
12
+ exports.getUniqueRunbookName = getUniqueRunbookName;
13
+ const AiRemediationCommandPlan_1 = require("../../Types/AutoRemediation/AiRemediationCommandPlan");
14
+ const AiRemediationCommandPolicyVerdict_1 = require("../../Types/AutoRemediation/AiRemediationCommandPolicyVerdict");
15
+ const AutoRemediationSuggestionType_1 = __importDefault(require("../../Types/AutoRemediation/AutoRemediationSuggestionType"));
16
+ const AutoRemediationVerificationStatus_1 = __importDefault(require("../../Types/AutoRemediation/AutoRemediationVerificationStatus"));
17
+ const ExternalMcpToolCallPlan_1 = require("../../Types/AutoRemediation/ExternalMcpToolCallPlan");
18
+ const ColumnLength_1 = __importDefault(require("../../Types/Database/ColumnLength"));
19
+ const ObjectID_1 = __importDefault(require("../../Types/ObjectID"));
20
+ const RunbookStepType_1 = __importDefault(require("../../Types/Runbook/RunbookStepType"));
21
+ /*
22
+ * A FIX THAT WORKED, WRITTEN DOWN AS A RUNBOOK (issue #6801).
23
+ *
24
+ * OneUptime AI could run a runbook but never write one. When it fixes an
25
+ * incident or an alert itself - commands on a Runner, a change through a
26
+ * cluster's or a resource's AI agent, calls to an MCP server - and the fix
27
+ * is verified (the monitors recovered, or the subject was resolved, within
28
+ * the verification window), what it ran is exactly the procedure the team
29
+ * would want written down. Save as Runbook writes it: a runbook of the
30
+ * steps that ran, in the order they ran, each with why OneUptime AI ran it
31
+ * and how to undo it.
32
+ *
33
+ * - A command on a Runner becomes a Bash step on that Runner, as written,
34
+ * with the same time limit. One the policy made a person approve waits
35
+ * for an approval before it runs in the runbook too.
36
+ * - A change through a cluster's Kubernetes AI agent, through a
37
+ * resource's AI agent (Docker, a host, a cloud account ...) or through
38
+ * an MCP server becomes a manual step that holds the exact command or
39
+ * call: a runbook's own steps cannot reach those agents, and would go
40
+ * around the command policy if they could (as the OpenStack runbook
41
+ * templates do, OpenStackRunbookTemplates). The step says to ask
42
+ * OneUptime AI for the change, or to make it by hand.
43
+ * - A command or call that did not run, or failed, is left out: the
44
+ * runbook is what worked.
45
+ *
46
+ * The runbook starts turned off: OneUptime AI never picks it, no rule runs
47
+ * it, and nobody can start it until a person has read its steps and turned
48
+ * it on (RunbookService, RunbookStarter). Pure: the server builds the
49
+ * runbook with it, and the tests pin it.
50
+ */
51
+ // Why a fix cannot be saved as a runbook.
52
+ var VerifiedFixRunbookRefusal;
53
+ (function (VerifiedFixRunbookRefusal) {
54
+ // The fix was not verified: only what worked is written down.
55
+ VerifiedFixRunbookRefusal["NotVerified"] = "NotVerified";
56
+ // The fix ran a runbook already.
57
+ VerifiedFixRunbookRefusal["RanARunbook"] = "RanARunbook";
58
+ // Nothing of the fix ran and succeeded.
59
+ VerifiedFixRunbookRefusal["NothingRan"] = "NothingRan";
60
+ // It was saved as a runbook already.
61
+ VerifiedFixRunbookRefusal["AlreadySaved"] = "AlreadySaved";
62
+ })(VerifiedFixRunbookRefusal || (exports.VerifiedFixRunbookRefusal = VerifiedFixRunbookRefusal = {}));
63
+ exports.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = {
64
+ [VerifiedFixRunbookRefusal.NotVerified]: "Only a fix that worked can be saved as a runbook, and this one has not been verified. Wait for its verification, or write the runbook yourself under Runbooks.",
65
+ [VerifiedFixRunbookRefusal.RanARunbook]: "This fix ran a runbook already, so there is nothing new to save. Open the runbook from the fix to change it.",
66
+ [VerifiedFixRunbookRefusal.NothingRan]: "None of this fix's commands ran and succeeded, so there is nothing to save as a runbook.",
67
+ [VerifiedFixRunbookRefusal.AlreadySaved]: "This fix is saved as a runbook already. Open that runbook from the fix.",
68
+ };
69
+ // The longest step title the runbook editor shows on one line.
70
+ exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = 120;
71
+ function cut(text, maxLength) {
72
+ const line = text.replace(/\s+/g, " ").trim();
73
+ return line.length > maxLength
74
+ ? `${line.slice(0, maxLength - 1).trimEnd()}…`
75
+ : line;
76
+ }
77
+ // The commands of the fix that ran and succeeded, in the order they ran.
78
+ function getSucceededCommands(plan) {
79
+ return ((plan === null || plan === void 0 ? void 0 : plan.commands) || [])
80
+ .filter((command) => {
81
+ var _a;
82
+ return (!(0, AiRemediationCommandPlan_1.isRemovedSshCommand)(command) &&
83
+ ((_a = command.execution) === null || _a === void 0 ? void 0 : _a.status) ===
84
+ AiRemediationCommandPlan_1.AiRemediationCommandExecutionStatus.Succeeded);
85
+ })
86
+ .sort((a, b) => {
87
+ return a.sequence - b.sequence;
88
+ });
89
+ }
90
+ // The MCP calls of the fix that were made and succeeded, in the order they were made.
91
+ function getSucceededMcpCalls(plan) {
92
+ return ((plan === null || plan === void 0 ? void 0 : plan.calls) || [])
93
+ .filter((call) => {
94
+ return call.status === ExternalMcpToolCallPlan_1.ExternalMcpToolCallStatus.Succeeded;
95
+ })
96
+ .sort((a, b) => {
97
+ return a.sequence - b.sequence;
98
+ });
99
+ }
100
+ // Why a fix cannot be saved as a runbook, or null when it can.
101
+ function getVerifiedFixRunbookRefusal(input) {
102
+ if (input.suggestionType === AutoRemediationSuggestionType_1.default.Runbook) {
103
+ return VerifiedFixRunbookRefusal.RanARunbook;
104
+ }
105
+ if (input.savedAsRunbookId) {
106
+ return VerifiedFixRunbookRefusal.AlreadySaved;
107
+ }
108
+ if (input.verificationStatus !== AutoRemediationVerificationStatus_1.default.Verified) {
109
+ return VerifiedFixRunbookRefusal.NotVerified;
110
+ }
111
+ const ranSomething = input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
112
+ ? getSucceededMcpCalls(input.mcpToolCallPlan).length > 0
113
+ : getSucceededCommands(input.commandPlan).length > 0;
114
+ return ranSomething ? null : VerifiedFixRunbookRefusal.NothingRan;
115
+ }
116
+ // "incident #42", or "the incident" when it has no handle.
117
+ function nameSubject(subject) {
118
+ return subject.handle.trim()
119
+ ? `${subject.kind} ${subject.handle.trim()}`
120
+ : `the ${subject.kind}`;
121
+ }
122
+ // What a step says under its title: why it ran, what it did, how to undo it.
123
+ function describeCommand(command, lead) {
124
+ var _a;
125
+ return [
126
+ lead,
127
+ command.rationale.trim() ? `Why: ${command.rationale.trim()}` : null,
128
+ command.expectedEffect.trim()
129
+ ? `What it does: ${command.expectedEffect.trim()}`
130
+ : null,
131
+ ((_a = command.rollbackCommand) === null || _a === void 0 ? void 0 : _a.trim())
132
+ ? `To undo it: ${command.rollbackCommand.trim()}`
133
+ : null,
134
+ ]
135
+ .filter((line) => {
136
+ return Boolean(line);
137
+ })
138
+ .join("\n\n");
139
+ }
140
+ // Where a change through an AI agent ran: "the prod cluster", "web-01".
141
+ function getAgentTarget(command) {
142
+ if (command.stepType === RunbookStepType_1.default.Kubectl) {
143
+ const cluster = (command.kubernetesClusterNameSnapshot || "").trim();
144
+ return cluster ? `the ${cluster} cluster` : "the cluster";
145
+ }
146
+ const resource = (command.resourceNameSnapshot || "").trim();
147
+ const agent = (command.runnerNameSnapshot || "").trim();
148
+ if (resource && agent) {
149
+ return `${resource} (${agent})`;
150
+ }
151
+ return resource || agent || "the resource";
152
+ }
153
+ function toRunbookSteps(input) {
154
+ const steps = [];
155
+ const add = (step) => {
156
+ steps.push(Object.assign({ id: ObjectID_1.default.generate().toString(), order: steps.length + 1 }, step));
157
+ };
158
+ for (const command of input.commands) {
159
+ if (command.stepType === RunbookStepType_1.default.Bash) {
160
+ add({
161
+ type: RunbookStepType_1.default.Bash,
162
+ title: cut(command.command, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
163
+ description: describeCommand(command, null),
164
+ requireApprovalBeforeRunning: command.policyVerdict ===
165
+ AiRemediationCommandPolicyVerdict_1.AiRemediationCommandPolicyVerdict.RequiresApproval,
166
+ config: {
167
+ script: command.command,
168
+ agentId: command.runnerId,
169
+ timeoutInMs: command.timeoutInMs,
170
+ },
171
+ });
172
+ continue;
173
+ }
174
+ const target = getAgentTarget(command);
175
+ add({
176
+ type: RunbookStepType_1.default.Manual,
177
+ title: cut(`On ${target}: ${command.command}`, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
178
+ description: describeCommand(command, `Run this on ${target}: ${command.command}\n\nOneUptime AI made this change through the AI agent there. Ask OneUptime AI to make it again, or make it yourself, then mark this step done.`),
179
+ config: {},
180
+ });
181
+ }
182
+ for (const call of input.mcpCalls) {
183
+ const server = call.serverNameSnapshot.trim() || "the MCP server";
184
+ add({
185
+ type: RunbookStepType_1.default.Manual,
186
+ title: cut(`${call.toolName} on ${server}`, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
187
+ description: `Call the tool ${call.toolName} on ${server} with these arguments:\n\n${JSON.stringify(call.arguments, null, 2)}\n\nOneUptime AI made this change through the MCP server. Ask OneUptime AI to make it again, or make it yourself, then mark this step done.`,
188
+ config: {},
189
+ });
190
+ }
191
+ return steps;
192
+ }
193
+ /*
194
+ * The runbook a verified fix is written down as: named for what it fixed,
195
+ * said where it comes from, its steps what ran. Its name may be taken in
196
+ * the project already - the server makes it unique (getUniqueRunbookName).
197
+ */
198
+ function buildVerifiedFixRunbook(input) {
199
+ const steps = toRunbookSteps({
200
+ commands: input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
201
+ ? []
202
+ : getSucceededCommands(input.commandPlan),
203
+ mcpCalls: input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
204
+ ? getSucceededMcpCalls(input.mcpToolCallPlan)
205
+ : [],
206
+ });
207
+ const subjectTitle = input.subject.title.trim();
208
+ const name = cut(subjectTitle ? `Fix: ${subjectTitle}` : "Verified fix", ColumnLength_1.default.ShortText);
209
+ const description = cut(`Written from the fix OneUptime AI ran for ${nameSubject(input.subject)}${subjectTitle ? ` (${subjectTitle})` : ""}, which was verified when it recovered. Turned off until someone reviews each step and turns it on.`, ColumnLength_1.default.LongText);
210
+ return { name, description, steps };
211
+ }
212
+ /*
213
+ * A name no runbook of the project has yet: the name itself, or with " (2)",
214
+ * " (3)" ... after it, cut so the whole stays within a runbook's name.
215
+ */
216
+ function getUniqueRunbookName(name, takenNames) {
217
+ const taken = new Set(takenNames.map((taken) => {
218
+ return taken.trim().toLowerCase();
219
+ }));
220
+ if (!taken.has(name.trim().toLowerCase())) {
221
+ return name;
222
+ }
223
+ for (let number = 2; number < 1000; number++) {
224
+ const suffix = ` (${number.toString()})`;
225
+ const candidate = `${cut(name, ColumnLength_1.default.ShortText - suffix.length)}${suffix}`;
226
+ if (!taken.has(candidate.toLowerCase())) {
227
+ return candidate;
228
+ }
229
+ }
230
+ return `${cut(name, ColumnLength_1.default.ShortText - 37)} ${ObjectID_1.default.generate().toString()}`;
231
+ }
@@ -0,0 +1,10 @@
1
+ import commonJsModule from "./VerifiedFixRunbook.js";
2
+ export const MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = commonJsModule.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH;
3
+ export const VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = commonJsModule.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES;
4
+ export const VerifiedFixRunbookRefusal = commonJsModule.VerifiedFixRunbookRefusal;
5
+ export const buildVerifiedFixRunbook = commonJsModule.buildVerifiedFixRunbook;
6
+ export const getSucceededCommands = commonJsModule.getSucceededCommands;
7
+ export const getSucceededMcpCalls = commonJsModule.getSucceededMcpCalls;
8
+ export const getUniqueRunbookName = commonJsModule.getUniqueRunbookName;
9
+ export const getVerifiedFixRunbookRefusal = commonJsModule.getVerifiedFixRunbookRefusal;
10
+ export const toRunbookSteps = commonJsModule.toRunbookSteps;
@@ -661,7 +661,12 @@ const DASHBOARD_WIDGET_SORT_SPECS = {
661
661
  title: "Used / Provisioned",
662
662
  path: "usedBytes",
663
663
  }),
664
- textColumn({ key: "array", title: "Array", path: "storageArray.name" }),
664
+ // The storage array's own key, as the header's (#7522, MeaningKeys).
665
+ textColumn({
666
+ key: "array",
667
+ title: "Array (storage array)",
668
+ path: "storageArray.name",
669
+ }),
665
670
  ],
666
671
  defaultSort: NAME_ASCENDING,
667
672
  thenBy: BY_NAME,
@@ -679,7 +684,11 @@ const DASHBOARD_WIDGET_SORT_SPECS = {
679
684
  path: ["kind", "componentType"],
680
685
  }),
681
686
  storageHardwareStatusColumn(),
682
- textColumn({ key: "array", title: "Array", path: "storageArray.name" }),
687
+ textColumn({
688
+ key: "array",
689
+ title: "Array (storage array)",
690
+ path: "storageArray.name",
691
+ }),
683
692
  ],
684
693
  defaultSort: NAME_ASCENDING,
685
694
  thenBy: BY_NAME,
@@ -1,4 +1,5 @@
1
1
  import Color from "../../Types/Color.mjs";
2
+ import ObjectID from "../../Types/ObjectID.mjs";
2
3
  import { MonitoringOffFlags } from "../Monitor/MonitoringOff.mjs";
3
4
  export declare const MONITOR_LIST_STATUS_FILTER_OPERATIONAL: string;
4
5
  export declare const MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL: string;
@@ -10,7 +11,7 @@ export interface MonitorListFilter {
10
11
  statusFilter?: string | undefined | null;
11
12
  monitorStatusIds?: Array<string> | undefined | null;
12
13
  }
13
- export type GetMonitorListQueryFunction = (filter: MonitorListFilter) => Record<string, unknown>;
14
+ export type GetMonitorListQueryFunction = (filter: MonitorListFilter, projectId?: ObjectID | string | null | undefined) => Record<string, unknown>;
14
15
  export declare const getMonitorListQuery: GetMonitorListQueryFunction;
15
16
  export interface MonitorListRowData extends MonitoringOffFlags {
16
17
  currentMonitorStatus?: {
@@ -1,4 +1,5 @@
1
1
  import Color from "../../Types/Color";
2
+ import ObjectID from "../../Types/ObjectID";
2
3
  import { MonitoringOffFlags } from "../Monitor/MonitoringOff";
3
4
  export declare const MONITOR_LIST_STATUS_FILTER_OPERATIONAL: string;
4
5
  export declare const MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL: string;
@@ -10,7 +11,7 @@ export interface MonitorListFilter {
10
11
  statusFilter?: string | undefined | null;
11
12
  monitorStatusIds?: Array<string> | undefined | null;
12
13
  }
13
- export type GetMonitorListQueryFunction = (filter: MonitorListFilter) => Record<string, unknown>;
14
+ export type GetMonitorListQueryFunction = (filter: MonitorListFilter, projectId?: ObjectID | string | null | undefined) => Record<string, unknown>;
14
15
  export declare const getMonitorListQuery: GetMonitorListQueryFunction;
15
16
  export interface MonitorListRowData extends MonitoringOffFlags {
16
17
  currentMonitorStatus?: {
@@ -16,7 +16,9 @@ const NotOperationalMonitorQuery_1 = __importDefault(require("../Monitor/NotOper
16
16
  * The widget in the browser and the public-dashboard policy on the server
17
17
  * (Server/Utils/Dashboard/PublicDashboardResourceListPolicy) both build their
18
18
  * query from getMonitorListQuery, so a board and its public page cannot list
19
- * different monitors. React-free and server-safe.
19
+ * different monitors. The board passes its project as well, which names the
20
+ * same monitors and reads them differently (getMonitorListQuery). React-free
21
+ * and server-safe.
20
22
  *
21
23
  * A monitor whose monitoring is turned off is not checked, so its status is
22
24
  * frozen at what its last check saw (Utils/Monitor/MonitoringOff). The list
@@ -38,10 +40,10 @@ exports.MONITOR_LIST_MONITORING_OFF_STATUS_LABEL = (0, Translator_1.translationK
38
40
  exports.MONITOR_LIST_MONITORING_OFF_STATUS_COLOR = BrandColors_1.Gray500;
39
41
  // The same word the row has always drawn for a monitor read with no status.
40
42
  exports.MONITOR_LIST_NO_STATUS_LABEL = "Unknown";
41
- const getMonitorListQuery = (filter) => {
43
+ const getMonitorListQuery = (filter, projectId) => {
42
44
  const query = { isArchived: false };
43
45
  if (filter.statusFilter === exports.MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL) {
44
- Object.assign(query, NotOperationalMonitorQuery_1.default.getQuery());
46
+ Object.assign(query, NotOperationalMonitorQuery_1.default.getQuery(projectId));
45
47
  }
46
48
  else if (filter.statusFilter === exports.MONITOR_LIST_STATUS_FILTER_OPERATIONAL) {
47
49
  Object.assign(query, MonitoringOff_1.default.getMonitoredQuery(), {
@@ -1,3 +1,4 @@
1
+ import Timezone from "../../Types/Timezone.mjs";
1
2
  export interface ValueWidgetPoint {
2
3
  timestamp: Date;
3
4
  value: number;
@@ -38,6 +39,7 @@ export declare const VALUE_WIDGET_MAX_FILLED_POINTS: number;
38
39
  export interface FillValueWidgetSeriesGapsData {
39
40
  series: Array<ValueWidgetPoint>;
40
41
  bucketWidthMs: number;
42
+ timezone?: Timezone | undefined;
41
43
  }
42
44
  export declare const fillValueWidgetSeriesGaps: (data: FillValueWidgetSeriesGapsData) => Array<ValueWidgetPoint>;
43
45
  export declare const getValueWidgetTrend: (data: GetValueWidgetTrendData) => ValueWidgetTrend | null;
@@ -1,3 +1,4 @@
1
+ import Timezone from "../../Types/Timezone";
1
2
  export interface ValueWidgetPoint {
2
3
  timestamp: Date;
3
4
  value: number;
@@ -38,6 +39,7 @@ export declare const VALUE_WIDGET_MAX_FILLED_POINTS: number;
38
39
  export interface FillValueWidgetSeriesGapsData {
39
40
  series: Array<ValueWidgetPoint>;
40
41
  bucketWidthMs: number;
42
+ timezone?: Timezone | undefined;
41
43
  }
42
44
  export declare const fillValueWidgetSeriesGaps: (data: FillValueWidgetSeriesGapsData) => Array<ValueWidgetPoint>;
43
45
  export declare const getValueWidgetTrend: (data: GetValueWidgetTrendData) => ValueWidgetTrend | null;
@@ -22,8 +22,12 @@
22
22
  * Plain TypeScript with no React, so the arithmetic is unit-testable and the
23
23
  * metric and Data Source hosts share one definition.
24
24
  */
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.getValueWidgetTrend = exports.fillValueWidgetSeriesGaps = exports.VALUE_WIDGET_MAX_FILLED_POINTS = exports.getValueWidgetBucketWidthMs = exports.getValueWidgetSeries = exports.getValueWidgetPointTime = exports.getMeanOfValues = exports.VALUE_WIDGET_FLAT_TREND_PERCENT = exports.ValueWidgetTrendDirection = void 0;
30
+ const Date_1 = __importDefault(require("../../Types/Date"));
27
31
  var ValueWidgetTrendDirection;
28
32
  (function (ValueWidgetTrendDirection) {
29
33
  ValueWidgetTrendDirection["Up"] = "Up";
@@ -156,6 +160,34 @@ const isUsableDate = (date) => {
156
160
  * as it came.
157
161
  */
158
162
  exports.VALUE_WIDGET_MAX_FILLED_POINTS = 2000;
163
+ const DAY_MS = 24 * 60 * 60 * 1000;
164
+ /*
165
+ * The start of the bucket after the one that starts at `startMs`, when a
166
+ * bucket is `days` of `timezone`'s calendar days: the start of the zone's
167
+ * day that many days on. Half a day past that many 24-hour days is inside
168
+ * that day whatever the clocks did in between (they move by two hours at
169
+ * most), and the day's start is where the server starts its bucket - its
170
+ * midnight, or the first instant after it on a day whose midnight the
171
+ * clocks skip.
172
+ */
173
+ const getNextCalendarBucketStartMs = (startMs, days, timezone) => {
174
+ return Date_1.default.getStartOfDay(new Date(startMs + days * DAY_MS + DAY_MS / 2), timezone).getTime();
175
+ };
176
+ /*
177
+ * The slots of buckets of whole calendar days in a zone, `days` of its days
178
+ * apart: from the first reading's, up to the first at or after the last
179
+ * reading. Null when that is more than VALUE_WIDGET_MAX_FILLED_POINTS.
180
+ */
181
+ const getCalendarBucketSlots = (data) => {
182
+ const slots = [data.firstMs];
183
+ while (slots[slots.length - 1] < data.lastMs) {
184
+ if (slots.length >= exports.VALUE_WIDGET_MAX_FILLED_POINTS) {
185
+ return null;
186
+ }
187
+ slots.push(getNextCalendarBucketStartMs(slots[slots.length - 1], data.days, data.timezone));
188
+ }
189
+ return slots;
190
+ };
159
191
  /*
160
192
  * A sum's or a count's series with the empty buckets between its readings
161
193
  * drawn as 0.
@@ -180,6 +212,11 @@ exports.VALUE_WIDGET_MAX_FILLED_POINTS = 2000;
180
212
  * month or year is not a fixed width, and a widget bucketed some other
181
213
  * way must not get zeros between its real points);
182
214
  * - the readings span more buckets than VALUE_WIDGET_MAX_FILLED_POINTS.
215
+ *
216
+ * Days and weeks in the reader's zone (`timezone`) are a grid of its
217
+ * calendar days, not of fixed widths: across a change of its clocks one
218
+ * day is 23 or 25 hours long, and a fixed step would put every later
219
+ * reading off the grid and fill nothing.
183
220
  */
184
221
  const fillValueWidgetSeriesGaps = (data) => {
185
222
  var _a;
@@ -191,6 +228,44 @@ const fillValueWidgetSeriesGaps = (data) => {
191
228
  const firstMs = series[0].timestamp.getTime();
192
229
  const lastMs = series[series.length - 1].timestamp.getTime();
193
230
  const valuesByTime = new Map();
231
+ /*
232
+ * Whole days in a zone, from a reading at the start of one of its days:
233
+ * the zone's calendar is the grid. Readings that are not on it - on
234
+ * UTC's midnights, say - are measured against the fixed width below.
235
+ */
236
+ if (data.timezone &&
237
+ widthMs % DAY_MS === 0 &&
238
+ Date_1.default.getStartOfDay(new Date(firstMs), data.timezone).getTime() ===
239
+ firstMs) {
240
+ const slots = getCalendarBucketSlots({
241
+ firstMs: firstMs,
242
+ lastMs: lastMs,
243
+ days: widthMs / DAY_MS,
244
+ timezone: data.timezone,
245
+ });
246
+ if (!slots) {
247
+ return series;
248
+ }
249
+ const onTheGrid = new Set(slots);
250
+ for (const point of series) {
251
+ const timeMs = point.timestamp.getTime();
252
+ if (!onTheGrid.has(timeMs)) {
253
+ return series;
254
+ }
255
+ valuesByTime.set(timeMs, point.value);
256
+ }
257
+ if (slots.length === series.length) {
258
+ // No bucket between the readings is empty.
259
+ return series;
260
+ }
261
+ return slots.map((slotMs) => {
262
+ var _a;
263
+ return {
264
+ timestamp: new Date(slotMs),
265
+ value: (_a = valuesByTime.get(slotMs)) !== null && _a !== void 0 ? _a : 0,
266
+ };
267
+ });
268
+ }
194
269
  for (const point of series) {
195
270
  const timeMs = point.timestamp.getTime();
196
271
  if ((timeMs - firstMs) % widthMs !== 0) {
@@ -0,0 +1,6 @@
1
+ import { TemplateValue, TermOptions, Translator } from "../Types/Translator.mjs";
2
+ export declare const getDefaultRecordNames: (tableName: string | null | undefined) => ReadonlyArray<string>;
3
+ export declare const isDefaultRecordName: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
4
+ export declare const isRecordNameAsWritten: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
5
+ export declare const translateRecordName: (translator: Translator, tableName: string | null | undefined, name: string | null | undefined) => string;
6
+ export declare const recordNameInSentence: (tableName: string | null | undefined, name: string | null | undefined, options?: TermOptions) => TemplateValue;
@@ -0,0 +1,6 @@
1
+ import { TemplateValue, TermOptions, Translator } from "../Types/Translator";
2
+ export declare const getDefaultRecordNames: (tableName: string | null | undefined) => ReadonlyArray<string>;
3
+ export declare const isDefaultRecordName: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
4
+ export declare const isRecordNameAsWritten: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
5
+ export declare const translateRecordName: (translator: Translator, tableName: string | null | undefined, name: string | null | undefined) => string;
6
+ export declare const recordNameInSentence: (tableName: string | null | undefined, name: string | null | undefined, options?: TermOptions) => TemplateValue;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recordNameInSentence = exports.translateRecordName = exports.isRecordNameAsWritten = exports.isDefaultRecordName = exports.getDefaultRecordNames = void 0;
4
+ const DefaultStatusNames_1 = require("../Types/StatusPage/DefaultStatusNames");
5
+ const Translator_1 = require("../Types/Translator");
6
+ const StateListType_1 = require("./StateListType");
7
+ /*
8
+ * A RECORD'S NAME, AS ITS READER READS IT - ONE RULE, WHEREVER IT IS DRAWN.
9
+ *
10
+ * A record's name is its owner's: a label, a monitor, a probe, a template,
11
+ * a state or a severity a project made. It is drawn as written in every
12
+ * language - a label named "Network" is "Network" on a Spanish page, never
13
+ * "Red" - in a badge (Pill, StatusBubble), in a picker's options and in a
14
+ * filter's menu and chip (DropdownOption.isUserContent), as a line of text
15
+ * (translateRecordName) and in a sentence (recordNameInSentence).
16
+ *
17
+ * The records a new project starts with that OneUptime names itself
18
+ * (ProjectService) are the exception: its states, severities, monitor
19
+ * statuses, postmortem statuses and security case priorities and statuses,
20
+ * the lists a project orders (StateListType, whose values are the tables'
21
+ * names). Their default names are OneUptime's words, read in the reader's
22
+ * language - "Resolved" is "Resuelto" - for as long as a record keeps one.
23
+ * A name the project gave a record of its own, or gave a default one in its
24
+ * place, is the project's and reads as written: a state named "Open" stays
25
+ * "Open", never the verb "Abrir", and a severity renamed "Critical" stays
26
+ * "Critical", never "Kritisch".
27
+ *
28
+ * A name is a default by its record's table and by the whole name, as
29
+ * written: an alert severity named "High" is OneUptime's word, a monitor
30
+ * status named "High" the project's, and "Critical incident" is a severity
31
+ * the project renamed. Nothing a record carries says whether OneUptime or
32
+ * the project made it (a severity has no built-in flag, both get the same
33
+ * kind of slug, and a badge is handed a name and a colour), so a project's
34
+ * own record named exactly as a default of its list reads as that default
35
+ * does - the same word the status page and the notifications use for it.
36
+ * A status page (StatusPage/src/Utils/StatusTranslation), an on-call page
37
+ * (OnCallDutyPolicy/OnCallPageWords) and a status page's notifications
38
+ * (Server/Utils/StatusPage/SubscriberMessageText) decide by this rule too,
39
+ * each handed its record's list (#8066).
40
+ */
41
+ /*
42
+ * Every list a project orders has the names it starts with. Only names:
43
+ * every form loads this, so it loads none of the lists' own modules
44
+ * (StateOrder, PostmortemStatus, SecurityCaseStatuses and _Priorities).
45
+ */
46
+ const DEFAULT_NAMES_BY_TABLE = {
47
+ [StateListType_1.StateListType.IncidentState]: DefaultStatusNames_1.DEFAULT_INCIDENT_STATE_NAMES,
48
+ [StateListType_1.StateListType.AlertState]: DefaultStatusNames_1.DEFAULT_ALERT_STATE_NAMES,
49
+ [StateListType_1.StateListType.ScheduledMaintenanceState]: DefaultStatusNames_1.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES,
50
+ [StateListType_1.StateListType.MonitorStatus]: DefaultStatusNames_1.DEFAULT_MONITOR_STATUS_NAMES,
51
+ [StateListType_1.StateListType.IncidentSeverity]: DefaultStatusNames_1.DEFAULT_INCIDENT_SEVERITY_NAMES,
52
+ [StateListType_1.StateListType.AlertSeverity]: DefaultStatusNames_1.DEFAULT_ALERT_SEVERITY_NAMES,
53
+ [StateListType_1.StateListType.IncidentPostmortemStatus]: DefaultStatusNames_1.DEFAULT_POSTMORTEM_STATUS_NAMES,
54
+ [StateListType_1.StateListType.SecurityCaseStatus]: DefaultStatusNames_1.DEFAULT_SECURITY_CASE_STATUS_NAMES,
55
+ [StateListType_1.StateListType.SecurityCasePriority]: DefaultStatusNames_1.DEFAULT_SECURITY_CASE_PRIORITY_NAMES,
56
+ };
57
+ /*
58
+ * The names OneUptime gives the records of a table: a StateListType, or a
59
+ * record's own tableName. None for any other table - a label's, a
60
+ * monitor's, a team's - whose names are all their owners'.
61
+ */
62
+ const getDefaultRecordNames = (tableName) => {
63
+ if (!tableName ||
64
+ !Object.prototype.hasOwnProperty.call(DEFAULT_NAMES_BY_TABLE, tableName)) {
65
+ return [];
66
+ }
67
+ return DEFAULT_NAMES_BY_TABLE[tableName];
68
+ };
69
+ exports.getDefaultRecordNames = getDefaultRecordNames;
70
+ // Whether `name` is one of OneUptime's default names for its table's records.
71
+ const isDefaultRecordName = (tableName, name) => {
72
+ return (typeof name === "string" &&
73
+ (0, exports.getDefaultRecordNames)(tableName).includes(name.trim()));
74
+ };
75
+ exports.isDefaultRecordName = isDefaultRecordName;
76
+ /*
77
+ * Whether a record's name is drawn as written, never looked up: a Pill's
78
+ * or a StatusBubble's isUserContent, a DropdownOption's. True for a name its
79
+ * owner gave; false for one of OneUptime's default names, and for no name
80
+ * at all - a badge's "Unknown" in its place is the product's word.
81
+ */
82
+ const isRecordNameAsWritten = (tableName, name) => {
83
+ return (typeof name === "string" &&
84
+ name.trim().length > 0 &&
85
+ !(0, exports.isDefaultRecordName)(tableName, name));
86
+ };
87
+ exports.isRecordNameAsWritten = isRecordNameAsWritten;
88
+ /*
89
+ * A record's name in `translator`'s reader's words, for where it is drawn
90
+ * as text: a default name in their language, any other name as written.
91
+ */
92
+ const translateRecordName = (translator, tableName, name) => {
93
+ if (!name) {
94
+ return "";
95
+ }
96
+ if (!(0, exports.isDefaultRecordName)(tableName, name)) {
97
+ return name;
98
+ }
99
+ return translator.translateText(name.trim()) || name;
100
+ };
101
+ exports.translateRecordName = translateRecordName;
102
+ /*
103
+ * A record's name as a value of a sentence - "{{stateName}} in", "Mark as
104
+ * {{state}}", "Incident · {{severity}}" - by the same rule. One of
105
+ * OneUptime's default names of its table goes in as a term, translated
106
+ * with the sentence and only then (Types/Translator): a sentence the
107
+ * reader's language words reads "Marcar como Resuelto", one it does not
108
+ * yet reads "Mark as Resolved" whole, and `inSentence` cases the name for
109
+ * the middle of one ("Not yet resolved"). Any other name goes in as
110
+ * written, never looked up: a state a project named "Open" reads "Marcar
111
+ * como Open", never the verb "Abrir", in any language and in any case.
112
+ */
113
+ const recordNameInSentence = (tableName, name, options) => {
114
+ if (!name) {
115
+ return "";
116
+ }
117
+ if (!(0, exports.isDefaultRecordName)(tableName, name)) {
118
+ return name;
119
+ }
120
+ return (0, Translator_1.translatableTerm)(name.trim(), options);
121
+ };
122
+ exports.recordNameInSentence = recordNameInSentence;
@@ -0,0 +1,6 @@
1
+ import commonJsModule from "./DefaultRecordNames.js";
2
+ export const getDefaultRecordNames = commonJsModule.getDefaultRecordNames;
3
+ export const isDefaultRecordName = commonJsModule.isDefaultRecordName;
4
+ export const isRecordNameAsWritten = commonJsModule.isRecordNameAsWritten;
5
+ export const recordNameInSentence = commonJsModule.recordNameInSentence;
6
+ export const translateRecordName = commonJsModule.translateRecordName;
@@ -1191,7 +1191,7 @@ function getApiTasks(data) {
1191
1191
  };
1192
1192
  });
1193
1193
  }
1194
- // "an incident", "a scheduled maintenance event": for step titles.
1194
+ // "an incident", "a maintenance event": for step titles.
1195
1195
  function getCreateTitle(data) {
1196
1196
  const profile = (0, ResourceProfiles_1.getDeveloperDocsProfile)(data.modelType);
1197
1197
  return (profile.createTitle ||
@@ -477,7 +477,7 @@ exports.DEVELOPER_DOCS_PROFILES = {
477
477
  },
478
478
  {
479
479
  title: "Internal note",
480
- description: "A note only your team sees.",
480
+ description: "A private note: only the people who can see the incident can read it.",
481
481
  scopes: ["view"],
482
482
  modelType: IncidentInternalNote_1.default,
483
483
  operation: "create",
@@ -631,7 +631,7 @@ exports.DEVELOPER_DOCS_PROFILES = {
631
631
  },
632
632
  {
633
633
  title: "Internal note",
634
- description: "A note only your team sees.",
634
+ description: "A private note: only the people who can see the alert can read it.",
635
635
  scopes: ["view"],
636
636
  modelType: AlertInternalNote_1.default,
637
637
  operation: "create",