@oneuptime/common 14.0.94 → 14.0.96

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 (289) hide show
  1. package/Models/AnalyticsModels/ExceptionInstance.d.mts +2 -0
  2. package/Models/AnalyticsModels/ExceptionInstance.d.ts +2 -0
  3. package/Models/AnalyticsModels/ExceptionInstance.js +7 -0
  4. package/Models/AnalyticsModels/Log.d.mts +2 -0
  5. package/Models/AnalyticsModels/Log.d.ts +2 -0
  6. package/Models/AnalyticsModels/Log.js +7 -0
  7. package/Models/AnalyticsModels/SecurityEvent.d.mts +8 -0
  8. package/Models/AnalyticsModels/SecurityEvent.d.ts +8 -0
  9. package/Models/AnalyticsModels/SecurityEvent.js +55 -0
  10. package/Models/AnalyticsModels/Span.d.mts +4 -0
  11. package/Models/AnalyticsModels/Span.d.ts +4 -0
  12. package/Models/AnalyticsModels/Span.js +63 -0
  13. package/Models/DatabaseModels/CustomNotificationChannel.d.mts +16 -0
  14. package/Models/DatabaseModels/CustomNotificationChannel.d.ts +16 -0
  15. package/Models/DatabaseModels/CustomNotificationChannel.js +337 -0
  16. package/Models/DatabaseModels/CustomNotificationChannel.mjs +2 -0
  17. package/Models/DatabaseModels/DashboardPlaylist.d.mts +16 -0
  18. package/Models/DatabaseModels/DashboardPlaylist.d.ts +16 -0
  19. package/Models/DatabaseModels/DashboardPlaylist.js +314 -0
  20. package/Models/DatabaseModels/DashboardPlaylist.mjs +2 -0
  21. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
  22. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.mts +1 -0
  23. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.ts +1 -0
  24. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.js +27 -3
  25. package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
  26. package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
  27. package/Models/DatabaseModels/DetectionRuleException.js +412 -0
  28. package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
  29. package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
  30. package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
  31. package/Models/DatabaseModels/GlobalConfig.js +107 -0
  32. package/Models/DatabaseModels/Index.js +8 -0
  33. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +2 -0
  34. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +2 -0
  35. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +40 -0
  36. package/Models/DatabaseModels/SecurityTelemetrySource.d.mts +21 -0
  37. package/Models/DatabaseModels/SecurityTelemetrySource.d.ts +21 -0
  38. package/Models/DatabaseModels/SecurityTelemetrySource.js +357 -0
  39. package/Models/DatabaseModels/SecurityTelemetrySource.mjs +2 -0
  40. package/Models/DatabaseModels/TeamComplianceSetting.js +2 -2
  41. package/Models/DatabaseModels/TeamPermission.js +5 -7
  42. package/Models/DatabaseModels/UserNotificationRule.d.mts +3 -0
  43. package/Models/DatabaseModels/UserNotificationRule.d.ts +3 -0
  44. package/Models/DatabaseModels/UserNotificationRule.js +67 -0
  45. package/Models/DatabaseModels/UserNotificationSetting.d.mts +1 -0
  46. package/Models/DatabaseModels/UserNotificationSetting.d.ts +1 -0
  47. package/Models/DatabaseModels/UserNotificationSetting.js +26 -0
  48. package/Models/DatabaseModels/UserOnCallLogTimeline.d.mts +3 -0
  49. package/Models/DatabaseModels/UserOnCallLogTimeline.d.ts +3 -0
  50. package/Models/DatabaseModels/UserOnCallLogTimeline.js +53 -0
  51. package/Types/AI/AIChatPermissionMode.js +11 -5
  52. package/Types/AI/ResourceCardFacts.d.mts +11 -0
  53. package/Types/AI/ResourceCardFacts.d.ts +11 -0
  54. package/Types/AI/ResourceCardFacts.js +80 -0
  55. package/Types/AI/ResourceCardFacts.mjs +4 -0
  56. package/Types/AnalyticsDatabase/TableColumn.d.mts +4 -0
  57. package/Types/AnalyticsDatabase/TableColumn.d.ts +4 -0
  58. package/Types/AnalyticsDatabase/TableColumn.js +7 -0
  59. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.mts +2 -0
  60. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.ts +2 -0
  61. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.js +4 -0
  62. package/Types/Backup/BackupDestinationCatalog.d.mts +2 -0
  63. package/Types/Backup/BackupDestinationCatalog.d.ts +2 -0
  64. package/Types/Backup/BackupDestinationCatalog.js +8 -0
  65. package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.mts +25 -0
  66. package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.ts +25 -0
  67. package/Types/CallAndSMS/CallAndSmsGatewayPayload.js +86 -0
  68. package/Types/CallAndSMS/CallAndSmsGatewayPayload.mjs +6 -0
  69. package/Types/CallAndSMS/CallAndSmsProvider.d.mts +23 -0
  70. package/Types/CallAndSMS/CallAndSmsProvider.d.ts +23 -0
  71. package/Types/CallAndSMS/CallAndSmsProvider.js +107 -0
  72. package/Types/CallAndSMS/CallAndSmsProvider.mjs +7 -0
  73. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +2 -0
  74. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +2 -0
  75. package/Types/CloudConnection/CloudConnectionCatalog.js +4 -0
  76. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.mts +95 -0
  77. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.ts +95 -0
  78. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.js +236 -0
  79. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.mjs +16 -0
  80. package/Types/Dashboard/DashboardPlaylist.d.mts +21 -0
  81. package/Types/Dashboard/DashboardPlaylist.d.ts +21 -0
  82. package/Types/Dashboard/DashboardPlaylist.js +197 -0
  83. package/Types/Dashboard/DashboardPlaylist.mjs +19 -0
  84. package/Types/Database/TableColumn.d.mts +8 -0
  85. package/Types/Database/TableColumn.d.ts +8 -0
  86. package/Types/Database/TableColumn.js +69 -23
  87. package/Types/Database/TableColumn.mjs +1 -0
  88. package/Types/HeldPermissions.d.mts +2 -0
  89. package/Types/HeldPermissions.d.ts +2 -0
  90. package/Types/HeldPermissions.js +32 -8
  91. package/Types/Icon/IconProp.d.mts +3 -0
  92. package/Types/Icon/IconProp.d.ts +3 -0
  93. package/Types/Icon/IconProp.js +4 -0
  94. package/Types/JSONFunctions.js +16 -1
  95. package/Types/LlmObservability/LlmConnectionCatalog.d.mts +2 -0
  96. package/Types/LlmObservability/LlmConnectionCatalog.d.ts +2 -0
  97. package/Types/LlmObservability/LlmConnectionCatalog.js +8 -0
  98. package/Types/Monitor/MonitorType.js +5 -4
  99. package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
  100. package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
  101. package/Types/Monitor/TelemetryAlertRule.js +886 -0
  102. package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
  103. package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
  104. package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
  105. package/Types/Monitor/TelemetryRulePreview.js +190 -0
  106. package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
  107. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
  108. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
  109. package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
  110. package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
  111. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.mts +3 -0
  112. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.ts +3 -0
  113. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.js +23 -8
  114. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.mjs +2 -0
  115. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.mts +47 -0
  116. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.ts +47 -0
  117. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.js +122 -0
  118. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.mjs +12 -0
  119. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.mts +2 -1
  120. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.ts +2 -1
  121. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.js +10 -1
  122. package/Types/Permission.d.mts +10 -0
  123. package/Types/Permission.d.ts +10 -0
  124. package/Types/Permission.js +83 -19
  125. package/Types/ProviderLogo/ProviderLogo.d.mts +87 -0
  126. package/Types/ProviderLogo/ProviderLogo.d.ts +87 -0
  127. package/Types/ProviderLogo/ProviderLogo.js +215 -0
  128. package/Types/ProviderLogo/ProviderLogo.mjs +6 -0
  129. package/Types/PushNotification/PushNotificationsTurnedOff.d.mts +3 -0
  130. package/Types/PushNotification/PushNotificationsTurnedOff.d.ts +3 -0
  131. package/Types/PushNotification/PushNotificationsTurnedOff.js +32 -0
  132. package/Types/PushNotification/PushNotificationsTurnedOff.mjs +4 -0
  133. package/Types/RollingTime/RollingTimeUtil.js +20 -10
  134. package/Types/Runbook/RunbookTriggerType.d.mts +2 -1
  135. package/Types/Runbook/RunbookTriggerType.d.ts +2 -1
  136. package/Types/Runbook/RunbookTriggerType.js +5 -1
  137. package/Types/SecurityCase/SecurityCaseContext.d.mts +188 -0
  138. package/Types/SecurityCase/SecurityCaseContext.d.ts +188 -0
  139. package/Types/SecurityCase/SecurityCaseContext.js +165 -0
  140. package/Types/SecurityCase/SecurityCaseContext.mjs +30 -0
  141. package/Types/SecurityCase/SecurityEntityRisk.d.mts +11 -0
  142. package/Types/SecurityCase/SecurityEntityRisk.d.ts +11 -0
  143. package/Types/SecurityCase/SecurityEntityRisk.js +9 -1
  144. package/Types/SecurityCase/SecurityEntityRisk.mjs +1 -0
  145. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.mts +2 -0
  146. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.ts +2 -0
  147. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +9 -0
  148. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.mts +2 -0
  149. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.ts +2 -0
  150. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.js +5 -0
  151. package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
  152. package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
  153. package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
  154. package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
  155. package/Types/SecurityEvent/DetectionRuleDataKind.d.mts +5 -1
  156. package/Types/SecurityEvent/DetectionRuleDataKind.d.ts +5 -1
  157. package/Types/SecurityEvent/DetectionRuleDataKind.js +42 -0
  158. package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
  159. package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
  160. package/Types/SecurityEvent/DetectionRuleException.js +441 -0
  161. package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
  162. package/Types/SecurityEvent/DetectionRuleLibrary.js +330 -0
  163. package/Types/SecurityEvent/NormalizedSecurityEvent.d.mts +5 -0
  164. package/Types/SecurityEvent/NormalizedSecurityEvent.d.ts +5 -0
  165. package/Types/SecurityEvent/SecurityAttackCampaign.d.mts +31 -0
  166. package/Types/SecurityEvent/SecurityAttackCampaign.d.ts +31 -0
  167. package/Types/SecurityEvent/SecurityAttackCampaign.js +81 -0
  168. package/Types/SecurityEvent/SecurityAttackCampaign.mjs +8 -0
  169. package/Types/SecurityEvent/SecurityEventRequestOutcome.d.mts +28 -0
  170. package/Types/SecurityEvent/SecurityEventRequestOutcome.d.ts +28 -0
  171. package/Types/SecurityEvent/SecurityEventRequestOutcome.js +78 -0
  172. package/Types/SecurityEvent/SecurityEventRequestOutcome.mjs +6 -0
  173. package/Types/SecurityEvent/SecurityTelemetrySource.d.mts +39 -0
  174. package/Types/SecurityEvent/SecurityTelemetrySource.d.ts +39 -0
  175. package/Types/SecurityEvent/SecurityTelemetrySource.js +127 -0
  176. package/Types/SecurityEvent/SecurityTelemetrySource.mjs +12 -0
  177. package/Types/SecurityEvent/TurnOnRecommended.d.mts +2 -0
  178. package/Types/SecurityEvent/TurnOnRecommended.d.ts +2 -0
  179. package/Types/SecurityEvent/TurnOnRecommended.js +7 -0
  180. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +7 -1
  181. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +7 -1
  182. package/Types/SecurityPlaybook/SecurityPlaybookAction.js +46 -0
  183. package/Types/SecurityPlaybook/SecurityPlaybookAction.mjs +1 -0
  184. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +10 -0
  185. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +10 -0
  186. package/Types/SecurityPlaybook/SecurityPlaybookStep.js +37 -1
  187. package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +1 -0
  188. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.js +17 -0
  189. package/Types/Team/ComplianceNotificationChannel.d.mts +2 -1
  190. package/Types/Team/ComplianceNotificationChannel.d.ts +2 -1
  191. package/Types/Team/ComplianceNotificationChannel.js +10 -1
  192. package/Types/Team/ComplianceRule.d.mts +8 -3
  193. package/Types/Team/ComplianceRule.d.ts +8 -3
  194. package/Types/Team/ComplianceRule.js +34 -22
  195. package/Types/Team/TeamComplianceStatus.d.mts +1 -0
  196. package/Types/Team/TeamComplianceStatus.d.ts +1 -0
  197. package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
  198. package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
  199. package/Types/Telemetry/OpenTelemetryGuides.js +419 -0
  200. package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
  201. package/Types/Telemetry/TelemetrySavedViewState.d.mts +1 -0
  202. package/Types/Telemetry/TelemetrySavedViewState.d.ts +1 -0
  203. package/Types/Telemetry/TraceHealth.d.mts +24 -0
  204. package/Types/Telemetry/TraceHealth.d.ts +24 -0
  205. package/Types/Telemetry/TraceHealth.js +97 -0
  206. package/Types/Telemetry/TraceHealth.mjs +4 -0
  207. package/Types/Telemetry/TraceSpanType.d.mts +90 -0
  208. package/Types/Telemetry/TraceSpanType.d.ts +90 -0
  209. package/Types/Telemetry/TraceSpanType.js +238 -0
  210. package/Types/Telemetry/TraceSpanType.mjs +19 -0
  211. package/Types/Theme/ThemePreference.d.mts +26 -0
  212. package/Types/Theme/ThemePreference.d.ts +26 -0
  213. package/Types/Theme/ThemePreference.js +104 -0
  214. package/Types/Theme/ThemePreference.mjs +12 -0
  215. package/Types/Workflow/Component.d.mts +3 -0
  216. package/Types/Workflow/Component.d.ts +3 -0
  217. package/Types/Workflow/Components/Discord.js +2 -0
  218. package/Types/Workflow/Components/Mattermost.js +2 -0
  219. package/Types/Workflow/Components/MicrosoftTeams.js +2 -0
  220. package/Types/Workflow/Components/Slack.js +2 -0
  221. package/Types/Workflow/Components/Telegram.js +2 -0
  222. package/Types/Workflow/Components.js +6 -0
  223. package/Types/Workflow/Templates.js +5 -3
  224. package/Utils/ColorContrast.d.mts +0 -3
  225. package/Utils/ColorContrast.d.ts +0 -3
  226. package/Utils/ColorContrast.js +3 -41
  227. package/Utils/ColorContrast.mjs +0 -2
  228. package/Utils/NameInitials.d.mts +5 -0
  229. package/Utils/NameInitials.d.ts +5 -0
  230. package/Utils/NameInitials.js +92 -0
  231. package/Utils/NameInitials.mjs +6 -0
  232. package/Utils/OldestKeyCursor.d.mts +7 -0
  233. package/Utils/OldestKeyCursor.d.ts +7 -0
  234. package/Utils/OldestKeyCursor.js +68 -0
  235. package/Utils/OldestKeyCursor.mjs +2 -0
  236. package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
  237. package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
  238. package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
  239. package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
  240. package/Utils/Schema/Zod.js +6 -0
  241. package/Utils/SecurityCase/SecurityCaseImpactFacts.d.mts +41 -0
  242. package/Utils/SecurityCase/SecurityCaseImpactFacts.d.ts +41 -0
  243. package/Utils/SecurityCase/SecurityCaseImpactFacts.js +215 -0
  244. package/Utils/SecurityCase/SecurityCaseImpactFacts.mjs +6 -0
  245. package/Utils/SecurityCase/SecurityCaseStoryItems.d.mts +46 -0
  246. package/Utils/SecurityCase/SecurityCaseStoryItems.d.ts +46 -0
  247. package/Utils/SecurityCase/SecurityCaseStoryItems.js +327 -0
  248. package/Utils/SecurityCase/SecurityCaseStoryItems.mjs +17 -0
  249. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.mts +5 -0
  250. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.ts +5 -0
  251. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.js +22 -2
  252. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.mjs +2 -0
  253. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.mts +20 -0
  254. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.ts +20 -0
  255. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.js +347 -31
  256. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.mjs +11 -0
  257. package/Utils/SecurityEvent/RequestFollowUp.d.mts +4 -0
  258. package/Utils/SecurityEvent/RequestFollowUp.d.ts +4 -0
  259. package/Utils/SecurityEvent/RequestFollowUp.js +127 -0
  260. package/Utils/SecurityEvent/RequestFollowUp.mjs +3 -0
  261. package/Utils/SecurityEvent/RequestOutcome.d.mts +80 -0
  262. package/Utils/SecurityEvent/RequestOutcome.d.ts +80 -0
  263. package/Utils/SecurityEvent/RequestOutcome.js +371 -0
  264. package/Utils/SecurityEvent/RequestOutcome.mjs +18 -0
  265. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.mts +76 -0
  266. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.ts +76 -0
  267. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.js +348 -0
  268. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.mjs +15 -0
  269. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.mts +61 -0
  270. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.ts +61 -0
  271. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.js +260 -0
  272. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.mjs +17 -0
  273. package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.mts +30 -0
  274. package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.ts +30 -0
  275. package/Utils/SecurityEvent/TelemetryScan/RumSignals.js +134 -0
  276. package/Utils/SecurityEvent/TelemetryScan/RumSignals.mjs +8 -0
  277. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.mts +40 -0
  278. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.ts +40 -0
  279. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.js +190 -0
  280. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.mjs +6 -0
  281. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.mts +57 -0
  282. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.ts +57 -0
  283. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.js +491 -0
  284. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.mjs +27 -0
  285. package/Utils/Telemetry/EntrySpan.d.mts +8 -0
  286. package/Utils/Telemetry/EntrySpan.d.ts +8 -0
  287. package/Utils/Telemetry/EntrySpan.js +53 -0
  288. package/Utils/Telemetry/EntrySpan.mjs +4 -0
  289. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ import commonJsModule from "./TelemetryAlertRule.js";
2
+ export default commonJsModule.default;
3
+ export const TelemetryAlertRuleAction = commonJsModule.TelemetryAlertRuleAction;
4
+ export const TelemetryAlertRuleRecovery = commonJsModule.TelemetryAlertRuleRecovery;
5
+ export const TelemetryAlertRuleShapeProblem = commonJsModule.TelemetryAlertRuleShapeProblem;
@@ -0,0 +1,57 @@
1
+ import { FilterType } from "./CriteriaFilter.mjs";
2
+ export declare const PREVIEW_WINDOW_COUNT: number;
3
+ export declare const MAX_PREVIEW_RANGE_IN_SECONDS: number;
4
+ export declare const MIN_PREVIEW_WINDOW_IN_SECONDS: number;
5
+ export declare const MAX_PREVIEW_WINDOW_IN_SECONDS: number;
6
+ export interface TelemetryRulePreviewRange {
7
+ startTime: Date;
8
+ endTime: Date;
9
+ windowInSeconds: number;
10
+ }
11
+ export interface TelemetryRulePreviewBucket {
12
+ time: string;
13
+ value: number;
14
+ }
15
+ export interface TelemetryRulePreviewAnswer {
16
+ buckets: Array<TelemetryRulePreviewBucket>;
17
+ windowInSeconds: number;
18
+ startTime: string;
19
+ endTime: string;
20
+ }
21
+ export interface TelemetryRulePreviewPoint {
22
+ time: Date;
23
+ value: number;
24
+ }
25
+ export interface TelemetryRulePreviewSummary {
26
+ hasData: boolean;
27
+ windowCount: number;
28
+ matchedWindowCount: number;
29
+ timesItWouldHaveFired: number;
30
+ highest: number;
31
+ lowest: number;
32
+ typical: number;
33
+ latest: number | undefined;
34
+ }
35
+ export default class TelemetryRulePreviewUtil {
36
+ static getRange(data: {
37
+ windowInSeconds: number;
38
+ now: Date;
39
+ }): TelemetryRulePreviewRange;
40
+ static clampWindow(windowInSeconds: number): number;
41
+ static toPoints(answer: TelemetryRulePreviewAnswer): Array<TelemetryRulePreviewPoint>;
42
+ static summarize(data: {
43
+ points: Array<TelemetryRulePreviewPoint>;
44
+ filterType: FilterType | undefined;
45
+ threshold: number | undefined;
46
+ }): TelemetryRulePreviewSummary;
47
+ static isMatched(data: {
48
+ filterType: FilterType | undefined;
49
+ threshold: number | undefined;
50
+ value: number;
51
+ }): boolean;
52
+ static suggestThreshold(data: {
53
+ points: Array<TelemetryRulePreviewPoint>;
54
+ filterType: FilterType | undefined;
55
+ }): number | undefined;
56
+ static roundUp(value: number): number;
57
+ }
@@ -0,0 +1,57 @@
1
+ import { FilterType } from "./CriteriaFilter";
2
+ export declare const PREVIEW_WINDOW_COUNT: number;
3
+ export declare const MAX_PREVIEW_RANGE_IN_SECONDS: number;
4
+ export declare const MIN_PREVIEW_WINDOW_IN_SECONDS: number;
5
+ export declare const MAX_PREVIEW_WINDOW_IN_SECONDS: number;
6
+ export interface TelemetryRulePreviewRange {
7
+ startTime: Date;
8
+ endTime: Date;
9
+ windowInSeconds: number;
10
+ }
11
+ export interface TelemetryRulePreviewBucket {
12
+ time: string;
13
+ value: number;
14
+ }
15
+ export interface TelemetryRulePreviewAnswer {
16
+ buckets: Array<TelemetryRulePreviewBucket>;
17
+ windowInSeconds: number;
18
+ startTime: string;
19
+ endTime: string;
20
+ }
21
+ export interface TelemetryRulePreviewPoint {
22
+ time: Date;
23
+ value: number;
24
+ }
25
+ export interface TelemetryRulePreviewSummary {
26
+ hasData: boolean;
27
+ windowCount: number;
28
+ matchedWindowCount: number;
29
+ timesItWouldHaveFired: number;
30
+ highest: number;
31
+ lowest: number;
32
+ typical: number;
33
+ latest: number | undefined;
34
+ }
35
+ export default class TelemetryRulePreviewUtil {
36
+ static getRange(data: {
37
+ windowInSeconds: number;
38
+ now: Date;
39
+ }): TelemetryRulePreviewRange;
40
+ static clampWindow(windowInSeconds: number): number;
41
+ static toPoints(answer: TelemetryRulePreviewAnswer): Array<TelemetryRulePreviewPoint>;
42
+ static summarize(data: {
43
+ points: Array<TelemetryRulePreviewPoint>;
44
+ filterType: FilterType | undefined;
45
+ threshold: number | undefined;
46
+ }): TelemetryRulePreviewSummary;
47
+ static isMatched(data: {
48
+ filterType: FilterType | undefined;
49
+ threshold: number | undefined;
50
+ value: number;
51
+ }): boolean;
52
+ static suggestThreshold(data: {
53
+ points: Array<TelemetryRulePreviewPoint>;
54
+ filterType: FilterType | undefined;
55
+ }): number | undefined;
56
+ static roundUp(value: number): number;
57
+ }
@@ -0,0 +1,190 @@
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_PREVIEW_WINDOW_IN_SECONDS = exports.MIN_PREVIEW_WINDOW_IN_SECONDS = exports.MAX_PREVIEW_RANGE_IN_SECONDS = exports.PREVIEW_WINDOW_COUNT = void 0;
7
+ const Date_1 = __importDefault(require("../Date"));
8
+ const CriteriaFilter_1 = require("./CriteriaFilter");
9
+ const TelemetryAlertRule_1 = __importDefault(require("./TelemetryAlertRule"));
10
+ /*
11
+ * What a telemetry rule would have caught: the count it compares, one
12
+ * window at a time, over the hours before now.
13
+ *
14
+ * A Logs, Traces or Exceptions monitor counts what matched in the last N
15
+ * seconds, every minute. The rule editor shows that count for every
16
+ * window of the same length back from now, beside the threshold, so the
17
+ * person setting the rule sees what is normal and when it would have fired
18
+ * before they save it. The server counts (one ClickHouse read with the
19
+ * monitor's own query, grouped by window); this module says which windows,
20
+ * and reads the answer.
21
+ *
22
+ * Bounded on purpose: at most PREVIEW_WINDOW_COUNT windows, so a one-minute
23
+ * rule reads 2.4 hours back, a five-minute rule 12 hours and a fifteen-minute
24
+ * rule 36 hours, and nothing reads more than MAX_PREVIEW_RANGE_IN_SECONDS.
25
+ * Windows are whole: they end on a multiple of their length before now, so
26
+ * the newest one is not a half-filled window that reads as a drop.
27
+ */
28
+ exports.PREVIEW_WINDOW_COUNT = 144;
29
+ exports.MAX_PREVIEW_RANGE_IN_SECONDS = 7 * 24 * 60 * 60;
30
+ exports.MIN_PREVIEW_WINDOW_IN_SECONDS = 5;
31
+ exports.MAX_PREVIEW_WINDOW_IN_SECONDS = 24 * 60 * 60;
32
+ class TelemetryRulePreviewUtil {
33
+ /*
34
+ * The windows to read for a rule whose window is `windowInSeconds`, back
35
+ * from `now`. The window is clamped to what the monitor forms offer.
36
+ */
37
+ static getRange(data) {
38
+ const windowInSeconds = TelemetryRulePreviewUtil.clampWindow(data.windowInSeconds);
39
+ const windowInMs = windowInSeconds * 1000;
40
+ const windowCount = Math.max(1, Math.min(exports.PREVIEW_WINDOW_COUNT, Math.floor(exports.MAX_PREVIEW_RANGE_IN_SECONDS / windowInSeconds)));
41
+ const endMs = Math.floor(data.now.getTime() / windowInMs) * windowInMs;
42
+ const startMs = endMs - windowCount * windowInMs;
43
+ return {
44
+ startTime: new Date(startMs),
45
+ endTime: new Date(endMs),
46
+ windowInSeconds,
47
+ };
48
+ }
49
+ static clampWindow(windowInSeconds) {
50
+ if (!Number.isFinite(windowInSeconds) || windowInSeconds <= 0) {
51
+ return 60;
52
+ }
53
+ return Math.min(exports.MAX_PREVIEW_WINDOW_IN_SECONDS, Math.max(exports.MIN_PREVIEW_WINDOW_IN_SECONDS, Math.round(windowInSeconds)));
54
+ }
55
+ /*
56
+ * Every window of the range, in order, with its count: a window the
57
+ * server did not answer for had nothing in it, so it is 0.
58
+ */
59
+ static toPoints(answer) {
60
+ const windowInMs = TelemetryRulePreviewUtil.clampWindow(answer.windowInSeconds) * 1000;
61
+ const startMs = Date_1.default.fromString(answer.startTime).getTime();
62
+ const endMs = Date_1.default.fromString(answer.endTime).getTime();
63
+ const counts = new Map();
64
+ for (const bucket of answer.buckets) {
65
+ const timeMs = Date_1.default.fromString(bucket.time).getTime();
66
+ if (!Number.isFinite(timeMs)) {
67
+ continue;
68
+ }
69
+ const alignedMs = Math.floor(timeMs / windowInMs) * windowInMs;
70
+ counts.set(alignedMs, (counts.get(alignedMs) || 0) + (bucket.value || 0));
71
+ }
72
+ const points = [];
73
+ for (let timeMs = startMs; timeMs < endMs && points.length < exports.PREVIEW_WINDOW_COUNT; timeMs += windowInMs) {
74
+ points.push({ time: new Date(timeMs), value: counts.get(timeMs) || 0 });
75
+ }
76
+ return points;
77
+ }
78
+ /*
79
+ * What the rule makes of those windows. An anomaly rule is judged against
80
+ * a baseline the preview does not read, so it matches none here.
81
+ */
82
+ static summarize(data) {
83
+ const firstWithData = data.points.findIndex((point) => {
84
+ return point.value > 0;
85
+ });
86
+ const values = firstWithData < 0
87
+ ? []
88
+ : data.points
89
+ .slice(firstWithData)
90
+ .map((point) => {
91
+ return point.value;
92
+ });
93
+ let matchedWindowCount = 0;
94
+ let timesItWouldHaveFired = 0;
95
+ let wasMatching = false;
96
+ for (const value of values) {
97
+ const isMatching = TelemetryRulePreviewUtil.isMatched({
98
+ filterType: data.filterType,
99
+ threshold: data.threshold,
100
+ value,
101
+ });
102
+ if (isMatching) {
103
+ matchedWindowCount++;
104
+ if (!wasMatching) {
105
+ timesItWouldHaveFired++;
106
+ }
107
+ }
108
+ wasMatching = isMatching;
109
+ }
110
+ const sorted = [...values].sort((a, b) => {
111
+ return a - b;
112
+ });
113
+ return {
114
+ hasData: values.length > 0,
115
+ windowCount: values.length,
116
+ matchedWindowCount,
117
+ timesItWouldHaveFired,
118
+ highest: sorted.length > 0 ? sorted[sorted.length - 1] : 0,
119
+ lowest: sorted.length > 0 ? sorted[0] : 0,
120
+ typical: sorted.length > 0 ? sorted[Math.floor((sorted.length - 1) / 2)] : 0,
121
+ latest: values.length > 0 ? values[values.length - 1] : undefined,
122
+ };
123
+ }
124
+ static isMatched(data) {
125
+ if (!data.filterType ||
126
+ data.threshold === undefined ||
127
+ TelemetryAlertRule_1.default.isAnomaly(data.filterType)) {
128
+ return false;
129
+ }
130
+ return TelemetryAlertRule_1.default.matches({
131
+ filterType: data.filterType,
132
+ threshold: data.threshold,
133
+ value: data.value,
134
+ });
135
+ }
136
+ /*
137
+ * A threshold that would have stayed quiet over the windows read: above
138
+ * the busiest window for a rule that fires on too many, below the
139
+ * quietest for one that fires on too few. Rounded to a number people
140
+ * write. None for an exact value or an anomaly, and none without data:
141
+ * windows that held nothing say nothing about a number, and offering 1
142
+ * for them read as advice to alert on the first log.
143
+ */
144
+ static suggestThreshold(data) {
145
+ if (data.points.length === 0) {
146
+ return undefined;
147
+ }
148
+ const summary = TelemetryRulePreviewUtil.summarize({
149
+ points: data.points,
150
+ filterType: undefined,
151
+ threshold: undefined,
152
+ });
153
+ if (!summary.hasData) {
154
+ return undefined;
155
+ }
156
+ switch (data.filterType) {
157
+ case CriteriaFilter_1.FilterType.GreaterThan:
158
+ return TelemetryRulePreviewUtil.roundUp(Math.max(summary.highest * 1.2, summary.typical * 3, 1));
159
+ case CriteriaFilter_1.FilterType.GreaterThanOrEqualTo:
160
+ return (TelemetryRulePreviewUtil.roundUp(Math.max(summary.highest * 1.2, summary.typical * 3, 1)) + 1);
161
+ case CriteriaFilter_1.FilterType.LessThan:
162
+ case CriteriaFilter_1.FilterType.LessThanOrEqualTo: {
163
+ if (summary.lowest <= 0) {
164
+ return undefined;
165
+ }
166
+ const below = Math.floor(summary.lowest / 2);
167
+ return data.filterType === CriteriaFilter_1.FilterType.LessThan
168
+ ? Math.max(1, below)
169
+ : Math.max(0, below);
170
+ }
171
+ default:
172
+ return undefined;
173
+ }
174
+ }
175
+ /*
176
+ * Up to a number with two significant digits at most: 27.6 is 28, 1480
177
+ * is 1500, 9.2 is 10.
178
+ */
179
+ static roundUp(value) {
180
+ if (!Number.isFinite(value) || value <= 0) {
181
+ return 0;
182
+ }
183
+ if (value <= 10) {
184
+ return Math.ceil(value);
185
+ }
186
+ const magnitude = Math.pow(10, Math.floor(Math.log10(value)) - 1);
187
+ return Math.ceil(value / magnitude) * magnitude;
188
+ }
189
+ }
190
+ exports.default = TelemetryRulePreviewUtil;
@@ -0,0 +1,6 @@
1
+ import commonJsModule from "./TelemetryRulePreview.js";
2
+ export default commonJsModule.default;
3
+ export const MAX_PREVIEW_RANGE_IN_SECONDS = commonJsModule.MAX_PREVIEW_RANGE_IN_SECONDS;
4
+ export const MAX_PREVIEW_WINDOW_IN_SECONDS = commonJsModule.MAX_PREVIEW_WINDOW_IN_SECONDS;
5
+ export const MIN_PREVIEW_WINDOW_IN_SECONDS = commonJsModule.MIN_PREVIEW_WINDOW_IN_SECONDS;
6
+ export const PREVIEW_WINDOW_COUNT = commonJsModule.PREVIEW_WINDOW_COUNT;
@@ -0,0 +1,23 @@
1
+ import { JSONObject } from "../JSON.mjs";
2
+ export declare const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY: string;
3
+ /**
4
+ * Whether a policy create asks for the two rules, read from its misc data.
5
+ *
6
+ * Only `true` (or the text "true") asks. Nothing sent, null or false asks
7
+ * nothing - an API caller, Terraform or an import gets the policy alone, as
8
+ * before. Anything else is refused rather than read as no: a caller who
9
+ * meant to page the policy must not get one that silently pages nobody.
10
+ */
11
+ export declare const readPageForEveryNewIncidentAndAlert: (miscDataProps: JSONObject | null | undefined) => boolean;
12
+ export declare const RULE_NAME_MAX_LENGTH: number;
13
+ export declare const getEveryNewIncidentRuleName: (policyName: string | undefined | null) => string;
14
+ export declare const getEveryNewAlertRuleName: (policyName: string | undefined | null) => string;
15
+ export declare const EVERY_NEW_INCIDENT_RULE_DESCRIPTION: string;
16
+ export declare const EVERY_NEW_ALERT_RULE_DESCRIPTION: string;
17
+ export interface EveryNewEventRulesOfferFacts {
18
+ policyCount: number | null;
19
+ incidentRuleCount: number | null;
20
+ alertRuleCount: number | null;
21
+ mayAddRules: boolean;
22
+ }
23
+ export declare const shouldOfferEveryNewEventRules: (facts: EveryNewEventRulesOfferFacts) => boolean;
@@ -0,0 +1,23 @@
1
+ import { JSONObject } from "../JSON";
2
+ export declare const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY: string;
3
+ /**
4
+ * Whether a policy create asks for the two rules, read from its misc data.
5
+ *
6
+ * Only `true` (or the text "true") asks. Nothing sent, null or false asks
7
+ * nothing - an API caller, Terraform or an import gets the policy alone, as
8
+ * before. Anything else is refused rather than read as no: a caller who
9
+ * meant to page the policy must not get one that silently pages nobody.
10
+ */
11
+ export declare const readPageForEveryNewIncidentAndAlert: (miscDataProps: JSONObject | null | undefined) => boolean;
12
+ export declare const RULE_NAME_MAX_LENGTH: number;
13
+ export declare const getEveryNewIncidentRuleName: (policyName: string | undefined | null) => string;
14
+ export declare const getEveryNewAlertRuleName: (policyName: string | undefined | null) => string;
15
+ export declare const EVERY_NEW_INCIDENT_RULE_DESCRIPTION: string;
16
+ export declare const EVERY_NEW_ALERT_RULE_DESCRIPTION: string;
17
+ export interface EveryNewEventRulesOfferFacts {
18
+ policyCount: number | null;
19
+ incidentRuleCount: number | null;
20
+ alertRuleCount: number | null;
21
+ mayAddRules: boolean;
22
+ }
23
+ export declare const shouldOfferEveryNewEventRules: (facts: EveryNewEventRulesOfferFacts) => boolean;
@@ -0,0 +1,105 @@
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.shouldOfferEveryNewEventRules = exports.EVERY_NEW_ALERT_RULE_DESCRIPTION = exports.EVERY_NEW_INCIDENT_RULE_DESCRIPTION = exports.getEveryNewAlertRuleName = exports.getEveryNewIncidentRuleName = exports.RULE_NAME_MAX_LENGTH = exports.readPageForEveryNewIncidentAndAlert = exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = void 0;
7
+ const ColumnLength_1 = __importDefault(require("../Database/ColumnLength"));
8
+ const BadDataException_1 = __importDefault(require("../Exception/BadDataException"));
9
+ /*
10
+ * A NEW PROJECT'S FIRST ON-CALL POLICY PAGES FOR EVERY INCIDENT AND ALERT.
11
+ *
12
+ * An on-call policy pages nobody until something runs it: an on-call rule
13
+ * under Incidents or Alerts > Rules > On-Call Rules, a monitor's criteria, a
14
+ * template, or someone by hand. Someone new followed the Home checklist's
15
+ * "Set up an on-call policy", picked themselves under "Who gets paged
16
+ * first?", saw the step ticked off - and was never paged, because no rule
17
+ * named the policy. Paging it for every incident took a second trip, to a
18
+ * folded Rules section of another product.
19
+ *
20
+ * Create On-Call Policy now offers, while the project has no on-call policy
21
+ * and no on-call rule yet, "Page this policy for every new incident and
22
+ * alert" - on to start with. The choice travels with the create as misc
23
+ * data under PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY, and the server, once
24
+ * the policy exists, adds two on-call rules naming it: one for incidents,
25
+ * one for alerts, each matching everything (OnCallDutyPolicyService.create).
26
+ * They are ordinary rules, listed and changed where every on-call rule is.
27
+ *
28
+ * React-free and server-safe: the server, the dashboard and their tests
29
+ * read it.
30
+ */
31
+ exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = "pageForEveryNewIncidentAndAlert";
32
+ /**
33
+ * Whether a policy create asks for the two rules, read from its misc data.
34
+ *
35
+ * Only `true` (or the text "true") asks. Nothing sent, null or false asks
36
+ * nothing - an API caller, Terraform or an import gets the policy alone, as
37
+ * before. Anything else is refused rather than read as no: a caller who
38
+ * meant to page the policy must not get one that silently pages nobody.
39
+ */
40
+ const readPageForEveryNewIncidentAndAlert = (miscDataProps) => {
41
+ if (!miscDataProps ||
42
+ typeof miscDataProps !== "object" ||
43
+ Array.isArray(miscDataProps)) {
44
+ return false;
45
+ }
46
+ const value = miscDataProps[exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY];
47
+ if (value === undefined || value === null || value === false) {
48
+ return false;
49
+ }
50
+ if (value === true) {
51
+ return true;
52
+ }
53
+ if (typeof value === "string") {
54
+ const text = value.trim().toLowerCase();
55
+ if (text === "true") {
56
+ return true;
57
+ }
58
+ if (text === "false" || text === "") {
59
+ return false;
60
+ }
61
+ }
62
+ throw new BadDataException_1.default(`${exports.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY} must be true or false.`);
63
+ };
64
+ exports.readPageForEveryNewIncidentAndAlert = readPageForEveryNewIncidentAndAlert;
65
+ // What the two rules are called, and the longest name a rule column holds.
66
+ exports.RULE_NAME_MAX_LENGTH = ColumnLength_1.default.ShortText;
67
+ const ELLIPSIS = "…";
68
+ const WHITESPACE_RUN = /\s+/g;
69
+ /*
70
+ * "Page <policy> for every <what>", cut to fit a rule's name column: the
71
+ * policy's name gives way, ending in "…", so the words around it stay
72
+ * whole. A policy with no name is "the new on-call policy".
73
+ */
74
+ const getRuleName = (policyName, what) => {
75
+ const prefix = "Page ";
76
+ const suffix = ` for every ${what}`;
77
+ const name = (policyName || "").replace(WHITESPACE_RUN, " ").trim() ||
78
+ "the new on-call policy";
79
+ const room = exports.RULE_NAME_MAX_LENGTH - prefix.length - suffix.length;
80
+ const shown = Array.from(name).length <= room
81
+ ? name
82
+ : `${Array.from(name)
83
+ .slice(0, room - ELLIPSIS.length)
84
+ .join("")
85
+ .trimEnd()}${ELLIPSIS}`;
86
+ return `${prefix}${shown}${suffix}`;
87
+ };
88
+ const getEveryNewIncidentRuleName = (policyName) => {
89
+ return getRuleName(policyName, "incident");
90
+ };
91
+ exports.getEveryNewIncidentRuleName = getEveryNewIncidentRuleName;
92
+ const getEveryNewAlertRuleName = (policyName) => {
93
+ return getRuleName(policyName, "alert");
94
+ };
95
+ exports.getEveryNewAlertRuleName = getEveryNewAlertRuleName;
96
+ // Each rule's description: what it does, and where it came from.
97
+ exports.EVERY_NEW_INCIDENT_RULE_DESCRIPTION = "Pages this on-call policy for every new incident. Added when the policy was created.";
98
+ exports.EVERY_NEW_ALERT_RULE_DESCRIPTION = "Pages this on-call policy for every new alert. Added when the policy was created.";
99
+ const shouldOfferEveryNewEventRules = (facts) => {
100
+ return (facts.mayAddRules &&
101
+ facts.policyCount === 0 &&
102
+ facts.incidentRuleCount === 0 &&
103
+ facts.alertRuleCount === 0);
104
+ };
105
+ exports.shouldOfferEveryNewEventRules = shouldOfferEveryNewEventRules;
@@ -0,0 +1,9 @@
1
+ import commonJsModule from "./EveryNewEventRules.js";
2
+ export const EVERY_NEW_ALERT_RULE_DESCRIPTION = commonJsModule.EVERY_NEW_ALERT_RULE_DESCRIPTION;
3
+ export const EVERY_NEW_INCIDENT_RULE_DESCRIPTION = commonJsModule.EVERY_NEW_INCIDENT_RULE_DESCRIPTION;
4
+ export const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY = commonJsModule.PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY;
5
+ export const RULE_NAME_MAX_LENGTH = commonJsModule.RULE_NAME_MAX_LENGTH;
6
+ export const getEveryNewAlertRuleName = commonJsModule.getEveryNewAlertRuleName;
7
+ export const getEveryNewIncidentRuleName = commonJsModule.getEveryNewIncidentRuleName;
8
+ export const readPageForEveryNewIncidentAndAlert = commonJsModule.readPageForEveryNewIncidentAndAlert;
9
+ export const shouldOfferEveryNewEventRules = commonJsModule.shouldOfferEveryNewEventRules;
@@ -1,11 +1,14 @@
1
1
  export declare const ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START: string;
2
2
  export declare const ON_CALL_POLICY_RUN_WAITING_MESSAGE_START: string;
3
+ export declare const ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START: string;
3
4
  export declare function getOnCallPolicyRunWaitingMessage(data: {
4
5
  pagingStartsAt: Date;
5
6
  timezone?: string | undefined;
6
7
  now: Date;
7
8
  isWaitingForWorkingHours: boolean;
9
+ isWaitingForOneUptimeAI?: boolean | undefined;
8
10
  }): string;
11
+ export declare function isOnCallPolicyRunWaitingForOneUptimeAI(statusMessage: string | null | undefined): boolean;
9
12
  export declare function isOnCallPolicyRunWaitingForWorkingHours(statusMessage: string | null | undefined): boolean;
10
13
  export declare const ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH: number;
11
14
  export declare function getOnCallPolicyRunStartedEarlyReason(data: {
@@ -1,11 +1,14 @@
1
1
  export declare const ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START: string;
2
2
  export declare const ON_CALL_POLICY_RUN_WAITING_MESSAGE_START: string;
3
+ export declare const ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START: string;
3
4
  export declare function getOnCallPolicyRunWaitingMessage(data: {
4
5
  pagingStartsAt: Date;
5
6
  timezone?: string | undefined;
6
7
  now: Date;
7
8
  isWaitingForWorkingHours: boolean;
9
+ isWaitingForOneUptimeAI?: boolean | undefined;
8
10
  }): string;
11
+ export declare function isOnCallPolicyRunWaitingForOneUptimeAI(statusMessage: string | null | undefined): boolean;
9
12
  export declare function isOnCallPolicyRunWaitingForWorkingHours(statusMessage: string | null | undefined): boolean;
10
13
  export declare const ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH: number;
11
14
  export declare function getOnCallPolicyRunStartedEarlyReason(data: {
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ON_CALL_POLICY_RUN_ENDED_WHILE_WAITING_MESSAGE_START = exports.ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH = exports.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START = exports.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START = void 0;
6
+ exports.ON_CALL_POLICY_RUN_ENDED_WHILE_WAITING_MESSAGE_START = exports.ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH = exports.ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START = exports.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START = exports.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START = void 0;
7
7
  exports.getOnCallPolicyRunWaitingMessage = getOnCallPolicyRunWaitingMessage;
8
+ exports.isOnCallPolicyRunWaitingForOneUptimeAI = isOnCallPolicyRunWaitingForOneUptimeAI;
8
9
  exports.isOnCallPolicyRunWaitingForWorkingHours = isOnCallPolicyRunWaitingForWorkingHours;
9
10
  exports.getOnCallPolicyRunStartedEarlyReason = getOnCallPolicyRunStartedEarlyReason;
10
11
  exports.getOnCallPolicyRunEndedWhileWaitingMessage = getOnCallPolicyRunEndedWhileWaitingMessage;
@@ -19,8 +20,9 @@ const WorkingHours_1 = __importDefault(require("./WorkingHours"));
19
20
  * is started at its first escalation rule when that moment comes
20
21
  * (OnCallDutyPolicyExecutionLog:ExecutePendingExecutions). An on-call rule
21
22
  * that pages only during working hours holds the runs it starts outside them
22
- * (OnCallRuleWhenToPage); OnCallDutyPolicyService.executePolicy holds a run
23
- * for any caller that names the moment.
23
+ * (OnCallRuleWhenToPage), one set to After OneUptime AI holds them while AI
24
+ * works (OnCallPolicyAiHold), and OnCallDutyPolicyService.executePolicy
25
+ * holds a run for any caller that names the moment.
24
26
  *
25
27
  * Acknowledged or resolved while it waits, the record needs nobody paged: the
26
28
  * run ends there, paging nobody. An archived policy pages no one: its run
@@ -36,15 +38,28 @@ const WorkingHours_1 = __importDefault(require("./WorkingHours"));
36
38
  exports.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START = "Waiting for working hours. ";
37
39
  // A run that waits for any other reason: "Waiting. Paging starts Wed 09:00 (UTC)."
38
40
  exports.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START = "Waiting. ";
41
+ /*
42
+ * A run OneUptime AI holds while it works (OnCallPolicyAiHold): "Waiting for
43
+ * OneUptime AI. Paging starts 02:10 (UTC) unless it resolves this."
44
+ */
45
+ exports.ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START = "Waiting for OneUptime AI. ";
39
46
  function getOnCallPolicyRunWaitingMessage(data) {
40
- const start = data.isWaitingForWorkingHours
41
- ? exports.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START
42
- : exports.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START;
43
- return `${start}Paging starts ${WorkingHours_1.default.describeMoment({
47
+ const moment = WorkingHours_1.default.describeMoment({
44
48
  at: data.pagingStartsAt,
45
49
  timezone: data.timezone,
46
50
  now: data.now,
47
- })}.`;
51
+ });
52
+ if (data.isWaitingForOneUptimeAI) {
53
+ return `${exports.ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START}Paging starts ${moment} unless it resolves this.`;
54
+ }
55
+ const start = data.isWaitingForWorkingHours
56
+ ? exports.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START
57
+ : exports.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START;
58
+ return `${start}Paging starts ${moment}.`;
59
+ }
60
+ // Whether a waiting run's message says OneUptime AI holds it.
61
+ function isOnCallPolicyRunWaitingForOneUptimeAI(statusMessage) {
62
+ return (statusMessage || "").startsWith(exports.ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START);
48
63
  }
49
64
  // Whether a waiting run's message says it waits for working hours.
50
65
  function isOnCallPolicyRunWaitingForWorkingHours(statusMessage) {
@@ -1,10 +1,12 @@
1
1
  import commonJsModule from "./OnCallDutyPolicyRunWait.js";
2
2
  export const ON_CALL_POLICY_RUN_ENDED_WHILE_WAITING_MESSAGE_START = commonJsModule.ON_CALL_POLICY_RUN_ENDED_WHILE_WAITING_MESSAGE_START;
3
3
  export const ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH = commonJsModule.ON_CALL_POLICY_RUN_STARTED_EARLY_REASON_MAX_LENGTH;
4
+ export const ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START = commonJsModule.ON_CALL_POLICY_RUN_WAITING_FOR_ONEUPTIME_AI_MESSAGE_START;
4
5
  export const ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START = commonJsModule.ON_CALL_POLICY_RUN_WAITING_FOR_WORKING_HOURS_MESSAGE_START;
5
6
  export const ON_CALL_POLICY_RUN_WAITING_MESSAGE_START = commonJsModule.ON_CALL_POLICY_RUN_WAITING_MESSAGE_START;
6
7
  export const getOnCallPolicyRunEndedWhileWaitingMessage = commonJsModule.getOnCallPolicyRunEndedWhileWaitingMessage;
7
8
  export const getOnCallPolicyRunStartedEarlyReason = commonJsModule.getOnCallPolicyRunStartedEarlyReason;
8
9
  export const getOnCallPolicyRunWaitingMessage = commonJsModule.getOnCallPolicyRunWaitingMessage;
9
10
  export const isOnCallPolicyRunEndedWhileWaiting = commonJsModule.isOnCallPolicyRunEndedWhileWaiting;
11
+ export const isOnCallPolicyRunWaitingForOneUptimeAI = commonJsModule.isOnCallPolicyRunWaitingForOneUptimeAI;
10
12
  export const isOnCallPolicyRunWaitingForWorkingHours = commonJsModule.isOnCallPolicyRunWaitingForWorkingHours;
@@ -0,0 +1,47 @@
1
+ export declare enum OnCallPolicyAiHoldOutcome {
2
+ Holding = "Holding",
3
+ ResolvedByAI = "Resolved by AI",
4
+ RecoveredOnItsOwn = "Recovered on its own",
5
+ HandledByPerson = "Handled by a person",
6
+ HandedOff = "Handed off",
7
+ HoldTimeRanOut = "Hold time ran out",
8
+ PageNowPressed = "Page now pressed"
9
+ }
10
+ export declare const AI_HOLD_TIME_DEFAULT_IN_MINUTES: number;
11
+ export declare const AI_HOLD_TIME_MIN_IN_MINUTES: number;
12
+ export declare const AI_HOLD_TIME_MAX_IN_MINUTES: number;
13
+ export declare function getAiHoldTimeInMinutes(aiHoldTimeInMinutes: number | null | undefined): number;
14
+ export declare const AI_HOLD_OUTAGE_RECORD_COUNT: number;
15
+ export declare const AI_HOLD_OUTAGE_WINDOW_IN_MINUTES: number;
16
+ export declare const AI_HOLD_RECURRENCE_WINDOW_IN_HOURS: number;
17
+ export type AiHoldRecordKind = "alert" | "incident";
18
+ export declare const AiHoldHandOffReason: {
19
+ investigationSkipped: (data: {
20
+ recordKind: AiHoldRecordKind;
21
+ why: string;
22
+ }) => string;
23
+ investigationWaits: (data: {
24
+ waitMinutes: number;
25
+ }) => string;
26
+ noFixToRun: () => string;
27
+ fixNeedsApproval: () => string;
28
+ fixDidNotHold: () => string;
29
+ noMonitorToCheck: () => string;
30
+ pageNow: (data: {
31
+ userName?: string | undefined;
32
+ }) => string;
33
+ aiTurnedOff: () => string;
34
+ automaticFixingTurnedOff: (data: {
35
+ recordKind: AiHoldRecordKind;
36
+ }) => string;
37
+ ruleChanged: () => string;
38
+ outage: (data: {
39
+ recordCount: number;
40
+ windowMinutes: number;
41
+ }) => string;
42
+ highestSeverity: (data: {
43
+ recordKind: AiHoldRecordKind;
44
+ }) => string;
45
+ };
46
+ export declare function isAiHoldOver(outcome: OnCallPolicyAiHoldOutcome | string | null | undefined): boolean;
47
+ export declare function isAiHoldPaged(outcome: OnCallPolicyAiHoldOutcome | string | null | undefined): boolean;